]> SALOME platform Git repositories - modules/geom.git/blob - src/AdvancedEngine/AdvancedEngine_PipeTShapeDriver.hxx
Salome HOME
0022616: [CEA 1038] Improve the quality of stl and vtk exports
[modules/geom.git] / src / AdvancedEngine / AdvancedEngine_PipeTShapeDriver.hxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _AdvancedEngine_PipeTShapeDriver_HXX
21 #define _AdvancedEngine_PipeTShapeDriver_HXX
22
23 #include "AdvancedEngine.hxx"
24
25 #include "GEOM_BaseDriver.hxx"
26 #include "GEOMAlgo_State.hxx"
27
28 #include <TopAbs_ShapeEnum.hxx>
29 #include <TopTools_HSequenceOfShape.hxx>
30 #include <TColStd_HSequenceOfInteger.hxx>
31 #include <Geom_Surface.hxx>
32
33 DEFINE_STANDARD_HANDLE( AdvancedEngine_PipeTShapeDriver, GEOM_BaseDriver );
34
35 class ADVANCEDENGINE_EXPORT AdvancedEngine_PipeTShapeDriver : public GEOM_BaseDriver
36 {
37 public:
38  // Methods PUBLIC
39   // 
40   AdvancedEngine_PipeTShapeDriver();
41   virtual  Standard_Integer Execute(TFunction_Logbook& log) const; 
42   virtual void Validate(TFunction_Logbook&) const {}
43   Standard_Boolean MustExecute(const TFunction_Logbook&) const
44   {
45     return Standard_True;
46   }
47   static const Standard_GUID& GetID();
48   ~AdvancedEngine_PipeTShapeDriver() {};
49   
50   virtual bool GetCreationInformation(std::string&             theOperationName,
51                                       std::vector<GEOM_Param>& params);
52   // Type management
53   //
54 DEFINE_STANDARD_RTTI( AdvancedEngine_PipeTShapeDriver )
55
56 private:
57
58   /*!
59    * \brief Create a T-Shape based on pipes
60    * \param r1 - the internal radius of main pipe
61    * \param w1 - the thickness of main pipe
62    * \param l1 - the half-length of main pipe
63    * \param r2 - the internal radius of incident pipe
64    * \param w2 - the thickness of incident pipe
65    * \param l2 - the half-length of main pipe
66    * \retval TopoDS_Shape - Resulting shape
67    */
68   TopoDS_Shape MakePipeTShape(double r1, double w1, double l1,
69                               double r2, double w2, double l2) const;
70
71   /*!
72    * \brief Create a quarter of a T-Shape based on pipes
73    * \param r1 - the internal radius of main pipe
74    * \param w1 - the thickness of main pipe
75    * \param l1 - the half-length of main pipe
76    * \param r2 - the internal radius of incident pipe
77    * \param w2 - the thickness of incident pipe
78    * \param l2 - the half-length of main pipe
79    * \retval TopoDS_Shape - Resulting shape
80    */
81   TopoDS_Shape MakeQuarterPipeTShape(double r1, double w1, double l1,
82                                      double r2, double w2, double l2) const;
83
84   /*!
85    * \brief Find IDs of sub-shapes complying with given status about surface
86    * \param theSurface - the surface to check state of sub-shapes against
87    * \param theShape - the shape to explore
88    * \param theShapeType - type of sub-shape of theShape
89    * \param theState - required state
90    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
91    */
92   Handle(TColStd_HSequenceOfInteger)
93     GetShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
94                           const TopoDS_Shape&         theShape,
95                           TopAbs_ShapeEnum            theShapeType,
96                           GEOMAlgo_State              theState) const;
97
98   /*!
99    * \brief Find IDs of sub-shapes complying with given status about surface
100     * \param theBox - the box to check state of sub-shapes against
101     * \param theShape - the shape to explore
102     * \param theShapeType - type of sub-shape of theShape
103     * \param theState - required state
104     * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
105    */
106   Handle(TColStd_HSequenceOfInteger)
107   GetShapesOnBoxIDs(const TopoDS_Shape& aBox,
108                  const TopoDS_Shape& aShape,
109                  const Standard_Integer theShapeType,
110                  GEOMAlgo_State theState) const;
111
112   //=======================================================================
113   //function : getCommonShapesOnCylinders
114   //purpose  : return the common edge between 2 cylindrical surfaces
115   //           along OX and OZ
116   //=======================================================================
117   void GetCommonShapesOnCylinders(const TopoDS_Shape& theShape,
118                                   TopAbs_ShapeEnum theShapeType,
119                                   double r, double r2,
120                                   Handle(TopTools_HSequenceOfShape)& commonShapes) const;
121
122 };
123
124 #endif // _AdvancedEngine_PipeTShapeDriver_HXX