Removed fix for nested attributes not initialized.
#include <algorithm>
-static GeomAPI_Shape::ShapeType shapeTypeByStr(const std::string& theShapeTypeStr);
-static GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection);
+/*static GeomAPI_Shape::ShapeType shapeTypeByStr(const std::string& theShapeTypeStr);
+static GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection);*/
//==================================================================================================
ConstructionAPI_Point::ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature)
}
}
-//==================================================================================================
+/*//==================================================================================================
ConstructionAPI_Point::ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const ModelHighAPI_Selection& theEdge,
const ModelHighAPI_Double& theDistanceValue,
setByLineAndPlaneIntersection(theObject1, theObject2);
}
}
-}
+}*/
//==================================================================================================
ConstructionAPI_Point::~ConstructionAPI_Point()
const ModelHighAPI_Double& theY,
const ModelHighAPI_Double& theZ)
{
- fillAttribute(ConstructionPlugin_Point::CREATION_METHOD_BY_XYZ(), mycreationMethod);
+ //fillAttribute(ConstructionPlugin_Point::CREATION_METHOD_BY_XYZ(), mycreationMethod);
fillAttribute(theX, myx);
fillAttribute(theY, myy);
fillAttribute(theZ, myz);
execute();
}
-//==================================================================================================
+/*//==================================================================================================
void ConstructionAPI_Point::setByDistanceOnEdge(const ModelHighAPI_Selection& theEdge,
const ModelHighAPI_Double& theDistanceValue,
const bool theDistancePercent,
fillAttribute(theFace, myintersectionPlane);
execute();
-}
+}*/
//==================================================================================================
PointPtr addPoint(const std::shared_ptr<ModelAPI_Document>& thePart,
return PointPtr(new ConstructionAPI_Point(aFeature, theX, theY, theZ));
}
-//==================================================================================================
+/*//==================================================================================================
PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
const ModelHighAPI_Selection& theEdge,
const ModelHighAPI_Double& theDistanceValue,
}
return aShapeType;
-}
+}*/
const ModelHighAPI_Double& theY,
const ModelHighAPI_Double& theZ);
- /// Constructor with values.
+ /*/// Constructor with values.
CONSTRUCTIONAPI_EXPORT
ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const ModelHighAPI_Selection& theEdge,
CONSTRUCTIONAPI_EXPORT
ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const ModelHighAPI_Selection& theObject1,
- const ModelHighAPI_Selection& theObject2);
+ const ModelHighAPI_Selection& theObject2);*/
/// Destructor.
CONSTRUCTIONAPI_EXPORT
virtual ~ConstructionAPI_Point();
- INTERFACE_14(ConstructionPlugin_Point::ID(),
- creationMethod, ConstructionPlugin_Point::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
- x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */,
- y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */,
- z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */,
- edge, ConstructionPlugin_Point::EDGE(), ModelAPI_AttributeSelection, /** Edge attribute */,
- distanceValue, ConstructionPlugin_Point::DISTANCE_VALUE(), ModelAPI_AttributeDouble, /** Distance value attribute */,
- distancePercent, ConstructionPlugin_Point::DISTANCE_PERCENT(), ModelAPI_AttributeBoolean, /** Distance percent attribute */,
- reverse, ConstructionPlugin_Point::REVERSE(), ModelAPI_AttributeBoolean, /** Reverse attribute */,
- point, ConstructionPlugin_Point::POINT(), ModelAPI_AttributeSelection, /** Point attribute */,
- plane, ConstructionPlugin_Point::PLANE(), ModelAPI_AttributeSelection, /** Plane attribute */,
- firstLine, ConstructionPlugin_Point::FIRST_LINE(), ModelAPI_AttributeSelection, /** First line attribute */,
- secondLine, ConstructionPlugin_Point::SECOND_LINE(), ModelAPI_AttributeSelection, /** Second line attribute */,
- intersectionLine, ConstructionPlugin_Point::INTERSECTION_LINE(), ModelAPI_AttributeSelection, /** Intersection line attribute */,
- intersectionPlane, ConstructionPlugin_Point::INTERSECTION_PLANE(), ModelAPI_AttributeSelection, /** Intersection plane attribute */
- )
+ INTERFACE_3(ConstructionPlugin_Point::ID(),
+ x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */,
+ y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */,
+ z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */)
+
+ //INTERFACE_14(ConstructionPlugin_Point::ID(),
+ // creationMethod, ConstructionPlugin_Point::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
+ // x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */,
+ // y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */,
+ // z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */,
+ // edge, ConstructionPlugin_Point::EDGE(), ModelAPI_AttributeSelection, /** Edge attribute */,
+ // distanceValue, ConstructionPlugin_Point::DISTANCE_VALUE(), ModelAPI_AttributeDouble, /** Distance value attribute */,
+ // distancePercent, ConstructionPlugin_Point::DISTANCE_PERCENT(), ModelAPI_AttributeBoolean, /** Distance percent attribute */,
+ // reverse, ConstructionPlugin_Point::REVERSE(), ModelAPI_AttributeBoolean, /** Reverse attribute */,
+ // point, ConstructionPlugin_Point::POINT(), ModelAPI_AttributeSelection, /** Point attribute */,
+ // plane, ConstructionPlugin_Point::PLANE(), ModelAPI_AttributeSelection, /** Plane attribute */,
+ // firstLine, ConstructionPlugin_Point::FIRST_LINE(), ModelAPI_AttributeSelection, /** First line attribute */,
+ // secondLine, ConstructionPlugin_Point::SECOND_LINE(), ModelAPI_AttributeSelection, /** Second line attribute */,
+ // intersectionLine, ConstructionPlugin_Point::INTERSECTION_LINE(), ModelAPI_AttributeSelection, /** Intersection line attribute */,
+ // intersectionPlane, ConstructionPlugin_Point::INTERSECTION_PLANE(), ModelAPI_AttributeSelection, /** Intersection plane attribute */
+ //)
/// Set point values.
CONSTRUCTIONAPI_EXPORT
const ModelHighAPI_Double & theY,
const ModelHighAPI_Double & theZ);
- /// Set edge and distance on it for point.
+ /*/// Set edge and distance on it for point.
CONSTRUCTIONAPI_EXPORT
void setByDistanceOnEdge(const ModelHighAPI_Selection& theEdge,
const ModelHighAPI_Double& theDistanceValue,
/// Set line and plane for intersections.
CONSTRUCTIONAPI_EXPORT
void setByLineAndPlaneIntersection(const ModelHighAPI_Selection& theEdge,
- const ModelHighAPI_Selection& theFace);
+ const ModelHighAPI_Selection& theFace);*/
};
/// Pointer on Point object.
const ModelHighAPI_Double & theY,
const ModelHighAPI_Double & theZ);
-/// \ingroup CPPHighAPI
+/*/// \ingroup CPPHighAPI
/// \brief Create Point feature
CONSTRUCTIONAPI_EXPORT
PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
CONSTRUCTIONAPI_EXPORT
PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
const ModelHighAPI_Selection& theObject1,
- const ModelHighAPI_Selection& theObject2);
+ const ModelHighAPI_Selection& theObject2);*/
#endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */
//==================================================================================================
void ConstructionPlugin_Point::initAttributes()
{
- data()->addAttribute(CREATION_METHOD(), ModelAPI_AttributeString::typeId());
+ //data()->addAttribute(CREATION_METHOD(), ModelAPI_AttributeString::typeId());
data()->addAttribute(X(), ModelAPI_AttributeDouble::typeId());
data()->addAttribute(Y(), ModelAPI_AttributeDouble::typeId());
data()->addAttribute(Z(), ModelAPI_AttributeDouble::typeId());
-/*
- data()->addAttribute(EDGE(), ModelAPI_AttributeSelection::typeId());
+ /*data()->addAttribute(EDGE(), ModelAPI_AttributeSelection::typeId());
data()->addAttribute(DISTANCE_VALUE(), ModelAPI_AttributeDouble::typeId());
data()->addAttribute(DISTANCE_PERCENT(), ModelAPI_AttributeBoolean::typeId());
data()->addAttribute(REVERSE(), ModelAPI_AttributeBoolean::typeId());
data()->addAttribute(SECOND_LINE(), ModelAPI_AttributeSelection::typeId());
data()->addAttribute(INTERSECTION_LINE(), ModelAPI_AttributeSelection::typeId());
- data()->addAttribute(INTERSECTION_PLANE(), ModelAPI_AttributeSelection::typeId());
-*/
- string("creation_method")->setValue("by_xyz");
+ data()->addAttribute(INTERSECTION_PLANE(), ModelAPI_AttributeSelection::typeId());*/
}
//==================================================================================================
void ConstructionPlugin_Point::execute()
{
GeomShapePtr aShape = createByXYZ();
-/* GeomShapePtr aShape;
+
+ /*GeomShapePtr aShape;
std::string aCreationMethod = string(CREATION_METHOD())->value();
if(aCreationMethod == CREATION_METHOD_BY_XYZ()) {
aShape = createByLinesIntersection();
} else if(aCreationMethod == CREATION_METHOD_BY_LINE_AND_PLANE_INTERSECTION()) {
aShape = createByLineAndPlaneIntersection();
- }
- */
+ }*/
+
if(!aShape.get()) {
return;
}
real(Z())->value());
}
-//==================================================================================================
+/*//==================================================================================================
std::shared_ptr<GeomAPI_Vertex> ConstructionPlugin_Point::createByDistanceOnEdge()
{
// Get edge.
std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aPlaneShape));
return GeomAlgoAPI_PointBuilder::vertexByIntersection(anEdge, aFace);
-}
+}*/
return CONSTRUCTION_POINT_KIND;
}
- /// Attribute name for creation method.
+ /*/// Attribute name for creation method.
inline static const std::string& CREATION_METHOD()
{
static const std::string MY_CREATION_METHOD_ID("creation_method");
{
static const std::string MY_CREATION_METHOD_ID("by_line_and_plane_intersection");
return MY_CREATION_METHOD_ID;
- }
+ }*/
/// Attribute name for X coordinate.
inline static const std::string& X()
return POINT_ATTR_Z;
}
- /// Attribute name for selected edge.
+ /*/// Attribute name for selected edge.
inline static const std::string& EDGE()
{
static const std::string ATTR_ID("edge");
{
static const std::string ATTR_ID("intersection_plane");
return ATTR_ID;
- }
+ }*/
/// Creates a new part document if needed.
CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
private:
std::shared_ptr<GeomAPI_Vertex> createByXYZ();
- std::shared_ptr<GeomAPI_Vertex> createByDistanceOnEdge();
+ /*std::shared_ptr<GeomAPI_Vertex> createByDistanceOnEdge();
std::shared_ptr<GeomAPI_Vertex> createByProjection();
std::shared_ptr<GeomAPI_Vertex> createByLinesIntersection();
- std::shared_ptr<GeomAPI_Vertex> createByLineAndPlaneIntersection();
+ std::shared_ptr<GeomAPI_Vertex> createByLineAndPlaneIntersection();*/
};
<doublevalue id="x" label="X " tooltip="X coordinate" default="0"/>
<doublevalue id="y" label="Y " tooltip="Y coordinate" default="0"/>
<doublevalue id="z" label="Z " tooltip="Z coordinate" default="0"/>
+
<!--<toolbox id="creation_method">
<box id="by_xyz"
title="By X, Y, Z"
#include <memory>
-#define NESTED_WIDGETS_FIX
-
// the only created instance of this plugin
static InitializationPlugin_Plugin* MY_INITIALIZATIONPLUGIN_INSTANCE =
new InitializationPlugin_Plugin();
{
FeaturePtr aPlane = theDoc->addFeature("Plane");
aPlane->string("creation_method")->setValue("by_general_equation");
-#ifdef NESTED_WIDGETS_FIX
- aPlane->string("by_other_plane_option")->setValue("by_distance_from_other");
- aPlane->real("distance")->setValue(0);
-#endif
aPlane->real("A")->setValue(theX);
aPlane->real("B")->setValue(theY);
aPlane->real("C")->setValue(theZ);
double theX, double theY, double theZ)
{
std::shared_ptr<ModelAPI_Feature> aPoint = theDoc->addFeature("Point");
- aPoint->string("creation_method")->setValue("by_xyz");
+ //aPoint->string("creation_method")->setValue("by_xyz");
aPoint->real("x")->setValue(theX);
aPoint->real("y")->setValue(theY);
aPoint->real("z")->setValue(theZ);
aAxis->real("Y_Direction")->setValue(theY);
aAxis->real("Z_Direction")->setValue(theZ);
-#ifdef NESTED_WIDGETS_FIX
- aAxis->string("use_offset1")->setValue("");
- aAxis->real("offset1")->setValue(0);
- aAxis->boolean("reverse_offset1")->setValue(false);
- aAxis->string("use_offset2")->setValue("");
- aAxis->real("offset2")->setValue(0);
- aAxis->boolean("reverse_offset2")->setValue(false);
-#endif
-
if (theX != 0) {
aAxis->data()->setName("OX");
} else if (theY != 0) {