]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
#20529 : Add GeomValidators_ConstructionComposite in xml CEA_2020/Lot2_Point_Coordinates
authorJérôme <jerome.lucas@cesgenslab.fr>
Thu, 17 Dec 2020 14:32:02 +0000 (15:32 +0100)
committerJérôme <jerome.lucas@cesgenslab.fr>
Thu, 17 Dec 2020 14:32:02 +0000 (15:32 +0100)
src/FeaturesPlugin/FeaturesPlugin_PointCoordinates.cpp
src/FeaturesPlugin/point_coordinates_widget.xml

index 01b8199a08328256d77c1cfcfc0e1b730d45b8a1..6a6daa9c52ea2a905bca970d7ab95caf7e6fb5a5 100644 (file)
@@ -79,16 +79,12 @@ void FeaturesPlugin_PointCoordinates::attributeChanged(const std::string& theID)
     }
     if (aShape) {
       aPoint = GeomAlgoAPI_PointBuilder::point(aShape);
-      if (aPoint.get()) {
-        streamx << std::setprecision(14) << aPoint->x();
-        aValues->setValue(0, aPoint->x());
-        streamy << std::setprecision(14) << aPoint->y();
-        aValues->setValue(1, aPoint->y());
-        streamz << std::setprecision(14) << aPoint->z();
-        aValues->setValue(2, aPoint->z());
-      } else {
-        aSelection->setValue( aSelection->context(),GeomShapePtr());
-      }
+      streamx << std::setprecision(14) << aPoint->x();
+      aValues->setValue(0, aPoint->x());
+      streamy << std::setprecision(14) << aPoint->y();
+      aValues->setValue(1, aPoint->y());
+      streamz << std::setprecision(14) << aPoint->z();
+      aValues->setValue(2, aPoint->z());
     }
 
     string(X_COORD_ID() )->setValue( "X = " +  streamx.str() );
index 7e5aa1151603195d32e0a0296a067150c25df782..29c744cc9b386aee8af72f95012304e1412c95ee 100644 (file)
@@ -5,6 +5,7 @@
                       tooltip="Select a point"
                       shape_types="vertex"
                       default="">
+        <validator id="GeomValidators_ConstructionComposite"/>
         <validator id="GeomValidators_ShapeType" parameters="vertex"/>
   </shape_selector>
   <label id="xcoordinate" isSelectable = "true"/>