#include <Constraint.h>
Public Member Functions | |
Constraint * | clone (void) const |
Constraint () | |
Constraint (Constraint &&)=delete | |
Constraint * | copy (void) const |
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... | |
Base::Quantity | getPresentationValue () const |
virtual PyObject * | getPyObject (void) override |
This method returns the Python wrapper for a C++ object. More... | |
double | getValue () const |
bool | isDimensional () const |
Constraint & | operator= (const Constraint &a)=delete |
Constraint & | operator= (Constraint &&)=delete |
virtual void | Restore (Base::XMLReader &) override |
This method is used to restore properties from an XML document. More... | |
virtual void | Save (Base::Writer &) const override |
This method is used to save properties to an XML document. More... | |
void | setValue (double newValue) |
virtual | ~Constraint ()=default |
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 Attributes | |
InternalAlignmentType | AlignmentType |
int | First |
PointPos | FirstPos |
int | InternalAlignmentIndex |
bool | isActive |
bool | isDriving |
bool | isInVirtualSpace |
float | LabelDistance |
float | LabelPosition |
std::string | Name |
int | Second |
PointPos | SecondPos |
int | Third |
PointPos | ThirdPos |
ConstraintType | Type |
Static Public Attributes | |
static const int | GeoUndef = -2000 |
Protected Attributes | |
boost::uuids::uuid | tag |
Friends | |
class | PropertyConstraintList |
Additional Inherited Members | |
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 Protected Member Functions inherited from Base::BaseClass | |
static void | initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) |
Constructor & Destructor Documentation
◆ Constraint() [1/2]
Constraint::Constraint | ( | ) |
References tag.
Referenced by clone(), copy(), and getPyObject().
◆ Constraint() [2/2]
|
delete |
◆ ~Constraint()
|
virtualdefault |
Member Function Documentation
◆ clone()
Constraint * Constraint::clone | ( | void | ) | const |
References Constraint().
Referenced by ArchPanel.CommandPanelSheet::Activated(), Sketcher::SketchObject::addConstraint(), Sketcher::SketchObject::delAllExternal(), Sketcher::SketchObject::delExternal(), Sketcher::SketchObject::delGeometry(), Sketcher::SketchObject::modifyBSplineKnotMultiplicity(), Sketcher::SketchObjectPy::renameConstraint(), Sketcher::PropertyConstraintList::set1Value(), Sketcher::PropertyConstraintList::setValue(), and Sketcher::SketchObject::validateExternalLinks().
◆ copy()
Constraint * Constraint::copy | ( | void | ) | const |
References AlignmentType, Constraint(), First, FirstPos, InternalAlignmentIndex, isActive, isDriving, isInVirtualSpace, LabelDistance, LabelPosition, Name, Second, SecondPos, Third, ThirdPos, and Type.
Referenced by Sketcher::SketchObject::addCopy(), Sketcher::SketchObject::addSymmetric(), and Sketcher::SketchObject::carbonCopy().
◆ getMemSize()
|
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?
Implements Base::Persistence.
◆ getPresentationValue()
Quantity Constraint::getPresentationValue | ( | ) | const |
References Sketcher::Angle, Sketcher::Diameter, Sketcher::Distance, Sketcher::DistanceX, Sketcher::DistanceY, Base::Quantity::getFormat(), Base::QuantityFormat::option, Sketcher::Radius, Base::Quantity::setFormat(), Base::Quantity::setUnit(), Base::Quantity::setValue(), and Sketcher::SnellsLaw.
Referenced by ConstraintItem::data(), SketcherGui::ViewProviderSketch::draw(), SketcherGui::ViewProviderSketch::getPresentationString(), and Sketcher::PropertyConstraintList::getPyPathValue().
◆ getPyObject()
|
overridevirtual |
This method returns the Python wrapper for a C++ object.
It's in the responsibility of the programmer to do the correct reference counting. Basically there are two ways how to implement that: Either always return a new Python object then reference counting is not a matter or return always the same Python object then the reference counter must be incremented by one. However, it's absolutely forbidden to return always the same Python object without incrementing the reference counter.
The default implementation returns 'None'.
Reimplemented from Base::BaseClass.
References Constraint().
◆ getValue()
double Sketcher::Constraint::getValue | ( | ) | const |
◆ isDimensional()
bool Sketcher::Constraint::isDimensional | ( | ) | const |
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
delete |
◆ Restore()
|
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:
Implements Base::Persistence.
References AlignmentType, First, FirstPos, Base::XMLReader::getAttribute(), Base::XMLReader::getAttributeAsFloat(), Base::XMLReader::getAttributeAsInteger(), Base::XMLReader::hasAttribute(), Sketcher::InternalAlignment, InternalAlignmentIndex, isActive, isDriving, isInVirtualSpace, LabelDistance, LabelPosition, Name, Base::XMLReader::readElement(), Second, SecondPos, Third, ThirdPos, and Sketcher::Undef.
Referenced by Sketcher::PropertyConstraintList::Restore().
◆ Save()
|
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:
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
Implements Base::Persistence.
References AlignmentType, Base::Persistence::encodeAttribute(), First, FirstPos, Base::Writer::ind(), Sketcher::InternalAlignment, InternalAlignmentIndex, isActive, isDriving, isInVirtualSpace, LabelDistance, LabelPosition, Name, Second, SecondPos, Base::Writer::Stream(), Third, and ThirdPos.
◆ setValue()
void Sketcher::Constraint::setValue | ( | double | newValue | ) |
Friends And Related Function Documentation
◆ PropertyConstraintList
|
friend |
Member Data Documentation
◆ AlignmentType
InternalAlignmentType Sketcher::Constraint::AlignmentType |
◆ First
int Sketcher::Constraint::First |
Referenced by Sketcher::Sketch::addConstraint(), Sketcher::SketchObject::addCopy(), Sketcher::SketchObject::addSymmetric(), Sketcher::SketchObject::calculateConstraintError(), Sketcher::SketchObject::carbonCopy(), copy(), ConstraintItem::data(), Sketcher::SketchObject::delExternal(), Sketcher::SketchObject::delGeometry(), SketcherGui::ViewProviderSketch::draw(), Sketcher::SketchObject::evaluateConstraint(), Sketcher::SketchObject::exposeInternalGeometry(), Sketcher::SketchObject::fillet(), ConstraintItem::isEnforceable(), SketcherGui::ViewProviderSketch::moveConstraint(), Sketcher::SketchObject::port_reversedExternalArcs(), Sketcher::ConstraintPy::PyInit(), Sketcher::ConstraintPy::representation(), Restore(), Save(), Sketcher::ConstraintPy::setFirst(), Sketcher::SketchObject::transferConstraints(), Sketcher::SketchObject::trim(), SketcherGui::ViewProviderSketch::updateColor(), and Sketcher::SketchObject::validateExternalLinks().
◆ FirstPos
PointPos Sketcher::Constraint::FirstPos |
Referenced by Sketcher::Sketch::addConstraint(), Sketcher::SketchObject::addCopy(), Sketcher::SketchObject::addSymmetric(), copy(), ConstraintItem::data(), SketcherGui::ViewProviderSketch::draw(), Sketcher::SketchObject::exposeInternalGeometry(), Sketcher::SketchObject::fillet(), SketcherGui::ViewProviderSketch::moveConstraint(), Sketcher::SketchObject::port_reversedExternalArcs(), Sketcher::ConstraintPy::PyInit(), Restore(), Save(), Sketcher::ConstraintPy::setFirstPos(), Sketcher::SketchObject::transferConstraints(), Sketcher::SketchObject::trim(), and SketcherGui::ViewProviderSketch::updateColor().
◆ GeoUndef
|
static |
Referenced by Sketcher::Sketch::addAngleAtPointConstraint(), Sketcher::Sketch::addBSpline(), Sketcher::Sketch::addConstraint(), Sketcher::SketchObject::addCopy(), Sketcher::SketchObject::addSymmetric(), Sketcher::SketchObject::calculateConstraintError(), Sketcher::SketchObject::carbonCopy(), ConstraintItem::data(), Sketcher::SketchObject::delAllExternal(), Sketcher::SketchObject::delConstraintOnPoint(), Sketcher::SketchObject::delConstraintsToExternal(), Sketcher::SketchObject::delExternal(), Sketcher::SketchAnalysis::detectMissingVerticalHorizontalConstraints(), Sketcher::SketchObject::evaluateConstraint(), Sketcher::Sketch::getBlockedGeometry(), Sketcher::SketchObject::getGeoVertexIndex(), Sketcher::SketchObjectPy::isPointOnCurve(), SketcherGui::ViewProviderSketch::mouseButtonPressed(), SketcherGui::ViewProviderSketch::mouseMove(), Sketcher::ConstraintPy::PyInit(), Sketcher::ConstraintPy::representation(), Sketcher::SketchObject::toggleDriving(), Sketcher::SketchObject::trim(), and Sketcher::SketchObject::validateExternalLinks().
◆ InternalAlignmentIndex
int Sketcher::Constraint::InternalAlignmentIndex |
◆ isActive
bool Sketcher::Constraint::isActive |
◆ isDriving
bool Sketcher::Constraint::isDriving |
Referenced by Sketcher::Sketch::addConstraint(), copy(), ConstraintItem::data(), SketcherGui::EditDatumDialog::exec(), ExpressionDelegate::paint(), Restore(), Save(), Sketcher::SketchObject::setDatumsDriving(), Sketcher::SketchObject::setDriving(), Sketcher::SketchObject::toggleDriving(), SketcherGui::ViewProviderSketch::updateColor(), and Sketcher::SketchObject::validateExpression().
◆ isInVirtualSpace
bool Sketcher::Constraint::isInVirtualSpace |
Referenced by copy(), Restore(), Save(), Sketcher::SketchObject::setVirtualSpace(), and Sketcher::SketchObject::toggleVirtualSpace().
◆ LabelDistance
float Sketcher::Constraint::LabelDistance |
Referenced by CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), copy(), SketcherGui::ViewProviderSketch::draw(), SketcherGui::ViewProviderSketch::moveConstraint(), Restore(), and Save().
◆ LabelPosition
float Sketcher::Constraint::LabelPosition |
◆ Name
std::string Sketcher::Constraint::Name |
◆ Second
int Sketcher::Constraint::Second |
Referenced by Sketcher::Sketch::addConstraint(), Sketcher::SketchObject::addCopy(), Sketcher::SketchObject::addSymmetric(), Sketcher::SketchObject::calculateConstraintError(), Sketcher::SketchObject::carbonCopy(), copy(), ConstraintItem::data(), Sketcher::SketchObject::delExternal(), Sketcher::SketchObject::delGeometry(), SketcherGui::ViewProviderSketch::draw(), Sketcher::SketchObject::evaluateConstraint(), Sketcher::SketchObject::exposeInternalGeometry(), Sketcher::SketchObject::fillet(), ConstraintItem::isEnforceable(), SketcherGui::ViewProviderSketch::moveConstraint(), Sketcher::SketchObject::port_reversedExternalArcs(), Sketcher::ConstraintPy::PyInit(), Sketcher::ConstraintPy::representation(), Restore(), Save(), Sketcher::ConstraintPy::setSecond(), Sketcher::SketchObject::transferConstraints(), Sketcher::SketchObject::trim(), SketcherGui::ViewProviderSketch::updateColor(), and Sketcher::SketchObject::validateExternalLinks().
◆ SecondPos
PointPos Sketcher::Constraint::SecondPos |
Referenced by Sketcher::Sketch::addConstraint(), Sketcher::SketchObject::addCopy(), Sketcher::SketchObject::addSymmetric(), copy(), ConstraintItem::data(), SketcherGui::ViewProviderSketch::draw(), Sketcher::SketchObject::exposeInternalGeometry(), Sketcher::SketchObject::fillet(), SketcherGui::ViewProviderSketch::moveConstraint(), Sketcher::SketchObject::port_reversedExternalArcs(), Sketcher::ConstraintPy::PyInit(), Restore(), Save(), Sketcher::ConstraintPy::setSecondPos(), Sketcher::SketchObject::transferConstraints(), Sketcher::SketchObject::trim(), and SketcherGui::ViewProviderSketch::updateColor().
◆ tag
|
protected |
◆ Third
int Sketcher::Constraint::Third |
Referenced by Sketcher::Sketch::addConstraint(), Sketcher::SketchObject::addCopy(), Sketcher::SketchObject::addSymmetric(), Sketcher::SketchObject::calculateConstraintError(), Sketcher::SketchObject::carbonCopy(), copy(), ConstraintItem::data(), Sketcher::SketchObject::delExternal(), Sketcher::SketchObject::delGeometry(), SketcherGui::ViewProviderSketch::draw(), Sketcher::SketchObject::evaluateConstraint(), ConstraintItem::isEnforceable(), SketcherGui::ViewProviderSketch::moveConstraint(), Sketcher::SketchObject::port_reversedExternalArcs(), Sketcher::ConstraintPy::PyInit(), Restore(), Save(), Sketcher::ConstraintPy::setThird(), and Sketcher::SketchObject::validateExternalLinks().
◆ ThirdPos
PointPos Sketcher::Constraint::ThirdPos |
Referenced by Sketcher::Sketch::addConstraint(), Sketcher::SketchObject::addSymmetric(), copy(), ConstraintItem::data(), SketcherGui::ViewProviderSketch::draw(), SketcherGui::ViewProviderSketch::moveConstraint(), Sketcher::SketchObject::port_reversedExternalArcs(), Sketcher::ConstraintPy::PyInit(), Restore(), Save(), and Sketcher::ConstraintPy::setThirdPos().
◆ Type
ConstraintType Sketcher::Constraint::Type |
Referenced by ArchPanel.CommandPanelSheet::Activated(), Sketcher::SketchObject::addConstraint(), Sketcher::Sketch::addConstraint(), Sketcher::SketchObject::addCopy(), ArchStructure.StructSelectionObserver::addSelection(), Sketcher::SketchObject::addSymmetric(), ArchSite.Compass::buildCoordinates(), copy(), ConstraintItem::data(), SketcherGui::ViewProviderSketch::draw(), Sketcher::SketchObject::evaluateConstraint(), SketcherGui::EditDatumDialog::exec(), Sketcher::SketchObject::exposeInternalGeometry(), Sketcher::SketchObject::fillet(), Sketcher::SketchObjectPy::getDatum(), SketcherGui::ViewProviderSketch::iconTypeFromConstraint(), ArchSchedule.CommandArchSchedule::IsActive(), ArchAxis.CommandArchGrid::IsActive(), ConstraintItem::isEnforceable(), SketcherGui::ViewProviderSketch::moveConstraint(), Sketcher::ConstraintPy::PyInit(), Sketcher::PropertyConstraintList::Restore(), Sketcher::SketchObject::transferConstraints(), Sketcher::SketchObject::trim(), and SketcherGui::ViewProviderSketch::updateColor().
The documentation for this class was generated from the following files:
- src/Mod/Sketcher/App/Constraint.h
- src/Mod/Sketcher/App/Constraint.cpp