Sketcher: Extend Constraints to have an activated boolean state
This commit is contained in:
committed by
abdullahtahiriyo
parent
4a0be9d3ba
commit
7cd3dd7dc4
@@ -60,7 +60,8 @@ Constraint::Constraint()
|
||||
LabelPosition(0.f),
|
||||
isDriving(true),
|
||||
InternalAlignmentIndex(-1),
|
||||
isInVirtualSpace(false)
|
||||
isInVirtualSpace(false),
|
||||
isActive(true)
|
||||
{
|
||||
// Initialize a random number generator, to avoid Valgrind false positives.
|
||||
static boost::mt19937 ran;
|
||||
@@ -98,6 +99,7 @@ Constraint *Constraint::copy(void) const
|
||||
temp->isDriving = this->isDriving;
|
||||
temp->InternalAlignmentIndex = this->InternalAlignmentIndex;
|
||||
temp->isInVirtualSpace = this->isInVirtualSpace;
|
||||
temp->isActive = this->isActive;
|
||||
// Do not copy tag, otherwise it is considered a clone, and a "rename" by the expression engine.
|
||||
return temp;
|
||||
}
|
||||
@@ -165,7 +167,8 @@ void Constraint::Save (Writer &writer) const
|
||||
<< "LabelDistance=\"" << LabelDistance << "\" "
|
||||
<< "LabelPosition=\"" << LabelPosition << "\" "
|
||||
<< "IsDriving=\"" << (int)isDriving << "\" "
|
||||
<< "IsInVirtualSpace=\"" << (int)isInVirtualSpace << "\" />"
|
||||
<< "IsInVirtualSpace=\"" << (int)isInVirtualSpace << "\" "
|
||||
<< "IsActive=\"" << (int)isActive << "\" />"
|
||||
|
||||
<< std::endl;
|
||||
}
|
||||
@@ -209,4 +212,7 @@ void Constraint::Restore(XMLReader &reader)
|
||||
|
||||
if (reader.hasAttribute("IsInVirtualSpace"))
|
||||
isInVirtualSpace = reader.getAttributeAsInteger("IsInVirtualSpace") ? true : false;
|
||||
|
||||
if (reader.hasAttribute("IsActive"))
|
||||
isActive = reader.getAttributeAsInteger("IsActive") ? true : false;
|
||||
}
|
||||
|
||||
@@ -143,6 +143,8 @@ public:
|
||||
int InternalAlignmentIndex; // Note: for InternalAlignment Type this index indexes equal internal geometry elements (e.g. index of pole in a bspline). It is not a GeoId!!
|
||||
bool isInVirtualSpace;
|
||||
|
||||
bool isActive;
|
||||
|
||||
protected:
|
||||
boost::uuids::uuid tag;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user