]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add the new mode to create a root sphere
authorClarisse Genrault <cgenrault@is231796.intra.cea.fr>
Mon, 20 Apr 2020 09:30:11 +0000 (11:30 +0200)
committerClarisse Genrault <cgenrault@is231796.intra.cea.fr>
Mon, 20 Apr 2020 09:30:11 +0000 (11:30 +0200)
src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h
src/GeomAlgoAPI/GeomAlgoAPI_Sphere.h
src/PrimitivesAPI/PrimitivesAPI_Sphere.cpp
src/PrimitivesAPI/PrimitivesAPI_Sphere.h
src/PrimitivesPlugin/PrimitivesPlugin_Sphere.cpp
src/PrimitivesPlugin/PrimitivesPlugin_Sphere.h
src/PrimitivesPlugin/sphere_widget.xml

index 6536032ce9bc43302a7896d4c614c47dae07d045..371ed859be03de230da39e9cfff8884c600c96b7 100644 (file)
@@ -199,6 +199,19 @@ namespace GeomAlgoAPI_ShapeAPI
     return runAlgoAndCheckShape(aSphereAlgo, aMsg);
   }
 
+  //===============================================================================================
+  std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeSphere(
+                                                   double theRMin, double theRMax,
+                                                   double thePhiMin, double thePhiMax,
+                                                   double theThetaMin, double theThetaMax)
+      throw (GeomAlgoAPI_Exception)
+  {
+    static const std::string aMsg("Sphere builder");
+    GeomAlgoAPI_Sphere aSphereAlgo(theRMin, theRMax, thePhiMin, thePhiMax,
+                                   theThetaMin, theThetaMax);
+    return runAlgoAndCheckShape(aSphereAlgo, aMsg);
+  }
+
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeTorus(
       std::shared_ptr<GeomAPI_Pnt> theBasePoint,
index c34d077a3777b7b4f1c45a771fec63274c31edb5..be075b47d24cf5bd93304e120cbddd297f570324 100644 (file)
@@ -108,6 +108,18 @@ public:
   static std::shared_ptr<GeomAPI_Shape> makeSphere(double theRadius)
                      throw (GeomAlgoAPI_Exception);
 
+  /// Creates a sphere using radius, phi angles and theta angles.
+  /// \param theRMin The inner radius of the sphere
+  /// \param theRMax The outer radius of the sphere
+  /// \param thePhiMin The lower phi limit
+  /// \param thePhiMax The higher phi limit
+  /// \param theThetaMin The lower theta limit
+  /// \param theThetaMax The higher theta limit
+  static std::shared_ptr<GeomAPI_Shape> makeSphere(double theRMin, double theRMax,
+                                                   double thePhiMin, double thePhiMax,
+                                                   double theThetaMin, double theThetaMax)
+                     throw (GeomAlgoAPI_Exception);
+
   /// Creates a torus using a base point, an axis, a radius and a ring radius.
   /// \param theBasePoint The center of the torus
   /// \param theEdge The axis of the torus
index fe3b3d4e5d66053cb9bcf05be70deb776f420b0a..20e129695d69901d8ba6e4bedfc23da1c1fc5b3c 100644 (file)
@@ -40,6 +40,16 @@ class GeomAlgoAPI_Sphere : public GeomAlgoAPI_MakeShape
   /// \param theRadius The radius of the sphere
   GEOMALGOAPI_EXPORT GeomAlgoAPI_Sphere(std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
                                         const double theRadius);
+  /// Creates a sphere.
+  /// \param theRMin The inner radius of the sphere
+  /// \param theRMax The outer radius of the sphere
+  /// \param thePhiMin The lower phi limit
+  /// \param thePhiMax The higher phi limit
+  /// \param theThetaMin The lower theta limit
+  /// \param theThetaMax The higher theta limit
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Sphere(const double theRMin, const double theRMax,
+                                        const double thePhiMin, const double thePhiMax,
+                                        const double theThetaMin, const double theThetaMax);
 
   /// Checks if data for the sphere construction is OK.
   GEOMALGOAPI_EXPORT bool check();
@@ -47,9 +57,16 @@ class GeomAlgoAPI_Sphere : public GeomAlgoAPI_MakeShape
   /// Builds the sphere.
   GEOMALGOAPI_EXPORT void build();
 
+  /// Builds the sphere.
+  GEOMALGOAPI_EXPORT void buildRootSphere();
+
  private:
+  bool isRootGeo;
   std::shared_ptr<GeomAPI_Pnt> myCenterPoint; /// Center of the sphere.
   double myRadius;
+  double myRMin, myRMax;
+  double myPhiMin, myPhiMax;
+  double myThetaMin, myThetaMax;
 };
 
 #endif // GEOMALGOAPI_SPHERE_H_
index 13a8b19163716713351fbcda610033417df111dd..0989fef0208b0dc75d756187e757c588f274e583 100644 (file)
@@ -41,11 +41,34 @@ PrimitivesAPI_Sphere::PrimitivesAPI_Sphere(const std::shared_ptr<ModelAPI_Featur
 : ModelHighAPI_Interface(theFeature)
 {
   if (initialize()) {
+    fillAttribute(PrimitivesPlugin_Sphere::CREATION_METHOD_BY_PT_RADIUS(), creationMethod());
     fillAttribute(theCenterPoint, centerPoint());
     setRadius(theRadius);
   }
 }
 
+//==================================================================================================
+PrimitivesAPI_Sphere::PrimitivesAPI_Sphere(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                           const ModelHighAPI_Double& theRMin,
+                                           const ModelHighAPI_Double& theRMax,
+                                           const ModelHighAPI_Double& thePhiMin,
+                                           const ModelHighAPI_Double& thePhiMax,
+                                           const ModelHighAPI_Double& theThetaMin,
+                                           const ModelHighAPI_Double& theThetaMax)
+: ModelHighAPI_Interface(theFeature)
+{
+  if (initialize()) {
+    fillAttribute(PrimitivesPlugin_Sphere::CREATION_METHOD_BY_DIMENSIONS(), creationMethod());
+    fillAttribute(theRMin, rmin());
+    fillAttribute(theRMax, rmax());
+    fillAttribute(thePhiMin, phimin());
+    fillAttribute(thePhiMax, phimax());
+    fillAttribute(theThetaMin, thetamin());
+    fillAttribute(theThetaMax, thetamax());
+    execute();
+  }
+}
+
 //==================================================================================================
 PrimitivesAPI_Sphere::~PrimitivesAPI_Sphere()
 {
@@ -65,6 +88,33 @@ void PrimitivesAPI_Sphere::setRadius(const ModelHighAPI_Double& theRadius)
   execute();
 }
 
+//==================================================================================================
+void PrimitivesAPI_Sphere::setRadius(const ModelHighAPI_Double& theRMin,
+                                     const ModelHighAPI_Double& theRMax)
+{
+  fillAttribute(theRMin, rmin());
+  fillAttribute(theRMax, rmax());
+  execute();
+}
+
+//==================================================================================================
+void PrimitivesAPI_Sphere::setPhi(const ModelHighAPI_Double& thePhiMin,
+                                  const ModelHighAPI_Double& thePhiMax)
+{
+  fillAttribute(thePhiMin, phimin());
+  fillAttribute(thePhiMax, phimax());
+  execute();
+}
+
+//==================================================================================================
+void PrimitivesAPI_Sphere::setTheta(const ModelHighAPI_Double& theThetaMin,
+                                    const ModelHighAPI_Double& theThetaMax)
+{
+  fillAttribute(theThetaMin, thetamin());
+  fillAttribute(theThetaMax, thetamax());
+  execute();
+}
+
 //==================================================================================================
 void PrimitivesAPI_Sphere::dump(ModelHighAPI_Dumper& theDumper) const
 {
@@ -73,10 +123,24 @@ void PrimitivesAPI_Sphere::dump(ModelHighAPI_Dumper& theDumper) const
 
   theDumper << aBase << " = model.addSphere(" << aDocName;
 
-  AttributeSelectionPtr anAttrCenterPoint =
-      aBase->selection(PrimitivesPlugin_Sphere::CENTER_POINT_ID());
-  AttributeDoublePtr anAttrRadius = aBase->real(PrimitivesPlugin_Sphere::RADIUS_ID());
-  theDumper << ", " << anAttrCenterPoint << ", " << anAttrRadius;
+  std::string aCreationMethod = aBase->string(PrimitivesPlugin_Sphere::CREATION_METHOD())->value();
+
+  if(aCreationMethod == PrimitivesPlugin_Sphere::CREATION_METHOD_BY_PT_RADIUS()) {
+    AttributeSelectionPtr anAttrCenterPoint =
+        aBase->selection(PrimitivesPlugin_Sphere::CENTER_POINT_ID());
+    AttributeDoublePtr anAttrRadius = aBase->real(PrimitivesPlugin_Sphere::RADIUS_ID());
+    theDumper << ", " << anAttrCenterPoint << ", " << anAttrRadius;
+  } else if(aCreationMethod == PrimitivesPlugin_Sphere::CREATION_METHOD_BY_DIMENSIONS()) {
+    AttributeDoublePtr anAttrRMin = aBase->real(PrimitivesPlugin_Sphere::RMIN_ID());
+    AttributeDoublePtr anAttrRMax = aBase->real(PrimitivesPlugin_Sphere::RMAX_ID());
+    AttributeDoublePtr anAttrPhiMin = aBase->real(PrimitivesPlugin_Sphere::PHIMIN_ID());
+    AttributeDoublePtr anAttrPhiMax = aBase->real(PrimitivesPlugin_Sphere::PHIMAX_ID());
+    AttributeDoublePtr anAttrThetaMin = aBase->real(PrimitivesPlugin_Sphere::THETAMIN_ID());
+    AttributeDoublePtr anAttrThetaMax = aBase->real(PrimitivesPlugin_Sphere::THETAMAX_ID());
+    theDumper << ", " << anAttrRMin << ", " << anAttrRMax;
+    theDumper << ", " << anAttrPhiMin << ", " << anAttrPhiMax;
+    theDumper << ", " << anAttrThetaMin << ", " << anAttrThetaMax;
+  }
 
   theDumper << ")" << std::endl;
 }
@@ -98,3 +162,17 @@ SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PrimitivesAPI_Sphere::ID());
   return SpherePtr(new PrimitivesAPI_Sphere(aFeature, aCenterPoint, theRadius));
 }
+
+//==================================================================================================
+SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
+                    const ModelHighAPI_Double& theRMin,
+                    const ModelHighAPI_Double& theRMax,
+                    const ModelHighAPI_Double& thePhiMin,
+                    const ModelHighAPI_Double& thePhiMax,
+                    const ModelHighAPI_Double& theThetaMin,
+                    const ModelHighAPI_Double& theThetaMax)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PrimitivesAPI_Sphere::ID());
+  return SpherePtr(new PrimitivesAPI_Sphere(aFeature, theRMin, theRMax, thePhiMin, thePhiMax,
+                                            theThetaMin, theThetaMax));
+}
\ No newline at end of file
index 57197dfa32787f1e277a6003f38f9ead3a21fef0..c3d007c2ce231f61691d54e771c8762df93015fd 100644 (file)
@@ -50,15 +50,39 @@ public:
                                 const ModelHighAPI_Selection& theCenterPoint,
                                 const ModelHighAPI_Double& theRadius);
 
+  /// Constructor with values.
+  PRIMITIVESAPI_EXPORT
+  explicit PrimitivesAPI_Sphere(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                const ModelHighAPI_Double& theRMin,
+                                const ModelHighAPI_Double& theRMax,
+                                const ModelHighAPI_Double& thePhiMin,
+                                const ModelHighAPI_Double& thePhiMax,
+                                const ModelHighAPI_Double& theThetaMin,
+                                const ModelHighAPI_Double& theThetaMax);
+
   /// Destructor.
   PRIMITIVESAPI_EXPORT
   virtual ~PrimitivesAPI_Sphere();
 
-  INTERFACE_2(PrimitivesPlugin_Sphere::ID(),
+  INTERFACE_9(PrimitivesPlugin_Sphere::ID(),
+             creationMethod, PrimitivesPlugin_Sphere::CREATION_METHOD(),
+             ModelAPI_AttributeString, /** Creation method */,
              centerPoint, PrimitivesPlugin_Sphere::CENTER_POINT_ID(),
              ModelAPI_AttributeSelection, /** Center point */,
              radius, PrimitivesPlugin_Sphere::RADIUS_ID(),
-             ModelAPI_AttributeDouble, /** Radius */)
+             ModelAPI_AttributeDouble, /** Radius */,
+             rmin, PrimitivesPlugin_Sphere::RMIN_ID(),
+             ModelAPI_AttributeDouble, /** The minimum radius*/,
+             rmax, PrimitivesPlugin_Sphere::RMAX_ID(),
+             ModelAPI_AttributeDouble, /** The maximum radius*/,
+             phimin, PrimitivesPlugin_Sphere::PHIMIN_ID(),
+             ModelAPI_AttributeDouble, /** The minimum phi*/,
+             phimax, PrimitivesPlugin_Sphere::PHIMAX_ID(),
+             ModelAPI_AttributeDouble, /** The maximum phi*/,
+             thetamin, PrimitivesPlugin_Sphere::THETAMIN_ID(),
+             ModelAPI_AttributeDouble, /** The minimum theta*/,
+             thetamax,PrimitivesPlugin_Sphere::THETAMAX_ID(),
+             ModelAPI_AttributeDouble, /** The maximum theta*/)
 
   /// Set center point
   PRIMITIVESAPI_EXPORT
@@ -68,6 +92,18 @@ public:
   PRIMITIVESAPI_EXPORT
   void setRadius(const ModelHighAPI_Double& theRadius);
 
+  /// Set minimum radius and maximum radius
+  PRIMITIVESAPI_EXPORT
+  void setRadius(const ModelHighAPI_Double& theRMin, const ModelHighAPI_Double& theRMax);
+
+  /// Set minimum phi and maximum phi
+  PRIMITIVESAPI_EXPORT
+  void setPhi(const ModelHighAPI_Double& thePhiMin, const ModelHighAPI_Double& thePhiMax);
+
+  /// Set minimum theta and maximum theta
+  PRIMITIVESAPI_EXPORT
+  void setTheta(const ModelHighAPI_Double& theThetaMin, const ModelHighAPI_Double& theThetaMax);
+
   /// Dump wrapped feature
   PRIMITIVESAPI_EXPORT
   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
@@ -89,4 +125,15 @@ PRIMITIVESAPI_EXPORT
 SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
                     const ModelHighAPI_Double& theRadius);
 
+/// \ingroup CPPHighAPI
+/// \brief Create primitive Sphere feature.
+PRIMITIVESAPI_EXPORT
+SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
+                    const ModelHighAPI_Double& theRMin,
+                    const ModelHighAPI_Double& theRMax,
+                    const ModelHighAPI_Double& thePhiMin,
+                    const ModelHighAPI_Double& thePhiMax,
+                    const ModelHighAPI_Double& theThetaMin,
+                    const ModelHighAPI_Double& theThetaMax);
+
 #endif // PRIMITIVESAPI_SPHERE_H_
index c9c43d750ec8fa478d4cbe6b9b1b77281cbaa5e3..f80c7f3affeae0c74df022e494492ca5f6806db9 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeSelection.h>
+#include <ModelAPI_AttributeString.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_Session.h>
@@ -43,6 +44,9 @@ PrimitivesPlugin_Sphere::PrimitivesPlugin_Sphere()
 //=================================================================================================
 void PrimitivesPlugin_Sphere::initAttributes()
 {
+  data()->addAttribute(PrimitivesPlugin_Sphere::CREATION_METHOD(), ModelAPI_AttributeString::typeId());
+  
+  // data for the first mode : by a point and a radius
   data()->addAttribute(PrimitivesPlugin_Sphere::CENTER_POINT_ID(),
                        ModelAPI_AttributeSelection::typeId());
 
@@ -60,10 +64,31 @@ void PrimitivesPlugin_Sphere::initAttributes()
       aCenterPoint->setValue(aPointRes, std::shared_ptr<GeomAPI_Shape>());
     }
   }
+  
+  // data for the second mode : by dimensions
+  data()->addAttribute(PrimitivesPlugin_Sphere::RMIN_ID(), ModelAPI_AttributeDouble::typeId());
+  data()->addAttribute(PrimitivesPlugin_Sphere::RMAX_ID(), ModelAPI_AttributeDouble::typeId());
+  data()->addAttribute(PrimitivesPlugin_Sphere::PHIMIN_ID(), ModelAPI_AttributeDouble::typeId());
+  data()->addAttribute(PrimitivesPlugin_Sphere::PHIMAX_ID(), ModelAPI_AttributeDouble::typeId());
+  data()->addAttribute(PrimitivesPlugin_Sphere::THETAMIN_ID(), ModelAPI_AttributeDouble::typeId());
+  data()->addAttribute(PrimitivesPlugin_Sphere::THETAMAX_ID(), ModelAPI_AttributeDouble::typeId());
 }
 
 //=================================================================================================
 void PrimitivesPlugin_Sphere::execute()
+{
+  AttributeStringPtr aMethodTypeAttr = string(PrimitivesPlugin_Sphere::CREATION_METHOD());
+  std::string aMethodType = aMethodTypeAttr->value();
+
+  if (aMethodType == CREATION_METHOD_BY_PT_RADIUS())
+    createSphereByPtRadius();
+
+  if (aMethodType == CREATION_METHOD_BY_DIMENSIONS())
+    createShereByDimensions();
+}
+
+//=================================================================================================
+void PrimitivesPlugin_Sphere::createSphereByPtRadius()
 {
   // Getting point.
   std::shared_ptr<GeomAPI_Pnt> aCenterPoint;
@@ -111,6 +136,48 @@ void PrimitivesPlugin_Sphere::execute()
   setResult(aResultBox, aResultIndex);
 }
 
+//=================================================================================================
+void PrimitivesPlugin_Sphere::createShereByDimensions()
+{
+  // Getting rmin, rmax, phimin, phimax, thetamin et thetamax
+  double aRMin = real(PrimitivesPlugin_Sphere::RMIN_ID())->value();
+  double aRMax = real(PrimitivesPlugin_Sphere::RMAX_ID())->value();
+  double aPhiMin = real(PrimitivesPlugin_Sphere::PHIMIN_ID())->value();
+  double aPhiMax = real(PrimitivesPlugin_Sphere::PHIMAX_ID())->value();
+  double aThetaMin = real(PrimitivesPlugin_Sphere::THETAMIN_ID())->value();
+  double aThetaMax = real(PrimitivesPlugin_Sphere::THETAMAX_ID())->value();
+  
+  std::shared_ptr<GeomAlgoAPI_Sphere> aSphereAlgo = std::shared_ptr<GeomAlgoAPI_Sphere>(
+      new GeomAlgoAPI_Sphere(aRMin, aRMax, aPhiMin, aPhiMax, aThetaMin, aThetaMax));
+  
+  // These checks should be made to the GUI for the feature but
+  // the corresponding validator does not exist yet.
+  if (!aSphereAlgo->check()) {
+    setError(aSphereAlgo->getError());
+    return;
+  }
+
+  // Build the box
+  aSphereAlgo->build();
+
+  // Check if the creation of the box
+  if(!aSphereAlgo->isDone()) {
+    // The error is not displayed in a popup window. It must be in the message console.
+    setError(aSphereAlgo->getError());
+    return;
+  }
+  if(!aSphereAlgo->checkValid("Root Sphere Builder")) {
+    // The error is not displayed in a popup window. It must be in the message console.
+    setError(aSphereAlgo->getError());
+    return;
+  }
+
+  int aResultIndex = 0;
+  ResultBodyPtr aResultBox = document()->createBody(data(), aResultIndex);
+  loadNamingDS(aSphereAlgo, aResultBox);
+  setResult(aResultBox, aResultIndex);
+}
+
 //=================================================================================================
 void PrimitivesPlugin_Sphere::loadNamingDS(std::shared_ptr<GeomAlgoAPI_Sphere> theSphereAlgo,
                                            std::shared_ptr<ModelAPI_ResultBody> theResultSphere)
index 01d48dcc67cb90fbd7184376980659913fdf7077..ce0e025a8a2c62c41d022e4ce32668eb0bfe3663 100644 (file)
@@ -44,6 +44,27 @@ class PrimitivesPlugin_Sphere : public ModelAPI_Feature
     return MY_SPHERE_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& CREATION_METHOD_BY_PT_RADIUS()
+  {
+    static const std::string MY_CREATION_METHOD_ID("SphereByPointRadius");
+    return MY_CREATION_METHOD_ID;
+  }
+
+  /// Attribute name for creation method
+  inline static const std::string& CREATION_METHOD_BY_DIMENSIONS()
+  {
+    static const std::string MY_CREATION_METHOD_ID("SphereByDimensions");
+    return MY_CREATION_METHOD_ID;
+  }
+
   /// Attribute name of the base point
   inline static const std::string& CENTER_POINT_ID()
   {
@@ -57,6 +78,48 @@ class PrimitivesPlugin_Sphere : public ModelAPI_Feature
     static const std::string MY_RADIUS_ID("radius");
     return MY_RADIUS_ID;
   }
+  
+  /// attribute name of the inner radius
+  inline static const std::string& RMIN_ID()
+  {
+    static const std::string MY_RMIN_ID("rmin");
+    return MY_RMIN_ID;
+  }
+  
+  /// attribute name of the outer radius
+  inline static const std::string& RMAX_ID()
+  {
+    static const std::string MY_RMAX_ID("rmax");
+    return MY_RMAX_ID;
+  }
+  
+  /// attribute name of the lower phi limit
+  inline static const std::string& PHIMIN_ID()
+  {
+    static const std::string MY_PHIMIN_ID("phimin");
+    return MY_PHIMIN_ID;
+  }
+  
+  /// attribute name of the higher phi limit
+  inline static const std::string& PHIMAX_ID()
+  {
+    static const std::string MY_PHIMAX_ID("phimax");
+    return MY_PHIMAX_ID;
+  }
+  
+  /// attribute name of the lower theta limit
+  inline static const std::string& THETAMIN_ID()
+  {
+    static const std::string MY_THETAMIN_ID("thetamin");
+    return MY_THETAMIN_ID;
+  }
+  
+  /// attribute name of the higher theta limit
+  inline static const std::string& THETAMAX_ID()
+  {
+    static const std::string MY_THETAMAX_ID("thetamax");
+    return MY_THETAMAX_ID;
+  }
 
   /// Returns the kind of a feature
   PRIMITIVESPLUGIN_EXPORT virtual const std::string& getKind()
@@ -78,6 +141,12 @@ class PrimitivesPlugin_Sphere : public ModelAPI_Feature
   /// Load Naming data structure of the feature to the document
   void loadNamingDS(std::shared_ptr<GeomAlgoAPI_Sphere> theSphereAlgo,
                     std::shared_ptr<ModelAPI_ResultBody> theResultSphere);
+  
+  ///
+  void createSphereByPtRadius();
+  
+  ///
+  void createShereByDimensions();
 
 };
 
index d2f29ce1e1ea49c0b1d5d623992ba7e25f5a5eca..ade9f70f7fcee2c56c83f9d05e846945a77f9133 100644 (file)
@@ -1,15 +1,71 @@
 <source>
-  <shape_selector id="center_point"
+  <toolbox id="CreationMethod">
+    <box id="SphereByPointRadius" title="By point and radius" icon="">
+      <shape_selector id="center_point"
                   label="Center point"
                   icon="icons/Primitives/point.png"
                   tooltip="Select a center point"
                   shape_types="vertex">
-  </shape_selector>
-  <doublevalue id="radius"
+      </shape_selector>
+      <doublevalue id="radius"
                label="Radius"
                icon="icons/Primitives/radius.png"
                tooltip="Enter a radius"
                step="1."
                default="10.">
-  </doublevalue>
-</source>
\ No newline at end of file
+      </doublevalue>
+    </box>
+    <box id="SphereByDimensions" title="By dimensions" icon="">
+      <groupbox title="Dimensions">
+        <doublevalue
+          id="rmin"
+          label="Rmin"
+          step="1."
+          default="0."
+          tooltip="Enter the inner radius">
+        </doublevalue>
+        <doublevalue
+          id="rmax"
+          label="Rmax"
+          step="1."
+          default="10."
+          tooltip="Enter the outer radius">
+        </doublevalue>
+      </groupbox>
+      <label title=""/>
+      <groupbox title="Phi/theta range">
+        <doublevalue
+          id="phimin"
+          label="Phi min"
+          step="1."
+          default="0."
+          tooltip="Enter the azimuthal starting angle">
+        </doublevalue>
+        <doublevalue
+          id="phimax"
+          label="Phi max"
+          step="1."
+          default="360."
+          max="360.0"
+          tooltip="Enter the azimuthal revolution angle">
+        </doublevalue>
+        <doublevalue
+          id="thetamin"
+          label="Theta min"
+          step="1."
+          default="0."
+          max="180.0"
+          tooltip="Enter the polar starting angle">
+        </doublevalue>
+        <doublevalue
+          id="thetamax"
+          label="Theta max"
+          step="1."
+          default="180."
+          max="180.0"
+          tooltip="Enter the polar revolution angle">
+        </doublevalue>
+      </groupbox>
+    </box>
+  </toolbox>
+</source>