@@ -328,55 +328,6 @@ class IFC_GEOM_API MAKE_TYPE_NAME(Kernel) : public IfcGeom::MAKE_TYPE_NAME(Abstr
328328
329329 std::pair<std::string, double > initializeUnits (IfcSchema::IfcUnitAssignment*);
330330
331- template <typename T> std::pair<IfcSchema::IfcSurfaceStyle*, T*> _get_surface_style (const IfcSchema::IfcStyledItem* si) {
332- #ifdef SCHEMA_HAS_IfcStyleAssignmentSelect
333- IfcEntityList::ptr style_assignments = si->Styles ();
334- for (IfcEntityList::it kt = style_assignments->begin (); kt != style_assignments->end (); ++kt) {
335- if (!(*kt)->declaration ().is (IfcSchema::IfcPresentationStyleAssignment::Class ())) {
336- continue ;
337- }
338- IfcSchema::IfcPresentationStyleAssignment* style_assignment = (IfcSchema::IfcPresentationStyleAssignment*) *kt;
339- #else
340- IfcSchema::IfcPresentationStyleAssignment::list::ptr style_assignments = si->Styles ();
341- for (IfcSchema::IfcPresentationStyleAssignment::list::it kt = style_assignments->begin (); kt != style_assignments->end (); ++kt) {
342- IfcSchema::IfcPresentationStyleAssignment* style_assignment = *kt;
343- #endif
344- IfcEntityList::ptr styles = style_assignment->Styles ();
345- for (IfcEntityList::it lt = styles->begin (); lt != styles->end (); ++lt) {
346- IfcUtil::IfcBaseClass* style = *lt;
347- if (style->declaration ().is (IfcSchema::IfcSurfaceStyle::Class ())) {
348- IfcSchema::IfcSurfaceStyle* surface_style = (IfcSchema::IfcSurfaceStyle*) style;
349- if (surface_style->Side () != IfcSchema::IfcSurfaceSide::IfcSurfaceSide_NEGATIVE) {
350- IfcEntityList::ptr styles_elements = surface_style->Styles ();
351- for (IfcEntityList::it mt = styles_elements->begin (); mt != styles_elements->end (); ++mt) {
352- if ((*mt)->declaration ().is (T::Class ())) {
353- return std::make_pair (surface_style, (T*) *mt);
354- }
355- }
356- }
357- }
358- }
359- }
360-
361- return std::make_pair<IfcSchema::IfcSurfaceStyle*, T*>(0 ,0 );
362- }
363-
364- template <typename T> std::pair<IfcSchema::IfcSurfaceStyle*, T*> get_surface_style (const IfcSchema::IfcRepresentationItem* representation_item) {
365- // For certain representation items, most notably boolean operands,
366- // a style definition might reside on one of its operands.
367- representation_item = find_item_carrying_style (representation_item);
368-
369- if (representation_item->as <IfcSchema::IfcStyledItem>()) {
370- return _get_surface_style<T>(representation_item->as <IfcSchema::IfcStyledItem>());
371- }
372- IfcSchema::IfcStyledItem::list::ptr styled_items = representation_item->StyledByItem ();
373- if (styled_items->size ()) {
374- // StyledByItem is a SET [0:1] OF IfcStyledItem, so we return after the first IfcStyledItem:
375- return _get_surface_style<T>(*styled_items->begin ());
376- }
377- return std::make_pair<IfcSchema::IfcSurfaceStyle*, T*>(0 ,0 );
378- }
379-
380331 void purge_cache () {
381332 // Rather hack-ish, but a stopgap solution to keep memory under control
382333 // for large files. SurfaceStyles need to be kept at all costs, as they
0 commit comments