Skip to content

Commit

Permalink
progress on PyBrxBim
Browse files Browse the repository at this point in the history
  • Loading branch information
CEXT-Dan committed Sep 13, 2024
1 parent 05d9acb commit 5a37984
Show file tree
Hide file tree
Showing 5 changed files with 514 additions and 514 deletions.
28 changes: 14 additions & 14 deletions PyRxCore/PyBrxBim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ BOOST_PYTHON_MODULE(PyBrxBim)

makePyBimCoreWrapper();

makePyIFCGuidWrapper();
makePyIFCStringWrapper();
makePyIFCBinaryWrapper();
makePyIFCLogicalWrapper();
makePyIFCVectorDescWrapper();
makePyIFCVectorValueWrapper();
makePyIFCSelectorDescWrapper();
makePyIFCSelectValueWrapper();
makePyIFCEnumValueWrapper();
makePyIFCEntityDescWrapper();
makePyIFCEntityWrapper();
makePyIFCHeaderWrapper();
makePyIFCModelWrapper();
makePyIFCVariantWrapper();
makePyIfcGuidWrapper();
makePyIfcStringWrapper();
makePyIfcBinaryWrapper();
makePyIfcLogicalWrapper();
makePyIfcVectorDescWrapper();
makePyIfcVectorValueWrapper();
makePyIfcSelectorDescWrapper();
makePyIfcSelectValueWrapper();
makePyIfcEnumValueWrapper();
makePyIfcEntityDescWrapper();
makePyIfcEntityWrapper();
makePyIfcHeaderWrapper();
makePyIfcModelWrapper();
makePyIfcVariantWrapper();

makePyBrxBimPoliciesWrapper();
makePyBrxBimObjectWrapper();
Expand Down
60 changes: 30 additions & 30 deletions PyRxCore/PyBrxBimImportExport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "PyDbDatabase.h"
#include "PyDbObjectId.h"
#include "PyDbEntity.h"
#include "PyBrxIFC.h"
#include "PyBrxIfc.h"

using namespace boost::python;

Expand Down Expand Up @@ -250,15 +250,15 @@ void makePyBrxBimIfcImportContextWrapper()
{
PyDocString DS("IfcImportContext");
class_<PyBrxBimIfcImportContext>("IfcImportContext", boost::python::no_init)
.def("ifcModel", &PyBrxBimIfcImportContext::ifcModel, DS.ARGS())
.def("IfcModel", &PyBrxBimIfcImportContext::ifcModel, DS.ARGS())
.def("database", &PyBrxBimIfcImportContext::database, DS.ARGS())
.def("createDefaultRepresentation", &PyBrxBimIfcImportContext::createDefaultRepresentation, DS.ARGS({ "entity: PyBrxBim.IFCEntity","isParent: bool" , "parent: PyBrxBim.IFCEntity" }))
.def("createRepresentationFromItem", &PyBrxBimIfcImportContext::createRepresentationFromItem, DS.ARGS({ "entity: PyBrxBim.IFCEntity" }))
.def("createPoint", &PyBrxBimIfcImportContext::createPoint, DS.ARGS({ "entity: PyBrxBim.IFCEntity" }))
.def("getLocalPlacement", &PyBrxBimIfcImportContext::getLocalPlacement, DS.ARGS({ "entity: PyBrxBim.IFCEntity" }))
.def("createSweptArea", &PyBrxBimIfcImportContext::createSweptArea, DS.ARGS({ "entity: PyBrxBim.IFCEntity" }))
.def("getEntity", &PyBrxBimIfcImportContext::getEntity, DS.ARGS({ "entity: PyBrxBim.IFCEntity" }))
.def("getEntityId", &PyBrxBimIfcImportContext::getEntityId, DS.ARGS({ "entity: PyBrxBim.IFCEntity" }))
.def("createDefaultRepresentation", &PyBrxBimIfcImportContext::createDefaultRepresentation, DS.ARGS({ "entity: PyBrxBim.IfcEntity","isParent: bool" , "parent: PyBrxBim.IfcEntity" }))
.def("createRepresentationFromItem", &PyBrxBimIfcImportContext::createRepresentationFromItem, DS.ARGS({ "entity: PyBrxBim.IfcEntity" }))
.def("createPoint", &PyBrxBimIfcImportContext::createPoint, DS.ARGS({ "entity: PyBrxBim.IfcEntity" }))
.def("getLocalPlacement", &PyBrxBimIfcImportContext::getLocalPlacement, DS.ARGS({ "entity: PyBrxBim.IfcEntity" }))
.def("createSweptArea", &PyBrxBimIfcImportContext::createSweptArea, DS.ARGS({ "entity: PyBrxBim.IfcEntity" }))
.def("getEntity", &PyBrxBimIfcImportContext::getEntity, DS.ARGS({ "entity: PyBrxBim.IfcEntity" }))
.def("getEntityId", &PyBrxBimIfcImportContext::getEntityId, DS.ARGS({ "entity: PyBrxBim.IfcEntity" }))
.def("angleConversionFactor", &PyBrxBimIfcImportContext::angleConversionFactor, DS.ARGS())
.def("areaConversionFactor", &PyBrxBimIfcImportContext::areaConversionFactor, DS.ARGS())
.def("lengthConversionFactor", &PyBrxBimIfcImportContext::lengthConversionFactor, DS.ARGS())
Expand All @@ -278,37 +278,37 @@ PyBrxBimIfcImportContext::PyBrxBimIfcImportContext(IfcImportContext* pObject, bo
{
}

PyIFCModel PyBrxBimIfcImportContext::ifcModel()
PyIfcModel PyBrxBimIfcImportContext::ifcModel()
{
return PyIFCModel(impObj()->ifcModel(), false);
return PyIfcModel(impObj()->ifcModel(), false);
}

PyDbDatabase PyBrxBimIfcImportContext::database()
{
return PyDbDatabase(impObj()->database());
}

PyDbEntity PyBrxBimIfcImportContext::createDefaultRepresentation(const PyIFCEntity& entity, bool isParent, const PyIFCEntity& parent)
PyDbEntity PyBrxBimIfcImportContext::createDefaultRepresentation(const PyIfcEntity& entity, bool isParent, const PyIfcEntity& parent)
{
return PyDbEntity(impObj()->createDefaultRepresentation(*entity.impObj(), isParent, *parent.impObj()), true);
}

PyDbEntity PyBrxBimIfcImportContext::createRepresentationFromItem(const PyIFCEntity& entity)
PyDbEntity PyBrxBimIfcImportContext::createRepresentationFromItem(const PyIfcEntity& entity)
{
return PyDbEntity(impObj()->createRepresentationFromItem(*entity.impObj()), true);
}

AcGePoint3d PyBrxBimIfcImportContext::createPoint(const PyIFCEntity& point)
AcGePoint3d PyBrxBimIfcImportContext::createPoint(const PyIfcEntity& point)
{
return impObj()->createPoint(*point.impObj());
}

AcGeMatrix3d PyBrxBimIfcImportContext::getLocalPlacement(const PyIFCEntity& point)
AcGeMatrix3d PyBrxBimIfcImportContext::getLocalPlacement(const PyIfcEntity& point)
{
return impObj()->getLocalPlacement(*point.impObj());
}

boost::python::list PyBrxBimIfcImportContext::createSweptArea(const PyIFCEntity& sweptArea)
boost::python::list PyBrxBimIfcImportContext::createSweptArea(const PyIfcEntity& sweptArea)
{
PyAutoLockGIL lock;
boost::python::list pylist;
Expand All @@ -317,18 +317,18 @@ boost::python::list PyBrxBimIfcImportContext::createSweptArea(const PyIFCEntity&
return pylist;
}

PyDbEntity PyBrxBimIfcImportContext::getEntity(const PyIFCEntity& ifcEntity)
PyDbEntity PyBrxBimIfcImportContext::getEntity(const PyIfcEntity& IfcEntity)
{
AcDbEntity* pEnt = nullptr;
if (bool flag = impObj()->getEntity(pEnt, *ifcEntity.impObj()); flag == false)
if (bool flag = impObj()->getEntity(pEnt, *IfcEntity.impObj()); flag == false)
PyThrowBadBim(BimApi::eInvalidInput);
return PyDbEntity(pEnt, true);
}

PyDbObjectId PyBrxBimIfcImportContext::getEntityId(const PyIFCEntity& ifcEntity)
PyDbObjectId PyBrxBimIfcImportContext::getEntityId(const PyIfcEntity& IfcEntity)
{
PyDbObjectId id;
if (bool flag = impObj()->getEntity(id.m_id, *ifcEntity.impObj()); flag == false)
if (bool flag = impObj()->getEntity(id.m_id, *IfcEntity.impObj()); flag == false)
PyThrowBadBim(BimApi::eInvalidInput);
return id;
}
Expand Down Expand Up @@ -384,7 +384,7 @@ void PyBimIfcImportReactorImpl::onStart(BimIfcImportReactorInstance::Context& co
if (impObj()->reg_onStart)
{
PyBrxBimIfcImportContext ctx(std::addressof(context));
PyIFCEntity ent(project);
PyIfcEntity ent(project);
PyBrxBimIfcImportInfo _info(std::addressof(info));
impObj()->onStart(ctx, ent, _info);
}
Expand All @@ -395,8 +395,8 @@ bool PyBimIfcImportReactorImpl::onIfcProduct(BimIfcImportReactorInstance::Contex
if (impObj()->reg_onIfcProduct)
{
PyBrxBimIfcImportContext ctx(std::addressof(context));
PyIFCEntity ent(entity);
PyIFCEntity parent(parentEntity);
PyIfcEntity ent(entity);
PyIfcEntity parent(parentEntity);
return impObj()->onIfcProduct(ctx, ent, isParent, parent);
}
return false;
Expand All @@ -420,8 +420,8 @@ void PyBimIfcImportReactorImpl::onIfcProductImported(
{
if (impObj()->reg_onIfcProductImported)
{
PyIFCEntity _sourceEntity(sourceEntity);
PyIFCEntity _sourceParentEntity(sourceParentEntity);
PyIfcEntity _sourceEntity(sourceEntity);
PyIfcEntity _sourceParentEntity(sourceParentEntity);

boost::python::list pycreatedAcEntites;
for (AcDbEntity* pEnt : createdAcEntites)
Expand Down Expand Up @@ -464,8 +464,8 @@ void makePyBimIfcImportReactorWrapper()
PyDocString DS("IfcImportReactor");
class_<PyBimIfcImportReactor>("IfcImportReactor", boost::python::no_init)
.def(init<const std::string&, const std::string&>(DS.ARGS({ "displayName: str","guid: str" })))
.def("onStart", &PyBimIfcImportReactor::onStart, DS.ARGS({ "context: PyBrxBim.IfcImportContext", "project: PyBrxBim.IFCEntity", "info: PyBrxBim.IfcImportInfo" }))
.def("onIfcProduct", &PyBimIfcImportReactor::onIfcProduct, DS.ARGS({ "context: PyBrxBim.IfcImportContext", "entity: PyBrxBim.IFCEntity", "isParent: bool","parentEntity: PyBrxBim.IFCEntity" }))
.def("onStart", &PyBimIfcImportReactor::onStart, DS.ARGS({ "context: PyBrxBim.IfcImportContext", "project: PyBrxBim.IfcEntity", "info: PyBrxBim.IfcImportInfo" }))
.def("onIfcProduct", &PyBimIfcImportReactor::onIfcProduct, DS.ARGS({ "context: PyBrxBim.IfcImportContext", "entity: PyBrxBim.IfcEntity", "isParent: bool","parentEntity: PyBrxBim.IfcEntity" }))
.def("beforeCompletion", &PyBimIfcImportReactor::beforeCompletion, DS.ARGS({ "context: PyBrxBim.IfcImportContext", "success: bool"}))
.def("onIfcProductImported", &PyBimIfcImportReactor::onIfcProductImported, DS.ARGS({ "desc: PyBrxBim.IfcEntityDesc", "schema: EIfcSchemaId" }))
.def("className", &PyBimIfcImportReactor::className, DS.SARGS()).staticmethod("className")
Expand All @@ -487,7 +487,7 @@ PyBimIfcImportReactor::PyBimIfcImportReactor(PyBimIfcImportReactorImpl* pObject,
{
}

void PyBimIfcImportReactor::onStart(PyBrxBimIfcImportContext& context, const PyIFCEntity& project, const PyBrxBimIfcImportInfo& info)
void PyBimIfcImportReactor::onStart(PyBrxBimIfcImportContext& context, const PyIfcEntity& project, const PyBrxBimIfcImportInfo& info)
{
PyAutoLockGIL lock;
try
Expand All @@ -504,7 +504,7 @@ void PyBimIfcImportReactor::onStart(PyBrxBimIfcImportContext& context, const PyI
}
}

bool PyBimIfcImportReactor::onIfcProduct(PyBrxBimIfcImportContext& context, const PyIFCEntity& entity, bool isParent, const PyIFCEntity& parentEntity)
bool PyBimIfcImportReactor::onIfcProduct(PyBrxBimIfcImportContext& context, const PyIfcEntity& entity, bool isParent, const PyIfcEntity& parentEntity)
{
PyAutoLockGIL lock;
try
Expand Down Expand Up @@ -539,7 +539,7 @@ void PyBimIfcImportReactor::beforeCompletion(PyBrxBimIfcImportContext& context,
}
}

void PyBimIfcImportReactor::onIfcProductImported(const PyIFCEntity& sourceEntity, bool isParent, const PyIFCEntity& sourceParentEntity, boost::python::list& createdAcEntites, const AcGeMatrix3d& xfrom)
void PyBimIfcImportReactor::onIfcProductImported(const PyIfcEntity& sourceEntity, bool isParent, const PyIfcEntity& sourceParentEntity, boost::python::list& createdAcEntites, const AcGeMatrix3d& xfrom)
{
PyAutoLockGIL lock;
try
Expand Down
26 changes: 13 additions & 13 deletions PyRxCore/PyBrxBimImportExport.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once
#ifdef BRXAPP

class PyIFCModel;
class PyIFCEntity;
class PyIfcModel;
class PyIfcEntity;
class PyDbEntity;
class PyDbDatabase;
class PyDbObjectId;
Expand Down Expand Up @@ -86,15 +86,15 @@ class PyBrxBimIfcImportContext
PyBrxBimIfcImportContext(IfcImportContext* pObject, bool autoDelete);
virtual ~PyBrxBimIfcImportContext() = default;

PyIFCModel ifcModel();
PyIfcModel ifcModel();
PyDbDatabase database();
PyDbEntity createDefaultRepresentation(const PyIFCEntity& entity, bool isParent, const PyIFCEntity& parent);
PyDbEntity createRepresentationFromItem(const PyIFCEntity& entity);
AcGePoint3d createPoint(const PyIFCEntity& point);
AcGeMatrix3d getLocalPlacement(const PyIFCEntity& point);
boost::python::list createSweptArea(const PyIFCEntity& sweptArea);
PyDbEntity getEntity(const PyIFCEntity& ifcEntity);
PyDbObjectId getEntityId(const PyIFCEntity& ifcEntity);
PyDbEntity createDefaultRepresentation(const PyIfcEntity& entity, bool isParent, const PyIfcEntity& parent);
PyDbEntity createRepresentationFromItem(const PyIfcEntity& entity);
AcGePoint3d createPoint(const PyIfcEntity& point);
AcGeMatrix3d getLocalPlacement(const PyIfcEntity& point);
boost::python::list createSweptArea(const PyIfcEntity& sweptArea);
PyDbEntity getEntity(const PyIfcEntity& IfcEntity);
PyDbObjectId getEntityId(const PyIfcEntity& IfcEntity);
double angleConversionFactor();
double areaConversionFactor();
double lengthConversionFactor();
Expand Down Expand Up @@ -170,10 +170,10 @@ class PyBimIfcImportReactor : public boost::python::wrapper<PyBimIfcImportReacto
PyBimIfcImportReactor(PyBimIfcImportReactorImpl* pObject, bool autoDelete);
virtual ~PyBimIfcImportReactor() = default;

virtual void onStart(PyBrxBimIfcImportContext& context, const PyIFCEntity& project,const PyBrxBimIfcImportInfo& info);
virtual bool onIfcProduct(PyBrxBimIfcImportContext& context,const PyIFCEntity& entity,bool isParent,const PyIFCEntity& parentEntity);
virtual void onStart(PyBrxBimIfcImportContext& context, const PyIfcEntity& project,const PyBrxBimIfcImportInfo& info);
virtual bool onIfcProduct(PyBrxBimIfcImportContext& context,const PyIfcEntity& entity,bool isParent,const PyIfcEntity& parentEntity);
virtual void beforeCompletion(PyBrxBimIfcImportContext& context,bool success);
virtual void onIfcProductImported(const PyIFCEntity& sourceEntity,bool isParent,const PyIFCEntity& sourceParentEntity, boost::python::list& createdAcEntites,const AcGeMatrix3d& xfrom);
virtual void onIfcProductImported(const PyIfcEntity& sourceEntity,bool isParent,const PyIfcEntity& sourceParentEntity, boost::python::list& createdAcEntites,const AcGeMatrix3d& xfrom);

static std::string className();
public:
Expand Down
Loading

0 comments on commit 5a37984

Please sign in to comment.