mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
Reduce unnecessary use of smart pointers
Speed up type checking by using std::maps and switch statements Add compile flag to win/IfcGeom.vcproj
This commit is contained in:
@@ -145,7 +145,7 @@ class SelectType:
|
|||||||
def __init__(self,l):
|
def __init__(self,l):
|
||||||
for x in l:
|
for x in l:
|
||||||
if x in simple_types: selectable_simple_types.add(x)
|
if x in simple_types: selectable_simple_types.add(x)
|
||||||
def __str__(self): return "SHARED_PTR<IfcAbstractSelect>"
|
def __str__(self): return "IfcSchemaEntity"
|
||||||
class BinaryType:
|
class BinaryType:
|
||||||
def __init__(self,l): self.l = int(l)
|
def __init__(self,l): self.l = int(l)
|
||||||
def __str__(self): return "char[%s]"%self.l
|
def __str__(self): return "char[%s]"%self.l
|
||||||
@@ -209,7 +209,7 @@ class ArgumentList:
|
|||||||
if ( str(a.type) in enumerations ):
|
if ( str(a.type) in enumerations ):
|
||||||
return_type = "%(type)s::%(type)s"%a.__dict__
|
return_type = "%(type)s::%(type)s"%a.__dict__
|
||||||
elif ( str(a.type) in entity_names ):
|
elif ( str(a.type) in entity_names ):
|
||||||
return_type = "SHARED_PTR<%(type)s>"%a.__dict__
|
return_type = "%(type)s*"%a.__dict__
|
||||||
s += "\n%s%s %s%s()%s"%(indent,return_type,class_name,a.name,function_body)
|
s += "\n%s%s %s%s()%s"%(indent,return_type,class_name,a.name,function_body)
|
||||||
argv += 1
|
argv += 1
|
||||||
return s
|
return s
|
||||||
@@ -237,20 +237,20 @@ class Classdef:
|
|||||||
"IfcBaseClass" if self.parent_class is None else self.parent_class,
|
"IfcBaseClass" if self.parent_class is None else self.parent_class,
|
||||||
self.arguments,
|
self.arguments,
|
||||||
self.inverse,
|
self.inverse,
|
||||||
("\n bool is(Type::Enum v);"+
|
("\n bool is(Type::Enum v) const;"+
|
||||||
"\n Type::Enum type();"+
|
"\n Type::Enum type() const;"+
|
||||||
"\n static Type::Enum Class();"+
|
"\n static Type::Enum Class();"+
|
||||||
"\n %(class_name)s (IfcAbstractEntityPtr e = IfcAbstractEntityPtr());"+
|
"\n %(class_name)s (IfcAbstractEntityPtr e = IfcAbstractEntityPtr());"+
|
||||||
"\n typedef SHARED_PTR<%(class_name)s> ptr;"+
|
"\n typedef %(class_name)s* ptr;"+
|
||||||
"\n typedef SHARED_PTR< IfcTemplatedEntityList<%(class_name)s> > list;"+
|
"\n typedef SHARED_PTR< IfcTemplatedEntityList<%(class_name)s> > list;"+
|
||||||
"\n typedef IfcTemplatedEntityList<%(class_name)s>::it it;")%self.__dict__
|
"\n typedef IfcTemplatedEntityList<%(class_name)s>::it it;")%self.__dict__
|
||||||
)
|
)
|
||||||
elif generator_mode == 'SOURCE':
|
elif generator_mode == 'SOURCE':
|
||||||
self.arguments.argstart = argument_start(self.class_name)
|
self.arguments.argstart = argument_start(self.class_name)
|
||||||
return (("\n// %(class_name)s"+str(self.arguments)+str(self.inverse)+
|
return (("\n// %(class_name)s"+str(self.arguments)+str(self.inverse)+
|
||||||
("\nbool %(class_name)s::is(Type::Enum v) { return v == Type::%(class_name)s; }" if self.parent_class is None else
|
("\nbool %(class_name)s::is(Type::Enum v) const { return v == Type::%(class_name)s; }" if self.parent_class is None else
|
||||||
"\nbool %(class_name)s::is(Type::Enum v) { return v == Type::%(class_name)s || %(parent_class)s::is(v); }")+
|
"\nbool %(class_name)s::is(Type::Enum v) const { return v == Type::%(class_name)s || %(parent_class)s::is(v); }")+
|
||||||
"\nType::Enum %(class_name)s::type() { return Type::%(class_name)s; }"+
|
"\nType::Enum %(class_name)s::type() const { return Type::%(class_name)s; }"+
|
||||||
"\nType::Enum %(class_name)s::Class() { return Type::%(class_name)s; }"+
|
"\nType::Enum %(class_name)s::Class() { return Type::%(class_name)s; }"+
|
||||||
"\n%(class_name)s::%(class_name)s(IfcAbstractEntityPtr e) { if (!is(Type::%(class_name)s)) throw; entity = e; }")%self.__dict__)%self.__dict__
|
"\n%(class_name)s::%(class_name)s(IfcAbstractEntityPtr e) { if (!is(Type::%(class_name)s)) throw; entity = e; }")%self.__dict__)%self.__dict__
|
||||||
|
|
||||||
@@ -340,6 +340,7 @@ print >>h_file, """#ifndef %(schema_upper)s_H
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
#include "../ifcparse/IfcUtil.h"
|
#include "../ifcparse/IfcUtil.h"
|
||||||
#include "../ifcparse/%(schema)senum.h"
|
#include "../ifcparse/%(schema)senum.h"
|
||||||
@@ -417,8 +418,9 @@ while True:
|
|||||||
if c.parent_class is None or c.parent_class in defined_classes:
|
if c.parent_class is None or c.parent_class in defined_classes:
|
||||||
defined_classes.add(c.class_name)
|
defined_classes.add(c.class_name)
|
||||||
print >>h_file, c
|
print >>h_file, c
|
||||||
|
|
||||||
print >>h_file, "IfcSchemaEntity SchemaEntity(IfcAbstractEntityPtr e = IfcAbstractEntityPtr());"
|
print >>h_file, "void InitStringMap();"
|
||||||
|
print >>h_file, "IfcSchemaEntity SchemaEntity(IfcAbstractEntityPtr e = 0);"
|
||||||
|
|
||||||
print >>h_file, "}\n\n#endif"
|
print >>h_file, "}\n\n#endif"
|
||||||
|
|
||||||
@@ -428,14 +430,15 @@ print >>cpp_file, """#include "%(schema)s.h"
|
|||||||
|
|
||||||
using namespace %(schema)s;
|
using namespace %(schema)s;
|
||||||
|
|
||||||
IfcSchemaEntity %(schema)s::SchemaEntity(IfcAbstractEntityPtr e) {"""%{'schema':schema_version}
|
IfcSchemaEntity %(schema)s::SchemaEntity(IfcAbstractEntityPtr e) {
|
||||||
|
switch(e->type()){"""%{'schema':schema_version}
|
||||||
|
|
||||||
for e in simple_enumerations:
|
for e in simple_enumerations:
|
||||||
print >>cpp_file, " if ( e->is(Type::%s) ) return IfcSchemaEntity(new IfcEntitySelect(e));"%e
|
print >>cpp_file, " case Type::%s: return new IfcEntitySelect(e); break;"%e
|
||||||
for e in entity_enumerations:
|
for e in entity_enumerations:
|
||||||
print >>cpp_file, " if ( e->is(Type::%s) ) return IfcSchemaEntity(new %s(e));"%(e,e)
|
print >>cpp_file, " case Type::%s: return new %s(e); break;"%(e,e)
|
||||||
print >>cpp_file, " throw; "
|
print >>cpp_file, " default: throw; break; "
|
||||||
print >>cpp_file, "}"
|
print >>cpp_file, " }\n}"
|
||||||
print >>cpp_file
|
print >>cpp_file
|
||||||
print >>cpp_file, "std::string Type::ToString(Enum v) {"
|
print >>cpp_file, "std::string Type::ToString(Enum v) {"
|
||||||
print >>cpp_file, " if (v < 0 || v >= %d) throw;"%len(all_enumerations)
|
print >>cpp_file, " if (v < 0 || v >= %d) throw;"%len(all_enumerations)
|
||||||
@@ -443,20 +446,31 @@ print >>cpp_file, ' const char* names[] = { "%s" };'%'","'.join(all_enumerati
|
|||||||
print >>cpp_file, ' return names[v];'
|
print >>cpp_file, ' return names[v];'
|
||||||
print >>cpp_file, "}"
|
print >>cpp_file, "}"
|
||||||
print >>cpp_file
|
print >>cpp_file
|
||||||
print >>cpp_file, "Type::Enum Type::FromString(const std::string& s){"
|
#print >>cpp_file, "Type::Enum Type::FromStringOld(const std::string& s){"
|
||||||
elseif = "if"
|
#elseif = "if"
|
||||||
|
#maxlen = max([len(e) for e in all_enumerations])
|
||||||
|
#for e in all_enumerations:
|
||||||
|
# print >>cpp_file, ' %s(s=="%s"%s) { return %s; }'%(elseif,e.upper()," "*(maxlen-len(e)),e)
|
||||||
|
#print >>cpp_file, " throw;"
|
||||||
|
#print >>cpp_file, "}"
|
||||||
|
print >>cpp_file, "std::map<std::string,Type::Enum> string_map;"
|
||||||
|
print >>cpp_file, "void Ifc2x3::InitStringMap() {"
|
||||||
maxlen = max([len(e) for e in all_enumerations])
|
maxlen = max([len(e) for e in all_enumerations])
|
||||||
for e in all_enumerations:
|
for e in all_enumerations:
|
||||||
print >>cpp_file, ' %s(s=="%s"%s) { return %s; }'%(elseif,e.upper()," "*(maxlen-len(e)),e)
|
print >>cpp_file, ' string_map["%s"%s] = Type::%s;'%(e.upper()," "*(maxlen-len(e)),e)
|
||||||
print >>cpp_file, " throw;"
|
print >>cpp_file, """}
|
||||||
print >>cpp_file, "}"
|
Type::Enum Type::FromString(const std::string& s) {
|
||||||
|
std::map<std::string,Type::Enum>::const_iterator it = string_map.find(s);
|
||||||
|
if ( it == string_map.end() ) throw;
|
||||||
|
else return it->second;
|
||||||
|
}"""
|
||||||
|
|
||||||
print >>cpp_file, "Type::Enum Type::Parent(Enum v){"
|
print >>cpp_file, "Type::Enum Type::Parent(Enum v){"
|
||||||
print >>cpp_file, " if (v < 0 || v >= %d) return -1;"%len(all_enumerations)
|
print >>cpp_file, " if (v < 0 || v >= %d) return (Enum)-1;"%len(all_enumerations)
|
||||||
for e in entity_enumerations:
|
for e in entity_enumerations:
|
||||||
if e not in parent_relations: continue
|
if e not in parent_relations or parent_relations[e] is None: continue
|
||||||
print >>cpp_file, ' if(v==%s%s) { return %s; }'%(e," "*(maxlen-len(e)),parent_relations[e])
|
print >>cpp_file, ' if(v==%s%s) { return %s; }'%(e," "*(maxlen-len(e)),parent_relations[e])
|
||||||
print >>cpp_file, " return -1;"
|
print >>cpp_file, " return (Enum)-1;"
|
||||||
print >>cpp_file, "}"
|
print >>cpp_file, "}"
|
||||||
|
|
||||||
for t in [T for T in types if isinstance(T.type,EnumType)]:
|
for t in [T for T in types if isinstance(T.type,EnumType)]:
|
||||||
|
|||||||
@@ -35,11 +35,11 @@
|
|||||||
|
|
||||||
namespace IfcGeom {
|
namespace IfcGeom {
|
||||||
bool convert_wire_to_face(const TopoDS_Wire& wire, TopoDS_Face& face);
|
bool convert_wire_to_face(const TopoDS_Wire& wire, TopoDS_Face& face);
|
||||||
bool convert_shape(const SHARED_PTR<IfcUtil::IfcBaseClass>& L, TopoDS_Shape& result);
|
bool convert_shape(const IfcUtil::IfcBaseClass* L, TopoDS_Shape& result);
|
||||||
bool convert_wire(const SHARED_PTR<IfcUtil::IfcBaseClass>& L, TopoDS_Wire& result);
|
bool convert_wire(const IfcUtil::IfcBaseClass* L, TopoDS_Wire& result);
|
||||||
bool convert_curve(const SHARED_PTR<IfcUtil::IfcBaseClass>& L, Handle(Geom_Curve)& result);
|
bool convert_curve(const IfcUtil::IfcBaseClass* L, Handle(Geom_Curve)& result);
|
||||||
bool convert_face(const SHARED_PTR<IfcUtil::IfcBaseClass>& L, TopoDS_Face& result);
|
bool convert_face(const IfcUtil::IfcBaseClass* L, TopoDS_Face& result);
|
||||||
bool convert_openings(const Ifc2x3::IfcProduct::ptr& L, const Ifc2x3::IfcRelVoidsElement::list& openings, TopoDS_Shape& result, const gp_Trsf& trsf);
|
bool convert_openings(const Ifc2x3::IfcProduct::ptr L, const Ifc2x3::IfcRelVoidsElement::list& openings, TopoDS_Shape& result, const gp_Trsf& trsf);
|
||||||
bool profile_helper(int numVerts, float* verts, int numFillets, int* filletIndices, float* filletRadii, gp_Trsf2d trsf, TopoDS_Face& face);
|
bool profile_helper(int numVerts, float* verts, int numFillets, int* filletIndices, float* filletRadii, gp_Trsf2d trsf, TopoDS_Face& face);
|
||||||
namespace Cache {
|
namespace Cache {
|
||||||
void Purge();
|
void Purge();
|
||||||
|
|||||||
@@ -74,40 +74,40 @@
|
|||||||
|
|
||||||
#include "../ifcgeom/IfcGeom.h"
|
#include "../ifcgeom/IfcGeom.h"
|
||||||
|
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcCircle::ptr& l, Handle(Geom_Curve)& curve) {
|
bool IfcGeom::convert(const Ifc2x3::IfcCircle::ptr l, Handle(Geom_Curve)& curve) {
|
||||||
const float r = l->Radius() * Ifc::LengthUnit;
|
const float r = l->Radius() * Ifc::LengthUnit;
|
||||||
if ( r <= 0.0f ) { return false; }
|
if ( r <= 0.0f ) { return false; }
|
||||||
gp_Trsf trsf;
|
gp_Trsf trsf;
|
||||||
Ifc2x3::IfcAxis2Placement placement = l->Position();
|
Ifc2x3::IfcAxis2Placement placement = l->Position();
|
||||||
if (placement->is(Ifc2x3::Type::IfcAxis2Placement3D)) {
|
if (placement->is(Ifc2x3::Type::IfcAxis2Placement3D)) {
|
||||||
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement3D>(placement),trsf);
|
IfcGeom::convert((Ifc2x3::IfcAxis2Placement3D*)placement,trsf);
|
||||||
} else {
|
} else {
|
||||||
gp_Trsf2d trsf2d;
|
gp_Trsf2d trsf2d;
|
||||||
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement2D>(placement),trsf2d);
|
IfcGeom::convert((IfcAxis2Placement2D*)placement,trsf2d);
|
||||||
trsf = trsf2d;
|
trsf = trsf2d;
|
||||||
}
|
}
|
||||||
gp_Ax2 ax = gp_Ax2().Transformed(trsf);
|
gp_Ax2 ax = gp_Ax2().Transformed(trsf);
|
||||||
curve = new Geom_Circle(ax, r);
|
curve = new Geom_Circle(ax, r);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcEllipse::ptr& l, Handle(Geom_Curve)& curve) {
|
bool IfcGeom::convert(const Ifc2x3::IfcEllipse::ptr l, Handle(Geom_Curve)& curve) {
|
||||||
float x = l->SemiAxis1() * Ifc::LengthUnit;
|
float x = l->SemiAxis1() * Ifc::LengthUnit;
|
||||||
float y = l->SemiAxis2() * Ifc::LengthUnit;
|
float y = l->SemiAxis2() * Ifc::LengthUnit;
|
||||||
if ( x == 0.0f || y == 0.0f || y > x ) { return false; }
|
if ( x == 0.0f || y == 0.0f || y > x ) { return false; }
|
||||||
gp_Trsf trsf;
|
gp_Trsf trsf;
|
||||||
Ifc2x3::IfcAxis2Placement placement = l->Position();
|
Ifc2x3::IfcAxis2Placement placement = l->Position();
|
||||||
if (placement->is(Ifc2x3::Type::IfcAxis2Placement3D)) {
|
if (placement->is(Ifc2x3::Type::IfcAxis2Placement3D)) {
|
||||||
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement3D>(placement),trsf);
|
IfcGeom::convert((Ifc2x3::IfcAxis2Placement3D*)placement,trsf);
|
||||||
} else {
|
} else {
|
||||||
gp_Trsf2d trsf2d;
|
gp_Trsf2d trsf2d;
|
||||||
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement2D>(placement),trsf2d);
|
IfcGeom::convert((Ifc2x3::IfcAxis2Placement2D*)placement,trsf2d);
|
||||||
trsf = trsf2d;
|
trsf = trsf2d;
|
||||||
}
|
}
|
||||||
gp_Ax2 ax = gp_Ax2().Transformed(trsf);
|
gp_Ax2 ax = gp_Ax2().Transformed(trsf);
|
||||||
curve = new Geom_Ellipse(ax, x, y);
|
curve = new Geom_Ellipse(ax, x, y);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcLine::ptr& l, Handle(Geom_Curve)& curve) {
|
bool IfcGeom::convert(const Ifc2x3::IfcLine::ptr l, Handle(Geom_Curve)& curve) {
|
||||||
gp_Pnt pnt;gp_Vec vec;
|
gp_Pnt pnt;gp_Vec vec;
|
||||||
IfcGeom::convert(l->Pnt(),pnt);
|
IfcGeom::convert(l->Pnt(),pnt);
|
||||||
IfcGeom::convert(l->Dir(),vec);
|
IfcGeom::convert(l->Dir(),vec);
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
|
|
||||||
#include "../ifcgeom/IfcGeom.h"
|
#include "../ifcgeom/IfcGeom.h"
|
||||||
|
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcFace::ptr& l, TopoDS_Face& face) {
|
bool IfcGeom::convert(const Ifc2x3::IfcFace::ptr l, TopoDS_Face& face) {
|
||||||
Ifc2x3::IfcFaceBound::list bounds = l->Bounds();
|
Ifc2x3::IfcFaceBound::list bounds = l->Bounds();
|
||||||
Ifc2x3::IfcFaceBound::it it = bounds->begin();
|
Ifc2x3::IfcFaceBound::it it = bounds->begin();
|
||||||
Ifc2x3::IfcLoop::ptr loop = (*it)->Bound();
|
Ifc2x3::IfcLoop::ptr loop = (*it)->Bound();
|
||||||
@@ -111,12 +111,12 @@ bool IfcGeom::convert(const Ifc2x3::IfcFace::ptr& l, TopoDS_Face& face) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcArbitraryClosedProfileDef::ptr& l, TopoDS_Face& face) {
|
bool IfcGeom::convert(const Ifc2x3::IfcArbitraryClosedProfileDef::ptr l, TopoDS_Face& face) {
|
||||||
TopoDS_Wire wire;
|
TopoDS_Wire wire;
|
||||||
if ( ! IfcGeom::convert_wire(l->OuterCurve(),wire) ) return false;
|
if ( ! IfcGeom::convert_wire(l->OuterCurve(),wire) ) return false;
|
||||||
return IfcGeom::convert_wire_to_face(wire,face);
|
return IfcGeom::convert_wire_to_face(wire,face);
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcArbitraryProfileDefWithVoids::ptr& l, TopoDS_Face& face) {
|
bool IfcGeom::convert(const Ifc2x3::IfcArbitraryProfileDefWithVoids::ptr l, TopoDS_Face& face) {
|
||||||
TopoDS_Wire profile;
|
TopoDS_Wire profile;
|
||||||
if ( ! IfcGeom::convert_wire(l->OuterCurve(),profile) ) return false;
|
if ( ! IfcGeom::convert_wire(l->OuterCurve(),profile) ) return false;
|
||||||
BRepBuilderAPI_MakeFace mf(profile);
|
BRepBuilderAPI_MakeFace mf(profile);
|
||||||
@@ -132,7 +132,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcArbitraryProfileDefWithVoids::ptr& l, Top
|
|||||||
face = TopoDS::Face(sfs.Shape());
|
face = TopoDS::Face(sfs.Shape());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcRectangleProfileDef::ptr& l, TopoDS_Face& face) {
|
bool IfcGeom::convert(const Ifc2x3::IfcRectangleProfileDef::ptr l, TopoDS_Face& face) {
|
||||||
const float x = l->XDim() / 2.0f * Ifc::LengthUnit;
|
const float x = l->XDim() / 2.0f * Ifc::LengthUnit;
|
||||||
const float y = l->YDim() / 2.0f * Ifc::LengthUnit;
|
const float y = l->YDim() / 2.0f * Ifc::LengthUnit;
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcRectangleProfileDef::ptr& l, TopoDS_Face&
|
|||||||
float coords[8] = {-x,-y,x,-y,x,y,-x,y};
|
float coords[8] = {-x,-y,x,-y,x,y,-x,y};
|
||||||
return IfcGeom::profile_helper(4,coords,0,0,0,trsf2d,face);
|
return IfcGeom::profile_helper(4,coords,0,0,0,trsf2d,face);
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcIShapeProfileDef::ptr& l, TopoDS_Face& face) {
|
bool IfcGeom::convert(const Ifc2x3::IfcIShapeProfileDef::ptr l, TopoDS_Face& face) {
|
||||||
const float x = l->OverallWidth() / 2.0f * Ifc::LengthUnit;
|
const float x = l->OverallWidth() / 2.0f * Ifc::LengthUnit;
|
||||||
const float y = l->OverallDepth() / 2.0f * Ifc::LengthUnit;
|
const float y = l->OverallDepth() / 2.0f * Ifc::LengthUnit;
|
||||||
const float d1 = l->WebThickness() / 2.0f * Ifc::LengthUnit;
|
const float d1 = l->WebThickness() / 2.0f * Ifc::LengthUnit;
|
||||||
@@ -170,7 +170,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcIShapeProfileDef::ptr& l, TopoDS_Face& fa
|
|||||||
float radii[4] = {f,f,f,f};
|
float radii[4] = {f,f,f,f};
|
||||||
return IfcGeom::profile_helper(12,coords,doFillet ? 4 : 0,fillets,radii,trsf2d,face);
|
return IfcGeom::profile_helper(12,coords,doFillet ? 4 : 0,fillets,radii,trsf2d,face);
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcCShapeProfileDef::ptr& l, TopoDS_Face& face) {
|
bool IfcGeom::convert(const Ifc2x3::IfcCShapeProfileDef::ptr l, TopoDS_Face& face) {
|
||||||
const float x = l->Depth() / 2.0f * Ifc::LengthUnit;
|
const float x = l->Depth() / 2.0f * Ifc::LengthUnit;
|
||||||
const float y = l->Width() / 2.0f * Ifc::LengthUnit;
|
const float y = l->Width() / 2.0f * Ifc::LengthUnit;
|
||||||
const float d1 = l->WallThickness() * Ifc::LengthUnit;
|
const float d1 = l->WallThickness() * Ifc::LengthUnit;
|
||||||
@@ -195,7 +195,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcCShapeProfileDef::ptr& l, TopoDS_Face& fa
|
|||||||
float radii[8] = {f2,f2,f1,f1,f1,f1,f2,f2};
|
float radii[8] = {f2,f2,f1,f1,f1,f1,f2,f2};
|
||||||
return IfcGeom::profile_helper(12,coords,doFillet ? 8 : 0,fillets,radii,trsf2d,face);
|
return IfcGeom::profile_helper(12,coords,doFillet ? 8 : 0,fillets,radii,trsf2d,face);
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcLShapeProfileDef::ptr& l, TopoDS_Face& face) {
|
bool IfcGeom::convert(const Ifc2x3::IfcLShapeProfileDef::ptr l, TopoDS_Face& face) {
|
||||||
const float y = l->Depth() / 2.0f * Ifc::LengthUnit;
|
const float y = l->Depth() / 2.0f * Ifc::LengthUnit;
|
||||||
const float x = l->Width() / 2.0f * Ifc::LengthUnit;
|
const float x = l->Width() / 2.0f * Ifc::LengthUnit;
|
||||||
const float d = l->Thickness() * Ifc::LengthUnit;
|
const float d = l->Thickness() * Ifc::LengthUnit;
|
||||||
@@ -222,7 +222,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcLShapeProfileDef::ptr& l, TopoDS_Face& fa
|
|||||||
float radii[3] = {f2,f1,f2};
|
float radii[3] = {f2,f1,f2};
|
||||||
return IfcGeom::profile_helper(6,coords,doFillet ? 3 : 0,fillets,radii,trsf2d,face);
|
return IfcGeom::profile_helper(6,coords,doFillet ? 3 : 0,fillets,radii,trsf2d,face);
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcCircleProfileDef::ptr& l, TopoDS_Face& face) {
|
bool IfcGeom::convert(const Ifc2x3::IfcCircleProfileDef::ptr l, TopoDS_Face& face) {
|
||||||
const float r = l->Radius() * Ifc::LengthUnit;
|
const float r = l->Radius() * Ifc::LengthUnit;
|
||||||
if ( r == 0.0f ) {
|
if ( r == 0.0f ) {
|
||||||
Ifc::LogMessage("Notice","Skipping zero sized profile:",l->entity);
|
Ifc::LogMessage("Notice","Skipping zero sized profile:",l->entity);
|
||||||
@@ -239,7 +239,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcCircleProfileDef::ptr& l, TopoDS_Face& fa
|
|||||||
w.Add(edge);
|
w.Add(edge);
|
||||||
return IfcGeom::convert_wire_to_face(w,face);
|
return IfcGeom::convert_wire_to_face(w,face);
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcCircleHollowProfileDef::ptr& l, TopoDS_Face& face) {
|
bool IfcGeom::convert(const Ifc2x3::IfcCircleHollowProfileDef::ptr l, TopoDS_Face& face) {
|
||||||
const float r = l->Radius() * Ifc::LengthUnit;
|
const float r = l->Radius() * Ifc::LengthUnit;
|
||||||
const float t = l->WallThickness() * Ifc::LengthUnit;
|
const float t = l->WallThickness() * Ifc::LengthUnit;
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
|
|
||||||
#include "../ifcgeom/IfcGeom.h"
|
#include "../ifcgeom/IfcGeom.h"
|
||||||
|
|
||||||
bool IfcGeom::convert_openings(const Ifc2x3::IfcProduct::ptr& entity,
|
bool IfcGeom::convert_openings(const Ifc2x3::IfcProduct::ptr entity,
|
||||||
const Ifc2x3::IfcRelVoidsElement::list& openings, TopoDS_Shape& result, const gp_Trsf& trsf2) {
|
const Ifc2x3::IfcRelVoidsElement::list& openings, TopoDS_Shape& result, const gp_Trsf& trsf2) {
|
||||||
for ( Ifc2x3::IfcRelVoidsElement::it it = openings->begin(); it != openings->end(); ++ it ) {
|
for ( Ifc2x3::IfcRelVoidsElement::it it = openings->begin(); it != openings->end(); ++ it ) {
|
||||||
Ifc2x3::IfcRelVoidsElement::ptr v = *it;
|
Ifc2x3::IfcRelVoidsElement::ptr v = *it;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ namespace IfcGeom {
|
|||||||
if ( it != Cache::T.end() ) { e = it->second; return true; }
|
if ( it != Cache::T.end() ) { e = it->second; return true; }
|
||||||
#define CACHE(T,E,e) Cache::T[E->entity->id()] = e;
|
#define CACHE(T,E,e) Cache::T[E->entity->id()] = e;
|
||||||
|
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcCartesianPoint::ptr& l, gp_Pnt& point) {
|
bool IfcGeom::convert(const Ifc2x3::IfcCartesianPoint::ptr l, gp_Pnt& point) {
|
||||||
IN_CACHE(IfcCartesianPoint,l,gp_Pnt,point)
|
IN_CACHE(IfcCartesianPoint,l,gp_Pnt,point)
|
||||||
std::vector<float> xyz = l->Coordinates();
|
std::vector<float> xyz = l->Coordinates();
|
||||||
point = gp_Pnt(
|
point = gp_Pnt(
|
||||||
@@ -95,7 +95,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcCartesianPoint::ptr& l, gp_Pnt& point) {
|
|||||||
CACHE(IfcCartesianPoint,l,point)
|
CACHE(IfcCartesianPoint,l,point)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcDirection::ptr& l, gp_Dir& dir) {
|
bool IfcGeom::convert(const Ifc2x3::IfcDirection::ptr l, gp_Dir& dir) {
|
||||||
IN_CACHE(IfcDirection,l,gp_Dir,dir)
|
IN_CACHE(IfcDirection,l,gp_Dir,dir)
|
||||||
std::vector<float> xyz = l->DirectionRatios();
|
std::vector<float> xyz = l->DirectionRatios();
|
||||||
dir = gp_Dir(
|
dir = gp_Dir(
|
||||||
@@ -106,7 +106,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcDirection::ptr& l, gp_Dir& dir) {
|
|||||||
CACHE(IfcDirection,l,dir)
|
CACHE(IfcDirection,l,dir)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcVector::ptr& l, gp_Vec& v) {
|
bool IfcGeom::convert(const Ifc2x3::IfcVector::ptr l, gp_Vec& v) {
|
||||||
IN_CACHE(IfcVector,l,gp_Vec,v)
|
IN_CACHE(IfcVector,l,gp_Vec,v)
|
||||||
gp_Dir d;
|
gp_Dir d;
|
||||||
IfcGeom::convert(l->Orientation(),d);
|
IfcGeom::convert(l->Orientation(),d);
|
||||||
@@ -114,7 +114,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcVector::ptr& l, gp_Vec& v) {
|
|||||||
CACHE(IfcVector,l,v)
|
CACHE(IfcVector,l,v)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement3D::ptr& l, gp_Trsf& trsf) {
|
bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement3D::ptr l, gp_Trsf& trsf) {
|
||||||
IN_CACHE(IfcAxis2Placement3D,l,gp_Trsf,trsf)
|
IN_CACHE(IfcAxis2Placement3D,l,gp_Trsf,trsf)
|
||||||
gp_Pnt o;gp_Dir axis = gp_Dir(0,0,1);gp_Dir refDirection;
|
gp_Pnt o;gp_Dir axis = gp_Dir(0,0,1);gp_Dir refDirection;
|
||||||
IfcGeom::convert(l->Location(),o);
|
IfcGeom::convert(l->Location(),o);
|
||||||
@@ -128,7 +128,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement3D::ptr& l, gp_Trsf& trsf)
|
|||||||
CACHE(IfcAxis2Placement3D,l,trsf)
|
CACHE(IfcAxis2Placement3D,l,trsf)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator3D::ptr& l, gp_Trsf& trsf) {
|
bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator3D::ptr l, gp_Trsf& trsf) {
|
||||||
IN_CACHE(IfcCartesianTransformationOperator3D,l,gp_Trsf,trsf)
|
IN_CACHE(IfcCartesianTransformationOperator3D,l,gp_Trsf,trsf)
|
||||||
gp_Pnt origin;
|
gp_Pnt origin;
|
||||||
IfcGeom::convert(l->LocalOrigin(),origin);
|
IfcGeom::convert(l->LocalOrigin(),origin);
|
||||||
@@ -145,7 +145,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator3D::ptr& l
|
|||||||
CACHE(IfcCartesianTransformationOperator3D,l,trsf)
|
CACHE(IfcCartesianTransformationOperator3D,l,trsf)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator2D::ptr& l, gp_Trsf2d& trsf) {
|
bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator2D::ptr l, gp_Trsf2d& trsf) {
|
||||||
IN_CACHE(IfcCartesianTransformationOperator2D,l,gp_Trsf2d,trsf)
|
IN_CACHE(IfcCartesianTransformationOperator2D,l,gp_Trsf2d,trsf)
|
||||||
gp_Pnt origin;
|
gp_Pnt origin;
|
||||||
IfcGeom::convert(l->LocalOrigin(),origin);
|
IfcGeom::convert(l->LocalOrigin(),origin);
|
||||||
@@ -157,7 +157,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator2D::ptr& l
|
|||||||
CACHE(IfcCartesianTransformationOperator2D,l,trsf)
|
CACHE(IfcCartesianTransformationOperator2D,l,trsf)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcPlane::ptr& pln, gp_Pln& plane) {
|
bool IfcGeom::convert(const Ifc2x3::IfcPlane::ptr pln, gp_Pln& plane) {
|
||||||
IN_CACHE(IfcPlane,pln,gp_Pln,plane)
|
IN_CACHE(IfcPlane,pln,gp_Pln,plane)
|
||||||
Ifc2x3::IfcAxis2Placement3D::ptr l = pln->Position();
|
Ifc2x3::IfcAxis2Placement3D::ptr l = pln->Position();
|
||||||
gp_Pnt o;gp_Dir axis = gp_Dir(0,0,1);gp_Dir refDirection;
|
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) {
|
|||||||
CACHE(IfcPlane,pln,plane)
|
CACHE(IfcPlane,pln,plane)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement2D::ptr& l, gp_Trsf2d& trsf) {
|
bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement2D::ptr l, gp_Trsf2d& trsf) {
|
||||||
IN_CACHE(IfcAxis2Placement2D,l,gp_Trsf2d,trsf)
|
IN_CACHE(IfcAxis2Placement2D,l,gp_Trsf2d,trsf)
|
||||||
gp_Pnt P; gp_Dir V (1,0,0);
|
gp_Pnt P; gp_Dir V (1,0,0);
|
||||||
IfcGeom::convert(l->Location(),P);
|
IfcGeom::convert(l->Location(),P);
|
||||||
@@ -184,7 +184,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement2D::ptr& l, gp_Trsf2d& trsf
|
|||||||
CACHE(IfcAxis2Placement2D,l,trsf)
|
CACHE(IfcAxis2Placement2D,l,trsf)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcObjectPlacement::ptr& l, gp_Trsf& trsf) {
|
bool IfcGeom::convert(const Ifc2x3::IfcObjectPlacement::ptr l, gp_Trsf& trsf) {
|
||||||
IN_CACHE(IfcObjectPlacement,l,gp_Trsf,trsf)
|
IN_CACHE(IfcObjectPlacement,l,gp_Trsf,trsf)
|
||||||
if ( ! l->is(Ifc2x3::Type::IfcLocalPlacement) ) return false;
|
if ( ! l->is(Ifc2x3::Type::IfcLocalPlacement) ) return false;
|
||||||
Ifc2x3::IfcLocalPlacement::ptr current = reinterpret_pointer_cast<Ifc2x3::IfcObjectPlacement,Ifc2x3::IfcLocalPlacement>(l);
|
Ifc2x3::IfcLocalPlacement::ptr current = reinterpret_pointer_cast<Ifc2x3::IfcObjectPlacement,Ifc2x3::IfcLocalPlacement>(l);
|
||||||
@@ -192,7 +192,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcObjectPlacement::ptr& l, gp_Trsf& trsf) {
|
|||||||
gp_Trsf trsf2;
|
gp_Trsf trsf2;
|
||||||
Ifc2x3::IfcAxis2Placement relplacement = current->RelativePlacement();
|
Ifc2x3::IfcAxis2Placement relplacement = current->RelativePlacement();
|
||||||
if ( relplacement->is(Ifc2x3::Type::IfcAxis2Placement3D) ) {
|
if ( relplacement->is(Ifc2x3::Type::IfcAxis2Placement3D) ) {
|
||||||
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement3D>(relplacement),trsf2);
|
IfcGeom::convert((Ifc2x3::IfcAxis2Placement3D*)relplacement,trsf2);
|
||||||
trsf.PreMultiply(trsf2);
|
trsf.PreMultiply(trsf2);
|
||||||
}
|
}
|
||||||
if ( current->hasPlacementRelTo() ) {
|
if ( current->hasPlacementRelTo() ) {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
|
|
||||||
#include "../ifcgeom/IfcGeom.h"
|
#include "../ifcgeom/IfcGeom.h"
|
||||||
|
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcExtrudedAreaSolid::ptr& l, TopoDS_Shape& shape) {
|
bool IfcGeom::convert(const Ifc2x3::IfcExtrudedAreaSolid::ptr l, TopoDS_Shape& shape) {
|
||||||
TopoDS_Face face;
|
TopoDS_Face face;
|
||||||
if ( ! IfcGeom::convert_face(l->SweptArea(),face) ) return false;
|
if ( ! IfcGeom::convert_face(l->SweptArea(),face) ) return false;
|
||||||
const float height = l->Depth() * Ifc::LengthUnit;
|
const float height = l->Depth() * Ifc::LengthUnit;
|
||||||
@@ -88,10 +88,10 @@ bool IfcGeom::convert(const Ifc2x3::IfcExtrudedAreaSolid::ptr& l, TopoDS_Shape&
|
|||||||
shape.Move(trsf);
|
shape.Move(trsf);
|
||||||
return ! shape.IsNull();
|
return ! shape.IsNull();
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcFacetedBrep::ptr& l, TopoDS_Shape& shape) {
|
bool IfcGeom::convert(const Ifc2x3::IfcFacetedBrep::ptr l, TopoDS_Shape& shape) {
|
||||||
return IfcGeom::convert_shape(l->Outer(),shape);
|
return IfcGeom::convert_shape(l->Outer(),shape);
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcFaceBasedSurfaceModel::ptr& l, TopoDS_Shape& shape) {
|
bool IfcGeom::convert(const Ifc2x3::IfcFaceBasedSurfaceModel::ptr l, TopoDS_Shape& shape) {
|
||||||
Ifc2x3::IfcConnectedFaceSet::list facesets = l->FbsmFaces();
|
Ifc2x3::IfcConnectedFaceSet::list facesets = l->FbsmFaces();
|
||||||
BRep_Builder builder;
|
BRep_Builder builder;
|
||||||
TopoDS_Compound c;
|
TopoDS_Compound c;
|
||||||
@@ -105,7 +105,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcFaceBasedSurfaceModel::ptr& l, TopoDS_Sha
|
|||||||
shape = c;
|
shape = c;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcHalfSpaceSolid::ptr& l, TopoDS_Shape& shape) {
|
bool IfcGeom::convert(const Ifc2x3::IfcHalfSpaceSolid::ptr l, TopoDS_Shape& shape) {
|
||||||
Ifc2x3::IfcSurface::ptr surface = l->BaseSurface();
|
Ifc2x3::IfcSurface::ptr surface = l->BaseSurface();
|
||||||
if ( ! surface->is(Ifc2x3::Type::IfcPlane) ) {
|
if ( ! surface->is(Ifc2x3::Type::IfcPlane) ) {
|
||||||
// Not implemented
|
// Not implemented
|
||||||
@@ -121,7 +121,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcHalfSpaceSolid::ptr& l, TopoDS_Shape& sha
|
|||||||
shape = BRepPrimAPI_MakeHalfSpace(BRepBuilderAPI_MakeFace(pln),pnt).Solid();
|
shape = BRepPrimAPI_MakeHalfSpace(BRepBuilderAPI_MakeFace(pln),pnt).Solid();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcPolygonalBoundedHalfSpace::ptr& l, TopoDS_Shape& shape) {
|
bool IfcGeom::convert(const Ifc2x3::IfcPolygonalBoundedHalfSpace::ptr l, TopoDS_Shape& shape) {
|
||||||
TopoDS_Shape halfspace;
|
TopoDS_Shape halfspace;
|
||||||
if ( ! IfcGeom::convert(reinterpret_pointer_cast<Ifc2x3::IfcPolygonalBoundedHalfSpace,Ifc2x3::IfcHalfSpaceSolid>(l),halfspace) ) return false;
|
if ( ! IfcGeom::convert(reinterpret_pointer_cast<Ifc2x3::IfcPolygonalBoundedHalfSpace,Ifc2x3::IfcHalfSpaceSolid>(l),halfspace) ) return false;
|
||||||
TopoDS_Wire wire;
|
TopoDS_Wire wire;
|
||||||
@@ -134,7 +134,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcPolygonalBoundedHalfSpace::ptr& l, TopoDS
|
|||||||
shape = BRepAlgoAPI_Cut(extrusion,halfspace);
|
shape = BRepAlgoAPI_Cut(extrusion,halfspace);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcShellBasedSurfaceModel::ptr& l, TopoDS_Shape& shape) {
|
bool IfcGeom::convert(const Ifc2x3::IfcShellBasedSurfaceModel::ptr l, TopoDS_Shape& shape) {
|
||||||
IfcUtil::IfcAbstractSelect::list shells = l->SbsmBoundary();
|
IfcUtil::IfcAbstractSelect::list shells = l->SbsmBoundary();
|
||||||
BRep_Builder builder;
|
BRep_Builder builder;
|
||||||
TopoDS_Compound c;
|
TopoDS_Compound c;
|
||||||
@@ -148,7 +148,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcShellBasedSurfaceModel::ptr& l, TopoDS_Sh
|
|||||||
shape = c;
|
shape = c;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcBooleanClippingResult::ptr& l, TopoDS_Shape& shape) {
|
bool IfcGeom::convert(const Ifc2x3::IfcBooleanClippingResult::ptr l, TopoDS_Shape& shape) {
|
||||||
TopoDS_Shape s1, s2;
|
TopoDS_Shape s1, s2;
|
||||||
if ( ! IfcGeom::convert_shape(l->FirstOperand(),s1) )
|
if ( ! IfcGeom::convert_shape(l->FirstOperand(),s1) )
|
||||||
return false;
|
return false;
|
||||||
@@ -157,7 +157,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcBooleanClippingResult::ptr& l, TopoDS_Sha
|
|||||||
shape = BRepAlgoAPI_Cut(s1,s2);
|
shape = BRepAlgoAPI_Cut(s1,s2);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcClosedShell::ptr& l, TopoDS_Shape& shape) {
|
bool IfcGeom::convert(const Ifc2x3::IfcClosedShell::ptr l, TopoDS_Shape& shape) {
|
||||||
if ( ! IfcGeom::convert((Ifc2x3::IfcConnectedFaceSet::ptr)l,shape) ) return false;
|
if ( ! IfcGeom::convert((Ifc2x3::IfcConnectedFaceSet::ptr)l,shape) ) return false;
|
||||||
try {
|
try {
|
||||||
ShapeFix_Solid solid;
|
ShapeFix_Solid solid;
|
||||||
@@ -166,7 +166,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcClosedShell::ptr& l, TopoDS_Shape& shape)
|
|||||||
} catch(...) {}
|
} catch(...) {}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcConnectedFaceSet::ptr& l, TopoDS_Shape& shape) {
|
bool IfcGeom::convert(const Ifc2x3::IfcConnectedFaceSet::ptr l, TopoDS_Shape& shape) {
|
||||||
BRepOffsetAPI_Sewing builder;
|
BRepOffsetAPI_Sewing builder;
|
||||||
builder.SetTolerance(0.01);
|
builder.SetTolerance(0.01);
|
||||||
Ifc2x3::IfcFace::list faces = l->CfsFaces();
|
Ifc2x3::IfcFace::list faces = l->CfsFaces();
|
||||||
@@ -185,7 +185,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcConnectedFaceSet::ptr& l, TopoDS_Shape& s
|
|||||||
shape = builder.SewedShape();
|
shape = builder.SewedShape();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcMappedItem::ptr& l, TopoDS_Shape& shape) {
|
bool IfcGeom::convert(const Ifc2x3::IfcMappedItem::ptr l, TopoDS_Shape& shape) {
|
||||||
gp_Trsf trsf1;
|
gp_Trsf trsf1;
|
||||||
Ifc2x3::IfcCartesianTransformationOperator::ptr transform = l->MappingTarget();
|
Ifc2x3::IfcCartesianTransformationOperator::ptr transform = l->MappingTarget();
|
||||||
if ( transform->is(Ifc2x3::Type::IfcCartesianTransformationOperator2DnonUniform) ||
|
if ( transform->is(Ifc2x3::Type::IfcCartesianTransformationOperator2DnonUniform) ||
|
||||||
@@ -205,17 +205,17 @@ bool IfcGeom::convert(const Ifc2x3::IfcMappedItem::ptr& l, TopoDS_Shape& shape)
|
|||||||
Ifc2x3::IfcAxis2Placement placement = map->MappingOrigin();
|
Ifc2x3::IfcAxis2Placement placement = map->MappingOrigin();
|
||||||
gp_Trsf trsf2;
|
gp_Trsf trsf2;
|
||||||
if (placement->is(Ifc2x3::Type::IfcAxis2Placement3D)) {
|
if (placement->is(Ifc2x3::Type::IfcAxis2Placement3D)) {
|
||||||
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement3D>(placement),trsf2);
|
IfcGeom::convert((Ifc2x3::IfcAxis2Placement3D*)placement,trsf2);
|
||||||
} else {
|
} else {
|
||||||
gp_Trsf2d trsf2_2d;
|
gp_Trsf2d trsf2_2d;
|
||||||
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement2D>(placement),trsf2_2d);
|
IfcGeom::convert((Ifc2x3::IfcAxis2Placement2D*)placement,trsf2_2d);
|
||||||
trsf2 = trsf2_2d;
|
trsf2 = trsf2_2d;
|
||||||
}
|
}
|
||||||
if ( ! IfcGeom::convert_shape(map->MappedRepresentation(),shape) ) return false;
|
if ( ! IfcGeom::convert_shape(map->MappedRepresentation(),shape) ) return false;
|
||||||
shape.Move(trsf2 * trsf1);
|
shape.Move(trsf2 * trsf1);
|
||||||
return !shape.IsNull();
|
return !shape.IsNull();
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcShapeRepresentation::ptr& l, TopoDS_Shape& shape) {
|
bool IfcGeom::convert(const Ifc2x3::IfcShapeRepresentation::ptr l, TopoDS_Shape& shape) {
|
||||||
Ifc2x3::IfcRepresentationItem::list items = l->Items();
|
Ifc2x3::IfcRepresentationItem::list items = l->Items();
|
||||||
if ( ! items->Size() ) return false;
|
if ( ! items->Size() ) return false;
|
||||||
BRep_Builder builder;
|
BRep_Builder builder;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
|
|
||||||
#include "../ifcgeom/IfcGeom.h"
|
#include "../ifcgeom/IfcGeom.h"
|
||||||
|
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcCompositeCurve::ptr& l, TopoDS_Wire& wire) {
|
bool IfcGeom::convert(const Ifc2x3::IfcCompositeCurve::ptr l, TopoDS_Wire& wire) {
|
||||||
Ifc2x3::IfcCompositeCurveSegment::list segments = l->Segments();
|
Ifc2x3::IfcCompositeCurveSegment::list segments = l->Segments();
|
||||||
BRepBuilderAPI_MakeWire w;
|
BRepBuilderAPI_MakeWire w;
|
||||||
for( Ifc2x3::IfcCompositeCurveSegment::it it = segments->begin(); it != segments->end(); ++ it ) {
|
for( Ifc2x3::IfcCompositeCurveSegment::it it = segments->begin(); it != segments->end(); ++ it ) {
|
||||||
@@ -92,7 +92,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcCompositeCurve::ptr& l, TopoDS_Wire& wire
|
|||||||
wire = w.Wire();
|
wire = w.Wire();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcTrimmedCurve::ptr& l, TopoDS_Wire& wire) {
|
bool IfcGeom::convert(const Ifc2x3::IfcTrimmedCurve::ptr l, TopoDS_Wire& wire) {
|
||||||
Ifc2x3::IfcCurve::ptr basis_curve = l->BasisCurve();
|
Ifc2x3::IfcCurve::ptr basis_curve = l->BasisCurve();
|
||||||
bool isConic = basis_curve->is(Ifc2x3::Type::IfcConic);
|
bool isConic = basis_curve->is(Ifc2x3::Type::IfcConic);
|
||||||
float parameterFactor = isConic ? Ifc::PlaneAngleUnit : Ifc::LengthUnit;
|
float parameterFactor = isConic ? Ifc::PlaneAngleUnit : Ifc::LengthUnit;
|
||||||
@@ -136,7 +136,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcTrimmedCurve::ptr& l, TopoDS_Wire& wire)
|
|||||||
if ( trimmed2 ) wire = w.Wire();
|
if ( trimmed2 ) wire = w.Wire();
|
||||||
return trimmed2;
|
return trimmed2;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcPolyline::ptr& l, TopoDS_Wire& result) {
|
bool IfcGeom::convert(const Ifc2x3::IfcPolyline::ptr l, TopoDS_Wire& result) {
|
||||||
Ifc2x3::IfcCartesianPoint::list points = l->Points();
|
Ifc2x3::IfcCartesianPoint::list points = l->Points();
|
||||||
|
|
||||||
BRepBuilderAPI_MakeWire w;
|
BRepBuilderAPI_MakeWire w;
|
||||||
@@ -151,7 +151,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcPolyline::ptr& l, TopoDS_Wire& result) {
|
|||||||
result = w.Wire();
|
result = w.Wire();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert(const Ifc2x3::IfcPolyLoop::ptr& l, TopoDS_Wire& result) {
|
bool IfcGeom::convert(const Ifc2x3::IfcPolyLoop::ptr l, TopoDS_Wire& result) {
|
||||||
Ifc2x3::IfcCartesianPoint::list points = l->Polygon();
|
Ifc2x3::IfcCartesianPoint::list points = l->Polygon();
|
||||||
|
|
||||||
BRepBuilderAPI_MakeWire w;
|
BRepBuilderAPI_MakeWire w;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace IfcGeom {
|
|||||||
using namespace Ifc2x3;
|
using namespace Ifc2x3;
|
||||||
using namespace IfcUtil;
|
using namespace IfcUtil;
|
||||||
|
|
||||||
bool IfcGeom::convert_shape(const SHARED_PTR<IfcBaseClass>& l, TopoDS_Shape& r) {
|
bool IfcGeom::convert_shape(const IfcBaseClass* l, TopoDS_Shape& r) {
|
||||||
const unsigned int id = l->entity->id();
|
const unsigned int id = l->entity->id();
|
||||||
std::map<int,TopoDS_Shape>::const_iterator it = Cache::Shape.find(id);
|
std::map<int,TopoDS_Shape>::const_iterator it = Cache::Shape.find(id);
|
||||||
if ( it != Cache::Shape.end() ) { r = it->second; return true; }
|
if ( it != Cache::Shape.end() ) { r = it->second; return true; }
|
||||||
@@ -39,17 +39,17 @@ bool IfcGeom::convert_shape(const SHARED_PTR<IfcBaseClass>& l, TopoDS_Shape& r)
|
|||||||
Ifc::LogMessage("Error","No operation defined for:",l->entity);
|
Ifc::LogMessage("Error","No operation defined for:",l->entity);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert_wire(const SHARED_PTR<IfcBaseClass>& l, TopoDS_Wire& r) {
|
bool IfcGeom::convert_wire(const IfcBaseClass* l, TopoDS_Wire& r) {
|
||||||
#include "IfcRegisterConvertWire.h"
|
#include "IfcRegisterConvertWire.h"
|
||||||
Ifc::LogMessage("Error","No operation defined for:",l->entity);
|
Ifc::LogMessage("Error","No operation defined for:",l->entity);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert_face(const SHARED_PTR<IfcBaseClass>& l, TopoDS_Face& r) {
|
bool IfcGeom::convert_face(const IfcBaseClass* l, TopoDS_Face& r) {
|
||||||
#include "IfcRegisterConvertFace.h"
|
#include "IfcRegisterConvertFace.h"
|
||||||
Ifc::LogMessage("Error","No operation defined for:",l->entity);
|
Ifc::LogMessage("Error","No operation defined for:",l->entity);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool IfcGeom::convert_curve(const SHARED_PTR<IfcBaseClass>& l, Handle(Geom_Curve)& r) {
|
bool IfcGeom::convert_curve(const IfcBaseClass* l, Handle(Geom_Curve)& r) {
|
||||||
#include "IfcRegisterConvertCurve.h"
|
#include "IfcRegisterConvertCurve.h"
|
||||||
Ifc::LogMessage("Error","No operation defined for:",l->entity);
|
Ifc::LogMessage("Error","No operation defined for:",l->entity);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "IfcRegisterUndef.h"
|
#include "IfcRegisterUndef.h"
|
||||||
#define CURVE(T) \
|
#define CURVE(T) \
|
||||||
if ( l->is(T::Class()) ) return convert(reinterpret_pointer_cast<IfcBaseClass,T>(l),r);
|
if ( l->is(T::Class()) ) return convert((T*)l,r);
|
||||||
#include "IfcRegisterDef.h"
|
#include "IfcRegisterDef.h"
|
||||||
|
|
||||||
#include "IfcRegister.h"
|
#include "IfcRegister.h"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "IfcRegisterUndef.h"
|
#include "IfcRegisterUndef.h"
|
||||||
#define FACE(T) \
|
#define FACE(T) \
|
||||||
if ( l->is(T::Class()) ) return convert(reinterpret_pointer_cast<IfcBaseClass,T>(l),r);
|
if ( l->is(T::Class()) ) return convert((T*)l,r);
|
||||||
#include "IfcRegisterDef.h"
|
#include "IfcRegisterDef.h"
|
||||||
|
|
||||||
#include "IfcRegister.h"
|
#include "IfcRegister.h"
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
#define SHAPE(T) \
|
#define SHAPE(T) \
|
||||||
if ( l->is(T::Class()) ) { \
|
if ( l->is(T::Class()) ) { \
|
||||||
try { \
|
try { \
|
||||||
bool b = convert(reinterpret_pointer_cast<IfcBaseClass,T>(l),r); \
|
bool b = convert((T*)l,r); \
|
||||||
if ( b ) { \
|
if ( b ) { \
|
||||||
Cache::Shape[l->entity->id()] = r; \
|
Cache::Shape[l->entity->id()] = r; \
|
||||||
return true; \
|
return true; \
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "IfcRegisterUndef.h"
|
#include "IfcRegisterUndef.h"
|
||||||
#define WIRE(T) \
|
#define WIRE(T) \
|
||||||
if ( l->is(T::Class()) ) return convert(reinterpret_pointer_cast<IfcBaseClass,T>(l),r);
|
if ( l->is(T::Class()) ) return convert((T*)l,r);
|
||||||
#include "IfcRegisterDef.h"
|
#include "IfcRegisterDef.h"
|
||||||
|
|
||||||
#include "IfcRegister.h"
|
#include "IfcRegister.h"
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "IfcRegisterUndef.h"
|
#include "IfcRegisterUndef.h"
|
||||||
#define CLASS(T,V) bool convert(const T::ptr& L, V& r);
|
#define CLASS(T,V) bool convert(const T::ptr L, V& r);
|
||||||
#define SHAPE(T) CLASS(T,TopoDS_Shape)
|
#define SHAPE(T) CLASS(T,TopoDS_Shape)
|
||||||
#define WIRE(T) CLASS(T,TopoDS_Wire)
|
#define WIRE(T) CLASS(T,TopoDS_Wire)
|
||||||
#define FACE(T) CLASS(T,TopoDS_Face)
|
#define FACE(T) CLASS(T,TopoDS_Face)
|
||||||
|
|||||||
+3085
-3078
File diff suppressed because it is too large
Load Diff
+2259
-2257
File diff suppressed because it is too large
Load Diff
+47
-37
@@ -280,8 +280,8 @@ TokenArgument::TokenArgument(Token t) {
|
|||||||
token = t;
|
token = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityArgument::EntityArgument(IfcUtil::IfcSchemaEntity e) {
|
EntityArgument::EntityArgument(Ifc2x3::Type::Enum ty, Token t) {
|
||||||
entity = e;
|
entity = new IfcUtil::IfcArgumentSelect(ty,new TokenArgument(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -292,17 +292,15 @@ ArgumentList::ArgumentList(Tokens* t, std::vector<unsigned int>& ids) {
|
|||||||
while( Token next = t->Next() ) {
|
while( Token next = t->Next() ) {
|
||||||
if ( TokenFunc::isOperator(next,',') ) continue;
|
if ( TokenFunc::isOperator(next,',') ) continue;
|
||||||
if ( TokenFunc::isOperator(next,')') ) break;
|
if ( TokenFunc::isOperator(next,')') ) break;
|
||||||
if ( TokenFunc::isOperator(next,'(') ) Push( ArgumentPtr(new ArgumentList(t,ids)) );
|
if ( TokenFunc::isOperator(next,'(') ) Push( new ArgumentList(t,ids) );
|
||||||
else {
|
else {
|
||||||
if ( TokenFunc::isIdentifier(next) ) ids.push_back(TokenFunc::asInt(next));
|
if ( TokenFunc::isIdentifier(next) ) ids.push_back(TokenFunc::asInt(next));
|
||||||
if ( TokenFunc::isDatatype(next) ) {
|
if ( TokenFunc::isDatatype(next) ) {
|
||||||
Ifc::file->Seek(TokenFunc::Offset(next));
|
t->Next();
|
||||||
EntityPtr e = EntityPtr(new Entity(0,t));
|
Push ( new EntityArgument(Ifc2x3::Type::FromString(TokenFunc::asString(next)),t->Next()) );
|
||||||
e->Load(ids,true);
|
t->Next();
|
||||||
IfcUtil::IfcSchemaEntity entity = Ifc2x3::SchemaEntity(e);
|
|
||||||
Push ( ArgumentPtr(new EntityArgument(entity)) );
|
|
||||||
} else {
|
} else {
|
||||||
Push ( ArgumentPtr(new TokenArgument(next)) );
|
Push ( new TokenArgument(next) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -344,7 +342,7 @@ ArgumentList::operator std::vector<std::string>() const {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
ArgumentList::operator IfcUtil::IfcSchemaEntity() const { throw IfcException("Argument is not an IFC type"); }
|
ArgumentList::operator IfcUtil::IfcSchemaEntity() const { throw IfcException("Argument is not an IFC type"); }
|
||||||
ArgumentList::operator SHARED_PTR<IfcUtil::IfcAbstractSelect>() const { throw IfcException("Argument is not an IFC type"); }
|
//ArgumentList::operator IfcUtil::IfcAbstractSelect::ptr() const { throw IfcException("Argument is not an IFC type"); }
|
||||||
ArgumentList::operator IfcEntities() const {
|
ArgumentList::operator IfcEntities() const {
|
||||||
IfcEntities l ( new IfcEntityList() );
|
IfcEntities l ( new IfcEntityList() );
|
||||||
std::vector<ArgumentPtr>::const_iterator it;
|
std::vector<ArgumentPtr>::const_iterator it;
|
||||||
@@ -372,6 +370,12 @@ std::string ArgumentList::toString() const {
|
|||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
bool ArgumentList::isNull() const { return false; }
|
bool ArgumentList::isNull() const { return false; }
|
||||||
|
ArgumentList::~ArgumentList() {
|
||||||
|
for( std::vector<ArgumentPtr>::iterator it = list.begin(); it != list.end(); it ++ ) {
|
||||||
|
delete (*it);
|
||||||
|
}
|
||||||
|
list.clear();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Functions for casting the TokenArgument to other types
|
// Functions for casting the TokenArgument to other types
|
||||||
@@ -384,9 +388,10 @@ TokenArgument::operator std::vector<float>() const { throw IfcException("Argumen
|
|||||||
TokenArgument::operator std::vector<int>() const { throw IfcException("Argument is not a list of ints"); }
|
TokenArgument::operator std::vector<int>() const { throw IfcException("Argument is not a list of ints"); }
|
||||||
TokenArgument::operator std::vector<std::string>() const { throw IfcException("Argument is not a list of strings"); }
|
TokenArgument::operator std::vector<std::string>() const { throw IfcException("Argument is not a list of strings"); }
|
||||||
TokenArgument::operator IfcUtil::IfcSchemaEntity() const { return Ifc::EntityById(TokenFunc::asInt(token)); }
|
TokenArgument::operator IfcUtil::IfcSchemaEntity() const { return Ifc::EntityById(TokenFunc::asInt(token)); }
|
||||||
TokenArgument::operator SHARED_PTR<IfcUtil::IfcAbstractSelect>() const {
|
/*TokenArgument::operator IfcUtil::IfcAbstractSelect::ptr() const {
|
||||||
return SHARED_PTR<IfcUtil::IfcAbstractSelect>( new IfcUtil::IfcEntitySelect(*this) );
|
//TODO Fix memory leak
|
||||||
}
|
return new IfcUtil::IfcEntitySelect(*this);
|
||||||
|
}*/
|
||||||
TokenArgument::operator IfcEntities() const { throw IfcException("Argument is not a list of entities"); }
|
TokenArgument::operator IfcEntities() const { throw IfcException("Argument is not a list of entities"); }
|
||||||
unsigned int TokenArgument::Size() const { return 1; }
|
unsigned int TokenArgument::Size() const { return 1; }
|
||||||
ArgumentPtr TokenArgument::operator [] (unsigned int i) const { throw IfcException("Argument is not a list of arguments"); }
|
ArgumentPtr TokenArgument::operator [] (unsigned int i) const { throw IfcException("Argument is not a list of arguments"); }
|
||||||
@@ -402,17 +407,15 @@ EntityArgument::operator std::string() const { throw IfcException("Argument is n
|
|||||||
EntityArgument::operator std::vector<float>() const { throw IfcException("Argument is not a list of floats"); }
|
EntityArgument::operator std::vector<float>() const { throw IfcException("Argument is not a list of floats"); }
|
||||||
EntityArgument::operator std::vector<int>() const { throw IfcException("Argument is not a list of ints"); }
|
EntityArgument::operator std::vector<int>() const { throw IfcException("Argument is not a list of ints"); }
|
||||||
EntityArgument::operator std::vector<std::string>() const { throw IfcException("Argument is not a list of strings"); }
|
EntityArgument::operator std::vector<std::string>() const { throw IfcException("Argument is not a list of strings"); }
|
||||||
EntityArgument::operator IfcUtil::IfcSchemaEntity() const {
|
EntityArgument::operator IfcUtil::IfcSchemaEntity() const { return entity; }
|
||||||
return SHARED_PTR<IfcUtil::IfcAbstractSelect>( new IfcUtil::IfcArgumentSelect(entity->type(),entity->entity->getArgument(0)) );
|
//EntityArgument::operator IfcUtil::IfcAbstractSelect::ptr() const { return entity; }
|
||||||
}
|
|
||||||
EntityArgument::operator SHARED_PTR<IfcUtil::IfcAbstractSelect>() const {
|
|
||||||
return SHARED_PTR<IfcUtil::IfcAbstractSelect>( new IfcUtil::IfcArgumentSelect(entity->type(),entity->entity->getArgument(0)) );
|
|
||||||
}
|
|
||||||
EntityArgument::operator IfcEntities() const { throw IfcException("Argument is not a list of entities"); }
|
EntityArgument::operator IfcEntities() const { throw IfcException("Argument is not a list of entities"); }
|
||||||
unsigned int EntityArgument::Size() const { return 1; }
|
unsigned int EntityArgument::Size() const { return 1; }
|
||||||
ArgumentPtr EntityArgument::operator [] (unsigned int i) const { throw IfcException("Argument is not a list of arguments"); }
|
ArgumentPtr EntityArgument::operator [] (unsigned int i) const { throw IfcException("Argument is not a list of arguments"); }
|
||||||
std::string EntityArgument::toString() const { return entity->entity->toString(); }
|
std::string EntityArgument::toString() const { return Ifc2x3::Type::ToString(entity->type()); }
|
||||||
|
//return entity->entity->toString(); }
|
||||||
bool EntityArgument::isNull() const { return false; }
|
bool EntityArgument::isNull() const { return false; }
|
||||||
|
EntityArgument::~EntityArgument() { delete entity; }
|
||||||
|
|
||||||
//
|
//
|
||||||
// Reads an Entity from the list of Tokens
|
// Reads an Entity from the list of Tokens
|
||||||
@@ -458,13 +461,13 @@ void Entity::Load(std::vector<unsigned int>& ids, bool seek) {
|
|||||||
_type = Ifc2x3::Type::FromString(TokenFunc::asString(datatype));
|
_type = Ifc2x3::Type::FromString(TokenFunc::asString(datatype));
|
||||||
}
|
}
|
||||||
Token open = Ifc::tokens->Next();
|
Token open = Ifc::tokens->Next();
|
||||||
args = ArgumentPtr(new ArgumentList(Ifc::tokens, ids));
|
args = new ArgumentList(Ifc::tokens, ids);
|
||||||
unsigned int old_offset = Ifc::file->Tell();
|
unsigned int old_offset = Ifc::file->Tell();
|
||||||
Token semilocon = Ifc::tokens->Next();
|
Token semilocon = Ifc::tokens->Next();
|
||||||
if ( ! TokenFunc::isOperator(semilocon,';') ) Ifc::file->Seek(old_offset);
|
if ( ! TokenFunc::isOperator(semilocon,';') ) Ifc::file->Seek(old_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ifc2x3::Type::Enum Entity::type() {
|
Ifc2x3::Type::Enum Entity::type() const {
|
||||||
return _type;
|
return _type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -489,6 +492,10 @@ std::string Entity::toString() {
|
|||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Entity::~Entity() {
|
||||||
|
delete args;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Returns the entities of type c that have this entity in their ArgumentList
|
// Returns the entities of type c that have this entity in their ArgumentList
|
||||||
//
|
//
|
||||||
@@ -514,7 +521,7 @@ IfcEntities Entity::getInverse(Ifc2x3::Type::Enum c, int i, const std::string& a
|
|||||||
}
|
}
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
bool Entity::is(Ifc2x3::Type::Enum v) { return _type == v; }
|
bool Entity::is(Ifc2x3::Type::Enum v) const { return _type == v; }
|
||||||
unsigned int Entity::id() { return _id; }
|
unsigned int Entity::id() { return _id; }
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -529,6 +536,7 @@ bool Ifc::Init(std::istream& f, int len) {
|
|||||||
return Ifc::Init(new File(f,len));
|
return Ifc::Init(new File(f,len));
|
||||||
}
|
}
|
||||||
bool Ifc::Init(IfcParse::File* f) {
|
bool Ifc::Init(IfcParse::File* f) {
|
||||||
|
Ifc2x3::InitStringMap();
|
||||||
file = f;
|
file = f;
|
||||||
if ( ! file->valid ) return false;
|
if ( ! file->valid ) return false;
|
||||||
tokens = new Tokens (file);
|
tokens = new Tokens (file);
|
||||||
@@ -542,7 +550,7 @@ bool Ifc::Init(IfcParse::File* f) {
|
|||||||
if ( log1 ) std::cout << "Scanning file..." << std::endl;
|
if ( log1 ) std::cout << "Scanning file..." << std::endl;
|
||||||
while ( true ) {
|
while ( true ) {
|
||||||
if ( currentId ) {
|
if ( currentId ) {
|
||||||
e = EntityPtr(new Entity(currentId,tokens));
|
e = new Entity(currentId,tokens);
|
||||||
entity = Ifc2x3::SchemaEntity(e);
|
entity = Ifc2x3::SchemaEntity(e);
|
||||||
if ( log1 && !((++x)%1000) ) std::cout << "\r#" << currentId << " " << std::flush;
|
if ( log1 && !((++x)%1000) ) std::cout << "\r#" << currentId << " " << std::flush;
|
||||||
Ifc2x3::Type::Enum ty = entity->type();
|
Ifc2x3::Type::Enum ty = entity->type();
|
||||||
@@ -589,18 +597,16 @@ bool Ifc::Init(IfcParse::File* f) {
|
|||||||
Ifc2x3::IfcSIUnit::ptr unit = Ifc2x3::IfcSIUnit::ptr();
|
Ifc2x3::IfcSIUnit::ptr unit = Ifc2x3::IfcSIUnit::ptr();
|
||||||
float value = 1.0f;
|
float value = 1.0f;
|
||||||
if ( base->is(Ifc2x3::Type::IfcConversionBasedUnit) ) {
|
if ( base->is(Ifc2x3::Type::IfcConversionBasedUnit) ) {
|
||||||
const Ifc2x3::IfcConversionBasedUnit::ptr u = reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcConversionBasedUnit>(*it);
|
const Ifc2x3::IfcConversionBasedUnit::ptr u = reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcConversionBasedUnit>(base);
|
||||||
const Ifc2x3::IfcMeasureWithUnit::ptr u2 = u->ConversionFactor();
|
const Ifc2x3::IfcMeasureWithUnit::ptr u2 = u->ConversionFactor();
|
||||||
Ifc2x3::IfcUnit u3 = u2->UnitComponent();
|
Ifc2x3::IfcUnit u3 = u2->UnitComponent();
|
||||||
if ( u3->is(Ifc2x3::Type::IfcSIUnit) ) {
|
if ( u3->is(Ifc2x3::Type::IfcSIUnit) ) {
|
||||||
unit = reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcSIUnit>(u3);
|
unit = (Ifc2x3::IfcSIUnit*) u3;
|
||||||
}
|
}
|
||||||
Ifc2x3::IfcValue v = u2->ValueComponent();
|
Ifc2x3::IfcValue v = u2->ValueComponent();
|
||||||
if ( v->isSimpleType() ) {
|
IfcUtil::IfcArgumentSelect* v2 = (IfcUtil::IfcArgumentSelect*) v;
|
||||||
IfcUtil::IfcArgumentSelect::ptr v2 = reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,IfcUtil::IfcArgumentSelect>(v);
|
const float f = *v2->wrappedValue();
|
||||||
const float f = *v2->wrappedValue();
|
value *= f;
|
||||||
value *= f;
|
|
||||||
}
|
|
||||||
} else if ( base->is(Ifc2x3::Type::IfcSIUnit) ) {
|
} else if ( base->is(Ifc2x3::Type::IfcSIUnit) ) {
|
||||||
unit = reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcSIUnit>(base);
|
unit = reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcSIUnit>(base);
|
||||||
}
|
}
|
||||||
@@ -646,13 +652,17 @@ IfcException::~IfcException() throw () {}
|
|||||||
const char* IfcException::what() const throw() { return error.c_str(); }
|
const char* IfcException::what() const throw() { return error.c_str(); }
|
||||||
|
|
||||||
void Ifc::Dispose() {
|
void Ifc::Dispose() {
|
||||||
file->Close();
|
for( MapEntityById::const_iterator it = byid.begin(); it != byid.end(); ++ it ) {
|
||||||
delete file;
|
delete it->second->entity;
|
||||||
delete tokens;
|
delete it->second;
|
||||||
offsets.clear();
|
}
|
||||||
bytype.clear();
|
bytype.clear();
|
||||||
byid.clear();
|
byid.clear();
|
||||||
byref.clear();
|
byref.clear();
|
||||||
|
file->Close();
|
||||||
|
delete file;
|
||||||
|
delete tokens;
|
||||||
|
offsets.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
float UnitPrefixToValue( Ifc2x3::IfcSIPrefix::IfcSIPrefix v ) {
|
float UnitPrefixToValue( Ifc2x3::IfcSIPrefix::IfcSIPrefix v ) {
|
||||||
@@ -675,7 +685,7 @@ float UnitPrefixToValue( Ifc2x3::IfcSIPrefix::IfcSIPrefix v ) {
|
|||||||
else return 1.0f;
|
else return 1.0f;
|
||||||
}
|
}
|
||||||
void Ifc::SetOutput(std::ostream* l1, std::ostream* l2) { log1 = l1; log2 = l2; }
|
void Ifc::SetOutput(std::ostream* l1, std::ostream* l2) { log1 = l1; log2 = l2; }
|
||||||
void Ifc::LogMessage(const std::string& type, const std::string& message, const SHARED_PTR<IfcAbstractEntity>& entity) {
|
void Ifc::LogMessage(const std::string& type, const std::string& message, const IfcAbstractEntityPtr entity) {
|
||||||
if ( log2 ) {
|
if ( log2 ) {
|
||||||
(*log2) << "[" << type << "] " << message << std::endl;
|
(*log2) << "[" << type << "] " << message << std::endl;
|
||||||
if ( entity ) (*log2) << entity->toString() << std::endl;
|
if ( entity ) (*log2) << entity->toString() << std::endl;
|
||||||
|
|||||||
+12
-9
@@ -46,7 +46,7 @@ namespace IfcParse {
|
|||||||
|
|
||||||
class Entity;
|
class Entity;
|
||||||
class Entities;
|
class Entities;
|
||||||
typedef SHARED_PTR<Entity> EntityPtr;
|
typedef Entity* EntityPtr;
|
||||||
typedef SHARED_PTR<Entities> EntitiesPtr;
|
typedef SHARED_PTR<Entities> EntitiesPtr;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -130,6 +130,7 @@ namespace IfcParse {
|
|||||||
void Push(ArgumentPtr l);
|
void Push(ArgumentPtr l);
|
||||||
public:
|
public:
|
||||||
ArgumentList(Tokens* t, std::vector<unsigned int>& ids);
|
ArgumentList(Tokens* t, std::vector<unsigned int>& ids);
|
||||||
|
~ArgumentList();
|
||||||
operator int() const;
|
operator int() const;
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
operator float() const;
|
operator float() const;
|
||||||
@@ -138,7 +139,7 @@ namespace IfcParse {
|
|||||||
operator std::vector<int>() const;
|
operator std::vector<int>() const;
|
||||||
operator std::vector<std::string>() const;
|
operator std::vector<std::string>() const;
|
||||||
operator IfcUtil::IfcSchemaEntity() const;
|
operator IfcUtil::IfcSchemaEntity() const;
|
||||||
operator SHARED_PTR<IfcUtil::IfcAbstractSelect>() const;
|
//operator IfcUtil::IfcAbstractSelect::ptr() const;
|
||||||
operator IfcEntities() const;
|
operator IfcEntities() const;
|
||||||
unsigned int Size() const;
|
unsigned int Size() const;
|
||||||
ArgumentPtr operator [] (unsigned int i) const;
|
ArgumentPtr operator [] (unsigned int i) const;
|
||||||
@@ -164,7 +165,7 @@ namespace IfcParse {
|
|||||||
operator std::vector<int>() const;
|
operator std::vector<int>() const;
|
||||||
operator std::vector<std::string>() const;
|
operator std::vector<std::string>() const;
|
||||||
operator IfcUtil::IfcSchemaEntity() const;
|
operator IfcUtil::IfcSchemaEntity() const;
|
||||||
operator SHARED_PTR<IfcUtil::IfcAbstractSelect>() const;
|
//operator IfcUtil::IfcAbstractSelect::ptr() const;
|
||||||
operator IfcEntities() const;
|
operator IfcEntities() const;
|
||||||
unsigned int Size() const;
|
unsigned int Size() const;
|
||||||
ArgumentPtr operator [] (unsigned int i) const;
|
ArgumentPtr operator [] (unsigned int i) const;
|
||||||
@@ -179,9 +180,10 @@ namespace IfcParse {
|
|||||||
//
|
//
|
||||||
class EntityArgument : public Argument {
|
class EntityArgument : public Argument {
|
||||||
private:
|
private:
|
||||||
IfcUtil::IfcSchemaEntity entity;
|
IfcUtil::IfcArgumentSelect* entity;
|
||||||
public:
|
public:
|
||||||
EntityArgument(IfcUtil::IfcSchemaEntity e);
|
EntityArgument(Ifc2x3::Type::Enum ty, Token t);
|
||||||
|
~EntityArgument();
|
||||||
operator int() const;
|
operator int() const;
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
operator float() const;
|
operator float() const;
|
||||||
@@ -190,7 +192,7 @@ namespace IfcParse {
|
|||||||
operator std::vector<int>() const;
|
operator std::vector<int>() const;
|
||||||
operator std::vector<std::string>() const;
|
operator std::vector<std::string>() const;
|
||||||
operator IfcUtil::IfcSchemaEntity() const;
|
operator IfcUtil::IfcSchemaEntity() const;
|
||||||
operator SHARED_PTR<IfcUtil::IfcAbstractSelect>() const;
|
//operator IfcUtil::IfcAbstractSelect::ptr() const;
|
||||||
operator IfcEntities() const;
|
operator IfcEntities() const;
|
||||||
unsigned int Size() const;
|
unsigned int Size() const;
|
||||||
ArgumentPtr operator [] (unsigned int i) const;
|
ArgumentPtr operator [] (unsigned int i) const;
|
||||||
@@ -212,14 +214,15 @@ namespace IfcParse {
|
|||||||
unsigned int offset;
|
unsigned int offset;
|
||||||
Entity(unsigned int i, Tokens* t);
|
Entity(unsigned int i, Tokens* t);
|
||||||
Entity(unsigned int i, Tokens* t, unsigned int o);
|
Entity(unsigned int i, Tokens* t, unsigned int o);
|
||||||
|
~Entity();
|
||||||
IfcEntities getInverse(Ifc2x3::Type::Enum c = Ifc2x3::Type::ALL);
|
IfcEntities getInverse(Ifc2x3::Type::Enum c = Ifc2x3::Type::ALL);
|
||||||
IfcEntities getInverse(Ifc2x3::Type::Enum c, int i, const std::string& a);
|
IfcEntities getInverse(Ifc2x3::Type::Enum c, int i, const std::string& a);
|
||||||
void Load(std::vector<unsigned int>& ids, bool seek=false);
|
void Load(std::vector<unsigned int>& ids, bool seek=false);
|
||||||
ArgumentPtr getArgument (unsigned int i);
|
ArgumentPtr getArgument (unsigned int i);
|
||||||
std::string toString();
|
std::string toString();
|
||||||
std::string datatype();
|
std::string datatype();
|
||||||
Ifc2x3::Type::Enum type();
|
Ifc2x3::Type::Enum type() const;
|
||||||
bool is(Ifc2x3::Type::Enum v);
|
bool is(Ifc2x3::Type::Enum v) const;
|
||||||
unsigned int id();
|
unsigned int id();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -254,7 +257,7 @@ private:
|
|||||||
static std::ostream* log2;
|
static std::ostream* log2;
|
||||||
public:
|
public:
|
||||||
static void SetOutput(std::ostream* l1, std::ostream* l2);
|
static void SetOutput(std::ostream* l1, std::ostream* l2);
|
||||||
static void LogMessage(const std::string& type, const std::string& message, const SHARED_PTR<IfcAbstractEntity>& entity=SHARED_PTR<IfcAbstractEntity>());
|
static void LogMessage(const std::string& type, const std::string& message, const IfcAbstractEntityPtr entity=0);
|
||||||
static IfcParse::File* file;
|
static IfcParse::File* file;
|
||||||
static IfcParse::Tokens* tokens;
|
static IfcParse::Tokens* tokens;
|
||||||
template <class T>
|
template <class T>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
#include "IfcUtil.h"
|
#include "IfcUtil.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
void IfcEntityList::push(IfcUtil::IfcSchemaEntity l) {
|
void IfcEntityList::push(IfcUtil::IfcSchemaEntity l) {
|
||||||
if ( l ) ls.push_back(l);
|
if ( l ) ls.push_back(l);
|
||||||
@@ -48,14 +49,16 @@ IfcEntities IfcEntityList::getInverse(Ifc2x3::Type::Enum c, int ar, const std::s
|
|||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IfcUtil::IfcEntitySelect::is(Ifc2x3::Type::Enum v) { return entity->is(v); }
|
bool IfcUtil::IfcEntitySelect::is(Ifc2x3::Type::Enum v) const { return entity->is(v); }
|
||||||
Ifc2x3::Type::Enum IfcUtil::IfcEntitySelect::type() { return entity->type(); }
|
Ifc2x3::Type::Enum IfcUtil::IfcEntitySelect::type() const { return entity->type(); }
|
||||||
IfcUtil::IfcEntitySelect::IfcEntitySelect(SHARED_PTR<IfcBaseClass> b) { entity = b->entity; }
|
IfcUtil::IfcEntitySelect::IfcEntitySelect(IfcSchemaEntity b) { entity = b->entity; }
|
||||||
IfcUtil::IfcEntitySelect::IfcEntitySelect(IfcAbstractEntityPtr e) { entity = e; }
|
IfcUtil::IfcEntitySelect::IfcEntitySelect(IfcAbstractEntityPtr e) { entity = e; }
|
||||||
bool IfcUtil::IfcEntitySelect::isSimpleType() { return false; }
|
bool IfcUtil::IfcEntitySelect::isSimpleType() { return false; }
|
||||||
|
IfcUtil::IfcEntitySelect::~IfcEntitySelect() { delete entity; }
|
||||||
|
|
||||||
bool IfcUtil::IfcArgumentSelect::is(Ifc2x3::Type::Enum v) { return _type == v; }
|
bool IfcUtil::IfcArgumentSelect::is(Ifc2x3::Type::Enum v) const { return _type == v; }
|
||||||
Ifc2x3::Type::Enum IfcUtil::IfcArgumentSelect::type() { return _type; }
|
Ifc2x3::Type::Enum IfcUtil::IfcArgumentSelect::type() const { return _type; }
|
||||||
IfcUtil::IfcArgumentSelect::IfcArgumentSelect(Ifc2x3::Type::Enum t, ArgumentPtr a) { _type = t; arg = a; }
|
IfcUtil::IfcArgumentSelect::IfcArgumentSelect(Ifc2x3::Type::Enum t, ArgumentPtr a) { _type = t; arg = a; }
|
||||||
ArgumentPtr IfcUtil::IfcArgumentSelect::wrappedValue() { return arg; }
|
ArgumentPtr IfcUtil::IfcArgumentSelect::wrappedValue() { return arg; }
|
||||||
bool IfcUtil::IfcArgumentSelect::isSimpleType() { return true; }
|
bool IfcUtil::IfcArgumentSelect::isSimpleType() { return true; }
|
||||||
|
IfcUtil::IfcArgumentSelect::~IfcArgumentSelect() { delete arg; }
|
||||||
|
|||||||
+31
-23
@@ -27,15 +27,17 @@
|
|||||||
#include "../ifcparse/Ifc2x3enum.h"
|
#include "../ifcparse/Ifc2x3enum.h"
|
||||||
|
|
||||||
class IfcAbstractEntity;
|
class IfcAbstractEntity;
|
||||||
typedef SHARED_PTR<IfcAbstractEntity> IfcAbstractEntityPtr;
|
//typedef SHARED_PTR<IfcAbstractEntity> IfcAbstractEntityPtr;
|
||||||
|
typedef IfcAbstractEntity* IfcAbstractEntityPtr;
|
||||||
|
|
||||||
class IfcEntityList;
|
class IfcEntityList;
|
||||||
typedef SHARED_PTR<IfcEntityList> IfcEntities;
|
typedef SHARED_PTR<IfcEntityList> IfcEntities;
|
||||||
|
|
||||||
template <class F, class T>
|
template <class F, class T>
|
||||||
inline SHARED_PTR<T> reinterpret_pointer_cast(SHARED_PTR<F> from) {
|
inline T* reinterpret_pointer_cast(F* from) {
|
||||||
SHARED_PTR<void> v = std::tr1::static_pointer_cast<void,F>(from);
|
return (T*)from;
|
||||||
return std::tr1::static_pointer_cast<T,void>(v);
|
//SHARED_PTR<void> v = std::tr1::static_pointer_cast<void,F>(from);
|
||||||
|
//return std::tr1::static_pointer_cast<T,void>(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace IfcUtil {
|
namespace IfcUtil {
|
||||||
@@ -43,11 +45,12 @@ namespace IfcUtil {
|
|||||||
class IfcBaseClass {
|
class IfcBaseClass {
|
||||||
public:
|
public:
|
||||||
IfcAbstractEntityPtr entity;
|
IfcAbstractEntityPtr entity;
|
||||||
virtual bool is(Ifc2x3::Type::Enum v) = 0;
|
virtual bool is(Ifc2x3::Type::Enum v) const = 0;
|
||||||
virtual Ifc2x3::Type::Enum type() = 0;
|
virtual Ifc2x3::Type::Enum type() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef SHARED_PTR<IfcBaseClass> IfcSchemaEntity;
|
//typedef SHARED_PTR<IfcBaseClass> IfcSchemaEntity;
|
||||||
|
typedef IfcBaseClass* IfcSchemaEntity;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,10 +70,10 @@ public:
|
|||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class IfcTemplatedEntityList {
|
class IfcTemplatedEntityList {
|
||||||
std::vector<SHARED_PTR<T> > ls;
|
std::vector<T*> ls;
|
||||||
public:
|
public:
|
||||||
typedef typename std::vector<SHARED_PTR<T> >::const_iterator it;
|
typedef typename std::vector<T*>::const_iterator it;
|
||||||
inline void push(SHARED_PTR<T> t) {if (t) ls.push_back(t);}
|
inline void push(T* t) {if (t) ls.push_back(t);}
|
||||||
inline void push(SHARED_PTR< IfcTemplatedEntityList<T> > t) { for ( typename T::it it = t->begin(); it != t->end(); ++it ) push(*it); }
|
inline void push(SHARED_PTR< IfcTemplatedEntityList<T> > t) { for ( typename T::it it = t->begin(); it != t->end(); ++it ) push(*it); }
|
||||||
inline it begin() { return ls.begin(); }
|
inline it begin() { return ls.begin(); }
|
||||||
inline it end() { return ls.end(); }
|
inline it end() { return ls.end(); }
|
||||||
@@ -79,34 +82,37 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
class Argument;
|
class Argument;
|
||||||
typedef SHARED_PTR<Argument> ArgumentPtr;
|
//typedef SHARED_PTR<Argument> ArgumentPtr;
|
||||||
|
typedef Argument* ArgumentPtr;
|
||||||
|
|
||||||
namespace IfcUtil {
|
namespace IfcUtil {
|
||||||
class IfcAbstractSelect : public IfcBaseClass {
|
class IfcAbstractSelect : public IfcBaseClass {
|
||||||
public:
|
public:
|
||||||
typedef SHARED_PTR< IfcTemplatedEntityList<IfcAbstractSelect> > list;
|
typedef SHARED_PTR< IfcTemplatedEntityList<IfcAbstractSelect> > list;
|
||||||
typedef IfcTemplatedEntityList<IfcAbstractSelect>::it it;
|
typedef IfcTemplatedEntityList<IfcAbstractSelect>::it it;
|
||||||
typedef SHARED_PTR<IfcAbstractSelect> ptr;
|
typedef IfcAbstractSelect* ptr;
|
||||||
virtual bool isSimpleType() = 0;
|
virtual bool isSimpleType() = 0;
|
||||||
};
|
};
|
||||||
class IfcEntitySelect : public IfcAbstractSelect {
|
class IfcEntitySelect : public IfcAbstractSelect {
|
||||||
public:
|
public:
|
||||||
typedef SHARED_PTR<IfcEntitySelect> ptr;
|
typedef IfcEntitySelect* ptr;
|
||||||
IfcEntitySelect(SHARED_PTR<IfcUtil::IfcBaseClass> b);
|
IfcEntitySelect(IfcSchemaEntity b);
|
||||||
IfcEntitySelect(IfcAbstractEntityPtr e);
|
IfcEntitySelect(IfcAbstractEntityPtr e);
|
||||||
bool is(Ifc2x3::Type::Enum v);
|
~IfcEntitySelect();
|
||||||
Ifc2x3::Type::Enum type();
|
bool is(Ifc2x3::Type::Enum v) const;
|
||||||
|
Ifc2x3::Type::Enum type() const;
|
||||||
bool isSimpleType();
|
bool isSimpleType();
|
||||||
};
|
};
|
||||||
class IfcArgumentSelect : public IfcAbstractSelect {
|
class IfcArgumentSelect : public IfcAbstractSelect {
|
||||||
Ifc2x3::Type::Enum _type;
|
Ifc2x3::Type::Enum _type;
|
||||||
ArgumentPtr arg;
|
ArgumentPtr arg;
|
||||||
public:
|
public:
|
||||||
typedef SHARED_PTR<IfcArgumentSelect> ptr;
|
typedef IfcArgumentSelect* ptr;
|
||||||
IfcArgumentSelect(Ifc2x3::Type::Enum t, ArgumentPtr a);
|
IfcArgumentSelect(Ifc2x3::Type::Enum t, ArgumentPtr a);
|
||||||
|
~IfcArgumentSelect();
|
||||||
ArgumentPtr wrappedValue();
|
ArgumentPtr wrappedValue();
|
||||||
bool is(Ifc2x3::Type::Enum v);
|
bool is(Ifc2x3::Type::Enum v) const;
|
||||||
Ifc2x3::Type::Enum type();
|
Ifc2x3::Type::Enum type() const;
|
||||||
bool isSimpleType();
|
bool isSimpleType();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -122,12 +128,13 @@ public:
|
|||||||
virtual operator std::vector<int>() const = 0;
|
virtual operator std::vector<int>() const = 0;
|
||||||
virtual operator std::vector<std::string>() const = 0;
|
virtual operator std::vector<std::string>() const = 0;
|
||||||
virtual operator IfcUtil::IfcSchemaEntity() const = 0;
|
virtual operator IfcUtil::IfcSchemaEntity() const = 0;
|
||||||
virtual operator SHARED_PTR<IfcUtil::IfcAbstractSelect>() const = 0;
|
//virtual operator IfcUtil::IfcAbstractSelect::ptr() const = 0;
|
||||||
virtual operator IfcEntities() const = 0;
|
virtual operator IfcEntities() const = 0;
|
||||||
virtual unsigned int Size() const = 0;
|
virtual unsigned int Size() const = 0;
|
||||||
virtual ArgumentPtr operator [] (unsigned int i) const = 0;
|
virtual ArgumentPtr operator [] (unsigned int i) const = 0;
|
||||||
virtual std::string toString() const = 0;
|
virtual std::string toString() const = 0;
|
||||||
virtual bool isNull() const = 0;
|
virtual bool isNull() const = 0;
|
||||||
|
virtual ~Argument() {};
|
||||||
};
|
};
|
||||||
|
|
||||||
class IfcAbstractEntity {
|
class IfcAbstractEntity {
|
||||||
@@ -136,10 +143,11 @@ public:
|
|||||||
virtual IfcEntities getInverse(Ifc2x3::Type::Enum c, int i, const std::string& a) = 0;
|
virtual IfcEntities getInverse(Ifc2x3::Type::Enum c, int i, const std::string& a) = 0;
|
||||||
virtual std::string datatype() = 0;
|
virtual std::string datatype() = 0;
|
||||||
virtual ArgumentPtr getArgument (unsigned int i) = 0;
|
virtual ArgumentPtr getArgument (unsigned int i) = 0;
|
||||||
virtual Ifc2x3::Type::Enum type() = 0;
|
virtual ~IfcAbstractEntity() {};
|
||||||
virtual bool is(Ifc2x3::Type::Enum v) = 0;
|
virtual Ifc2x3::Type::Enum type() const = 0;
|
||||||
|
virtual bool is(Ifc2x3::Type::Enum v) const = 0;
|
||||||
virtual std::string toString() = 0;
|
virtual std::string toString() = 0;
|
||||||
virtual unsigned int id() = 0;
|
virtual unsigned int id() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -103,6 +103,7 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
|
AdditionalOptions="/DWNT"
|
||||||
Optimization="2"
|
Optimization="2"
|
||||||
EnableIntrinsicFunctions="true"
|
EnableIntrinsicFunctions="true"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
||||||
|
|||||||
Reference in New Issue
Block a user