The python export class for Sketch. More...

#include <SketchPy.h>

Public Types

typedef SketchPointerType
 
- Public Types inherited from Base::PersistencePy
typedef PersistencePointerType
 
- Public Types inherited from Base::BaseClassPy
typedef BaseClassPointerType
 
- Public Types inherited from Base::PyObjectBase
typedef void * PointerType
 
enum  Status { Valid = 0, Immutable = 1, Notify = 2, NoTrack = 3 }
 

Public Member Functions

virtual PyTypeObject * GetType (void)
 
virtual int PyInit (PyObject *args, PyObject *k)
 PyInit method Override this method to initialize a newly created instance of the class (Constructor) More...
 
std::string representation (void) const
 
 SketchPy (Sketch *pcObject, PyTypeObject *T=&Type)
 
- Public Member Functions inherited from Base::PersistencePy
 PersistencePy (Persistence *pcObject, PyTypeObject *T=&Type)
 
std::string representation (void) const
 
PyObjectdumpContent (PyObject *args, PyObject *kwd)
 implementer for the dumpContent() method More...
 
PyObjectrestoreContent (PyObject *args)
 implementer for the restoreContent() method More...
 
Py::String getContent (void) const
 getter for the Content attribute More...
 
Py::Int getMemSize (void) const
 getter for the MemSize attribute More...
 
PyObjectgetCustomAttributes (const char *attr) const
 getter method for special attributes (e.g. dynamic ones) More...
 
int setCustomAttributes (const char *attr, PyObject *obj)
 setter for special attributes (e.g. More...
 
PersistencegetPersistencePtr (void) const
 getter for the object handled by this class More...
 
- Public Member Functions inherited from Base::BaseClassPy
 BaseClassPy (BaseClass *pcObject, PyTypeObject *T=&Type)
 
std::string representation (void) const
 
PyObjectisDerivedFrom (PyObject *args)
 implementer for the isDerivedFrom() method More...
 
PyObjectgetAllDerivedFrom (PyObject *args)
 implementer for the getAllDerivedFrom() method More...
 
Py::String getTypeId (void) const
 getter for the TypeId attribute More...
 
Py::String getModule (void) const
 getter for the Module attribute More...
 
PyObjectgetCustomAttributes (const char *attr) const
 getter method for special attributes (e.g. dynamic ones) More...
 
int setCustomAttributes (const char *attr, PyObject *obj)
 setter for special attributes (e.g. More...
 
BaseClassgetBaseClassPtr (void) const
 getter for the object handled by this class More...
 
- Public Member Functions inherited from Base::PyObjectBase
PyObjectBaseDecRef (void)
 decref method wrapper (see python extending manual)
More...
 
PyObjectBaseIncRef (void)
 incref method wrapper (see python extending manual) More...
 
bool isConst ()
 
bool isNotTracking () const
 
bool isValid ()
 
 PyObjectBase (void *, PyTypeObject *T)
 Constructor Sets the Type of the object (for inheritance) and decrease the the reference count of the PyObject. More...
 
void setConst ()
 
void setInvalid ()
 
void setNotTracking (bool on=true)
 
void setShouldNotify (bool on)
 
bool shouldNotify () const
 
void startNotify ()
 

Static Public Member Functions

static PyObjectPyMake (struct _typeobject *, PyObject *, PyObject *)
 
- Static Public Member Functions inherited from Base::PersistencePy
static PyObjectPyMake (struct _typeobject *, PyObject *, PyObject *)
 
static PyObjectstaticCallback_dumpContent (PyObject *self, PyObject *args, PyObject *kwd)
 callback for the dumpContent() method More...
 
static PyObjectstaticCallback_restoreContent (PyObject *self, PyObject *args)
 callback for the restoreContent() method More...
 
static PyObjectstaticCallback_getContent (PyObject *self, void *closure)
 getter callback for the Content attribute More...
 
static int staticCallback_setContent (PyObject *self, PyObject *value, void *closure)
 setter callback for the Content attribute More...
 
static PyObjectstaticCallback_getMemSize (PyObject *self, void *closure)
 getter callback for the MemSize attribute More...
 
static int staticCallback_setMemSize (PyObject *self, PyObject *value, void *closure)
 setter callback for the MemSize attribute More...
 
- Static Public Member Functions inherited from Base::BaseClassPy
static PyObjectPyMake (struct _typeobject *, PyObject *, PyObject *)
 
static PyObjectstaticCallback_isDerivedFrom (PyObject *self, PyObject *args)
 callback for the isDerivedFrom() method More...
 
static PyObjectstaticCallback_getAllDerivedFrom (PyObject *self, PyObject *args)
 callback for the getAllDerivedFrom() method More...
 
static PyObjectstaticCallback_getTypeId (PyObject *self, void *closure)
 getter callback for the TypeId attribute More...
 
static int staticCallback_setTypeId (PyObject *self, PyObject *value, void *closure)
 setter callback for the TypeId attribute More...
 
static PyObjectstaticCallback_getModule (PyObject *self, void *closure)
 getter callback for the Module attribute More...
 
static int staticCallback_setModule (PyObject *self, PyObject *value, void *closure)
 setter callback for the Module attribute More...
 
- Static Public Member Functions inherited from Base::PyObjectBase
static void PyDestructor (PyObject *P)
 Wrapper for the Python destructor. More...
 

Static Public Attributes

static PyGetSetDef GetterSetter []
 Attribute structure of SketchPy. More...
 
static PyMethodDef Methods []
 Methods structure of SketchPy. More...
 
static PyTypeObject Type
 Type structure of SketchPy. More...
 
- Static Public Attributes inherited from Base::PersistencePy
static PyGetSetDef GetterSetter []
 Attribute structure of PersistencePy. More...
 
static PyMethodDef Methods []
 Methods structure of PersistencePy. More...
 
static PyTypeObject Type
 Type structure of PersistencePy. More...
 
- Static Public Attributes inherited from Base::BaseClassPy
static PyGetSetDef GetterSetter []
 Attribute structure of BaseClassPy. More...
 
static PyMethodDef Methods []
 Methods structure of BaseClassPy. More...
 
static PyTypeObject Type
 Type structure of BaseClassPy. More...
 
- Static Public Attributes inherited from Base::PyObjectBase
static PyMethodDef Methods []
 
static PyTypeObject Type
 Py_Header struct from python.h. More...
 

Protected Member Functions

 ~SketchPy ()
 
- Protected Member Functions inherited from Base::PersistencePy
 ~PersistencePy ()
 
- Protected Member Functions inherited from Base::BaseClassPy
 ~BaseClassPy ()
 
- Protected Member Functions inherited from Base::PyObjectBase
virtual ~PyObjectBase ()
 destructor More...
 

callbacks and implementers for the python object methods

PyObjectsolve (PyObject *args)
 implementer for the solve() method More...
 
PyObjectaddGeometry (PyObject *args)
 implementer for the addGeometry() method More...
 
PyObjectaddConstraint (PyObject *args)
 implementer for the addConstraint() method More...
 
PyObjectclear (PyObject *args)
 implementer for the clear() method More...
 
PyObjectmovePoint (PyObject *args)
 implementer for the movePoint() method More...
 
static PyObjectstaticCallback_solve (PyObject *self, PyObject *args)
 callback for the solve() method More...
 
static PyObjectstaticCallback_addGeometry (PyObject *self, PyObject *args)
 callback for the addGeometry() method More...
 
static PyObjectstaticCallback_addConstraint (PyObject *self, PyObject *args)
 callback for the addConstraint() method More...
 
static PyObjectstaticCallback_clear (PyObject *self, PyObject *args)
 callback for the clear() method More...
 
static PyObjectstaticCallback_movePoint (PyObject *self, PyObject *args)
 callback for the movePoint() method More...
 

callbacks and implementers for the python object attributes

Py::Long getConstraint (void) const
 getter for the Constraint attribute More...
 
Py::Tuple getConflicts (void) const
 getter for the Conflicts attribute More...
 
Py::Tuple getRedundancies (void) const
 getter for the Redundancies attribute More...
 
Py::Tuple getGeometries (void) const
 getter for the Geometries attribute More...
 
Py::Object getShape (void) const
 getter for the Shape attribute More...
 
PyObjectgetCustomAttributes (const char *attr) const
 getter method for special attributes (e.g. dynamic ones) More...
 
int setCustomAttributes (const char *attr, PyObject *obj)
 setter for special attributes (e.g. More...
 
SketchgetSketchPtr (void) const
 getter for the object handled by this class More...
 
static PyObjectstaticCallback_getConstraint (PyObject *self, void *closure)
 getter callback for the Constraint attribute More...
 
static int staticCallback_setConstraint (PyObject *self, PyObject *value, void *closure)
 setter callback for the Constraint attribute More...
 
static PyObjectstaticCallback_getConflicts (PyObject *self, void *closure)
 getter callback for the Conflicts attribute More...
 
static int staticCallback_setConflicts (PyObject *self, PyObject *value, void *closure)
 setter callback for the Conflicts attribute More...
 
static PyObjectstaticCallback_getRedundancies (PyObject *self, void *closure)
 getter callback for the Redundancies attribute More...
 
static int staticCallback_setRedundancies (PyObject *self, PyObject *value, void *closure)
 setter callback for the Redundancies attribute More...
 
static PyObjectstaticCallback_getGeometries (PyObject *self, void *closure)
 getter callback for the Geometries attribute More...
 
static int staticCallback_setGeometries (PyObject *self, PyObject *value, void *closure)
 setter callback for the Geometries attribute More...
 
static PyObjectstaticCallback_getShape (PyObject *self, void *closure)
 getter callback for the Shape attribute More...
 
static int staticCallback_setShape (PyObject *self, PyObject *value, void *closure)
 setter callback for the Shape attribute More...
 

Additional Inherited Members

- Protected Attributes inherited from Base::PyObjectBase
std::bitset< 32 > StatusBits
 

Detailed Description

The python export class for Sketch.

Member Typedef Documentation

◆ PointerType

Constructor & Destructor Documentation

◆ ~SketchPy()

SketchPy::~SketchPy ( )
protected

◆ SketchPy()

SketchPy::SketchPy ( Sketch pcObject,
PyTypeObject *  T = &Type 
)

Member Function Documentation

◆ addConstraint()

PyObject * SketchPy::addConstraint ( PyObject args)

◆ addGeometry()

PyObject * SketchPy::addGeometry ( PyObject args)

implementer for the addGeometry() method

References Part::GeometryPy::Type.

Referenced by staticCallback_addGeometry().

◆ clear()

PyObject * SketchPy::clear ( PyObject args)

implementer for the clear() method

Referenced by staticCallback_clear().

◆ getConflicts()

Py::Tuple SketchPy::getConflicts ( void  ) const

getter for the Conflicts attribute

Referenced by staticCallback_getConflicts().

◆ getConstraint()

Py::Long SketchPy::getConstraint ( void  ) const

getter for the Constraint attribute

Referenced by staticCallback_getConstraint().

◆ getCustomAttributes()

PyObject * SketchPy::getCustomAttributes ( const char *  attr) const

getter method for special attributes (e.g. dynamic ones)

◆ getGeometries()

Py::Tuple SketchPy::getGeometries ( void  ) const

getter for the Geometries attribute

Referenced by staticCallback_getGeometries().

◆ getRedundancies()

Py::Tuple SketchPy::getRedundancies ( void  ) const

getter for the Redundancies attribute

Referenced by staticCallback_getRedundancies().

◆ getShape()

Py::Object SketchPy::getShape ( void  ) const

getter for the Shape attribute

Referenced by staticCallback_getShape().

◆ getSketchPtr()

Sketch * SketchPy::getSketchPtr ( void  ) const

getter for the object handled by this class

◆ GetType()

virtual PyTypeObject* Sketcher::SketchPy::GetType ( void  )
virtual

Reimplemented from Base::PersistencePy.

◆ movePoint()

PyObject * SketchPy::movePoint ( PyObject args)

implementer for the movePoint() method

References Base::VectorPy::Type.

Referenced by staticCallback_movePoint().

◆ PyInit()

int SketchPy::PyInit ( PyObject ,
PyObject  
)
virtual

PyInit method Override this method to initialize a newly created instance of the class (Constructor)

Reimplemented from Base::PersistencePy.

◆ PyMake()

PyObject * SketchPy::PyMake ( struct _typeobject *  ,
PyObject ,
PyObject  
)
static

◆ representation()

◆ setCustomAttributes()

int SketchPy::setCustomAttributes ( const char *  attr,
PyObject obj 
)

setter for special attributes (e.g.

dynamic ones) Output: Success=1, Failure=-1, Ignore=0

◆ solve()

PyObject * SketchPy::solve ( PyObject args)

implementer for the solve() method

Referenced by staticCallback_solve().

◆ staticCallback_addConstraint()

◆ staticCallback_addGeometry()

◆ staticCallback_clear()

◆ staticCallback_getConflicts()

PyObject * SketchPy::staticCallback_getConflicts ( PyObject self,
void *  closure 
)
static

◆ staticCallback_getConstraint()

PyObject * SketchPy::staticCallback_getConstraint ( PyObject self,
void *  closure 
)
static

◆ staticCallback_getGeometries()

PyObject * SketchPy::staticCallback_getGeometries ( PyObject self,
void *  closure 
)
static

◆ staticCallback_getRedundancies()

PyObject * SketchPy::staticCallback_getRedundancies ( PyObject self,
void *  closure 
)
static

◆ staticCallback_getShape()

PyObject * SketchPy::staticCallback_getShape ( PyObject self,
void *  closure 
)
static

◆ staticCallback_movePoint()

◆ staticCallback_setConflicts()

int SketchPy::staticCallback_setConflicts ( PyObject self,
PyObject value,
void *  closure 
)
static

setter callback for the Conflicts attribute

References Base::PyObjectBase::isValid(), and Base::PyObjectBase::PyObjectBase().

◆ staticCallback_setConstraint()

int SketchPy::staticCallback_setConstraint ( PyObject self,
PyObject value,
void *  closure 
)
static

setter callback for the Constraint attribute

References Base::PyObjectBase::isValid(), and Base::PyObjectBase::PyObjectBase().

◆ staticCallback_setGeometries()

int SketchPy::staticCallback_setGeometries ( PyObject self,
PyObject value,
void *  closure 
)
static

setter callback for the Geometries attribute

References Base::PyObjectBase::isValid(), and Base::PyObjectBase::PyObjectBase().

◆ staticCallback_setRedundancies()

int SketchPy::staticCallback_setRedundancies ( PyObject self,
PyObject value,
void *  closure 
)
static

setter callback for the Redundancies attribute

References Base::PyObjectBase::isValid(), and Base::PyObjectBase::PyObjectBase().

◆ staticCallback_setShape()

int SketchPy::staticCallback_setShape ( PyObject self,
PyObject value,
void *  closure 
)
static

setter callback for the Shape attribute

References Base::PyObjectBase::isValid(), and Base::PyObjectBase::PyObjectBase().

◆ staticCallback_solve()

Member Data Documentation

◆ GetterSetter

PyGetSetDef SketchPy::GetterSetter
static

Attribute structure of SketchPy.

◆ Methods

PyMethodDef SketchPy::Methods
static
Initial value:
= {
{"solve",
reinterpret_cast<PyCFunction>( staticCallback_solve ),
METH_VARARGS,
"solve the actual set of geometry and constraints"
},
{"addGeometry",
reinterpret_cast<PyCFunction>( staticCallback_addGeometry ),
METH_VARARGS,
"add a geometric object to the sketch"
},
{"addConstraint",
reinterpret_cast<PyCFunction>( staticCallback_addConstraint ),
METH_VARARGS,
"add an constraint object to the sketch"
},
{"clear",
reinterpret_cast<PyCFunction>( staticCallback_clear ),
METH_VARARGS,
"clear the sketch"
},
{"movePoint",
reinterpret_cast<PyCFunction>( staticCallback_movePoint ),
METH_VARARGS,
"\n movePoint(GeoIndex,PointPos,Vector,[relative]) - move a given point (or curve)\n to another location.\n It moves the specified point (or curve) to the given location by adding some\n temporary weak constraints and solve the sketch.\n This method is mostly used to allow the user to drag some portions of the sketch\n in real time by e.g. the mouse and it works only for underconstrained portions of\n the sketch.\n The argument 'relative', if present, states if the new location is given\n relatively to the current one.\n "
},
{NULL, NULL, 0, NULL}
}

Methods structure of SketchPy.

◆ Type


The documentation for this class was generated from the following files:
  • build/webdoc/src/Mod/Sketcher/App/SketchPy.h
  • src/Mod/Sketcher/App/SketchPyImp.cpp
  • build/webdoc/src/Mod/Sketcher/App/SketchPy.cpp
static PyObject * staticCallback_solve(PyObject *self, PyObject *args)
callback for the solve() method
Definition: SketchPy.cpp:148
static PyObject * staticCallback_addGeometry(PyObject *self, PyObject *args)
callback for the addGeometry() method
Definition: SketchPy.cpp:231
static PyObject * staticCallback_movePoint(PyObject *self, PyObject *args)
callback for the movePoint() method
Definition: SketchPy.cpp:480
static PyObject * staticCallback_clear(PyObject *self, PyObject *args)
callback for the clear() method
Definition: SketchPy.cpp:397
static PyObject * staticCallback_addConstraint(PyObject *self, PyObject *args)
callback for the addConstraint() method
Definition: SketchPy.cpp:314