1 // Created on: 1993-07-02 2 // Created by: Laurent BUCHARD 3 // Copyright (c) 1993-1999 Matra Datavision 4 // Copyright (c) 1999-2014 OPEN CASCADE SAS 5 // 6 // This file is part of Open CASCADE Technology software library. 7 // 8 // This library is free software; you can redistribute it and/or modify it under 9 // the terms of the GNU Lesser General Public License version 2.1 as published 10 // by the Free Software Foundation, with special exception defined in the file 11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 12 // distribution for complete text of the license and disclaimer of any warranty. 13 // 14 // Alternatively, this file may be used under the terms of Open CASCADE 15 // commercial license or contractual agreement. 16 17 #ifndef _Adaptor3d_HSurfaceTool_HeaderFile 18 #define _Adaptor3d_HSurfaceTool_HeaderFile 19 20 #include <Adaptor3d_Surface.hxx> 21 #include <Adaptor3d_Curve.hxx> 22 #include <Geom_BezierSurface.hxx> 23 #include <Geom_BSplineSurface.hxx> 24 #include <GeomAbs_Shape.hxx> 25 #include <GeomAbs_SurfaceType.hxx> 26 #include <gp_Ax1.hxx> 27 #include <gp_Dir.hxx> 28 #include <gp_Cylinder.hxx> 29 #include <gp_Cone.hxx> 30 #include <gp_Pln.hxx> 31 #include <gp_Pnt.hxx> 32 #include <gp_Sphere.hxx> 33 #include <gp_Torus.hxx> 34 #include <gp_Vec.hxx> 35 #include <Standard.hxx> 36 #include <Standard_DefineAlloc.hxx> 37 #include <Standard_Handle.hxx> 38 #include <Standard_Boolean.hxx> 39 #include <TColStd_Array1OfReal.hxx> 40 41 class Adaptor3d_HSurfaceTool 42 { 43 public: 44 45 DEFINE_STANDARD_ALLOC 46 FirstUParameter(const Handle (Adaptor3d_Surface)& theSurf)47 static Standard_Real FirstUParameter (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->FirstUParameter(); } 48 FirstVParameter(const Handle (Adaptor3d_Surface)& theSurf)49 static Standard_Real FirstVParameter (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->FirstVParameter(); } 50 LastUParameter(const Handle (Adaptor3d_Surface)& theSurf)51 static Standard_Real LastUParameter (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->LastUParameter(); } 52 LastVParameter(const Handle (Adaptor3d_Surface)& theSurf)53 static Standard_Real LastVParameter (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->LastVParameter(); } 54 NbUIntervals(const Handle (Adaptor3d_Surface)& theSurf,const GeomAbs_Shape theSh)55 static Standard_Integer NbUIntervals (const Handle(Adaptor3d_Surface)& theSurf, const GeomAbs_Shape theSh) { return theSurf->NbUIntervals (theSh); } 56 NbVIntervals(const Handle (Adaptor3d_Surface)& theSurf,const GeomAbs_Shape theSh)57 static Standard_Integer NbVIntervals (const Handle(Adaptor3d_Surface)& theSurf, const GeomAbs_Shape theSh) { return theSurf->NbVIntervals (theSh); } 58 UIntervals(const Handle (Adaptor3d_Surface)& theSurf,TColStd_Array1OfReal & theTab,const GeomAbs_Shape theSh)59 static void UIntervals (const Handle(Adaptor3d_Surface)& theSurf, TColStd_Array1OfReal& theTab, const GeomAbs_Shape theSh) { theSurf->UIntervals (theTab, theSh); } 60 VIntervals(const Handle (Adaptor3d_Surface)& theSurf,TColStd_Array1OfReal & theTab,const GeomAbs_Shape theSh)61 static void VIntervals (const Handle(Adaptor3d_Surface)& theSurf, TColStd_Array1OfReal& theTab, const GeomAbs_Shape theSh) { theSurf->VIntervals (theTab, theSh); } 62 63 //! If <First> >= <Last> UTrim(const Handle (Adaptor3d_Surface)& theSurf,const Standard_Real theFirst,const Standard_Real theLast,const Standard_Real theTol)64 static Handle(Adaptor3d_Surface) UTrim (const Handle(Adaptor3d_Surface)& theSurf, 65 const Standard_Real theFirst, const Standard_Real theLast, const Standard_Real theTol) 66 { 67 return theSurf->UTrim (theFirst, theLast, theTol); 68 } 69 70 //! If <First> >= <Last> VTrim(const Handle (Adaptor3d_Surface)& theSurf,const Standard_Real theFirst,const Standard_Real theLast,const Standard_Real theTol)71 static Handle(Adaptor3d_Surface) VTrim (const Handle(Adaptor3d_Surface)& theSurf, 72 const Standard_Real theFirst, const Standard_Real theLast, const Standard_Real theTol) 73 { 74 return theSurf->VTrim (theFirst, theLast, theTol); 75 } 76 IsUClosed(const Handle (Adaptor3d_Surface)& theSurf)77 static Standard_Boolean IsUClosed (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->IsUClosed(); } 78 IsVClosed(const Handle (Adaptor3d_Surface)& theSurf)79 static Standard_Boolean IsVClosed (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->IsVClosed(); } 80 IsUPeriodic(const Handle (Adaptor3d_Surface)& theSurf)81 static Standard_Boolean IsUPeriodic (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->IsUPeriodic(); } 82 UPeriod(const Handle (Adaptor3d_Surface)& theSurf)83 static Standard_Real UPeriod (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->UPeriod(); } 84 IsVPeriodic(const Handle (Adaptor3d_Surface)& theSurf)85 static Standard_Boolean IsVPeriodic (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->IsVPeriodic(); } 86 VPeriod(const Handle (Adaptor3d_Surface)& theSurf)87 static Standard_Real VPeriod (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->VPeriod(); } 88 Value(const Handle (Adaptor3d_Surface)& theSurf,const Standard_Real theU,const Standard_Real theV)89 static gp_Pnt Value (const Handle(Adaptor3d_Surface)& theSurf, const Standard_Real theU, const Standard_Real theV) { return theSurf->Value (theU, theV); } 90 D0(const Handle (Adaptor3d_Surface)& theSurf,const Standard_Real theU,const Standard_Real theV,gp_Pnt & thePnt)91 static void D0 (const Handle(Adaptor3d_Surface)& theSurf, 92 const Standard_Real theU, const Standard_Real theV, 93 gp_Pnt& thePnt) 94 { 95 theSurf->D0 (theU, theV, thePnt); 96 } 97 D1(const Handle (Adaptor3d_Surface)& theSurf,const Standard_Real theU,const Standard_Real theV,gp_Pnt & thePnt,gp_Vec & theD1U,gp_Vec & theD1V)98 static void D1 (const Handle(Adaptor3d_Surface)& theSurf, 99 const Standard_Real theU, const Standard_Real theV, 100 gp_Pnt& thePnt, 101 gp_Vec& theD1U, gp_Vec& theD1V) 102 { 103 theSurf->D1 (theU, theV, thePnt, theD1U, theD1V); 104 } 105 D2(const Handle (Adaptor3d_Surface)& theSurf,const Standard_Real theU,const Standard_Real theV,gp_Pnt & thePnt,gp_Vec & theD1U,gp_Vec & theD1V,gp_Vec & theD2U,gp_Vec & theD2V,gp_Vec & theD2UV)106 static void D2 (const Handle(Adaptor3d_Surface)& theSurf, 107 const Standard_Real theU, const Standard_Real theV, 108 gp_Pnt& thePnt, 109 gp_Vec& theD1U, gp_Vec& theD1V, 110 gp_Vec& theD2U, gp_Vec& theD2V, gp_Vec& theD2UV) 111 { 112 theSurf->D2 (theU, theV, thePnt, theD1U, theD1V, theD2U, theD2V, theD2UV); 113 } 114 D3(const Handle (Adaptor3d_Surface)& theSurf,const Standard_Real theU,const Standard_Real theV,gp_Pnt & thePnt,gp_Vec & theD1U,gp_Vec & theD1V,gp_Vec & theD2U,gp_Vec & theD2V,gp_Vec & theD2UV,gp_Vec & theD3U,gp_Vec & theD3V,gp_Vec & theD3UUV,gp_Vec & theD3UVV)115 static void D3 (const Handle(Adaptor3d_Surface)& theSurf, 116 const Standard_Real theU, const Standard_Real theV, 117 gp_Pnt& thePnt, 118 gp_Vec& theD1U, gp_Vec& theD1V, 119 gp_Vec& theD2U, gp_Vec& theD2V, gp_Vec& theD2UV, 120 gp_Vec& theD3U, gp_Vec& theD3V, gp_Vec& theD3UUV, gp_Vec& theD3UVV) 121 { 122 theSurf->D3 (theU, theV, thePnt, theD1U, theD1V, theD2U, theD2V, theD2UV, theD3U, theD3V, theD3UUV, theD3UVV); 123 } 124 DN(const Handle (Adaptor3d_Surface)& theSurf,const Standard_Real theU,const Standard_Real theV,const Standard_Integer theNU,const Standard_Integer theNV)125 static gp_Vec DN (const Handle(Adaptor3d_Surface)& theSurf, 126 const Standard_Real theU, const Standard_Real theV, 127 const Standard_Integer theNU, const Standard_Integer theNV) 128 { 129 return theSurf->DN (theU, theV, theNU, theNV); 130 } 131 UResolution(const Handle (Adaptor3d_Surface)& theSurf,const Standard_Real theR3d)132 static Standard_Real UResolution (const Handle(Adaptor3d_Surface)& theSurf, const Standard_Real theR3d) 133 { 134 return theSurf->UResolution (theR3d); 135 } 136 VResolution(const Handle (Adaptor3d_Surface)& theSurf,const Standard_Real theR3d)137 static Standard_Real VResolution (const Handle(Adaptor3d_Surface)& theSurf, const Standard_Real theR3d) 138 { 139 return theSurf->VResolution (theR3d); 140 } 141 GetType(const Handle (Adaptor3d_Surface)& theSurf)142 static GeomAbs_SurfaceType GetType (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->GetType(); } 143 Plane(const Handle (Adaptor3d_Surface)& theSurf)144 static gp_Pln Plane (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->Plane(); } 145 Cylinder(const Handle (Adaptor3d_Surface)& theSurf)146 static gp_Cylinder Cylinder (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->Cylinder(); } 147 Cone(const Handle (Adaptor3d_Surface)& theSurf)148 static gp_Cone Cone (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->Cone(); } 149 Torus(const Handle (Adaptor3d_Surface)& theSurf)150 static gp_Torus Torus (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->Torus(); } 151 Sphere(const Handle (Adaptor3d_Surface)& theSurf)152 static gp_Sphere Sphere (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->Sphere(); } 153 Bezier(const Handle (Adaptor3d_Surface)& theSurf)154 static Handle(Geom_BezierSurface) Bezier (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->Bezier(); } 155 BSpline(const Handle (Adaptor3d_Surface)& theSurf)156 static Handle(Geom_BSplineSurface) BSpline (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->BSpline(); } 157 AxeOfRevolution(const Handle (Adaptor3d_Surface)& theSurf)158 static gp_Ax1 AxeOfRevolution (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->AxeOfRevolution(); } 159 Direction(const Handle (Adaptor3d_Surface)& theSurf)160 static gp_Dir Direction (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->Direction(); } 161 BasisCurve(const Handle (Adaptor3d_Surface)& theSurf)162 static Handle(Adaptor3d_Curve) BasisCurve (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->BasisCurve(); } 163 BasisSurface(const Handle (Adaptor3d_Surface)& theSurf)164 static Handle(Adaptor3d_Surface) BasisSurface (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->BasisSurface(); } 165 OffsetValue(const Handle (Adaptor3d_Surface)& theSurf)166 static Standard_Real OffsetValue (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->OffsetValue(); } 167 168 Standard_EXPORT static Standard_Integer NbSamplesU (const Handle(Adaptor3d_Surface)& S); 169 170 Standard_EXPORT static Standard_Integer NbSamplesV (const Handle(Adaptor3d_Surface)& S); 171 172 Standard_EXPORT static Standard_Integer NbSamplesU (const Handle(Adaptor3d_Surface)& S, const Standard_Real u1, const Standard_Real u2); 173 174 Standard_EXPORT static Standard_Integer NbSamplesV (const Handle(Adaptor3d_Surface)& , const Standard_Real v1, const Standard_Real v2); 175 176 }; 177 178 #endif // _Adaptor3d_HSurfaceTool_HeaderFile 179