INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
ADD_UNIT_TESTS(TestAPI_Box.py
+ TestAPI_Cylinder.py
TestAPI_GDMLConeSegment.py
TestAPI_Symmetry.py
TestAPI_Translation.py)
if (fabs(aDiffX) < Precision::Confusion() ||
fabs(aDiffY) < Precision::Confusion() ||
fabs(aDiffZ) < Precision::Confusion()) {
- myError =
+ myError =
"Box builder with points :: the points belong both to one of the OXY, OYZ or OZX planes";
return false;
}
void GeomAlgoAPI_Cylinder::build()
{
myCreatedFaces.clear();
-
+
const gp_Ax2& anAxis = myAxis->impl<gp_Ax2>();
-
+
// Construct the cylinder
BRepPrimAPI_MakeCylinder *aCylinderMaker;
-
+
if (withAngle) {
- aCylinderMaker = new BRepPrimAPI_MakeCylinder(anAxis, myRadius, myHeight, myAngle * M_PI / 180.);
+ aCylinderMaker =
+ new BRepPrimAPI_MakeCylinder(anAxis, myRadius, myHeight, myAngle * M_PI / 180.);
} else {
- aCylinderMaker = new BRepPrimAPI_MakeCylinder(anAxis, myRadius, myHeight);
+ aCylinderMaker = new BRepPrimAPI_MakeCylinder(anAxis, myRadius, myHeight);
}
-
+
aCylinderMaker->Build();
-
+
if (!aCylinderMaker->IsDone()) {
return;
}
myError = "Cylinder builder :: resulting shape is null.";
return;
}
-
+
setImpl(aCylinderMaker);
-
+
setDone(true);
}
public:
GEOMALGOAPI_EXPORT GeomAlgoAPI_Cylinder();
- /// Creates a cylinder
+ /// Creates a cylinder.
/// \param theAxis The axis of the cylinder
/// \param theRadius The radius of the cylinder
/// \param theHeight The height of the cylinder
- /// \param theAngle The covering angle of the cylinder
GEOMALGOAPI_EXPORT GeomAlgoAPI_Cylinder(std::shared_ptr<GeomAPI_Ax2> theAxis,
const double theRadius,
const double theHeight);
- /// Creates a cylinder
+ /// Creates a cylinder.
/// \param theAxis The axis of the cylinder
/// \param theRadius The radius of the cylinder
/// \param theHeight The height of the cylinder
GEOMALGOAPI_EXPORT void build();
private:
- bool withAngle;
- std::shared_ptr<GeomAPI_Pnt> myBasePoint;
+ bool withAngle; /// Boolean indicating if the type of cylinder (full or portion).
+ std::shared_ptr<GeomAPI_Pnt> myBasePoint; /// Center of the lower base of the cylinder.
std::shared_ptr<GeomAPI_Ax2> myAxis; /// Axis of the cylinder.
double myRadius; /// Radius of the cylinder.
double myHeight; /// Height of the cylinder.
#include "GeomAlgoAPI_ShapeAPI.h"
#include <GeomAlgoAPI_Box.h>
+#include <GeomAlgoAPI_Cylinder.h>
#include <GeomAlgoAPI_ConeSegment.h>
#include <GeomAlgoAPI_EdgeBuilder.h>
#include <GeomAlgoAPI_Symmetry.h>
#include <GeomAlgoAPI_Translation.h>
+#include <GeomAPI_Lin.h>
+
namespace GeomAlgoAPI_ShapeAPI
{
- //=======================================================================================
+ //===============================================================================================
std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeBox(
const double theDx, const double theDy,
const double theDz) throw (GeomAlgoAPI_Exception)
return aBoxAlgo.shape();
}
- //======================================================================================
+ //===============================================================================================
std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeBox(
std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception)
return aBoxAlgo.shape();
}
- //=========================================================================================================
+ //===============================================================================================
+ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeCylinder(
+ std::shared_ptr<GeomAPI_Pnt> theBasePoint, std::shared_ptr<GeomAPI_Edge> theEdge,
+ double theRadius, double theHeight) throw (GeomAlgoAPI_Exception)
+ {
+ std::shared_ptr<GeomAPI_Ax2> anAxis;
+ anAxis = std::shared_ptr<GeomAPI_Ax2>(new GeomAPI_Ax2(theBasePoint,
+ theEdge->line()->direction()));
+
+ GeomAlgoAPI_Cylinder aCylinderAlgo(anAxis, theRadius, theHeight);
+
+ if (!aCylinderAlgo.check()) {
+ throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
+ }
+
+ aCylinderAlgo.build();
+
+ if(!aCylinderAlgo.isDone()) {
+ throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
+ }
+ if (!aCylinderAlgo.checkValid("Cylinder builder")) {
+ throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
+ }
+ return aCylinderAlgo.shape();
+ }
+
+ //===============================================================================================
+ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeCylinder(
+ std::shared_ptr<GeomAPI_Pnt> theBasePoint, std::shared_ptr<GeomAPI_Edge> theEdge,
+ double theRadius, double theHeight, double theAngle) throw (GeomAlgoAPI_Exception)
+ {
+ std::shared_ptr<GeomAPI_Ax2> anAxis;
+ anAxis = std::shared_ptr<GeomAPI_Ax2>(new GeomAPI_Ax2(theBasePoint,
+ theEdge->line()->direction()));
+
+ GeomAlgoAPI_Cylinder aCylinderAlgo(anAxis, theRadius, theHeight, theAngle);
+
+ if (!aCylinderAlgo.check()) {
+ throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
+ }
+
+ aCylinderAlgo.build();
+
+ if(!aCylinderAlgo.isDone()) {
+ throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
+ }
+ if (!aCylinderAlgo.checkValid("Cylinder portion builder")) {
+ throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
+ }
+ return aCylinderAlgo.shape();
+ }
+
+ //===============================================================================================
+ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeCylinder(
+ double theRadius, double theHeight) throw (GeomAlgoAPI_Exception)
+ {
+ std::shared_ptr<GeomAPI_Pnt> aBasePoint =
+ std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(0.,0.,0.));
+ std::shared_ptr<GeomAPI_Edge> aEdge = GeomAlgoAPI_EdgeBuilder::line(0., 0., 1.);
+ std::shared_ptr<GeomAPI_Ax2> anAxis;
+ anAxis = std::shared_ptr<GeomAPI_Ax2>(new GeomAPI_Ax2(aBasePoint,
+ aEdge->line()->direction()));
+
+ GeomAlgoAPI_Cylinder aCylinderAlgo(anAxis, theRadius, theHeight);
+
+ if (!aCylinderAlgo.check()) {
+ throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
+ }
+
+ aCylinderAlgo.build();
+
+ if(!aCylinderAlgo.isDone()) {
+ throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
+ }
+ if (!aCylinderAlgo.checkValid("Cylinder builder")) {
+ throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
+ }
+ return aCylinderAlgo.shape();
+ }
+
+ //===============================================================================================
+ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeCylinder(
+ double theRadius, double theHeight, double theAngle) throw (GeomAlgoAPI_Exception)
+ {
+ std::shared_ptr<GeomAPI_Pnt> aBasePoint =
+ std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(0.,0.,0.));
+ std::shared_ptr<GeomAPI_Edge> aEdge = GeomAlgoAPI_EdgeBuilder::line(0., 0., 1.);
+ std::shared_ptr<GeomAPI_Ax2> anAxis;
+ anAxis = std::shared_ptr<GeomAPI_Ax2>(new GeomAPI_Ax2(aBasePoint,
+ aEdge->line()->direction()));
+
+ GeomAlgoAPI_Cylinder aCylinderAlgo(anAxis, theRadius, theHeight, theAngle);
+
+ if (!aCylinderAlgo.check()) {
+ throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
+ }
+
+ aCylinderAlgo.build();
+
+ if(!aCylinderAlgo.isDone()) {
+ throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
+ }
+ if (!aCylinderAlgo.checkValid("Cylinder portion builder")) {
+ throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
+ }
+ return aCylinderAlgo.shape();
+ }
+
+ //===============================================================================================
std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeTranslation(
std::shared_ptr<GeomAPI_Shape> theSourceShape,
std::shared_ptr<GeomAPI_Ax1> theAxis,
return aTranslationAlgo.shape();
}
- //=========================================================================================================
+ //===============================================================================================
std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeTranslation(
std::shared_ptr<GeomAPI_Shape> theSourceShape,
const double theDx,
return aTranslationAlgo.shape();
}
- //=========================================================================================================
+ //===============================================================================================
std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeTranslation(
std::shared_ptr<GeomAPI_Shape> theSourceShape,
std::shared_ptr<GeomAPI_Pnt> theStartPoint,
return aTranslationAlgo.shape();
}
- //=========================================================================================================
+ //===============================================================================================
std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeSymmetry(
std::shared_ptr<GeomAPI_Shape> theSourceShape,
std::shared_ptr<GeomAPI_Pnt> thePoint) throw (GeomAlgoAPI_Exception)
return aSymmetryAlgo.shape();
}
- //=========================================================================================================
+ //===============================================================================================
std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeSymmetry(
std::shared_ptr<GeomAPI_Shape> theSourceShape,
std::shared_ptr<GeomAPI_Ax1> theAxis) throw (GeomAlgoAPI_Exception)
return aSymmetryAlgo.shape();
}
- //=========================================================================================================
+ //===============================================================================================
std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeSymmetry(
std::shared_ptr<GeomAPI_Shape> theSourceShape,
std::shared_ptr<GeomAPI_Ax2> thePlane) throw (GeomAlgoAPI_Exception)
return aSymmetryAlgo.shape();
}
- //=========================================================================================================
+ //===============================================================================================
std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeConeSegment(
const double theRMin1, const double theRMax1,
const double theRMin2, const double theRMax2,
static std::shared_ptr<GeomAPI_Shape> makeBox(std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception);
+ /// Creates a cylinder using a center, an axis, a radius and a height.
+ /// \param theBasePoint The center of the lower base of the cylinder
+ /// \param theEdge The axis of the cylinder
+ /// \param theRadius The radius of the cylinder
+ /// \param theHeight The heigth of the cylinder
+ static std::shared_ptr<GeomAPI_Shape> makeCylinder(std::shared_ptr<GeomAPI_Pnt> theBasePoint,
+ std::shared_ptr<GeomAPI_Edge> theEdge, double theRadius, double theHeight)
+ throw (GeomAlgoAPI_Exception);
+
+ /// Creates a portion of cylinder using a center, an axis, a radius, a height and an angle.
+ /// \param theBasePoint The center of the lower base of the cylinder
+ /// \param theEdge The axis of the cylinder
+ /// \param theRadius The radius of the cylinder
+ /// \param theHeight The heigth of the cylinder
+ /// \param theAngle The angle defining the portion
+ static std::shared_ptr<GeomAPI_Shape> makeCylinder(std::shared_ptr<GeomAPI_Pnt> theBasePoint,
+ std::shared_ptr<GeomAPI_Edge> theEdge, double theRadius, double theHeight,
+ double theAngle) throw (GeomAlgoAPI_Exception);
+
+ /// Creates a cylinder using the origin, the OZ axis, a radius and a height.
+ /// \param theRadius The radius of the cylinder
+ /// \param theHeight The heigth of the cylinder
+ static std::shared_ptr<GeomAPI_Shape> makeCylinder(double theRadius, double theHeight)
+ throw (GeomAlgoAPI_Exception);
+
+ /// Creates a portion of cylinder using the origin, the OZ axis, a radius, a height and an angle.
+ /// \param theRadius The radius of the cylinder
+ /// \param theHeight The heigth of the cylinder
+ /// \param theAngle The angle defining the portion
+ static std::shared_ptr<GeomAPI_Shape> makeCylinder(double theRadius, double theHeight,
+ double theAngle) throw (GeomAlgoAPI_Exception);
+
/// Performs a translation from an axis and a distance.
- /// \param theSourceShape Shape to be moved.
- /// \param theAxis Movement axis.
- /// \param theDistance Movement distance.
+ /// \param theSourceShape Shape to be moved
+ /// \param theAxis Movement axis
+ /// \param theDistance Movement distance
/// \return a shape
static std::shared_ptr<GeomAPI_Shape> makeTranslation(
std::shared_ptr<GeomAPI_Shape> theSourceShape,
const double theDistance) throw (GeomAlgoAPI_Exception);
/// Performs a translation from dimensions.
- /// \param theSourceShape Shape to be moved.
- /// \param theDx Movement dimension on X.
- /// \param theDy Movement dimension on Y.
- /// \param theDz Movement dimension on Z.
+ /// \param theSourceShape Shape to be moved
+ /// \param theDx Movement dimension on X
+ /// \param theDy Movement dimension on Y
+ /// \param theDz Movement dimension on Z
/// \return a shape
static std::shared_ptr<GeomAPI_Shape> makeTranslation(
std::shared_ptr<GeomAPI_Shape> theSourceShape,
const double theDz) throw (GeomAlgoAPI_Exception);
/// Performs a translation from two points.
- /// \param theSourceShape Shape to be moved.
- /// \param theStartPoint Movement start point.
- /// \param theEndPoint Movement end point.
+ /// \param theSourceShape Shape to be moved
+ /// \param theStartPoint Movement start point
+ /// \param theEndPoint Movement end point
/// \return a shape
static std::shared_ptr<GeomAPI_Shape> makeTranslation(
std::shared_ptr<GeomAPI_Shape> theSourceShape,
std::shared_ptr<GeomAPI_Pnt> theStartPoint,
std::shared_ptr<GeomAPI_Pnt> theEndPoint) throw (GeomAlgoAPI_Exception);
- /// Performs a symmetry by a point
+ /// Performs a symmetry by a point.
+ /// \param theSourceShape Shape be symmetrized
+ /// \param thePoint Point of symmetry
static std::shared_ptr<GeomAPI_Shape> makeSymmetry(
std::shared_ptr<GeomAPI_Shape> theSourceShape,
std::shared_ptr<GeomAPI_Pnt> thePoint) throw (GeomAlgoAPI_Exception);
- /// Performs a symmetry by an axis
+ /// Performs a symmetry by an axis.
+ /// \param theSourceShape Shape be symmetrized
+ /// \param theAxis Axis of symmetry
static std::shared_ptr<GeomAPI_Shape> makeSymmetry(
std::shared_ptr<GeomAPI_Shape> theSourceShape,
std::shared_ptr<GeomAPI_Ax1> theAxis) throw (GeomAlgoAPI_Exception);
- /// Performs a symmetry by a plane
+ /// Performs a symmetry by a plane.
+ /// \param theSourceShape Shape be symmetrized
+ /// \param thePlane Plane of symmetry
static std::shared_ptr<GeomAPI_Shape> makeSymmetry(
std::shared_ptr<GeomAPI_Shape> theSourceShape,
std::shared_ptr<GeomAPI_Ax2> thePlane) throw (GeomAlgoAPI_Exception);
- /// Creates a cone segment using standard GDML parameters
+ /// Creates a cone segment using standard GDML parameters.
/// \param theRMin1 Inner radius at base of cone
/// \param theRMax1 Outer radius at base of cone
/// \param theRMin2 Inner radius at top of cone
--- /dev/null
+# Copyright (C) 2014-201x CEA/DEN, EDF R&D
+
+# File: TestAPI_Cylinder.py
+# Created: 13 Jan 2017
+# Author: Clarisse Genrault (CEA)
+
+from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
+from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
+from GeomAlgoAPI import GeomAlgoAPI_EdgeBuilder as edgeBuilder
+from GeomAPI import GeomAPI_Pnt as pnt
+
+aPoint = pnt(10.,5.,0.)
+anEdge = edgeBuilder.line(1.,0.,0.)
+
+# Create a cylinder
+try :
+ cylinder1 = shaperpy.makeCylinder(5., 20.)
+
+except myExcept,ec:
+ print ec.what()
+
+# Create a cylinder
+try :
+ cylinder2 = shaperpy.makeCylinder(5., 20., 100.)
+
+except myExcept,ec:
+ print ec.what()
+
+# Create a cylinder
+try :
+ cylinder3 = shaperpy.makeCylinder(aPoint, anEdge, 5., 20.)
+
+except myExcept,ec:
+ print ec.what()
+
+# Create a cylinder
+try :
+ cylinder4 = shaperpy.makeCylinder(aPoint, anEdge, 5., 20., 180.)
+
+except myExcept,ec:
+ print ec.what()
\ No newline at end of file
// shared pointers
%shared_ptr(PrimitivesAPI_Box)
- %shared_ptr(PrimitivesAPI_Cylinder)
+%shared_ptr(PrimitivesAPI_Cylinder)
// all supported interfaces
%include "PrimitivesAPI_Box.h"
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+// Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
-// File: PrimitivesAPI_Cylinder.h
+// File: PrimitivesAPI_Cylinder.cpp
// Created: 12 Jan 2017
-// Author: Clarisse Genrault (CEA)
+// Author: Clarisse Genrault
#include "PrimitivesAPI_Cylinder.h"
//==================================================================================================
PrimitivesAPI_Cylinder::PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const ModelHighAPI_Selection& theBasePoint,
- const ModelHighAPI_Selection& theAxis,
- const ModelHighAPI_Double& theRadius,
- const ModelHighAPI_Double& theHeight)
+ const ModelHighAPI_Selection& theBasePoint,
+ const ModelHighAPI_Selection& theAxis,
+ const ModelHighAPI_Double& theRadius,
+ const ModelHighAPI_Double& theHeight)
: ModelHighAPI_Interface(theFeature)
{
if (initialize()) {
- fillAttribute(PrimitivesPlugin_Cylinder::CREATION_METHOD_CYLINDER(), creationMethod());
- setObjects(theBasePoint, theAxis);
+ fillAttribute(theBasePoint, basePoint());
+ fillAttribute(theAxis, axis());
setSizes(theRadius, theHeight);
}
}
//==================================================================================================
PrimitivesAPI_Cylinder::PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const ModelHighAPI_Selection& theBasePoint,
- const ModelHighAPI_Selection& theAxis,
- const ModelHighAPI_Double& theRadius,
- const ModelHighAPI_Double& theHeight,
- const ModelHighAPI_Double& theAngle)
+ const ModelHighAPI_Selection& theBasePoint,
+ const ModelHighAPI_Selection& theAxis,
+ const ModelHighAPI_Double& theRadius,
+ const ModelHighAPI_Double& theHeight,
+ const ModelHighAPI_Double& theAngle)
: ModelHighAPI_Interface(theFeature)
{
if (initialize()) {
- fillAttribute(PrimitivesPlugin_Cylinder::CREATION_METHOD_CYLINDER_PORTION(), creationMethod());
- setObjects(theBasePoint, theAxis);
+ fillAttribute(theBasePoint, basePoint());
+ fillAttribute(theAxis, axis());
+ fillAttribute(theAngle, angle());
setSizes(theRadius, theHeight);
- setAngle(theAngle);
}
}
//==================================================================================================
-void PrimitivesAPI_Cylinder::setObjects(const ModelHighAPI_Selection& theBasePoint,
- const ModelHighAPI_Selection& theAxis)
+PrimitivesAPI_Cylinder::~PrimitivesAPI_Cylinder()
{
- fillAttribute(theBasePoint, basePoint());
- fillAttribute(theAxis, axis());
- execute();
}
//==================================================================================================
{
fillAttribute(theRadius, radius());
fillAttribute(theHeight, height());
-
- execute();
-}
-
-//==================================================================================================
-void PrimitivesAPI_Cylinder::setAngle(const ModelHighAPI_Double& theAngle)
-{
- fillAttribute(theAngle, angle());
-
execute();
}
theDumper << aBase << " = model.addCylinder(" << aDocName;
- std::string aCreationMethod = aBase->string(PrimitivesPlugin_Cylinder::CREATION_METHOD())->value();
-
AttributeSelectionPtr anAttrBasePoint =
aBase->selection(PrimitivesPlugin_Cylinder::BASE_POINT_ID());
AttributeSelectionPtr anAttrAxis = aBase->selection(PrimitivesPlugin_Cylinder::AXIS_ID());
+ theDumper << ", " << anAttrBasePoint << ", " << anAttrAxis;
+
AttributeDoublePtr anAttrRadius = aBase->real(PrimitivesPlugin_Cylinder::RADIUS_ID());
AttributeDoublePtr anAttrHeight = aBase->real(PrimitivesPlugin_Cylinder::HEIGHT_ID());
-
- theDumper << ", " << anAttrBasePoint << ", " << anAttrAxis;
theDumper << ", " << anAttrRadius << ", " << anAttrHeight;
-
+
+ std::string aCreationMethod =
+ aBase->string(PrimitivesPlugin_Cylinder::CREATION_METHOD())->value();
+
if (aCreationMethod == PrimitivesPlugin_Cylinder::CREATION_METHOD_CYLINDER_PORTION()) {
AttributeDoublePtr anAttrAngle = aBase->real(PrimitivesPlugin_Cylinder::ANGLE_ID());
theDumper << ", " << anAttrAngle;
const ModelHighAPI_Selection& theBasePoint,
const ModelHighAPI_Selection& theAxis,
const ModelHighAPI_Double& theRadius,
- const ModelHighAPI_Double& theHeight,
- const ModelHighAPI_Double& theAngle)
+ const ModelHighAPI_Double& theHeight)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PrimitivesAPI_Cylinder::ID());
return CylinderPtr(new PrimitivesAPI_Cylinder(aFeature, theBasePoint, theAxis,
- theRadius, theHeight, theAngle));
+ theRadius, theHeight));
}
//==================================================================================================
const ModelHighAPI_Selection& theBasePoint,
const ModelHighAPI_Selection& theAxis,
const ModelHighAPI_Double& theRadius,
- const ModelHighAPI_Double& theHeight)
+ const ModelHighAPI_Double& theHeight,
+ const ModelHighAPI_Double& theAngle)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PrimitivesAPI_Cylinder::ID());
return CylinderPtr(new PrimitivesAPI_Cylinder(aFeature, theBasePoint, theAxis,
- theRadius, theHeight));
+ theRadius, theHeight, theAngle));
}
//==================================================================================================
CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
const ModelHighAPI_Double& theRadius,
- const ModelHighAPI_Double& theHeight,
- const ModelHighAPI_Double& theAngle)
+ const ModelHighAPI_Double& theHeight)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PrimitivesAPI_Cylinder::ID());
ModelHighAPI_Selection aBasePoint("VERT", "Origin");
ModelHighAPI_Selection anAxis("EDGE", "OZ");
+ std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PrimitivesAPI_Cylinder::ID());
return CylinderPtr(new PrimitivesAPI_Cylinder(aFeature, aBasePoint, anAxis,
- theRadius, theHeight, theAngle));
+ theRadius, theHeight));
}
//==================================================================================================
CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
const ModelHighAPI_Double& theRadius,
- const ModelHighAPI_Double& theHeight)
+ const ModelHighAPI_Double& theHeight,
+ const ModelHighAPI_Double& theAngle)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PrimitivesAPI_Cylinder::ID());
ModelHighAPI_Selection aBasePoint("VERT", "Origin");
ModelHighAPI_Selection anAxis("EDGE", "OZ");
+ std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PrimitivesAPI_Cylinder::ID());
return CylinderPtr(new PrimitivesAPI_Cylinder(aFeature, aBasePoint, anAxis,
theRadius, theHeight));
}
\ No newline at end of file
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+// Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
// File: PrimitivesAPI_Cylinder.h
// Created: 12 Jan 2017
-// Author: Clarisse Genrault (CEA)
+// Author: Clarisse Genrault
#ifndef PRIMITIVESAPI_CYLINDER_H_
#define PRIMITIVESAPI_CYLINDER_H_
class ModelHighAPI_Double;
class ModelHighAPI_Selection;
-/// \class PrimitivesAPI_Cylinder
+/// \class PrimitivesAPI_Box
/// \ingroup CPPHighAPI
-/// \brief Interface for primitive Cylinder feature.
+/// \brief Interface for primitive Box feature.
class PrimitivesAPI_Cylinder: public ModelHighAPI_Interface
{
public:
PRIMITIVESAPI_EXPORT
explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+ /// Constructor with values.
+ /*PRIMITIVESAPI_EXPORT
+ explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const ModelHighAPI_Double& theDx,
+ const ModelHighAPI_Double& theDy,
+ const ModelHighAPI_Double& theDz);*/
+
/// Constructor with values.
PRIMITIVESAPI_EXPORT
explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const ModelHighAPI_Selection& theAxis,
const ModelHighAPI_Double& theRadius,
const ModelHighAPI_Double& theHeight);
+
+ /// Constructor with values.
PRIMITIVESAPI_EXPORT
explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const ModelHighAPI_Selection& theBasePoint,
const ModelHighAPI_Double& theHeight,
const ModelHighAPI_Double& theAngle);
- /// Constructor with values.
- /*PRIMITIVESAPI_EXPORT
- explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const ModelHighAPI_Selection& theFirstPoint,
- const ModelHighAPI_Selection& theSecondPoint);*/
-
/// Destructor.
PRIMITIVESAPI_EXPORT
virtual ~PrimitivesAPI_Cylinder();
INTERFACE_6(PrimitivesPlugin_Cylinder::ID(),
- creationMethod, PrimitivesPlugin_Cylinder::CREATION_METHOD(),
- ModelAPI_AttributeString, /** Creation method */,
- basePoint, PrimitivesPlugin_Cylinder::BASE_POINT_ID(),
- ModelAPI_AttributeSelection, /** Base point */,
- axis, PrimitivesPlugin_Cylinder::AXIS_ID(),
- ModelAPI_AttributeSelection, /** Axis */,
- radius, PrimitivesPlugin_Cylinder::RADIUS_ID(),
- ModelAPI_AttributeDouble, /** Radius */,
- height, PrimitivesPlugin_Cylinder::HEIGHT_ID(),
- ModelAPI_AttributeDouble, /** Height */,
- angle, PrimitivesPlugin_Cylinder::ANGLE_ID(),
- ModelAPI_AttributeDouble, /** Angle */)
-
- /// Set base point and axis
- PRIMITIVESAPI_EXPORT
- void setObjects(const ModelHighAPI_Selection& theBasePoint,
- const ModelHighAPI_Selection& theAxis);
-
- /// Set radius and height
+ creationMethod, PrimitivesPlugin_Cylinder::CREATION_METHOD(),
+ ModelAPI_AttributeString, /** Creation method */,
+ basePoint, PrimitivesPlugin_Cylinder::BASE_POINT_ID(),
+ ModelAPI_AttributeSelection, /** Dimension in X */,
+ axis, PrimitivesPlugin_Cylinder::AXIS_ID(),
+ ModelAPI_AttributeSelection, /** Dimension in Y */,
+ radius, PrimitivesPlugin_Cylinder::RADIUS_ID(),
+ ModelAPI_AttributeDouble, /** Dimension in Z */,
+ height, PrimitivesPlugin_Cylinder::HEIGHT_ID(),
+ ModelAPI_AttributeDouble, /** First point */,
+ angle, PrimitivesPlugin_Cylinder::ANGLE_ID(),
+ ModelAPI_AttributeDouble, /** Second point */)
+
+ /// Set dimensions
PRIMITIVESAPI_EXPORT
void setSizes(const ModelHighAPI_Double& theRadius,
const ModelHighAPI_Double& theHeight);
- /// Set angle
- PRIMITIVESAPI_EXPORT
- void setAngle(const ModelHighAPI_Double& theAngle);
-
/// Dump wrapped feature
PRIMITIVESAPI_EXPORT
virtual void dump(ModelHighAPI_Dumper& theDumper) const;
typedef std::shared_ptr<PrimitivesAPI_Cylinder> CylinderPtr;
/// \ingroup CPPHighAPI
-/// \brief Create primitive Cylinder feature.
+/// \brief Create primitive Box feature.
PRIMITIVESAPI_EXPORT
CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
const ModelHighAPI_Selection& theBasePoint,
const ModelHighAPI_Selection& theAxis,
const ModelHighAPI_Double& theRadius,
- const ModelHighAPI_Double& theHeight,
- const ModelHighAPI_Double& theAngle);
+ const ModelHighAPI_Double& theHeight);
/// \ingroup CPPHighAPI
-/// \brief Create primitive Cylinder feature.
+/// \brief Create primitive Box feature.
PRIMITIVESAPI_EXPORT
CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
const ModelHighAPI_Selection& theBasePoint,
const ModelHighAPI_Selection& theAxis,
const ModelHighAPI_Double& theRadius,
- const ModelHighAPI_Double& theHeight);
+ const ModelHighAPI_Double& theHeight,
+ const ModelHighAPI_Double& theAngle);
+
/// \ingroup CPPHighAPI
-/// \brief Create primitive Cylinder feature.
+/// \brief Create primitive Box feature.
PRIMITIVESAPI_EXPORT
CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
const ModelHighAPI_Double& theRadius,
- const ModelHighAPI_Double& theHeight,
- const ModelHighAPI_Double& theAngle);
+ const ModelHighAPI_Double& theHeight);
/// \ingroup CPPHighAPI
-/// \brief Create primitive Cylinder feature.
+/// \brief Create primitive Box feature.
PRIMITIVESAPI_EXPORT
CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
const ModelHighAPI_Double& theRadius,
- const ModelHighAPI_Double& theHeight);
+ const ModelHighAPI_Double& theHeight,
+ const ModelHighAPI_Double& theAngle);
#endif // PRIMITIVESAPI_CYLINDER_H_
\ No newline at end of file
--- /dev/null
+"""
+Test case for Primitive Cylinder feature.
+Written on High API.
+"""
+from ModelAPI import *
+from GeomAPI import *
+
+from salome.shaper import model
+
+# Get session
+aSession = ModelAPI_Session.get()
+
+# Create a part
+aDocument = aSession.activeDocument()
+aSession.startOperation()
+model.addPart(aDocument)
+aDocument = aSession.activeDocument()
+aSession.finishOperation()
+
+aSession.startOperation()
+aBasePoint = model.addPoint(aDocument, 0, 0, 0).result()
+anAxis = model.addAxis(aDocument, 10, 0, 0).result()
+aSession.finishOperation()
+
+aSession.startOperation()
+aCylinder1 = model.addCylinder(aDocument, aBasePoint, anAxis, 5., 20.)
+assert (aCylinder1 is not None)
+aSession.finishOperation()
+
+aSession.startOperation()
+aCylinder2 = model.addCylinder(aDocument, aBasePoint, anAxis, 5., 20., 100.)
+assert (aCylinder2 is not None)
+aSession.finishOperation()
+
+aSession.startOperation()
+aCylinder3 = model.addCylinder(aDocument, 5., 20.)
+assert (aCylinder3 is not None)
+aSession.finishOperation()
+
+aSession.startOperation()
+aCylinder4 = model.addCylinder(aDocument, 5., 20., 100.)
+assert (aCylinder4 is not None)
+aSession.finishOperation()
+
{
data()->addAttribute(PrimitivesPlugin_Cylinder::CREATION_METHOD(),
ModelAPI_AttributeString::typeId());
-
+
data()->addAttribute(PrimitivesPlugin_Cylinder::BASE_POINT_ID(),
ModelAPI_AttributeSelection::typeId());
data()->addAttribute(PrimitivesPlugin_Cylinder::AXIS_ID(),
ModelAPI_AttributeSelection::typeId());
-
+
data()->addAttribute(PrimitivesPlugin_Cylinder::RADIUS_ID(),
ModelAPI_AttributeDouble::typeId());
data()->addAttribute(PrimitivesPlugin_Cylinder::HEIGHT_ID(),
ModelAPI_AttributeDouble::typeId());
data()->addAttribute(PrimitivesPlugin_Cylinder::ANGLE_ID(),
ModelAPI_AttributeDouble::typeId());
-
+
// Initialize the base point of the cylinder at the origin if the base point is not filled.
AttributeSelectionPtr aBasePoint = data()->selection(BASE_POINT_ID());
if (!aBasePoint->isInitialized()) {
aBasePoint->setValue(aPointRes, std::shared_ptr<GeomAPI_Shape>());
}
}
-
+
// Initialize the axis at the OZ axis if the axis is not filled.
AttributeSelectionPtr anAxis = data()->selection(AXIS_ID());
- if (!anAxis->isInitialized()) {
+ if (!anAxis->isInitialized()) {
ObjectPtr anAxisObj = ModelAPI_Session::get()->moduleDocument()
->objectByName(ModelAPI_ResultConstruction::group(), "OZ");
if (anAxisObj.get()) {
aBasePoint = GeomAlgoAPI_PointBuilder::point(aShape1);
}
}
-
+
// Getting axis.
std::shared_ptr<GeomAPI_Ax2> anAxis;
std::shared_ptr<GeomAPI_Edge> anEdge;
anAxis = std::shared_ptr<GeomAPI_Ax2>(new GeomAPI_Ax2(aBasePoint,
anEdge->line()->direction()));
}
-
+
// Getting radius and height
double aRadius = real(PrimitivesPlugin_Cylinder::RADIUS_ID())->value();
double aHeight = real(PrimitivesPlugin_Cylinder::HEIGHT_ID())->value();
-
+
std::shared_ptr<GeomAlgoAPI_Cylinder> aCylinderAlgo;
if (withAngle) {
// Getting angle
double anAngle = real(PrimitivesPlugin_Cylinder::ANGLE_ID())->value();
- aCylinderAlgo =
+ aCylinderAlgo =
std::shared_ptr<GeomAlgoAPI_Cylinder>(new GeomAlgoAPI_Cylinder(anAxis,
aRadius, aHeight,
anAngle));
} else {
- aCylinderAlgo =
+ aCylinderAlgo =
std::shared_ptr<GeomAlgoAPI_Cylinder>(new GeomAlgoAPI_Cylinder(anAxis,
aRadius, aHeight));
}
void PrimitivesPlugin_Cylinder::loadNamingDS(std::shared_ptr<GeomAlgoAPI_Cylinder> theCylinderAlgo,
std::shared_ptr<ModelAPI_ResultBody> theResultCylinder)
{
-
// Load the result
theResultCylinder->store(theCylinderAlgo->shape());
static const std::string MY_CREATION_METHOD_ID("CreationMethod");
return MY_CREATION_METHOD_ID;
}
-
+
/// Attribute name for creation method
inline static const std::string& CREATION_METHOD_CYLINDER()
{
static const std::string MY_CREATION_METHOD_ID("Cylinder");
return MY_CREATION_METHOD_ID;
}
-
+
/// Attribute name for creation method
inline static const std::string& CREATION_METHOD_CYLINDER_PORTION()
{
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="16"
+ id="svg3352"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ viewBox="0 0 16 16"
+ sodipodi:docname="cylinder.svg"
+ inkscape:export-filename="/export/home/ldigallo/DOC_ALYOTECH/icones/Primitives/cylinder.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs3354">
+ <linearGradient
+ id="linearGradient4223"
+ osb:paint="solid">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop4225" />
+ </linearGradient>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="31.672166"
+ inkscape:cx="16.392822"
+ inkscape:cy="11.031694"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:grid-bbox="true"
+ inkscape:document-units="px"
+ showguides="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1006"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ inkscape:window-maximized="1"
+ inkscape:showpageshadow="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3398" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata3357">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ transform="translate(0,-16)">
+ <g
+ id="g4142"
+ transform="matrix(0.50611145,0,0,0.50611145,-0.09985814,15.941804)">
+ <g
+ transform="matrix(1.337139,0,0,1.0393351,-4.0398283,-0.85518679)"
+ id="g4141">
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#1b4955;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 7.9776742,6.1069675 0,20.0000005"
+ id="path3400"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#1b4955;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 21.977674,5.9730127 0,20.0000003"
+ id="path3402"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;fill-opacity:1;stroke:#1b4955;stroke-width:4;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path3404-3"
+ sodipodi:type="arc"
+ sodipodi:cx="14.977674"
+ sodipodi:cy="26.080961"
+ sodipodi:rx="7"
+ sodipodi:ry="3.1079483"
+ sodipodi:start="6.1688662"
+ sodipodi:end="3.1989972"
+ d="m 21.931982,25.726437 a 7,3.1079483 0 0 1 -3.11418,2.953054 7,3.1079483 0 0 1 -7.341119,0.09278 7,3.1079483 0 0 1 -3.4874791,-2.869621"
+ sodipodi:open="true" />
+ <ellipse
+ style="fill:#b7d9ea;fill-opacity:1;stroke:#1b4955;stroke-width:4;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path3404-3-0-9"
+ transform="scale(1,-1)"
+ cx="14.981355"
+ cy="-6.1497636"
+ rx="7"
+ ry="3.1079483" />
+ <path
+ style="fill:#b7d9ea;fill-opacity:1;stroke:#b7d9ea;stroke-width:0.12629385;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 13.38883,28.075268 C 11.624221,27.87219 10.037848,27.303122 9.3391283,26.622548 l -0.3074363,-0.299452 0,-8.648097 0,-8.6480963 0.5525356,0.2379569 c 3.0800834,1.3264784 7.6875904,1.3533244 10.6337444,0.061957 0.324842,-0.1423858 0.626142,-0.2743649 0.669555,-0.2932868 0.06293,-0.027428 0.07889,1.7050652 0.0787,8.5445472 -2.53e-4,8.294429 -0.0042,8.585428 -0.119319,8.774236 -0.47948,0.7863 -2.286639,1.49933 -4.377175,1.727049 -0.710171,0.07736 -2.392563,0.07512 -3.080901,-0.0041 z"
+ id="path4145"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="32"
+ height="32"
+ id="svg3352"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ viewBox="0 0 32 32"
+ sodipodi:docname="cylinder_32x32_cla.svg"
+ inkscape:export-filename="/export/home/cgenraul/SHAPER-CEA-FD20_64/INSTALL/SHAPER/share/salome/resources/shaper/icons/Primitives/cylinder_32x32.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs3354">
+ <linearGradient
+ id="linearGradient4223"
+ osb:paint="solid">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop4225" />
+ </linearGradient>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="15.836083"
+ inkscape:cx="10.55697"
+ inkscape:cy="19.400616"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:grid-bbox="true"
+ inkscape:document-units="px"
+ showguides="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1110"
+ inkscape:window-x="-2"
+ inkscape:window-y="32"
+ inkscape:window-maximized="1"
+ showborder="true"
+ inkscape:showpageshadow="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3398"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata3357">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <path
+ style="fill:#b7d9ea;fill-opacity:1;stroke:#b7d9ea;stroke-width:0.18526213;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="M 13.182776,29.487897 C 9.8774461,29.254602 6.9059739,28.600862 5.5971891,27.819018 l -0.575868,-0.344006 0,-9.934896 0,-9.9348943 1.0349683,0.2733641 C 11.82566,9.4024394 20.456092,9.4332793 25.974601,7.9497624 26.583072,7.7861867 27.14744,7.6345711 27.228758,7.6128329 c 0.117871,-0.0315 0.147774,1.9587736 0.147427,9.8159421 -4.75e-4,9.5286 -0.0079,9.862898 -0.223499,10.079799 -0.898127,0.903301 -4.283156,1.722424 -8.198987,1.984027 -1.33024,0.08889 -4.481566,0.08633 -5.770907,-0.0048 z"
+ id="path4145"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#1b4955;stroke-width:1.20723967;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3404-3"
+ sodipodi:type="arc"
+ sodipodi:cx="14.977674"
+ sodipodi:cy="26.080961"
+ sodipodi:rx="7"
+ sodipodi:ry="3.1079483"
+ sodipodi:start="6.1688662"
+ sodipodi:end="9.4821825"
+ d="M 21.931982,25.726437 A 7,3.1079483 0 1 1 7.9892038,25.902649"
+ sodipodi:open="true"
+ transform="matrix(1.658174,0,0,1.6551711,-8.8162043,-18.273731)" />
+ <path
+ style="fill:none;stroke:#1b4955;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 27.59775,6.7001261 0,18.1037449"
+ id="path3402"
+ inkscape:connector-curvature="0" />
+ <ellipse
+ style="fill:#b7d9ea;fill-opacity:1;stroke:#1b4955;stroke-width:1.46138835;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3404-3-0-9"
+ transform="matrix(1.6451704,0,0,-1.4676935,-8.6236034,-2.4341761)"
+ cx="14.981355"
+ cy="-6.1497636"
+ rx="7"
+ ry="3.1079483"
+ sodipodi:cx="14.981355"
+ sodipodi:cy="-6.1497636"
+ sodipodi:rx="7"
+ sodipodi:ry="3.1079483" />
+ <path
+ style="fill:none;stroke:#1b4955;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 4.3782992,6.1071278 0,18.6104482"
+ id="path3400"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="32"
+ height="32"
+ id="svg3352"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ viewBox="0 0 32 32"
+ sodipodi:docname="cylinder_portion_32x32_cla.svg"
+ inkscape:export-filename="/export/home/cgenraul/SHAPER-CEA-FD20_64/INSTALL/SHAPER/share/salome/resources/shaper/icons/Primitives/cylinder_portion_32x32.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs3354">
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect4188"
+ is_visible="true" />
+ <linearGradient
+ id="linearGradient4223"
+ osb:paint="solid">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop4225" />
+ </linearGradient>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="16"
+ inkscape:cx="3.3340758"
+ inkscape:cy="14.83048"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:grid-bbox="true"
+ inkscape:document-units="px"
+ showguides="false"
+ inkscape:window-width="1920"
+ inkscape:window-height="1110"
+ inkscape:window-x="-2"
+ inkscape:window-y="32"
+ inkscape:window-maximized="1"
+ inkscape:snap-bbox="true"
+ inkscape:snap-others="false"
+ inkscape:snap-grids="false"
+ inkscape:object-paths="false"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:snap-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:snap-intersection-paths="false"
+ inkscape:snap-midpoints="false"
+ inkscape:bbox-nodes="true"
+ inkscape:showpageshadow="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3398"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata3357">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <path
+ style="fill:#b7d9ea;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1"
+ d="M 22.235579,11.804264 26.75,8.6875 l 0.09629,18.310773 -4.62734,3.543844 z"
+ id="path4503"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:#b7d9ea;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1"
+ d="M 10.460421,11.521399 16.168853,7.4906673 16.108369,26.39488 10.343036,30.466349 z"
+ id="path4483"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#1b4955;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 26.759017,7.9134682 0,19.7134698"
+ id="path3402"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 19.4713,8.8277471 Z"
+ id="path4215"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#1b4955;stroke-width:2.11622119;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="M 10.343036,30.466349 16.108369,26.39488"
+ id="path4219"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:#b7d9ea;fill-opacity:1;stroke:#b7d9ea;stroke-width:0.18596868;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="M 9.5677965,30.401949 C 8.4630616,30.17651 7.7812389,29.985062 7.0504131,29.695093 6.205534,29.359872 5.7973275,29.071585 5.7311083,28.763365 5.7047195,28.640557 5.6533663,24.333156 5.6169878,19.191366 L 5.550838,9.8426537 6.4802499,10.085544 c 0.7373697,0.192702 2.57171,0.559638 3.4754138,0.695212 0.096039,0.0144 0.1644643,0.471733 0.2158493,1.442438 0.09561,1.805969 0.16767,18.310804 0.07994,18.307425 -0.03602,-0.0013 -0.343683,-0.05929 -0.6836805,-0.12867 z"
+ id="path4155"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#1b4955;stroke-width:2.00294089;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="M 5.3556579,7.4617626 5.4417241,28.282926"
+ id="path4209"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#1b4955;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 10.196535,10.749669 0.08839,19.774791"
+ id="path4221"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#1b4955;stroke-width:1.9978863;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="M 16.16991,7.4896105 16.14441,25.671337"
+ id="path4227"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:#b7d9ea;fill-opacity:1;stroke:#b7d9ea;stroke-width:0.15230079;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 19.456987,28.653705 c -1.203104,-0.33894 -2.204439,-0.628935 -2.225186,-0.64443 -0.02075,-0.0155 -0.02767,-4.203777 -0.0154,-9.307289 l 0.02233,-9.2791141 2.290969,0.6386571 2.290969,0.638658 0.02414,9.139751 c 0.01325,5.026864 0.0027,9.206384 -0.02372,9.287826 -0.02632,0.08143 -0.07682,0.146752 -0.11225,0.145136 -0.03543,-0.0015 -1.048766,-0.280252 -2.25187,-0.619195 z"
+ id="path4159"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#1b4955;stroke-width:1.93488965;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3404-3-0-9-39"
+ transform="matrix(1.1011193,0,0,-0.97031605,-4.5048213,2.5369224)"
+ sodipodi:type="arc"
+ sodipodi:cx="16.007248"
+ sodipodi:cy="-25.924555"
+ sodipodi:rx="7"
+ sodipodi:ry="3.1079483"
+ sodipodi:start="3.1415927"
+ sodipodi:end="4.3308797"
+ d="m 9.0072479,-25.924555 a 7,3.1079483 0 0 1 4.3937481,-2.884498"
+ sodipodi:open="true" />
+ <path
+ style="fill:#b7d9ea;fill-opacity:1;stroke:#1b4955;stroke-width:1.42327809;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3404-3-0-9"
+ transform="matrix(1.5190222,0,0,-1.5346995,-8.0747405,-1.9471515)"
+ sodipodi:type="arc"
+ sodipodi:cx="15.918855"
+ sodipodi:cy="-6.1497636"
+ sodipodi:rx="7"
+ sodipodi:ry="3.1079483"
+ sodipodi:start="5.2670034"
+ sodipodi:end="10.432426"
+ d="m 19.605164,-8.7918415 a 7,3.1079483 0 1 1 -7.423266,0.014063 l 3.736957,2.6280145 z" />
+ <path
+ style="fill:none;stroke:#1b4955;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 22.235579,11.804264 -0.01663,18.737853"
+ id="path4225"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#1b4955;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 16.398168,26.684679 5.502463,4.09669"
+ id="path4190"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#1b4955;stroke-width:1.69513776;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3404-3-0-9-39-2"
+ transform="matrix(-1.1057497,0,0,-1.2589056,36.718779,-5.4865086)"
+ sodipodi:type="arc"
+ sodipodi:cx="16.007248"
+ sodipodi:cy="-25.924555"
+ sodipodi:rx="7"
+ sodipodi:ry="3.1079483"
+ sodipodi:start="3.1415927"
+ sodipodi:end="4.3308797"
+ d="m 9.0072479,-25.924555 a 7,3.1079483 0 0 1 4.3937481,-2.884498"
+ sodipodi:open="true" />
+ </g>
+</svg>
"""Package for Primitives plugin for the Parametric Geometry API of the Modeler.
"""
-from PrimitivesAPI import addBox
+from PrimitivesAPI import addBox, addCylinder