Sketcher::SketchGeometryExtension Class Reference

#include <SketchGeometryExtension.h>

Public Member Functions

virtual std::unique_ptr< Part::GeometryExtensioncopy (void) const override
virtual int getGeometryLayerId () const override
virtual long getId () const override
virtual InternalType::InternalType getInternalType () const override
virtual PyObjectgetPyObject (void) override
 This method returns the Python wrapper for a C++ object. More...
virtual void setGeometryLayerId (int geolayer) override
virtual void setGeometryMode (int flag, bool v=true) override
virtual void setId (long id) override
virtual void setInternalType (InternalType::InternalType type) override
 SketchGeometryExtension ()
 SketchGeometryExtension (long cid)
virtual bool testGeometryMode (int flag) const override
virtual ~SketchGeometryExtension () override=default
- Public Member Functions inherited from Part::GeometryPersistenceExtension
void Restore (Base::XMLReader &)
void Save (Base::Writer &) const
virtual ~GeometryPersistenceExtension ()=default
- Public Member Functions inherited from Part::GeometryExtension
virtual std::unique_ptr< GeometryExtensioncopy (void) const =0
PyObjectcopyPyObject () const
const std::string & getName () const
virtual PyObjectgetPyObject (void)=0
 This method returns the Python wrapper for a C++ object. More...
virtual void notifyAttachment (Part::Geometry *)
void setName (const std::string &str)
virtual ~GeometryExtension ()=default
- Public Member Functions inherited from Base::BaseClass
 BaseClass ()
 Construction. More...
 BaseClass (const BaseClass &)=default
virtual PyObjectgetPyObject ()
 This method returns the Python wrapper for a C++ object. More...
virtual Type getTypeId () const
bool isDerivedFrom (const Type type) const
BaseClassoperator= (const BaseClass &)=default
virtual void setPyObject (PyObject *)
virtual ~BaseClass ()
 Destruction. More...

Static Public Member Functions

static bool getGeometryModeFromName (std::string str, GeometryMode::GeometryMode &type)
static bool getInternalTypeFromName (std::string str, InternalType::InternalType &type)
- Static Public Member Functions inherited from Base::BaseClass
static void * create ()
static Type getClassTypeId ()
static void init ()

Static Public Attributes

static constexpr std::array< const char *, GeometryMode::NumGeometryModegeometrymode2str {{ "Blocked", "Construction" }}
static constexpr std::array< const char *, InternalType::NumInternalGeometryTypeinternaltype2str {{ "None", "EllipseMajorDiameter", "EllipseMinorDiameter","EllipseFocus1", "EllipseFocus2", "HyperbolaMajor", "HyperbolaMinor", "HyperbolaFocus", "ParabolaFocus", "BSplineControlPoint", "BSplineKnotPoint" }}

Protected Member Functions

virtual void copyAttributes (Part::GeometryExtension *cpy) const override
virtual void restoreAttributes (Base::XMLReader &reader) override
virtual void saveAttributes (Base::Writer &writer) const override
virtual void restoreAttributes (Base::XMLReader &)
virtual void saveAttributes (Base::Writer &writer) const
- Protected Member Functions inherited from Part::GeometryExtension
virtual void copyAttributes (Part::GeometryExtension *cpy) const
 GeometryExtension ()
 GeometryExtension (const GeometryExtension &obj)=default
GeometryExtensionoperator= (const GeometryExtension &obj)=default

Additional Inherited Members

- Static Protected Member Functions inherited from Base::BaseClass
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr)

Constructor & Destructor Documentation

◆ SketchGeometryExtension() [1/2]

SketchGeometryExtension::SketchGeometryExtension ( )

Referenced by getPyObject().

◆ SketchGeometryExtension() [2/2]

SketchGeometryExtension::SketchGeometryExtension ( long  cid)

◆ ~SketchGeometryExtension()

virtual Sketcher::SketchGeometryExtension::~SketchGeometryExtension ( )

Member Function Documentation

◆ copy()

std::unique_ptr< Part::GeometryExtension > SketchGeometryExtension::copy ( void  ) const

◆ copyAttributes()

void SketchGeometryExtension::copyAttributes ( Part::GeometryExtension cpy) const

Reimplemented from Part::GeometryExtension.

References Part::GeometryExtension::copyAttributes().

Referenced by copy().

◆ getGeometryLayerId()

virtual int Sketcher::SketchGeometryExtension::getGeometryLayerId ( ) const

◆ getGeometryModeFromName()

bool SketchGeometryExtension::getGeometryModeFromName ( std::string  str,
GeometryMode::GeometryMode type 

References geometrymode2str.

◆ getId()

virtual long Sketcher::SketchGeometryExtension::getId ( ) const

◆ getInternalType()

virtual InternalType::InternalType Sketcher::SketchGeometryExtension::getInternalType ( ) const

◆ getInternalTypeFromName()

bool SketchGeometryExtension::getInternalTypeFromName ( std::string  str,
InternalType::InternalType type 

References internaltype2str.

◆ getPyObject()

PyObject * SketchGeometryExtension::getPyObject ( void  )

This method returns the Python wrapper for a C++ object.

It's in the responsibility of the programmer to do the correct reference counting. Basically there are two ways how to implement that: Either always return a new Python object then reference counting is not a matter or return always the same Python object then the reference counter must be incremented by one. However, it's absolutely forbidden to return always the same Python object without incrementing the reference counter.

The default implementation returns 'None'.

Implements Part::GeometryExtension.

References SketchGeometryExtension().

◆ restoreAttributes()

◆ saveAttributes()

void SketchGeometryExtension::saveAttributes ( Base::Writer writer) const

◆ setGeometryLayerId()

virtual void Sketcher::SketchGeometryExtension::setGeometryLayerId ( int  geolayer)

◆ setGeometryMode()

virtual void Sketcher::SketchGeometryExtension::setGeometryMode ( int  flag,
bool  v = true 

◆ setId()

virtual void Sketcher::SketchGeometryExtension::setId ( long  id)

◆ setInternalType()

virtual void Sketcher::SketchGeometryExtension::setInternalType ( InternalType::InternalType  type)

◆ testGeometryMode()

virtual bool Sketcher::SketchGeometryExtension::testGeometryMode ( int  flag) const

Member Data Documentation

◆ geometrymode2str

constexpr std::array< const char *, GeometryMode::NumGeometryMode > SketchGeometryExtension::geometrymode2str {{ "Blocked", "Construction" }}

Referenced by getGeometryModeFromName().

◆ internaltype2str

constexpr std::array< const char *, InternalType::NumInternalGeometryType > SketchGeometryExtension::internaltype2str {{ "None", "EllipseMajorDiameter", "EllipseMinorDiameter","EllipseFocus1", "EllipseFocus2", "HyperbolaMajor", "HyperbolaMinor", "HyperbolaFocus", "ParabolaFocus", "BSplineControlPoint", "BSplineKnotPoint" }}

Referenced by getInternalTypeFromName().

The documentation for this class was generated from the following files: