Salome HOME
Synchronize adm files
[modules/geom.git] / src / AdvancedEngine / GEOMImpl_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 _GEOMImpl_PipeTShapeDriver_HXX
21 #define _GEOMImpl_PipeTShapeDriver_HXX
22
23 #include <TFunction_Driver.hxx>
24
25 #include "GEOMAlgo_State.hxx"
26
27 #include <TopAbs_ShapeEnum.hxx>
28 #include <TopTools_ListOfShape.hxx>
29 #include <TopTools_HSequenceOfShape.hxx>
30 #include <TopTools_IndexedMapOfShape.hxx>
31 #include <TColStd_HSequenceOfInteger.hxx>
32 #include <gp_Ax2.hxx>
33
34 #include <Handle_Geom_Surface.hxx>
35
36 class Handle_Standard_Type;
37 class GEOMImpl_PipeTShapeDriver;
38
39
40
41 #include "GEOM_BaseDriver.hxx"
42
43 DEFINE_STANDARD_HANDLE( GEOMImpl_PipeTShapeDriver, GEOM_BaseDriver );
44
45 class GEOMImpl_PipeTShapeDriver : public GEOM_BaseDriver {
46 public:
47  // Methods PUBLIC
48   // 
49   Standard_EXPORT GEOMImpl_PipeTShapeDriver();
50   Standard_EXPORT virtual  Standard_Integer Execute(TFunction_Logbook& log) const; 
51   Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {}
52   Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const
53   {
54     return Standard_True;
55   }
56   Standard_EXPORT static const Standard_GUID& GetID();
57   Standard_EXPORT ~GEOMImpl_PipeTShapeDriver() {};
58   
59   Standard_EXPORT virtual
60   bool GetCreationInformation(std::string&             theOperationName,
61                               std::vector<GEOM_Param>& params);
62   // Type management
63   //
64 DEFINE_STANDARD_RTTI( GEOMImpl_PipeTShapeDriver )
65
66 private:
67
68   /*!
69    * \brief Create a T-Shape based on pipes
70    * \param r1 - the internal radius of main pipe
71    * \param w1 - the thickness of main pipe
72    * \param l1 - the half-length of main pipe
73    * \param r2 - the internal radius of incident pipe
74    * \param w2 - the thickness of incident pipe
75    * \param l2 - the half-length of main pipe
76    * \retval TopoDS_Shape - Resulting shape
77    */
78   TopoDS_Shape MakePipeTShape(double r1, double w1, double l1,
79                               double r2, double w2, double l2) const;
80
81   /*!
82    * \brief Create a quarter of a T-Shape based on pipes
83    * \param r1 - the internal radius of main pipe
84    * \param w1 - the thickness of main pipe
85    * \param l1 - the half-length of main pipe
86    * \param r2 - the internal radius of incident pipe
87    * \param w2 - the thickness of incident pipe
88    * \param l2 - the half-length of main pipe
89    * \retval TopoDS_Shape - Resulting shape
90    */
91   TopoDS_Shape MakeQuarterPipeTShape(double r1, double w1, double l1,
92                                      double r2, double w2, double l2) const;
93
94   /*!
95    * \brief Find IDs of sub-shapes complying with given status about surface
96    * \param theSurface - the surface to check state of sub-shapes against
97    * \param theShape - the shape to explore
98    * \param theShapeType - type of sub-shape of theShape
99    * \param theState - required state
100    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
101    */
102   Handle(TColStd_HSequenceOfInteger)
103     GetShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
104                           const TopoDS_Shape&         theShape,
105                           TopAbs_ShapeEnum            theShapeType,
106                           GEOMAlgo_State              theState) const;
107
108   /*!
109    * \brief Find IDs of sub-shapes complying with given status about surface
110     * \param theBox - the box to check state of sub-shapes against
111     * \param theShape - the shape to explore
112     * \param theShapeType - type of sub-shape of theShape
113     * \param theState - required state
114     * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
115    */
116   Handle(TColStd_HSequenceOfInteger)
117   GetShapesOnBoxIDs(const TopoDS_Shape& aBox,
118                  const TopoDS_Shape& aShape,
119                  const Standard_Integer theShapeType,
120                  GEOMAlgo_State theState) const;
121
122   //=======================================================================
123   //function : getCommonShapesOnCylinders
124   //purpose  : return the common edge between 2 cylindrical surfaces
125   //           along OX and OZ
126   //=======================================================================
127   void GetCommonShapesOnCylinders(const TopoDS_Shape& theShape,
128                                   TopAbs_ShapeEnum theShapeType,
129                                   double r, double r2,
130                                   Handle(TopTools_HSequenceOfShape)& commonShapes) const;
131
132 };
133
134 #endif // _GEOMImpl_PipeTShapeDriver_HXX