21 #ifndef __O_PRC_FILE_H
22 #define __O_PRC_FILE_H
39 #include "PRCbitStream.h"
47 RGBAColour(
double r=0.0,
double g=0.0,
double b=0.0,
double a=1.0) :
48 R(r), G(g), B(b), A(a) {}
51 void Set(
double r,
double g,
double b,
double a=1.0)
53 R = r; G = g; B = b; A = a;
57 return (R==c.R && G==c.G && B==c.B && A==c.A);
61 return !(R==c.R && G==c.G && B==c.B && A==c.A);
74 {
return RGBAColour(a.R*d,a.G*d,a.B*d,a.A*d); }
76 {
return RGBAColour(a.R*d,a.G*d,a.B*d,a.A*d); }
79 typedef std::map<RGBAColour,uint32_t> PRCcolourMap;
83 RGBAColourWidth(
double r=0.0,
double g=0.0,
double b=0.0,
double a=1.0,
double w=1.0) :
84 R(r), G(g), B(b), A(a), W(w) {}
89 return (R==c.R && G==c.G && B==c.B && A==c.A && W==c.W);
93 return !(R==c.R && G==c.G && B==c.B && A==c.A && W==c.W);
108 typedef std::map<RGBAColourWidth,uint32_t> PRCcolourwidthMap;
110 typedef std::map<PRCRgbColor,uint32_t> PRCcolorMap;
115 picture_data(NULL), picture_format(KEPRCPicture_BITMAP_RGB_BYTE), picture_width(0), picture_height(0), picture_size(0),
116 picture_replace(
false), picture_repeat(
false) {}
119 const uint8_t* pic=NULL, EPRCPictureDataFormat picf=KEPRCPicture_BITMAP_RGB_BYTE,
120 uint32_t picw=0, uint32_t pich=0, uint32_t pics=0,
bool picreplace=
false,
bool picrepeat=
false) :
121 ambient(a), diffuse(d), emissive(e), specular(s), alpha(p), shininess(h),
122 picture_data(pic), picture_format(picf), picture_width(picw), picture_height(pich), picture_size(pics),
123 picture_replace(picreplace), picture_repeat(picrepeat) {
126 if (picture_format==KEPRCPicture_BITMAP_RGB_BYTE)
127 picture_size = picture_width*picture_height*3;
128 if (picture_format==KEPRCPicture_BITMAP_RGBA_BYTE)
129 picture_size = picture_width*picture_height*4;
130 if (picture_format==KEPRCPicture_BITMAP_GREY_BYTE)
131 picture_size = picture_width*picture_height*1;
132 if (picture_format==KEPRCPicture_BITMAP_GREYA_BYTE)
133 picture_size = picture_width*picture_height*2;
137 double alpha,shininess;
138 const uint8_t* picture_data;
139 EPRCPictureDataFormat picture_format;
140 uint32_t picture_width;
141 uint32_t picture_height;
142 uint32_t picture_size;
143 bool picture_replace;
148 return (ambient==m.ambient && diffuse==m.diffuse && emissive==m.emissive
149 && specular==m.specular && alpha==m.alpha && shininess==m.shininess
150 && picture_replace==m.picture_replace && picture_repeat==m.picture_repeat
151 && picture_format==m.picture_format
152 && picture_width==m.picture_width && picture_height==m.picture_height && picture_size==m.picture_size
153 && (picture_data==m.picture_data || memcmp(picture_data,m.picture_data,picture_size)==0) );
157 if(ambient!=m.ambient)
158 return (ambient<m.ambient);
159 if(diffuse!=m.diffuse)
160 return (diffuse<m.diffuse);
161 if(emissive!=m.emissive)
162 return (emissive<m.emissive);
163 if(specular!=m.specular)
164 return (specular<m.specular);
166 return (alpha<m.alpha);
167 if(shininess!=m.shininess)
168 return (shininess<m.shininess);
169 if(picture_replace!=m.picture_replace)
170 return (picture_replace<m.picture_replace);
171 if(picture_repeat!=m.picture_repeat)
172 return (picture_repeat<m.picture_repeat);
173 if(picture_format!=m.picture_format)
174 return (picture_format<m.picture_format);
175 if(picture_width!=m.picture_width)
176 return (picture_width<m.picture_width);
177 if(picture_height!=m.picture_height)
178 return (picture_height<m.picture_height);
179 if(picture_size!=m.picture_size)
180 return (picture_size<m.picture_size);
181 if(picture_data!=m.picture_data)
182 return (memcmp(picture_data,m.picture_data,picture_size)<0);
186 typedef std::map<PRCmaterial,uint32_t> PRCmaterialMap;
191 data(NULL), format(KEPRCPicture_BITMAP_RGB_BYTE),
192 width(0), height(0), size(0) {}
193 PRCpicture(
const uint8_t* pic, EPRCPictureDataFormat picf,
194 uint32_t picw, uint32_t pich, uint32_t pics=0) :
195 data(pic), format(picf),
196 width(picw), height(pich), size(pics)
200 if (format==KEPRCPicture_BITMAP_RGB_BYTE)
201 size = width*height*3;
202 if (format==KEPRCPicture_BITMAP_RGBA_BYTE)
203 size = width*height*4;
204 if (format==KEPRCPicture_BITMAP_GREY_BYTE)
205 size = width*height*1;
206 if (format==KEPRCPicture_BITMAP_GREYA_BYTE)
207 size = width*height*2;
211 data(m.picture_data), format(m.picture_format),
212 width(m.picture_width), height(m.picture_height), size(m.picture_size) {}
215 EPRCPictureDataFormat format;
221 return ( format==p.format
222 && width==p.width && height==p.height && size==p.size
223 && (data==p.data || memcmp(data,p.data,size)==0) );
228 return (format<p.format);
230 return (width<p.width);
232 return (height<p.height);
234 return (size<p.size);
236 return (memcmp(data,p.data,size)<0);
241 typedef std::map<PRCpicture,uint32_t> PRCpictureMap;
248 ambient(a), diffuse(d), emissive(e), specular(s), alpha(p), shininess(h) {}
250 ambient(m.ambient), diffuse(m.diffuse), emissive(m.emissive), specular(m.specular), alpha(m.alpha), shininess(m.shininess) {}
252 double alpha,shininess;
256 return (ambient==m.ambient && diffuse==m.diffuse && emissive==m.emissive
257 && specular==m.specular && alpha==m.alpha && shininess==m.shininess);
261 if(ambient!=m.ambient)
262 return (ambient<m.ambient);
263 if(diffuse!=m.diffuse)
264 return (diffuse<m.diffuse);
265 if(emissive!=m.emissive)
266 return (emissive<m.emissive);
267 if(specular!=m.specular)
268 return (specular<m.specular);
270 return (alpha<m.alpha);
271 if(shininess!=m.shininess)
272 return (shininess<m.shininess);
276 typedef std::map<PRCmaterialgeneric,uint32_t> PRCmaterialgenericMap;
281 picture_index(m1), picture_replace(
false), picture_repeat(
false) {}
283 picture_index(picindex), picture_replace(picreplace), picture_repeat(picrepeat) {}
285 picture_index(picindex), picture_replace(m.picture_replace), picture_repeat(m.picture_repeat) {}
286 uint32_t picture_index;
287 bool picture_replace;
292 return (picture_index==t.picture_index
293 && picture_replace==t.picture_replace && picture_repeat==t.picture_repeat);
297 if(picture_index!=t.picture_index)
298 return (picture_index<t.picture_index);
299 if(picture_replace!=t.picture_replace)
300 return (picture_replace<t.picture_replace);
301 if(picture_repeat!=t.picture_repeat)
302 return (picture_repeat<t.picture_repeat);
306 typedef std::map<PRCtexturedefinition,uint32_t> PRCtexturedefinitionMap;
311 material_generic_index(m1), texture_definition_index(m1) {}
313 material_generic_index(matindex), texture_definition_index(texindex) {}
314 uint32_t material_generic_index;
315 uint32_t texture_definition_index;
319 return (material_generic_index==t.material_generic_index
320 && texture_definition_index==t.texture_definition_index);
324 if(material_generic_index!=t.material_generic_index)
325 return (material_generic_index<t.material_generic_index);
326 if(texture_definition_index!=t.texture_definition_index)
327 return (texture_definition_index<t.texture_definition_index);
331 typedef std::map<PRCtextureapplication,uint32_t> PRCtextureapplicationMap;
336 line_width(0), alpha(1), is_material(
false), color_material_index(m1) {}
337 PRCstyle(
double linewidth,
double alph,
bool ismat, uint32_t colindex=m1) :
338 line_width(linewidth), alpha(alph), is_material(ismat), color_material_index(colindex) {}
342 uint32_t color_material_index;
344 bool operator==(
const PRCstyle& s)
const
346 return (line_width==s.line_width && alpha==s.alpha && is_material==s.is_material
347 && color_material_index==s.color_material_index);
349 bool operator<(
const PRCstyle& s)
const
351 if(line_width!=s.line_width)
352 return (line_width<s.line_width);
354 return (alpha<s.alpha);
355 if(is_material!=s.is_material)
356 return (is_material<s.is_material);
357 if(color_material_index!=s.color_material_index)
358 return (color_material_index<s.color_material_index);
362 typedef std::map<PRCstyle,uint32_t> PRCstyleMap;
369 typedef std::vector<PRCtessrectangle> PRCtessrectangleList;
376 typedef std::vector<PRCtessquad> PRCtessquadList;
392 std::vector<PRCVector3d> point;
395 typedef std::list<PRCtessline> PRCtesslineList;
396 typedef std::map<double, PRCtesslineList> PRCtesslineMap;
400 PRCface() : transform(NULL), face(NULL) {}
406 typedef std::vector <PRCface> PRCfaceList;
415 typedef std::vector <PRCcompface> PRCcompfaceList;
419 PRCwire() : style(m1), transform(NULL), curve(NULL) {}
424 typedef std::vector <PRCwire> PRCwireList;
426 typedef std::map <uint32_t,std::vector<PRCVector3d> > PRCpointsetMap;
440 PRCoptions(
double compression=0.0,
double granularity=0.0,
bool closed=
false,
441 bool tess=
false,
bool do_break=
true,
bool no_break=
false,
double crease_angle=25.8419)
442 : compression(compression), granularity(granularity), closed(closed),
443 tess(tess), do_break(do_break), no_break(no_break), crease_angle(crease_angle) {}
450 product_occurrence(NULL), parent_product_occurrence(NULL), part_definition(NULL), parent_part_definition(NULL), transform(NULL) {}
452 product_occurrence(NULL), parent_product_occurrence(NULL), part_definition(NULL), parent_part_definition(NULL), transform(NULL), name(name) {}
456 PRCcompfaceList compfaces;
457 PRCtessrectangleList rectangles;
459 PRCtessquadList quads;
460 PRCtesslineMap lines;
462 PRCpointsetMap points;
463 std::vector<PRCPointSet*> pointsets;
464 std::vector<PRCPolyBrepModel*> polymodels;
465 std::vector<PRCPolyWire*> polywires;
483 void write(std::ostream&)
const;
485 uint32_t getSize()
const;
487 typedef std::deque <PRCUncompressedFile*> PRCUncompressedFileList;
492 uint32_t minimal_version_for_read;
493 uint32_t authoring_version;
498 minimal_version_for_read(PRCVersion), authoring_version(PRCVersion) {}
499 void serializeStartHeader(std::ostream&)
const;
501 uint32_t getStartHeaderSize()
const;
507 uint32_t number_of_referenced_file_structures;
508 double tessellation_chord_height_ratio;
509 double tessellation_angle_degree;
510 std::string default_font_family_name;
511 std::vector<PRCRgbColor> colors;
512 std::vector<PRCPicture> pictures;
513 PRCUncompressedFileList uncompressed_files;
514 PRCTextureDefinitionList texture_definitions;
515 PRCMaterialList materials;
517 PRCCoordinateSystemList reference_coordinate_systems;
518 std::vector<PRCFontKeysSameFont> font_keys_of_font;
519 PRCPartDefinitionList part_definitions;
520 PRCProductOccurrenceList product_occurrences;
524 PRCTopoContextList contexts;
525 PRCTessList tessellations;
528 uint8_t *globals_data;
532 uint8_t *tessellations_data;
534 uint8_t *geometry_data;
536 uint8_t *extraGeometry_data;
540 for(PRCUncompressedFileList::iterator it=uncompressed_files.begin(); it!=uncompressed_files.end(); ++it)
delete *it;
541 for(PRCTextureDefinitionList::iterator it=texture_definitions.begin(); it!=texture_definitions.end(); ++it)
delete *it;
542 for(PRCMaterialList::iterator it=materials.begin(); it!=materials.end(); ++it)
delete *it;
543 for(PRCStyleList::iterator it=styles.begin(); it!=styles.end(); ++it)
delete *it;
544 for(PRCTopoContextList::iterator it=contexts.begin(); it!=contexts.end(); ++it)
delete *it;
545 for(PRCTessList::iterator it=tessellations.begin(); it!=tessellations.end(); ++it)
delete *it;
546 for(PRCPartDefinitionList::iterator it=part_definitions.begin(); it!=part_definitions.end(); ++it)
delete *it;
547 for(PRCProductOccurrenceList::iterator it=product_occurrences.begin(); it!=product_occurrences.end(); ++it)
delete *it;
548 for(PRCCoordinateSystemList::iterator it=reference_coordinate_systems.begin(); it!=reference_coordinate_systems.end(); it++)
553 free(tessellations_data);
555 free(extraGeometry_data);
559 number_of_referenced_file_structures(0),
560 tessellation_chord_height_ratio(2000.0),tessellation_angle_degree(40.0),
561 default_font_family_name(
""),
563 globals_data(NULL),globals_out(globals_data,0),
564 tree_data(NULL),tree_out(tree_data,0),
565 tessellations_data(NULL),tessellations_out(tessellations_data,0),
566 geometry_data(NULL),geometry_out(geometry_data,0),
567 extraGeometry_data(NULL),extraGeometry_out(extraGeometry_data,0) {}
568 void write(std::ostream&);
575 void serializeFileStructureExtraGeometry(
PRCbitStream&);
576 uint32_t addPicture(EPRCPictureDataFormat format, uint32_t size,
const uint8_t *picture, uint32_t width=0, uint32_t height=0, std::string name=
"");
579 uint32_t addRgbColorUnique(
const PRCRgbColor &color);
582 uint32_t addStyle(
PRCStyle*& pStyle);
603 uint32_t number_of_offsets;
606 void write(std::ostream&);
614 uint32_t number_of_file_structures;
616 uint32_t model_file_offset;
618 PRCUncompressedFileList uncompressed_files;
620 void write(std::ostream&);
624 typedef std::map <PRCGeneralTransformation3d,uint32_t> PRCtransformMap;
629 oPRCFile(std::ostream &os,
double u=1, uint32_t n=1) :
630 number_of_file_structures(n),
633 modelFile_data(NULL),modelFile_out(modelFile_data,0),
634 fout(NULL),output(os)
636 for(uint32_t i = 0; i < number_of_file_structures; ++i)
639 fileStructures[i]->minimal_version_for_read = PRCVersion;
640 fileStructures[i]->authoring_version = PRCVersion;
641 makeFileUUID(fileStructures[i]->file_structure_uuid);
642 makeAppUUID(fileStructures[i]->application_uuid);
643 fileStructures[i]->unit = u;
649 group.transform = NULL;
651 group.parent_product_occurrence = NULL;
653 group.parent_part_definition = NULL;
656 oPRCFile(
const std::string &name,
double u=1, uint32_t n=1) :
657 number_of_file_structures(n),
660 modelFile_data(NULL),modelFile_out(modelFile_data,0),
661 fout(
new std::ofstream(name.c_str(),
662 std::ios::out|std::ios::binary|std::ios::trunc)),
665 for(uint32_t i = 0; i < number_of_file_structures; ++i)
668 fileStructures[i]->minimal_version_for_read = PRCVersion;
669 fileStructures[i]->authoring_version = PRCVersion;
670 makeFileUUID(fileStructures[i]->file_structure_uuid);
671 makeAppUUID(fileStructures[i]->application_uuid);
672 fileStructures[i]->unit = u;
678 group.transform = NULL;
680 group.parent_product_occurrence = NULL;
682 group.parent_part_definition = NULL;
687 for(uint32_t i = 0; i < number_of_file_structures; ++i)
688 delete fileStructures[i];
689 delete[] fileStructures;
692 free(modelFile_data);
693 for(PRCpictureMap::iterator it=pictureMap.begin(); it!=pictureMap.end(); ++it)
delete it->first.data;
696 void begingroup(
const char *name,
PRCoptions *options=NULL,
697 const double* t=NULL);
700 std::string lastgroupname;
701 std::vector<std::string> lastgroupnames;
707 const uint32_t number_of_file_structures;
711 uint8_t *modelFile_data;
713 PRCcolorMap colorMap;
714 PRCcolourMap colourMap;
715 PRCcolourwidthMap colourwidthMap;
716 PRCmaterialgenericMap materialgenericMap;
717 PRCtexturedefinitionMap texturedefinitionMap;
718 PRCtextureapplicationMap textureapplicationMap;
719 PRCstyleMap styleMap;
720 PRCpictureMap pictureMap;
722 PRCtransformMap transformMap;
723 std::stack<PRCgroup> groups;
728 uint32_t addColourWidth(
const RGBAColour &colour,
double width);
729 uint32_t addLineMaterial(
const RGBAColour& c,
double width)
730 {
return addColourWidth(c,width); }
733 uint32_t addTransform(
const double* t);
734 uint32_t addTransform(
const double origin[3],
const double x_axis[3],
const double y_axis[3],
double scale);
735 void addPoint(
const double P[3],
const RGBAColour &c,
double w=1.0);
736 void addPoints(uint32_t n,
const double P[][3],
const RGBAColour &c,
double w=1.0);
737 void addLines(uint32_t nP,
const double P[][3], uint32_t nI,
const uint32_t PI[],
739 bool segment_color, uint32_t nC,
const RGBAColour C[], uint32_t nCI,
const uint32_t CI[]);
740 uint32_t createLines(uint32_t nP,
const double P[][3], uint32_t nI,
const uint32_t PI[],
741 bool segment_color, uint32_t nC,
const RGBAColour C[], uint32_t nCI,
const uint32_t CI[]);
742 void addTriangles(uint32_t nP,
const double P[][3], uint32_t nI,
const uint32_t PI[][3],
const PRCmaterial &m,
743 uint32_t nN,
const double N[][3],
const uint32_t NI[][3],
744 uint32_t nT,
const double T[][2],
const uint32_t TI[][3],
745 uint32_t nC,
const RGBAColour C[],
const uint32_t CI[][3],
746 uint32_t nM,
const PRCmaterial M[],
const uint32_t MI[],
double ca);
747 uint32_t createTriangleMesh(uint32_t nP,
const double P[][3], uint32_t nI,
const uint32_t PI[][3], uint32_t style_index,
748 uint32_t nN,
const double N[][3],
const uint32_t NI[][3],
749 uint32_t nT,
const double T[][2],
const uint32_t TI[][3],
750 uint32_t nC,
const RGBAColour C[],
const uint32_t CI[][3],
751 uint32_t nS,
const uint32_t S[],
const uint32_t SI[],
double ca);
752 uint32_t createTriangleMesh(uint32_t nP,
const double P[][3], uint32_t nI,
const uint32_t PI[][3],
const PRCmaterial& m,
753 uint32_t nN,
const double N[][3],
const uint32_t NI[][3],
754 uint32_t nT,
const double T[][2],
const uint32_t TI[][3],
755 uint32_t nC,
const RGBAColour C[],
const uint32_t CI[][3],
756 uint32_t nM,
const PRCmaterial M[],
const uint32_t MI[],
double ca)
758 const uint32_t style = addMaterial(m);
761 uint32_t*
const styles =
new uint32_t[nM];
762 for(uint32_t i=0; i<nM; i++)
763 styles[i]=addMaterial(M[i]);
764 const uint32_t meshid = createTriangleMesh(nP, P, nI, PI, style, nN, N, NI, nT, T, TI, nC, C, CI, nM, styles, MI, ca);
769 return createTriangleMesh(nP, P, nI, PI, style, nN, N, NI, nT, T, TI, nC, C, CI, 0, NULL, NULL, ca);
771 void addQuads(uint32_t nP,
const double P[][3], uint32_t nI,
const uint32_t PI[][4],
const PRCmaterial &m,
772 uint32_t nN,
const double N[][3],
const uint32_t NI[][4],
773 uint32_t nT,
const double T[][2],
const uint32_t TI[][4],
774 uint32_t nC,
const RGBAColour C[],
const uint32_t CI[][4],
775 uint32_t nM,
const PRCmaterial M[],
const uint32_t MI[],
double ca);
776 uint32_t createQuadMesh(uint32_t nP,
const double P[][3], uint32_t nI,
const uint32_t PI[][4], uint32_t style_index,
777 uint32_t nN,
const double N[][3],
const uint32_t NI[][4],
778 uint32_t nT,
const double T[][2],
const uint32_t TI[][4],
779 uint32_t nC,
const RGBAColour C[],
const uint32_t CI[][4],
780 uint32_t nS,
const uint32_t S[],
const uint32_t SI[],
double ca);
781 uint32_t createQuadMesh(uint32_t nP,
const double P[][3], uint32_t nI,
const uint32_t PI[][4],
const PRCmaterial& m,
782 uint32_t nN,
const double N[][3],
const uint32_t NI[][4],
783 uint32_t nT,
const double T[][2],
const uint32_t TI[][4],
784 uint32_t nC,
const RGBAColour C[],
const uint32_t CI[][4],
785 uint32_t nM,
const PRCmaterial M[],
const uint32_t MI[],
double ca)
787 const uint32_t style = addMaterial(m);
790 uint32_t*
const styles =
new uint32_t[nM];
791 for(uint32_t i=0; i<nM; i++)
792 styles[i]=addMaterial(M[i]);
793 const uint32_t meshid = createQuadMesh(nP, P, nI, PI, style, nN, N, NI, nT, T, TI, nC, C, CI, nM, styles, MI, ca);
798 return createQuadMesh(nP, P, nI, PI, style, nN, N, NI, nT, T, TI, nC, C, CI, 0, NULL, NULL, ca);
800 #define PRCTRANSFORM const double origin[3]=NULL, const double x_axis[3]=NULL, const double y_axis[3]=NULL, double scale=1, const double* t=NULL
801 #define PRCCARTRANSFORM const double origin[3], const double x_axis[3], const double y_axis[3], double scale
802 #define PRCGENTRANSFORM const double* t=NULL
803 #define PRCNOMATERIALINDEX m1
804 void useMesh(uint32_t tess_index, uint32_t style_index, PRCGENTRANSFORM);
805 void useMesh(uint32_t tess_index,
const PRCmaterial& m, PRCGENTRANSFORM)
806 { useMesh(tess_index,addMaterial(m),t); }
807 void useMesh(uint32_t tess_index, uint32_t style_index, PRCCARTRANSFORM);
808 void useMesh(uint32_t tess_index,
const PRCmaterial& m, PRCCARTRANSFORM)
809 { useMesh(tess_index,addMaterial(m),origin, x_axis, y_axis, scale); }
811 void useLines(uint32_t tess_index, uint32_t style_index, PRCGENTRANSFORM);
812 void useLines(uint32_t tess_index,
const RGBAColour& c,
double w, PRCGENTRANSFORM)
813 { useLines(tess_index, addLineMaterial(c,w), t); }
814 void useLines(uint32_t tess_index, uint32_t style_index, PRCCARTRANSFORM);
815 void useLines(uint32_t tess_index,
const RGBAColour& c,
double w, PRCCARTRANSFORM)
816 { useLines(tess_index,addLineMaterial(c,w),origin, x_axis, y_axis, scale); }
820 void addLine(uint32_t n,
const double P[][3],
const RGBAColour &c,
double w=1.0);
821 void addBezierCurve(uint32_t n,
const double cP[][3],
const RGBAColour &c);
822 void addCurve(uint32_t d, uint32_t n,
const double cP[][3],
const double *k,
const RGBAColour &c,
const double w[]);
823 void addQuad(
const double P[][3],
const RGBAColour C[]);
825 void addRectangle(
const double P[][3],
const PRCmaterial &m);
826 void addPatch(
const double cP[][3],
const PRCmaterial &m);
827 void addSurface(uint32_t dU, uint32_t dV, uint32_t nU, uint32_t nV,
828 const double cP[][3],
const double *kU,
const double *kV,
const PRCmaterial &m,
830 void addTube(uint32_t n,
const double cP[][3],
const double oP[][3],
bool straight,
const PRCmaterial& m, PRCTRANSFORM);
831 void addHemisphere(
double radius,
const PRCmaterial& m, PRCTRANSFORM);
832 void addSphere(
double radius,
const PRCmaterial& m, PRCTRANSFORM);
833 void addDisk(
double radius,
const PRCmaterial& m, PRCTRANSFORM);
834 void addCylinder(
double radius,
double height,
const PRCmaterial& m, PRCTRANSFORM);
835 void addCone(
double radius,
double height,
const PRCmaterial& m, PRCTRANSFORM);
836 void addTorus(
double major_radius,
double minor_radius,
double angle1,
double angle2,
const PRCmaterial& m, PRCTRANSFORM);
838 #undef PRCCARTRANSFORM
839 #undef PRCGENTRANSFORM
842 uint32_t addPicture(EPRCPictureDataFormat format, uint32_t size,
const uint8_t *picture, uint32_t width=0, uint32_t height=0,
843 std::string name=
"", uint32_t fileStructure=0)
844 {
return fileStructures[fileStructure]->addPicture(format, size, picture, width, height, name); }
846 std::string name=
"", uint32_t fileStructure=0)
847 {
return fileStructures[fileStructure]->addPicture(pic.format, pic.size, pic.data, pic.width, pic.height, name); }
848 uint32_t addTextureDefinition(
PRCTextureDefinition*& pTextureDefinition, uint32_t fileStructure=0)
850 return fileStructures[fileStructure]->addTextureDefinition(pTextureDefinition);
852 uint32_t addTextureApplication(
PRCTextureApplication*& pTextureApplication, uint32_t fileStructure=0)
854 return fileStructures[fileStructure]->addTextureApplication(pTextureApplication);
857 uint32_t fileStructure=0)
859 return fileStructures[fileStructure]->addRgbColor(color);
861 uint32_t addRgbColorUnique(
const PRCRgbColor &color,
862 uint32_t fileStructure=0)
864 return fileStructures[fileStructure]->addRgbColorUnique(color);
867 uint32_t fileStructure=0)
869 return fileStructures[fileStructure]->addMaterialGeneric(pMaterialGeneric);
871 uint32_t addStyle(
PRCStyle*& pStyle, uint32_t fileStructure=0)
873 return fileStructures[fileStructure]->addStyle(pStyle);
875 uint32_t addPartDefinition(
PRCPartDefinition*& pPartDefinition, uint32_t fileStructure=0)
877 return fileStructures[fileStructure]->addPartDefinition(pPartDefinition);
879 uint32_t addProductOccurrence(
PRCProductOccurrence*& pProductOccurrence, uint32_t fileStructure=0)
881 return fileStructures[fileStructure]->addProductOccurrence(pProductOccurrence);
883 uint32_t addTopoContext(
PRCTopoContext*& pTopoContext, uint32_t fileStructure=0)
885 return fileStructures[fileStructure]->addTopoContext(pTopoContext);
887 uint32_t getTopoContext(
PRCTopoContext*& pTopoContext, uint32_t fileStructure=0)
889 return fileStructures[fileStructure]->getTopoContext(pTopoContext);
891 uint32_t add3DTess(
PRC3DTess*& p3DTess, uint32_t fileStructure=0)
893 return fileStructures[fileStructure]->add3DTess(p3DTess);
895 uint32_t add3DWireTess(
PRC3DWireTess*& p3DWireTess, uint32_t fileStructure=0)
897 return fileStructures[fileStructure]->add3DWireTess(p3DWireTess);
913 uint32_t addCoordinateSystem(
PRCCoordinateSystem*& pCoordinateSystem, uint32_t fileStructure=0)
915 return fileStructures[fileStructure]->addCoordinateSystem(pCoordinateSystem);
917 uint32_t addCoordinateSystemUnique(
PRCCoordinateSystem*& pCoordinateSystem, uint32_t fileStructure=0)
919 return fileStructures[fileStructure]->addCoordinateSystemUnique(pCoordinateSystem);
924 std::ostream &output;
927 #endif // __O_PRC_FILE_H
Definition: writePRC.h:452
Definition: oPRCFile.h:398
Definition: oPRCFile.h:446
Definition: oPRCFile.h:626
Definition: oPRCFile.h:188
Definition: oPRCFile.h:278
Definition: writePRC.h:1273
Definition: writePRC.h:1424
Definition: oPRCFile.h:390
Definition: oPRCFile.h:243
Definition: oPRCFile.h:504
Definition: writePRC.h:855
Definition: writePRC.h:1377
Definition: oPRCFile.h:428
Definition: writePRC.h:38
Definition: oPRCFile.h:81
Definition: oPRCFile.h:408
Definition: writePRC.h:1037
Definition: oPRCFile.h:45
Definition: writePRC.h:540
Definition: oPRCFile.h:474
Definition: writePRC.h:240
Definition: writePRC.h:481
Definition: writePRC.h:1342
Definition: oPRCFile.h:112
Definition: writePRC.h:1402
Definition: writePRC.h:562
Definition: writePRC.h:380
Definition: writePRC.h:1414
Definition: writePRC.h:285
Definition: oPRCFile.h:371
Definition: PRCbitStream.h:46
Definition: oPRCFile.h:364
Definition: writePRC.h:1453
Definition: writePRC.h:423
Definition: oPRCFile.h:417
Definition: oPRCFile.h:308
Definition: oPRCFile.h:333