1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: GEOMAlgo_ClsfSurf.cxx
21 // Created: Wed Nov 22 10:41:47 2006
22 // Author: Peter KURNEV
26 #include <GEOMAlgo_ClsfSurf.ixx>
27 #include <GeomAbs_SurfaceType.hxx>
28 #include <GEOMAlgo_SurfaceTools.hxx>
29 #include <GeomAdaptor_Curve.hxx>
31 //=======================================================================
34 //=======================================================================
35 GEOMAlgo_ClsfSurf::GEOMAlgo_ClsfSurf()
40 //=======================================================================
43 //=======================================================================
44 GEOMAlgo_ClsfSurf::~GEOMAlgo_ClsfSurf()
47 //=======================================================================
48 //function : SetSurface
50 //=======================================================================
51 void GEOMAlgo_ClsfSurf::SetSurface(const Handle(Geom_Surface)& aS)
55 //=======================================================================
58 //=======================================================================
59 const Handle(Geom_Surface)& GEOMAlgo_ClsfSurf::Surface() const
63 //=======================================================================
64 //function : CheckData
66 //=======================================================================
67 void GEOMAlgo_ClsfSurf::CheckData()
69 GeomAbs_SurfaceType aType;
74 myErrorStatus=10; // mySurface=NULL
79 aType=myGAS.GetType();
80 if (!(aType==GeomAbs_Plane ||
81 aType==GeomAbs_Cylinder ||
82 aType==GeomAbs_Sphere)) {
83 myErrorStatus=11; // unallowed surface type
86 //=======================================================================
89 //=======================================================================
90 void GEOMAlgo_ClsfSurf::Perform()
99 GEOMAlgo_SurfaceTools::GetState(myPnt, myGAS, myTolerance, myState);
101 //=======================================================================
104 //=======================================================================
105 Standard_Boolean GEOMAlgo_ClsfSurf::CanBeON(const Handle(Geom_Curve)& aC) const
107 GeomAbs_SurfaceType aST;
108 GeomAbs_CurveType aCT;
109 GeomAdaptor_Curve aGAC;
115 if (aCT==GeomAbs_Line && aST==GeomAbs_Sphere) {
116 return Standard_False;
118 return Standard_True;
120 //=======================================================================
123 //=======================================================================
124 Standard_Boolean GEOMAlgo_ClsfSurf::CanBeON(const Handle(Geom_Surface)& aS1) const
126 Standard_Boolean bRet;
127 GeomAbs_SurfaceType aST, aST1;
128 GeomAdaptor_Surface aGAS1;
132 aST1=aGAS1.GetType();