#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 |
std::string | internalAlignmentTypeToString () 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) |
void | substituteIndex (int fromGeoId, int toGeoId) |
utility function to swap the index in First/Second/Third of the provided constraint from the fromGeoId GeoId to toGeoId More... | |
std::string | typeToString () const |
virtual | ~Constraint ()=default |
Public Member Functions inherited from Base::Persistence | |
void | dumpToStream (std::ostream &stream, int compression) |
virtual unsigned int | getMemSize () const =0 |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More... | |
virtual Base::Type | getTypeId (void) const |
virtual void | Restore (XMLReader &)=0 |
This method is used to restore properties from an XML document. More... | |
virtual void | RestoreDocFile (Reader &) |
This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data. More... | |
void | restoreFromStream (std::istream &stream) |
virtual void | Save (Writer &) const =0 |
This method is used to save properties to an XML document. More... | |
virtual void | SaveDocFile (Writer &) const |
This method is used to save large amounts of data to a binary file. More... | |
Public Member Functions inherited from Base::BaseClass | |
BaseClass () | |
Construction. More... | |
BaseClass (const BaseClass &)=default | |
virtual PyObject * | getPyObject () |
This method returns the Python wrapper for a C++ object. More... | |
virtual Type | getTypeId () const |
bool | isDerivedFrom (const Type type) const |
BaseClass & | operator= (const BaseClass &)=default |
virtual void | setPyObject (PyObject *) |
virtual | ~BaseClass () |
Destruction. More... | |
Static Public Member Functions | |
static std::string | internalAlignmentTypeToString (InternalAlignmentType alignment) |
static std::string | typeToString (ConstraintType type) |
Static Public Member Functions inherited from Base::Persistence | |
static void * | create (void) |
static std::string | encodeAttribute (const std::string &) |
Encodes an attribute upon saving. More... | |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Static Public Member Functions inherited from Base::BaseClass | |
static void * | create () |
static Type | getClassTypeId () |
static void | init () |
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 |
Protected Attributes | |
boost::uuids::uuid | tag |
Friends | |
class | PropertyConstraintList |
Additional Inherited Members | |
Static Protected Member Functions inherited from Base::BaseClass | |
static void | initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) |
Constraint::Constraint | ( | ) |
Referenced by clone(), copy(), and getPyObject().
|
delete |
|
virtualdefault |
Constraint * Constraint::clone | ( | void | ) | const |
References Constraint().
Referenced by ArchPanel.CommandPanelSheet::Activated(), ArchStructure.CommandStructuralSystem::Activated(), Sketcher::SketchObject::addConstraint(), Sketcher::SketchObject::addConstraints(), Sketcher::SketchObject::calculateConstraintError(), Sketcher::SketchObject::changeConstraintsLocking(), Sketcher::SketchObject::delAllExternal(), Sketcher::SketchObject::delExternal(), ArchComponent.Component::execute(), ArchCurtainWall.CurtainWall::execute(), ArchTruss.Truss::execute(), Sketcher::SketchObject::insertBSplineKnot(), Mod.PartDesign.WizardShaft.SegmentFunction.SegmentFunction::integrated(), Sketcher::SketchObject::modifyBSplineKnotMultiplicity(), Sketcher::SketchObject::port_reversedExternalArcs(), Sketcher::SketchObject::renameConstraint(), Sketcher::PropertyConstraintList::set1Value(), Sketcher::SketchObject::setActive(), Sketcher::PropertyConstraintList::setValue(), Sketcher::SketchObject::setVirtualSpace(), PathTests.TestPathHelix.TestPathHelix::test04(), Sketcher::SketchObject::toggleActive(), Sketcher::SketchObject::toggleDriving(), Sketcher::SketchObject::toggleVirtualSpace(), and Sketcher::SketchObject::validateExternalLinks().
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(), Sketcher::SketchObject::carbonCopy(), and Sketcher::SketchObject::split().
|
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.
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(), Sketcher::SnellsLaw, and Sketcher::Weight.
Referenced by ConstraintItem::data(), and Sketcher::PropertyConstraintList::getPyPathValue().
|
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().
double Sketcher::Constraint::getValue | ( | void | ) | const |
std::string Sketcher::Constraint::internalAlignmentTypeToString | ( | ) | const |
References internalAlignmentTypeToString().
Referenced by internalAlignmentTypeToString().
|
static |
bool Sketcher::Constraint::isDimensional | ( | ) | const |
|
delete |
|
delete |
|
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().
|
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.
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.
void Sketcher::Constraint::setValue | ( | double | newValue | ) |
Referenced by Sketcher::SketchObject::addCopy(), and Sketcher::SketchObject::addSymmetric().
utility function to swap the index in First/Second/Third of the provided constraint from the fromGeoId GeoId to toGeoId
References First, Second, and Third.
Referenced by Sketcher::SketchObject::split().
std::string Sketcher::Constraint::typeToString | ( | ) | const |
References typeToString().
Referenced by typeToString().
|
static |
|
friend |
InternalAlignmentType Sketcher::Constraint::AlignmentType |
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::delGeometriesExclusiveList(), SketcherGui::EditModeConstraintCoinManager::drawConstraintIcons(), Sketcher::SketchObject::evaluateConstraint(), Sketcher::SketchObject::exposeInternalGeometry(), Sketcher::SketchObject::fillet(), ConstraintItem::isEnforceable(), Sketcher::SketchObject::port_reversedExternalArcs(), SketcherGui::EditModeConstraintCoinManager::processConstraints(), Restore(), Save(), Sketcher::SketchObject::split(), substituteIndex(), Sketcher::SketchObject::synchroniseGeometryState(), Sketcher::SketchObject::transferFilletConstraints(), Sketcher::SketchObject::trim(), SketcherGui::EditModeConstraintCoinManager::updateConstraintColor(), and Sketcher::SketchObject::validateExternalLinks().
PointPos Sketcher::Constraint::FirstPos |
Referenced by Sketcher::Sketch::addConstraint(), Sketcher::SketchObject::addCopy(), Sketcher::SketchObject::addSymmetric(), copy(), ConstraintItem::data(), SketcherGui::EditModeConstraintCoinManager::drawConstraintIcons(), Sketcher::SketchObject::exposeInternalGeometry(), Sketcher::SketchObject::fillet(), Sketcher::SketchObject::port_reversedExternalArcs(), SketcherGui::EditModeConstraintCoinManager::processConstraints(), Restore(), Save(), Sketcher::SketchObject::split(), Sketcher::SketchObject::transferFilletConstraints(), Sketcher::SketchObject::trim(), and SketcherGui::EditModeConstraintCoinManager::updateConstraintColor().
int Sketcher::Constraint::InternalAlignmentIndex |
bool Sketcher::Constraint::isActive |
bool Sketcher::Constraint::isDriving |
Referenced by Sketcher::Sketch::addConstraint(), Sketcher::SketchObject::addCopy(), copy(), ConstraintItem::data(), SketcherGui::EditDatumDialog::exec(), ExpressionDelegate::paint(), Restore(), Save(), Sketcher::SketchObject::toggleDriving(), SketcherGui::EditModeConstraintCoinManager::updateConstraintColor(), and Sketcher::SketchObject::validateExpression().
bool Sketcher::Constraint::isInVirtualSpace |
float Sketcher::Constraint::LabelDistance |
Referenced by copy(), SketcherGui::EditModeConstraintCoinManager::processConstraints(), Restore(), and Save().
float Sketcher::Constraint::LabelPosition |
Referenced by copy(), SketcherGui::EditModeConstraintCoinManager::processConstraints(), Restore(), and Save().
std::string Sketcher::Constraint::Name |
Referenced by copy(), ConstraintItem::data(), SketcherGui::EditModeConstraintCoinManager::drawConstraintIcons(), SketcherGui::EditDatumDialog::exec(), SketcherGui::TaskSketcherConstraints::on_listWidgetConstraints_itemChanged(), Sketcher::SketchObject::renameConstraint(), Restore(), Save(), and Sketcher::PropertyConstraintList::set1Value().
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::delGeometriesExclusiveList(), SketcherGui::EditModeConstraintCoinManager::drawConstraintIcons(), Sketcher::SketchObject::evaluateConstraint(), Sketcher::SketchObject::exposeInternalGeometry(), Sketcher::SketchObject::fillet(), ConstraintItem::isEnforceable(), Sketcher::SketchObject::port_reversedExternalArcs(), SketcherGui::EditModeConstraintCoinManager::processConstraints(), Restore(), Save(), Sketcher::SketchObject::split(), substituteIndex(), Sketcher::SketchObject::transferFilletConstraints(), Sketcher::SketchObject::trim(), SketcherGui::EditModeConstraintCoinManager::updateConstraintColor(), and Sketcher::SketchObject::validateExternalLinks().
PointPos Sketcher::Constraint::SecondPos |
Referenced by Sketcher::Sketch::addConstraint(), Sketcher::SketchObject::addCopy(), Sketcher::SketchObject::addSymmetric(), copy(), ConstraintItem::data(), SketcherGui::EditModeConstraintCoinManager::drawConstraintIcons(), Sketcher::SketchObject::exposeInternalGeometry(), Sketcher::SketchObject::fillet(), Sketcher::SketchObject::port_reversedExternalArcs(), SketcherGui::EditModeConstraintCoinManager::processConstraints(), Restore(), Save(), Sketcher::SketchObject::split(), Sketcher::SketchObject::transferFilletConstraints(), Sketcher::SketchObject::trim(), and SketcherGui::EditModeConstraintCoinManager::updateConstraintColor().
|
protected |
Referenced by PathScripts.PathDressupHoldingTags.MapWireToTag::add(), PathScripts.PathDressupHoldingTags.MapWireToTag::cleanupEdges(), PathScripts.PathDressupHoldingTags.MapWireToTag::commandsForEdges(), Dice3DS.dom3ds.ChunkBase::document_html(), Dice3DS.dom3ds.ChunkBase::dump_header(), ArchPanel.PanelCut::getWires(), Sketcher::PropertyConstraintList::set1Value(), Sketcher::PropertyConstraintList::setValue(), PathScripts.PathDressupHoldingTags.MapWireToTag::shell(), and FreeCADInit.FCADLogger::trace().
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::delGeometriesExclusiveList(), SketcherGui::EditModeConstraintCoinManager::drawConstraintIcons(), Sketcher::SketchObject::evaluateConstraint(), ConstraintItem::isEnforceable(), Sketcher::SketchObject::port_reversedExternalArcs(), SketcherGui::EditModeConstraintCoinManager::processConstraints(), Restore(), Save(), substituteIndex(), and Sketcher::SketchObject::validateExternalLinks().
PointPos Sketcher::Constraint::ThirdPos |
ConstraintType Sketcher::Constraint::Type |
Referenced by ArchPanel.CommandPanelSheet::Activated(), ArchStructure.CommandStructuralSystem::Activated(), draftobjects.draft_annotation.DraftAnnotation::add_missing_properties_0v19(), Sketcher::Sketch::addConstraint(), Sketcher::SketchObject::addConstraint(), Sketcher::SketchObject::addConstraints(), Sketcher::SketchObject::addCopy(), ArchStructure.StructSelectionObserver::addSelection(), Sketcher::SketchObject::addSymmetric(), ArchSite.Compass::buildCoordinates(), copy(), ConstraintItem::data(), SketcherGui::EditModeConstraintCoinManager::drawConstraintIcons(), Sketcher::SketchObject::evaluateConstraint(), SketcherGui::EditDatumDialog::exec(), ArchComponent.Component::execute(), draftobjects.layer.LayerContainer::execute(), Sketcher::SketchObject::exposeInternalGeometry(), Sketcher::SketchObject::fillet(), Sketcher::SketchObject::getBlockedState(), Sketcher::SketchObject::getInternalTypeState(), ArchSchedule.CommandArchSchedule::IsActive(), ConstraintItem::isEnforceable(), SketcherGui::EditModeConstraintCoinManager::processConstraints(), Sketcher::PropertyConstraintList::Restore(), draftobjects.layer.Layer::set_properties(), ArchReference.ArchReference::setProperties(), Sketcher::SketchObject::split(), Sketcher::SketchObject::transferFilletConstraints(), Sketcher::SketchObject::trim(), and SketcherGui::EditModeConstraintCoinManager::updateConstraintColor().