9494
9595namespace IfcGeom {
9696
97- template <typename P>
98- class MAKE_TYPE_NAME (IteratorImplementation_) : public IteratorImplementation<P> {
97+ template <typename P, typename PP >
98+ class MAKE_TYPE_NAME (IteratorImplementation_) : public IteratorImplementation<P, PP > {
9999 private:
100100
101101 MAKE_TYPE_NAME (IteratorImplementation_)(const MAKE_TYPE_NAME (IteratorImplementation_)&); // N/I
@@ -111,9 +111,9 @@ namespace IfcGeom {
111111 IfcSchema::IfcRepresentation::list::it representation_iterator;
112112
113113 // The object is fetched beforehand to be sure that get() returns a valid element
114- TriangulationElement<P>* current_triangulation;
115- BRepElement<P>* current_shape_model;
116- SerializedElement<P>* current_serialization;
114+ TriangulationElement<P, PP >* current_triangulation;
115+ BRepElement<P, PP >* current_shape_model;
116+ SerializedElement<P, PP >* current_serialization;
117117
118118 // A container and iterator for IfcBuildingElements for the current IfcRepresentation referenced by *representation_iterator
119119 IfcSchema::IfcProduct::list::ptr ifcproducts;
@@ -154,6 +154,7 @@ namespace IfcGeom {
154154 // / @todo public/private sections all over the place: move all public to the beginning of the class
155155 public:
156156 typedef P Precision;
157+ typedef PP PlacementPrecision;
157158
158159 MAKE_TYPE_NAME (IteratorImplementation_)(const IteratorSettings& settings, IfcParse::IfcFile* file, std::vector<IfcGeom::filter_t >& filters)
159160 : settings (settings)
@@ -399,7 +400,7 @@ namespace IfcGeom {
399400 return associated_single_materials.size () == 1 ;
400401 }
401402
402- BRepElement<P>* create_shape_model_for_next_entity () {
403+ BRepElement<P, PP >* create_shape_model_for_next_entity () {
403404 for (;;) {
404405 IfcSchema::IfcRepresentation* representation;
405406
@@ -468,9 +469,9 @@ namespace IfcGeom {
468469 IfcSchema::IfcProduct* product = *ifcproduct_iterator;
469470 Logger::SetProduct (product);
470471
471- BRepElement<P>* element;
472+ BRepElement<P, PP >* element;
472473 if (ifcproduct_iterator == ifcproducts->begin () || !geometry_reuse_ok_for_current_representation_) {
473- element = kernel.create_brep_for_representation_and_product <P>(settings, representation, product);
474+ element = kernel.create_brep_for_representation_and_product <P, PP >(settings, representation, product);
474475 } else {
475476 element = kernel.create_brep_for_processed_representation (settings, representation, product, current_shape_model);
476477 }
@@ -524,10 +525,10 @@ namespace IfcGeom {
524525 }
525526
526527 // / Gets the representation of the current geometrical entity.
527- Element<P>* get ()
528+ Element<P, PP >* get ()
528529 {
529530 // TODO: Test settings and throw
530- Element<P>* ret = 0 ;
531+ Element<P, PP >* ret = 0 ;
531532 if (current_triangulation) { ret = current_triangulation; }
532533 else if (current_serialization) { ret = current_serialization; }
533534 else if (current_shape_model) { ret = current_shape_model; }
@@ -537,12 +538,12 @@ namespace IfcGeom {
537538 {
538539 // We are going to build a vector with the element parents.
539540 // First, create the parent vector
540- std::vector<const IfcGeom::Element<P>*> parents;
541+ std::vector<const IfcGeom::Element<P, PP >*> parents;
541542
542543 // if the element has a parent
543544 if (ret->parent_id () != -1 )
544545 {
545- const IfcGeom::Element<P>* parent_object = NULL ;
546+ const IfcGeom::Element<P, PP >* parent_object = NULL ;
546547 bool hasParent = true ;
547548
548549 // get the parent
@@ -582,13 +583,13 @@ namespace IfcGeom {
582583 }
583584
584585 // / Gets the native (Open Cascade) representation of the current geometrical entity.
585- BRepElement<P>* get_native ()
586+ BRepElement<P, PP >* get_native ()
586587 {
587588 // TODO: Test settings and throw
588589 return current_shape_model;
589590 }
590591
591- const Element<P>* get_object (int id) {
592+ const Element<P, PP >* get_object (int id) {
592593 gp_Trsf trsf;
593594 int parent_id = -1 ;
594595 std::string instance_type, product_name, product_guid;
@@ -640,14 +641,14 @@ namespace IfcGeom {
640641
641642 ElementSettings element_settings (settings, unit_magnitude, instance_type);
642643
643- Element<P>* ifc_object = new Element<P>(element_settings, id, parent_id, product_name, instance_type, product_guid, " " , trsf, ifc_product);
644+ Element<P, PP >* ifc_object = new Element<P, PP >(element_settings, id, parent_id, product_name, instance_type, product_guid, " " , trsf, ifc_product);
644645 return ifc_object;
645646 }
646647
647648 IfcUtil::IfcBaseClass* create () {
648- IfcGeom::BRepElement<P>* next_shape_model = 0 ;
649- IfcGeom::SerializedElement<P>* next_serialization = 0 ;
650- IfcGeom::TriangulationElement<P>* next_triangulation = 0 ;
649+ IfcGeom::BRepElement<P, PP >* next_shape_model = 0 ;
650+ IfcGeom::SerializedElement<P, PP >* next_serialization = 0 ;
651+ IfcGeom::TriangulationElement<P, PP >* next_triangulation = 0 ;
651652
652653 try {
653654 next_shape_model = create_shape_model_for_next_entity ();
@@ -666,16 +667,16 @@ namespace IfcGeom {
666667 if (next_shape_model) {
667668 if (settings.get (IteratorSettings::USE_BREP_DATA)) {
668669 try {
669- next_serialization = new SerializedElement<P>(*next_shape_model);
670+ next_serialization = new SerializedElement<P, PP >(*next_shape_model);
670671 } catch (...) {
671672 Logger::Message (Logger::LOG_ERROR, " Getting a serialized element from model failed." );
672673 }
673674 } else if (!settings.get (IteratorSettings::DISABLE_TRIANGULATION)) {
674675 try {
675676 if (ifcproduct_iterator == ifcproducts->begin () || !geometry_reuse_ok_for_current_representation_) {
676- next_triangulation = new TriangulationElement<P>(*next_shape_model);
677+ next_triangulation = new TriangulationElement<P, PP >(*next_shape_model);
677678 } else {
678- next_triangulation = new TriangulationElement<P>(*next_shape_model, current_triangulation->geometry_pointer ());
679+ next_triangulation = new TriangulationElement<P, PP >(*next_shape_model, current_triangulation->geometry_pointer ());
679680 }
680681 } catch (...) {
681682 Logger::Message (Logger::LOG_ERROR, " Getting a triangulation element from model failed." );
0 commit comments