// Created on: 1993-08-18 // Created by: Laurent BUCHARD // Copyright (c) 1993-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. // Modified by skv - Wed Jun 16 17:36:47 2004 OCC6001 #include #include #include #include #include #define EPSX 0.00000000000001 #define EPSDIST 0.00000001 #define EPSNUL 0.00000001 //================================================================================ IntCurveSurface_QuadricCurveExactInter::IntCurveSurface_QuadricCurveExactInter(const TheSurface& S, const TheCurve& C) : nbpnts(-1),nbintv(-1) { GeomAbs_SurfaceType QuadricType = TheSurfaceTool::GetType(S); IntSurf_Quadric Quadric; switch(QuadricType) { case GeomAbs_Plane: { Quadric.SetValue(TheSurfaceTool::Plane(S)); break; } case GeomAbs_Cylinder: { Quadric.SetValue(TheSurfaceTool::Cylinder(S)); break; } case GeomAbs_Cone: { Quadric.SetValue(TheSurfaceTool::Cone(S)); break; } case GeomAbs_Sphere: { Quadric.SetValue(TheSurfaceTool::Sphere(S)); break; } default: { //cout<<" Probleme Sur le Type de Surface dans IntCurveSurface_Inter::InternalPerform "< nbIntervals) { nbpnts = pnts.Length(); nbintv = intv.Length()/2; } // Modified by skv - Wed Jun 16 17:36:47 2004 OCC6001 End } //================================================================================ Standard_Boolean IntCurveSurface_QuadricCurveExactInter::IsDone() const { return(nbpnts!=-1); } //================================================================================ Standard_Integer IntCurveSurface_QuadricCurveExactInter::NbRoots() const { return(nbpnts); } //================================================================================ Standard_Integer IntCurveSurface_QuadricCurveExactInter::NbIntervals() const { return(nbintv); } //================================================================================ Standard_Real IntCurveSurface_QuadricCurveExactInter::Root(const Standard_Integer Index) const { return(pnts(Index)); } //================================================================================ void IntCurveSurface_QuadricCurveExactInter::Intervals(const Standard_Integer Index, Standard_Real& a, Standard_Real& b) const { Standard_Integer Index2 = Index+Index-1; a = intv(Index2); b = intv(Index2+1); }