#include <ModelAPI_AttributeSelection.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_AttributeBoolean.h>
+#include <ModelAPI_AttributeString.h>
+#include <ModelAPI_AttributeReference.h>
#include <GeomAlgoAPI_Extrusion.h>
using namespace std;
FeaturesPlugin_Extrusion::LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
// extrusion works with faces always
aSelection->setSelectionType("FACE");
- data()->addAttribute(FeaturesPlugin_Extrusion::SIZE_ID(), ModelAPI_AttributeDouble::typeId());
+
data()->addAttribute(FeaturesPlugin_Extrusion::REVERSE_ID(), ModelAPI_AttributeBoolean::typeId());
+ data()->addAttribute(FeaturesPlugin_Extrusion::TO_SIZE_ID(), ModelAPI_AttributeDouble::typeId());
+ //data()->addAttribute(FeaturesPlugin_Extrusion::FROM_SIZE_ID(), ModelAPI_AttributeDouble::typeId());
+
+ //data()->addAttribute(FeaturesPlugin_Extrusion::AXIS_OBJECT_ID(), ModelAPI_AttributeReference::typeId());
+
+ //data()->addAttribute(FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), ModelAPI_AttributeReference::typeId());
+ //data()->addAttribute(FeaturesPlugin_Extrusion::TO_OBJECT_ID(), ModelAPI_AttributeReference::typeId());
}
void FeaturesPlugin_Extrusion::execute()
setError(aContextError);
break;
}
- double aSize = real(FeaturesPlugin_Extrusion::SIZE_ID())->value();
+ double aSize = real(FeaturesPlugin_Extrusion::TO_SIZE_ID())->value();
if (boolean(FeaturesPlugin_Extrusion::REVERSE_ID())->value())
aSize = -aSize;
return MY_GROUP_LIST_ID;
}
+ /// attribute name of an object to which the extrusion grows
+ inline static const std::string& AXIS_OBJECT_ID()
+ {
+ static const std::string MY_TO_OBJECT_ID("axis_object");
+ return MY_TO_OBJECT_ID;
+ }
+
/// attribute name of extrusion size
- inline static const std::string& SIZE_ID()
+ inline static const std::string& TO_SIZE_ID()
{
- static const std::string MY_SIZE_ID("size");
- return MY_SIZE_ID;
+ static const std::string MY_TO_SIZE_ID("to_size");
+ return MY_TO_SIZE_ID;
}
- /// attribute name of reverse direction
- inline static const std::string& REVERSE_ID()
+
+ /// attribute name of extrusion size
+ inline static const std::string& FROM_SIZE_ID()
{
- static const std::string MY_REVERSE_ID("reverse");
- return MY_REVERSE_ID;
+ static const std::string MY_FROM_SIZE_ID("from_size");
+ return MY_FROM_SIZE_ID;
}
+ /// attribute name of an object to which the extrusion grows
+ inline static const std::string& TO_OBJECT_ID()
+ {
+ static const std::string MY_TO_OBJECT_ID("to_object");
+ return MY_TO_OBJECT_ID;
+ }
+
+ /// attribute name of tool object
+ inline static const std::string& FROM_OBJECT_ID()
+ {
+ static const std::string MY_FROM_OBJECT_ID("from_object");
+ return MY_FROM_OBJECT_ID;
+ }
+ /// attribute name of reverse direction
+ inline static const std::string& REVERSE_ID()
+ {
+ static const std::string MY_REVERSE_ID("reverse");
+ return MY_REVERSE_ID;
+ }
+
/// Returns the kind of a feature
FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
{
type_choice="Faces">
<validator id="PartSet_SketchEntityValidator" parameters="Sketch"/>
</multi_selector>
- <doublevalue
- id="size"
- label="Size"
- min="0"
- step="1.0"
- default="1"
- icon=":icons/dimension_v.png"
- tooltip="Height">
- <validator id="GeomValidators_Positive"/>
- </doublevalue>
- <boolvalue id="reverse" label="Reverse" default="false" tooltip="Reverse default direction"/>
+ <!--<groupbox title="From">
+ <shape_selector id="from_object"
+ icon=":icons/plane.png"
+ label="Plane face"
+ tooltip="Select a planar face"
+ shape_types="face" obligatory="false">
+ <validator id="GeomValidators_Face" parameters="plane"/>
+ </shape_selector>
+ <doublevalue
+ id="from_size"
+ label="Size"
+ min="0"
+ step="1.0"
+ default="0"
+ icon=":icons/dimension_down.png"
+ tooltip="Height"
+ obligatory="false">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </groupbox>-->
+ <groupbox title="To">
+ <!-- <shape_selector id="to_object"
+ icon=":icons/plane_inverted.png"
+ label="Plane face"
+ tooltip="Select a planar face"
+ shape_types="face"
+ obligatory="false">
+ <validator id="GeomValidators_Face" parameters="plane"/>
+ </shape_selector>-->
+ <doublevalue
+ id="to_size"
+ label="Size"
+ min="0"
+ step="1.0"
+ default="10"
+ icon=":icons/dimension_up.png"
+ tooltip="Height">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ <boolvalue id="reverse" label="Reverse" default="false" tooltip="Reverse default direction"/>
+ </groupbox>-->
+<!--XML definition of the revolution:-->
+<!-- <multi_selector id="base"
+ label="Select a sketch face"
+ icon=":icons/sketch.png"
+ tooltip="Select a sketch face"
+ type_choice="Faces">
+ <validator id="PartSet_SketchEntityValidator" parameters="Sketch"/>
+ </multi_selector>
+ <shape_selector id="axis_object"
+ icon=":icons/axis.png"
+ label="Plane face"
+ tooltip="Select a planar face"
+ shape_types="edge">
+ </shape_selector>
+ <groupbox title="From">
+ <shape_selector id="from_object"
+ icon=":icons/plane.png"
+ label="Plane face"
+ tooltip="Select a planar face"
+ shape_types="face">
+ <validator id="GeomValidators_Face" parameters="plane"/>
+ </shape_selector>
+ <doublevalue
+ id="from_size"
+ label="Size"
+ min="0"
+ step="1.0"
+ default="0"
+ icon=":icons/angle_down.png"
+ tooltip="Height">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </groupbox>
+ <groupbox title="To">
+ <shape_selector id="to_object"
+ icon=":icons/plane_inverted.png"
+ label="Plane face"
+ tooltip="Select a planar face"
+ shape_types="face">
+ <validator id="GeomValidators_Face" parameters="plane"/>
+ </shape_selector>
+ <doublevalue
+ id="to_size"
+ label="Size"
+ min="0"
+ step="1.0"
+ default="10"
+ icon=":icons/angle_up.png"
+ tooltip="Height">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </groupbox>-->
</source>