double aDeltaX = aX - aCurX;
double aDeltaY = anY - aCurY;
- moveLinePoint(feature(), aDeltaX, aDeltaY, LINE_ATTR_START);
- moveLinePoint(feature(), aDeltaX, aDeltaY, LINE_ATTR_END);
+ PartSet_Tools::moveFeature(feature(), aDeltaX, aDeltaY);
std::list<XGUI_ViewerPrs>::const_iterator anIt = myFeatures.begin(), aLast = myFeatures.end();
for (; anIt != aLast; anIt++) {
FeaturePtr aFeature = (*anIt).feature();
if (!aFeature || aFeature == feature())
continue;
- moveLinePoint(aFeature, aDeltaX, aDeltaY, LINE_ATTR_START);
- moveLinePoint(aFeature, aDeltaX, aDeltaY, LINE_ATTR_END);
+ PartSet_Tools::moveFeature(aFeature, aDeltaX, aDeltaY);
}
}
sendFeatures();
return FeaturePtr();
}
-void PartSet_OperationEditFeature::moveLinePoint(FeaturePtr theFeature,
- double theDeltaX, double theDeltaY,
- const std::string& theAttribute)
-{
- if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
- return;
-
- boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
- if (!aData->isValid())
- return;
- boost::shared_ptr<GeomDataAPI_Point2D> aPoint =
- boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(theAttribute));
-
- aPoint->setValue(aPoint->x() + theDeltaX, aPoint->y() + theDeltaY);
-}
-
void PartSet_OperationEditFeature::sendFeatures()
{
static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_MOVED);