30 #include "PRCbitStream.h"
35 static const uint32_t m1=(uint32_t)-1;
36 static const double pi=acos(-1.0);
47 x(fx), y(fy), z(fz) {}
48 PRCVector3d(
const double c[],
double fx=0,
double fy=0,
double fz=0) :
49 x(c?c[0]:fx), y(c?c[1]:fy), z(c?c[2]:fz) {}
51 x(sVector3d.x), y(sVector3d.y), z(sVector3d.z) {}
53 void Set(
double fx,
double fy,
double fz)
54 { x = fx; y = fy; z = fz; }
56 {
return(x*sPt.x)+(y*sPt.y)+(z*sPt.z); }
57 double LengthSquared()
58 {
return(x*x+y*y+z*z); }
73 {
return PRCVector3d((a.y*b.z)-(a.z*b.y), (a.z*b.x)-(a.x*b.z), (a.x*b.y)-(a.y*b.x)); }
76 void serializeVector3d(
PRCbitStream &pbs)
const { pbs << x << y << z; }
77 void serializeVector2d(
PRCbitStream &pbs)
const { pbs << x << y; }
84 return x==v.x && y==v.y && z==v.z;
88 return !(x==v.x && y==v.y && z==v.z);
98 friend std::ostream& operator << (std::ostream& out,
const PRCVector3d& v)
100 out <<
"(" << v.x <<
"," << v.y <<
"," << v.z <<
")";
118 void writeUncompressedUnsignedInteger(std::ostream &out, uint32_t data);
127 UserData(uint32_t s = 0, uint8_t* d = 0) : size(s),data(d) {}
139 title_integer = integer;
146 bool title_is_integer;
147 std::string title_text;
148 uint32_t title_integer;
157 value.integer = integer;
172 value.integer = integer;
188 value.integer = integer;
203 EPRCModellerAttributeType type;
210 std::string value_text;
220 PRCSingleAttribute& newKey() { attribute_keys.resize(attribute_keys.size()+1);
return attribute_keys.back(); }
222 std::deque<PRCSingleAttribute> attribute_keys;
225 typedef std::list<PRCAttribute> PRCAttributeList;
232 void addAttribute(
const PRCAttribute &attribute) { attributes.push_front(attribute); }
233 PRCAttributeList attributes;
236 bool type_eligible_for_reference(uint32_t type);
237 uint32_t makeCADID();
238 uint32_t makePRCID();
244 type(t),name(n),CAD_identifier(0), CAD_persistent_identifier(0), PRC_unique_identifier(0)
246 if(type_eligible_for_reference(type))
248 CAD_identifier = makeCADID();
249 PRC_unique_identifier = makePRCID();
253 uint32_t getPRCID()
const {
return PRC_unique_identifier; }
254 uint32_t getType()
const {
return type; }
257 uint32_t CAD_identifier, CAD_persistent_identifier, PRC_unique_identifier;
264 type(0), unique_identifier(m1) {}
269 uint32_t unique_identifier;
272 extern std::string currentName;
276 extern uint32_t current_layer_index;
277 extern uint32_t current_index_of_line_style;
278 extern uint16_t current_behaviour_bit_field;
280 void writeGraphics(
PRCbitStream&,uint32_t=m1,uint32_t=m1,uint16_t=1,
bool=
false);
281 void resetGraphics();
283 void resetGraphicsAndName();
287 PRCRgbColor(
double r=0.0,
double g=0.0,
double b=0.0) :
288 red(r), green(g), blue(b) {}
289 double red,green,blue;
294 return (red==c.red && green==c.green && blue==c.blue);
298 return !(red==c.red && green==c.green && blue==c.blue);
305 return (green<c.green);
306 return (blue<c.blue);
314 ContentPRCBase(PRC_TYPE_GRAPH_Picture,n), format(KEPRCPicture_PNG), uncompressed_file_index(m1), pixel_width(0), pixel_height(0) {}
316 EPRCPictureDataFormat format;
317 uint32_t uncompressed_file_index;
318 uint32_t pixel_width;
319 uint32_t pixel_height;
331 PRCVector2d(
const double c[],
double fx=0,
double fy=0) :
332 x(c?c[0]:fx), y(c?c[1]:fy) {}
334 x(sVector2d.x), y(sVector2d.y) {}
336 void Set(
double fx,
double fy)
339 {
return(x*sPt.x)+(y*sPt.y); }
340 double LengthSquared()
361 return x==v.x && y==v.y;
365 return !(x==v.x && y==v.y);
373 friend std::ostream& operator << (std::ostream& out,
const PRCVector2d& v)
375 out <<
"(" << v.x <<
"," << v.y <<
")";
384 ContentPRCBase(PRC_TYPE_GRAPH_TextureDefinition,n), picture_index(m1), texture_mapping_attribute(PRC_TEXTURE_MAPPING_DIFFUSE),
385 texture_mapping_attribute_intensity(1.0), texture_mapping_attribute_components(PRC_TEXTURE_MAPPING_COMPONENTS_RGBA),
386 texture_function(KEPRCTextureFunction_Modulate), texture_applying_mode(PRC_TEXTURE_APPLYING_MODE_NONE),
387 texture_wrapping_mode_S(KEPRCTextureWrappingMode_Unknown), texture_wrapping_mode_T(KEPRCTextureWrappingMode_Unknown)
392 uint32_t picture_index;
393 uint32_t texture_mapping_attribute;
394 double texture_mapping_attribute_intensity;
395 uint8_t texture_mapping_attribute_components;
396 EPRCTextureFunction texture_function;
397 uint8_t texture_applying_mode;
398 EPRCTextureWrappingMode texture_wrapping_mode_S;
399 EPRCTextureWrappingMode texture_wrapping_mode_T;
413 typedef std::deque <PRCTextureDefinition*> PRCTextureDefinitionList;
421 typedef std::deque <PRCMaterial*> PRCMaterialList;
428 ambient(m1), diffuse(m1), emissive(m1), specular(m1),
430 ambient_alpha(1.0), diffuse_alpha(1.0), emissive_alpha(1.0), specular_alpha(1.0)
433 void serializeMaterial(
PRCbitStream &pbs) { serializeMaterialGeneric(pbs); }
434 uint32_t picture_index;
440 double ambient_alpha;
441 double diffuse_alpha;
442 double emissive_alpha;
443 double specular_alpha;
447 return (ambient==m.ambient && diffuse==m.diffuse && emissive==m.emissive && specular==m.specular && shininess==m.shininess &&
448 ambient_alpha==m.ambient_alpha && diffuse_alpha==m.diffuse_alpha && emissive_alpha==m.emissive_alpha && specular_alpha==m.specular_alpha);
457 material_generic_index(m1), texture_definition_index(m1),
458 next_texture_index(m1), UV_coordinates_index(0)
461 void serializeMaterial(
PRCbitStream &pbs) { serializeTextureApplication(pbs); }
462 uint32_t material_generic_index;
463 uint32_t texture_definition_index;
464 uint32_t next_texture_index;
465 uint32_t UV_coordinates_index;
473 phase(0), is_real_length(
false) {}
475 std::vector<double> lengths;
479 typedef std::deque <PRCLinePattern*> PRCLinePatternList;
485 ContentPRCBase(PRC_TYPE_GRAPH_Style,n), line_width(0.0), is_vpicture(
false), line_pattern_vpicture_index(m1),
486 is_material(
false), color_material_index(m1), is_transparency_defined(
false), transparency(255), additional(0)
491 uint32_t line_pattern_vpicture_index;
493 uint32_t color_material_index;
494 bool is_transparency_defined;
495 uint8_t transparency;
498 typedef std::deque <PRCStyle*> PRCStyleList;
504 start_wire(0), used_entities_flag(0),
505 start_triangulated(0), number_of_texture_coordinate_indexes(0),
506 is_rgba(
false), behaviour(PRC_GRAPHICS_Show)
509 std::vector<uint32_t> line_attributes;
511 std::vector<uint32_t> sizes_wire;
512 uint32_t used_entities_flag;
513 uint32_t start_triangulated;
514 std::vector<uint32_t> sizes_triangulated;
515 uint32_t number_of_texture_coordinate_indexes;
517 std::vector<uint8_t> rgba_vertices;
520 typedef std::deque <PRCTessFace*> PRCTessFaceList;
526 is_calculated(
false) {}
529 std::vector<double> coordinates;
536 virtual void serializeBaseTessData(
PRCbitStream &pbs) = 0;
538 typedef std::deque <PRCTess*> PRCTessList;
544 has_faces(
false), has_loops(
false),
545 crease_angle(25.8419)
547 ~
PRC3DTess() {
for(PRCTessFaceList::iterator it=face_tessellation.begin(); it!=face_tessellation.end(); ++it)
delete *it; }
549 void serializeBaseTessData(
PRCbitStream &pbs) { serialize3DTess(pbs); }
555 std::vector<double> normal_coordinate;
556 std::vector<uint32_t> wire_index;
557 std::vector<uint32_t> triangulated_index;
558 PRCTessFaceList face_tessellation;
559 std::vector<double> texture_coordinate;
566 is_rgba(
false), is_segment_color(
false) {}
568 void serializeBaseTessData(
PRCbitStream &pbs) { serialize3DWireTess(pbs); }
571 bool is_segment_color;
572 std::vector<uint32_t> wire_indexes;
573 std::vector<uint8_t> rgba_vertices;
583 void serializeBaseTessData(
PRCbitStream &pbs) { serializeMarkupTess(pbs); }
585 std::vector<uint32_t> codes;
586 std::vector<std::string> texts;
594 PRCGraphics() : layer_index(m1), index_of_line_style(m1), behaviour_bit_field(PRC_GRAPHICS_Show) {}
597 bool has_graphics() {
return (index_of_line_style!=m1 || layer_index!=m1 || behaviour_bit_field!=PRC_GRAPHICS_Show) ; }
598 uint32_t layer_index;
599 uint32_t index_of_line_style;
600 uint16_t behaviour_bit_field;
602 typedef std::deque <PRCGraphics*> PRCGraphicsList;
611 type(KEPRCMarkupType_Unknown), sub_type(KEPRCMarkupSubType_Unknown), index_tessellation(m1) {}
614 EPRCMarkupSubType sub_type;
617 uint32_t index_tessellation;
619 typedef std::deque <PRCMarkup*> PRCMarkupList;
627 void serializeAnnotationEntity(
PRCbitStream &pbs) { serializeAnnotationItem(pbs); }
630 typedef std::deque <PRCAnnotationItem*> PRCAnnotationItemList;
637 index_local_coordinate_system(m1), index_tessellation(m1) {}
639 uint32_t index_local_coordinate_system;
640 uint32_t index_tessellation;
649 virtual void serializeRepresentationItem(
PRCbitStream &pbs) = 0;
651 typedef std::deque <PRCRepresentationItem*> PRCRepresentationItemList;
657 PRCRepresentationItem(PRC_TYPE_RI_BrepModel,n), has_brep_data(
true), context_id(m1), body_id(m1), is_closed(
false) {}
659 void serializeRepresentationItem(
PRCbitStream &pbs) { serializeBrepModel(pbs); }
672 void serializeRepresentationItem(
PRCbitStream &pbs) { serializePolyBrepModel(pbs); }
682 void serializeRepresentationItem(
PRCbitStream &pbs) { serializePointSet(pbs); }
683 std::vector<PRCVector3d> point;
692 void serializeRepresentationItem(
PRCbitStream &pbs) { serializeWire(pbs); }
704 void serializeRepresentationItem(
PRCbitStream &pbs) { serializePolyWire(pbs); }
710 PRCSet(std::string n=
"") :
712 ~
PRCSet() {
for(PRCRepresentationItemList::iterator it=elements.begin(); it!=elements.end(); ++it)
delete *it; }
714 void serializeRepresentationItem(
PRCbitStream &pbs) { serializeSet(pbs); }
718 uint32_t addSet(
PRCSet*& pSet);
719 uint32_t addWire(
PRCWire*& pWire);
722 PRCRepresentationItemList elements;
729 virtual void serializeTransformation3d(
PRCbitStream&)
const =0;
731 typedef std::deque <PRCTransformation3d*> PRCTransformation3dList;
745 void serializeGeneralTransformation3d(
PRCbitStream&)
const;
746 void serializeTransformation3d(
PRCbitStream& pbs)
const { serializeGeneralTransformation3d(pbs); }
750 for (
size_t i=0;i<16;i++)
751 if(m_coef[i]!=t.m_coef[i])
757 for (
size_t i=0;i<16;i++)
758 if(m_coef[i]!=t.m_coef[i])
760 return (m_coef[i]<t.m_coef[i]);
764 void set(
const double t[])
767 for (
size_t i=0;i<16;i++)
774 m_coef[0]=1; m_coef[4]=0; m_coef[ 8]=0; m_coef[12]=0;
775 m_coef[1]=0; m_coef[5]=1; m_coef[ 9]=0; m_coef[13]=0;
776 m_coef[2]=0; m_coef[6]=0; m_coef[10]=1; m_coef[14]=0;
777 m_coef[3]=0; m_coef[7]=0; m_coef[11]=0; m_coef[15]=1;
779 bool isnotidtransform()
const {
781 m_coef[0]!=1 || m_coef[4]!=0 || m_coef[ 8]!=0 || m_coef[12]!=0 ||
782 m_coef[1]!=0 || m_coef[5]!=1 || m_coef[ 9]!=0 || m_coef[13]!=0 ||
783 m_coef[2]!=0 || m_coef[6]!=0 || m_coef[10]!=1 || m_coef[14]!=0 ||
784 m_coef[3]!=0 || m_coef[7]!=0 || m_coef[11]!=0 || m_coef[15]!=1 );
786 bool isidtransform()
const {
788 m_coef[0]==1 && m_coef[4]==0 && m_coef[ 8]==0 && m_coef[12]==0 &&
789 m_coef[1]==0 && m_coef[5]==1 && m_coef[ 9]==0 && m_coef[13]==0 &&
790 m_coef[2]==0 && m_coef[6]==0 && m_coef[10]==1 && m_coef[14]==0 &&
791 m_coef[3]==0 && m_coef[7]==0 && m_coef[11]==0 && m_coef[15]==1 );
793 double M(
size_t i,
size_t j)
const {
794 return m_coef[i+j*4];
797 typedef std::deque <PRCGeneralTransformation3d> PRCGeneralTransformation3dList;
803 behaviour(PRC_TRANSFORMATION_Identity), origin(0.0,0.0,0.0), X(1.0,0.0,0.0), Y(0.0,1.0,0.0), Z(0.0,0.0,1.0),
804 scale(1.0,1.0,1.0), uniform_scale(1.0),
805 X_homogeneous_coord(0.0), Y_homogeneous_coord(0.0), Z_homogeneous_coord(0.0), origin_homogeneous_coord(1.0) {}
807 behaviour(PRC_TRANSFORMATION_Identity), origin(o,0.0,0.0,0.0), X(x,1.0,0.0,0.0), Y(y,0.0,1.0,0.0), Z(0.0,0.0,1.0),
808 scale(1.0,1.0,1.0), uniform_scale(sc),
809 X_homogeneous_coord(0.0), Y_homogeneous_coord(0.0), Z_homogeneous_coord(0.0), origin_homogeneous_coord(1.0)
812 behaviour = behaviour | PRC_TRANSFORMATION_Translate;
814 behaviour = behaviour | PRC_TRANSFORMATION_Rotate;
816 behaviour = behaviour | PRC_TRANSFORMATION_Scale;
818 void serializeCartesianTransformation3d(
PRCbitStream& pbs)
const;
819 void serializeTransformation3d(
PRCbitStream& pbs)
const { serializeCartesianTransformation3d(pbs); }
826 double uniform_scale;
827 double X_homogeneous_coord;
828 double Y_homogeneous_coord;
829 double Z_homogeneous_coord;
830 double origin_homogeneous_coord;
833 return behaviour==t.behaviour && origin==t.origin && X==t.X && Y==t.Y && Z==t.Z && scale==t.scale && uniform_scale==t.uniform_scale &&
834 X_homogeneous_coord==t.X_homogeneous_coord && Y_homogeneous_coord==t.Y_homogeneous_coord &&
835 Z_homogeneous_coord==t.Z_homogeneous_coord && origin_homogeneous_coord==t.origin_homogeneous_coord;
843 has_transformation(
false), geometry_is_2D(
false), behaviour(PRC_TRANSFORMATION_Identity),
844 origin(0.0,0.0,0.0), x_axis(1.0,0.0,0.0), y_axis(0.0,1.0,0.0), scale(1) {}
846 bool has_transformation;
862 void serializeRepresentationItem(
PRCbitStream &pbs) { serializeCoordinateSystem(pbs); }
868 if(index_local_coordinate_system!=t.index_local_coordinate_system)
874 if(axis_set_general!=NULL)
875 return (t_axis_set_general!=NULL?(*axis_set_general==*t_axis_set_general):
false);
876 if(axis_set_cartesian!=NULL)
877 return (t_axis_set_cartesian!=NULL?(*axis_set_cartesian==*t_axis_set_cartesian):
false);
881 typedef std::deque <PRCCoordinateSystem*> PRCCoordinateSystemList;
893 std::string font_name;
895 std::vector<PRCFontKey> font_keys;
904 base_information(
false), identifier(0) {}
906 base_information(
true),name(n),identifier(
id) {}
908 bool base_information;
935 PRCInterval(
double m,
double M) : min(m), max(M) {}
945 PRCParameterization(
double min,
double max) : interval(min, max), parameterization_coeff_a(1), parameterization_coeff_b(0) {}
948 double parameterization_coeff_a;
949 double parameterization_coeff_b;
956 parameterization_on_u_coeff_a(1), parameterization_on_v_coeff_a(1),
957 parameterization_on_u_coeff_b(0), parameterization_on_v_coeff_b(0) {}
961 double parameterization_on_u_coeff_a;
962 double parameterization_on_v_coeff_a;
963 double parameterization_on_u_coeff_b;
964 double parameterization_on_v_coeff_b;
971 x(0), y(0), z(0), w(1) {}
973 x(X), y(Y), z(Z), w(W) {}
975 x(v.x), y(v.y), z(v.z), w(1) {}
976 void Set(
double fx,
double fy,
double fz,
double fw=1)
977 { x = fx; y = fy; z = fz; w = fw; }
992 EPRCExtendType extend_info;
1010 PRCSurface(), knot_type(KEPRCKnotTypeUnspecified), surface_form(KEPRCBSplineSurfaceFormUnspecified) {}
1012 PRCSurface(n), knot_type(KEPRCKnotTypeUnspecified), surface_form(KEPRCBSplineSurfaceFormUnspecified) {}
1014 void serializeSurface(
PRCbitStream &pbs) { serializeNURBSSurface(pbs); }
1016 uint32_t degree_in_u;
1017 uint32_t degree_in_v;
1018 std::vector<PRCControlPoint> control_point;
1019 std::vector<double> knot_u;
1020 std::vector<double> knot_v;
1021 const EPRCKnotType knot_type;
1022 const EPRCBSplineSurfaceForm surface_form;
1031 PRCBaseGeometry(n,makeCADID()),extend_info(KEPRCExtendTypeNone), is_3d(
true) {}
1033 EPRCExtendType extend_info;
1047 typedef std::deque <PRCCurve*> PRCCurveList;
1053 PRCCurve(), knot_type(KEPRCKnotTypeUnspecified), curve_form(KEPRCBSplineCurveFormUnspecified) {}
1055 PRCCurve(n), knot_type(KEPRCKnotTypeUnspecified), curve_form(KEPRCBSplineCurveFormUnspecified) {}
1057 void serializeCurve(
PRCbitStream &pbs) { serializeNURBSCurve(pbs); }
1060 std::vector<PRCControlPoint> control_point;
1061 std::vector<double> knot;
1062 const EPRCKnotType knot_type;
1063 const EPRCBSplineCurveForm curve_form;
1074 void serializeCurve(
PRCbitStream &pbs) { serializePolyLine(pbs); }
1075 std::vector<PRCVector3d> point;
1086 void serializeCurve(
PRCbitStream &pbs) { serializeCircle(pbs); }
1098 void serializeCurve(
PRCbitStream &pbs) { serializeComposite(pbs); }
1099 PRCCurveList base_curve;
1100 std::vector<bool> base_sense;
1108 PRCSurface(), center_curve(NULL), origin_curve(NULL), tangent_curve(NULL) {}
1110 PRCSurface(n), center_curve(NULL), origin_curve(NULL), tangent_curve(NULL) {}
1111 ~
PRCBlend01() {
delete center_curve;
delete origin_curve;
delete tangent_curve; }
1113 void serializeSurface(
PRCbitStream &pbs) { serializeBlend01(pbs); }
1126 PRCSurface(), first_curve(NULL), second_curve(NULL) {}
1129 ~
PRCRuled() {
delete first_curve;
delete second_curve; }
1131 void serializeSurface(
PRCbitStream &pbs) { serializeRuled(pbs); }
1146 void serializeSurface(
PRCbitStream &pbs) { serializeSphere(pbs); }
1158 void serializeSurface(
PRCbitStream &pbs) { serializeCone(pbs); }
1159 double bottom_radius;
1171 void serializeSurface(
PRCbitStream &pbs) { serializeCylinder(pbs); }
1183 void serializeSurface(
PRCbitStream &pbs) { serializeTorus(pbs); }
1184 double major_radius;
1185 double minor_radius;
1192 base_information(
false),identifier(0) {}
1194 base_information(
true),name(n),identifier(
id) {}
1196 bool base_information;
1198 uint32_t identifier;
1226 PRCBody(uint32_t tit, std::string n) :
1230 void serializeTopoItem(
PRCbitStream &pbs) { serializeBody(pbs); }
1231 uint32_t serialType() {
return topo_item_type; }
1232 virtual double serialTolerance() {
return 0; }
1233 const uint32_t topo_item_type;
1235 typedef std::deque <PRCBody*> PRCBodyList;
1243 PRCBaseTopology(n,makeCADID()), curve_3d(NULL), has_curve_trim_interval(
false) {}
1248 bool has_curve_trim_interval;
1256 void serializeTopoItem(
PRCbitStream &pbs) { serializeWireEdge(pbs); }
1263 PRCBody(PRC_TYPE_TOPO_SingleWireBody), wire_edge(NULL) {}
1265 PRCBody(PRC_TYPE_TOPO_SingleWireBody, n), wire_edge(NULL) {}
1268 void serializeBody(
PRCbitStream &pbs) { serializeSingleWireBody(pbs); }
1269 void setWireEdge(
PRCWireEdge*& wireEdge) { wire_edge = wireEdge; wireEdge = NULL; }
1277 PRCBaseTopology(), base_surface(NULL), have_surface_trim_domain(
false), have_tolerance(
false), tolerance(0), number_of_loop(0), outer_loop_index(-1) {}
1279 PRCBaseTopology(n,makeCADID()), base_surface(NULL), have_surface_trim_domain(
false), have_tolerance(
false), tolerance(0), number_of_loop(0), outer_loop_index(-1) {}
1280 ~
PRCFace() {
delete base_surface; }
1282 void serializeTopoItem(
PRCbitStream &pbs) { serializeFace(pbs); }
1283 void setBaseSurface(
PRCSurface*& surface) { base_surface = surface; surface = NULL; }
1285 const bool have_surface_trim_domain;
1287 const bool have_tolerance;
1288 const double tolerance;
1289 const uint32_t number_of_loop;
1290 const int32_t outer_loop_index;
1293 typedef std::deque <PRCFace*> PRCFaceList;
1302 ~
PRCShell() {
for(PRCFaceList::iterator it=face.begin(); it!=face.end(); ++it)
delete *it; }
1304 void serializeTopoItem(
PRCbitStream &pbs) { serializeShell(pbs); }
1305 void addFace(
PRCFace*& pFace, uint8_t orientation=2);
1306 bool shell_is_closed;
1308 std::vector<uint8_t> orientation_surface_with_shell;
1310 typedef std::deque <PRCShell*> PRCShellList;
1319 ~
PRCConnex() {
for(PRCShellList::iterator it=shell.begin(); it!=shell.end(); ++it)
delete *it; }
1321 void serializeTopoItem(
PRCbitStream &pbs) { serializeConnex(pbs); }
1325 typedef std::deque <PRCConnex*> PRCConnexList;
1331 PRCBody(PRC_TYPE_TOPO_BrepData) {}
1333 PRCBody(PRC_TYPE_TOPO_BrepData, n) {}
1334 ~
PRCBrepData() {
for(PRCConnexList::iterator it=connex.begin(); it!=connex.end(); ++it)
delete *it; }
1336 void serializeBody(
PRCbitStream &pbs) { serializeBrepData(pbs); }
1338 PRCConnexList connex;
1348 PRCBaseTopology(n,makeCADID()), orientation_surface_with_shell(
true), degree(0) {}
1349 void serializeCompressedFace(
PRCbitStream &pbs,
double brep_data_compressed_tolerance);
1350 void serializeContentCompressedFace(
PRCbitStream &pbs);
1351 void serializeCompressedAnaNurbs(
PRCbitStream &pbs,
double brep_data_compressed_tolerance);
1352 void serializeCompressedNurbs(
PRCbitStream &pbs,
double brep_data_compressed_tolerance);
1353 bool orientation_surface_with_shell;
1355 std::vector<PRCVector3d> control_point;
1357 typedef std::deque <PRCCompressedFace*> PRCCompressedFaceList;
1364 PRCBody(PRC_TYPE_TOPO_BrepDataCompress), serial_tolerance(0), brep_data_compressed_tolerance(0) {}
1366 PRCBody(PRC_TYPE_TOPO_BrepDataCompress, n), serial_tolerance(0), brep_data_compressed_tolerance(0) {}
1367 ~
PRCCompressedBrepData() {
for(PRCCompressedFaceList::iterator it=face.begin(); it!=face.end(); ++it)
delete *it; }
1369 void serializeBody(
PRCbitStream &pbs) { serializeCompressedBrepData(pbs); }
1371 double serialTolerance() {
return serial_tolerance; }
1372 double serial_tolerance;
1373 double brep_data_compressed_tolerance;
1374 PRCCompressedFaceList face;
1381 ContentPRCBase(PRC_TYPE_TOPO_Context,n), behaviour(0), granularity(1), tolerance(0),
1382 have_smallest_face_thickness(
false), smallest_thickness(0), have_scale(
false), scale(1) {}
1383 ~
PRCTopoContext() {
for(PRCBodyList::iterator it=body.begin(); it!=body.end(); ++it)
delete *it; }
1394 bool have_smallest_face_thickness;
1395 double smallest_thickness;
1400 typedef std::deque <PRCTopoContext*> PRCTopoContextList;
1407 void serializeFileStructureUncompressedUniqueId(std::ostream& out)
const;
1417 PRCUnit() : unit_from_CAD_file(
false), unit(1) {}
1418 PRCUnit(
double u,
bool ufcf=
true) : unit_from_CAD_file(ufcf), unit(u) {}
1420 bool unit_from_CAD_file;
1430 index_prototype(m1), prototype_in_same_file_structure(
true),
1431 index_external_data(m1), external_data_in_same_file_structure(
true),
1432 product_behaviour(0), product_information_flags(0), product_load_status(KEPRCProductLoadStatus_Loaded),
1437 uint32_t index_part;
1438 uint32_t index_prototype;
1439 bool prototype_in_same_file_structure;
1441 uint32_t index_external_data;
1442 bool external_data_in_same_file_structure;
1444 std::vector<uint32_t> index_son_occurrence;
1445 uint8_t product_behaviour;
1447 uint8_t product_information_flags;
1448 EPRCProductLoadStatus product_load_status;
1451 typedef std::deque <PRCProductOccurrence*> PRCProductOccurrenceList;
1458 ~
PRCPartDefinition() {
for(PRCRepresentationItemList::iterator it=representation_item.begin(); it!=representation_item.end(); ++it)
delete *it; }
1463 uint32_t addSet(
PRCSet*& pSet);
1464 uint32_t addWire(
PRCWire*& pWire);
1467 PRCRepresentationItemList representation_item;
1469 typedef std::deque <PRCPartDefinition*> PRCPartDefinitionList;
1471 #endif //__WRITE_PRC_H
Definition: writePRC.h:452
Definition: writePRC.h:941
Definition: writePRC.h:134
Definition: writePRC.h:1006
Definition: writePRC.h:1219
Definition: writePRC.h:889
Definition: writePRC.h:1049
Definition: writePRC.h:522
Definition: writePRC.h:310
Definition: writePRC.h:415
Definition: writePRC.h:1273
Definition: writePRC.h:931
Definition: writePRC.h:1078
Definition: writePRC.h:995
Definition: writePRC.h:698
Definition: writePRC.h:653
Definition: writePRC.h:124
Definition: writePRC.h:204
Definition: writePRC.h:1424
Definition: writePRC.h:855
Definition: writePRC.h:1377
Definition: writePRC.h:500
Definition: writePRC.h:1150
Definition: writePRC.h:1175
Definition: writePRC.h:1208
Definition: writePRC.h:1237
Definition: writePRC.h:900
Definition: writePRC.h:1122
Definition: writePRC.h:38
Definition: writePRC.h:1259
Definition: writePRC.h:686
Definition: writePRC.h:151
Definition: writePRC.h:1163
Definition: writePRC.h:1037
Definition: writePRC.h:643
Definition: writePRC.h:468
Definition: writePRC.h:1295
Definition: writePRC.h:967
Definition: writePRC.h:540
Definition: writePRC.h:240
Definition: writePRC.h:481
Definition: writePRC.h:1342
Definition: writePRC.h:984
Definition: writePRC.h:1188
Definition: writePRC.h:913
Definition: writePRC.h:1025
Definition: writePRC.h:1327
Definition: writePRC.h:666
Definition: writePRC.h:923
Definition: writePRC.h:883
Definition: writePRC.h:1402
Definition: writePRC.h:1090
Definition: writePRC.h:632
Definition: writePRC.h:591
Definition: writePRC.h:606
Definition: writePRC.h:260
Definition: writePRC.h:1066
Definition: writePRC.h:621
Definition: writePRC.h:562
Definition: writePRC.h:1138
Definition: writePRC.h:676
Definition: writePRC.h:380
Definition: writePRC.h:1104
Definition: writePRC.h:1414
Definition: writePRC.h:1201
Definition: writePRC.h:285
Definition: PRCbitStream.h:46
Definition: writePRC.h:1360
Definition: writePRC.h:1453
Definition: writePRC.h:1252
Definition: writePRC.h:423
Definition: writePRC.h:213
Definition: writePRC.h:952
Definition: writePRC.h:1312
Definition: writePRC.h:532
Definition: writePRC.h:322
Definition: writePRC.h:707
Definition: writePRC.h:576
Definition: writePRC.h:227