Back to index

salome-geom  6.5.0
GEOMImpl_Fillet1d.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 //  File   : GEOMImpl_Fillet1d.hxx
00021 //  Module : GEOMImpl
00022 //
00023 #ifndef _GEOMImpl_Fillet1d_HeaderFile
00024 #define _GEOMImpl_Fillet1d_HeaderFile
00025 
00026 #include <gp_Pnt.hxx>
00027 #include <Geom_Plane.hxx>
00028 #include <Geom2d_Curve.hxx>
00029 
00030 #include <TopoDS_Edge.hxx>
00031 #include <TColStd_ListOfReal.hxx>
00032 #include <TColStd_SequenceOfReal.hxx>
00033 #include <TColStd_SequenceOfInteger.hxx>
00034 
00035 class GEOMImpl_Fillet1dPoint;
00036 
00041 class GEOMImpl_Fillet1d 
00042 {
00043 public:
00046   Standard_EXPORT GEOMImpl_Fillet1d(const TopoDS_Edge& theEdge1,
00047                                     const TopoDS_Edge& theEdge2,
00048                                     const gp_Pln&      thePlane);
00051   Standard_EXPORT Standard_Boolean Perform(const Standard_Real theRadius);
00053   Standard_EXPORT TopoDS_Edge Result(const gp_Pnt& thePoint, TopoDS_Edge& theEdge1, TopoDS_Edge& theEdge2);
00054 
00055 private:
00057   void fillPoint(GEOMImpl_Fillet1dPoint*);
00058   void fillDiff(GEOMImpl_Fillet1dPoint*, Standard_Real, Standard_Boolean);
00059   void performNewton(GEOMImpl_Fillet1dPoint*, GEOMImpl_Fillet1dPoint*);
00060   Standard_Boolean processPoint(GEOMImpl_Fillet1dPoint*, GEOMImpl_Fillet1dPoint*, Standard_Real);
00061 
00062 
00063 private:
00065   TopoDS_Edge myEdge1, myEdge2;
00066   Handle(Geom_Plane) myPlane;
00067   Handle(Geom2d_Curve) myCurve1, myCurve2;
00068   Standard_Real myStart1, myEnd1, myStart2, myEnd2, myRadius;
00069   TColStd_ListOfReal myResultParams;
00070   TColStd_SequenceOfInteger myResultOrientation;
00071   Standard_Boolean myStartSide, myEdgesExchnged;
00072   Standard_Integer myDegreeOfRecursion;
00073 };
00074 
00075 
00081 class GEOMImpl_Fillet1dPoint
00082 {
00083 public:
00085 
00087   Standard_EXPORT GEOMImpl_Fillet1dPoint(Standard_Real theParam)
00088   {myParam = theParam;}
00089   
00092   Standard_EXPORT GEOMImpl_Fillet1dPoint* Copy(); // warning: this is not the full copy! 
00093 
00095   Standard_EXPORT inline void SetParam(Standard_Real theParam)
00096     {myParam = theParam;}
00097   Standard_EXPORT inline Standard_Real GetParam() const
00098     {return myParam;}
00099   Standard_EXPORT inline void SetParam2(const Standard_Real theParam2)
00100     {myParam2 = theParam2;}
00101   Standard_EXPORT inline Standard_Real GetParam2()
00102     { return myParam2 ; }
00103 
00105   Standard_EXPORT inline Standard_Boolean IsValid(int theIndex)
00106     {return (Standard_Boolean)myValid.Value(theIndex);}
00107 
00109   Standard_EXPORT inline Standard_Integer GetNBValues() {return myV.Length();}
00110   Standard_EXPORT inline Standard_Real GetValue(Standard_Integer theIndex)
00111     {return myV.Value(theIndex);}
00112   Standard_EXPORT inline Standard_Real GetDiff(Standard_Integer theIndex)
00113     {return myD.Value(theIndex);}
00114   Standard_EXPORT inline Standard_Integer GetNear(Standard_Integer theIndex)
00115     {return myNear.Value(theIndex);}
00116 
00118   Standard_EXPORT inline void SetCenter(const gp_Pnt2d thePoint)
00119     {myCenter = thePoint;}
00120   Standard_EXPORT inline const gp_Pnt2d GetCenter()
00121     {return myCenter;}
00122 
00123   Standard_EXPORT void AddValue(Standard_Real theValue, Standard_Boolean theIsValid);
00124 
00126   Standard_EXPORT Standard_Boolean ComputeDifference(GEOMImpl_Fillet1dPoint*);
00127   Standard_EXPORT void FilterPoints(GEOMImpl_Fillet1dPoint*);
00128   
00130   Standard_EXPORT Standard_Integer HasSolution(Standard_Real theRadius); 
00132   void RemoveSolution(Standard_Integer theIndex);
00133 
00134 private:
00136   gp_Pnt2d myCenter;
00137   Standard_Real myParam, myParam2;
00138   TColStd_SequenceOfReal myV, myD;
00139   TColStd_SequenceOfInteger myValid, myNear;
00140 };
00141 
00142 #endif