1 // Copyright (C) 2007-2015 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 "GEOM_BaseDriver.hxx"
24 #include "GEOMAlgo_State.hxx"
26 #include <TopAbs_ShapeEnum.hxx>
27 #include <TopTools_HSequenceOfShape.hxx>
28 #include <TColStd_HSequenceOfInteger.hxx>
29 #include <Geom_Surface.hxx>
31 DEFINE_STANDARD_HANDLE( AdvancedEngine_PipeTShapeDriver, GEOM_BaseDriver );
33 class AdvancedEngine_PipeTShapeDriver : public GEOM_BaseDriver
38 AdvancedEngine_PipeTShapeDriver();
39 virtual Standard_Integer Execute(TFunction_Logbook& log) const;
40 virtual void Validate(TFunction_Logbook&) const {}
41 Standard_Boolean MustExecute(const TFunction_Logbook&) const
45 static const Standard_GUID& GetID();
46 ~AdvancedEngine_PipeTShapeDriver() {};
48 virtual bool GetCreationInformation(std::string& theOperationName,
49 std::vector<GEOM_Param>& params);
52 DEFINE_STANDARD_RTTI( AdvancedEngine_PipeTShapeDriver )
57 * \brief Create a T-Shape based on pipes
58 * \param r1 - the internal radius of main pipe
59 * \param w1 - the thickness of main pipe
60 * \param l1 - the half-length of main pipe
61 * \param r2 - the internal radius of incident pipe
62 * \param w2 - the thickness of incident pipe
63 * \param l2 - the half-length of main pipe
64 * \retval TopoDS_Shape - Resulting shape
66 TopoDS_Shape MakePipeTShape(double r1, double w1, double l1,
67 double r2, double w2, double l2) const;
70 * \brief Create a quarter of a T-Shape based on pipes
71 * \param r1 - the internal radius of main pipe
72 * \param w1 - the thickness of main pipe
73 * \param l1 - the half-length of main pipe
74 * \param r2 - the internal radius of incident pipe
75 * \param w2 - the thickness of incident pipe
76 * \param l2 - the half-length of main pipe
77 * \retval TopoDS_Shape - Resulting shape
79 TopoDS_Shape MakeQuarterPipeTShape(double r1, double w1, double l1,
80 double r2, double w2, double l2) const;
83 * \brief Find IDs of sub-shapes complying with given status about surface
84 * \param theSurface - the surface to check state of sub-shapes against
85 * \param theShape - the shape to explore
86 * \param theShapeType - type of sub-shape of theShape
87 * \param theState - required state
88 * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
90 Handle(TColStd_HSequenceOfInteger)
91 GetShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
92 const TopoDS_Shape& theShape,
93 TopAbs_ShapeEnum theShapeType,
94 GEOMAlgo_State theState) const;
97 * \brief Find IDs of sub-shapes complying with given status about surface
98 * \param theBox - the box to check state of sub-shapes against
99 * \param theShape - the shape to explore
100 * \param theShapeType - type of sub-shape of theShape
101 * \param theState - required state
102 * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
104 Handle(TColStd_HSequenceOfInteger)
105 GetShapesOnBoxIDs(const TopoDS_Shape& aBox,
106 const TopoDS_Shape& aShape,
107 const Standard_Integer theShapeType,
108 GEOMAlgo_State theState) const;
110 //=======================================================================
111 //function : getCommonShapesOnCylinders
112 //purpose : return the common edge between 2 cylindrical surfaces
114 //=======================================================================
115 void GetCommonShapesOnCylinders(const TopoDS_Shape& theShape,
116 TopAbs_ShapeEnum theShapeType,
118 Handle(TopTools_HSequenceOfShape)& commonShapes) const;
122 #endif // _AdvancedEngine_PipeTShapeDriver_HXX