Sketcher::SketchObject Class Reference

#include <SketchObject.h>

Public Member Functions

 SketchObject ()
 
 ~SketchObject ()
 
- Public Member Functions inherited from Part::Part2DObject
 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...
 
Base::Placement globalPlacement () const
 Calculates the placement in the global reference coordinate system. More...
 
virtual ~GeoFeature ()
 
- Public Member Functions inherited from App::DocumentObject
virtual App::PropertyaddDynamicProperty (const char *type, const char *name=0, const char *group=0, const char *doc=0, short attr=0, bool ro=false, bool hidden=false) override
 
virtual bool adjustRelativeLinks (const std::set< App::DocumentObject * > &inList, std::set< App::DocumentObject * > *visited=0)
 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 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=0) 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=0, 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...
 
unsigned long getStatus () const
 return the status bits More...
 
const char * getStatusString (void) const
 get the status Message 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 * 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
 
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=0, std::string *childName=0, const char **subElement=0, PyObject **pyObj=0, Base::Matrix4D *mat=0, 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 int setElementVisible (const char *element, bool visible)
 Child element handling. More...
 
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
 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::PropertygetDynamicPropertyByName (const char *name) const
 
DynamicProperty::PropData getDynamicPropertyData (const Property *prop) const
 
virtual std::vector< std::string > getDynamicPropertyNames () const
 
const char * getPropertyPrefix () const
 
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...
 
 PropertyContainer ()
 A constructor. 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 Base::Type getTypeId (void) const
 
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 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...
 
bool isDerivedFrom (const Type type) const
 
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 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 int extensionSetElementVisible (const char *, bool)
 
App::DocumentObjectgetExtendedObject ()
 
const App::DocumentObjectgetExtendedObject () const
 
virtual const char * getViewProviderExtensionName (void) const
 returns the type name of the ViewProviderExtension which is automatically attached to the viewprovider object when it is initiated 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 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 delConstraint (int ConstrId)
 delete constraint More...
 
int delConstraints (std::vector< int > ConstrIds, bool updategeometry=true)
 
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)
 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...
 
const Part::GeometrygetGeometry (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...
 
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 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 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, int endPoint)
 extend a curve More...
 
int addSymmetric (const std::vector< int > &geoIdList, int refGeoId, Sketcher::PointPos refPosId=Sketcher::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 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...
 
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)
 
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 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=0) 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=0) const
 
bool isPerformingInternalTransaction () const
 
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, boost::shared_ptr< App::Expression > expr) override
 
std::string validateExpression (const App::ObjectIdentifier &path, boost::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 ()
 
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 GeoId, const Base::Vector3d &point, int &GeoId1, Base::Vector3d &intersect1, int &GeoId2, Base::Vector3d &intersect2)
 calculate the points where a curve with index GeoId 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=0, bool needSubElement=false, Base::Matrix4D *pmat=0, App::DocumentObject **owner=0, 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=0, bool needSubElement=false, Base::Matrix4D *pmat=0, App::DocumentObject **owner=0, bool resolveLink=true, bool transform=true, bool noElementMap=false)
 
static void clearShapeCache ()
 
static App::DocumentObjectgetShapeOwner (const App::DocumentObject *obj, const char *subname=0)
 
static bool hasShapeOwner (const App::DocumentObject *obj, const char *subname=0)
 
- 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=0, const char **element=0, GeoFeature **geo=0)
 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 (void)
 
static Type getClassTypeId (void)
 
static void init (void)
 
- 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
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 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...
 
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
 
- 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=0)
 
- Protected Attributes inherited from App::DocumentObject
std::string oldLabel
 Old label; used for renaming expressions. More...
 
const std::string * pcNameInDocument
 
Py::Object 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::Object 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

verify and accept the assigned geometry

Reimplemented from Part::Part2DObject.

◆ addConstraint()

◆ 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(), 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, Sketcher::Constraint::GeoUndef, Part::GeomConic::getCenter(), Part::GeomArcOfConic::getCenter(), Base::Persistence::getClassTypeId(), Part::GeomLineSegment::getEndPoint(), Sketcher::GeometryFacade::getFacade(), draftguitools.gui_tool_utils::getPoint, Part::GeomPoint::getPoint(), Part::GeomBSplineCurve::getPoles(), Part::GeomBoundedCurve::getStartPoint(), Part::GeomLineSegment::getStartPoint(), Part::GeomArcOfConic::getStartPoint(), Base::Persistence::getTypeId(), 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::start, Sketcher::Constraint::Third, Sketcher::Constraint::Type, and Sketcher::Weight.

Referenced by Sketcher::SketchObjectPy::addCopy(), Sketcher::SketchObjectPy::addMove(), and Sketcher::SketchObjectPy::addRectangularArray().

◆ addCopyOfConstraints()

int SketchObject::addCopyOfConstraints ( const SketchObject orig)

◆ addExternal()

int SketchObject::addExternal ( App::DocumentObject Obj,
const char *  SubName 
)

◆ addGeometry() [1/2]

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

Add geometry to a sketch.

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

References Part::Geometry::copy(), Base::Persistence::getClassTypeId(), Base::Persistence::getTypeId(), draftfunctions.move::move(), and Sketcher::GeometryFacade::setConstruction().

Referenced by Sketcher::SketchObjectPy::addGeometry().

◆ 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 Base::Persistence::getClassTypeId(), draftfunctions.move::move(), and Sketcher::GeometryFacade::setConstruction().

◆ addSymmetric()

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

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

References Sketcher::Angle, Sketcher::Coincident, Base::Console(), 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(), Sketcher::Constraint::GeoUndef, Part::GeomConic::getCenter(), Part::GeomArcOfConic::getCenter(), Base::Persistence::getClassTypeId(), Part::GeomBoundedCurve::getEndPoint(), Part::GeomLineSegment::getEndPoint(), Part::GeomArcOfConic::getEndPoint(), Sketcher::GeometryFacade::getFacade(), Part::GeomArcOfParabola::getFocus(), 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(), draftguitools.gui_tool_utils::getPoint, Part::GeomPoint::getPoint(), Part::GeomBSplineCurve::getPoles(), Part::GeomArcOfEllipse::getRange(), Part::GeomArcOfHyperbola::getRange(), Part::GeomArcOfParabola::getRange(), Part::GeomBoundedCurve::getStartPoint(), Part::GeomLineSegment::getStartPoint(), Part::GeomArcOfConic::getStartPoint(), Base::Persistence::getTypeId(), Sketcher::GeoEnum::HAxis, 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(), Part::GeomArcOfConic::setXAxisDir(), Sketcher::start, Sketcher::Tangent, Sketcher::Constraint::Third, Sketcher::Constraint::ThirdPos, Sketcher::Constraint::Type, Sketcher::GeoEnum::VAxis, Sketcher::Vertical, Base::Vector3< _Precision >::x, and Base::Vector3< _Precision >::y.

Referenced by Sketcher::SketchObjectPy::addSymmetric().

◆ 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

◆ 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

◆ 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

◆ 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(), Base::ConsoleSingleton::Log(), draftfunctions.move::move(), Sketcher::Perpendicular, and Sketcher::Tangent.

◆ constraintHasExpression()

bool SketchObject::constraintHasExpression ( int  constrid) const

returns whether a given constraint has an associated expression or not

References App::PropertyExpressionEngine::ExpressionInfo::expression.

◆ constraintsRemoved()

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

Referenced by SketchObject().

◆ constraintsRenamed()

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

References App::GetApplication().

Referenced by SketchObject().

◆ convertToNURBS()

bool SketchObject::convertToNURBS ( int  GeoId)

Approximates the given geometry with a B-spline.

Parameters
GeoId- the geometry to approximate
delgeoid- if true in addition to the unused internal geometry also deletes the GeoId geometry
Return values
bool- returns true if the approximation succeeded, or false if it did not succeed.

References Sketcher::Coincident, Base::Console(), Base::ConsoleSingleton::Error(), Base::Persistence::getClassTypeId(), Part::GeomCurve::getFirstParameter(), Part::GeomCurve::getLastParameter(), Base::Persistence::getTypeId(), Base::BaseClass::isDerivedFrom(), Part::GeomArcOfConic::isReversed(), Sketcher::mid, draftfunctions.move::move(), and Part::GeomCurve::toNurbs().

◆ 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 Base::Console(), Base::ConsoleSingleton::Error(), Base::Persistence::getClassTypeId(), and Base::Persistence::getTypeId().

Referenced by Sketcher::SketchObjectPy::decreaseBSplineDegree().

◆ delAllExternal()

◆ delConstraint()

int SketchObject::delConstraint ( int  ConstrId)

delete constraint

References draftfunctions.move::move().

◆ 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 
)

◆ delConstraintsToExternal()

int SketchObject::delConstraintsToExternal ( )

Deletes all constraints referencing an external geometry.

References Sketcher::Constraint::GeoUndef, draftfunctions.move::move(), and Sketcher::GeoEnum::RefExt.

Referenced by PartDesignGui::TaskFeaturePick::makeCopy().

◆ deleteAllConstraints()

int SketchObject::deleteAllConstraints ( )

deletes all the constraints of the sketch

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

◆ deleteAllGeometry()

int SketchObject::deleteAllGeometry ( )

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

◆ deleteUnusedInternalGeometry()

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

Deletes all unused (not further constrained) internal geometry.

Parameters
GeoId- the geometry having the internal geometry to delete
delgeoid- if true in addition to the unused internal geometry also deletes the GeoId geometry
Return values
int- returns -1 on error, otherwise the number of deleted elements

References Sketcher::BSplineControlPoint, Sketcher::BSplineKnotPoint, Part::GeomBSplineCurve::countKnots(), Part::GeomBSplineCurve::countPoles(), Sketcher::EllipseFocus1, Sketcher::EllipseFocus2, Sketcher::EllipseMajorDiameter, Sketcher::EllipseMinorDiameter, Sketcher::end, Sketcher::Equal, Base::Persistence::getClassTypeId(), Base::Persistence::getTypeId(), Sketcher::HyperbolaFocus, Sketcher::HyperbolaMajor, Sketcher::HyperbolaMinor, Sketcher::InternalAlignment, Sketcher::mid, Sketcher::ParabolaFocus, and Sketcher::start.

◆ delExternal()

int SketchObject::delExternal ( int  ExtGeoId)

◆ delGeometries()

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

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

References DraftVecUtils::find(), and Sketcher::InternalAlignment.

◆ delGeometriesExclusiveList()

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

Deletes just the GeoIds indicated, it does not look for internal geometry.

References Sketcher::Constraint::First, Sketcher::mid, draftfunctions.move::move(), Sketcher::Constraint::Second, Sketcher::start, and Sketcher::Constraint::Third.

◆ delGeometry()

int SketchObject::delGeometry ( int  GeoId,
bool  deleteinternalgeo = true 
)

Deletes indicated geometry (by geoid).

Parameters
GeoId- the geometry to delete
deleteinternalgeo- if true deletes the associated and unconstraint internal geometry, otherwise deletes only the GeoId
Return values
int- 0 if successful

References Base::Persistence::getClassTypeId(), Base::Persistence::getTypeId(), Sketcher::mid, draftfunctions.move::move(), and Sketcher::start.

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

◆ 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)

◆ evaluateConstraint()

◆ evaluateConstraints()

bool SketchObject::evaluateConstraints ( ) const

Check for constraints with invalid indexes.

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

◆ evaluateSupport()

bool SketchObject::evaluateSupport ( void  )

◆ execute()

◆ exposeInternalGeometry()

int SketchObject::exposeInternalGeometry ( int  GeoId)

Exposes all internal geometry of an object supporting internal geometry.

Returns
-1 on error

References Sketcher::Constraint::AlignmentType, Sketcher::BSplineControlPoint, Sketcher::BSplineKnotPoint, Sketcher::Coincident, 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(), Part::GeomArcOfParabola::getFocus(), 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::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.

◆ 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 draftgeoutils.fillets::fillet(), Base::Persistence::getClassTypeId(), Part::GeomLineSegment::getEndPoint(), Part::GeomLineSegment::getStartPoint(), and Base::Persistence::getTypeId().

Referenced by Sketcher::SketchObjectPy::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 Part::GeomCurve::closestParameter(), Sketcher::Coincident, Base::Console(), Part::createFilletGeometry(), Base::Vector3< _Precision >::Cross(), 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(), draftguitools.gui_tool_utils::getPoint, Part::GeomLineSegment::getStartPoint(), Base::Persistence::getTypeId(), Part::GeomCurve::intersect(), Part::GeomTrimmedCurve::intersectBasisCurves(), Base::BaseClass::isDerivedFrom(), Base::Vector3< _Precision >::Length(), Base::ConsoleSingleton::Log(), Sketcher::none, Sketcher::Perpendicular, Part::GeomCurve::pointAtParameter(), Base::Vector3< _Precision >::ProjectToLine(), draftutils.translate::QT_TRANSLATE_NOOP, Sketcher::Constraint::Second, Sketcher::Constraint::SecondPos, Sketcher::start, Part::GeomCurve::tangent(), Sketcher::Tangent, 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

◆ getAllCoincidentPoints()

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

◆ getAxis()

Base::Axis SketchObject::getAxis ( int  axId) const
overridevirtual

retrieves an axis iterating through the construction lines of the sketch (indices start at 0)

Reimplemented from Part::Part2DObject.

References Part::Part2DObject::getAxis(), Base::Persistence::getClassTypeId(), Sketcher::GeometryFacade::getConstruction(), Part::GeomLineSegment::getEndPoint(), and Part::GeomLineSegment::getStartPoint().

◆ 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(), and Sketcher::GeometryFacade::getConstruction().

◆ 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

retrieves a vector containing both normal and external Geometry (including the sketch axes)

Referenced by SketcherGui::ViewProviderSketch::doBoxSelection(), and SketcherGui::DrawSketchHandler::seekAutoConstraint().

◆ getDirectlyCoincidentPoints() [1/2]

void SketchObject::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)

References Sketcher::Coincident.

Referenced by SketcherGui::FilletSelection::allow(), and DrawSketchHandlerFillet::releaseButton().

◆ 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

◆ 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

returns the number of external Geometry entities

Referenced by SketcherGui::ViewProviderSketch::doBoxSelection(), and isCarbonCopyAllowed().

◆ getGeometry()

const Part::Geometry * 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,

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(), CmdSketcherConstrainAngle::activated(), CmdSketcherConstrainEqual::activated(), CmdSketcherConstrainSymmetric::activated(), SketcherGui::FilletSelection::allow(), SketcherGui::TrimmingSelection::allow(), SketcherGui::ExtendSelection::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(), CmdSketcherConstrainAngle::applyConstraint(), CmdSketcherConstrainEqual::applyConstraint(), CmdSketcherConstrainSymmetric::applyConstraint(), SketcherGui::DrawSketchHandler::createAutoConstraints(), SketcherGui::isBsplinePole(), DrawSketchHandlerExtend::mouseMove(), DrawSketchHandlerLineSet::pressButton(), DrawSketchHandlerLineSet::registerPressedKey(), DrawSketchHandlerFillet::releaseButton(), DrawSketchHandlerTrimming::releaseButton(), DrawSketchHandlerExtend::releaseButton(), SketcherGui::DrawSketchHandler::seekAutoConstraint(), and 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(), Sketcher::none, Sketcher::SolverGeometryExtension::NotFullyConstraint, and Sketcher::start.

Referenced by Sketcher::SketchObjectPy::getGeometryWithDependentParameters().

◆ getGeoVertexIndex()

void SketchObject::getGeoVertexIndex ( int  VertexId,
int &  GeoId,
PointPos PosId 
) const

◆ 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

gets DoF of last solver execution

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

◆ getLastHasConflicts()

bool Sketcher::SketchObject::getLastHasConflicts ( ) const

gets HasConflicts status of last solver execution

Referenced by CmdSketcherConstrainBlock::activated(), and Sketcher::SketchAnalysis::solvesketch().

◆ getLastHasMalformedConstraints()

bool Sketcher::SketchObject::getLastHasMalformedConstraints ( ) const

gets HasMalformedConstraints status of last solver execution

◆ getLastHasPartialRedundancies()

bool Sketcher::SketchObject::getLastHasPartialRedundancies ( ) const

gets HasRedundancies status of last solver execution

◆ getLastHasRedundancies()

bool Sketcher::SketchObject::getLastHasRedundancies ( ) const

gets HasRedundancies status of last solver execution

Referenced by CmdSketcherConstrainBlock::activated(), and Sketcher::SketchAnalysis::solvesketch().

◆ 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

◆ 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

◆ getPyObject()

PyObject * SketchObject::getPyObject ( void  )
overridevirtual

getPyObject returns the Python binding object

Returns
the Python binding object

Reimplemented from Part::Feature.

◆ 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

◆ hasConflicts()

int SketchObject::hasConflicts ( void  ) const

returns non zero if the sketch contains conflicting constraints

Referenced by SketcherGui::EditDatumDialog::exec().

◆ 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(), Base::Persistence::getClassTypeId(), Base::Persistence::getTypeId(), and draftfunctions.move::move().

◆ 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().

◆ 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 = 0 
) const

Return true if this object is allowed as external geometry for the sketch.

rsn argument receives the reason for disallowing.

References Base::Console(), Part::BodyBase::findBodyOf(), App::Part::getPartOfObject(), and Base::ConsoleSingleton::Warning().

Referenced by Sketcher::SketchObjectPy::addExternal(), SketcherGui::ExternalSelection::allow(), and Sketcher::SketchObjectPy::carbonCopy().

◆ 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(), and Base::Persistence::getTypeId().

◆ 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(), Part::GeomBSplineCurve::countKnots(), Part::GeomBSplineCurve::countPoles(), Base::ConsoleSingleton::Error(), Base::Persistence::getClassTypeId(), Part::GeomBSplineCurve::getDegree(), Part::GeomBSplineCurve::getKnots(), Part::GeomBSplineCurve::getMultiplicity(), Part::GeomBSplineCurve::getPoles(), Base::Persistence::getTypeId(), Sketcher::InternalAlignment, Sketcher::Constraint::InternalAlignmentIndex, draftfunctions.move::move(), and draftutils.translate::QT_TRANSLATE_NOOP.

◆ moveDatumsToEnd()

int SketchObject::moveDatumsToEnd ( void  )

Move Dimensional constraints at the end of the properties array.

References draftfunctions.move::move().

◆ movePoint()

int SketchObject::movePoint ( int  GeoId,
PointPos  PosId,
const Base::Vector3d toPoint,
bool  relative = false,
bool  updateGeoBeforeMoving = false 
)

move this point to a new location and solve

Referenced by Sketcher::SketchObjectPy::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.

◆ onChanged()

◆ onDocumentRestored()

void SketchObject::onDocumentRestored ( )
overrideprotectedvirtual

get called after a document has been fully restored

Reimplemented from App::DocumentObject.

References App::DocumentObject::onDocumentRestored().

◆ onUndoRedoFinished()

void SketchObject::onUndoRedoFinished ( )
overrideprotectedvirtual

get called after an undo/redo transaction is finished

Reimplemented from App::DocumentObject.

◆ 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(), Sketcher::end, Sketcher::Constraint::First, Sketcher::Constraint::FirstPos, Base::Persistence::getClassTypeId(), Part::GeomArcOfConic::isReversed(), Base::ConsoleSingleton::Log(), draftfunctions.move::move(), Sketcher::none, Sketcher::GeoEnum::RefExt, Sketcher::Constraint::Second, Sketcher::Constraint::SecondPos, Sketcher::start, Sketcher::Constraint::Third, and Sketcher::Constraint::ThirdPos.

◆ rebuildExternalGeometry()

◆ rebuildVertexIndex()

void SketchObject::rebuildVertexIndex ( void  )

◆ 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");
}
The XML reader class This is an important helper class for the store and retrieval system of objects ...
Definition: Reader.h:118
void readElement(const char *ElementName=0)
read until a start element is found (<name>) or start-end element (<name/>) (with special name if giv...
Definition: Reader.cpp:240
double getAttributeAsFloat(const char *AttrName) const
return the named attribute as a double floating point (does type checking)
Definition: Reader.cpp:158

Reimplemented from Part::Part2DObject.

References Part::Part2DObject::Restore().

◆ restoreFinished()

void SketchObject::restoreFinished ( )
overrideprotectedvirtual

This method is used at the end of restoreFromStream() after all data files have been read in.

A subclass can set up some internals. The default implementation does nothing.

Reimplemented from Base::Persistence.

◆ retrieveSolverDiagnostics()

void SketchObject::retrieveSolverDiagnostics ( )
protected

◆ 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().

◆ setActive()

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

set the driving status of this constraint and solve

References Sketcher::Constraint::clone(), Sketcher::Constraint::isActive, and draftfunctions.move::move().

◆ setAllowOtherBody()

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

◆ setAllowUnaligned()

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

◆ setConstruction()

int SketchObject::setConstruction ( int  GeoId,
bool  on 
)

◆ setDatum()

int SketchObject::setDatum ( int  ConstrId,
double  Datum 
)

◆ setDatumsDriving()

int SketchObject::setDatumsDriving ( bool  isdriving)

Make all dimensionals Driving/non-Driving.

References draftfunctions.move::move().

◆ setDriving()

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

set the driving status of this constraint and solve

References draftfunctions.move::move().

◆ setExpression()

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

Reimplemented from App::DocumentObject.

◆ setGeometryId()

int SketchObject::setGeometryId ( int  GeoId,
long  id 
)

◆ 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)

◆ setUpSketch()

int SketchObject::setUpSketch ( )

sets the geometry of sketchObject as the solvedsketch geometry returns the DoF of such a geometry.

Referenced by Sketcher::SketchObjectPy::addConstraint(), and Sketcher::SketchAnalysis::solvesketch().

◆ setVirtualSpace()

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

set the driving status of this constraint and solve

References Sketcher::Constraint::clone(), Sketcher::Constraint::isInVirtualSpace, and draftfunctions.move::move().

◆ 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(), Base::ConsoleSingleton::Error(), GCS::Failed, and Base::ConsoleSingleton::Warning().

Referenced by CmdSketcherConstrainCoincident::activated(), CmdSketcherConstrainTangent::activated(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), Sketcher::SketchObjectPy::addConstraint(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), initTemporaryMove(), femsolver.run.Machine::reset(), Sketcher::SketchObjectPy::solve(), and Sketcher::SketchAnalysis::solvesketch().

◆ 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

◆ synchroniseGeometryState()

void SketchObject::synchroniseGeometryState ( )
protected

◆ testDrivingChange()

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

◆ toggleActive()

int SketchObject::toggleActive ( int  ConstrId)

toggle the driving status of this constraint

References Sketcher::Constraint::clone(), Sketcher::Constraint::isActive, and draftfunctions.move::move().

◆ toggleConstruction()

int SketchObject::toggleConstruction ( int  GeoId)

◆ toggleDriving()

int SketchObject::toggleDriving ( int  ConstrId)

◆ toggleVirtualSpace()

int SketchObject::toggleVirtualSpace ( int  ConstrId)

toggle the driving status of this constraint

References Sketcher::Constraint::clone(), Sketcher::Constraint::isInVirtualSpace, and draftfunctions.move::move().

◆ transferConstraints()

int SketchObject::transferConstraints ( int  fromGeoId,
PointPos  fromPosId,
int  toGeoId,
PointPos  toPosId 
)

◆ 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 Sketcher::Coincident, Sketcher::Distance, Sketcher::DistanceX, Sketcher::DistanceY, Sketcher::Equal, Sketcher::Constraint::First, Sketcher::Constraint::FirstPos, Base::Persistence::getClassTypeId(), draftguitools.gui_tool_utils::getPoint, Base::Persistence::getTypeId(), Sketcher::Horizontal, draftfunctions.move::move(), Sketcher::none, Sketcher::PointOnObject, Sketcher::Constraint::Second, Sketcher::Constraint::SecondPos, Sketcher::SnellsLaw, Sketcher::start, Sketcher::Symmetric, Sketcher::Constraint::Type, and Sketcher::Vertical.

◆ trim()

int SketchObject::trim ( int  geoId,
const Base::Vector3d point 
)

trim a curve

References Sketcher::Constraint::AlignmentType, Sketcher::Coincident, Sketcher::EllipseMajorDiameter, Sketcher::EllipseMinorDiameter, Sketcher::end, Sketcher::Equal, Sketcher::Constraint::First, Sketcher::Constraint::FirstPos, Base::fmod(), Sketcher::Constraint::GeoUndef, Part::GeomArcOfConic::getAngleXU(), Part::GeomArcOfConic::getCenter(), Base::Persistence::getClassTypeId(), Part::GeomLineSegment::getEndPoint(), Part::GeomArcOfEllipse::getMajorAxisDir(), Part::GeomArcOfEllipse::getMajorRadius(), Part::GeomArcOfHyperbola::getMajorRadius(), Part::GeomArcOfEllipse::getMinorRadius(), Part::GeomArcOfHyperbola::getMinorRadius(), draftguitools.gui_tool_utils::getPoint, Part::GeomArcOfCircle::getRange(), Part::GeomArcOfEllipse::getRange(), Part::GeomArcOfHyperbola::getRange(), Part::GeomLineSegment::getStartPoint(), Base::Persistence::getTypeId(), Sketcher::InternalAlignment, Sketcher::mid, draftfunctions.move::move(), Sketcher::none, Sketcher::PointOnObject, Sketcher::Constraint::Second, Sketcher::Constraint::SecondPos, Part::GeomArcOfConic::setCenter(), Part::GeomArcOfEllipse::setMajorAxisDir(), Part::GeomArcOfEllipse::setMajorRadius(), Part::GeomArcOfEllipse::setMinorRadius(), Part::GeomArcOfCircle::setRadius(), Part::GeomArcOfCircle::setRange(), Part::GeomArcOfEllipse::setRange(), Part::GeomArcOfHyperbola::setRange(), Sketcher::start, Sketcher::Tangent, Sketcher::Constraint::Type, Base::Vector3< _Precision >::x, and Base::Vector3< _Precision >::y.

Referenced by Sketcher::SketchObjectPy::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()

void SketchObject::validateConstraints ( )

Remove constraints with invalid indexes.

References draftfunctions.move::move().

◆ validateExpression()

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

References Sketcher::Constraint::isDriving.

Referenced by SketchObject().

◆ validateExternalLinks()

Member Data Documentation

◆ Constraints

Sketcher::PropertyConstraintList Sketcher::SketchObject::Constraints

Referenced by CmdSketcherConstrainHorizontal::activated(), CmdSketcherConstrainVertical::activated(), CmdSketcherConstrainLock::activated(), CmdSketcherConstrainBlock::activated(), CmdSketcherConstrainCoincident::activated(), CmdSketcherConstrainDistance::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainTangent::activated(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainAngle::activated(), Sketcher::SketchObjectPy::addConstraint(), addCopyOfConstraints(), CmdSketcherConstrainHorizontal::applyConstraint(), CmdSketcherConstrainVertical::applyConstraint(), CmdSketcherConstrainLock::applyConstraint(), CmdSketcherConstrainDistance::applyConstraint(), CmdSketcherConstrainDistanceX::applyConstraint(), CmdSketcherConstrainDistanceY::applyConstraint(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), CmdSketcherConstrainAngle::applyConstraint(), SketcherGui::areAllPointsOrSegmentsFixed(), SketcherGui::areBothPointsOrSegmentsFixed(), carbonCopy(), Sketcher::SketchAnalysis::detectMissingEqualityConstraints(), Sketcher::SketchAnalysis::detectMissingPointOnPointConstraints(), SketcherGui::EditDatumDialog::EditDatumDialog(), SketcherGui::EditDatumDialog::exec(), Sketcher::SketchObjectPy::getDatum(), Sketcher::SketchObjectPy::getIndexByName(), SketcherGui::isPointOrSegmentFixed(), SketcherGui::TaskSketcherConstrains::on_listWidgetConstraints_itemChanged(), ExpressionDelegate::paint(), DrawSketchHandlerBSpline::releaseButton(), Sketcher::SketchObjectPy::renameConstraint(), Sketcher::SketchObjectPy::setDatum(), and SketcherGui::ConstraintView::swapNamedOfSelectedItems().

◆ ExternalGeometry

App ::PropertyLinkSubList Sketcher::SketchObject::ExternalGeometry

Referenced by carbonCopy().

◆ FullyConstrained

App ::PropertyBool Sketcher::SketchObject::FullyConstrained

◆ 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 Sketcher::SketchObjectPy::getGeometryFacadeList(), and Sketcher::SketchObjectPy::setGeometryFacadeList().

◆ 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 CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), and SketcherGui::TaskSketcherMessages::TaskSketcherMessages().


The documentation for this class was generated from the following files:
  • Sources/FreeCAD/src/Mod/Sketcher/App/SketchObject.h
  • Sources/FreeCAD/src/Mod/Sketcher/App/SketchObject.cpp