1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef _GEOMImpl_PipeTShapeDriver_HXX
21 #define _GEOMImpl_PipeTShapeDriver_HXX
23 #include <TFunction_Driver.hxx>
25 #include "GEOMAlgo_State.hxx"
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>
34 #include <Handle_Geom_Surface.hxx>
36 class Handle_Standard_Type;
37 class GEOMImpl_PipeTShapeDriver;
41 #include "GEOM_BaseDriver.hxx"
43 DEFINE_STANDARD_HANDLE( GEOMImpl_PipeTShapeDriver, GEOM_BaseDriver );
45 class GEOMImpl_PipeTShapeDriver : public GEOM_BaseDriver {
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
56 Standard_EXPORT static const Standard_GUID& GetID();
57 Standard_EXPORT ~GEOMImpl_PipeTShapeDriver() {};
59 Standard_EXPORT virtual
60 bool GetCreationInformation(std::string& theOperationName,
61 std::vector<GEOM_Param>& params);
64 DEFINE_STANDARD_RTTI( GEOMImpl_PipeTShapeDriver )
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
78 TopoDS_Shape MakePipeTShape(double r1, double w1, double l1,
79 double r2, double w2, double l2) const;
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
91 TopoDS_Shape MakeQuarterPipeTShape(double r1, double w1, double l1,
92 double r2, double w2, double l2) const;
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
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;
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
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;
122 //=======================================================================
123 //function : getCommonShapesOnCylinders
124 //purpose : return the common edge between 2 cylindrical surfaces
126 //=======================================================================
127 void GetCommonShapesOnCylinders(const TopoDS_Shape& theShape,
128 TopAbs_ShapeEnum theShapeType,
130 Handle(TopTools_HSequenceOfShape)& commonShapes) const;
134 #endif // _GEOMImpl_PipeTShapeDriver_HXX