<multi_selector id="base_objects"
label="Edges:"
tooltip="Select edges on sketch or edges objects."
- type_choice="edges objects"
+ type_choice="edges"
concealment="true">
<validator id="BuildPlugin_ValidatorBaseForBuild" parameters="edge"/>
</multi_selector>
<multi_selector id="base_objects"
label="Segments and wires:"
tooltip="Select edges on sketch, edges or wires objects."
- type_choice="edges objects"
+ type_choice="edges wires"
concealment="true">
<validator id="BuildPlugin_ValidatorBaseForBuild" parameters="edge,wire"/>
</multi_selector>
<multi_selector id="base_objects"
label="Vertices:"
tooltip="Select vertices on sketch or vertex objects."
- type_choice="vertices objects"
+ type_choice="vertices"
concealment="true">
<validator id="BuildPlugin_ValidatorBaseForBuild" parameters="vertex"/>
</multi_selector>
<multi_selector id="base_objects"
label="Segments and wires:"
tooltip="Select edges on sketch, edges or wires objects."
- type_choice="edges objects"
+ type_choice="edges wires"
concealment="true">
<validator id="BuildPlugin_ValidatorBaseForBuild" parameters="edge,wire"/>
</multi_selector>
<group id="Exchange">
<feature id="Import" title="Import" tooltip="Import a file" icon="icons/Exchange/import.png" document="Part">
<file_selector id="file_path" title="Import file" path="">
- <validator id="ExchangePlugin_ImportFormat" parameters="BREP|BRP:BREP,STEP|STP:STEP,IGES|IGS:IGES,XAO:XAO" />
+ <validator id="ExchangePlugin_ImportFormat" parameters="BREP|BRP:BREP,STEP|STP:STEP,IGES|IGS:IGES" />
</file_selector>
</feature>
<feature id="Export" title="Export" tooltip="Export to file" icon="icons/Exchange/export.png">
- <source path="export_widget.xml" />
+ <export_file_selector id="file_path" type="save" title="Export file" path="">
+ <validator id="ExchangePlugin_ExportFormat" parameters="BREP|BRP:BREP,STEP|STP:STEP,IGES|IGS:IGES-5.1,IGES|IGS:IGES-5.3" />
+ </export_file_selector>
+ <multi_selector id="selection_list" tooltip="Select a set of objects"
+ type_choice="Vertices Edges Faces Solids Objects" use_choice="true">
+ <validator id="GeomValidators_Finite"/>
+ </multi_selector>
</feature>
</group>
</workbench>
-</plugin>
+</plugin>
\ No newline at end of file
label="Main objects"
icon=""
tooltip="Select solid objects"
- type_choice="Solids Objects"
+ type_choice="solids edges faces"
use_choice="false"
concealment="true">
<validator id="PartSet_DifferentObjects"/>
label="Tool objects"
icon=""
tooltip="Select a tool solid"
- type_choice="Solids Objects"
+ type_choice="solids edges faces"
use_choice="false"
concealment="true" >
<validator id="PartSet_DifferentObjects"/>
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="wires faces objects">
+ shape_types="vertices edges wires faces shells solids compsolids compounds">
<validator id="FeaturesPlugin_ValidatorCompositeLauncher" parameters="base,Sketch"/>
</sketch_launcher>
<multi_selector id="base"
label="Base objects:"
tooltip="Select a base objects"
- type_choice="wires faces objects"
+ type_choice="vertices edges wires faces shells compounds"
concealment="true">
<validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell,compound"/>
</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="wires faces objects">
+ shape_types="wires faces shells">
<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="wires faces objects">
+ type_choice="wires faces shells">
<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="wires faces objects">
+ shape_types="vertices edges wires faces shells compounds">
<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="wires faces objects">
+ type_choice="vertices edges wires faces shells compounds">
<validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell,compound"/>
</multi_selector>
<shape_selector id="direction_object"
<source>
<multi_selector id="group_list"
tooltip="Select a set of objects"
- type_choice="Vertices Edges Faces Solids"
+ type_choice="vertices edges faces solids"
use_choice="true"
clear_in_neutral_point="false">
<validator id="GeomValidators_BodyShapes"/>
<multi_selector id="main_objects"
label="Main objects"
icon="icons/Features/cut_shape.png"
- tooltip="Select objects(objects, compsoilds, solids, shells, faces or edges)"
- type_choice="Solids Objects"
+ tooltip="Select objects(compounds, compsolids, solids, shells, faces or edges)"
+ type_choice="edges faces shells solids compsolids compounds"
use_choice="false"
concealment="true">
<validator id="PartSet_DifferentObjects"/>
<multi_selector id="tool_objects"
label="Tool objects"
icon="icons/Features/cut_tool.png"
- tooltip="Select tools(objects, compsoilds, solids, shells, faces or edges)"
- type_choice="Solids Objects"
+ tooltip="Select tools(compounds, compsolids, solids, shells, faces or edges)"
+ type_choice="edges faces shells solids compsolids compounds"
use_choice="false"
concealment="true">
<validator id="PartSet_DifferentObjects"/>
<multi_selector id="base_objects"
label="Base objects:"
tooltip="Select a base objects"
- type_choice="wires faces objects"
+ type_choice="vertices edges wires faces shells compsolids"
use_choice="false"
concealment="true">
<validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell,compound"/>
label="Select objects to move"
icon="icons/Features/cut_shape.png"
tooltip="Select solid objects"
- type_choice="solids objects"
+ type_choice="objects"
concealment="true" >
<validator id="FeaturesPlugin_ValidatorTransform"/>
</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="wires faces objects">
+ shape_types="vertices edges wires faces shells compounds">
<validator id="FeaturesPlugin_ValidatorCompositeLauncher" parameters="base,Sketch"/>
</sketch_launcher>
<multi_selector id="base"
label="Base objects:"
tooltip="Select a base objects"
- type_choice="wires faces objects"
+ type_choice="vertices edges wires faces shells compounds"
concealment="true">
<validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell,compound"/>
</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="wires face objects">
+ shape_types="wires faces shells">
<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="wires faces objects">
+ type_choice="wires faces shells">
<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="wires face objects">
+ shape_types="vertices edges wires faces shells compounds">
<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="wires faces objects">
+ type_choice="vertices edges wires faces shells compounds">
<validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell,compound"/>
</multi_selector>
<shape_selector id="axis_object"
label="Main objects"
icon="icons/Features/cut_shape.png"
tooltip="Select solid objects"
- type_choice="solids objects"
+ type_choice="objects"
concealment="true">
<validator id="FeaturesPlugin_ValidatorTransform"/>
</multi_selector>
label="Main objects"
icon="icons/Features/cut_shape.png"
tooltip="Select solid objects"
- type_choice="solids objects"
+ type_choice="objects"
concealment="true">
<validator id="FeaturesPlugin_ValidatorTransform"/>
</multi_selector>
void ModuleBase_ResultPrs::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer aMode)
{
- if (aMode > 8)
+ if (aMode > TopAbs_SHAPE) {
// In order to avoid using custom selection modes
+ if (aMode == ModuleBase_ResultPrs::Sel_Result) {
+ AIS_Shape::ComputeSelection(aSelection, TopAbs_COMPOUND);
+ }
return;
+ }
// TODO: OCCT issue should be created for the COMPOUND processing
// before it is fixed, the next workaround in necessary
*/
class ModuleBase_ResultPrs: public ViewerData_AISShape
{
+public:
+ enum SelectionModes {
+ Sel_Result = TopAbs_SHAPE + 1 /// it should be combined with Compsolid results, so it is not
+ /// the Shape type. It is not defined in XML as compound type
+ /// because this type is processed as shape with compounds inside.
+ };
+
public:
/// Constructor
/// \param theResult a result object
#include <ModuleBase_IWorkshop.h>
#include <ModuleBase_IModule.h>
#include <ModuleBase_IconFactory.h>
+#include <ModuleBase_ResultPrs.h>
#include <ModelAPI_Attribute.h>
#include <ModelAPI_AttributeRefAttr.h>
case TopAbs_EDGE: anInfo = "edge"; break;
case TopAbs_VERTEX: anInfo = "vertex"; break;
case TopAbs_SHAPE: anInfo = "shape"; break;
+ case ModuleBase_ResultPrs::Sel_Result:
+ anInfo = "result_shape"; break;
default: break;
}
return anInfo;
#endif
}
-typedef QMap<QString, TopAbs_ShapeEnum> ShapeTypes;
+typedef QMap<QString, int> ShapeTypes;
static ShapeTypes myShapeTypes;
-TopAbs_ShapeEnum shapeType(const QString& theType)
+int shapeType(const QString& theType)
{
if (myShapeTypes.count() == 0) {
myShapeTypes["compound"] = TopAbs_COMPOUND;
myShapeTypes["edges"] = TopAbs_EDGE;
myShapeTypes["vertex"] = TopAbs_VERTEX;
myShapeTypes["vertices"] = TopAbs_VERTEX;
- myShapeTypes["objects"] = TopAbs_SHAPE;
+ myShapeTypes["object"] = ModuleBase_ResultPrs::Sel_Result;
+ myShapeTypes["objects"] = ModuleBase_ResultPrs::Sel_Result;
}
QString aType = theType.toLower();
if(myShapeTypes.contains(aType))
/// Converts string value (name of shape type) to shape enum value
/// \param theType - string with shape type name
/// \return TopAbs_ShapeEnum value
-MODULEBASE_EXPORT TopAbs_ShapeEnum shapeType(const QString& theType);
+MODULEBASE_EXPORT int shapeType(const QString& theType);
/// Checks whether the object is a sub result. It gets the feature of the object,
/// obtains all results of the feature and check if the object is a sub result
}
//********************************************************************
-void ModuleBase_WidgetMultiSelector::setCurrentShapeType(const TopAbs_ShapeEnum theShapeType)
+void ModuleBase_WidgetMultiSelector::setCurrentShapeType(const int theShapeType)
{
QString aShapeTypeName;
for (int idx = 0; idx < myTypeCombo->count(); ++idx) {
aShapeTypeName = myTypeCombo->itemText(idx);
- TopAbs_ShapeEnum aRefType = ModuleBase_Tools::shapeType(aShapeTypeName);
+ int aRefType = ModuleBase_Tools::shapeType(aShapeTypeName);
if(aRefType == theShapeType && idx != myTypeCombo->currentIndex()) {
bool aWasActivated = activateSelectionAndFilters(false);
bool isBlocked = myTypeCombo->blockSignals(true);
virtual QIntList shapeTypes() const;
/// Set current shape type for selection
- void setCurrentShapeType(const TopAbs_ShapeEnum theShapeType);
+ void setCurrentShapeType(const int theShapeType);
/// Return the attribute values wrapped in a list of viewer presentations
/// \return a list of viewer presentations, which contains an attribute result and
QIntList ModuleBase_WidgetSelector::getShapeTypes() const
{
QIntList aShapeTypes = shapeTypes();
- if (aShapeTypes.contains(TopAbs_SOLID) || aShapeTypes.contains(TopAbs_SHAPE)) {
+ if (aShapeTypes.contains(TopAbs_SOLID) || aShapeTypes.contains(ModuleBase_ResultPrs::Sel_Result/*TopAbs_SHAPE*/)) {
// it should be selectable for both, "solids" and "objects" types
aShapeTypes.append(TopAbs_COMPSOLID);
}
aValid = true;
return aValid;
}
- // when the SHAPE type is provided by XML, the hole result shape can be selected.
- if (!aShape.get() && aShapeTypes.contains(TopAbs_SHAPE)) {
+ // when the SHAPE type is provided by XML as Object, the whole result shape should be selected.
+ if (!aShape.get() && aShapeTypes.contains(ModuleBase_ResultPrs::Sel_Result)) {
aValid = true;
return aValid;
}
int XGUI_Displayer::getSelectionMode(int theShapeType)
{
- return (theShapeType >= TopAbs_SHAPE)? theShapeType :
- AIS_Shape::SelectionMode((TopAbs_ShapeEnum)theShapeType);
+ return (theShapeType > TopAbs_SHAPE) ? theShapeType :
+ AIS_Shape::SelectionMode((TopAbs_ShapeEnum)theShapeType);
}
bool XGUI_Displayer::isVisible(XGUI_Displayer* theDisplayer, const ObjectPtr& theObject)