}
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;
std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(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;
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)
/// \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