}
//********************************************************************
-QIntList ModuleBase_WidgetMultiSelector::getShapeTypes() const
+QIntList ModuleBase_WidgetMultiSelector::shapeTypes() const
{
QIntList aShapeTypes;
aShapeTypes.append(ModuleBase_Tools::shapeType(myTypeCombo->currentText()));
}
else {
- for (int i = 0, aCount = myTypeCombo->count(); i < aCount; i++) {
- TopAbs_ShapeEnum aType = ModuleBase_Tools::shapeType(myTypeCombo->itemText(i));
- aShapeTypes.append(aType);
- if (aType == TopAbs_SOLID)
- aShapeTypes.append(TopAbs_COMPSOLID);
- }
+ for (int i = 0, aCount = myTypeCombo->count(); i < aCount; i++)
+ aShapeTypes.append(ModuleBase_Tools::shapeType(myTypeCombo->itemText(i)));
}
return aShapeTypes;
}
/// Retunrs a list of possible shape types
/// \return a list of shapes
- virtual QIntList getShapeTypes() const;
+ virtual QIntList shapeTypes() const;
/// Set current shape type for selection
void setCurrentShapeType(const TopAbs_ShapeEnum theShapeType);
updateFocus();
}
+//********************************************************************
+QIntList ModuleBase_WidgetSelector::getShapeTypes() const
+{
+ QIntList aShapeTypes = shapeTypes();
+ if (aShapeTypes.contains(TopAbs_SOLID) || aShapeTypes.contains(TopAbs_SHAPE)) {
+ // it should be selectable for both, "solids" and "objects" types
+ aShapeTypes.append(TopAbs_COMPSOLID);
+ }
+ return aShapeTypes;
+}
+
//********************************************************************
QList<ModuleBase_ViewerPrsPtr> ModuleBase_WidgetSelector::getAttributeSelection() const
{
/// Retunrs a list of possible shape types
/// \return a list of shapes
- virtual QIntList getShapeTypes() const = 0;
+ QIntList getShapeTypes() const;
+
+ /// Retunrs a list of possible shape types
+ /// \return a list of shapes
+ virtual QIntList shapeTypes() const = 0;
/// Computes and updates name of selected object in the widget
// NDS: has body is temporary
}
//********************************************************************
-QIntList ModuleBase_WidgetShapeSelector::getShapeTypes() const
+QIntList ModuleBase_WidgetShapeSelector::shapeTypes() const
{
QIntList aShapeTypes;
foreach(QString aType, myShapeTypes) {
/// Retunrs a list of possible shape types
/// \return a list of shapes
- virtual QIntList getShapeTypes() const;
+ virtual QIntList shapeTypes() const;
/// Get the shape from the attribute if the attribute contains a shape, e.g. selection attribute
/// \return a shape
}
}
-QIntList PartSet_WidgetSketchCreator::getShapeTypes() const
+QIntList PartSet_WidgetSketchCreator::shapeTypes() const
{
QIntList aShapeTypes;
foreach(QString aType, myShapeTypes) {
/// Retunrs a list of possible shape types
/// \return a list of shapes
- virtual QIntList getShapeTypes() const;
+ virtual QIntList shapeTypes() const;
/// Emits model changed info, updates the current control by selection change
/// \param theDone a state whether the selection is set