GeomAlgoAPI_SolidClassifier.h
GeomAlgoAPI_MapShapesAndAncestors.h
GeomAlgoAPI_Chamfer.h
+ GeomAlgoAPI_Tube.h
GeomAlgoAPI_ROOTExport.h
)
GeomAlgoAPI_MapShapesAndAncestors.cpp
GeomAlgoAPI_Projection.cpp
GeomAlgoAPI_Chamfer.cpp
+ GeomAlgoAPI_Tube.cpp
GeomAlgoAPI_ROOTExport.cpp
)
#include <map>
#include <string>
+#define ANGULAR_PRECISION Precision::Angular() * 180. / M_PI
+
/// \class GeomAlgoAPI_MakeShape
/// \ingroup DataAlgo
/// \brief Interface to the root class of all topological shapes constructions
--- /dev/null
+// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <GeomAlgoAPI_Tube.h>
+
+#include <BRepAlgo_FaceRestrictor.hxx>
+#include <BRepBuilderAPI_MakeEdge.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
+#include <BRepPrimAPI_MakePrism.hxx>
+#include <BRepPrimAPI_MakeRevol.hxx>
+
+#include <gp_Circ.hxx>
+
+#include <Precision.hxx>
+
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Wire.hxx>
+
+//=================================================================================================
+GeomAlgoAPI_Tube::GeomAlgoAPI_Tube()
+{
+}
+
+
+//=================================================================================================
+GeomAlgoAPI_Tube::GeomAlgoAPI_Tube(const double theRMin, const double theRMax, const double theZ)
+{
+ isSimple = true;
+
+ myRMin = theRMin;
+ myRMax = theRMax;
+ myZ = theZ;
+}
+
+//=================================================================================================
+GeomAlgoAPI_Tube::GeomAlgoAPI_Tube(const double theRMin, const double theRMax, const double theZ,
+ const double theStartPhi, const double theDeltaPhi)
+{
+ isSimple = false;
+
+ myRMin = theRMin;
+ myRMax = theRMax;
+ myZ = theZ;
+ myStartPhi = theStartPhi;
+ myDeltaPhi = theDeltaPhi;
+}
+
+//=================================================================================================
+bool GeomAlgoAPI_Tube::check()
+{
+ if ((myRMax - myRMin) < Precision::Confusion()){
+ myError = "Tube builder :: rmin is greater than or equal to rmax.";
+ return false;
+ } else if (myRMin < 0.){
+ myError = "Tube builder :: rmin is negative.";
+ return false;
+ } else if (myRMax < Precision::Confusion()){
+ myError = "Tube builder :: rmax is negative or null.";
+ return false;
+ } else if (myZ < Precision::Confusion()){
+ myError = "Tube builder :: z is negative or null.";
+ return false;
+ }
+
+ if (!isSimple) {
+ if (myDeltaPhi < ANGULAR_PRECISION){
+ myError = "Tube builder :: deltaphi is negative or null.";
+ return false;
+ } else if (myDeltaPhi > 360.){
+ myError = "Tube builder :: deltaphi is greater than 360 degrees.";
+ return false;
+ }
+ }
+
+ return true;
+}
+
+//=================================================================================================
+void GeomAlgoAPI_Tube::build()
+{
+ myCreatedFaces.clear();
+
+ std::shared_ptr<GeomAPI_Shape> aResultShape;
+ if (isSimple)
+ aResultShape = buildSimpleTube();
+ else
+ aResultShape = buildSegmentTube();
+
+ // Test on the shapes
+ if (!(aResultShape).get() || aResultShape->isNull()) {
+ myError = "";
+ return;
+ }
+
+ setShape(aResultShape);
+ setDone(true);
+}
+
+//=================================================================================================
+std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_Tube::buildSimpleTube()
+{
+ // Construct the inner and outer circles
+ gp_Pnt anOrigin(0., 0., 0.);
+ gp_Dir aNormal(0., 0., 1.);
+ gp_Circ anInnerCircle(gp_Ax2(anOrigin, aNormal), myRMin);
+ gp_Circ anOuterCircle(gp_Ax2(anOrigin, aNormal), myRMax);
+
+ // Construct the outer wire
+ BRepBuilderAPI_MakeEdge anOuterCircleBuilder(anOuterCircle);
+ anOuterCircleBuilder.Build();
+ BRepBuilderAPI_MakeWire anOuterWireBuilder;
+ anOuterWireBuilder.Add(anOuterCircleBuilder.Edge());
+ anOuterWireBuilder.Build();
+ TopoDS_Wire anOuterWire(anOuterWireBuilder.Wire());
+
+ // Construct the face with the outer wire
+ BRepBuilderAPI_MakeFace aFaceBuilder(anOuterWireBuilder.Wire());
+ aFaceBuilder.Build();
+ TopoDS_Face aFace(aFaceBuilder.Face());
+
+ // Construct the inner wire
+ BRepBuilderAPI_MakeEdge anInnerCircleBuilder(anInnerCircle);
+ anInnerCircleBuilder.Build();
+ BRepBuilderAPI_MakeWire anInnerWireBuilder;
+ anInnerWireBuilder.Add(anInnerCircleBuilder.Edge());
+ anInnerWireBuilder.Build();
+ TopoDS_Wire anInnerWire(anInnerWireBuilder.Wire());
+
+ // Construct the hole face
+ BRepAlgo_FaceRestrictor aFRestrictor;
+ aFRestrictor.Init(aFace, Standard_False, Standard_True);
+ aFRestrictor.Add(anInnerWire);
+ aFRestrictor.Add(anOuterWire);
+ aFRestrictor.Perform();
+ aFace = TopoDS_Face(aFRestrictor.Current());
+
+ // Construct the tube
+ gp_Vec aVec(aNormal);
+ BRepPrimAPI_MakePrism* aPrismBuilder = new BRepPrimAPI_MakePrism(aFace, aVec * myZ);
+
+ setImpl(aPrismBuilder);
+ setBuilderType(OCCT_BRepBuilderAPI_MakeShape);
+
+ std::shared_ptr<GeomAPI_Shape> aResultShape =
+ std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
+ aResultShape->setImpl(new TopoDS_Shape(aPrismBuilder->Shape()));
+
+ return aResultShape;
+}
+
+//=================================================================================================
+std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_Tube::buildSegmentTube()
+{
+ const double aStartPhiRad = myStartPhi * M_PI / 180.;
+ BRepBuilderAPI_MakeWire aWireBuilder;
+
+ // Build the 4 points defining the section's vertices (it's a simple rectangular section)
+ gp_Pnt aTopOuter(myRMax*cos(aStartPhiRad), myRMax*sin(aStartPhiRad),myZ/2.);
+ gp_Pnt aBaseOuter(myRMax*cos(aStartPhiRad), myRMax*sin(aStartPhiRad),-myZ/2.);
+ gp_Pnt aTopInner(myRMin*cos(aStartPhiRad), myRMin*sin(aStartPhiRad),myZ/2.);
+ gp_Pnt aBaseInner(myRMin*cos(aStartPhiRad), myRMin*sin(aStartPhiRad),-myZ/2.);
+
+ // Build the edges of the section's outline, add them to a wire
+ BRepBuilderAPI_MakeEdge anEdgeBuilderTop(aTopOuter, aTopInner);
+ anEdgeBuilderTop.Build();
+ aWireBuilder.Add(anEdgeBuilderTop.Edge());
+ BRepBuilderAPI_MakeEdge anEdgeBuilderInner(aTopInner, aBaseInner);
+ anEdgeBuilderInner.Build();
+ aWireBuilder.Add(anEdgeBuilderInner.Edge());
+ BRepBuilderAPI_MakeEdge anEdgeBuilderBase(aBaseInner, aBaseOuter);
+ anEdgeBuilderBase.Build();
+ aWireBuilder.Add(anEdgeBuilderBase.Edge());
+ BRepBuilderAPI_MakeEdge anEdgeBuilderOuter(aBaseOuter, aTopOuter);
+ anEdgeBuilderOuter.Build();
+ aWireBuilder.Add(anEdgeBuilderOuter.Edge());
+
+ // Build the section (face) from the wire
+ aWireBuilder.Build();
+ BRepBuilderAPI_MakeFace aFaceBuilder(aWireBuilder.Wire());
+ aFaceBuilder.Build();
+
+ if (!aFaceBuilder.IsDone()){
+ myError = "Tube Segment builder :: section is not valid";
+ return;
+ }
+
+ // Create the mathematical tools needed to perform the revolution
+ gp_Dir aZDir(0., 0., 1.);
+ gp_Pnt anOrigin(0., 0., 0.);
+ gp_Ax1 aZAxis(anOrigin, aZDir);
+
+ // Perform the revolution using the section
+ BRepPrimAPI_MakeRevol* aRevolBuilder = new BRepPrimAPI_MakeRevol(aFaceBuilder.Face(), aZAxis, myDeltaPhi * M_PI / 180., Standard_True);
+ if(!aRevolBuilder) {
+ return;
+ myError = "Tube Segment builder :: section revolution did not succeed";
+ }
+ if(!aRevolBuilder->IsDone()) {
+ myError = "Tube Segment builder :: section revolution did not succeed";
+ return;
+ }
+
+ // Store the result and publish it
+ std::shared_ptr<GeomAPI_Shape> aResultShape = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape()) ;
+ aResultShape->setImpl(new TopoDS_Shape(aRevolBuilder->Shape()));
+
+ return aResultShape;
+}
--- /dev/null
+// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef GeomAlgoAPI_Tube_H_
+#define GeomAlgoAPI_Tube_H_
+
+#include <GeomAlgoAPI_MakeShape.h>
+
+/**\class GeomAlgoAPI_TubeSegment
+ * \ingroup DataAlgo
+ * \brief Allows to create Tube Segment GDML Primitives
+ */
+class GeomAlgoAPI_Tube : public GeomAlgoAPI_MakeShape
+{
+ public:
+ GEOMALGOAPI_EXPORT GeomAlgoAPI_Tube();
+
+ /// Creates a tube segment using standard GDML parameters
+ /// \param theRMin inside radius of segment
+ /// \param theRMax outside radius of segment
+ /// \param theZ z length of tube segment
+ GEOMALGOAPI_EXPORT GeomAlgoAPI_Tube(const double theRMin,
+ const double theRMax,
+ const double theZ);
+
+ /// Creates a tube segment using standard GDML parameters
+ /// \param theRMin inside radius of segment
+ /// \param theRMax outside radius of segment
+ /// \param theZ z length of tube segment
+ /// \param theStartPhi starting phi position angle of segment
+ /// \param theDeltaPhi delta angle of segment
+ GEOMALGOAPI_EXPORT GeomAlgoAPI_Tube(const double theRMin,
+ const double theRMax,
+ const double theZ,
+ const double theStartPhi,
+ const double theDeltaPhi);
+
+ /// Checks if the set of parameters used to define the tube are OK.
+ GEOMALGOAPI_EXPORT bool check();
+
+ /// Builds the tube based on the parameters given in the constructor.
+ GEOMALGOAPI_EXPORT void build();
+
+ private:
+ bool isSimple; /// attribute to indicate whether we are building a simple tube
+ double myRMin; /// attribute inside radius of segment
+ double myRMax; /// attribute outside radius of segment
+ double myZ; /// attribute z length of tube segment
+ double myStartPhi; /// attribute starting phi position angle of segment
+ double myDeltaPhi; /// attribute delta angle of segment
+
+ std::shared_ptr<GeomAPI_Shape> buildSimpleTube();
+ std::shared_ptr<GeomAPI_Shape> buildSegmentTube();
+};
+
+#endif
+
PrimitivesPlugin_Cylinder.h
PrimitivesPlugin_Sphere.h
PrimitivesPlugin_Torus.h
+ PrimitivesPlugin_Tube.h
)
SET(PROJECT_SOURCES
PrimitivesPlugin_Cylinder.cpp
PrimitivesPlugin_Sphere.cpp
PrimitivesPlugin_Torus.cpp
+ PrimitivesPlugin_Tube.cpp
)
SET(XML_RESOURCES
cylinder_widget.xml
sphere_widget.xml
torus_widget.xml
+ tube_widget.xml
)
SET(TEXT_RESOURCES
#include <PrimitivesPlugin_Cylinder.h>
#include <PrimitivesPlugin_Sphere.h>
#include <PrimitivesPlugin_Torus.h>
+#include <PrimitivesPlugin_Tube.h>
#include <ModelAPI_Session.h>
return FeaturePtr(new PrimitivesPlugin_Sphere);
} else if (theFeatureID == PrimitivesPlugin_Torus::ID()) {
return FeaturePtr(new PrimitivesPlugin_Torus);
+ } else if (theFeatureID == PrimitivesPlugin_Tube::ID()) {
+ return FeaturePtr(new PrimitivesPlugin_Tube);
}
// feature of such kind is not found
return FeaturePtr();
--- /dev/null
+// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <PrimitivesPlugin_Tube.h>
+
+#include <ModelAPI_AttributeDouble.h>
+#include <ModelAPI_AttributeString.h>
+#include <ModelAPI_ResultBody.h>
+
+//=================================================================================================
+PrimitivesPlugin_Tube::PrimitivesPlugin_Tube() // Nothing to do during instantiation
+{
+}
+
+//=================================================================================================
+void PrimitivesPlugin_Tube::initAttributes()
+{
+ data()->addAttribute(PrimitivesPlugin_Tube::CREATION_METHOD(), ModelAPI_AttributeString::typeId());
+
+ data()->addAttribute(PrimitivesPlugin_Tube::RMIN_ID(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(PrimitivesPlugin_Tube::RMAX_ID(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(PrimitivesPlugin_Tube::Z_ID(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(PrimitivesPlugin_Tube::START_PHI_ID(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(PrimitivesPlugin_Tube::DELTA_PHI_ID(), ModelAPI_AttributeDouble::typeId());
+}
+
+//=================================================================================================
+void PrimitivesPlugin_Tube::execute()
+{
+ AttributeStringPtr aMethodTypeAttr = string(PrimitivesPlugin_Tube::CREATION_METHOD());
+ std::string aMethodType = aMethodTypeAttr->value();
+
+ if (aMethodType == METHODE_SIMPLE_TUBE_ID())
+ createSimpleTube();
+
+ if (aMethodType == METHODE_SEGMENT_TUBE_ID())
+ createSegmentTube();
+}
+
+//=================================================================================================
+void PrimitivesPlugin_Tube::createSimpleTube()
+{
+ double aRMin = real(PrimitivesPlugin_Tube::RMIN_ID())->value();
+ double aRMax = real(PrimitivesPlugin_Tube::RMAX_ID())->value();
+ double aZ = real(PrimitivesPlugin_Tube::Z_ID())->value();
+
+ std::shared_ptr<GeomAlgoAPI_Tube> aTubeAlgo(new GeomAlgoAPI_Tube(aRMin,aRMax,aZ));
+
+ // These checks should be made to the GUI for the feature but
+ // the corresponding validator does not exist yet.
+ if (!aTubeAlgo->check()) {
+ setError(aTubeAlgo->getError());
+ return;
+ }
+
+ // Build the tube
+ aTubeAlgo->build();
+
+ int aResultIndex = 0;
+ ResultBodyPtr aResultTube = document()->createBody(data(), aResultIndex);
+ loadNamingDS(aTubeAlgo, aResultTube);
+ setResult(aResultTube, aResultIndex);
+}
+
+//=================================================================================================
+void PrimitivesPlugin_Tube::createSegmentTube()
+{
+ double aRMin = real(PrimitivesPlugin_Tube::RMIN_ID())->value();
+ double aRMax = real(PrimitivesPlugin_Tube::RMAX_ID())->value();
+ double aZ = real(PrimitivesPlugin_Tube::Z_ID())->value();
+ double aStartPhi =real(PrimitivesPlugin_Tube::START_PHI_ID())->value();
+ double aDelatPhi =real(PrimitivesPlugin_Tube::DELTA_PHI_ID())->value();
+
+ std::shared_ptr<GeomAlgoAPI_Tube> aTubeAlgo(new GeomAlgoAPI_Tube(aRMin,aRMax,aZ,
+ aStartPhi, aDelatPhi));
+
+ // These checks should be made to the GUI for the feature but
+ // the corresponding validator does not exist yet.
+ if (!aTubeAlgo->check()) {
+ setError(aTubeAlgo->getError());
+ return;
+ }
+
+ // Build the tube
+ aTubeAlgo->build();
+
+ int aResultIndex = 0;
+ ResultBodyPtr aResultTube = document()->createBody(data(), aResultIndex);
+ loadNamingDS(aTubeAlgo, aResultTube);
+ setResult(aResultTube, aResultIndex);
+}
+
+//=================================================================================================
+void PrimitivesPlugin_Tube::loadNamingDS(std::shared_ptr<GeomAlgoAPI_Tube> theTubeAlgo,
+ std::shared_ptr<ModelAPI_ResultBody> theResultTube)
+{
+ // Load the result
+ theResultTube->store(theTubeAlgo->shape());
+
+ // Prepare the naming
+ theTubeAlgo->prepareNamingFaces();
+
+ // Insert to faces
+ int num = 1;
+ std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
+ theTubeAlgo->getCreatedFaces();
+ for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator it = listOfFaces.begin();
+ it != listOfFaces.end();
+ ++it)
+ {
+ theResultTube->generated((*it).second, (*it).first);
+ }
+}
--- /dev/null
+// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef PrimitivesPlugin_Tube_H_
+#define PrimitivesPlugin_Tube_H_
+
+#include <PrimitivesPlugin.h>
+#include <GeomAlgoAPI_Tube.h>
+#include <ModelAPI_Feature.h>
+
+/// \class PrimitivesPlugin_Tube
+/// \ingroup Plugins
+/// \brief Feature for creation of a tube primitive using various methods.
+///
+/// ToDo
+/// Supported following methods:
+/// * two points that define a diagonal,
+/// * three lengths that define the rectangular dimensions,
+/// * one point and three lengths that define the rectangular dimensions.
+class PrimitivesPlugin_Tube : public ModelAPI_Feature
+{
+ public:
+ /// Tube kind
+ inline static const std::string& ID()
+ {
+ static const std::string MY_TUBE_ID("Tube");
+ return MY_TUBE_ID;
+ }
+
+ /// Attribute name for creation method
+ inline static const std::string& CREATION_METHOD()
+ {
+ static const std::string MY_CREATION_METHOD_ID("CreationMethod");
+ return MY_CREATION_METHOD_ID;
+ }
+
+ /// Attribute name for creation method
+ inline static const std::string& METHODE_SIMPLE_TUBE_ID()
+ {
+ static const std::string MY_CREATION_METHOD_ID("SimpleTube");
+ return MY_CREATION_METHOD_ID;
+ }
+
+ /// Attribute name for creation method
+ inline static const std::string& METHODE_SEGMENT_TUBE_ID()
+ {
+ static const std::string MY_CREATION_METHOD_ID("SegmentTube");
+ return MY_CREATION_METHOD_ID;
+ }
+
+ /// Attribute name of the inner radius of tube
+ inline static const std::string& RMIN_ID()
+ {
+ static const std::string MY_RMIN("rmin");
+ return MY_RMIN;
+ }
+
+ /// Attribute name of the outer radius of tube
+ inline static const std::string& RMAX_ID()
+ {
+ static const std::string MY_RMAX("rmax");
+ return MY_RMAX;
+ }
+
+ /// Attribute name of the z length of tube
+ inline static const std::string& Z_ID()
+ {
+ static const std::string MY_Z("z");
+ return MY_Z;
+ }
+
+ /// attribute name of the starting phi position angle of segment
+ inline static const std::string& START_PHI_ID()
+ {
+ static const std::string MY_START_PHI("startphi");
+ return MY_START_PHI;
+ }
+
+ /// attribute name of the delta angle of segment
+ inline static const std::string& DELTA_PHI_ID()
+ {
+ static const std::string MY_DELTA_PHI("deltaphi");
+ return MY_DELTA_PHI;
+ }
+
+ /// Returns the kind of a feature
+ PRIMITIVESPLUGIN_EXPORT virtual const std::string& getKind()
+ {
+ static std::string MY_KIND = PrimitivesPlugin_Tube::ID();
+ return MY_KIND;
+ }
+
+ /// Creates a new part document if needed
+ PRIMITIVESPLUGIN_EXPORT virtual void execute();
+
+ /// Request for initialization of data model of the feature: adding all attributes
+ PRIMITIVESPLUGIN_EXPORT virtual void initAttributes();
+
+ /// Use plugin manager for features creation
+ PrimitivesPlugin_Tube();
+
+ private:
+ /// Load Naming data structure of the feature to the document
+ void loadNamingDS(std::shared_ptr<GeomAlgoAPI_Tube> theTubeAlgo,
+ std::shared_ptr<ModelAPI_ResultBody> theResultBox);
+
+ ///Perform the creation of the simple tube
+ void createSimpleTube();
+
+ ///Perform the creation of the segment tube
+ void createSegmentTube();
+};
+
+#endif
<source path="cone_widget.xml"/>
</feature>
</group>
+ <group id="Primitives">
+ <feature id="Tube" title="Tube" tooltip="Create a Tube" icon=""
+ helpfile="">
+ <source path="tube_widget.xml"/>
+ </feature>
+ </group>
</workbench>
</plugin>
--- /dev/null
+<source>
+ <toolbox id="CreationMethod">
+ <box id="SimpleTube" title="Simple tube" icon="">
+ <doublevalue
+ id="rmin"
+ label="rmin"
+ step="1."
+ default="3."
+ min="0."
+ tooltip="Enter the inner radius">
+ </doublevalue>
+ <doublevalue
+ id="rmax"
+ label="rmax"
+ step="1."
+ default="5."
+ min="0."
+ tooltip="Enter the outer radius">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ <doublevalue
+ id="z"
+ label="z"
+ step="1."
+ default="12."
+ min="0."
+ tooltip="Enter the height">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </box>
+ <box id="SegmentTube" title="Segment tube" icon="">
+ <groupbox title="Section">
+ <doublevalue
+ id="rmin"
+ label="rmin"
+ step="1."
+ default="3."
+ min="0."
+ tooltip="Enter the inner radius">
+ </doublevalue>
+ <doublevalue
+ id="rmax"
+ label="rmax"
+ step="1."
+ default="5."
+ min="0."
+ tooltip="Enter the outer radius">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </groupbox>
+ <groupbox title="Crop">
+ <doublevalue
+ id="z"
+ label="z"
+ step="1."
+ default="12."
+ min="0."
+ tooltip="Enter the height">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ <doublevalue
+ id="startphi"
+ label="startphi"
+ step="15."
+ default="30."
+ tooltip="Enter the starting angle">
+ </doublevalue>
+ <doublevalue
+ id="deltaphi"
+ label="deltaphi"
+ step="15."
+ default="270."
+ min="0."
+ max="360."
+ tooltip="Enter the revolution angle">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </groupbox>
+ </box>
+ </toolbox>
+</source>