PartSet_Module modification for selection Faces on Sketch is temporary commented.
1. Planar face of non-sketch object or a plane. Sketch creation will be started.<br />
2. An existing sketch face or contour. Extrusion will be filled by it.<br />
3. An existing result shape of kind: wires/edge/vertices.Extrusion will be filled by it."
- shape_types="faces objects">
+ shape_types="wires faces objects">
<validator id="FeaturesPlugin_ValidatorCompositeLauncher" parameters="base,Sketch"/>
</sketch_launcher>
<multi_selector id="base"
label="Base objects:"
tooltip="Select a base objects"
- type_choice="faces objects"
+ type_choice="wires faces objects"
concealment="true">
<validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell"/>
</multi_selector>
1. Planar face of non-sketch object or a plane. Sketch creation will be started.<br />
2. An existing sketch face or contour. Extrusion will be filled by it.<br />
3. An existing result shape of kind: wires/edge/vertices.Extrusion will be filled by it."
- shape_types="face objects">
+ shape_types="wires faces objects">
<validator id="FeaturesPlugin_ValidatorCompositeLauncher" parameters="base,Sketch"/>
</sketch_launcher>
<multi_selector id="base"
label="Select a sketch face"
icon="icons/Features/sketch.png"
tooltip="Select a sketch face"
- type_choice="Faces Objects">
+ type_choice="wires faces objects">
<validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="face,shell"/>
</multi_selector>
<shape_selector id="direction_object"
1. Planar face of non-sketch object or a plane. Sketch creation will be started.<br />
2. An existing sketch face or contour. Extrusion will be filled by it.<br />
3. An existing result shape of kind: wires/edge/vertices.Extrusion will be filled by it."
- shape_types="face objects">
+ shape_types="wires faces objects">
<validator id="FeaturesPlugin_ValidatorCompositeLauncher" parameters="base,Sketch"/>
</sketch_launcher>
<multi_selector id="base"
label="Select a sketch face"
icon="icons/Features/sketch.png"
tooltip="Select a sketch face"
- type_choice="Faces Objects">
+ type_choice="wires faces objects">
<validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell"/>
</multi_selector>
<shape_selector id="direction_object"
<multi_selector id="base_objects"
label="Base objects:"
tooltip="Select a base objects"
- type_choice="faces objects"
+ type_choice="wires faces objects"
use_choice="false"
concealment="true">
<validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell"/>
1. Planar face of non-sketch object or a plane. Sketch creation will be started.<br />
2. An existing sketch face or contour. Extrusion will be filled by it.<br />
3. An existing result shape of kind: wires/edge/vertices.Extrusion will be filled by it."
- shape_types="faces objects">
+ shape_types="wires faces objects">
<validator id="FeaturesPlugin_ValidatorCompositeLauncher" parameters="base,Sketch"/>
</sketch_launcher>
<multi_selector id="base"
label="Base objects:"
tooltip="Select a base objects"
- type_choice="faces objects"
+ type_choice="wires faces objects"
concealment="true">
<validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell"/>
</multi_selector>
1. Planar face of non-sketch object or a plane. Sketch creation will be started.<br />
2. An existing sketch face or contour. Extrusion will be filled by it.<br />
3. An existing result shape of kind: wires/edge/vertices.Extrusion will be filled by it."
- shape_types="face objects">
+ shape_types="wires face objects">
<validator id="FeaturesPlugin_ValidatorCompositeLauncher" parameters="base,Sketch"/>
</sketch_launcher>
<multi_selector id="base"
label="Select a sketch face"
icon="icons/Features/sketch.png"
tooltip="Select a sketch face"
- type_choice="Faces Objects">
+ type_choice="wires faces objects">
<validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="face,shell"/>
</multi_selector>
<shape_selector id="axis_object"
1. Planar face of non-sketch object or a plane. Sketch creation will be started.<br />
2. An existing sketch face or contour. Extrusion will be filled by it.<br />
3. An existing result shape of kind: wires/edge/vertices.Extrusion will be filled by it."
- shape_types="face objects">
+ shape_types="wires face objects">
<validator id="FeaturesPlugin_ValidatorCompositeLauncher" parameters="base,Sketch"/>
</sketch_launcher>
<multi_selector id="base"
label="Select a sketch face"
icon="icons/Features/sketch.png"
tooltip="Select a sketch face"
- type_choice="Faces Objects">
+ type_choice="wires faces objects">
<validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell"/>
</multi_selector>
<shape_selector id="axis_object"
SetAutoHilight(aCompSolid.get() == NULL);
}
-bool ModuleBase_ResultPrs::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 ModuleBase_ResultPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode)
/// \param theResult a result object
Standard_EXPORT ModuleBase_ResultPrs(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);
-
-
//! Method which draws selected owners ( for fast presentation draw )
Standard_EXPORT virtual void HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM,
const SelectMgr_SequenceOfOwner& theOwners);
MyShapeTypes["vertex"] = TopAbs_VERTEX;
MyShapeTypes["vertices"] = TopAbs_VERTEX;
MyShapeTypes["wire"] = TopAbs_WIRE;
+ MyShapeTypes["wires"] = TopAbs_WIRE;
MyShapeTypes["edge"] = TopAbs_EDGE;
MyShapeTypes["edges"] = TopAbs_EDGE;
MyShapeTypes["shell"] = TopAbs_SHELL;
std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theResult);
aValid = aCResult.get() && aCResult->facesNum() > 0;
}
- 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;
//******************************************************
bool PartSet_Module::canActivateSelectionMode(const Handle(AIS_InteractiveObject)& theIO, int theMode) const
{
- if (theMode == TopAbs_FACE) {
+ /*if (theMode == TopAbs_FACE) {
Handle(PartSet_ResultSketchPrs) aSketchPrs = Handle(PartSet_ResultSketchPrs)::DownCast(theIO);
if (!aSketchPrs.IsNull()) {
ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
} else
return false;
}
- }
+ }*/
return true;
}
bool PartSet_Module::needDeactivateSelectionMode(const Handle(AIS_InteractiveObject)& theIO, int theMode) const
{
if (theMode == TopAbs_FACE) {
- Handle(PartSet_ResultSketchPrs) aSketchPrs = Handle(PartSet_ResultSketchPrs)::DownCast(theIO);
- return !aSketchPrs.IsNull();
+ // Handle(PartSet_ResultSketchPrs) aSketchPrs = Handle(PartSet_ResultSketchPrs)::DownCast(theIO);
+ // return !aSketchPrs.IsNull();
}
return false;
}
// In order to avoid using custom selection modes
return;
- if (aMode == AIS_Shape::SelectionMode(TopAbs_FACE)) {
+ bool aShapeIsChanged = false;
+ if (aMode == AIS_Shape::SelectionMode(TopAbs_FACE) ||
+ aMode == AIS_Shape::SelectionMode(TopAbs_WIRE)) {
#ifdef DEBUG_WIRE
const TopoDS_Shape& aShape = Shape();
debugInfo(aShape, TopAbs_VERTEX); // 24
for(NCollection_List<TopoDS_Shape>::Iterator anIt(mySketchFaceList); anIt.More(); anIt.Next()) {
const TopoDS_Shape& aFace = anIt.Value();
aBuilder.Add(aComp, aFace);
- // for sketch presentation in the face mode wires should be selectable also
- // accoring to #1343 Improvement of Extrusion and Revolution operations
- appendShapeSelection(aSelection, aFace, TopAbs_WIRE);
}
#ifdef DEBUG_WIRE
debugInfo(aComp, TopAbs_VERTEX); // 24
debugInfo(aComp, TopAbs_FACE); // 2
#endif
Set(aComp);
- } else
+ aShapeIsChanged = true;
+ }
+ else
Set(myOriginalShape);
// append auxiliary compound to selection of edges/vertices
if (aMode == AIS_Shape::SelectionMode(TopAbs_EDGE) ||
aMode == AIS_Shape::SelectionMode(TopAbs_VERTEX)) {
- bool isVertex = aMode == AIS_Shape::SelectionMode(TopAbs_VERTEX);
+ bool isVertex = aMode == AIS_Shape::SelectionMode(TopAbs_VERTEX);
appendShapeSelection(aSelection, myAuxiliaryCompound, isVertex ? TopAbs_VERTEX : TopAbs_EDGE);
}
AIS_Shape::ComputeSelection(aSelection, aMode);
+
+ if (aShapeIsChanged)
+ Set(myOriginalShape);
}
void PartSet_ResultSketchPrs::appendShapeSelection(const Handle(SelectMgr_Selection)& theSelection,