Salome HOME
Issue #326 Distance constraint on 2 preselected segments problem
authornds <natalia.donis@opencascade.com>
Tue, 27 Jan 2015 12:05:16 +0000 (15:05 +0300)
committernds <natalia.donis@opencascade.com>
Tue, 27 Jan 2015 12:05:16 +0000 (15:05 +0300)
it should not be possible to select an arc object.

src/SketchPlugin/SketchPlugin_Validators.cpp
src/XGUI/XGUI_SelectionMgr.cpp

index d8d056f46da98a190e2f48e2e856482ba4c1de20..b53102af2a268799729f716ecf5ffde12850d3c6 100644 (file)
@@ -25,7 +25,13 @@ bool SketchPlugin_DistanceAttrValidator::isValid(const FeaturePtr& theFeature,
   // If the object is not a line then it is accepted
   const ModelAPI_ResultValidator* aLineValidator =
       dynamic_cast<const ModelAPI_ResultValidator*>(aFactory->validator("SketchPlugin_ResultLine"));
-  if (!aLineValidator->isValid(theObject))
+  bool aLineValid = aLineValidator->isValid(theObject);
+
+  const ModelAPI_ResultValidator* anArcValidator =
+      dynamic_cast<const ModelAPI_ResultValidator*>(aFactory->validator("SketchPlugin_ResultArc"));
+  bool anArcValid = anArcValidator->isValid(theObject);
+
+  if (!aLineValid && !anArcValid)
     return true;
 
   // If it is a line then we have to check that first attribute id not a line
index 9eb43d499ee60d566e1aab807e23cd0eb6311d8e..8304179726f246d4106c5cef7f06256dd71a53b5 100644 (file)
@@ -60,7 +60,6 @@ void XGUI_SelectionMgr::setSelectedOwners(const SelectMgr_IndexedMapOfOwner& the
 }
 
 //**************************************************************
-#include <SelectMgr_ListIteratorOfListOfFilter.hxx>
 void XGUI_SelectionMgr::updateSelectedOwners(bool isUpdateViewer)
 {
   Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();