Skip to content

Commit d02eeac

Browse files
committed
Reduce unnecessary use of smart pointers
Speed up type checking by using std::maps and switch statements Add compile flag to win/IfcGeom.vcproj
1 parent b17832e commit d02eeac

21 files changed

+5539
-5491
lines changed

src/ifcexpressparser/IfcExpressParser.py

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class SelectType:
145145
def __init__(self,l):
146146
for x in l:
147147
if x in simple_types: selectable_simple_types.add(x)
148-
def __str__(self): return "SHARED_PTR<IfcAbstractSelect>"
148+
def __str__(self): return "IfcSchemaEntity"
149149
class BinaryType:
150150
def __init__(self,l): self.l = int(l)
151151
def __str__(self): return "char[%s]"%self.l
@@ -209,7 +209,7 @@ def __str__(self):
209209
if ( str(a.type) in enumerations ):
210210
return_type = "%(type)s::%(type)s"%a.__dict__
211211
elif ( str(a.type) in entity_names ):
212-
return_type = "SHARED_PTR<%(type)s>"%a.__dict__
212+
return_type = "%(type)s*"%a.__dict__
213213
s += "\n%s%s %s%s()%s"%(indent,return_type,class_name,a.name,function_body)
214214
argv += 1
215215
return s
@@ -237,20 +237,20 @@ def __str__(self):
237237
"IfcBaseClass" if self.parent_class is None else self.parent_class,
238238
self.arguments,
239239
self.inverse,
240-
("\n bool is(Type::Enum v);"+
241-
"\n Type::Enum type();"+
240+
("\n bool is(Type::Enum v) const;"+
241+
"\n Type::Enum type() const;"+
242242
"\n static Type::Enum Class();"+
243243
"\n %(class_name)s (IfcAbstractEntityPtr e = IfcAbstractEntityPtr());"+
244-
"\n typedef SHARED_PTR<%(class_name)s> ptr;"+
244+
"\n typedef %(class_name)s* ptr;"+
245245
"\n typedef SHARED_PTR< IfcTemplatedEntityList<%(class_name)s> > list;"+
246246
"\n typedef IfcTemplatedEntityList<%(class_name)s>::it it;")%self.__dict__
247247
)
248248
elif generator_mode == 'SOURCE':
249249
self.arguments.argstart = argument_start(self.class_name)
250250
return (("\n// %(class_name)s"+str(self.arguments)+str(self.inverse)+
251-
("\nbool %(class_name)s::is(Type::Enum v) { return v == Type::%(class_name)s; }" if self.parent_class is None else
252-
"\nbool %(class_name)s::is(Type::Enum v) { return v == Type::%(class_name)s || %(parent_class)s::is(v); }")+
253-
"\nType::Enum %(class_name)s::type() { return Type::%(class_name)s; }"+
251+
("\nbool %(class_name)s::is(Type::Enum v) const { return v == Type::%(class_name)s; }" if self.parent_class is None else
252+
"\nbool %(class_name)s::is(Type::Enum v) const { return v == Type::%(class_name)s || %(parent_class)s::is(v); }")+
253+
"\nType::Enum %(class_name)s::type() const { return Type::%(class_name)s; }"+
254254
"\nType::Enum %(class_name)s::Class() { return Type::%(class_name)s; }"+
255255
"\n%(class_name)s::%(class_name)s(IfcAbstractEntityPtr e) { if (!is(Type::%(class_name)s)) throw; entity = e; }")%self.__dict__)%self.__dict__
256256

@@ -340,6 +340,7 @@ def __str__(self):
340340
341341
#include <string>
342342
#include <vector>
343+
#include <map>
343344
344345
#include "../ifcparse/IfcUtil.h"
345346
#include "../ifcparse/%(schema)senum.h"
@@ -417,8 +418,9 @@ def __str__(self):
417418
if c.parent_class is None or c.parent_class in defined_classes:
418419
defined_classes.add(c.class_name)
419420
print >>h_file, c
420-
421-
print >>h_file, "IfcSchemaEntity SchemaEntity(IfcAbstractEntityPtr e = IfcAbstractEntityPtr());"
421+
422+
print >>h_file, "void InitStringMap();"
423+
print >>h_file, "IfcSchemaEntity SchemaEntity(IfcAbstractEntityPtr e = 0);"
422424

423425
print >>h_file, "}\n\n#endif"
424426

@@ -428,35 +430,47 @@ def __str__(self):
428430
429431
using namespace %(schema)s;
430432
431-
IfcSchemaEntity %(schema)s::SchemaEntity(IfcAbstractEntityPtr e) {"""%{'schema':schema_version}
433+
IfcSchemaEntity %(schema)s::SchemaEntity(IfcAbstractEntityPtr e) {
434+
switch(e->type()){"""%{'schema':schema_version}
432435

433436
for e in simple_enumerations:
434-
print >>cpp_file, " if ( e->is(Type::%s) ) return IfcSchemaEntity(new IfcEntitySelect(e));"%e
437+
print >>cpp_file, " case Type::%s: return new IfcEntitySelect(e); break;"%e
435438
for e in entity_enumerations:
436-
print >>cpp_file, " if ( e->is(Type::%s) ) return IfcSchemaEntity(new %s(e));"%(e,e)
437-
print >>cpp_file, " throw; "
438-
print >>cpp_file, "}"
439+
print >>cpp_file, " case Type::%s: return new %s(e); break;"%(e,e)
440+
print >>cpp_file, " default: throw; break; "
441+
print >>cpp_file, " }\n}"
439442
print >>cpp_file
440443
print >>cpp_file, "std::string Type::ToString(Enum v) {"
441444
print >>cpp_file, " if (v < 0 || v >= %d) throw;"%len(all_enumerations)
442445
print >>cpp_file, ' const char* names[] = { "%s" };'%'","'.join(all_enumerations)
443446
print >>cpp_file, ' return names[v];'
444447
print >>cpp_file, "}"
445448
print >>cpp_file
446-
print >>cpp_file, "Type::Enum Type::FromString(const std::string& s){"
447-
elseif = "if"
449+
#print >>cpp_file, "Type::Enum Type::FromStringOld(const std::string& s){"
450+
#elseif = "if"
451+
#maxlen = max([len(e) for e in all_enumerations])
452+
#for e in all_enumerations:
453+
# print >>cpp_file, ' %s(s=="%s"%s) { return %s; }'%(elseif,e.upper()," "*(maxlen-len(e)),e)
454+
#print >>cpp_file, " throw;"
455+
#print >>cpp_file, "}"
456+
print >>cpp_file, "std::map<std::string,Type::Enum> string_map;"
457+
print >>cpp_file, "void Ifc2x3::InitStringMap() {"
448458
maxlen = max([len(e) for e in all_enumerations])
449459
for e in all_enumerations:
450-
print >>cpp_file, ' %s(s=="%s"%s) { return %s; }'%(elseif,e.upper()," "*(maxlen-len(e)),e)
451-
print >>cpp_file, " throw;"
452-
print >>cpp_file, "}"
460+
print >>cpp_file, ' string_map["%s"%s] = Type::%s;'%(e.upper()," "*(maxlen-len(e)),e)
461+
print >>cpp_file, """}
462+
Type::Enum Type::FromString(const std::string& s) {
463+
std::map<std::string,Type::Enum>::const_iterator it = string_map.find(s);
464+
if ( it == string_map.end() ) throw;
465+
else return it->second;
466+
}"""
453467

454468
print >>cpp_file, "Type::Enum Type::Parent(Enum v){"
455-
print >>cpp_file, " if (v < 0 || v >= %d) return -1;"%len(all_enumerations)
469+
print >>cpp_file, " if (v < 0 || v >= %d) return (Enum)-1;"%len(all_enumerations)
456470
for e in entity_enumerations:
457-
if e not in parent_relations: continue
471+
if e not in parent_relations or parent_relations[e] is None: continue
458472
print >>cpp_file, ' if(v==%s%s) { return %s; }'%(e," "*(maxlen-len(e)),parent_relations[e])
459-
print >>cpp_file, " return -1;"
473+
print >>cpp_file, " return (Enum)-1;"
460474
print >>cpp_file, "}"
461475

462476
for t in [T for T in types if isinstance(T.type,EnumType)]:

src/ifcgeom/IfcGeom.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535

3636
namespace IfcGeom {
3737
bool convert_wire_to_face(const TopoDS_Wire& wire, TopoDS_Face& face);
38-
bool convert_shape(const SHARED_PTR<IfcUtil::IfcBaseClass>& L, TopoDS_Shape& result);
39-
bool convert_wire(const SHARED_PTR<IfcUtil::IfcBaseClass>& L, TopoDS_Wire& result);
40-
bool convert_curve(const SHARED_PTR<IfcUtil::IfcBaseClass>& L, Handle(Geom_Curve)& result);
41-
bool convert_face(const SHARED_PTR<IfcUtil::IfcBaseClass>& L, TopoDS_Face& result);
42-
bool convert_openings(const Ifc2x3::IfcProduct::ptr& L, const Ifc2x3::IfcRelVoidsElement::list& openings, TopoDS_Shape& result, const gp_Trsf& trsf);
38+
bool convert_shape(const IfcUtil::IfcBaseClass* L, TopoDS_Shape& result);
39+
bool convert_wire(const IfcUtil::IfcBaseClass* L, TopoDS_Wire& result);
40+
bool convert_curve(const IfcUtil::IfcBaseClass* L, Handle(Geom_Curve)& result);
41+
bool convert_face(const IfcUtil::IfcBaseClass* L, TopoDS_Face& result);
42+
bool convert_openings(const Ifc2x3::IfcProduct::ptr L, const Ifc2x3::IfcRelVoidsElement::list& openings, TopoDS_Shape& result, const gp_Trsf& trsf);
4343
bool profile_helper(int numVerts, float* verts, int numFillets, int* filletIndices, float* filletRadii, gp_Trsf2d trsf, TopoDS_Face& face);
4444
namespace Cache {
4545
void Purge();

src/ifcgeom/IfcGeomCurves.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,40 +74,40 @@
7474

7575
#include "../ifcgeom/IfcGeom.h"
7676

77-
bool IfcGeom::convert(const Ifc2x3::IfcCircle::ptr& l, Handle(Geom_Curve)& curve) {
77+
bool IfcGeom::convert(const Ifc2x3::IfcCircle::ptr l, Handle(Geom_Curve)& curve) {
7878
const float r = l->Radius() * Ifc::LengthUnit;
7979
if ( r <= 0.0f ) { return false; }
8080
gp_Trsf trsf;
8181
Ifc2x3::IfcAxis2Placement placement = l->Position();
8282
if (placement->is(Ifc2x3::Type::IfcAxis2Placement3D)) {
83-
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement3D>(placement),trsf);
83+
IfcGeom::convert((Ifc2x3::IfcAxis2Placement3D*)placement,trsf);
8484
} else {
8585
gp_Trsf2d trsf2d;
86-
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement2D>(placement),trsf2d);
86+
IfcGeom::convert((IfcAxis2Placement2D*)placement,trsf2d);
8787
trsf = trsf2d;
8888
}
8989
gp_Ax2 ax = gp_Ax2().Transformed(trsf);
9090
curve = new Geom_Circle(ax, r);
9191
return true;
9292
}
93-
bool IfcGeom::convert(const Ifc2x3::IfcEllipse::ptr& l, Handle(Geom_Curve)& curve) {
93+
bool IfcGeom::convert(const Ifc2x3::IfcEllipse::ptr l, Handle(Geom_Curve)& curve) {
9494
float x = l->SemiAxis1() * Ifc::LengthUnit;
9595
float y = l->SemiAxis2() * Ifc::LengthUnit;
9696
if ( x == 0.0f || y == 0.0f || y > x ) { return false; }
9797
gp_Trsf trsf;
9898
Ifc2x3::IfcAxis2Placement placement = l->Position();
9999
if (placement->is(Ifc2x3::Type::IfcAxis2Placement3D)) {
100-
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement3D>(placement),trsf);
100+
IfcGeom::convert((Ifc2x3::IfcAxis2Placement3D*)placement,trsf);
101101
} else {
102102
gp_Trsf2d trsf2d;
103-
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement2D>(placement),trsf2d);
103+
IfcGeom::convert((Ifc2x3::IfcAxis2Placement2D*)placement,trsf2d);
104104
trsf = trsf2d;
105105
}
106106
gp_Ax2 ax = gp_Ax2().Transformed(trsf);
107107
curve = new Geom_Ellipse(ax, x, y);
108108
return true;
109109
}
110-
bool IfcGeom::convert(const Ifc2x3::IfcLine::ptr& l, Handle(Geom_Curve)& curve) {
110+
bool IfcGeom::convert(const Ifc2x3::IfcLine::ptr l, Handle(Geom_Curve)& curve) {
111111
gp_Pnt pnt;gp_Vec vec;
112112
IfcGeom::convert(l->Pnt(),pnt);
113113
IfcGeom::convert(l->Dir(),vec);

src/ifcgeom/IfcGeomFaces.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676

7777
#include "../ifcgeom/IfcGeom.h"
7878

79-
bool IfcGeom::convert(const Ifc2x3::IfcFace::ptr& l, TopoDS_Face& face) {
79+
bool IfcGeom::convert(const Ifc2x3::IfcFace::ptr l, TopoDS_Face& face) {
8080
Ifc2x3::IfcFaceBound::list bounds = l->Bounds();
8181
Ifc2x3::IfcFaceBound::it it = bounds->begin();
8282
Ifc2x3::IfcLoop::ptr loop = (*it)->Bound();
@@ -111,12 +111,12 @@ bool IfcGeom::convert(const Ifc2x3::IfcFace::ptr& l, TopoDS_Face& face) {
111111
return false;
112112
}
113113
}
114-
bool IfcGeom::convert(const Ifc2x3::IfcArbitraryClosedProfileDef::ptr& l, TopoDS_Face& face) {
114+
bool IfcGeom::convert(const Ifc2x3::IfcArbitraryClosedProfileDef::ptr l, TopoDS_Face& face) {
115115
TopoDS_Wire wire;
116116
if ( ! IfcGeom::convert_wire(l->OuterCurve(),wire) ) return false;
117117
return IfcGeom::convert_wire_to_face(wire,face);
118118
}
119-
bool IfcGeom::convert(const Ifc2x3::IfcArbitraryProfileDefWithVoids::ptr& l, TopoDS_Face& face) {
119+
bool IfcGeom::convert(const Ifc2x3::IfcArbitraryProfileDefWithVoids::ptr l, TopoDS_Face& face) {
120120
TopoDS_Wire profile;
121121
if ( ! IfcGeom::convert_wire(l->OuterCurve(),profile) ) return false;
122122
BRepBuilderAPI_MakeFace mf(profile);
@@ -132,7 +132,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcArbitraryProfileDefWithVoids::ptr& l, Top
132132
face = TopoDS::Face(sfs.Shape());
133133
return true;
134134
}
135-
bool IfcGeom::convert(const Ifc2x3::IfcRectangleProfileDef::ptr& l, TopoDS_Face& face) {
135+
bool IfcGeom::convert(const Ifc2x3::IfcRectangleProfileDef::ptr l, TopoDS_Face& face) {
136136
const float x = l->XDim() / 2.0f * Ifc::LengthUnit;
137137
const float y = l->YDim() / 2.0f * Ifc::LengthUnit;
138138

@@ -146,7 +146,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcRectangleProfileDef::ptr& l, TopoDS_Face&
146146
float coords[8] = {-x,-y,x,-y,x,y,-x,y};
147147
return IfcGeom::profile_helper(4,coords,0,0,0,trsf2d,face);
148148
}
149-
bool IfcGeom::convert(const Ifc2x3::IfcIShapeProfileDef::ptr& l, TopoDS_Face& face) {
149+
bool IfcGeom::convert(const Ifc2x3::IfcIShapeProfileDef::ptr l, TopoDS_Face& face) {
150150
const float x = l->OverallWidth() / 2.0f * Ifc::LengthUnit;
151151
const float y = l->OverallDepth() / 2.0f * Ifc::LengthUnit;
152152
const float d1 = l->WebThickness() / 2.0f * Ifc::LengthUnit;
@@ -170,7 +170,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcIShapeProfileDef::ptr& l, TopoDS_Face& fa
170170
float radii[4] = {f,f,f,f};
171171
return IfcGeom::profile_helper(12,coords,doFillet ? 4 : 0,fillets,radii,trsf2d,face);
172172
}
173-
bool IfcGeom::convert(const Ifc2x3::IfcCShapeProfileDef::ptr& l, TopoDS_Face& face) {
173+
bool IfcGeom::convert(const Ifc2x3::IfcCShapeProfileDef::ptr l, TopoDS_Face& face) {
174174
const float x = l->Depth() / 2.0f * Ifc::LengthUnit;
175175
const float y = l->Width() / 2.0f * Ifc::LengthUnit;
176176
const float d1 = l->WallThickness() * Ifc::LengthUnit;
@@ -195,7 +195,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcCShapeProfileDef::ptr& l, TopoDS_Face& fa
195195
float radii[8] = {f2,f2,f1,f1,f1,f1,f2,f2};
196196
return IfcGeom::profile_helper(12,coords,doFillet ? 8 : 0,fillets,radii,trsf2d,face);
197197
}
198-
bool IfcGeom::convert(const Ifc2x3::IfcLShapeProfileDef::ptr& l, TopoDS_Face& face) {
198+
bool IfcGeom::convert(const Ifc2x3::IfcLShapeProfileDef::ptr l, TopoDS_Face& face) {
199199
const float y = l->Depth() / 2.0f * Ifc::LengthUnit;
200200
const float x = l->Width() / 2.0f * Ifc::LengthUnit;
201201
const float d = l->Thickness() * Ifc::LengthUnit;
@@ -222,7 +222,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcLShapeProfileDef::ptr& l, TopoDS_Face& fa
222222
float radii[3] = {f2,f1,f2};
223223
return IfcGeom::profile_helper(6,coords,doFillet ? 3 : 0,fillets,radii,trsf2d,face);
224224
}
225-
bool IfcGeom::convert(const Ifc2x3::IfcCircleProfileDef::ptr& l, TopoDS_Face& face) {
225+
bool IfcGeom::convert(const Ifc2x3::IfcCircleProfileDef::ptr l, TopoDS_Face& face) {
226226
const float r = l->Radius() * Ifc::LengthUnit;
227227
if ( r == 0.0f ) {
228228
Ifc::LogMessage("Notice","Skipping zero sized profile:",l->entity);
@@ -239,7 +239,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcCircleProfileDef::ptr& l, TopoDS_Face& fa
239239
w.Add(edge);
240240
return IfcGeom::convert_wire_to_face(w,face);
241241
}
242-
bool IfcGeom::convert(const Ifc2x3::IfcCircleHollowProfileDef::ptr& l, TopoDS_Face& face) {
242+
bool IfcGeom::convert(const Ifc2x3::IfcCircleHollowProfileDef::ptr l, TopoDS_Face& face) {
243243
const float r = l->Radius() * Ifc::LengthUnit;
244244
const float t = l->WallThickness() * Ifc::LengthUnit;
245245

src/ifcgeom/IfcGeomFunctions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
#include "../ifcgeom/IfcGeom.h"
7676

77-
bool IfcGeom::convert_openings(const Ifc2x3::IfcProduct::ptr& entity,
77+
bool IfcGeom::convert_openings(const Ifc2x3::IfcProduct::ptr entity,
7878
const Ifc2x3::IfcRelVoidsElement::list& openings, TopoDS_Shape& result, const gp_Trsf& trsf2) {
7979
for ( Ifc2x3::IfcRelVoidsElement::it it = openings->begin(); it != openings->end(); ++ it ) {
8080
Ifc2x3::IfcRelVoidsElement::ptr v = *it;

src/ifcgeom/IfcGeomHelpers.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace IfcGeom {
8484
if ( it != Cache::T.end() ) { e = it->second; return true; }
8585
#define CACHE(T,E,e) Cache::T[E->entity->id()] = e;
8686

87-
bool IfcGeom::convert(const Ifc2x3::IfcCartesianPoint::ptr& l, gp_Pnt& point) {
87+
bool IfcGeom::convert(const Ifc2x3::IfcCartesianPoint::ptr l, gp_Pnt& point) {
8888
IN_CACHE(IfcCartesianPoint,l,gp_Pnt,point)
8989
std::vector<float> xyz = l->Coordinates();
9090
point = gp_Pnt(
@@ -95,7 +95,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcCartesianPoint::ptr& l, gp_Pnt& point) {
9595
CACHE(IfcCartesianPoint,l,point)
9696
return true;
9797
}
98-
bool IfcGeom::convert(const Ifc2x3::IfcDirection::ptr& l, gp_Dir& dir) {
98+
bool IfcGeom::convert(const Ifc2x3::IfcDirection::ptr l, gp_Dir& dir) {
9999
IN_CACHE(IfcDirection,l,gp_Dir,dir)
100100
std::vector<float> xyz = l->DirectionRatios();
101101
dir = gp_Dir(
@@ -106,15 +106,15 @@ bool IfcGeom::convert(const Ifc2x3::IfcDirection::ptr& l, gp_Dir& dir) {
106106
CACHE(IfcDirection,l,dir)
107107
return true;
108108
}
109-
bool IfcGeom::convert(const Ifc2x3::IfcVector::ptr& l, gp_Vec& v) {
109+
bool IfcGeom::convert(const Ifc2x3::IfcVector::ptr l, gp_Vec& v) {
110110
IN_CACHE(IfcVector,l,gp_Vec,v)
111111
gp_Dir d;
112112
IfcGeom::convert(l->Orientation(),d);
113113
v = l->Magnitude() * Ifc::LengthUnit * d;
114114
CACHE(IfcVector,l,v)
115115
return true;
116116
}
117-
bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement3D::ptr& l, gp_Trsf& trsf) {
117+
bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement3D::ptr l, gp_Trsf& trsf) {
118118
IN_CACHE(IfcAxis2Placement3D,l,gp_Trsf,trsf)
119119
gp_Pnt o;gp_Dir axis = gp_Dir(0,0,1);gp_Dir refDirection;
120120
IfcGeom::convert(l->Location(),o);
@@ -128,7 +128,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement3D::ptr& l, gp_Trsf& trsf)
128128
CACHE(IfcAxis2Placement3D,l,trsf)
129129
return true;
130130
}
131-
bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator3D::ptr& l, gp_Trsf& trsf) {
131+
bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator3D::ptr l, gp_Trsf& trsf) {
132132
IN_CACHE(IfcCartesianTransformationOperator3D,l,gp_Trsf,trsf)
133133
gp_Pnt origin;
134134
IfcGeom::convert(l->LocalOrigin(),origin);
@@ -145,7 +145,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator3D::ptr& l
145145
CACHE(IfcCartesianTransformationOperator3D,l,trsf)
146146
return true;
147147
}
148-
bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator2D::ptr& l, gp_Trsf2d& trsf) {
148+
bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator2D::ptr l, gp_Trsf2d& trsf) {
149149
IN_CACHE(IfcCartesianTransformationOperator2D,l,gp_Trsf2d,trsf)
150150
gp_Pnt origin;
151151
IfcGeom::convert(l->LocalOrigin(),origin);
@@ -157,7 +157,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator2D::ptr& l
157157
CACHE(IfcCartesianTransformationOperator2D,l,trsf)
158158
return true;
159159
}
160-
bool IfcGeom::convert(const Ifc2x3::IfcPlane::ptr& pln, gp_Pln& plane) {
160+
bool IfcGeom::convert(const Ifc2x3::IfcPlane::ptr pln, gp_Pln& plane) {
161161
IN_CACHE(IfcPlane,pln,gp_Pln,plane)
162162
Ifc2x3::IfcAxis2Placement3D::ptr l = pln->Position();
163163
gp_Pnt o;gp_Dir axis = gp_Dir(0,0,1);gp_Dir refDirection;
@@ -172,7 +172,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcPlane::ptr& pln, gp_Pln& plane) {
172172
CACHE(IfcPlane,pln,plane)
173173
return true;
174174
}
175-
bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement2D::ptr& l, gp_Trsf2d& trsf) {
175+
bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement2D::ptr l, gp_Trsf2d& trsf) {
176176
IN_CACHE(IfcAxis2Placement2D,l,gp_Trsf2d,trsf)
177177
gp_Pnt P; gp_Dir V (1,0,0);
178178
IfcGeom::convert(l->Location(),P);
@@ -184,15 +184,15 @@ bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement2D::ptr& l, gp_Trsf2d& trsf
184184
CACHE(IfcAxis2Placement2D,l,trsf)
185185
return true;
186186
}
187-
bool IfcGeom::convert(const Ifc2x3::IfcObjectPlacement::ptr& l, gp_Trsf& trsf) {
187+
bool IfcGeom::convert(const Ifc2x3::IfcObjectPlacement::ptr l, gp_Trsf& trsf) {
188188
IN_CACHE(IfcObjectPlacement,l,gp_Trsf,trsf)
189189
if ( ! l->is(Ifc2x3::Type::IfcLocalPlacement) ) return false;
190190
Ifc2x3::IfcLocalPlacement::ptr current = reinterpret_pointer_cast<Ifc2x3::IfcObjectPlacement,Ifc2x3::IfcLocalPlacement>(l);
191191
while (1) {
192192
gp_Trsf trsf2;
193193
Ifc2x3::IfcAxis2Placement relplacement = current->RelativePlacement();
194194
if ( relplacement->is(Ifc2x3::Type::IfcAxis2Placement3D) ) {
195-
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement3D>(relplacement),trsf2);
195+
IfcGeom::convert((Ifc2x3::IfcAxis2Placement3D*)relplacement,trsf2);
196196
trsf.PreMultiply(trsf2);
197197
}
198198
if ( current->hasPlacementRelTo() ) {

0 commit comments

Comments
 (0)