Back to index

salome-geom  6.5.0
GEOMImpl_PipeTShapeDriver.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef _GEOMImpl_PipeTShapeDriver_HXX
00021 #define _GEOMImpl_PipeTShapeDriver_HXX
00022 
00023 #include <TFunction_Driver.hxx>
00024 
00025 #include "GEOMAlgo_State.hxx"
00026 
00027 #include <TopTools_ListOfShape.hxx>
00028 #include <TopTools_HSequenceOfShape.hxx>
00029 #include <TopTools_IndexedMapOfShape.hxx>
00030 #include <TopAbs_ShapeEnum.hxx>
00031 #include <TColStd_HSequenceOfInteger.hxx>
00032 
00033 #include <Handle_Geom_Surface.hxx>
00034 
00035 class Handle_Standard_Type;
00036 class GEOMImpl_PipeTShapeDriver;
00037 
00038 Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMImpl_PipeTShapeDriver);
00039 
00040 class Handle(GEOMImpl_PipeTShapeDriver) : public Handle(TFunction_Driver) {
00041 public:
00042   inline void* operator new(size_t,void* anAddress) 
00043   {
00044     return anAddress;
00045   }
00046   inline void* operator new(size_t size) 
00047   { 
00048     return Standard::Allocate(size); 
00049   }
00050   inline void  operator delete(void *anAddress) 
00051   { 
00052     if (anAddress) Standard::Free((Standard_Address&)anAddress); 
00053   }
00054   
00055   Handle(GEOMImpl_PipeTShapeDriver)():Handle(TFunction_Driver)() {} 
00056   Handle(GEOMImpl_PipeTShapeDriver)(const Handle(GEOMImpl_PipeTShapeDriver)& aHandle) : Handle(TFunction_Driver)(aHandle) 
00057   {}
00058 
00059   Handle(GEOMImpl_PipeTShapeDriver)(const GEOMImpl_PipeTShapeDriver* anItem) : Handle(TFunction_Driver)((TFunction_Driver *)anItem) 
00060   {}
00061 
00062   Handle(GEOMImpl_PipeTShapeDriver)& operator=(const Handle(GEOMImpl_PipeTShapeDriver)& aHandle)
00063   {
00064     Assign(aHandle.Access());
00065     return *this;
00066   }
00067   
00068   Handle(GEOMImpl_PipeTShapeDriver)& operator=(const GEOMImpl_PipeTShapeDriver* anItem)
00069   {
00070     Assign((Standard_Transient *)anItem);
00071     return *this;
00072   }
00073   
00074   GEOMImpl_PipeTShapeDriver* operator->() 
00075   {
00076     return (GEOMImpl_PipeTShapeDriver *)ControlAccess();
00077   }
00078   
00079   GEOMImpl_PipeTShapeDriver* operator->() const 
00080   {
00081     return (GEOMImpl_PipeTShapeDriver *)ControlAccess();
00082   }
00083   
00084   Standard_EXPORT ~Handle(GEOMImpl_PipeTShapeDriver)() {};
00085   
00086   Standard_EXPORT static const Handle(GEOMImpl_PipeTShapeDriver) DownCast(const Handle(Standard_Transient)& AnObject);
00087 };
00088 
00089 class GEOMImpl_PipeTShapeDriver : public TFunction_Driver {
00090 public:
00091   inline void* operator new(size_t,void* anAddress) 
00092   {
00093     return anAddress;
00094   }
00095   inline void* operator new(size_t size) 
00096   { 
00097     return Standard::Allocate(size); 
00098   }
00099   inline void  operator delete(void *anAddress) 
00100   { 
00101     if (anAddress) Standard::Free((Standard_Address&)anAddress); 
00102   }
00103   
00104   // Methods PUBLIC
00105   // 
00106   Standard_EXPORT GEOMImpl_PipeTShapeDriver();
00107   Standard_EXPORT virtual  Standard_Integer Execute(TFunction_Logbook& log) const; 
00108   Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {}
00109   Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const
00110   {
00111     return Standard_True;
00112   }
00113   Standard_EXPORT static const Standard_GUID& GetID();
00114   Standard_EXPORT ~GEOMImpl_PipeTShapeDriver() {};
00115   
00116   // Type management
00117   //
00118   Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_PipeTShapeDriver_Type_();
00119   Standard_EXPORT const Handle(Standard_Type)& DynamicType() const
00120   {
00121     return STANDARD_TYPE(GEOMImpl_PipeTShapeDriver);
00122   }
00123   Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const
00124   {
00125     return (STANDARD_TYPE(GEOMImpl_PipeTShapeDriver) == AType || TFunction_Driver::IsKind(AType));
00126   }
00127 private:
00138   TopoDS_Shape MakePipeTShape(double r1, double w1, double l1, double r2, double w2, double l2) const;
00139 
00150   TopoDS_Shape MakeQuarterPipeTShape(double r1, double w1, double l1, double r2, double w2, double l2) const;
00151 
00152 //=======================================================================
00153 //function : GetShapesOnSurfaceIDs
00162   Handle(TColStd_HSequenceOfInteger)
00163     GetShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
00164                           const TopoDS_Shape&         theShape,
00165                           TopAbs_ShapeEnum            theShapeType,
00166                           GEOMAlgo_State              theState) const;
00167 //=======================================================================
00168 //function : getShapesOnBoxIDs
00177 //=======================================================================
00178   Handle(TColStd_HSequenceOfInteger)
00179   GetShapesOnBoxIDs(const TopoDS_Shape& aBox,
00180                  const TopoDS_Shape& aShape,
00181                  const Standard_Integer theShapeType,
00182                  GEOMAlgo_State theState) const;
00183 
00184   //=======================================================================
00185   //function : getCommonShapesOnCylinders
00186   //purpose  : return the common edge between 2 cylindrical surfaces
00187   //           along OX and OZ
00188   //=======================================================================
00189   void GetCommonShapesOnCylinders(const TopoDS_Shape& theShape,
00190                               TopAbs_ShapeEnum theShapeType,
00191                   double r, double r2,
00192                               Handle(TopTools_HSequenceOfShape)& commonShapes) const;
00193 
00194 };
00195 
00196 #endif // _GEOMImpl_PipeTShapeDriver_HXX