1 // Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File: GEOMAlgo_ClsfSurf.cxx
24 // Created: Wed Nov 22 10:41:47 2006
25 // Author: Peter KURNEV
28 #include <GEOMAlgo_ClsfSurf.hxx>
30 #include <GeomAbs_SurfaceType.hxx>
31 #include <GeomAdaptor_Curve.hxx>
33 #include <GEOMAlgo_SurfaceTools.hxx>
35 IMPLEMENT_STANDARD_RTTIEXT(GEOMAlgo_ClsfSurf, GEOMAlgo_Clsf)
37 //=======================================================================
40 //=======================================================================
41 GEOMAlgo_ClsfSurf::GEOMAlgo_ClsfSurf()
46 //=======================================================================
49 //=======================================================================
50 GEOMAlgo_ClsfSurf::~GEOMAlgo_ClsfSurf()
53 //=======================================================================
54 //function : SetSurface
56 //=======================================================================
57 void GEOMAlgo_ClsfSurf::SetSurface(const Handle(Geom_Surface)& aS)
61 //=======================================================================
64 //=======================================================================
65 const Handle(Geom_Surface)& GEOMAlgo_ClsfSurf::Surface() const
69 //=======================================================================
70 //function : CheckData
72 //=======================================================================
73 void GEOMAlgo_ClsfSurf::CheckData()
75 GeomAbs_SurfaceType aType;
80 myErrorStatus=10; // mySurface=NULL
85 aType=myGAS.GetType();
86 if (!(aType==GeomAbs_Plane ||
87 aType==GeomAbs_Cylinder ||
88 aType==GeomAbs_Sphere)) {
89 myErrorStatus=11; // unallowed surface type
92 //=======================================================================
95 //=======================================================================
96 void GEOMAlgo_ClsfSurf::Perform()
105 GEOMAlgo_SurfaceTools::GetState(myPnt, myGAS, myTolerance, myState);
107 //=======================================================================
110 //=======================================================================
111 Standard_Boolean GEOMAlgo_ClsfSurf::CanBeON(const Handle(Geom_Curve)& aC) const
113 GeomAbs_SurfaceType aST;
114 GeomAbs_CurveType aCT;
115 GeomAdaptor_Curve aGAC;
121 if (aCT==GeomAbs_Line && aST==GeomAbs_Sphere) {
122 return Standard_False;
124 return Standard_True;
126 //=======================================================================
129 //=======================================================================
130 Standard_Boolean GEOMAlgo_ClsfSurf::CanBeON(const Handle(Geom_Surface)& aS1) const
132 Standard_Boolean bRet;
133 GeomAbs_SurfaceType aST, aST1;
134 GeomAdaptor_Surface aGAS1;
138 aST1=aGAS1.GetType();