X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMAlgo%2FGEOMAlgo_ShellSolid.cxx;h=f502a8fc2fea58cf5270e1fe9e8bb810578fe77e;hb=04f3d723da1ae9133d108921c8f10338a9656d12;hp=cd53db7fe0ab69e0c982cb6ffa52ee392d35ed19;hpb=ca429d817a18d6acc571443f6a596575dee03c2f;p=modules%2Fgeom.git diff --git a/src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx b/src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx index cd53db7fe..f502a8fc2 100644 --- a/src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx +++ b/src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx @@ -1,3 +1,22 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: GEOMAlgo_ShellSolid.cxx // Created: Wed Jan 12 12:49:45 2005 // Author: Peter KURNEV @@ -10,24 +29,25 @@ #include #include +#include +#include #include #include -#include #include #include #include +#include +#include #include #include -#include - #include #include - +#include #include #include @@ -46,28 +66,10 @@ #include #include #include -// -#include -#include -#include -#include -#include -#include -#include + #include #include #include -#include -#include -#include -#include -#include -#include -#include - -static - Standard_Boolean CheckSameDomainFaceInside(const TopoDS_Face& theFace1, - const TopoDS_Face& theFace2); //======================================================================= //function : GEOMAlgo_ShellSolid @@ -345,10 +347,10 @@ void GEOMAlgo_ShellSolid::DetectSDFaces() Standard_Boolean bIsValidIn2D, bNegativeFlag; bIsValidIn2D=BOPTools_Tools3D::IsValidArea (aFaceResult, bNegativeFlag); if (bIsValidIn2D) { - if(CheckSameDomainFaceInside(aFaceResult, aF2)) { - iZone=1; - break; - } + //if(CheckSameDomainFaceInside(aFaceResult, aF2)) { + iZone=1; + break; + //} } // } @@ -365,52 +367,3 @@ void GEOMAlgo_ShellSolid::DetectSDFaces() aFF.SetSenseFlag (iSenseFlag); }// end of for (i=1; i<=aNb; i++) } -//======================================================================= -//function : CheckSameDomainFaceInside -//purpose : -//======================================================================= -Standard_Boolean CheckSameDomainFaceInside(const TopoDS_Face& theFace1, - const TopoDS_Face& theFace2) -{ - Standard_Real umin = 0., umax = 0., vmin = 0., vmax = 0.; - BRepTools::UVBounds(theFace1, umin, umax, vmin, vmax); - IntTools_Context aContext; - Handle(Geom_Surface) aSurface = BRep_Tool::Surface(theFace1); - Standard_Real aTolerance = BRep_Tool::Tolerance(theFace1); - - TopExp_Explorer anExpE(theFace1, TopAbs_EDGE); - - for(; anExpE.More(); anExpE.Next()) { - const TopoDS_Edge& anEdge = TopoDS::Edge(anExpE.Current()); - Standard_Real anEdgeTol = BRep_Tool::Tolerance(anEdge); - aTolerance = (aTolerance < anEdgeTol) ? anEdgeTol : aTolerance; - } - aTolerance += BRep_Tool::Tolerance(theFace2); - - Standard_Integer nbpoints = 5; - Standard_Real adeltau = (umax - umin) / (nbpoints + 1); - Standard_Real adeltav = (vmax - vmin) / (nbpoints + 1); - Standard_Real U = umin + adeltau; - GeomAPI_ProjectPointOnSurf& aProjector = aContext.ProjPS(theFace2); - - for(Standard_Integer i = 1; i <= nbpoints; i++, U+=adeltau) { - Standard_Real V = vmin + adeltav; - - for(Standard_Integer j = 1; j <= nbpoints; j++, V+=adeltav) { - gp_Pnt2d aPoint(U,V); - - if(aContext.IsPointInFace(theFace1, aPoint)) { - gp_Pnt aP3d = aSurface->Value(U, V); - aProjector.Perform(aP3d); - - if(aProjector.IsDone()) { - - if(aProjector.LowerDistance() > aTolerance) - return Standard_False; - } - } - } - } - - return Standard_True; -}