1 // Copyright (C) 2007-2014 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, or (at your option) any later version.
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 _AdvancedEngine_PipeTShapeDriver_HXX
21 #define _AdvancedEngine_PipeTShapeDriver_HXX
23 #include "AdvancedEngine.hxx"
25 #include "GEOM_BaseDriver.hxx"
26 #include "GEOMAlgo_State.hxx"
28 #include <TopAbs_ShapeEnum.hxx>
29 #include <TopTools_HSequenceOfShape.hxx>
30 #include <TColStd_HSequenceOfInteger.hxx>
31 #include <Geom_Surface.hxx>
33 DEFINE_STANDARD_HANDLE( AdvancedEngine_PipeTShapeDriver, GEOM_BaseDriver );
35 class ADVANCEDENGINE_EXPORT AdvancedEngine_PipeTShapeDriver : public GEOM_BaseDriver
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
47 static const Standard_GUID& GetID();
48 ~AdvancedEngine_PipeTShapeDriver() {};
50 virtual bool GetCreationInformation(std::string& theOperationName,
51 std::vector<GEOM_Param>& params);
54 DEFINE_STANDARD_RTTI( AdvancedEngine_PipeTShapeDriver )
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
68 TopoDS_Shape MakePipeTShape(double r1, double w1, double l1,
69 double r2, double w2, double l2) const;
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
81 TopoDS_Shape MakeQuarterPipeTShape(double r1, double w1, double l1,
82 double r2, double w2, double l2) const;
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
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;
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
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;
112 //=======================================================================
113 //function : getCommonShapesOnCylinders
114 //purpose : return the common edge between 2 cylindrical surfaces
116 //=======================================================================
117 void GetCommonShapesOnCylinders(const TopoDS_Shape& theShape,
118 TopAbs_ShapeEnum theShapeType,
120 Handle(TopTools_HSequenceOfShape)& commonShapes) const;
124 #endif // _AdvancedEngine_PipeTShapeDriver_HXX