00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "dynamicVertices.h"
00020 #include "config_char.h"
00021 #include <bamReader.h>
00022 #include <bamWriter.h>
00023 #include <datagram.h>
00024 #include <datagramIterator.h>
00025 #include <ioPtaDatagramLinMath.h>
00026
00027 TypeHandle DynamicVertices::_type_handle;
00028
00029
00030
00031
00032
00033
00034 DynamicVertices::
00035 DynamicVertices() {
00036 }
00037
00038
00039
00040
00041
00042
00043
00044
00045 DynamicVertices::
00046 DynamicVertices(const DynamicVertices ©) :
00047 _coords(copy._coords),
00048 _norms(copy._norms),
00049 _colors(copy._colors),
00050 _texcoords(copy._texcoords)
00051 {
00052 }
00053
00054
00055
00056
00057
00058
00059
00060
00061 DynamicVertices DynamicVertices::
00062 deep_copy(const DynamicVertices ©) {
00063 DynamicVertices dv;
00064 if (!copy._coords.empty()) {
00065 dv._coords = PTA_Vertexf::empty_array(0);
00066 dv._coords.v() = copy._coords.v();
00067 }
00068 if (!copy._norms.empty()) {
00069 dv._norms = PTA_Normalf::empty_array(0);
00070 dv._norms.v() = copy._norms.v();
00071 }
00072 if (!copy._colors.empty()) {
00073 dv._colors = PTA_Colorf::empty_array(0);
00074 dv._colors.v() = copy._colors.v();
00075 }
00076 if (!copy._texcoords.empty()) {
00077 dv._texcoords = PTA_TexCoordf::empty_array(0);
00078 dv._texcoords.v() = copy._texcoords.v();
00079 }
00080 return dv;
00081 }
00082
00083
00084
00085
00086
00087
00088
00089 void DynamicVertices::
00090 write_datagram(BamWriter *manager, Datagram &me)
00091 {
00092 WRITE_PTA(manager, me, IPD_Vertexf::write_datagram, _coords)
00093 WRITE_PTA(manager, me, IPD_Normalf::write_datagram, _norms)
00094 WRITE_PTA(manager, me, IPD_Colorf::write_datagram, _colors)
00095 WRITE_PTA(manager, me, IPD_TexCoordf::write_datagram, _texcoords)
00096 }
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106 void DynamicVertices::
00107 fillin(DatagramIterator& scan, BamReader* manager)
00108 {
00109 READ_PTA(manager, scan, IPD_Vertexf::read_datagram, _coords)
00110 READ_PTA(manager, scan, IPD_Normalf::read_datagram, _norms)
00111 READ_PTA(manager, scan, IPD_Colorf::read_datagram, _colors)
00112 READ_PTA(manager, scan, IPD_TexCoordf::read_datagram, _texcoords)
00113 }