First step at reorganizing

This commit is contained in:
Thomas Krijnen
2019-08-04 09:36:31 +02:00
parent c8def0474e
commit 467ebb68a3
20 changed files with 363 additions and 57 deletions
+13 -13
View File
@@ -107,13 +107,13 @@ namespace IfcGeom {
: geometry_exception("Too many faces for operation") {}
};
class IFC_GEOM_API MAKE_TYPE_NAME(Cache) {
class IFC_GEOM_API POSTFIX_SCHEMA(Cache) {
public:
#include "IfcRegisterCreateCache.h"
std::map<int, TopoDS_Shape> Shape;
};
class IFC_GEOM_API MAKE_TYPE_NAME(Kernel) : public IfcGeom::MAKE_TYPE_NAME(AbstractKernel) {
class IFC_GEOM_API POSTFIX_SCHEMA(Kernel) : public IfcGeom::POSTFIX_SCHEMA(AbstractKernel) {
private:
/*
@@ -125,7 +125,7 @@ private:
*/
class faceset_helper {
private:
MAKE_TYPE_NAME(Kernel)* kernel_;
POSTFIX_SCHEMA(Kernel)* kernel_;
std::set<const IfcSchema::IfcPolyLoop*> duplicates_;
std::map<int, int> vertex_mapping_;
std::map<std::pair<int, int>, TopoDS_Edge> edges_;
@@ -154,7 +154,7 @@ private:
}
}
public:
faceset_helper(MAKE_TYPE_NAME(Kernel)* kernel, const IfcSchema::IfcConnectedFaceSet* l);
faceset_helper(POSTFIX_SCHEMA(Kernel)* kernel, const IfcSchema::IfcConnectedFaceSet* l);
~faceset_helper();
@@ -220,24 +220,24 @@ private:
};
#ifndef NO_CACHE
MAKE_TYPE_NAME(Cache) cache;
POSTFIX_SCHEMA(Cache) cache;
#endif
faceset_helper* faceset_helper_;
public:
MAKE_TYPE_NAME(Kernel)()
: IfcGeom::MAKE_TYPE_NAME(AbstractKernel)("opencascade")
POSTFIX_SCHEMA(Kernel)()
: IfcGeom::POSTFIX_SCHEMA(AbstractKernel)("opencascade")
, faceset_helper_(nullptr)
{}
MAKE_TYPE_NAME(Kernel)(const MAKE_TYPE_NAME(Kernel)& other)
: IfcGeom::MAKE_TYPE_NAME(AbstractKernel)("opencascade")
POSTFIX_SCHEMA(Kernel)(const POSTFIX_SCHEMA(Kernel)& other)
: IfcGeom::POSTFIX_SCHEMA(AbstractKernel)("opencascade")
{
*this = other;
}
MAKE_TYPE_NAME(Kernel)& operator=(const MAKE_TYPE_NAME(Kernel)& other) {
POSTFIX_SCHEMA(Kernel)& operator=(const POSTFIX_SCHEMA(Kernel)& other) {
setValue(GV_DEFLECTION_TOLERANCE, other.getValue(GV_DEFLECTION_TOLERANCE));
setValue(GV_MAX_FACES_TO_ORIENT, other.getValue(GV_MAX_FACES_TO_ORIENT));
setValue(GV_LENGTH_UNIT, other.getValue(GV_LENGTH_UNIT));
@@ -333,7 +333,7 @@ public:
// for large files. SurfaceStyles need to be kept at all costs, as they
// are read later on when serializing Collada files.
#ifndef NO_CACHE
cache = MAKE_TYPE_NAME(Cache)();
cache = POSTFIX_SCHEMA(Cache)();
#endif
}
@@ -368,8 +368,8 @@ public:
};
IfcUtil::IfcBaseClass* MAKE_TYPE_NAME(tesselate_)(const TopoDS_Shape& shape, double deflection);
IfcUtil::IfcBaseClass* MAKE_TYPE_NAME(serialise_)(const TopoDS_Shape& shape, bool advanced);
IfcUtil::IfcBaseClass* POSTFIX_SCHEMA(tesselate_)(const TopoDS_Shape& shape, double deflection);
IfcUtil::IfcBaseClass* POSTFIX_SCHEMA(serialise_)(const TopoDS_Shape& shape, bool advanced);
}
#endif
@@ -83,7 +83,7 @@
#include <Geom_BSplineCurve.hxx>
#endif
#define Kernel MAKE_TYPE_NAME(Kernel)
#define Kernel POSTFIX_SCHEMA(Kernel)
bool IfcGeom::Kernel::convert(const IfcSchema::IfcCircle* l, Handle(Geom_Curve)& curve) {
const double r = l->Radius() * getValue(GV_LENGTH_UNIT);
@@ -106,7 +106,7 @@
#include <TColStd_Array1OfInteger.hxx>
#endif
#define Kernel MAKE_TYPE_NAME(Kernel)
#define Kernel POSTFIX_SCHEMA(Kernel)
namespace {
/* Returns whether wire conforms to a polyhedron, i.e. only edges with linear curves*/
@@ -167,9 +167,9 @@
#endif
namespace {
struct MAKE_TYPE_NAME(factory_t) {
struct POSTFIX_SCHEMA(factory_t) {
IfcGeom::Kernel* operator()(IfcParse::IfcFile* file) const {
IfcGeom::MAKE_TYPE_NAME(Kernel)* k = new IfcGeom::MAKE_TYPE_NAME(Kernel);
IfcGeom::POSTFIX_SCHEMA(Kernel)* k = new IfcGeom::POSTFIX_SCHEMA(Kernel);
if (file) {
double unit_magnitude = 1.;
@@ -222,11 +222,11 @@ namespace {
void MAKE_INIT_FN(KernelImplementation_opencascade_)(IfcGeom::impl::KernelFactoryImplementation* mapping) {
static const std::string schema_name = STRINGIFY(IfcSchema);
MAKE_TYPE_NAME(factory_t) factory;
POSTFIX_SCHEMA(factory_t) factory;
mapping->bind(schema_name, "opencascade", factory);
}
#define Kernel MAKE_TYPE_NAME(Kernel)
#define Kernel POSTFIX_SCHEMA(Kernel)
namespace {
void copy_operand(const TopTools_ListOfShape& l, TopTools_ListOfShape& r) {
@@ -77,7 +77,7 @@
#include "../../../ifcgeom/kernels/opencascade/IfcGeom.h"
#define Kernel MAKE_TYPE_NAME(Kernel)
#define Kernel POSTFIX_SCHEMA(Kernel)
namespace {
@@ -493,7 +493,7 @@ int convert_to_ifc(const TopoDS_Shape& s, U*& item, bool advanced) {
return faces->size();
}
IfcUtil::IfcBaseClass* IfcGeom::MAKE_TYPE_NAME(serialise_)(const TopoDS_Shape& shape, bool advanced) {
IfcUtil::IfcBaseClass* IfcGeom::POSTFIX_SCHEMA(serialise_)(const TopoDS_Shape& shape, bool advanced) {
#ifndef USE_IFC4
advanced = false;
#endif
@@ -604,7 +604,7 @@ IfcUtil::IfcBaseClass* IfcGeom::MAKE_TYPE_NAME(serialise_)(const TopoDS_Shape& s
return new IfcSchema::IfcProductDefinitionShape(boost::none, boost::none, reps);
}
IfcUtil::IfcBaseClass* IfcGeom::MAKE_TYPE_NAME(tesselate_)(const TopoDS_Shape& shape, double deflection) {
IfcUtil::IfcBaseClass* IfcGeom::POSTFIX_SCHEMA(tesselate_)(const TopoDS_Shape& shape, double deflection) {
BRepMesh_IncrementalMesh(shape, deflection);
IfcSchema::IfcFace::list::ptr faces(new IfcSchema::IfcFace::list);
@@ -105,7 +105,7 @@
#include <memory>
#define Kernel MAKE_TYPE_NAME(Kernel)
#define Kernel POSTFIX_SCHEMA(Kernel)
bool IfcGeom::Kernel::convert(const IfcSchema::IfcExtrudedAreaSolid* l, TopoDS_Shape& shape) {
const double height = l->Depth() * getValue(GV_LENGTH_UNIT);
@@ -97,7 +97,7 @@
#include "../../../ifcgeom/kernels/opencascade/IfcGeom.h"
#define Kernel MAKE_TYPE_NAME(Kernel)
#define Kernel POSTFIX_SCHEMA(Kernel)
namespace {
// Returns the other vertex of an edge
@@ -20,7 +20,7 @@
#include "IfcGeom.h"
#include "IfcGeomShapeType.h"
#define Kernel MAKE_TYPE_NAME(Kernel)
#define Kernel POSTFIX_SCHEMA(Kernel)
using namespace IfcUtil;