From: nds Date: Thu, 26 May 2016 09:54:49 +0000 (+0300) Subject: Correction to use in XML "edges, faces" X-Git-Tag: V_2.3.1~54 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3d6815215e69b112a72b31d467cda60a6ca877c3;p=modules%2Fshaper.git Correction to use in XML "edges, faces" --- diff --git a/src/ModuleBase/ModuleBase_WidgetSelector.cpp b/src/ModuleBase/ModuleBase_WidgetSelector.cpp index ea76a64c4..ebdd60a53 100755 --- a/src/ModuleBase/ModuleBase_WidgetSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelector.cpp @@ -114,7 +114,7 @@ bool ModuleBase_WidgetSelector::acceptSubShape(const GeomShapePtr& theShape, } QIntList::const_iterator anIt = aShapeTypes.begin(), aLast = aShapeTypes.end(); - for (; anIt != aLast; anIt++) { + for (; anIt != aLast && !aValid; anIt++) { TopAbs_ShapeEnum aCurrentShapeType = (TopAbs_ShapeEnum)*anIt; if (aShapeType == aCurrentShapeType) aValid = true; @@ -125,7 +125,11 @@ bool ModuleBase_WidgetSelector::acceptSubShape(const GeomShapePtr& theShape, std::dynamic_pointer_cast(theResult); aValid = aCResult.get() && aCResult->facesNum() > 0; } - aValid = ModuleBase_ResultPrs::isValidShapeType(aCurrentShapeType, aShapeType); + if (!aValid) { + // the compared shape types are not equal but presentation might allow some type for another + // exactly it allow Wire type of the shape for Face XML shape type + aValid = ModuleBase_ResultPrs::isValidShapeType(aCurrentShapeType, aShapeType); + } } } return aValid; diff --git a/src/PartSet/PartSet_ResultSketchPrs.cpp b/src/PartSet/PartSet_ResultSketchPrs.cpp index 8769ea22f..0715850b9 100755 --- a/src/PartSet/PartSet_ResultSketchPrs.cpp +++ b/src/PartSet/PartSet_ResultSketchPrs.cpp @@ -61,18 +61,6 @@ PartSet_ResultSketchPrs::PartSet_ResultSketchPrs(ResultPtr theResult) SetAutoHilight(aCompSolid.get() == NULL); } -bool PartSet_ResultSketchPrs::isValidShapeType(const TopAbs_ShapeEnum& theBaseType, - const TopAbs_ShapeEnum& theCheckedType) -{ - bool aValid = theBaseType == theCheckedType; - if (!aValid) { - // currently this functionality is for all, as we have no separate wire selection mode - // lately it should be corrected to have the following check only for sketch presentations - aValid = theBaseType == TopAbs_FACE && theCheckedType == TopAbs_WIRE; - } - return aValid; -} - void PartSet_ResultSketchPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) diff --git a/src/PartSet/PartSet_ResultSketchPrs.h b/src/PartSet/PartSet_ResultSketchPrs.h index 3b39b34f5..ddf21d1ec 100755 --- a/src/PartSet/PartSet_ResultSketchPrs.h +++ b/src/PartSet/PartSet_ResultSketchPrs.h @@ -29,12 +29,6 @@ public: /// \param theResult a result object Standard_EXPORT PartSet_ResultSketchPrs(ResultPtr theResult); - /// Returns true if the checked type can be accepted for the base selection type - /// It returns true if they are coicide or if the base type is face and the checked type is wire - /// @return boolean result - static Standard_EXPORT bool isValidShapeType(const TopAbs_ShapeEnum& theBaseType, - const TopAbs_ShapeEnum& theCheckedType); - DEFINE_STANDARD_RTTI(PartSet_ResultSketchPrs) protected: /// Redefinition of virtual function