Skip to content

Commit

Permalink
progress on brep
Browse files Browse the repository at this point in the history
  • Loading branch information
CEXT-Dan committed Nov 12, 2024
1 parent 38c7744 commit 63fd8c7
Show file tree
Hide file tree
Showing 5 changed files with 208 additions and 2 deletions.
18 changes: 18 additions & 0 deletions PyRxCore/PyAcBr.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "PyAcBr.h"
#include "PyBrEntity.h"
#include "PyBrTraverser.h"

using namespace boost::python;

Expand Down Expand Up @@ -86,6 +87,23 @@ BOOST_PYTHON_MODULE(PyBr)
makePyBrMesh2dWrapper();
makePyBrNodeWrapper();

makePyBrTraverserWrapper();
makePyBrepComplexTraverserWrapper();
makePyBrepEdgeTraverserWrapper();
makePyBrepFaceTraverserWrapper();
makePyBrepShellTraverserWrapper();
makePyBrepVertexTraverserWrapper();
makePyBrComplexShellTraverserWrapper();
makePyBrEdgeLoopTraverserWrapper();
makePyBrElement2dNodeTraverserWrapper();
makePyBrFaceLoopTraverserWrapper();
makePyBrLoopEdgeTraverserWrapper();
makePyBrLoopVertexTraverserWrapper();
makePyBrMesh2dElement2dTraverserWrapper();
makePyBrShellFaceTraverserWrapper();
makePyBrVertexEdgeTraverserWrapper();
makePyBrVertexLoopTraverserWrapper();

enum_<AcBr::Element2dShape>("Element2dShape")
.value("kDefault", AcBr::Element2dShape::kDefault)
.value("kAllPolygons", AcBr::Element2dShape::kAllPolygons)
Expand Down
2 changes: 1 addition & 1 deletion PyRxCore/PyBrEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void makePyBrHitWrapper()
.def("getEntityEntered", &PyBrHit::getEntityEntered, DS.ARGS())
.def("getEntityAssociated", &PyBrHit::getEntityAssociated, DS.ARGS())
.def("getPoint", &PyBrHit::getPoint, DS.ARGS())
.def("getPoint", &PyBrHit::getValidationLevel, DS.ARGS())
.def("getValidationLevel", &PyBrHit::getValidationLevel, DS.ARGS())
.def("setValidationLevel", &PyBrHit::setValidationLevel, DS.ARGS({ "val: PyBr.ValidationLevel" }))
.def("brepChanged", &PyBrHit::brepChanged, DS.ARGS())
.def("className", &PyBrHit::className, DS.SARGS()).staticmethod("className")
Expand Down
54 changes: 54 additions & 0 deletions PyRxCore/PyBrTraverser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ void makePyBrTraverserWrapper()
{
PyDocString DS("Traverser");
class_<PyBrTraverser, bases<PyRxObject>>("Traverser", no_init)
.def("isEqualTo", &PyBrTraverser::isEqualTo, DS.ARGS({ "otherObject: PyRx.RxObject" }))
.def("isNull", &PyBrTraverser::isNull, DS.ARGS())
.def("done", &PyBrTraverser::done, DS.ARGS())
.def("next", &PyBrTraverser::next, DS.ARGS())
.def("restart", &PyBrTraverser::restart, DS.ARGS())
.def("getValidationLevel", &PyBrTraverser::getValidationLevel, DS.ARGS())
.def("setValidationLevel", &PyBrTraverser::setValidationLevel, DS.ARGS({ "val: PyBr.ValidationLevel" }))
.def("brepChanged", &PyBrTraverser::brepChanged, DS.ARGS())
.def("className", &PyBrTraverser::className, DS.SARGS()).staticmethod("className")
.def("desc", &PyBrTraverser::desc, DS.SARGS(15560)).staticmethod("desc")
;
Expand All @@ -25,6 +33,52 @@ PyBrTraverser::PyBrTraverser(AcRxObject* ptr, bool autoDelete)
{
}

Adesk::Boolean PyBrTraverser::isEqualTo(const PyRxObject& other) const
{
return impObj()->isEqualTo(other.impObj());
}

Adesk::Boolean PyBrTraverser::isNull() const
{
return impObj()->isNull();
}

bool PyBrTraverser::done()
{
return impObj()->done();
}

void PyBrTraverser::next()
{
PyThrowBadBr(impObj()->next());
}

void PyBrTraverser::restart()
{
PyThrowBadBr(impObj()->restart());
}

void PyBrTraverser::setValidationLevel(const AcBr::ValidationLevel& validationLevel)
{
PyThrowBadBr(impObj()->setValidationLevel(validationLevel));
}

AcBr::ValidationLevel PyBrTraverser::getValidationLevel() const
{
AcBr::ValidationLevel val;
PyThrowBadBr(impObj()->getValidationLevel(val));
return val;
}

Adesk::Boolean PyBrTraverser::brepChanged() const
{
#if defined(_BRXTARGET250)
throw PyNotimplementedByHost();
#else
return impObj()->brepChanged();
#endif
}

PyRxClass PyBrTraverser::desc()
{
return PyRxClass(AcBrTraverser::desc(), false);
Expand Down
12 changes: 12 additions & 0 deletions PyRxCore/PyBrTraverser.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ class PyBrTraverser : public PyRxObject
PyBrTraverser(const AcRxObject* ptr);
PyBrTraverser(AcRxObject* ptr, bool autoDelete);
inline virtual ~PyBrTraverser() = default;

Adesk::Boolean isEqualTo(const PyRxObject& other) const;
Adesk::Boolean isNull() const;

bool done();
void next();
void restart();

void setValidationLevel(const AcBr::ValidationLevel& validationLevel);
AcBr::ValidationLevel getValidationLevel() const;
Adesk::Boolean brepChanged() const;

static PyRxClass desc();
static std::string className();
public:
Expand Down
124 changes: 123 additions & 1 deletion PyRxStubs/PyBr.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,41 @@ __init__( (object)arg1) -> None :
''' '''
...

class Element(MeshEntity):
def __init__ (self, *args, **kwargs)-> None :
'''Raises an exception
This class cannot be instantiated from Python'''
...

@staticmethod
def className ()-> str :
''' '''
...

@staticmethod
def desc ()-> PyRx.RxClass :
'''Returns a pointer to the AcRxClass object representing the specific class, or most recent parent class explicitly registered with ObjectARX of either the pointer type used to invoke it or the class qualifier used with it. (Remember that when a static member function is invoked via a pointer, the pointer type, not the object type, determines which implementation of the function is invoked.)When working with a pointer to an object and the proper AcRxClass object for the class of the object pointed to is desired, the AcRxObject::isA() function should be used, since it is a virtual non-static method and is therefore not pointer type dependent.Caching the value of the pointer returned by this method is acceptable, provided the application knows that the AcRxClass object pointed to by the returned pointer was created by an ObjectARX application that will not be unloaded. '''
...

class Element2d(Element):
def __init__ (self, *args, **kwargs)-> None :
'''Raises an exception
This class cannot be instantiated from Python'''
...

@staticmethod
def className ()-> str :
''' '''
...

@staticmethod
def desc ()-> PyRx.RxClass :
'''Returns a pointer to the AcRxClass object representing the specific class, or most recent parent class explicitly registered with ObjectARX of either the pointer type used to invoke it or the class qualifier used with it. (Remember that when a static member function is invoked via a pointer, the pointer type, not the object type, determines which implementation of the function is invoked.)When working with a pointer to an object and the proper AcRxClass object for the class of the object pointed to is desired, the AcRxObject::isA() function should be used, since it is a virtual non-static method and is therefore not pointer type dependent.Caching the value of the pointer returned by this method is acceptable, provided the application knows that the AcRxClass object pointed to by the returned pointer was created by an ObjectARX application that will not be unloaded. '''
...
def getNormal (self)-> PyGe.Vector3d :
''' '''
...

class Element2dShape(object):
def kAllPolygons (self, *args, **kwargs)-> None :
'''None'''
Expand Down Expand Up @@ -290,13 +325,16 @@ class Hit(PyRx.RxObject):
def getPoint (self)-> PyGe.Point3d :
''' '''
...
def getValidationLevel (self)-> PyBr.ValidationLevel :
''' '''
...
def isEqualTo (self, otherObject: PyRx.RxObject)-> bool :
''' '''
...
def isNull (self)-> bool :
''' '''
...
def setValidationLevel (self, val: PyBr.ValidationLevel)-> PyGe.Point3d :
def setValidationLevel (self, val: PyBr.ValidationLevel)-> None :
''' '''
...

Expand Down Expand Up @@ -373,6 +411,90 @@ class MassProps(object):
''' '''
...

class Mesh(MeshEntity):
def __init__ (self, *args, **kwargs)-> None :
'''Raises an exception
This class cannot be instantiated from Python'''
...

@staticmethod
def className ()-> str :
''' '''
...

@staticmethod
def desc ()-> PyRx.RxClass :
'''Returns a pointer to the AcRxClass object representing the specific class, or most recent parent class explicitly registered with ObjectARX of either the pointer type used to invoke it or the class qualifier used with it. (Remember that when a static member function is invoked via a pointer, the pointer type, not the object type, determines which implementation of the function is invoked.)When working with a pointer to an object and the proper AcRxClass object for the class of the object pointed to is desired, the AcRxObject::isA() function should be used, since it is a virtual non-static method and is therefore not pointer type dependent.Caching the value of the pointer returned by this method is acceptable, provided the application knows that the AcRxClass object pointed to by the returned pointer was created by an ObjectARX application that will not be unloaded. '''
...

class Mesh2d(Mesh):
def __init__ (self, *args, **kwargs)-> None :
'''Raises an exception
This class cannot be instantiated from Python'''
...

@staticmethod
def className ()-> str :
''' '''
...

@staticmethod
def desc ()-> PyRx.RxClass :
'''Returns a pointer to the AcRxClass object representing the specific class, or most recent parent class explicitly registered with ObjectARX of either the pointer type used to invoke it or the class qualifier used with it. (Remember that when a static member function is invoked via a pointer, the pointer type, not the object type, determines which implementation of the function is invoked.)When working with a pointer to an object and the proper AcRxClass object for the class of the object pointed to is desired, the AcRxObject::isA() function should be used, since it is a virtual non-static method and is therefore not pointer type dependent.Caching the value of the pointer returned by this method is acceptable, provided the application knows that the AcRxClass object pointed to by the returned pointer was created by an ObjectARX application that will not be unloaded. '''
...

class MeshEntity(PyRx.RxObject):
def __init__ (self, *args, **kwargs)-> None :
'''Raises an exception
This class cannot be instantiated from Python'''
...
def brepChanged (self)-> bool :
''' '''
...

@staticmethod
def className ()-> str :
''' '''
...

@staticmethod
def desc ()-> PyRx.RxClass :
'''Returns a pointer to the AcRxClass object representing the specific class, or most recent parent class explicitly registered with ObjectARX of either the pointer type used to invoke it or the class qualifier used with it. (Remember that when a static member function is invoked via a pointer, the pointer type, not the object type, determines which implementation of the function is invoked.)When working with a pointer to an object and the proper AcRxClass object for the class of the object pointed to is desired, the AcRxObject::isA() function should be used, since it is a virtual non-static method and is therefore not pointer type dependent.Caching the value of the pointer returned by this method is acceptable, provided the application knows that the AcRxClass object pointed to by the returned pointer was created by an ObjectARX application that will not be unloaded. '''
...
def getEntityAssociated (self)-> PyBr.Entity :
''' '''
...
def getPoint (self)-> PyBr.ValidationLevel :
''' '''
...
def isEqualTo (self, otherObject: PyRx.RxObject)-> bool :
''' '''
...
def isNull (self)-> bool :
''' '''
...
def setValidationLevel (self, val: PyBr.ValidationLevel)-> None :
''' '''
...

class Node(MeshEntity):
def __init__ (self)-> None :
''' '''
...

@staticmethod
def className ()-> str :
''' '''
...

@staticmethod
def desc ()-> PyRx.RxClass :
'''Returns a pointer to the AcRxClass object representing the specific class, or most recent parent class explicitly registered with ObjectARX of either the pointer type used to invoke it or the class qualifier used with it. (Remember that when a static member function is invoked via a pointer, the pointer type, not the object type, determines which implementation of the function is invoked.)When working with a pointer to an object and the proper AcRxClass object for the class of the object pointed to is desired, the AcRxObject::isA() function should be used, since it is a virtual non-static method and is therefore not pointer type dependent.Caching the value of the pointer returned by this method is acceptable, provided the application knows that the AcRxClass object pointed to by the returned pointer was created by an ObjectARX application that will not be unloaded. '''
...
def getPoint (self)-> PyGe.Point3d :
''' '''
...

class Relation(object):
def kBoundary (self, *args, **kwargs)-> None :
'''None'''
Expand Down

0 comments on commit 63fd8c7

Please sign in to comment.