Salome HOME
2D points selection in multi-translation/rotation : multi-translation: using ModelAPI...
[modules/shaper.git] / src / GeomDataAPI / GeomDataAPI_Point2D.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomDataAPI_Point2D.cpp
4 // Created:     24 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7
8 #include <GeomDataAPI_Point2D.h>
9 #include <ModelAPI_AttributeRefAttr.h>
10
11 void GeomDataAPI_Point2D::move(const double theDeltaX, const double theDeltaY)
12 {
13   setValue(x() + theDeltaX, y() + theDeltaY);
14 }
15
16 std::string GeomDataAPI_Point2D::attributeType()
17 {
18   return typeId();
19 }
20
21 std::shared_ptr<GeomDataAPI_Point2D> GeomDataAPI_Point2D::getPoint2D(
22                                   const DataPtr& theData, const std::string& theAttribute)
23 {
24   std::shared_ptr<GeomDataAPI_Point2D> aPointAttr;
25   if (!theData)
26     return aPointAttr;
27
28   std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = std::dynamic_pointer_cast<
29                                  ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute));
30   if (anAttr && anAttr->attr()) {
31     aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(anAttr->attr());
32   }
33   return aPointAttr;
34 }
35
36
37 GeomDataAPI_Point2D::GeomDataAPI_Point2D()
38 {
39 }
40
41 GeomDataAPI_Point2D::~GeomDataAPI_Point2D()
42 {
43 }