@@ -94,7 +94,7 @@ class RepresentationConverter : public StatusCallback
9494 m_curve_converter = shared_ptr<CurveConverter>( new CurveConverter ( m_geom_settings, m_placement_converter, m_point_converter, m_spline_converter ) );
9595 m_profile_cache = shared_ptr<ProfileCache>( new ProfileCache ( m_curve_converter, m_spline_converter ) );
9696 m_face_converter = shared_ptr<FaceConverter>( new FaceConverter ( m_geom_settings, m_unit_converter, m_curve_converter, m_spline_converter, m_sweeper, m_profile_cache ) );
97- m_solid_converter = shared_ptr<SolidModelConverter>( new SolidModelConverter ( m_geom_settings, m_point_converter, m_curve_converter, m_face_converter, m_profile_cache, m_sweeper ) );
97+ m_solid_converter = shared_ptr<SolidModelConverter>( new SolidModelConverter ( m_geom_settings, m_point_converter, m_curve_converter, m_face_converter, m_profile_cache, m_sweeper, m_styles_converter ) );
9898
9999 // this redirects the callback messages from all converters to RepresentationConverter's callback
100100 m_styles_converter->setMessageTarget ( this );
@@ -139,59 +139,59 @@ class RepresentationConverter : public StatusCallback
139139 m_face_converter->m_unit_converter = unit_converter;
140140 }
141141
142- void convertRepresentationStyle ( const shared_ptr<IfcRepresentationItem>& representation_item, std::vector<shared_ptr<StyleData> >& vec_style_data )
142+ // void convertRepresentationStyle( const shared_ptr<IfcRepresentationItem>& representation_item, std::vector<shared_ptr<StyleData> >& vec_style_data )
143+ // {
144+ // std::vector<weak_ptr<IfcStyledItem> >& vec_StyledByItem_inverse = representation_item->m_StyledByItem_inverse;
145+ // for( size_t i = 0; i < vec_StyledByItem_inverse.size(); ++i )
146+ // {
147+ // weak_ptr<IfcStyledItem> styled_item_weak = vec_StyledByItem_inverse[i];
148+ // shared_ptr<IfcStyledItem> styled_item = shared_ptr<IfcStyledItem>( styled_item_weak );
149+ // m_styles_converter->convertIfcStyledItem( styled_item, vec_style_data );
150+ // }
151+ // }
152+
153+ void convertIfcRepresentation ( const shared_ptr<IfcRepresentation>& ifcRepresentation, shared_ptr<ItemShapeData>& representationData )
143154 {
144- std::vector<weak_ptr<IfcStyledItem> >& vec_StyledByItem_inverse = representation_item->m_StyledByItem_inverse ;
145- for ( size_t i = 0 ; i < vec_StyledByItem_inverse.size (); ++i )
146- {
147- weak_ptr<IfcStyledItem> styled_item_weak = vec_StyledByItem_inverse[i];
148- shared_ptr<IfcStyledItem> styled_item = shared_ptr<IfcStyledItem>( styled_item_weak );
149- m_styles_converter->convertIfcStyledItem ( styled_item, vec_style_data );
150- }
151- }
155+ representationData->m_ifc_representation = ifcRepresentation;
152156
153- void convertIfcRepresentation ( const shared_ptr<IfcRepresentation>& ifc_representation, shared_ptr<ItemShapeData>& representation_data )
154- {
155- representation_data->m_ifc_representation = ifc_representation;
156-
157- for ( const shared_ptr<IfcRepresentationItem>& representation_item : ifc_representation->m_Items )
157+ for ( const shared_ptr<IfcRepresentationItem>& representationItem : ifcRepresentation->m_Items )
158158 {
159159 // ENTITY IfcRepresentationItem ABSTRACT SUPERTYPE OF(ONEOF(IfcGeometricRepresentationItem, IfcMappedItem, IfcStyledItem, IfcTopologicalRepresentationItem));
160- shared_ptr<IfcGeometricRepresentationItem> geom_item = dynamic_pointer_cast<IfcGeometricRepresentationItem>( representation_item );
161- if ( geom_item )
160+ shared_ptr<IfcGeometricRepresentationItem> geomItem = dynamic_pointer_cast<IfcGeometricRepresentationItem>( representationItem );
161+ if ( geomItem )
162162 {
163- shared_ptr<ItemShapeData> geom_item_data ( new ItemShapeData () );
163+ shared_ptr<ItemShapeData> geomItemData ( new ItemShapeData () );
164164
165165 try
166166 {
167- convertIfcGeometricRepresentationItem ( geom_item, geom_item_data );
168- representation_data ->addGeometricChildItem (geom_item_data, representation_data );
167+ convertIfcGeometricRepresentationItem ( geomItem, geomItemData );
168+ representationData ->addGeometricChildItem (geomItemData, representationData );
169169 }
170170 catch ( BuildingException& e )
171171 {
172- messageCallback ( e.what (), StatusCallback::MESSAGE_TYPE_ERROR, " " , representation_item .get () );
172+ messageCallback ( e.what (), StatusCallback::MESSAGE_TYPE_ERROR, " " , representationItem .get () );
173173 }
174174 catch ( std::exception& e )
175175 {
176- messageCallback ( e.what (), StatusCallback::MESSAGE_TYPE_ERROR, __FUNC__, representation_item .get () );
176+ messageCallback ( e.what (), StatusCallback::MESSAGE_TYPE_ERROR, __FUNC__, representationItem .get () );
177177 }
178178
179179 continue ;
180180 }
181181
182- shared_ptr<IfcMappedItem> mapped_item = dynamic_pointer_cast<IfcMappedItem>( representation_item );
182+ shared_ptr<IfcMappedItem> mapped_item = dynamic_pointer_cast<IfcMappedItem>( representationItem );
183183 if ( mapped_item )
184184 {
185185 shared_ptr<IfcRepresentationMap> map_source = mapped_item->m_MappingSource ;
186186 if ( !map_source )
187187 {
188- messageCallback ( " MappingSource not valid" , StatusCallback::MESSAGE_TYPE_WARNING, __FUNC__, representation_item .get () );
188+ messageCallback ( " MappingSource not valid" , StatusCallback::MESSAGE_TYPE_WARNING, __FUNC__, representationItem .get () );
189189 continue ;
190190 }
191191 shared_ptr<IfcRepresentation> mapped_representation = map_source->m_MappedRepresentation ;
192192 if ( !mapped_representation )
193193 {
194- messageCallback ( " MappingSource.MappedRepresentation not valid" , StatusCallback::MESSAGE_TYPE_WARNING, __FUNC__, representation_item .get () );
194+ messageCallback ( " MappingSource.MappedRepresentation not valid" , StatusCallback::MESSAGE_TYPE_WARNING, __FUNC__, representationItem .get () );
195195 continue ;
196196 }
197197
@@ -237,7 +237,7 @@ class RepresentationConverter : public StatusCallback
237237 if ( m_geom_settings->handleStyledItems () )
238238 {
239239 std::vector<shared_ptr<StyleData> > vec_style_data;
240- convertRepresentationStyle ( representation_item , vec_style_data );
240+ m_styles_converter-> convertRepresentationStyle ( representationItem , vec_style_data );
241241
242242 if ( vec_style_data.size () > 0 )
243243 {
@@ -258,32 +258,32 @@ class RepresentationConverter : public StatusCallback
258258 double eps = m_geom_settings->getEpsilonMergePoints ();
259259 mapped_input_data->applyTransformToItem (mapped_pos, eps, false );
260260 }
261- representation_data ->addGeometricChildItem ( mapped_input_data, representation_data );
261+ representationData ->addGeometricChildItem ( mapped_input_data, representationData );
262262 continue ;
263263 }
264264
265- shared_ptr<IfcStyledItem> styled_item = dynamic_pointer_cast<IfcStyledItem>( representation_item );
265+ shared_ptr<IfcStyledItem> styled_item = dynamic_pointer_cast<IfcStyledItem>( representationItem );
266266 if ( styled_item )
267267 {
268268 continue ;
269269 }
270270
271- shared_ptr<IfcTopologicalRepresentationItem> topo_item = dynamic_pointer_cast<IfcTopologicalRepresentationItem>( representation_item );
271+ shared_ptr<IfcTopologicalRepresentationItem> topo_item = dynamic_pointer_cast<IfcTopologicalRepresentationItem>( representationItem );
272272 if ( topo_item )
273273 {
274274 shared_ptr<ItemShapeData> topological_item_data ( new ItemShapeData () );
275- representation_data ->addGeometricChildItem ( topological_item_data, representation_data );
275+ representationData ->addGeometricChildItem ( topological_item_data, representationData );
276276 // topological_item_data->m_ifc_representation_item = topo_item;
277277 convertTopologicalRepresentationItem (topo_item, topological_item_data);
278278 continue ;
279279 }
280280
281- messageCallback ( " unhandled representation" , StatusCallback::MESSAGE_TYPE_WARNING, __FUNC__, representation_item .get () );
281+ messageCallback ( " unhandled representation" , StatusCallback::MESSAGE_TYPE_WARNING, __FUNC__, representationItem .get () );
282282 }
283283
284284 if ( m_geom_settings->handleLayerAssignments () )
285285 {
286- std::vector<weak_ptr<IfcPresentationLayerAssignment> >& vec_layer_assignments_inverse = ifc_representation ->m_LayerAssignments_inverse ;
286+ std::vector<weak_ptr<IfcPresentationLayerAssignment> >& vec_layer_assignments_inverse = ifcRepresentation ->m_LayerAssignments_inverse ;
287287 for ( size_t ii = 0 ; ii < vec_layer_assignments_inverse.size (); ++ii )
288288 {
289289 weak_ptr<IfcPresentationLayerAssignment>& layer_assignment_weak = vec_layer_assignments_inverse[ii];
@@ -314,7 +314,7 @@ class RepresentationConverter : public StatusCallback
314314 m_styles_converter->convertIfcPresentationStyle ( presentation_style, style_data );
315315 if ( style_data )
316316 {
317- representation_data ->addStyle ( style_data );
317+ representationData ->addStyle ( style_data );
318318 }
319319 }
320320 }
@@ -347,7 +347,7 @@ class RepresentationConverter : public StatusCallback
347347 if ( m_geom_settings->handleStyledItems () )
348348 {
349349 std::vector<shared_ptr<StyleData> > vec_style_data;
350- convertRepresentationStyle ( geom_item, vec_style_data );
350+ m_styles_converter-> convertRepresentationStyle ( geom_item, vec_style_data );
351351 for (auto & style : vec_style_data)
352352 {
353353 item_data->addStyle (style);
@@ -373,7 +373,7 @@ class RepresentationConverter : public StatusCallback
373373 m_solid_converter->convertIfcBooleanResult ( boolean_result, item_data );
374374 return ;
375375 }
376-
376+
377377 shared_ptr<IfcSolidModel> solid_model = dynamic_pointer_cast<IfcSolidModel>( geom_item );
378378 if ( solid_model )
379379 {
0 commit comments