Sketcher::SketchObject Class Reference

#include <SketchObject.h>

Public Member Functions

 SketchObject ()
 
 ~SketchObject ()
 
- Public Member Functions inherited from Part::Part2DObject
virtual void acceptGeometry ()
 verify and accept the assigned geometry More...
 
virtual Base::Axis getAxis (int axId) const
 retrieves an axis iterating through the construction lines of the sketch (indices start at 0) More...
 
virtual int getAxisCount (void) const
 returns the number of construction lines (to be used as axes) More...
 
 Part2DObject ()
 
virtual void transformPlacement (const Base::Placement &transform) override
 transformPlacement applies transform to placement of this shape. More...
 
- Public Member Functions inherited from Part::Feature
 Feature (void)
 Constructor. More...
 
virtual ~Feature ()
 
virtual const App::PropertyComplexGeoDatagetPropertyOfGeometry () const override
 This method returns the main property of a geometric object that holds the actual geometry. More...
 
TopLoc_Location getLocation () const
 
virtual DocumentObjectgetSubObject (const char *subname, PyObject **pyObj, Base::Matrix4D *mat, bool transform, int depth) const override
 Get the sub element/object by name. More...
 
- Public Member Functions inherited from App::GeoFeature
 GeoFeature (void)
 Constructor. More...
 
virtual std::pair< std::string, std::string > getElementName (const char *name, ElementNameType type=Normal) const
 Return the new and old style sub-element name. More...
 
virtual const PropertyComplexGeoDatagetPropertyOfGeometry () const
 This method returns the main property of a geometric object that holds the actual geometry. More...
 
virtual PyObjectgetPyObject (void)
 getPyObject returns the Python binding object More...
 
Base::Placement globalPlacement () const
 Calculates the placement in the global reference coordinate system. More...
 
virtual void transformPlacement (const Base::Placement &transform)
 transformPlacement applies transform to placement of this shape. More...
 
virtual ~GeoFeature ()
 
- Public Member Functions inherited from App::DocumentObject
virtual App::PropertyaddDynamicProperty (const char *type, const char *name=nullptr, const char *group=nullptr, const char *doc=nullptr, short attr=0, bool ro=false, bool hidden=false) override
 
virtual bool adjustRelativeLinks (const std::set< App::DocumentObject * > &inList, std::set< App::DocumentObject * > *visited=nullptr)
 Called to adjust link properties to avoid cyclic links. More...
 
virtual bool allowDuplicateLabel () const
 
virtual bool canLinkProperties () const
 
virtual int canLoadPartial () const
 allow partial loading of dependent objects More...
 
void clearExpression (const ObjectIdentifier &path)
 
void clearOutListCache () const
 clear internal out list cache More...
 
virtual const char * detachFromDocument () override
 
 DocumentObject (void)
 Constructor. More...
 
void enforceRecompute ()
 Enforce this document object to be recomputed. More...
 
App::DocumentgetDocument (void) const
 gets the document in which this Object is handled More...
 
std::string getExportName (bool forced=false) const
 returns the name that is safe to be exported to other document More...
 
virtual const PropertyExpressionEngine::ExpressionInfo getExpression (const ObjectIdentifier &path) const
 
virtual std::string getFullName () const override
 Return the object full name of the form DocName::ObjName. More...
 
DocumentObjectGroupgetGroup () const
 get group if object is part of a group, otherwise 0 is returned More...
 
long getID () const
 Return the object ID that is unique within its owner document. More...
 
const std::vector< App::DocumentObject * > & getInList (void) const
 
std::set< App::DocumentObject * > getInListEx (bool recursive) const
 Return a set of all objects linking to this object, including possible external parent objects. More...
 
void getInListEx (std::set< App::DocumentObject * > &inSet, bool recursive, std::vector< App::DocumentObject * > *inList=nullptr) const
 Get a set of all objects linking to this object, including possible external parent objects. More...
 
std::vector< App::DocumentObject * > getInListRecursive (void) const
 get all objects link directly or indirectly to this object More...
 
virtual DocumentObjectgetLinkedObject (bool recurse=true, Base::Matrix4D *mat=nullptr, bool transform=false, int depth=0) const
 Return the linked object with optional transformation. More...
 
const char * getNameInDocument (void) const
 returns the name which is set in the document for this object (not the name property!) More...
 
const std::string & getOldLabel () const
 
const std::vector< App::DocumentObject * > & getOutList () const
 returns a list of objects this object is pointing to by Links More...
 
std::vector< App::DocumentObject * > getOutList (int option) const
 
void getOutList (int option, std::vector< App::DocumentObject * > &res) const
 
std::vector< App::DocumentObject * > getOutListOfProperty (App::Property *) const
 returns a list of objects linked by the property More...
 
std::vector< App::DocumentObject * > getOutListRecursive (void) const
 returns a list of objects this object is pointing to by Links and all further descended More...
 
std::vector< std::pair< App::DocumentObject *, std::string > > getParents (int depth=0) const
 Obtain top parents and subnames of this object using its InList. More...
 
std::vector< std::list< App::DocumentObject * > > getPathsByOutList (App::DocumentObject *to) const
 get all possible paths from this to another object following the OutList More...
 
virtual PyObjectgetPyObject (void) override
 This method returns the Python wrapper for a C++ object. More...
 
unsigned long getStatus () const
 return the status bits More...
 
const char * getStatusString (void) const
 get the status Message More...
 
virtual DocumentObjectgetSubObject (const char *subname, PyObject **pyObj=nullptr, Base::Matrix4D *mat=nullptr, bool transform=true, int depth=0) const
 Get the sub element/object by name. More...
 
std::vector< DocumentObject * > getSubObjectList (const char *subname) const
 Return a list of objects referenced by a given subname including this object. More...
 
virtual std::vector< std::string > getSubObjects (int reason=0) const
 Return name reference of all sub-objects. More...
 
virtual const char * getViewProviderName (void) const
 returns the type name of the ViewProvider More...
 
virtual const char * getViewProviderNameOverride () const
 This function is introduced to allow Python feature override its view provider. More...
 
const char * getViewProviderNameStored () const
 
virtual bool hasChildElement () const
 return true to activate tree view group object handling and element visibility More...
 
virtual bool isAttachedToDocument () const override
 
virtual int isElementVisible (const char *element) const
 Get sub-element visibility. More...
 
bool isError (void) const
 set this feature to error More...
 
int isExporting () const
 
bool isInInList (DocumentObject *objToTest) const
 test if this object is directly (non recursive) in the InList More...
 
bool isInInListRecursive (DocumentObject *objToTest) const
 test if this object is in the InList and recursive further down More...
 
bool isInOutList (DocumentObject *objToTest) const
 test if this object is directly (non recursive) in the OutList More...
 
bool isInOutListRecursive (DocumentObject *objToTest) const
 test if the given object is in the OutList and recursive further down More...
 
bool isRecomputing () const
 returns true if this objects is currently recomputing More...
 
bool isRemoving () const
 returns true if this objects is currently removed from the document More...
 
bool isRestoring () const
 returns true if this objects is currently restoring from file More...
 
bool isTouched (void) const
 test if this document object is touched More...
 
bool isValid (void) const
 
virtual short mustExecute (void) const
 mustExecute We call this method to check if the object was modified to be invoked. More...
 
bool mustRecompute (void) const
 Test if this document object must be recomputed. More...
 
virtual void onBeforeChangeLabel (std::string &newLabel)
 
virtual void onLostLinkToObject (DocumentObject *)
 Called in case of losing a link Get called by the document when a object got deleted a link property of this object ist pointing to. More...
 
virtual void onUpdateElementReference (const Property *)
 
void purgeError (void)
 remove the error from the object More...
 
void purgeTouched (void)
 reset this document object touched More...
 
bool recomputeFeature (bool recursive=false)
 Recompute only this feature. More...
 
virtual bool redirectSubName (std::ostringstream &ss, DocumentObject *topParent, DocumentObject *child) const
 Allow object to redirect a subname path. More...
 
virtual bool removeDynamicProperty (const char *prop) override
 
virtual void renameObjectIdentifiers (const std::map< App::ObjectIdentifier, App::ObjectIdentifier > &paths)
 
App::DocumentObjectresolve (const char *subname, App::DocumentObject **parent=nullptr, std::string *childName=nullptr, const char **subElement=nullptr, PyObject **pyObj=nullptr, Base::Matrix4D *mat=nullptr, bool transform=true, int depth=0) const
 Resolve the last document object referenced in the subname. More...
 
App::DocumentObjectresolveRelativeLink (std::string &subname, App::DocumentObject *&link, std::string &linkSub) const
 Resolve a link reference that is relative to this object reference. More...
 
virtual void Save (Base::Writer &writer) const override
 This method is used to save properties to an XML document. More...
 
virtual int setElementVisible (const char *element, bool visible)
 Child element handling. More...
 
virtual void setExpression (const ObjectIdentifier &path, std::shared_ptr< App::Expression > expr)
 
void setStatus (ObjectStatus pos, bool on)
 
bool testIfLinkDAGCompatible (App::PropertyLinkSub &linkTo) const
 
bool testIfLinkDAGCompatible (App::PropertyLinkSubList &linksTo) const
 
bool testIfLinkDAGCompatible (const std::vector< DocumentObject * > &linksTo) const
 
bool testIfLinkDAGCompatible (DocumentObject *linkTo) const
 testIfLinkIsDAG tests a link that is about to be created for circular references. More...
 
bool testStatus (ObjectStatus pos) const
 
void touch (bool noRecompute=false)
 Set the property touched -> changed, cause recomputation in Update() More...
 
virtual ~DocumentObject ()
 
- Public Member Functions inherited from App::TransactionalObject
virtual const char * detachFromDocument ()
 
virtual bool isAttachedToDocument () const
 
 TransactionalObject (void)
 Constructor. More...
 
virtual ~TransactionalObject ()
 
- Public Member Functions inherited from App::ExtensionContainer
ExtensionIterator extensionBegin ()
 
 ExtensionContainer ()
 
ExtensionIterator extensionEnd ()
 
App::ExtensiongetExtension (Base::Type, bool derived=true, bool no_except=false) const
 
App::ExtensiongetExtension (const std::string &name) const
 
template<typename ExtensionT >
ExtensionTgetExtensionByType (bool no_except=false, bool derived=true) const
 
std::vector< Extension * > getExtensionsDerivedFrom (Base::Type type) const
 
template<typename ExtensionT >
std::vector< ExtensionT * > getExtensionsDerivedFromType () const
 
bool hasExtension (Base::Type, bool derived=true) const
 
bool hasExtension (const std::string &name) const
 
bool hasExtensions () const
 
void registerExtension (Base::Type extension, App::Extension *ext)
 
virtual ~ExtensionContainer ()
 
virtual PropertygetPropertyByName (const char *name) const override
 find a property by its name More...
 
virtual const char * getPropertyName (const Property *prop) const override
 get the name of a property More...
 
virtual void getPropertyMap (std::map< std::string, Property * > &Map) const override
 get all properties of the class (including properties of the parent) More...
 
virtual void getPropertyList (std::vector< Property * > &List) const override
 get all properties of the class (including properties of the parent) More...
 
virtual short getPropertyType (const Property *prop) const override
 get the Type of a Property More...
 
virtual short getPropertyType (const char *name) const override
 get the Type of a named Property More...
 
virtual const char * getPropertyGroup (const Property *prop) const override
 get the Group of a Property More...
 
virtual const char * getPropertyGroup (const char *name) const override
 get the Group of a named Property More...
 
virtual const char * getPropertyDocumentation (const Property *prop) const override
 get the Group of a Property More...
 
virtual const char * getPropertyDocumentation (const char *name) const override
 get the Group of a named Property More...
 
void saveExtensions (Base::Writer &writer) const
 
void restoreExtensions (Base::XMLReader &reader)
 
- Public Member Functions inherited from App::PropertyContainer
virtual App::PropertyaddDynamicProperty (const char *type, const char *name=nullptr, const char *group=nullptr, const char *doc=nullptr, short attr=0, bool ro=false, bool hidden=false)
 
bool changeDynamicProperty (const Property *prop, const char *group, const char *doc)
 
virtual void editProperty (const char *)
 
virtual App::PropertygetDynamicPropertyByName (const char *name) const
 
DynamicProperty::PropData getDynamicPropertyData (const Property *prop) const
 
virtual std::vector< std::string > getDynamicPropertyNames () const
 
virtual std::string getFullName () const
 
virtual unsigned int getMemSize (void) const
 This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More...
 
virtual PropertygetPropertyByName (const char *name) const
 find a property by its name More...
 
virtual const char * getPropertyDocumentation (const char *name) const
 get the Group of a named Property More...
 
virtual const char * getPropertyDocumentation (const Property *prop) const
 get the Group of a Property More...
 
virtual const char * getPropertyGroup (const char *name) const
 get the Group of a named Property More...
 
virtual const char * getPropertyGroup (const Property *prop) const
 get the Group of a Property More...
 
virtual void getPropertyList (std::vector< Property * > &List) const
 get all properties of the class (including properties of the parent) More...
 
virtual void getPropertyMap (std::map< std::string, Property * > &Map) const
 get all properties of the class (including properties of the parent) More...
 
virtual const char * getPropertyName (const Property *prop) const
 get the name of a property More...
 
virtual void getPropertyNamedList (std::vector< std::pair< const char *, Property * > > &List) const
 get all properties with their names, may contain duplicates and aliases More...
 
const char * getPropertyPrefix () const
 
virtual short getPropertyType (const char *name) const
 get the Type of a named Property More...
 
virtual short getPropertyType (const Property *prop) const
 get the Type of a Property More...
 
bool isHidden (const char *name) const
 check if the named property is hidden More...
 
bool isHidden (const Property *prop) const
 check if the property is hidden More...
 
bool isReadOnly (const char *name) const
 check if the named property is read-only More...
 
bool isReadOnly (const Property *prop) const
 check if the property is read-only More...
 
virtual void onPropertyStatusChanged (const Property &prop, unsigned long oldStatus)
 
 PropertyContainer ()
 A constructor. More...
 
virtual bool removeDynamicProperty (const char *name)
 
virtual void Restore (Base::XMLReader &reader)
 This method is used to restore properties from an XML document. More...
 
virtual void Save (Base::Writer &writer) const
 This method is used to save properties to an XML document. More...
 
void setPropertyPrefix (const char *prefix)
 
void setPropertyStatus (unsigned char bit, bool value)
 set the Status bit of all properties at once More...
 
virtual ~PropertyContainer ()
 A destructor. More...
 
- Public Member Functions inherited from Base::Persistence
void dumpToStream (std::ostream &stream, int compression)
 
virtual unsigned int getMemSize () const =0
 This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More...
 
virtual Base::Type getTypeId (void) const
 
virtual void Restore (XMLReader &)=0
 This method is used to restore properties from an XML document. More...
 
virtual void RestoreDocFile (Reader &)
 This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data. More...
 
void restoreFromStream (std::istream &stream)
 
virtual void Save (Writer &) const =0
 This method is used to save properties to an XML document. More...
 
virtual void SaveDocFile (Writer &) const
 This method is used to save large amounts of data to a binary file. More...
 
- 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...
 
- Public Member Functions inherited from Part::AttachExtension
Attacher::AttachEngineattacher (void) const
 
 AttachExtension ()
 
bool changeAttacherType (const char *typeName)
 changeAttacherType More...
 
virtual App::DocumentObjectExecReturnextensionExecute (void)
 
virtual short int extensionMustExecute (void)
 
virtual PyObjectgetExtensionPyObject (void)
 
bool isAttacherActive () const
 Return whether this attacher is active. More...
 
virtual bool isTouched_Mapping ()
 
virtual void onExtendedDocumentRestored ()
 get called after a document has been fully restored More...
 
virtual bool positionBySupport (void)
 calculate and update the Placement property based on the Support, and mode. More...
 
virtual void setAttacher (Attacher::AttachEngine *attacher)
 setAttacher sets the AttachEngine object. More...
 
void updateAttacherVals ()
 
virtual ~AttachExtension ()
 
- Public Member Functions inherited from App::DocumentObjectExtension
 DocumentObjectExtension ()
 
virtual App::DocumentObjectExecReturnextensionExecute ()
 
virtual bool extensionGetLinkedObject (DocumentObject *&ret, bool recursive, Base::Matrix4D *mat, bool transform, int depth) const
 Get the linked object. More...
 
virtual bool extensionGetSubObject (DocumentObject *&ret, const char *subname, PyObject **pyObj, Base::Matrix4D *mat, bool transform, int depth) const
 Get the sub object by name. More...
 
virtual bool extensionGetSubObjects (std::vector< std::string > &ret, int reason) const
 Get name references of all sub objects. More...
 
virtual bool extensionHasChildElement () const
 
virtual int extensionIsElementVisible (const char *)
 
virtual short extensionMustExecute ()
 
virtual int extensionSetElementVisible (const char *, bool)
 
App::DocumentObjectgetExtendedObject ()
 
const App::DocumentObjectgetExtendedObject () const
 
virtual PyObjectgetExtensionPyObject () override
 
virtual const char * getViewProviderExtensionName () const
 returns the type name of the ViewProviderExtension which is automatically attached to the viewprovider object when it is initiated More...
 
virtual void onExtendedDocumentRestored ()
 get called after a document has been fully restored More...
 
virtual void onExtendedSettingDocument ()
 get called after setting the document More...
 
virtual void onExtendedSetupObject ()
 get called after a brand new object was created More...
 
virtual void onExtendedUnsetupObject ()
 get called when object is going to be removed from the document More...
 
virtual ~DocumentObjectExtension ()
 
- Public Member Functions inherited from App::Extension
 Extension ()
 
App::ExtensionContainergetExtendedContainer ()
 
const App::ExtensionContainergetExtendedContainer () const
 
virtual PyObjectgetExtensionPyObject ()
 
virtual void initExtension (App::ExtensionContainer *obj)
 
bool isPythonExtension ()
 
std::string name () const
 
virtual ~Extension ()
 
virtual PropertyextensionGetPropertyByName (const char *name) const
 find a property by its name More...
 
virtual const char * extensionGetPropertyName (const Property *prop) const
 get the name of a property More...
 
virtual void extensionGetPropertyMap (std::map< std::string, Property * > &Map) const
 get all properties of the class (including properties of the parent) More...
 
virtual void extensionGetPropertyList (std::vector< Property * > &List) const
 get all properties of the class (including properties of the parent) More...
 
virtual short extensionGetPropertyType (const Property *prop) const
 get the Type of a Property More...
 
virtual short extensionGetPropertyType (const char *name) const
 get the Type of a named Property More...
 
virtual const char * extensionGetPropertyGroup (const Property *prop) const
 get the Group of a Property More...
 
virtual const char * extensionGetPropertyGroup (const char *name) const
 get the Group of a named Property More...
 
virtual const char * extensionGetPropertyDocumentation (const Property *prop) const
 get the Group of a Property More...
 
virtual const char * extensionGetPropertyDocumentation (const char *name) const
 get the Group of a named Property More...
 
virtual void extensionSave (Base::Writer &) const
 
virtual void extensionRestore (Base::XMLReader &)
 
bool extensionIsDerivedFrom (const Base::Type type) const
 

Public Attributes

Sketcher::PropertyConstraintList Constraints
 
App::PropertyLinkSubList ExternalGeometry
 
App::PropertyBool FullyConstrained
 
Part::PropertyGeometryList Geometry
 Property. More...
 
- Public Attributes inherited from Part::Feature
PropertyPartShape Shape
 
- Public Attributes inherited from App::GeoFeature
PropertyPlacement Placement
 
- Public Attributes inherited from App::DocumentObject
PropertyExpressionEngine ExpressionEngine
 
PropertyString Label
 
PropertyString Label2
 
boost::signals2::signal< void(const App::DocumentObject &, const App::Property &)> signalBeforeChange
 signal before changing a property of this object More...
 
boost::signals2::signal< void(const App::DocumentObject &, const App::Property &)> signalChanged
 signal on changed property of this object More...
 
PropertyBool Visibility
 Allow control visibility status in App name space. More...
 
- Public Attributes inherited from Part::AttachExtension
App::PropertyString AttacherType
 
App::PropertyPlacement AttachmentOffset
 
App::PropertyEnumeration MapMode
 
App::PropertyFloat MapPathParameter
 MapPathParameter is a parameter value for mmNormalToPath (the sketch will be mapped normal to a curve at point specified by parameter (from 0.0 to 1.0, from start to end) ) More...
 
App::PropertyBool MapReversed
 
App::PropertyLinkSubList Support
 

methods override Feature

enum  eReasonList {
  rlAllowed , rlOtherDoc , rlCircularReference , rlOtherPart ,
  rlOtherBody , rlOtherBodyWithLinks , rlNotASketch , rlNonParallel ,
  rlAxesMisaligned , rlOriginsMisaligned
}
 
bool noRecomputes
 SketchObject can work in two modes: Recompute Mode and noRecomputes Mode. More...
 
short mustExecute () const override
 mustExecute We call this method to check if the object was modified to be invoked. More...
 
App::DocumentObjectExecReturnexecute (void) override
 recalculate the Feature (if no recompute is needed see also solve() and solverNeedsUpdate boolean) More...
 
const char * getViewProviderName (void) const override
 returns the type name of the ViewProvider More...
 
bool isSupportedGeometry (const Part::Geometry *geo) const
 Returns true if the sketcher supports the given geometry. More...
 
int addGeometry (const Part::Geometry *geo, bool construction=false)
 Add geometry to a sketch. More...
 
int addGeometry (const std::vector< Part::Geometry * > &geoList, bool construction=false)
 Add multiple geometry elements to a sketch. More...
 
int delGeometry (int GeoId, bool deleteinternalgeo=true)
 Deletes indicated geometry (by geoid). More...
 
int delGeometriesExclusiveList (const std::vector< int > &GeoIds)
 Deletes just the GeoIds indicated, it does not look for internal geometry. More...
 
int delGeometries (const std::vector< int > &GeoIds)
 Does the same as delGeometry but allows to delete several geometries in one step. More...
 
int deleteAllGeometry ()
 deletes all the elements/constraints of the sketch except for external geometry More...
 
int deleteAllConstraints ()
 deletes all the constraints of the sketch More...
 
int addConstraints (const std::vector< Constraint * > &ConstraintList)
 add all constraints in the list More...
 
int addCopyOfConstraints (const SketchObject &orig)
 Copy the constraints instead of cloning them and copying the expressions if any. More...
 
int addConstraint (const Constraint *constraint)
 add constraint More...
 
int addConstraint (std::unique_ptr< Constraint > constraint)
 add constraint More...
 
int delConstraint (int ConstrId)
 delete constraint More...
 
int delConstraints (std::vector< int > ConstrIds, bool updategeometry=true)
 deletes a group of constraints at once, if norecomputes is active, the default behaviour is that it will solve the sketch. More...
 
int delConstraintOnPoint (int GeoId, PointPos PosId, bool onlyCoincident=true)
 
int delConstraintOnPoint (int VertexId, bool onlyCoincident=true)
 
int delConstraintsToExternal ()
 Deletes all constraints referencing an external geometry. More...
 
int transferConstraints (int fromGeoId, PointPos fromPosId, int toGeoId, PointPos toPosId, bool doNotTransformTangencies=false)
 transfers all constraints of a point to a new point More...
 
int carbonCopy (App::DocumentObject *pObj, bool construction=true)
 Carbon copy another sketch geometry and constraints. More...
 
int addExternal (App::DocumentObject *Obj, const char *SubName)
 add an external geometry reference More...
 
int delExternal (int ExtGeoId)
 delete external ExtGeoId >= 0 with 0 corresponding to the first user defined external geometry More...
 
int delAllExternal ()
 deletes all external geometry More...
 
template<typename GeometryT = Part::Geometry, typename = typename std::enable_if< std::is_base_of<Part::Geometry, typename std::decay<GeometryT>::type>::value >::type>
const GeometryT * getGeometry (int GeoId) const
 returns a pointer to a given Geometry index, possible indexes are: id>=0 for user defined geometries, id==-1 for the horizontal sketch axis, id==-2 for the vertical sketch axis id<=-3 for user defined projected external geometries, More...
 
std::unique_ptr< const GeometryFacadegetGeometryFacade (int GeoId) const
 
const std::vector< Part::Geometry * > & getInternalGeometry (void) const
 returns a list of all internal geometries More...
 
const std::vector< Part::Geometry * > & getExternalGeometry (void) const
 returns a list of projected external geometries More...
 
void rebuildExternalGeometry (void)
 rebuilds external geometry (projection onto the sketch plane) More...
 
int getExternalGeometryCount (void) const
 returns the number of external Geometry entities More...
 
std::vector< Part::Geometry * > getCompleteGeometry (void) const
 retrieves a vector containing both normal and external Geometry (including the sketch axes) More...
 
GeoListFacade getGeoListFacade (void) const
 
int getCompleteGeometryIndex (int GeoId) const
 converts a GeoId index into an index of the CompleteGeometry vector More...
 
int getGeoIdFromCompleteGeometryIndex (int completeGeometryIndex) const
 
int hasConflicts (void) const
 returns non zero if the sketch contains conflicting constraints More...
 
int setUpSketch ()
 sets the geometry of sketchObject as the solvedsketch geometry returns the DoF of such a geometry. More...
 
int diagnoseAdditionalConstraints (std::vector< Sketcher::Constraint * > additionalconstraints)
 Performs a full analysis of the addition of additional constraints without adding them to the sketch object. More...
 
int solve (bool updateGeoAfterSolving=true)
 solves the sketch and updates the geometry, but not all the dependent features (does not recompute) When a recompute is necessary, recompute triggers execute() which solves the sketch and updates all dependent features When a solve only is necessary (e.g. More...
 
int setDatum (int ConstrId, double Datum)
 set the datum of a Distance or Angle constraint and solve More...
 
int setDriving (int ConstrId, bool isdriving)
 set the driving status of this constraint and solve More...
 
int getDriving (int ConstrId, bool &isdriving)
 get the driving status of this constraint More...
 
int toggleDriving (int ConstrId)
 toggle the driving status of this constraint More...
 
int setActive (int ConstrId, bool isactive)
 set the driving status of this constraint and solve More...
 
int getActive (int ConstrId, bool &isactive)
 get the driving status of this constraint More...
 
int toggleActive (int ConstrId)
 toggle the driving status of this constraint More...
 
int setDatumsDriving (bool isdriving)
 Make all dimensionals Driving/non-Driving. More...
 
int moveDatumsToEnd (void)
 Move Dimensional constraints at the end of the properties array. More...
 
int setVirtualSpace (int ConstrId, bool isinvirtualspace)
 set the driving status of this constraint and solve More...
 
int setVirtualSpace (std::vector< int > constrIds, bool isinvirtualspace)
 set the driving status of a group of constraints at once More...
 
int getVirtualSpace (int ConstrId, bool &isinvirtualspace) const
 get the driving status of this constraint More...
 
int toggleVirtualSpace (int ConstrId)
 toggle the driving status of this constraint More...
 
int movePoint (int GeoId, PointPos PosId, const Base::Vector3d &toPoint, bool relative=false, bool updateGeoBeforeMoving=false)
 move this point to a new location and solve More...
 
Base::Vector3d getPoint (int GeoId, PointPos PosId) const
 retrieves the coordinates of a point More...
 
int toggleConstruction (int GeoId)
 toggle geometry to draft line More...
 
int setConstruction (int GeoId, bool on)
 
int fillet (int geoId, PointPos pos, double radius, bool trim=true, bool preserveCorner=false)
 Create a sketch fillet from the point at the intersection of two lines. More...
 
int fillet (int geoId1, int geoId2, const Base::Vector3d &refPnt1, const Base::Vector3d &refPnt2, double radius, bool trim=true, bool createCorner=false)
 More general form of fillet. More...
 
int trim (int geoId, const Base::Vector3d &point)
 trim a curve More...
 
int extend (int geoId, double increment, PointPos endPoint)
 extend a curve More...
 
int split (int geoId, const Base::Vector3d &point)
 split a curve More...
 
int addSymmetric (const std::vector< int > &geoIdList, int refGeoId, Sketcher::PointPos refPosId=Sketcher::PointPos::none)
 adds symmetric geometric elements with respect to the refGeoId (line or point) More...
 
int addCopy (const std::vector< int > &geoIdList, const Base::Vector3d &displacement, bool moveonly=false, bool clone=false, int csize=2, int rsize=1, bool constraindisplacement=false, double perpscale=1.0)
 with default parameters adds a copy of the geometric elements displaced by the displacement vector. More...
 
int removeAxesAlignment (const std::vector< int > &geoIdList)
 
int exposeInternalGeometry (int GeoId)
 Exposes all internal geometry of an object supporting internal geometry. More...
 
int deleteUnusedInternalGeometry (int GeoId, bool delgeoid=false)
 Deletes all unused (not further constrained) internal geometry. More...
 
bool convertToNURBS (int GeoId)
 Approximates the given geometry with a B-spline. More...
 
bool increaseBSplineDegree (int GeoId, int degreeincrement=1)
 Increases the degree of a BSpline by degreeincrement, which defaults to 1. More...
 
bool decreaseBSplineDegree (int GeoId, int degreedecrement=1)
 Decreases the degree of a BSpline by degreedecrement, which defaults to 1. More...
 
bool modifyBSplineKnotMultiplicity (int GeoId, int knotIndex, int multiplicityincr=1)
 Increases or Decreases the multiplicity of a BSpline knot by the multiplicityincr param, which defaults to 1, if the result is multiplicity zero, the knot is removed. More...
 
bool insertBSplineKnot (int GeoId, double param, int multiplicity=1)
 Inserts a knot in the BSpline at param with given multiplicity. If the knot already exists, its multiplicity is increased by multiplicity. More...
 
void getGeoVertexIndex (int VertexId, int &GeoId, PointPos &PosId) const
 retrieves for a Vertex number the corresponding GeoId and PosId More...
 
int getHighestVertexIndex (void) const
 
int getHighestCurveIndex (void) const
 
void rebuildVertexIndex (void)
 
int getVertexIndexGeoPos (int GeoId, PointPos PosId) const
 retrieves for a GeoId and PosId the Vertex number More...
 
const std::vector< std::map< int, Sketcher::PointPos > > getCoincidenceGroups ()
 
void isCoincidentWithExternalGeometry (int GeoId, bool &start_external, bool &mid_external, bool &end_external)
 
const std::map< int, Sketcher::PointPosgetAllCoincidentPoints (int GeoId, PointPos PosId)
 
void getDirectlyCoincidentPoints (int GeoId, PointPos PosId, std::vector< int > &GeoIdList, std::vector< PointPos > &PosIdList)
 retrieves for a Vertex number a list with all coincident points (sharing a single coincidence constraint) More...
 
void getDirectlyCoincidentPoints (int VertexId, std::vector< int > &GeoIdList, std::vector< PointPos > &PosIdList)
 
bool arePointsCoincident (int GeoId1, PointPos PosId1, int GeoId2, PointPos PosId2)
 
void getConstraintIndices (int GeoId, std::vector< int > &constraintList)
 returns a list of indices of all constraints involving given GeoId More...
 
double calculateAngleViaPoint (int geoId1, int geoId2, double px, double py)
 
bool isPointOnCurve (int geoIdCurve, double px, double py)
 
double calculateConstraintError (int ConstrId)
 
int changeConstraintsLocking (bool bLock)
 changeConstraintsLocking locks or unlocks all tangent and perpendicular constraints. More...
 
bool constraintHasExpression (int constrid) const
 returns whether a given constraint has an associated expression or not More...
 
int port_reversedExternalArcs (bool justAnalyze)
 porting functions More...
 
virtual PyObjectgetPyObject (void) override
 getPyObject returns the Python binding object More...
 
virtual unsigned int getMemSize (void) const override
 This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More...
 
virtual void Save (Base::Writer &) const override
 This method is used to save properties to an XML document. More...
 
virtual void Restore (Base::XMLReader &) override
 This method is used to restore properties from an XML document. More...
 
virtual int getAxisCount (void) const override
 returns the number of construction lines (to be used as axes) More...
 
virtual Base::Axis getAxis (int axId) const override
 retrieves an axis iterating through the construction lines of the sketch (indices start at 0) More...
 
virtual void acceptGeometry () override
 verify and accept the assigned geometry More...
 
bool evaluateConstraint (const Constraint *constraint) const
 Check if constraint has invalid indexes. More...
 
bool evaluateConstraints () const
 Check for constraints with invalid indexes. More...
 
void validateConstraints ()
 Remove constraints with invalid indexes. More...
 
bool evaluateSupport (void)
 Checks if support is valid. More...
 
void validateExternalLinks (void)
 validate External Links (remove invalid external links) More...
 
int getLastDoF () const
 gets DoF of last solver execution More...
 
bool getLastHasConflicts () const
 gets HasConflicts status of last solver execution More...
 
bool getLastHasRedundancies () const
 gets HasRedundancies status of last solver execution More...
 
bool getLastHasPartialRedundancies () const
 gets HasRedundancies status of last solver execution More...
 
bool getLastHasMalformedConstraints () const
 gets HasMalformedConstraints status of last solver execution More...
 
int getLastSolverStatus () const
 gets solver status of last solver execution More...
 
float getLastSolveTime () const
 gets solver SolveTime of last solver execution More...
 
const std::vector< int > & getLastConflicting (void) const
 gets the conflicting constraints of the last solver execution More...
 
const std::vector< int > & getLastRedundant (void) const
 gets the redundant constraints of last solver execution More...
 
const std::vector< int > & getLastPartiallyRedundant (void) const
 gets the redundant constraints of last solver execution More...
 
const std::vector< int > & getLastMalformedConstraints (void) const
 gets the redundant constraints of last solver execution More...
 
const SketchgetSolvedSketch (void) const
 gets the solved sketch as a reference More...
 
void setRecalculateInitialSolutionWhileMovingPoint (bool recalculateInitialSolutionWhileMovingPoint)
 enables/disables solver initial solution recalculation when moving point mode (useful for dragging) More...
 
int initTemporaryMove (int geoId, PointPos pos, bool fine=true)
 Forwards a request for a temporary initMove to the solver using the current sketch state as a reference (enables dragging) More...
 
int initTemporaryBSplinePieceMove (int geoId, PointPos pos, const Base::Vector3d &firstPoint, bool fine=true)
 Forwards a request for a temporary initBSplinePieceMove to the solver using the current sketch state as a reference (enables dragging) More...
 
int moveTemporaryPoint (int geoId, PointPos pos, Base::Vector3d toPoint, bool relative=false)
 Forwards a request for point or curve temporary movement to the solver using the current state as a reference (enables dragging). More...
 
void updateSolverExtension (int geoId, std::unique_ptr< Part::GeometryExtension > &&ext)
 forwards a request to update an extension of a geometry of the solver to the solver. More...
 
void getGeometryWithDependentParameters (std::vector< std::pair< int, PointPos > > &geometrymap)
 returns the geometric elements/vertex which the solver detects as having dependent parameters. More...
 
bool isAllowedOtherBody () const
 Flag to allow external geometry from other bodies than the one this sketch belongs to. More...
 
void setAllowOtherBody (bool on)
 
bool isAllowedUnaligned () const
 Flag to allow carbon copy from misaligned geometry. More...
 
void setAllowUnaligned (bool on)
 
bool isExternalAllowed (App::Document *pDoc, App::DocumentObject *pObj, eReasonList *rsn=nullptr) const
 Return true if this object is allowed as external geometry for the sketch. More...
 
bool isCarbonCopyAllowed (App::Document *pDoc, App::DocumentObject *pObj, bool &xinv, bool &yinv, eReasonList *rsn=nullptr) const
 
bool isPerformingInternalTransaction () const
 
bool seekTrimPoints (int GeoId, const Base::Vector3d &point, int &GeoId1, Base::Vector3d &intersect1, int &GeoId2, Base::Vector3d &intersect2)
 retrieves intersection points of this curve with the closest two curves around a point of this curve. More...
 
int autoConstraint (double precision=Precision::Confusion() *1000, double angleprecision=M_PI/20, bool includeconstruction=true)
 
int detectMissingPointOnPointConstraints (double precision=Precision::Confusion() *1000, bool includeconstruction=true)
 
void analyseMissingPointOnPointCoincident (double angleprecision=M_PI/8)
 
int detectMissingVerticalHorizontalConstraints (double angleprecision=M_PI/8)
 
int detectMissingEqualityConstraints (double precision)
 
std::vector< ConstraintIds > & getMissingPointOnPointConstraints (void)
 
std::vector< ConstraintIds > & getMissingVerticalHorizontalConstraints (void)
 
std::vector< ConstraintIds > & getMissingLineEqualityConstraints (void)
 
std::vector< ConstraintIds > & getMissingRadiusConstraints (void)
 
void setMissingRadiusConstraints (std::vector< ConstraintIds > &cl)
 
void setMissingLineEqualityConstraints (std::vector< ConstraintIds > &cl)
 
void setMissingVerticalHorizontalConstraints (std::vector< ConstraintIds > &cl)
 
void setMissingPointOnPointConstraints (std::vector< ConstraintIds > &cl)
 
void makeMissingPointOnPointCoincident (bool onebyone=false)
 
void makeMissingVerticalHorizontal (bool onebyone=false)
 
void makeMissingEquality (bool onebyone=true)
 
int autoRemoveRedundants (bool updategeo=true)
 returns the number of redundant constraints detected More...
 
int renameConstraint (int GeoId, std::string name)
 
std::vector< Base::Vector3dgetOpenVertices (void) const
 
int setGeometryId (int GeoId, long id)
 
int getGeometryId (int GeoId, long &id) const
 
static void appendConflictMsg (const std::vector< int > &conflicting, std::string &msg)
 generates a warning message about constraint conflicts and appends it to the given message More...
 
static void appendRedundantMsg (const std::vector< int > &redundant, std::string &msg)
 generates a warning message about redundant constraints and appends it to the given message More...
 
static void appendMalformedConstraintsMsg (const std::vector< int > &malformed, std::string &msg)
 generates a warning message about malformed constraints and appends it to the given message More...
 
virtual void onChanged (const App::Property *) override
 get called by the container when a property has changed More...
 
virtual void onDocumentRestored () override
 get called after a document has been fully restored More...
 
virtual void restoreFinished () override
 This method is used at the end of restoreFromStream() after all data files have been read in. More...
 
virtual void setExpression (const App::ObjectIdentifier &path, std::shared_ptr< App::Expression > expr) override
 
std::string validateExpression (const App::ObjectIdentifier &path, std::shared_ptr< const App::Expression > expr)
 
void constraintsRenamed (const std::map< App::ObjectIdentifier, App::ObjectIdentifier > &renamed)
 
void constraintsRemoved (const std::set< App::ObjectIdentifier > &removed)
 
std::vector< Part::Geometry * > supportedGeometry (const std::vector< Part::Geometry * > &geoList) const
 Returns a list of supported geometries from the input list. More...
 
void transferFilletConstraints (int geoId1, PointPos posId1, int geoId2, PointPos posId2)
 Transfer constraints on lines being filleted. More...
 
int testDrivingChange (int ConstrId, bool isdriving)
 
virtual void onUndoRedoFinished () override
 get called after an undo/redo transaction is finished More...
 
void migrateSketch (void)
 
void retrieveSolverDiagnostics ()
 
bool getBlockedState (const Constraint *cstr, bool &blockedstate) const
 
bool getInternalTypeState (const Constraint *cstr, Sketcher::InternalType::InternalType &internaltypestate) const
 
void synchroniseGeometryState ()
 
void addConstraint (Sketcher::ConstraintType constrType, int firstGeoId, Sketcher::PointPos firstPos, int secondGeoId=GeoEnum::GeoUndef, Sketcher::PointPos secondPos=Sketcher::PointPos::none, int thirdGeoId=GeoEnum::GeoUndef, Sketcher::PointPos thirdPos=Sketcher::PointPos::none)
 
std::unique_ptr< ConstraintcreateConstraint (Sketcher::ConstraintType constrType, int firstGeoId, Sketcher::PointPos firstPos, int secondGeoId=GeoEnum::GeoUndef, Sketcher::PointPos secondPos=Sketcher::PointPos::none, int thirdGeoId=GeoEnum::GeoUndef, Sketcher::PointPos thirdPos=Sketcher::PointPos::none)
 
static void appendConstraintsMsg (const std::vector< int > &vector, const std::string &singularmsg, const std::string &pluralmsg, std::string &msg)
 

Additional Inherited Members

- Public Types inherited from App::GeoFeature
enum  ElementNameType { Normal =0 , Import =1 , Export =2 }
 Specify the type of element name to return when calling getElementName() More...
 
- Public Types inherited from App::DocumentObject
enum  GSReason { GS_DEFAULT , GS_SELECT }
 reason of calling getSubObjects() More...
 
enum  OutListOption { OutListNoExpression = 1 , OutListNoHidden = 2 , OutListNoXLinked = 4 }
 DAG handling This part of the interface deals with viewing the document as a DAG (directed acyclic graph). More...
 
- Public Types inherited from App::ExtensionContainer
typedef std::map< Base::Type, App::Extension * >::iterator ExtensionIterator
 
- Static Public Member Functions inherited from Part::Part2DObject
static bool seekTrimPoints (const std::vector< Geometry * > &geomlist, int geometryIndex, const Base::Vector3d &point, int &geometryIndex1, Base::Vector3d &intersect1, int &geometryIndex2, Base::Vector3d &intersect2)
 calculate the points where a curve with index geometryIndex should be trimmed with respect to the rest of the curves contained in the list geomlist and a picked point. More...
 
- Static Public Member Functions inherited from Part::Feature
static TopoDS_Shape getShape (const App::DocumentObject *obj, const char *subname=nullptr, bool needSubElement=false, Base::Matrix4D *pmat=nullptr, App::DocumentObject **owner=nullptr, bool resolveLink=true, bool transform=true)
 Convenience function to extract shape from fully qualified subname. More...
 
static TopoShape getTopoShape (const App::DocumentObject *obj, const char *subname=nullptr, bool needSubElement=false, Base::Matrix4D *pmat=nullptr, App::DocumentObject **owner=nullptr, bool resolveLink=true, bool transform=true, bool noElementMap=false)
 
static void clearShapeCache ()
 
static App::DocumentObjectgetShapeOwner (const App::DocumentObject *obj, const char *subname=nullptr)
 
static bool hasShapeOwner (const App::DocumentObject *obj, const char *subname=nullptr)
 
- Static Public Member Functions inherited from App::GeoFeature
static DocumentObjectresolveElement (App::DocumentObject *obj, const char *subname, std::pair< std::string, std::string > &elementName, bool append=false, ElementNameType type=Normal, const DocumentObject *filter=nullptr, const char **element=nullptr, GeoFeature **geo=nullptr)
 Resolve both the new and old style element name. More...
 
- Static Public Member Functions inherited from App::DocumentObject
static const char * hasHiddenMarker (const char *subname)
 Check if the subname reference ends with hidden marker. More...
 
static const std::string & hiddenMarker ()
 Special marker to mark the object as hidden. More...
 
- Static Public Member Functions inherited from Base::Persistence
static void * create (void)
 
static std::string encodeAttribute (const std::string &)
 Encodes an attribute upon saving. More...
 
static Base::Type getClassTypeId (void)
 
static void init (void)
 
- Static Public Member Functions inherited from Base::BaseClass
static void * create ()
 
static Type getClassTypeId ()
 
static void init ()
 
- Static Public Attributes inherited from Part::Part2DObject
static const int H_Axis = -1
 
static const int N_Axis = -3
 
static const int V_Axis = -2
 
- Static Public Attributes inherited from App::DocumentObject
static DocumentObjectExecReturnStdReturn
 
- Protected Member Functions inherited from Part::Part2DObject
void handleChangedPropertyType (Base::XMLReader &reader, const char *TypeName, App::Property *prop) override
 PropertyContainer::handleChangedPropertyType is called during restore to possibly fix reading of older versions of the property container. More...
 
void handleChangedPropertyName (Base::XMLReader &reader, const char *TypeName, const char *PropName) override
 PropertyContainer::handleChangedPropertyName is called during restore to possibly fix reading of older versions of this property container. More...
 
- Protected Member Functions inherited from Part::Feature
virtual App::DocumentObjectExecReturnrecompute () override
 recompute only this object More...
 
ShapeHistory buildHistory (BRepBuilderAPI_MakeShape &, TopAbs_ShapeEnum type, const TopoDS_Shape &newS, const TopoDS_Shape &oldS)
 Build a history of changes MakeShape: The operation that created the changes, e.g. More...
 
ShapeHistory joinHistory (const ShapeHistory &, const ShapeHistory &)
 
- Protected Member Functions inherited from App::DocumentObject
virtual App::DocumentObjectExecReturnexecute (void)
 get called by the document to recompute this feature Normally this method get called in the processing of Document::recompute(). More...
 
App::DocumentObjectExecReturnexecuteExtensions ()
 Executes the extensions of a document object. More...
 
virtual void onBeforeChange (const Property *prop) override
 get called before the value is changed More...
 
virtual void onChanged (const Property *prop) override
 get called by the container when a property was changed More...
 
virtual void onDocumentRestored ()
 get called after a document has been fully restored More...
 
virtual void onPropertyStatusChanged (const Property &prop, unsigned long oldStatus) override
 get called when a property status has changed More...
 
virtual void onSettingDocument ()
 get called after setting the document More...
 
virtual void onUndoRedoFinished ()
 get called after an undo/redo transaction is finished More...
 
virtual App::DocumentObjectExecReturnrecompute (void)
 recompute only this object More...
 
void resetError (void)
 
void setDocument (App::Document *doc)
 
void setError (void)
 
virtual void setupObject ()
 get called after a brand new object was created More...
 
virtual void unsetupObject ()
 get called when object is going to be removed from the document More...
 
- Protected Member Functions inherited from App::TransactionalObject
void onBeforeChangeProperty (Document *doc, const Property *prop)
 
- Protected Member Functions inherited from App::PropertyContainer
virtual const PropertyDatagetPropertyData (void) const
 
virtual void handleChangedPropertyName (Base::XMLReader &reader, const char *TypeName, const char *PropName)
 PropertyContainer::handleChangedPropertyName is called during restore to possibly fix reading of older versions of this property container. More...
 
virtual void handleChangedPropertyType (Base::XMLReader &reader, const char *TypeName, Property *prop)
 PropertyContainer::handleChangedPropertyType is called during restore to possibly fix reading of older versions of the property container. More...
 
virtual void onBeforeChange (const Property *)
 get called before the value is changed More...
 
virtual void onChanged (const Property *)
 get called by the container when a property has changed More...
 
- Protected Member Functions inherited from Part::AttachExtension
virtual void extensionOnChanged (const App::Property *)
 
virtual void extHandleChangedPropertyName (Base::XMLReader &reader, const char *TypeName, const char *PropName)
 
App::PropertyPlacementgetPlacement () const
 
- Protected Member Functions inherited from App::Extension
void initExtensionType (Base::Type type)
 
- Static Protected Member Functions inherited from App::PropertyContainer
static const PropertyDatagetPropertyDataPtr (void)
 
- Static Protected Member Functions inherited from Base::BaseClass
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr)
 
- Static Protected Member Functions inherited from App::Extension
static void initExtensionSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Base::Type::instantiationMethod method=nullptr)
 
- Protected Attributes inherited from App::DocumentObject
std::string oldLabel
 Old label; used for renaming expressions. More...
 
const std::string * pcNameInDocument
 
Py::SmartPtr PythonObject
 python object of this class and all descendent More...
 
std::bitset< 32 > StatusBits
 Status bits of the document object The first 8 bits are used for the base system the rest can be used in descendent classes to mark special statuses on the objects. More...
 
- Protected Attributes inherited from App::PropertyContainer
DynamicProperty dynamicProps
 
- Protected Attributes inherited from App::Extension
bool m_isPythonExtension = false
 
Py::SmartPtr ExtensionPythonObject
 

Member Enumeration Documentation

◆ eReasonList

Enumerator
rlAllowed 
rlOtherDoc 
rlCircularReference 
rlOtherPart 
rlOtherBody 
rlOtherBodyWithLinks 
rlNotASketch 
rlNonParallel 
rlAxesMisaligned 
rlOriginsMisaligned 

Constructor & Destructor Documentation

◆ SketchObject()

◆ ~SketchObject()

SketchObject::~SketchObject ( )

Member Function Documentation

◆ acceptGeometry()

void SketchObject::acceptGeometry ( )
overridevirtual

◆ addConstraint() [1/3]

◆ addConstraint() [2/3]

void SketchObject::addConstraint ( Sketcher::ConstraintType  constrType,
int  firstGeoId,
Sketcher::PointPos  firstPos,
int  secondGeoId = GeoEnum::GeoUndef,
Sketcher::PointPos  secondPos = Sketcher::PointPos::none,
int  thirdGeoId = GeoEnum::GeoUndef,
Sketcher::PointPos  thirdPos = Sketcher::PointPos::none 
)
protected

◆ addConstraint() [3/3]

◆ addConstraints()

◆ addCopy()

int SketchObject::addCopy ( const std::vector< int > &  geoIdList,
const Base::Vector3d displacement,
bool  moveonly = false,
bool  clone = false,
int  csize = 2,
int  rsize = 1,
bool  constraindisplacement = false,
double  perpscale = 1.0 
)

with default parameters adds a copy of the geometric elements displaced by the displacement vector.

It creates an array of csize elements in the direction of the displacement vector by rsize elements in the direction perpendicular to the displacement vector, wherein the modulus of this perpendicular vector is scaled by perpscale.

References Sketcher::Angle, Sketcher::Coincident, Base::Console(), Constraints, Sketcher::Constraint::copy(), Part::Geometry::copy(), Sketcher::Diameter, Sketcher::Distance, Sketcher::DistanceX, Sketcher::DistanceY, Sketcher::end, Sketcher::Equal, Base::ConsoleSingleton::Error(), DraftVecUtils::find(), Sketcher::Constraint::First, Sketcher::Constraint::FirstPos, Geometry, Part::GeomConic::getCenter(), Part::GeomArcOfConic::getCenter(), Base::Persistence::getClassTypeId(), Part::GeomLineSegment::getEndPoint(), Sketcher::GeometryFacade::getFacade(), getGeometry(), getHighestCurveIndex(), getInternalGeometry(), getPoint(), Part::GeomPoint::getPoint(), Part::GeomBSplineCurve::getPoles(), Part::PropertyGeometryList::getSize(), Part::GeomBoundedCurve::getStartPoint(), Part::GeomLineSegment::getStartPoint(), Part::GeomArcOfConic::getStartPoint(), Base::Persistence::getTypeId(), Sketcher::PropertyConstraintList::getValues(), Sketcher::InternalAlignment, Sketcher::Constraint::isDriving, Base::Vector3< _Precision >::Length(), Sketcher::mid, draftfunctions.move::move(), Sketcher::none, Sketcher::Parallel, Sketcher::Perpendicular, Sketcher::Radius, Sketcher::Constraint::Second, Sketcher::Constraint::SecondPos, Part::GeomConic::setCenter(), Part::GeomArcOfConic::setCenter(), Sketcher::GeometryFacade::setConstruction(), Part::GeomPoint::setPoint(), Part::GeomLineSegment::setPoints(), Part::GeomBSplineCurve::setPoles(), Sketcher::Constraint::setValue(), Sketcher::PropertyConstraintList::setValues(), Part::PropertyGeometryList::setValues(), Sketcher::start, Sketcher::Constraint::Third, App::Property::touch(), Sketcher::Constraint::Type, Sketcher::Weight, Base::Vector3< _Precision >::x, and Base::Vector3< _Precision >::y.

◆ addCopyOfConstraints()

◆ addExternal()

◆ addGeometry() [1/2]

int SketchObject::addGeometry ( const Part::Geometry geo,
bool  construction = false 
)

◆ addGeometry() [2/2]

int SketchObject::addGeometry ( const std::vector< Part::Geometry * > &  geoList,
bool  construction = false 
)

Add multiple geometry elements to a sketch.

Parameters
geoList- geometry to add
construction- true for construction lines
Return values
int- GeoId of last added element

References Geometry, Base::Persistence::getClassTypeId(), getInternalGeometry(), Part::PropertyGeometryList::getSize(), draftfunctions.move::move(), Sketcher::GeometryFacade::setConstruction(), and Part::PropertyGeometryList::setValues().

◆ addSymmetric()

int SketchObject::addSymmetric ( const std::vector< int > &  geoIdList,
int  refGeoId,
Sketcher::PointPos  refPosId = Sketcher::PointPos::none 
)

adds symmetric geometric elements with respect to the refGeoId (line or point)

References Sketcher::Angle, Sketcher::Coincident, Base::Console(), Constraints, Sketcher::Constraint::copy(), Part::Geometry::copy(), Sketcher::Distance, Sketcher::DistanceX, Sketcher::DistanceY, Sketcher::end, Sketcher::Equal, Base::ConsoleSingleton::Error(), DraftVecUtils::find(), Sketcher::Constraint::First, Sketcher::Constraint::FirstPos, Base::fmod(), Geometry, Part::GeomConic::getCenter(), Part::GeomArcOfConic::getCenter(), Base::Persistence::getClassTypeId(), Part::GeomBoundedCurve::getEndPoint(), Part::GeomLineSegment::getEndPoint(), Part::GeomArcOfConic::getEndPoint(), Sketcher::GeometryFacade::getFacade(), Part::GeomArcOfParabola::getFocus(), getGeometry(), getHighestCurveIndex(), getInternalGeometry(), Part::GeomEllipse::getMajorAxisDir(), Part::GeomArcOfEllipse::getMajorAxisDir(), Part::GeomArcOfHyperbola::getMajorAxisDir(), Part::GeomEllipse::getMajorRadius(), Part::GeomArcOfEllipse::getMajorRadius(), Part::GeomArcOfHyperbola::getMajorRadius(), Part::GeomEllipse::getMinorRadius(), Part::GeomArcOfEllipse::getMinorRadius(), Part::GeomArcOfHyperbola::getMinorRadius(), getPoint(), Part::GeomPoint::getPoint(), Part::GeomBSplineCurve::getPoles(), Part::GeomArcOfEllipse::getRange(), Part::GeomArcOfHyperbola::getRange(), Part::GeomArcOfParabola::getRange(), Part::PropertyGeometryList::getSize(), Part::GeomBoundedCurve::getStartPoint(), Part::GeomLineSegment::getStartPoint(), Part::GeomArcOfConic::getStartPoint(), Base::Persistence::getTypeId(), Sketcher::PropertyConstraintList::getValues(), Sketcher::Horizontal, Sketcher::InternalAlignment, Sketcher::mid, draftfunctions.move::move(), Sketcher::none, Sketcher::Parallel, Base::Vector3< _Precision >::Perpendicular(), Sketcher::Perpendicular, Sketcher::PointOnObject, Sketcher::Constraint::Second, Sketcher::Constraint::SecondPos, Part::GeomConic::setCenter(), Part::GeomArcOfConic::setCenter(), Part::GeomEllipse::setMajorAxisDir(), Part::GeomArcOfEllipse::setMajorAxisDir(), Part::GeomArcOfHyperbola::setMajorAxisDir(), Part::GeomPoint::setPoint(), Part::GeomLineSegment::setPoints(), Part::GeomBSplineCurve::setPoles(), Part::GeomArcOfCircle::setRange(), Part::GeomArcOfEllipse::setRange(), Part::GeomArcOfHyperbola::setRange(), Part::GeomArcOfParabola::setRange(), Sketcher::Constraint::setValue(), Sketcher::PropertyConstraintList::setValues(), Part::PropertyGeometryList::setValues(), Part::GeomArcOfConic::setXAxisDir(), Sketcher::start, Sketcher::Tangent, Sketcher::Constraint::Third, Sketcher::Constraint::ThirdPos, App::Property::touch(), Sketcher::Constraint::Type, Sketcher::Vertical, Base::Vector3< _Precision >::x, and Base::Vector3< _Precision >::y.

◆ analyseMissingPointOnPointCoincident()

void SketchObject::analyseMissingPointOnPointCoincident ( double  angleprecision = M_PI/8)

◆ appendConflictMsg()

void SketchObject::appendConflictMsg ( const std::vector< int > &  conflicting,
std::string &  msg 
)
static

generates a warning message about constraint conflicts and appends it to the given message

References appendConstraintsMsg().

Referenced by execute().

◆ appendConstraintsMsg()

void SketchObject::appendConstraintsMsg ( const std::vector< int > &  vector,
const std::string &  singularmsg,
const std::string &  pluralmsg,
std::string &  msg 
)
staticprotected

◆ appendMalformedConstraintsMsg()

void SketchObject::appendMalformedConstraintsMsg ( const std::vector< int > &  malformed,
std::string &  msg 
)
static

generates a warning message about malformed constraints and appends it to the given message

References appendConstraintsMsg().

Referenced by execute().

◆ appendRedundantMsg()

void SketchObject::appendRedundantMsg ( const std::vector< int > &  redundant,
std::string &  msg 
)
static

generates a warning message about redundant constraints and appends it to the given message

References appendConstraintsMsg().

Referenced by execute().

◆ arePointsCoincident()

◆ autoConstraint()

int SketchObject::autoConstraint ( double  precision = Precision::Confusion() * 1000,
double  angleprecision = M_PI/20,
bool  includeconstruction = true 
)

◆ autoRemoveRedundants()

◆ calculateAngleViaPoint()

double SketchObject::calculateAngleViaPoint ( int  geoId1,
int  geoId2,
double  px,
double  py 
)

◆ calculateConstraintError()

◆ carbonCopy()

◆ changeConstraintsLocking()

int SketchObject::changeConstraintsLocking ( bool  bLock)

changeConstraintsLocking locks or unlocks all tangent and perpendicular constraints.

(Constraint locking prevents it from flipping to another valid configuration, when e.g. external geometry is updated from outside.) The sketch solve is not triggered by the function, but the SketchObject is touched (a recompute will be necessary). The geometry should not be affected by the function. The bLock argument specifies, what to do. If true, all constraints are unlocked and locked again. If false, all tangent and perp. constraints are unlocked.

References Sketcher::Constraint::clone(), Base::Console(), Constraints, Sketcher::PropertyConstraintList::getValues(), Base::ConsoleSingleton::Log(), draftfunctions.move::move(), Sketcher::Perpendicular, Sketcher::PropertyConstraintList::setValues(), and Sketcher::Tangent.

◆ constraintHasExpression()

bool SketchObject::constraintHasExpression ( int  constrid) const

◆ constraintsRemoved()

void SketchObject::constraintsRemoved ( const std::set< App::ObjectIdentifier > &  removed)
protected

◆ constraintsRenamed()

void SketchObject::constraintsRenamed ( const std::map< App::ObjectIdentifier, App::ObjectIdentifier > &  renamed)
protected

◆ convertToNURBS()

bool SketchObject::convertToNURBS ( int  GeoId)

◆ createConstraint()

std::unique_ptr< Constraint > SketchObject::createConstraint ( Sketcher::ConstraintType  constrType,
int  firstGeoId,
Sketcher::PointPos  firstPos,
int  secondGeoId = GeoEnum::GeoUndef,
Sketcher::PointPos  secondPos = Sketcher::PointPos::none,
int  thirdGeoId = GeoEnum::GeoUndef,
Sketcher::PointPos  thirdPos = Sketcher::PointPos::none 
)
protected

Referenced by addConstraint().

◆ decreaseBSplineDegree()

bool SketchObject::decreaseBSplineDegree ( int  GeoId,
int  degreedecrement = 1 
)

Decreases the degree of a BSpline by degreedecrement, which defaults to 1.

Parameters
GeoId- the geometry of type bspline to increase the degree
degreedecrement- the decrement in number of degrees to effect
Return values
bool- returns true if the decrease in degree succeeded, or false if it did not succeed.

References addGeometry(), Base::Console(), delGeometry(), Base::ConsoleSingleton::Error(), exposeInternalGeometry(), Geometry, Base::Persistence::getClassTypeId(), getGeometry(), getHighestCurveIndex(), getInternalGeometry(), Base::Persistence::getTypeId(), and Part::PropertyGeometryList::setValues().

◆ delAllExternal()

◆ delConstraint()

◆ delConstraintOnPoint() [1/2]

◆ delConstraintOnPoint() [2/2]

int SketchObject::delConstraintOnPoint ( int  VertexId,
bool  onlyCoincident = true 
)

◆ delConstraints()

int SketchObject::delConstraints ( std::vector< int ConstrIds,
bool  updategeometry = true 
)

deletes a group of constraints at once, if norecomputes is active, the default behaviour is that it will solve the sketch.

If updating the Geometry property as a consequence of a (successful) solve() is not wanted, updategeometry=false, prevents the update. This allows to update the solve status (e.g. dof), without updating the geometry (i.e. make it move to fulfil the constraints).

References Constraints, Sketcher::PropertyConstraintList::getValues(), draftfunctions.move::move(), noRecomputes, Sketcher::PropertyConstraintList::setValues(), and solve().

Referenced by autoRemoveRedundants(), split(), transferFilletConstraints(), and trim().

◆ delConstraintsToExternal()

◆ deleteAllConstraints()

int SketchObject::deleteAllConstraints ( )

deletes all the constraints of the sketch

References Constraints, noRecomputes, Sketcher::PropertyConstraintList::setValues(), and solve().

Referenced by Sketcher::SketchAnalysis::autoconstraint().

◆ deleteAllGeometry()

int SketchObject::deleteAllGeometry ( )

deletes all the elements/constraints of the sketch except for external geometry

References Constraints, Geometry, noRecomputes, Sketcher::PropertyConstraintList::setValues(), Part::PropertyGeometryList::setValues(), solve(), and App::Property::touch().

◆ deleteUnusedInternalGeometry()

int SketchObject::deleteUnusedInternalGeometry ( int  GeoId,
bool  delgeoid = false 
)

◆ delExternal()

◆ delGeometries()

int SketchObject::delGeometries ( const std::vector< int > &  GeoIds)

Does the same as delGeometry but allows to delete several geometries in one step.

References Constraints, delGeometriesExclusiveList(), DraftVecUtils::find(), Sketcher::PropertyConstraintList::getValues(), and Sketcher::InternalAlignment.

◆ delGeometriesExclusiveList()

◆ delGeometry()

◆ detectMissingEqualityConstraints()

int SketchObject::detectMissingEqualityConstraints ( double  precision)

◆ detectMissingPointOnPointConstraints()

int SketchObject::detectMissingPointOnPointConstraints ( double  precision = Precision::Confusion() * 1000,
bool  includeconstruction = true 
)

◆ detectMissingVerticalHorizontalConstraints()

int SketchObject::detectMissingVerticalHorizontalConstraints ( double  angleprecision = M_PI/8)

◆ diagnoseAdditionalConstraints()

int SketchObject::diagnoseAdditionalConstraints ( std::vector< Sketcher::Constraint * >  additionalconstraints)

Performs a full analysis of the addition of additional constraints without adding them to the sketch object.

References Constraints, getCompleteGeometry(), getExternalGeometryCount(), Sketcher::PropertyConstraintList::getValues(), retrieveSolverDiagnostics(), and Sketcher::Sketch::setUpSketch().

◆ evaluateConstraint()

◆ evaluateConstraints()

◆ evaluateSupport()

◆ execute()

App::DocumentObjectExecReturn * SketchObject::execute ( void  )
overridevirtual

recalculate the Feature (if no recompute is needed see also solve() and solverNeedsUpdate boolean)

Reimplemented from Part::Part2DObject.

References Sketcher::PropertyConstraintList::acceptGeometry(), appendConflictMsg(), appendMalformedConstraintsMsg(), appendRedundantMsg(), Base::Console(), Constraints, delConstraintsToExternal(), Base::ConsoleSingleton::Error(), getCompleteGeometry(), rebuildExternalGeometry(), Part::PropertyPartShape::setValue(), Part::Feature::Shape, solve(), App::DocumentObject::StdReturn, and Sketcher::Sketch::toShape().

Referenced by draftobjects.facebinder.Facebinder::addSubobjects(), PathScripts.PathDressupDogbone.ObjectDressup::boneStateList(), ArchSite.Compass::buildCoordinates(), PathScripts.PathDressupHoldingTags.ObjectTagDressup::generateTags(), ArchPanel.PanelCut::getWires(), ArchSchedule.CommandArchSchedule::IsActive(), Mod.PartDesign.Scripts.DistanceBolt.DistanceBolt::onChanged(), Mod.PartDesign.Scripts.Epitrochoid.Epitrochoid::onChanged(), Mod.PartDesign.Scripts.Parallelepiped.Parallelepiped::onChanged(), Mod.PartDesign.Scripts.Parallelepiped.BoxCylinder::onChanged(), Mod.PartDesign.Scripts.Spring.MySpring::onChanged(), FeaturePython.DistanceBolt::onChanged(), PathScripts.PathStock.StockFromBase::onChanged(), PathScripts.PathStock.StockCreateBox::onChanged(), PathScripts.PathStock.StockCreateCylinder::onChanged(), draftobjects.draftlink.DraftLink::onDocumentRestored(), draftobjects.patharray.PathArray::onDocumentRestored(), and draftobjects.pathtwistedarray.PathTwistedArray::onDocumentRestored().

◆ exposeInternalGeometry()

int SketchObject::exposeInternalGeometry ( int  GeoId)

Exposes all internal geometry of an object supporting internal geometry.

Returns
-1 on error

References addConstraints(), addGeometry(), Sketcher::Constraint::AlignmentType, Sketcher::BSplineControlPoint, Sketcher::BSplineKnotPoint, Sketcher::Coincident, Constraints, Part::GeomBSplineCurve::countKnots(), Part::GeomBSplineCurve::countPoles(), Sketcher::EllipseFocus1, Sketcher::EllipseFocus2, Sketcher::EllipseMajorDiameter, Sketcher::EllipseMinorDiameter, Sketcher::end, Sketcher::Equal, Sketcher::Constraint::First, Sketcher::Constraint::FirstPos, Part::GeomArcOfConic::getCenter(), Base::Persistence::getClassTypeId(), getDirectlyCoincidentPoints(), Part::GeomArcOfParabola::getFocus(), getGeometry(), getHighestCurveIndex(), Part::GeomBSplineCurve::getKnots(), Part::GeomArcOfEllipse::getMajorAxisDir(), Part::GeomArcOfHyperbola::getMajorAxisDir(), Part::GeomArcOfEllipse::getMajorRadius(), Part::GeomArcOfHyperbola::getMajorRadius(), Part::GeomArcOfEllipse::getMinorRadius(), Part::GeomArcOfHyperbola::getMinorRadius(), Part::GeomBSplineCurve::getPoles(), Base::Persistence::getTypeId(), Sketcher::PropertyConstraintList::getValues(), Part::GeomBSplineCurve::getWeights(), Sketcher::HyperbolaFocus, Sketcher::HyperbolaMajor, Sketcher::HyperbolaMinor, Sketcher::InternalAlignment, Sketcher::Constraint::InternalAlignmentIndex, Sketcher::mid, Sketcher::none, Sketcher::ParabolaFocus, Part::GeomCurve::pointAtParameter(), Sketcher::Constraint::Second, Sketcher::Constraint::SecondPos, Part::GeomConic::setCenter(), Sketcher::GeometryFacade::setConstruction(), Part::GeomPoint::setPoint(), Part::GeomLineSegment::setPoints(), Part::GeomCircle::setRadius(), Sketcher::start, Sketcher::Constraint::Type, Sketcher::Weight, Base::Vector3< _Precision >::x, and Base::Vector3< _Precision >::y.

Referenced by decreaseBSplineDegree(), and trim().

◆ extend()

◆ fillet() [1/2]

int SketchObject::fillet ( int  geoId,
PointPos  pos,
double  radius,
bool  trim = true,
bool  preserveCorner = false 
)

Create a sketch fillet from the point at the intersection of two lines.

Parameters
geoId,pos- one of the (exactly) two coincident endpoints
radius- fillet radius
trim- if false, leaves the original lines untouched
createCorner- keep geoId/pos as a Point and keep as many constraints as possible
Return values
-0 on success, -1 on failure

References fillet(), Base::Persistence::getClassTypeId(), getDirectlyCoincidentPoints(), Part::GeomLineSegment::getEndPoint(), getGeometry(), getHighestCurveIndex(), Part::GeomLineSegment::getStartPoint(), Base::Persistence::getTypeId(), and trim().

Referenced by fillet().

◆ fillet() [2/2]

int SketchObject::fillet ( int  geoId1,
int  geoId2,
const Base::Vector3d refPnt1,
const Base::Vector3d refPnt2,
double  radius,
bool  trim = true,
bool  createCorner = false 
)

More general form of fillet.

Parameters
geoId1,geoId2- geoId for two lines (which don't necessarily have to coincide)
refPnt1,refPnt2- reference points on the input geometry, used to influence the free fillet variables
radius- fillet radius
trim- if false, leaves the original lines untouched
preserveCorner- if the lines are coincident, place a Point where they meet and keep as many of the existing constraints as possible
Return values
-0 on success, -1 on failure

References addConstraint(), addGeometry(), Part::GeomCurve::closestParameter(), Sketcher::Coincident, Base::Console(), Constraints, Part::createFilletGeometry(), Base::Vector3< _Precision >::Cross(), delConstraintOnPoint(), DraftVecUtils::dist(), Base::Vector3< _Precision >::Dot(), Sketcher::end, Part::findFilletCenter(), Sketcher::Constraint::First, Part::GeomCurve::firstDerivativeAtParameter(), Sketcher::Constraint::FirstPos, Sketcher::GeometryFacade::getBlocked(), Base::Persistence::getClassTypeId(), Part::GeomLineSegment::getEndPoint(), Part::GeomCurve::getFirstParameter(), getGeometry(), getHighestCurveIndex(), getPoint(), Part::GeomLineSegment::getStartPoint(), Base::Persistence::getTypeId(), Sketcher::PropertyConstraintList::getValues(), Part::GeomCurve::intersect(), Part::GeomTrimmedCurve::intersectBasisCurves(), Base::BaseClass::isDerivedFrom(), Base::Vector3< _Precision >::Length(), Base::ConsoleSingleton::Log(), draftfunctions.move::move(), movePoint(), Sketcher::none, noRecomputes, Sketcher::Perpendicular, Part::GeomCurve::pointAtParameter(), Base::Vector3< _Precision >::ProjectToLine(), draftutils.translate::QT_TRANSLATE_NOOP, Sketcher::Constraint::Second, Sketcher::Constraint::SecondPos, solve(), Sketcher::start, Part::GeomCurve::tangent(), Sketcher::Tangent, transferFilletConstraints(), trim(), Sketcher::Constraint::Type, Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.

◆ getActive()

int SketchObject::getActive ( int  ConstrId,
bool isactive 
)

get the driving status of this constraint

References Constraints, and Sketcher::PropertyConstraintList::getValues().

◆ getAllCoincidentPoints()

const std::map< int, Sketcher::PointPos > SketchObject::getAllCoincidentPoints ( int  GeoId,
PointPos  PosId 
)

◆ getAxis()

◆ getAxisCount()

int SketchObject::getAxisCount ( void  ) const
overridevirtual

returns the number of construction lines (to be used as axes)

Reimplemented from Part::Part2DObject.

References Base::Persistence::getClassTypeId(), Sketcher::GeometryFacade::getConstruction(), and getInternalGeometry().

◆ getBlockedState()

bool SketchObject::getBlockedState ( const Constraint cstr,
bool blockedstate 
) const
protected

◆ getCoincidenceGroups()

const std::vector< std::map< int, Sketcher::PointPos > > SketchObject::getCoincidenceGroups ( )

◆ getCompleteGeometry()

std::vector< Part::Geometry * > SketchObject::getCompleteGeometry ( void  ) const

◆ getCompleteGeometryIndex()

int SketchObject::getCompleteGeometryIndex ( int  GeoId) const

converts a GeoId index into an index of the CompleteGeometry vector

References Geometry, and Part::PropertyGeometryList::getSize().

◆ getConstraintIndices()

void SketchObject::getConstraintIndices ( int  GeoId,
std::vector< int > &  constraintList 
)

returns a list of indices of all constraints involving given GeoId

References Constraints, and Sketcher::PropertyConstraintList::getValues().

Referenced by split().

◆ getDirectlyCoincidentPoints() [1/2]

void SketchObject::getDirectlyCoincidentPoints ( int  GeoId,
PointPos  PosId,
std::vector< int > &  GeoIdList,
std::vector< PointPos > &  PosIdList 
)

◆ getDirectlyCoincidentPoints() [2/2]

void SketchObject::getDirectlyCoincidentPoints ( int  VertexId,
std::vector< int > &  GeoIdList,
std::vector< PointPos > &  PosIdList 
)

◆ getDriving()

int SketchObject::getDriving ( int  ConstrId,
bool isdriving 
)

get the driving status of this constraint

References Constraints, and Sketcher::PropertyConstraintList::getValues().

◆ getExternalGeometry()

const std::vector< Part::Geometry * > & Sketcher::SketchObject::getExternalGeometry ( void  ) const

returns a list of projected external geometries

◆ getExternalGeometryCount()

int Sketcher::SketchObject::getExternalGeometryCount ( void  ) const

◆ getGeoIdFromCompleteGeometryIndex()

int SketchObject::getGeoIdFromCompleteGeometryIndex ( int  completeGeometryIndex) const

◆ getGeoListFacade()

◆ getGeometry()

template<typename GeometryT , typename >
const GeometryT * Sketcher::SketchObject::getGeometry ( int  GeoId) const

returns a pointer to a given Geometry index, possible indexes are: id>=0 for user defined geometries, id==-1 for the horizontal sketch axis, id==-2 for the vertical sketch axis id<=-3 for user defined projected external geometries,

References getInternalGeometry().

Referenced by SketcherCopy::activate(), CmdSketcherConstrainHorizontal::activated(), CmdSketcherConstrainVertical::activated(), CmdSketcherConstrainDistance::activated(), CmdSketcherConstrainPointOnObject::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainParallel::activated(), CmdSketcherConstrainPerpendicular::activated(), CmdSketcherConstrainTangent::activated(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainRadiam::activated(), CmdSketcherConstrainAngle::activated(), CmdSketcherConstrainEqual::activated(), CmdSketcherConstrainSymmetric::activated(), addCopy(), addSymmetric(), SketcherGui::ExtendSelection::allow(), SketcherGui::FilletSelection::allow(), SketcherGui::SplittingSelection::allow(), SketcherGui::TrimmingSelection::allow(), Sketcher::SketchAnalysis::analyseMissingPointOnPointCoincident(), CmdSketcherConstrainHorizontal::applyConstraint(), CmdSketcherConstrainVertical::applyConstraint(), CmdSketcherConstrainDistance::applyConstraint(), CmdSketcherConstrainPointOnObject::applyConstraint(), CmdSketcherConstrainDistanceX::applyConstraint(), CmdSketcherConstrainDistanceY::applyConstraint(), CmdSketcherConstrainParallel::applyConstraint(), CmdSketcherConstrainPerpendicular::applyConstraint(), CmdSketcherConstrainTangent::applyConstraint(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), CmdSketcherConstrainRadiam::applyConstraint(), CmdSketcherConstrainAngle::applyConstraint(), CmdSketcherConstrainEqual::applyConstraint(), CmdSketcherConstrainSymmetric::applyConstraint(), calculateAngleViaPoint(), calculateConstraintError(), convertToNURBS(), SketcherGui::DrawSketchHandler::createAutoConstraints(), decreaseBSplineDegree(), deleteUnusedInternalGeometry(), delGeometry(), DrawSketchHandlerBSplineInsertKnot::DrawSketchHandlerBSplineInsertKnot(), exposeInternalGeometry(), fillet(), getGeometryFacade(), getPoint(), increaseBSplineDegree(), insertBSplineKnot(), SketcherGui::isBsplineKnotOrEndPoint(), SketcherGui::isBsplinePole(), isPointOnCurve(), migrateSketch(), modifyBSplineKnotMultiplicity(), SketcherGui::ViewProviderSketch::mouseButtonPressed(), DrawSketchHandlerBSplineInsertKnot::mouseMove(), SketcherGui::DrawSketchHandlerExtend::mouseMove(), SketcherGui::ViewProviderSketch::mouseMove(), SketcherGui::DrawSketchHandlerLineSet::pressButton(), SketcherGui::DrawSketchHandlerLineSet::registerPressedKey(), DrawSketchHandlerBSplineInsertKnot::releaseButton(), SketcherGui::DrawSketchHandlerExtend::releaseButton(), SketcherGui::DrawSketchHandlerFillet::releaseButton(), SketcherGui::DrawSketchHandlerSplitting::releaseButton(), SketcherGui::DrawSketchHandlerTrimming::releaseButton(), SketcherGui::DrawSketchHandler::seekAutoConstraint(), split(), transferFilletConstraints(), trim(), and SketcherGui::DrawSketchHandlerLineSet::updateTransitionData().

◆ getGeometryFacade()

std::unique_ptr< const GeometryFacade > SketchObject::getGeometryFacade ( int  GeoId) const

◆ getGeometryId()

int SketchObject::getGeometryId ( int  GeoId,
long &  id 
) const

◆ getGeometryWithDependentParameters()

void SketchObject::getGeometryWithDependentParameters ( std::vector< std::pair< int, PointPos > > &  geometrymap)

returns the geometric elements/vertex which the solver detects as having dependent parameters.

these parameters relate to not fully constraint edges/vertices.

References Sketcher::SolverGeometryExtension::Dependent, Base::BaseClass::getClassTypeId(), getInternalGeometry(), Sketcher::none, Sketcher::SolverGeometryExtension::NotFullyConstraint, and Sketcher::start.

◆ getGeoVertexIndex()

◆ getHighestCurveIndex()

◆ getHighestVertexIndex()

int Sketcher::SketchObject::getHighestVertexIndex ( void  ) const

◆ getInternalGeometry()

◆ getInternalTypeState()

◆ getLastConflicting()

const std::vector< int > & Sketcher::SketchObject::getLastConflicting ( void  ) const

gets the conflicting constraints of the last solver execution

◆ getLastDoF()

int Sketcher::SketchObject::getLastDoF ( ) const

◆ getLastHasConflicts()

bool Sketcher::SketchObject::getLastHasConflicts ( ) const

◆ getLastHasMalformedConstraints()

bool Sketcher::SketchObject::getLastHasMalformedConstraints ( ) const

gets HasMalformedConstraints status of last solver execution

Referenced by SketcherGui::ViewProviderSketch::UpdateSolverInformation().

◆ getLastHasPartialRedundancies()

bool Sketcher::SketchObject::getLastHasPartialRedundancies ( ) const

gets HasRedundancies status of last solver execution

Referenced by SketcherGui::ViewProviderSketch::UpdateSolverInformation().

◆ getLastHasRedundancies()

bool Sketcher::SketchObject::getLastHasRedundancies ( ) const

◆ getLastMalformedConstraints()

const std::vector< int > & Sketcher::SketchObject::getLastMalformedConstraints ( void  ) const

gets the redundant constraints of last solver execution

◆ getLastPartiallyRedundant()

const std::vector< int > & Sketcher::SketchObject::getLastPartiallyRedundant ( void  ) const

gets the redundant constraints of last solver execution

◆ getLastRedundant()

const std::vector< int > & Sketcher::SketchObject::getLastRedundant ( void  ) const

gets the redundant constraints of last solver execution

Referenced by autoRemoveRedundants().

◆ getLastSolverStatus()

int Sketcher::SketchObject::getLastSolverStatus ( ) const

gets solver status of last solver execution

Referenced by CmdSketcherConstrainBlock::activated().

◆ getLastSolveTime()

float Sketcher::SketchObject::getLastSolveTime ( ) const

gets solver SolveTime of last solver execution

◆ getMemSize()

unsigned int SketchObject::getMemSize ( void  ) const
overridevirtual

This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB?

Reimplemented from App::PropertyContainer.

◆ getMissingLineEqualityConstraints()

std::vector< ConstraintIds > & SketchObject::getMissingLineEqualityConstraints ( void  )

◆ getMissingPointOnPointConstraints()

std::vector< ConstraintIds > & SketchObject::getMissingPointOnPointConstraints ( void  )

◆ getMissingRadiusConstraints()

std::vector< ConstraintIds > & SketchObject::getMissingRadiusConstraints ( void  )

◆ getMissingVerticalHorizontalConstraints()

std::vector< ConstraintIds > & SketchObject::getMissingVerticalHorizontalConstraints ( void  )

◆ getOpenVertices()

std::vector< Base::Vector3d > SketchObject::getOpenVertices ( void  ) const

◆ getPoint()

Base::Vector3d SketchObject::getPoint ( int  GeoId,
PointPos  PosId 
) const

retrieves the coordinates of a point

References Sketcher::end, Part::GeomArcOfConic::getCenter(), Base::Persistence::getClassTypeId(), Part::GeomBoundedCurve::getEndPoint(), Part::GeomLineSegment::getEndPoint(), Part::GeomArcOfConic::getEndPoint(), getExternalGeometryCount(), getGeometry(), getHighestCurveIndex(), Part::GeomPoint::getPoint(), Part::GeomBoundedCurve::getStartPoint(), Part::GeomLineSegment::getStartPoint(), Part::GeomArcOfConic::getStartPoint(), Base::Persistence::getTypeId(), Part::Part2DObject::H_Axis, Sketcher::mid, Sketcher::start, and Part::Part2DObject::V_Axis.

Referenced by CmdSketcherConstrainLock::activated(), CmdSketcherConstrainDistance::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainAngle::activated(), ArchStructure.CommandStructuralSystem::Activated(), addCopy(), PathScripts.PathOpGui.TaskPanelBaseLocationPage::addLocation(), PathScripts.PathDressupTagGui.PathDressupTagTaskPanel::addNewTag(), addSymmetric(), CmdSketcherConstrainLock::applyConstraint(), CmdSketcherConstrainDistance::applyConstraint(), CmdSketcherConstrainDistanceX::applyConstraint(), CmdSketcherConstrainDistanceY::applyConstraint(), CmdSketcherConstrainAngle::applyConstraint(), PathScripts.PathOpGui.TaskPanelBaseLocationPage::editLocation(), PathScripts.PathDressupTagGui.PathDressupTagTaskPanel::editTag(), fillet(), draftguitools.gui_arcs.Arc_3Points::getPoint(), ArchCurtainWall.CommandArchCurtainWall::getPoint(), ArchTruss.CommandArchTruss::getPoint(), SketcherGui::IsPointAlreadyOnCurve(), PathScripts.PathDressupTagGui.PathDressupTagTaskPanel::modifyStandardButtons(), PathScripts.PathOpGui.TaskPanelBaseLocationPage::modifyStandardButtons(), split(), transferFilletConstraints(), and trim().

◆ getPyObject()

PyObject * SketchObject::getPyObject ( void  )
overridevirtual

getPyObject returns the Python binding object

Returns
the Python binding object

Reimplemented from Part::Feature.

References App::DocumentObject::PythonObject.

◆ getSolvedSketch()

◆ getVertexIndexGeoPos()

int SketchObject::getVertexIndexGeoPos ( int  GeoId,
PointPos  PosId 
) const

retrieves for a GeoId and PosId the Vertex number

Referenced by SketcherGui::TaskSketcherElements::on_listWidgetElements_itemEntered().

◆ getViewProviderName()

const char * Sketcher::SketchObject::getViewProviderName ( void  ) const
overridevirtual

returns the type name of the ViewProvider

Reimplemented from Part::Part2DObject.

◆ getVirtualSpace()

int SketchObject::getVirtualSpace ( int  ConstrId,
bool isinvirtualspace 
) const

get the driving status of this constraint

References Constraints, and Sketcher::PropertyConstraintList::getValues().

◆ hasConflicts()

int SketchObject::hasConflicts ( void  ) const

returns non zero if the sketch contains conflicting constraints

References Sketcher::Sketch::hasConflicts().

Referenced by SketcherGui::EditDatumDialog::exec(), and restoreFinished().

◆ increaseBSplineDegree()

bool SketchObject::increaseBSplineDegree ( int  GeoId,
int  degreeincrement = 1 
)

Increases the degree of a BSpline by degreeincrement, which defaults to 1.

Parameters
GeoId- the geometry of type bspline to increase the degree
degreeincrement- the increment in number of degrees to effect
Return values
bool- returns true if the increase in degree succeeded, or false if it did not succeed.

References Base::Console(), Base::ConsoleSingleton::Error(), Geometry, Base::Persistence::getClassTypeId(), getGeometry(), getHighestCurveIndex(), getInternalGeometry(), Base::Persistence::getTypeId(), draftfunctions.move::move(), and Part::PropertyGeometryList::setValues().

◆ initTemporaryBSplinePieceMove()

int Sketcher::SketchObject::initTemporaryBSplinePieceMove ( int  geoId,
PointPos  pos,
const Base::Vector3d firstPoint,
bool  fine = true 
)

Forwards a request for a temporary initBSplinePieceMove to the solver using the current sketch state as a reference (enables dragging)

References Sketcher::Sketch::initBSplinePieceMove(), and solve().

Referenced by SketcherGui::ViewProviderSketch::mouseMove().

◆ initTemporaryMove()

int Sketcher::SketchObject::initTemporaryMove ( int  geoId,
PointPos  pos,
bool  fine = true 
)

Forwards a request for a temporary initMove to the solver using the current sketch state as a reference (enables dragging)

References Sketcher::Sketch::initMove(), and solve().

Referenced by SketcherGui::ViewProviderSketch::mouseMove().

◆ insertBSplineKnot()

◆ isAllowedOtherBody()

bool Sketcher::SketchObject::isAllowedOtherBody ( ) const

Flag to allow external geometry from other bodies than the one this sketch belongs to.

◆ isAllowedUnaligned()

bool Sketcher::SketchObject::isAllowedUnaligned ( ) const

Flag to allow carbon copy from misaligned geometry.

◆ isCarbonCopyAllowed()

◆ isCoincidentWithExternalGeometry()

void SketchObject::isCoincidentWithExternalGeometry ( int  GeoId,
bool start_external,
bool mid_external,
bool end_external 
)

◆ isExternalAllowed()

bool SketchObject::isExternalAllowed ( App::Document pDoc,
App::DocumentObject pObj,
eReasonList rsn = nullptr 
) const

◆ isPerformingInternalTransaction()

bool Sketcher::SketchObject::isPerformingInternalTransaction ( ) const

◆ isPointOnCurve()

◆ isSupportedGeometry()

bool SketchObject::isSupportedGeometry ( const Part::Geometry geo) const

Returns true if the sketcher supports the given geometry.

Parameters
geo- the geometry
Return values
bool- true if the geometry is supported

References Base::Persistence::getClassTypeId(), Base::Persistence::getTypeId(), and trim().

Referenced by supportedGeometry().

◆ makeMissingEquality()

void SketchObject::makeMissingEquality ( bool  onebyone = true)

◆ makeMissingPointOnPointCoincident()

void SketchObject::makeMissingPointOnPointCoincident ( bool  onebyone = false)

◆ makeMissingVerticalHorizontal()

void SketchObject::makeMissingVerticalHorizontal ( bool  onebyone = false)

◆ migrateSketch()

◆ modifyBSplineKnotMultiplicity()

bool SketchObject::modifyBSplineKnotMultiplicity ( int  GeoId,
int  knotIndex,
int  multiplicityincr = 1 
)

Increases or Decreases the multiplicity of a BSpline knot by the multiplicityincr param, which defaults to 1, if the result is multiplicity zero, the knot is removed.

Parameters
GeoId- the geometry of type bspline to increase the degree
knotIndex- the index of the knot to modify (note that index is OCC consistent, so 1<=knotindex<=knots)
multiplicityincr- the increment (positive value) or decrement (negative value) of multiplicity of the knot
Return values
bool- returns true if the operation succeeded, or false if it did not succeed.

References Sketcher::BSplineControlPoint, Sketcher::BSplineKnotPoint, Part::Geometry::clone(), Sketcher::Constraint::clone(), Base::Console(), Constraints, Part::GeomBSplineCurve::countKnots(), Part::GeomBSplineCurve::countPoles(), delGeometriesExclusiveList(), Base::ConsoleSingleton::Error(), Geometry, Base::Persistence::getClassTypeId(), Part::GeomBSplineCurve::getDegree(), getGeometry(), getHighestCurveIndex(), getInternalGeometry(), Part::GeomBSplineCurve::getKnots(), Part::GeomBSplineCurve::getMultiplicity(), Part::GeomBSplineCurve::getPoles(), Base::Persistence::getTypeId(), Sketcher::PropertyConstraintList::getValues(), Sketcher::InternalAlignment, Sketcher::Constraint::InternalAlignmentIndex, draftfunctions.move::move(), draftutils.translate::QT_TRANSLATE_NOOP, Sketcher::PropertyConstraintList::setValues(), Part::PropertyGeometryList::setValues(), and App::Property::touch().

◆ moveDatumsToEnd()

int SketchObject::moveDatumsToEnd ( void  )

◆ movePoint()

◆ moveTemporaryPoint()

int Sketcher::SketchObject::moveTemporaryPoint ( int  geoId,
PointPos  pos,
Base::Vector3d  toPoint,
bool  relative = false 
)

Forwards a request for point or curve temporary movement to the solver using the current state as a reference (enables dragging).

NOTE: A temporary move operation must always be preceded by a initTemporaryMove() operation.

References Sketcher::Sketch::movePoint().

◆ mustExecute()

short SketchObject::mustExecute ( ) const
overridevirtual

mustExecute We call this method to check if the object was modified to be invoked.

If the object label or an argument is modified. If we must recompute the object - to call the method execute(). 0: no recomputation is needed 1: recomputation needed

Remarks
If an object is marked as 'touched' then this does not necessarily mean that it will be recomputed. It only means that all objects that link it (i.e. its InList) will be recomputed.

Reimplemented from Part::Feature.

References Constraints, ExternalGeometry, Geometry, and App::Property::isTouched().

◆ onChanged()

◆ onDocumentRestored()

void SketchObject::onDocumentRestored ( )
overrideprotectedvirtual

get called after a document has been fully restored

Reimplemented from App::DocumentObject.

References App::DocumentObject::onDocumentRestored(), and restoreFinished().

◆ onUndoRedoFinished()

void SketchObject::onUndoRedoFinished ( )
overrideprotectedvirtual

◆ port_reversedExternalArcs()

int SketchObject::port_reversedExternalArcs ( bool  justAnalyze)

porting functions

SketchObject::port_reversedExternalArcs finds constraints that link to endpoints of external-geometry arcs, and swaps the endpoints in the constraints. This is needed after CCW emulation was introduced, to port old sketches.

Parameters
justAnalyzeif true, nothing is actually done - only the number of constraints to be affected is returned.
Returns
the number of constraints changed/to be changed.

References Sketcher::Constraint::clone(), Base::Console(), Constraints, Sketcher::end, Sketcher::Constraint::First, Sketcher::Constraint::FirstPos, Base::Persistence::getClassTypeId(), Sketcher::PropertyConstraintList::getValues(), Part::GeomArcOfConic::isReversed(), Base::ConsoleSingleton::Log(), draftfunctions.move::move(), Sketcher::none, Sketcher::Constraint::Second, Sketcher::Constraint::SecondPos, Sketcher::PropertyConstraintList::setValues(), Sketcher::start, Sketcher::Constraint::Third, and Sketcher::Constraint::ThirdPos.

◆ rebuildExternalGeometry()

◆ rebuildVertexIndex()

◆ removeAxesAlignment()

◆ renameConstraint()

int SketchObject::renameConstraint ( int  GeoId,
std::string  name 
)

◆ Restore()

void SketchObject::Restore ( Base::XMLReader )
overridevirtual

This method is used to restore properties from an XML document.

It uses the XMLReader class, which bases on SAX, to read the in Save() written information. Again the Vector as an example:

void PropertyVector::Restore(Base::XMLReader &reader)
{
// read my Element
reader.readElement("PropertyVector");
// get the value of my Attribute
_cVec.x = reader.getAttributeAsFloat("valueX");
_cVec.y = reader.getAttributeAsFloat("valueY");
_cVec.z = reader.getAttributeAsFloat("valueZ");
}

Reimplemented from Part::Part2DObject.

References Part::Part2DObject::Restore().

◆ restoreFinished()

void SketchObject::restoreFinished ( )
overrideprotectedvirtual

◆ retrieveSolverDiagnostics()

◆ Save()

void SketchObject::Save ( Base::Writer ) const
overridevirtual

This method is used to save properties to an XML document.

A good example you'll find in PropertyStandard.cpp, e.g. the vector:

void PropertyVector::Save (Writer &writer) const
{
writer << writer.ind() << "<PropertyVector valueX=\"" << _cVec.x <<
"\" valueY=\"" << _cVec.y <<
"\" valueZ=\"" << _cVec.z <<"\"/>" << endl;
}

The writer.ind() expression writes the indentation, just for pretty printing of the XML. As you see, the writing of the XML document is not done with a DOM implementation because of performance reasons. Therefore the programmer has to take care that a valid XML document is written. This means closing tags and writing UTF-8.

See also
Base::Writer

Reimplemented from App::DocumentObject.

References App::DocumentObject::Save().

◆ seekTrimPoints()

bool SketchObject::seekTrimPoints ( int  GeoId,
const Base::Vector3d point,
int GeoId1,
Base::Vector3d intersect1,
int GeoId2,
Base::Vector3d intersect2 
)

retrieves intersection points of this curve with the closest two curves around a point of this curve.

  • it includes internal and external intersecting geometry.
  • it returns GeoEnum::GeoUndef if no intersection is found.

References getCompleteGeometry(), getGeoIdFromCompleteGeometryIndex(), and getHighestCurveIndex().

Referenced by trim().

◆ setActive()

◆ setAllowOtherBody()

void Sketcher::SketchObject::setAllowOtherBody ( bool  on)

◆ setAllowUnaligned()

void Sketcher::SketchObject::setAllowUnaligned ( bool  on)

◆ setConstruction()

◆ setDatum()

◆ setDatumsDriving()

◆ setDriving()

◆ setExpression()

void SketchObject::setExpression ( const App::ObjectIdentifier path,
std::shared_ptr< App::Expression expr 
)
overrideprotectedvirtual

◆ setGeometryId()

◆ setMissingLineEqualityConstraints()

void SketchObject::setMissingLineEqualityConstraints ( std::vector< ConstraintIds > &  cl)

◆ setMissingPointOnPointConstraints()

void SketchObject::setMissingPointOnPointConstraints ( std::vector< ConstraintIds > &  cl)

◆ setMissingRadiusConstraints()

void SketchObject::setMissingRadiusConstraints ( std::vector< ConstraintIds > &  cl)

◆ setMissingVerticalHorizontalConstraints()

void SketchObject::setMissingVerticalHorizontalConstraints ( std::vector< ConstraintIds > &  cl)

◆ setRecalculateInitialSolutionWhileMovingPoint()

void Sketcher::SketchObject::setRecalculateInitialSolutionWhileMovingPoint ( bool  recalculateInitialSolutionWhileMovingPoint)

enables/disables solver initial solution recalculation when moving point mode (useful for dragging)

Referenced by SketcherGui::ViewProviderSketch::setEdit().

◆ setUpSketch()

int SketchObject::setUpSketch ( )

◆ setVirtualSpace() [1/2]

int SketchObject::setVirtualSpace ( int  ConstrId,
bool  isinvirtualspace 
)

◆ setVirtualSpace() [2/2]

int SketchObject::setVirtualSpace ( std::vector< int constrIds,
bool  isinvirtualspace 
)

◆ solve()

int SketchObject::solve ( bool  updateGeoAfterSolving = true)

solves the sketch and updates the geometry, but not all the dependent features (does not recompute) When a recompute is necessary, recompute triggers execute() which solves the sketch and updates all dependent features When a solve only is necessary (e.g.

DoF changed), solve() solves the sketch and updates the geometry (if updateGeoAfterSolving==true), but does not trigger any recompute.

Returns
0 if no error, if error, the following codes in this order of priority: -4 if overconstrained, -3 if conflicting, -1 if solver error, -2 if redundant constraints

References Base::Console(), Constraints, Base::ConsoleSingleton::Error(), Sketcher::Sketch::extractGeometry(), GCS::Failed, FullyConstrained, Geometry, getCompleteGeometry(), getExternalGeometryCount(), App::DocumentObject::getNameInDocument(), Sketcher::Sketch::getSolveTime(), Sketcher::PropertyConstraintList::getValues(), Sketcher::Sketch::resetInitMove(), retrieveSolverDiagnostics(), Sketcher::Sketch::setUpSketch(), App::PropertyBool::setValue(), Part::PropertyGeometryList::setValues(), Sketcher::Sketch::solve(), App::Property::touch(), and Base::ConsoleSingleton::Warning().

Referenced by delConstraint(), delConstraints(), delConstraintsToExternal(), deleteAllConstraints(), deleteAllGeometry(), delGeometriesExclusiveList(), delGeometry(), execute(), extend(), fillet(), initTemporaryBSplinePieceMove(), initTemporaryMove(), moveDatumsToEnd(), SketcherGui::ViewProviderSketch::onDelete(), onUndoRedoFinished(), femsolver.run.Machine::reset(), restoreFinished(), setActive(), setDatum(), setDatumsDriving(), setDriving(), SketcherGui::ViewProviderSketch::setEdit(), setExpression(), Sketcher::SketchAnalysis::solvesketch(), split(), CmdSketcherConstrainTangent::substituteConstraintCombinations(), CmdSketcherConstrainCoincident::substituteConstraintCombinations(), toggleActive(), toggleDriving(), trim(), and validateExternalLinks().

◆ split()

◆ supportedGeometry()

std::vector< Part::Geometry * > SketchObject::supportedGeometry ( const std::vector< Part::Geometry * > &  geoList) const
protected

Returns a list of supported geometries from the input list.

Parameters
geoList- the geometry list
Return values
list- the supported geometry list

References isSupportedGeometry().

Referenced by onChanged().

◆ synchroniseGeometryState()

◆ testDrivingChange()

int SketchObject::testDrivingChange ( int  ConstrId,
bool  isdriving 
)
protected

◆ toggleActive()

◆ toggleConstruction()

◆ toggleDriving()

◆ toggleVirtualSpace()

◆ transferConstraints()

int SketchObject::transferConstraints ( int  fromGeoId,
PointPos  fromPosId,
int  toGeoId,
PointPos  toPosId,
bool  doNotTransformTangencies = false 
)

◆ transferFilletConstraints()

void SketchObject::transferFilletConstraints ( int  geoId1,
PointPos  posId1,
int  geoId2,
PointPos  posId2 
)
protected

Transfer constraints on lines being filleted.

Since filleting moves the endpoints of the input geometry, existing constraints may no longer be sensible. If fillet() was called with preserveCorner=false, the constraints are simply deleted. But if the lines are coincident and preserveCorner=true, we can preserve most constraints on the old end points by moving them to the preserved corner, or transforming distance constraints on straight lines into point-to-point distance constraints.

Parameters
geoId1,podId1,geoId2,posId2- The two lines that have just been filleted

References addConstraint(), addGeometry(), arePointsCoincident(), Sketcher::Coincident, Constraints, delConstraintOnPoint(), delConstraints(), Sketcher::Distance, Sketcher::DistanceX, Sketcher::DistanceY, Sketcher::end, Sketcher::Equal, Sketcher::Constraint::First, Sketcher::Constraint::FirstPos, Base::Persistence::getClassTypeId(), getGeometry(), getPoint(), Base::Persistence::getTypeId(), Sketcher::PropertyConstraintList::getValues(), Sketcher::Horizontal, draftfunctions.move::move(), Sketcher::none, Sketcher::PointOnObject, Sketcher::Constraint::Second, Sketcher::Constraint::SecondPos, Sketcher::PropertyConstraintList::setValues(), Sketcher::SnellsLaw, Sketcher::start, Sketcher::Symmetric, Sketcher::Constraint::Type, and Sketcher::Vertical.

Referenced by fillet().

◆ trim()

◆ updateSolverExtension()

void Sketcher::SketchObject::updateSolverExtension ( int  geoId,
std::unique_ptr< Part::GeometryExtension > &&  ext 
)

forwards a request to update an extension of a geometry of the solver to the solver.

References draftfunctions.move::move().

◆ validateConstraints()

◆ validateExpression()

std::string SketchObject::validateExpression ( const App::ObjectIdentifier path,
std::shared_ptr< const App::Expression expr 
)
protected

◆ validateExternalLinks()

Member Data Documentation

◆ Constraints

Sketcher::PropertyConstraintList Sketcher::SketchObject::Constraints

Referenced by acceptGeometry(), CmdSketcherConstrainHorizontal::activated(), CmdSketcherConstrainVertical::activated(), CmdSketcherConstrainLock::activated(), CmdSketcherConstrainBlock::activated(), CmdSketcherConstrainDistance::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainRadiam::activated(), CmdSketcherConstrainAngle::activated(), addConstraint(), addConstraints(), addCopy(), addCopyOfConstraints(), addSymmetric(), CmdSketcherConstrainHorizontal::applyConstraint(), CmdSketcherConstrainVertical::applyConstraint(), CmdSketcherConstrainLock::applyConstraint(), CmdSketcherConstrainDistance::applyConstraint(), CmdSketcherConstrainDistanceX::applyConstraint(), CmdSketcherConstrainDistanceY::applyConstraint(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), CmdSketcherConstrainRadiam::applyConstraint(), CmdSketcherConstrainAngle::applyConstraint(), SketcherGui::areAllPointsOrSegmentsFixed(), SketcherGui::areBothPointsOrSegmentsFixed(), calculateConstraintError(), carbonCopy(), changeConstraintsLocking(), constraintHasExpression(), ConstraintItem::constraintType(), convertToNURBS(), ConstraintItem::data(), delAllExternal(), delConstraint(), delConstraintOnPoint(), delConstraints(), delConstraintsToExternal(), deleteAllConstraints(), deleteAllGeometry(), deleteUnusedInternalGeometry(), delExternal(), delGeometries(), delGeometriesExclusiveList(), delGeometry(), Sketcher::SketchAnalysis::detectMissingEqualityConstraints(), Sketcher::SketchAnalysis::detectMissingPointOnPointConstraints(), diagnoseAdditionalConstraints(), SketcherGui::EditDatumDialog::EditDatumDialog(), SketcherGui::ViewProviderSketch::editDoubleClicked(), evaluateConstraints(), SketcherGui::EditDatumDialog::exec(), execute(), exposeInternalGeometry(), fillet(), getActive(), getCoincidenceGroups(), getConstraintIndices(), getDirectlyCoincidentPoints(), getDriving(), getVirtualSpace(), insertBSplineKnot(), ConstraintItem::isActive(), ConstraintItem::isDimensional(), ConstraintItem::isDriving(), ConstraintItem::isEnforceable(), ConstraintItem::isInVirtualSpace(), SketcherGui::isPointOrSegmentFixed(), migrateSketch(), modifyBSplineKnotMultiplicity(), moveDatumsToEnd(), movePoint(), mustExecute(), SketcherGui::TaskSketcherConstraints::on_listWidgetConstraints_itemChanged(), onChanged(), SketcherGui::ViewProviderSketch::onDelete(), onUndoRedoFinished(), ExpressionDelegate::paint(), port_reversedExternalArcs(), removeAxesAlignment(), renameConstraint(), restoreFinished(), setActive(), setDatum(), setDatumsDriving(), setDriving(), setUpSketch(), setVirtualSpace(), solve(), split(), CmdSketcherConstrainTangent::substituteConstraintCombinations(), CmdSketcherConstrainPointOnObject::substituteConstraintCombinations(), CmdSketcherConstrainCoincident::substituteConstraintCombinations(), SketcherGui::ConstraintView::swapNamedOfSelectedItems(), synchroniseGeometryState(), testDrivingChange(), toggleActive(), toggleDriving(), toggleVirtualSpace(), transferConstraints(), transferFilletConstraints(), trim(), validateConstraints(), validateExpression(), and validateExternalLinks().

◆ ExternalGeometry

◆ FullyConstrained

App::PropertyBool Sketcher::SketchObject::FullyConstrained

Referenced by solve().

◆ Geometry

Part::PropertyGeometryList Sketcher::SketchObject::Geometry

Property.

The Geometry list contains the non-external Part::Geometry objects in the sketch. The list may be accessed directly, or indirectly via getInternalGeometry().

Many of the methods in this class take geoId and posId parameters. A GeoId is a unique identifier for geometry in the Sketch. geoId >= 0 means an index in the Geometry list. geoId < 0 refers to sketch axes and external geometry. posId is a PointPos enum, documented in Constraint.h.

Referenced by addCopy(), addGeometry(), addSymmetric(), carbonCopy(), convertToNURBS(), decreaseBSplineDegree(), deleteAllGeometry(), delGeometriesExclusiveList(), delGeometry(), getCompleteGeometryIndex(), getGeoIdFromCompleteGeometryIndex(), getGeoListFacade(), getGeometryId(), increaseBSplineDegree(), insertBSplineKnot(), migrateSketch(), modifyBSplineKnotMultiplicity(), movePoint(), mustExecute(), onChanged(), setConstruction(), setGeometryId(), solve(), toggleConstruction(), and trim().

◆ noRecomputes

bool Sketcher::SketchObject::noRecomputes

SketchObject can work in two modes: Recompute Mode and noRecomputes Mode.

  • In Recompute Mode, a recompute is necessary after each geometry addition to update the solver DoF (default)
  • In NoRecomputes Mode, no recompute is necessary after a geometry addition. If a recompute is triggered it is just less efficient.

This flag does not regulate whether this object will recompute or not if execute() or a recompute() is actually executed, it just regulates whether the solver is called or not (i.e. whether it relies on the solve of execute for the calculation)

Referenced by delConstraint(), delConstraints(), delConstraintsToExternal(), deleteAllConstraints(), deleteAllGeometry(), delGeometriesExclusiveList(), delGeometry(), extend(), fillet(), moveDatumsToEnd(), setActive(), setDatumsDriving(), setDriving(), setExpression(), split(), SketcherGui::TaskSketcherMessages::TaskSketcherMessages(), toggleActive(), toggleDriving(), and trim().


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