@@ -94,7 +94,7 @@ class RepresentationConverter : public StatusCallback
94
94
m_curve_converter = shared_ptr<CurveConverter>( new CurveConverter ( m_geom_settings, m_placement_converter, m_point_converter, m_spline_converter ) );
95
95
m_profile_cache = shared_ptr<ProfileCache>( new ProfileCache ( m_curve_converter, m_spline_converter ) );
96
96
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 ) );
98
98
99
99
// this redirects the callback messages from all converters to RepresentationConverter's callback
100
100
m_styles_converter->setMessageTarget ( this );
@@ -139,59 +139,59 @@ class RepresentationConverter : public StatusCallback
139
139
m_face_converter->m_unit_converter = unit_converter;
140
140
}
141
141
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 )
143
154
{
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;
152
156
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 )
158
158
{
159
159
// 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 )
162
162
{
163
- shared_ptr<ItemShapeData> geom_item_data ( new ItemShapeData () );
163
+ shared_ptr<ItemShapeData> geomItemData ( new ItemShapeData () );
164
164
165
165
try
166
166
{
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 );
169
169
}
170
170
catch ( BuildingException& e )
171
171
{
172
- messageCallback ( e.what (), StatusCallback::MESSAGE_TYPE_ERROR, " " , representation_item .get () );
172
+ messageCallback ( e.what (), StatusCallback::MESSAGE_TYPE_ERROR, " " , representationItem .get () );
173
173
}
174
174
catch ( std::exception & e )
175
175
{
176
- messageCallback ( e.what (), StatusCallback::MESSAGE_TYPE_ERROR, __FUNC__, representation_item .get () );
176
+ messageCallback ( e.what (), StatusCallback::MESSAGE_TYPE_ERROR, __FUNC__, representationItem .get () );
177
177
}
178
178
179
179
continue ;
180
180
}
181
181
182
- shared_ptr<IfcMappedItem> mapped_item = dynamic_pointer_cast<IfcMappedItem>( representation_item );
182
+ shared_ptr<IfcMappedItem> mapped_item = dynamic_pointer_cast<IfcMappedItem>( representationItem );
183
183
if ( mapped_item )
184
184
{
185
185
shared_ptr<IfcRepresentationMap> map_source = mapped_item->m_MappingSource ;
186
186
if ( !map_source )
187
187
{
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 () );
189
189
continue ;
190
190
}
191
191
shared_ptr<IfcRepresentation> mapped_representation = map_source->m_MappedRepresentation ;
192
192
if ( !mapped_representation )
193
193
{
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 () );
195
195
continue ;
196
196
}
197
197
@@ -237,7 +237,7 @@ class RepresentationConverter : public StatusCallback
237
237
if ( m_geom_settings->handleStyledItems () )
238
238
{
239
239
std::vector<shared_ptr<StyleData> > vec_style_data;
240
- convertRepresentationStyle ( representation_item , vec_style_data );
240
+ m_styles_converter-> convertRepresentationStyle ( representationItem , vec_style_data );
241
241
242
242
if ( vec_style_data.size () > 0 )
243
243
{
@@ -258,32 +258,32 @@ class RepresentationConverter : public StatusCallback
258
258
double eps = m_geom_settings->getEpsilonMergePoints ();
259
259
mapped_input_data->applyTransformToItem (mapped_pos, eps, false );
260
260
}
261
- representation_data ->addGeometricChildItem ( mapped_input_data, representation_data );
261
+ representationData ->addGeometricChildItem ( mapped_input_data, representationData );
262
262
continue ;
263
263
}
264
264
265
- shared_ptr<IfcStyledItem> styled_item = dynamic_pointer_cast<IfcStyledItem>( representation_item );
265
+ shared_ptr<IfcStyledItem> styled_item = dynamic_pointer_cast<IfcStyledItem>( representationItem );
266
266
if ( styled_item )
267
267
{
268
268
continue ;
269
269
}
270
270
271
- shared_ptr<IfcTopologicalRepresentationItem> topo_item = dynamic_pointer_cast<IfcTopologicalRepresentationItem>( representation_item );
271
+ shared_ptr<IfcTopologicalRepresentationItem> topo_item = dynamic_pointer_cast<IfcTopologicalRepresentationItem>( representationItem );
272
272
if ( topo_item )
273
273
{
274
274
shared_ptr<ItemShapeData> topological_item_data ( new ItemShapeData () );
275
- representation_data ->addGeometricChildItem ( topological_item_data, representation_data );
275
+ representationData ->addGeometricChildItem ( topological_item_data, representationData );
276
276
// topological_item_data->m_ifc_representation_item = topo_item;
277
277
convertTopologicalRepresentationItem (topo_item, topological_item_data);
278
278
continue ;
279
279
}
280
280
281
- messageCallback ( " unhandled representation" , StatusCallback::MESSAGE_TYPE_WARNING, __FUNC__, representation_item .get () );
281
+ messageCallback ( " unhandled representation" , StatusCallback::MESSAGE_TYPE_WARNING, __FUNC__, representationItem .get () );
282
282
}
283
283
284
284
if ( m_geom_settings->handleLayerAssignments () )
285
285
{
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 ;
287
287
for ( size_t ii = 0 ; ii < vec_layer_assignments_inverse.size (); ++ii )
288
288
{
289
289
weak_ptr<IfcPresentationLayerAssignment>& layer_assignment_weak = vec_layer_assignments_inverse[ii];
@@ -314,7 +314,7 @@ class RepresentationConverter : public StatusCallback
314
314
m_styles_converter->convertIfcPresentationStyle ( presentation_style, style_data );
315
315
if ( style_data )
316
316
{
317
- representation_data ->addStyle ( style_data );
317
+ representationData ->addStyle ( style_data );
318
318
}
319
319
}
320
320
}
@@ -347,7 +347,7 @@ class RepresentationConverter : public StatusCallback
347
347
if ( m_geom_settings->handleStyledItems () )
348
348
{
349
349
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 );
351
351
for (auto & style : vec_style_data)
352
352
{
353
353
item_data->addStyle (style);
@@ -373,7 +373,7 @@ class RepresentationConverter : public StatusCallback
373
373
m_solid_converter->convertIfcBooleanResult ( boolean_result, item_data );
374
374
return ;
375
375
}
376
-
376
+
377
377
shared_ptr<IfcSolidModel> solid_model = dynamic_pointer_cast<IfcSolidModel>( geom_item );
378
378
if ( solid_model )
379
379
{
0 commit comments