[Sketcher] Add some utility functions to Sketcher::Constraint
`involvesGeoId`, `invovesGeoIdAndPosId`, `substituteIndexAndPos`
This commit is contained in:
@@ -239,6 +239,25 @@ void Constraint::substituteIndex(int fromGeoId, int toGeoId)
|
||||
}
|
||||
}
|
||||
|
||||
void Constraint::substituteIndexAndPos(int fromGeoId,
|
||||
PointPos fromPosId,
|
||||
int toGeoId,
|
||||
PointPos toPosId)
|
||||
{
|
||||
if (this->First == fromGeoId && this->FirstPos == fromPosId) {
|
||||
this->First = toGeoId;
|
||||
this->FirstPos = toPosId;
|
||||
}
|
||||
if (this->Second == fromGeoId && this->SecondPos == fromPosId) {
|
||||
this->Second = toGeoId;
|
||||
this->SecondPos = toPosId;
|
||||
}
|
||||
if (this->Third == fromGeoId && this->ThirdPos == fromPosId) {
|
||||
this->Third = toGeoId;
|
||||
this->ThirdPos = toPosId;
|
||||
}
|
||||
}
|
||||
|
||||
std::string Constraint::typeToString(ConstraintType type)
|
||||
{
|
||||
return type2str[type];
|
||||
|
||||
Reference in New Issue
Block a user