Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetPoint2dDistance.cpp
index 871654bd21c99da06bc005768d8b300c1be95419..1a100c57bdf806eba251facd01c351b07a82e917 100644 (file)
 
 #include <QDoubleSpinBox>
 
-ModuleBase_WidgetPoint2dDistance::ModuleBase_WidgetPoint2dDistance(QWidget* theParent, const Config_WidgetAPI* theData)
-  : ModuleBase_WidgetDoubleValue(theParent, theData)
+ModuleBase_WidgetPoint2dDistance::ModuleBase_WidgetPoint2dDistance(QWidget* theParent,
+                                                                   const Config_WidgetAPI* theData,
+                                                                   const std::string& theParentId)
+    : ModuleBase_WidgetDoubleValue(theParent, theData, theParentId)
 {
   myFirstPntName = theData->getProperty("first_point");
 }
@@ -29,8 +31,8 @@ bool ModuleBase_WidgetPoint2dDistance::setValue(ModuleBase_WidgetValue* theValue
   bool isDone = false;
 
   if (theValue) {
-    ModuleBase_WidgetValueFeature* aFeatureValue = 
-                         dynamic_cast<ModuleBase_WidgetValueFeature*>(theValue);
+    ModuleBase_WidgetValueFeature* aFeatureValue =
+        dynamic_cast<ModuleBase_WidgetValueFeature*>(theValue);
     if (aFeatureValue) {
       boost::shared_ptr<GeomAPI_Pnt2d> aPnt = aFeatureValue->point();
       ObjectPtr aObject = aFeatureValue->object();
@@ -44,12 +46,14 @@ bool ModuleBase_WidgetPoint2dDistance::setValue(ModuleBase_WidgetValue* theValue
   return isDone;
 }
 
-void ModuleBase_WidgetPoint2dDistance::setPoint(FeaturePtr theFeature, const boost::shared_ptr<GeomAPI_Pnt2d>& thePnt)
+void ModuleBase_WidgetPoint2dDistance::setPoint(FeaturePtr theFeature,
+                                                const boost::shared_ptr<GeomAPI_Pnt2d>& thePnt)
 {
   boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
-  boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
-                                                              (aData->attribute(myFirstPntName));
-  if (!aPoint) return;
+  boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+      aData->attribute(myFirstPntName));
+  if (!aPoint)
+    return;
 
   double aRadius = thePnt->distance(aPoint->pnt());
   AttributeDoublePtr aReal = aData->real(attributeID());
@@ -57,4 +61,4 @@ void ModuleBase_WidgetPoint2dDistance::setPoint(FeaturePtr theFeature, const boo
     aReal->setValue(aRadius);
     mySpinBox->setValue(aRadius);
   }
-}
\ No newline at end of file
+}