1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0024002: Overall code and build procedure refactoring -- automatic

Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
This commit is contained in:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

View File

@@ -1,2 +1,22 @@
IntAna_ListOfCurve.hxx
IntAna_Curve.cxx
IntAna_Curve.hxx
IntAna_Int3Pln.cxx
IntAna_Int3Pln.hxx
IntAna_Int3Pln.lxx
IntAna_IntConicQuad.cxx
IntAna_IntConicQuad.hxx
IntAna_IntConicQuad.lxx
IntAna_IntLinTorus.cxx
IntAna_IntLinTorus.hxx
IntAna_IntLinTorus.lxx
IntAna_IntQuadQuad.cxx
IntAna_IntQuadQuad.hxx
IntAna_IntQuadQuad.lxx
IntAna_ListIteratorOfListOfCurve.hxx
IntAna_ListOfCurve.hxx
IntAna_QuadQuadGeo.cxx
IntAna_QuadQuadGeo.hxx
IntAna_QuadQuadGeo.lxx
IntAna_Quadric.cxx
IntAna_Quadric.hxx
IntAna_ResultType.hxx

View File

@@ -1,77 +0,0 @@
-- Created on: 1992-06-30
-- Created by: Laurent BUCHARD
-- Copyright (c) 1992-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.
package IntAna
---Purpose: This package provides the intersections between :
--
-- - Natural Quadrics when the result is a conic (QuadQuadGeo)
--
-- - A natural Quadric and a Quadric defined by its Coefficients
-- (IntQuadQuad)
--
-- - 3 Pln (Int3Pln)
--
-- - a Line and a Torus (IntLinTorus)
--
-- - a Conic from gp and a Quadric defined by its Coefficients
-- (IntConicQuad)
--
---Level: Public
--
-- All the methods of the classes of this package are public.
--
uses TCollection, math, gp, StdFail, IntAna2d, GeomAbs
is
enumeration ResultType is Point,
Line,
Circle,
PointAndCircle,
Ellipse,
Parabola,
Hyperbola,
Empty,
Same,
NoGeometricSolution;
class QuadQuadGeo;
class IntQuadQuad;
class Int3Pln;
class IntLinTorus;
class IntConicQuad;
class Curve;
class Quadric;
--
imported ListOfCurve;
imported ListIteratorOfListOfCurve;
--
end IntAna;

View File

@@ -1,241 +0,0 @@
-- Created on: 1992-06-30
-- Created by: Laurent BUCHARD
-- Copyright (c) 1992-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.
class Curve from IntAna
---Purpose: Definition of a parametric Curve which is the result
-- of the intersection between two quadrics.
uses Pnt from gp,
Vec from gp,
Ax3 from gp,
Cone from gp,
Cylinder from gp,
SurfaceType from GeomAbs
raises DomainError from Standard
is
Create
---Purpose: Empty Constructor
returns Curve from IntAna;
SetCylinderQuadValues(me :in out;
Cylinder: Cylinder from gp;
Qxx,Qyy,Qzz,Qxy,Qxz,Qyz,Qx,Qy,Qz,Q1 : Real;
Tol,DomInf,DomSup : Real;
TwoZForATheta : Boolean from Standard;
ZIsPositive : Boolean from Standard)
---Purpose: Sets the parameters used to compute Points and Derivative
-- on the curve.
is static;
SetConeQuadValues(me :in out;
Cone: Cone from gp;
Qxx,Qyy,Qzz,Qxy,Qxz,Qyz,Qx,Qy,Qz,Q1 : Real;
Tol,DomInf,DomSup : Real;
TwoZForATheta : Boolean from Standard;
ZIsPositive : Boolean from Standard)
---Purpose: Sets the parameters used to compute Points and
-- Derivative on the curve.
is static;
IsOpen(me)
---Purpose: Returns TRUE if the curve is not infinite at the
-- last parameter or at the first parameter of the domain.
returns Boolean from Standard
is static;
Domain(me ; Theta1,Theta2 : out Real)
---Purpose: Returns the paramatric domain of the curve.
raises DomainError from Standard
-- The exception DomainError is raised if IsRestricted
-- returns False.
is static;
IsConstant(me)
---Purpose: Returns TRUE if the function is constant.
returns Boolean from Standard
is static;
IsFirstOpen(me)
---Purpose: Returns TRUE if the domain is open at the beginning.
returns Boolean from Standard
is static;
IsLastOpen(me)
---Purpose: Returns TRUE if the domain is open at the end.
returns Boolean from Standard
is static;
Value(me: in out ;
Theta: Real from Standard)
---Purpose: Returns the point at parameter Theta on the curve.
returns Pnt from gp
raises DomainError from Standard
-- The exception DomainError is raised if Theta is not in
-- the domain.
is static;
D1u(me: in out ; Theta: Real from Standard;
P: out Pnt from gp; V: out Vec from gp)
---Purpose: Returns the point and the first derivative at parameter
-- Theta on the curve.
returns Boolean from Standard
raises DomainError from Standard
-- The exception DomainError is raised if Theta is not in
-- the domain.
is static;
FindParameter(me; P: Pnt from gp; Para: out Real from Standard)
---Purpose: Tries to find the parameter of the point P on the curve.
-- If the method returns False, the "projection" is
-- impossible, and the value of Para is not significant.
-- If the method returns True, Para is the parameter of the
-- nearest intersection between the curve and the iso-theta
-- containing P.
returns Boolean from Standard
is static;
---------------------------------------------------------------
--
-- Implementation :
--
SetIsFirstOpen(me : in out; Flag: Boolean from Standard)
---Purpose: If flag is True, the Curve is not defined at the
-- first parameter of its domain.
--
is static;
SetIsLastOpen(me : in out; Flag: Boolean from Standard)
---Purpose: If flag is True, the Curve is not defined at the
-- first parameter of its domain.
is static;
InternalValue(me; Theta1,Theta2: Real from Standard)
---Purpose: Protected function.
returns Pnt from gp
is static protected;
InternalUVValue(me; Param: Real from Standard;
U,V,A,B,C,Co,Si,Di: out Real from Standard)
---Purpose: Protected function.
is static;
--
SetDomain(me:out;
Theta1:Real from Standard;
Theta2:Real from Standard)
raises DomainError from Standard;
--
fields
Z0Cte: Real from Standard;
Z0Sin: Real from Standard;
Z0Cos: Real from Standard;
Z0SinSin: Real from Standard;
Z0CosCos: Real from Standard;
Z0CosSin: Real from Standard;
Z1Cte: Real from Standard;
Z1Sin: Real from Standard;
Z1Cos: Real from Standard;
Z1SinSin: Real from Standard;
Z1CosCos: Real from Standard;
Z1CosSin: Real from Standard;
Z2Cte: Real from Standard;
Z2Sin: Real from Standard;
Z2Cos: Real from Standard;
Z2SinSin: Real from Standard;
Z2CosCos: Real from Standard;
Z2CosSin: Real from Standard;
TwoCurves : Boolean from Standard;
TakeZPositive : Boolean from Standard;
Tolerance : Real from Standard;
DomainInf : Real from Standard;
DomainSup : Real from Standard;
RestrictedInf : Boolean from Standard;
RestrictedSup : Boolean from Standard;
firstbounded : Boolean from Standard;
lastbounded : Boolean from Standard;
typequadric : SurfaceType from GeomAbs;
RCyl : Real from Standard;
Angle : Real from Standard;
Ax3 : Ax3 from gp;
end Curve;

View File

@@ -37,14 +37,16 @@
//-- pas etre mene a bien.
//----------------------------------------------------------------------
#include <Precision.hxx>
#include <IntAna_Curve.ixx>
#include <Standard_DomainError.hxx>
#include <math_DirectPolynomialRoots.hxx>
#include <ElSLib.hxx>
#include <gp_Cone.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_XYZ.hxx>
#include <IntAna_Curve.hxx>
#include <math_DirectPolynomialRoots.hxx>
#include <Precision.hxx>
#include <Standard_DomainError.hxx>
//=======================================================================
//function : IntAna_Curve

156
src/IntAna/IntAna_Curve.hxx Normal file
View File

@@ -0,0 +1,156 @@
// Created on: 1992-06-30
// Created by: Laurent BUCHARD
// Copyright (c) 1992-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.
#ifndef _IntAna_Curve_HeaderFile
#define _IntAna_Curve_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <GeomAbs_SurfaceType.hxx>
#include <gp_Ax3.hxx>
class Standard_DomainError;
class gp_Cylinder;
class gp_Cone;
class gp_Pnt;
class gp_Vec;
//! Definition of a parametric Curve which is the result
//! of the intersection between two quadrics.
class IntAna_Curve
{
public:
DEFINE_STANDARD_ALLOC
//! Empty Constructor
Standard_EXPORT IntAna_Curve();
//! Sets the parameters used to compute Points and Derivative
//! on the curve.
Standard_EXPORT void SetCylinderQuadValues (const gp_Cylinder& Cylinder, const Standard_Real Qxx, const Standard_Real Qyy, const Standard_Real Qzz, const Standard_Real Qxy, const Standard_Real Qxz, const Standard_Real Qyz, const Standard_Real Qx, const Standard_Real Qy, const Standard_Real Qz, const Standard_Real Q1, const Standard_Real Tol, const Standard_Real DomInf, const Standard_Real DomSup, const Standard_Boolean TwoZForATheta, const Standard_Boolean ZIsPositive);
//! Sets the parameters used to compute Points and
//! Derivative on the curve.
Standard_EXPORT void SetConeQuadValues (const gp_Cone& Cone, const Standard_Real Qxx, const Standard_Real Qyy, const Standard_Real Qzz, const Standard_Real Qxy, const Standard_Real Qxz, const Standard_Real Qyz, const Standard_Real Qx, const Standard_Real Qy, const Standard_Real Qz, const Standard_Real Q1, const Standard_Real Tol, const Standard_Real DomInf, const Standard_Real DomSup, const Standard_Boolean TwoZForATheta, const Standard_Boolean ZIsPositive);
//! Returns TRUE if the curve is not infinite at the
//! last parameter or at the first parameter of the domain.
Standard_EXPORT Standard_Boolean IsOpen() const;
//! Returns the paramatric domain of the curve.
Standard_EXPORT void Domain (Standard_Real& Theta1, Standard_Real& Theta2) const;
//! Returns TRUE if the function is constant.
Standard_EXPORT Standard_Boolean IsConstant() const;
//! Returns TRUE if the domain is open at the beginning.
Standard_EXPORT Standard_Boolean IsFirstOpen() const;
//! Returns TRUE if the domain is open at the end.
Standard_EXPORT Standard_Boolean IsLastOpen() const;
//! Returns the point at parameter Theta on the curve.
Standard_EXPORT gp_Pnt Value (const Standard_Real Theta);
//! Returns the point and the first derivative at parameter
//! Theta on the curve.
Standard_EXPORT Standard_Boolean D1u (const Standard_Real Theta, gp_Pnt& P, gp_Vec& V);
//! Tries to find the parameter of the point P on the curve.
//! If the method returns False, the "projection" is
//! impossible, and the value of Para is not significant.
//! If the method returns True, Para is the parameter of the
//! nearest intersection between the curve and the iso-theta
//! containing P.
Standard_EXPORT Standard_Boolean FindParameter (const gp_Pnt& P, Standard_Real& Para) const;
//! If flag is True, the Curve is not defined at the
//! first parameter of its domain.
Standard_EXPORT void SetIsFirstOpen (const Standard_Boolean Flag);
//! If flag is True, the Curve is not defined at the
//! first parameter of its domain.
Standard_EXPORT void SetIsLastOpen (const Standard_Boolean Flag);
//! Protected function.
Standard_EXPORT void InternalUVValue (const Standard_Real Param, Standard_Real& U, Standard_Real& V, Standard_Real& A, Standard_Real& B, Standard_Real& C, Standard_Real& Co, Standard_Real& Si, Standard_Real& Di) const;
Standard_EXPORT void SetDomain (const Standard_Real Theta1, const Standard_Real Theta2);
protected:
//! Protected function.
Standard_EXPORT gp_Pnt InternalValue (const Standard_Real Theta1, const Standard_Real Theta2) const;
private:
Standard_Real Z0Cte;
Standard_Real Z0Sin;
Standard_Real Z0Cos;
Standard_Real Z0SinSin;
Standard_Real Z0CosCos;
Standard_Real Z0CosSin;
Standard_Real Z1Cte;
Standard_Real Z1Sin;
Standard_Real Z1Cos;
Standard_Real Z1SinSin;
Standard_Real Z1CosCos;
Standard_Real Z1CosSin;
Standard_Real Z2Cte;
Standard_Real Z2Sin;
Standard_Real Z2Cos;
Standard_Real Z2SinSin;
Standard_Real Z2CosCos;
Standard_Real Z2CosSin;
Standard_Boolean TwoCurves;
Standard_Boolean TakeZPositive;
Standard_Real Tolerance;
Standard_Real DomainInf;
Standard_Real DomainSup;
Standard_Boolean RestrictedInf;
Standard_Boolean RestrictedSup;
Standard_Boolean firstbounded;
Standard_Boolean lastbounded;
GeomAbs_SurfaceType typequadric;
Standard_Real RCyl;
Standard_Real Angle;
gp_Ax3 Ax3;
};
#endif // _IntAna_Curve_HeaderFile

View File

@@ -1,97 +0,0 @@
-- Created on: 1991-05-16
-- Created by: Isabelle GRIGNON
-- Copyright (c) 1991-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.
class Int3Pln from IntAna
---Purpose: Intersection between 3 planes. The algorithm searches
-- for an intersection point. If two of the planes are
-- parallel or identical, IsEmpty returns TRUE.
uses Pln from gp,
Pnt from gp
raises NotDone from StdFail,
DomainError from Standard
is
Create
returns Int3Pln from IntAna;
Create(P1,P2,P3 : Pln from gp)
---Purpose: Determination of the intersection point between
-- 3 planes.
returns Int3Pln from IntAna;
Perform(me: in out; P1,P2,P3 : Pln from gp)
---Purpose: Determination of the intersection point between
-- 3 planes.
is static;
IsDone(me)
---Purpose: Returns True if the computation was successful.
returns Boolean from Standard
---C++: inline
is static;
IsEmpty(me)
---Purpose: Returns TRUE if there is no intersection POINT.
-- If 2 planes are identical or parallel, IsEmpty
-- will return TRUE.
returns Boolean from Standard
---C++: inline
raises NotDone from StdFail
--- The exception NotDone is raised when IsDone() returns False.
is static;
Value(me)
---Purpose: Returns the intersection point.
returns Pnt from gp
---C++: inline
---C++: return const&
raises NotDone from StdFail,
DomainError from Standard
--- The exception NotDone is raised when IsDone() returns False.
--- The exception Domain is raised when IsEmpty() returns False.
is static;
fields
done: Boolean from Standard;
empt: Boolean from Standard;
pnt : Pnt from gp;
end Int3Pln;

View File

@@ -17,13 +17,16 @@
#define No_Standard_OutOfRange
#endif
#include <IntAna_Int3Pln.ixx>
#include <StdFail_NotDone.hxx>
#include <Standard_DomainError.hxx>
#include <gp.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <IntAna_Int3Pln.hxx>
#include <math_Gauss.hxx>
#include <math_Matrix.hxx>
#include <math_Vector.hxx>
#include <gp.hxx>
#include <Standard_DomainError.hxx>
#include <StdFail_NotDone.hxx>
IntAna_Int3Pln::IntAna_Int3Pln () : done(Standard_False) {}

View File

@@ -0,0 +1,90 @@
// Created on: 1991-05-16
// Created by: Isabelle GRIGNON
// Copyright (c) 1991-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.
#ifndef _IntAna_Int3Pln_HeaderFile
#define _IntAna_Int3Pln_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <gp_Pnt.hxx>
class StdFail_NotDone;
class Standard_DomainError;
class gp_Pln;
class gp_Pnt;
//! Intersection between 3 planes. The algorithm searches
//! for an intersection point. If two of the planes are
//! parallel or identical, IsEmpty returns TRUE.
class IntAna_Int3Pln
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT IntAna_Int3Pln();
//! Determination of the intersection point between
//! 3 planes.
Standard_EXPORT IntAna_Int3Pln(const gp_Pln& P1, const gp_Pln& P2, const gp_Pln& P3);
//! Determination of the intersection point between
//! 3 planes.
Standard_EXPORT void Perform (const gp_Pln& P1, const gp_Pln& P2, const gp_Pln& P3);
//! Returns True if the computation was successful.
Standard_Boolean IsDone() const;
//! Returns TRUE if there is no intersection POINT.
//! If 2 planes are identical or parallel, IsEmpty
//! will return TRUE.
Standard_Boolean IsEmpty() const;
//! Returns the intersection point.
const gp_Pnt& Value() const;
protected:
private:
Standard_Boolean done;
Standard_Boolean empt;
gp_Pnt pnt;
};
#include <IntAna_Int3Pln.lxx>
#endif // _IntAna_Int3Pln_HeaderFile

View File

@@ -1,362 +0,0 @@
-- Created on: 1992-08-06
-- Created by: Laurent BUCHARD
-- Copyright (c) 1992-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.
class IntConicQuad from IntAna
---Purpose: This class provides the analytic intersection between
-- a conic defined as an element of gp (Lin,Circ,Elips,
-- Parab,Hypr) and a quadric as defined in the class
-- Quadric from IntAna.
-- The intersection between a conic and a plane is treated
-- as a special case.
--
-- The result of the intersection are points (Pnt from
-- gp), associated with the parameter on the conic.
--
-- A call to an Intersection L:Lin from gp and
-- SPH: Sphere from gp can be written either :
-- IntAna_IntConicQuad Inter(L,IntAna_Quadric(SPH))
-- or :
-- IntAna_IntConicQuad Inter(L,SPH) (it is necessary
-- to include IntAna_Quadric.hxx in this case)
uses Pnt from gp,
Lin from gp,
Circ from gp,
Elips from gp,
Parab from gp,
Hypr from gp,
Pln from gp,
Quadric from IntAna
raises NotDone from StdFail,
OutOfRange from Standard,
DomainError from Standard
is
Create
---Purpose: Empty constructor.
--
returns IntConicQuad from IntAna;
Create(L: Lin from gp; Q: Quadric from IntAna)
---Purpose: Creates the intersection between a line and a quadric.
returns IntConicQuad from IntAna;
Perform(me:in out; L: Lin from gp; Q: Quadric from IntAna)
---Purpose: Intersects a line and a quadric.
is static;
Create(C: Circ from gp; Q: Quadric from IntAna)
---Purpose: Creates the intersection between a circle and a quadric.
returns IntConicQuad from IntAna;
Perform(me: in out; C: Circ from gp; Q: Quadric from IntAna)
---Purpose: Intersects a circle and a quadric.
is static;
Create(E: Elips from gp; Q: Quadric from IntAna)
---Purpose: Creates the intersection between an ellipse and a quadric.
returns IntConicQuad from IntAna;
Perform(me:in out; E: Elips from gp; Q: Quadric from IntAna)
---Purpose: Intersects an ellipse and a quadric.
is static;
Create(P: Parab from gp; Q: Quadric from IntAna)
---Purpose: Creates the intersection between a parabola and a quadric.
returns IntConicQuad from IntAna;
Perform(me:in out; P: Parab from gp; Q: Quadric from IntAna)
---Purpose: Intersects a parabola and a quadric.
is static;
Create(H: Hypr from gp; Q: Quadric from IntAna)
---Purpose: Creates the intersection between an hyperbola and
-- a quadric.
returns IntConicQuad from IntAna;
Perform(me:in out; H: Hypr from gp; Q: Quadric from IntAna)
---Purpose: Intersects an hyperbola and a quadric.
is static;
----------------------------------------------------------------------
-- Intersection between a Conic from gp and a Pln from IntAna
-- The intersection is computed with Tolerances.
----------------------------------------------------------------------
Create(L : Lin from gp; P: Pln from gp;
Tolang: Real from Standard;
Tol : Real from Standard = 0;
Len : Real from Standard = 0)
---Purpose: Intersection between a line and a plane.
-- Tolang is used to determine if the angle between two
-- vectors is null.
-- Tol is used to check the distance between line and plane
-- on the distance <Len> from the origin of the line.
returns IntConicQuad from IntAna;
Perform(me: in out;
L : Lin from gp; P: Pln from gp; Tolang: Real from Standard;
Tol : Real from Standard = 0;
Len : Real from Standard = 0)
---Purpose: Intersects a line and a plane.
-- Tolang is used to determine if the angle between two
-- vectors is null.
-- Tol is used to check the distance between line and plane
-- on the distance <Len> from the origin of the line.
is static;
Create(C : Circ from gp; P: Pln from gp;
Tolang,Tol: Real from Standard)
---Purpose: Intersection between a circle and a plane.
-- Tolang is used to determine if the angle between two
-- vectors is null.
-- Tol is used to determine if a distance is null.
returns IntConicQuad from IntAna;
Perform(me: in out;
C : Circ from gp; P: Pln from gp; Tolang,Tol: Real from Standard)
---Purpose: Intersects a circle and a plane.
-- Tolang is used to determine if the angle between two
-- vectors is null.
-- Tol is used to determine if a distance is null.
is static;
Create(E : Elips from gp; P: Pln from gp;
Tolang,Tol: Real from Standard)
---Purpose: Intersection between an ellipse and a plane.
-- Tolang is used to determine if the angle between two
-- vectors is null.
-- Tol is used to determine if a distance is null.
returns IntConicQuad from IntAna;
Perform(me: in out;
E : Elips from gp; P: Pln from gp; Tolang,Tol: Real from Standard)
---Purpose: Intersects an ellipse and a plane.
-- Tolang is used to determine if the angle between two
-- vectors is null.
-- Tol is used to determine if a distance is null.
is static;
Create(Pb: Parab from gp; P: Pln from gp;
Tolang: Real from Standard)
---Purpose: Intersection between a parabola and a plane.
-- Tolang is used to determine if the angle between two
-- vectors is null.
returns IntConicQuad from IntAna;
Perform(me: in out;
Pb: Parab from gp; P: Pln from gp; Tolang: Real from Standard)
---Purpose: Intersects a parabola and a plane.
-- Tolang is used to determine if the angle between two
-- vectors is null.
is static;
Create(H : Hypr from gp; P: Pln from gp;
Tolang: Real from Standard)
---Purpose: Intersection between an hyperbola and a plane.
-- Tolang is used to determine if the angle between two
-- vectors is null.
returns IntConicQuad from IntAna;
Perform(me: in out;
H : Hypr from gp; P: Pln from gp; Tolang: Real from Standard)
---Purpose: Intersects an hyperbola and a plane.
-- Tolang is used to determine if the angle between two
-- vectors is null.
is static;
IsDone(me)
---Purpose: Returns TRUE if the creation completed.
--
---C++: inline
returns Boolean from Standard
is static;
IsInQuadric(me)
---Purpose: Returns TRUE if the conic is in the quadric.
--
---C++: inline
returns Boolean from Standard
raises NotDone from StdFail
-- The exception NotDone is raised if IsDone returns False.
is static;
IsParallel(me)
---Purpose: Returns TRUE if the line is in a quadric which
-- is parallel to the quadric.
---C++: inline
returns Boolean from Standard
raises NotDone from StdFail
-- The exception NotDone is raised if IsDone returns False.
is static;
NbPoints(me)
---Purpose: Returns the number of intersection point.
--
---C++: inline
returns Integer from Standard
raises NotDone from StdFail,
DomainError from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception DomainError is raised if IsInQuadric returns
-- True or IsParallel returns True.
is static;
Point(me; N: Integer from Standard)
---Purpose: Returns the point of range N.
--
---C++: inline
---C++: return const&
returns Pnt from gp
raises NotDone from StdFail,
DomainError from Standard,
OutOfRange from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception DomainError is raised if IsInQuadric returns
-- True or IsParallel returns true.
-- The exception OutOfRange is raised if N<=0 or N>NbPoints.
is static;
ParamOnConic(me; N: Integer from Standard)
---Purpose: Returns the parameter on the line of the intersection
-- point of range N.
--
---C++: inline
returns Real from Standard
raises NotDone from StdFail,
DomainError from Standard,
OutOfRange from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception DomainError is raised if IsInQuadric returns
-- True or IsParallel returns true.
-- The exception OutOfRange is raised if N<=0 or N>NbPoints.
is static;
fields
done : Boolean from Standard;
parallel : Boolean from Standard;
inquadric : Boolean from Standard;
nbpts : Integer from Standard;
pnts : Pnt from gp [4];
paramonc : Real from Standard [4];
end IntConicQuad;

View File

@@ -23,24 +23,29 @@
#define PERFORM void IntAna_IntConicQuad::Perform
#include <IntAna_IntConicQuad.ixx>
#include <IntAna_QuadQuadGeo.hxx>
#include <ElCLib.hxx>
#include <gp_Ax3.hxx>
#include <gp_Circ.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Elips.hxx>
#include <gp_Hypr.hxx>
#include <gp_Lin.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Parab.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <IntAna2d_AnaIntersection.hxx>
#include <IntAna2d_IntPoint.hxx>
#include <IntAna_IntConicQuad.hxx>
#include <IntAna_QuadQuadGeo.hxx>
#include <IntAna_Quadric.hxx>
#include <IntAna_ResultType.hxx>
#include <gp_Vec.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Ax3.hxx>
#include <math_DirectPolynomialRoots.hxx>
#include <math_TrigonometricFunctionRoots.hxx>
#include <ElCLib.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_OutOfRange.hxx>
#include <StdFail_NotDone.hxx>
static Standard_Real PIpPI = M_PI + M_PI;
//=============================================================================

View File

@@ -0,0 +1,206 @@
// Created on: 1992-08-06
// Created by: Laurent BUCHARD
// Copyright (c) 1992-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.
#ifndef _IntAna_IntConicQuad_HeaderFile
#define _IntAna_IntConicQuad_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <gp_Pnt.hxx>
#include <Standard_Real.hxx>
class StdFail_NotDone;
class Standard_OutOfRange;
class Standard_DomainError;
class gp_Lin;
class IntAna_Quadric;
class gp_Circ;
class gp_Elips;
class gp_Parab;
class gp_Hypr;
class gp_Pln;
class gp_Pnt;
//! This class provides the analytic intersection between
//! a conic defined as an element of gp (Lin,Circ,Elips,
//! Parab,Hypr) and a quadric as defined in the class
//! Quadric from IntAna.
//! The intersection between a conic and a plane is treated
//! as a special case.
//!
//! The result of the intersection are points (Pnt from
//! gp), associated with the parameter on the conic.
//!
//! A call to an Intersection L:Lin from gp and
//! SPH: Sphere from gp can be written either :
//! IntAna_IntConicQuad Inter(L,IntAna_Quadric(SPH))
//! or :
//! IntAna_IntConicQuad Inter(L,SPH) (it is necessary
//! to include IntAna_Quadric.hxx in this case)
class IntAna_IntConicQuad
{
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor.
Standard_EXPORT IntAna_IntConicQuad();
//! Creates the intersection between a line and a quadric.
Standard_EXPORT IntAna_IntConicQuad(const gp_Lin& L, const IntAna_Quadric& Q);
//! Intersects a line and a quadric.
Standard_EXPORT void Perform (const gp_Lin& L, const IntAna_Quadric& Q);
//! Creates the intersection between a circle and a quadric.
Standard_EXPORT IntAna_IntConicQuad(const gp_Circ& C, const IntAna_Quadric& Q);
//! Intersects a circle and a quadric.
Standard_EXPORT void Perform (const gp_Circ& C, const IntAna_Quadric& Q);
//! Creates the intersection between an ellipse and a quadric.
Standard_EXPORT IntAna_IntConicQuad(const gp_Elips& E, const IntAna_Quadric& Q);
//! Intersects an ellipse and a quadric.
Standard_EXPORT void Perform (const gp_Elips& E, const IntAna_Quadric& Q);
//! Creates the intersection between a parabola and a quadric.
Standard_EXPORT IntAna_IntConicQuad(const gp_Parab& P, const IntAna_Quadric& Q);
//! Intersects a parabola and a quadric.
Standard_EXPORT void Perform (const gp_Parab& P, const IntAna_Quadric& Q);
//! Creates the intersection between an hyperbola and
//! a quadric.
Standard_EXPORT IntAna_IntConicQuad(const gp_Hypr& H, const IntAna_Quadric& Q);
//! Intersects an hyperbola and a quadric.
Standard_EXPORT void Perform (const gp_Hypr& H, const IntAna_Quadric& Q);
//! Intersection between a line and a plane.
//! Tolang is used to determine if the angle between two
//! vectors is null.
//! Tol is used to check the distance between line and plane
//! on the distance <Len> from the origin of the line.
Standard_EXPORT IntAna_IntConicQuad(const gp_Lin& L, const gp_Pln& P, const Standard_Real Tolang, const Standard_Real Tol = 0, const Standard_Real Len = 0);
//! Intersects a line and a plane.
//! Tolang is used to determine if the angle between two
//! vectors is null.
//! Tol is used to check the distance between line and plane
//! on the distance <Len> from the origin of the line.
Standard_EXPORT void Perform (const gp_Lin& L, const gp_Pln& P, const Standard_Real Tolang, const Standard_Real Tol = 0, const Standard_Real Len = 0);
//! Intersection between a circle and a plane.
//! Tolang is used to determine if the angle between two
//! vectors is null.
//! Tol is used to determine if a distance is null.
Standard_EXPORT IntAna_IntConicQuad(const gp_Circ& C, const gp_Pln& P, const Standard_Real Tolang, const Standard_Real Tol);
//! Intersects a circle and a plane.
//! Tolang is used to determine if the angle between two
//! vectors is null.
//! Tol is used to determine if a distance is null.
Standard_EXPORT void Perform (const gp_Circ& C, const gp_Pln& P, const Standard_Real Tolang, const Standard_Real Tol);
//! Intersection between an ellipse and a plane.
//! Tolang is used to determine if the angle between two
//! vectors is null.
//! Tol is used to determine if a distance is null.
Standard_EXPORT IntAna_IntConicQuad(const gp_Elips& E, const gp_Pln& P, const Standard_Real Tolang, const Standard_Real Tol);
//! Intersects an ellipse and a plane.
//! Tolang is used to determine if the angle between two
//! vectors is null.
//! Tol is used to determine if a distance is null.
Standard_EXPORT void Perform (const gp_Elips& E, const gp_Pln& P, const Standard_Real Tolang, const Standard_Real Tol);
//! Intersection between a parabola and a plane.
//! Tolang is used to determine if the angle between two
//! vectors is null.
Standard_EXPORT IntAna_IntConicQuad(const gp_Parab& Pb, const gp_Pln& P, const Standard_Real Tolang);
//! Intersects a parabola and a plane.
//! Tolang is used to determine if the angle between two
//! vectors is null.
Standard_EXPORT void Perform (const gp_Parab& Pb, const gp_Pln& P, const Standard_Real Tolang);
//! Intersection between an hyperbola and a plane.
//! Tolang is used to determine if the angle between two
//! vectors is null.
Standard_EXPORT IntAna_IntConicQuad(const gp_Hypr& H, const gp_Pln& P, const Standard_Real Tolang);
//! Intersects an hyperbola and a plane.
//! Tolang is used to determine if the angle between two
//! vectors is null.
Standard_EXPORT void Perform (const gp_Hypr& H, const gp_Pln& P, const Standard_Real Tolang);
//! Returns TRUE if the creation completed.
Standard_Boolean IsDone() const;
//! Returns TRUE if the conic is in the quadric.
Standard_Boolean IsInQuadric() const;
//! Returns TRUE if the line is in a quadric which
//! is parallel to the quadric.
Standard_Boolean IsParallel() const;
//! Returns the number of intersection point.
Standard_Integer NbPoints() const;
//! Returns the point of range N.
const gp_Pnt& Point (const Standard_Integer N) const;
//! Returns the parameter on the line of the intersection
//! point of range N.
Standard_Real ParamOnConic (const Standard_Integer N) const;
protected:
private:
Standard_Boolean done;
Standard_Boolean parallel;
Standard_Boolean inquadric;
Standard_Integer nbpts;
gp_Pnt pnts[4];
Standard_Real paramonc[4];
};
#include <IntAna_IntConicQuad.lxx>
#endif // _IntAna_IntConicQuad_HeaderFile

View File

@@ -1,136 +0,0 @@
-- Created on: 1991-05-16
-- Created by: Isabelle GRIGNON
-- Copyright (c) 1991-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.
class IntLinTorus from IntAna
---Purpose: Intersection between a line and a torus.
uses Lin from gp,
Torus from gp,
Pnt from gp
raises NotDone from StdFail,
OutOfRange from Standard
is
Create
returns IntLinTorus from IntAna;
Create(L : Lin from gp; T : Torus from gp)
---Purpose: Creates the intersection between a line and a torus.
returns IntLinTorus from IntAna;
Perform(me: in out; L : Lin from gp; T : Torus from gp)
---Purpose: Intersects a line and a torus.
is static;
IsDone(me)
---Purpose: Returns True if the computation was successful.
--
---C++: inline
returns Boolean from Standard
is static;
NbPoints(me)
---Purpose: Returns the number of intersection points.
--
---C++: inline
returns Integer from Standard
raises NotDone from StdFail
-- The exception NotDone is raised if IsDone returns False.
is static;
Value(me; Index : Integer from Standard)
---Purpose: Returns the intersection point of range Index.
--
---C++: inline
---C++: return const&
returns Pnt from gp
raises NotDone from StdFail,
OutOfRange from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception OutOfRange is raised if Index <= 0 or
-- Index > NbPoints
is static;
ParamOnLine(me; Index : Integer from Standard)
---Purpose: Returns the parameter on the line of the intersection
-- point of range Index.
--
---C++: inline
returns Real from Standard
raises NotDone from StdFail,
OutOfRange from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception OutOfRange is raised if Index <= 0 or
-- Index > NbPoints
is static;
ParamOnTorus(me; Index : Integer from Standard;
FI,THETA: out Real from Standard)
---Purpose: Returns the parameters on the torus of the intersection
-- point of range Index.
--
---C++: inline
raises NotDone from StdFail,
OutOfRange from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception OutOfRange is raised if Index <= 0 or
-- Index > NbPoints
is static;
fields
done : Boolean from Standard;
nbpt : Integer from Standard;
thePoint: Pnt from gp [4];
theParam: Real from Standard [4];
theFi : Real from Standard [4];
theTheta: Real from Standard [4];
end IntLinTorus;

View File

@@ -16,16 +16,18 @@
//-- lbr : la methode avec les coefficients est catastrophique.
//-- Mise en place d'une vraie solution.
#include <IntAna_IntLinTorus.ixx>
#include <TColStd_Array1OfReal.hxx>
#include <math_DirectPolynomialRoots.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <ElSLib.hxx>
#include <ElCLib.hxx>
#include <ElSLib.hxx>
#include <gp_Dir.hxx>
#include <gp_Lin.hxx>
#include <gp_Pnt.hxx>
#include <gp_Torus.hxx>
#include <gp_Trsf.hxx>
#include <IntAna_IntLinTorus.hxx>
#include <math_DirectPolynomialRoots.hxx>
#include <Standard_OutOfRange.hxx>
#include <StdFail_NotDone.hxx>
#include <TColStd_Array1OfReal.hxx>
IntAna_IntLinTorus::IntAna_IntLinTorus () : done(Standard_False)
{}

View File

@@ -0,0 +1,98 @@
// Created on: 1991-05-16
// Created by: Isabelle GRIGNON
// Copyright (c) 1991-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.
#ifndef _IntAna_IntLinTorus_HeaderFile
#define _IntAna_IntLinTorus_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <gp_Pnt.hxx>
#include <Standard_Real.hxx>
class StdFail_NotDone;
class Standard_OutOfRange;
class gp_Lin;
class gp_Torus;
class gp_Pnt;
//! Intersection between a line and a torus.
class IntAna_IntLinTorus
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT IntAna_IntLinTorus();
//! Creates the intersection between a line and a torus.
Standard_EXPORT IntAna_IntLinTorus(const gp_Lin& L, const gp_Torus& T);
//! Intersects a line and a torus.
Standard_EXPORT void Perform (const gp_Lin& L, const gp_Torus& T);
//! Returns True if the computation was successful.
Standard_Boolean IsDone() const;
//! Returns the number of intersection points.
Standard_Integer NbPoints() const;
//! Returns the intersection point of range Index.
const gp_Pnt& Value (const Standard_Integer Index) const;
//! Returns the parameter on the line of the intersection
//! point of range Index.
Standard_Real ParamOnLine (const Standard_Integer Index) const;
//! Returns the parameters on the torus of the intersection
//! point of range Index.
void ParamOnTorus (const Standard_Integer Index, Standard_Real& FI, Standard_Real& THETA) const;
protected:
private:
Standard_Boolean done;
Standard_Integer nbpt;
gp_Pnt thePoint[4];
Standard_Real theParam[4];
Standard_Real theFi[4];
Standard_Real theTheta[4];
};
#include <IntAna_IntLinTorus.lxx>
#endif // _IntAna_IntLinTorus_HeaderFile

View File

@@ -1,316 +0,0 @@
-- Created on: 1991-05-15
-- Created by: Isabelle GRIGNON
-- Copyright (c) 1991-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.
class IntQuadQuad from IntAna
---Purpose: This class provides the analytic intersection between a
-- cylinder or a cone from gp and another quadric, as defined
-- in the class Quadric from IntAna.
-- This algorithm is used when the geometric intersection
-- (class QuadQuadGeo from IntAna) returns no geometric
-- solution.
-- The result of the intersection may be
-- - Curves as defined in the class Curve from IntAna
-- - Points (Pnt from gp)
uses Cylinder from gp,
Cone from gp,
Quadric from IntAna,
Curve from IntAna,
Pnt from gp
raises OutOfRange from Standard,
NotDone from StdFail,
DomainError from Standard
is
Create
---Purpose: Empty Constructor
returns IntQuadQuad from IntAna;
Create(C: Cylinder from gp; Q: Quadric from IntAna;
Tol: Real from Standard)
---Purpose: Creates the intersection between a cylinder and a quadric .
-- Tol est a definir plus precisemment.
returns IntQuadQuad from IntAna;
Create(C: Cone from gp; Q: Quadric from IntAna;
Tol: Real from Standard)
---Purpose: Creates the intersection between a cone and a quadric.
-- Tol est a definir plus precisemment.
returns IntQuadQuad from IntAna;
Perform(me: in out; C: Cylinder from gp; Q: Quadric from IntAna;
Tol: Real from Standard)
---Purpose: Intersects a cylinder and a quadric .
-- Tol est a definir plus precisemment.
is static;
Perform(me: in out; C: Cone from gp; Q: Quadric from IntAna;
Tol: Real from Standard)
---Purpose: Intersects a cone and a quadric.
-- Tol est a definir plus precisemment.
is static;
IsDone(me)
---Purpose: Returns True if the computation was successful.
--
---C++: inline
returns Boolean from Standard
is static;
IdenticalElements(me)
---Purpose: Returns TRUE if the cylinder, the cone or the sphere
-- is identical to the quadric.
--
---C++: inline
returns Boolean from Standard
raises NotDone from StdFail
-- The exception NotDone is raised if IsDone returns False.
is static;
NbCurve(me)
---Purpose: Returns the number of curves solution.
--
---C++: inline
returns Integer from Standard
raises NotDone from StdFail,
DomainError from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception DomainError is raised if IdenticalElements
-- returns True.
is static;
Curve(me; N: Integer from Standard)
---Purpose: Returns the curve of range N.
--
---C++: return const&
returns Curve from IntAna
raises NotDone from StdFail,
DomainError from Standard,
OutOfRange from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception DomainError is raised if IdenticalElements
-- returns True.
-- The exception OutOfRange is raised if N<=0 or N>NbCurve.
is static;
NbPnt(me)
---Purpose: Returns the number of contact point.
--
---C++: inline
returns Integer from Standard
raises NotDone from StdFail,
DomainError from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception DomainError is raised if IdenticalElements
-- returns True.
is static;
Point(me; N: Integer from Standard)
---Purpose: Returns the point of range N.
--
---C++: return const&
returns Pnt from gp
raises NotDone from StdFail,
DomainError from Standard,
OutOfRange from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception DomainError is raised if IdenticalElements
-- returns True.
-- The exception OutOfRange is raised if N<=0 or N>NbPnt.
is static;
Parameters(me; N: Integer from Standard;
U1,U2: out Real from Standard)
---Purpose: Returns the paramaters on the "explicit quadric"
-- (i.e the cylinder or the cone, the
-- first argument given to the constructor) of the
-- point of range N.
raises NotDone from StdFail,
DomainError from Standard,
OutOfRange from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception DomainError is raised if IdenticalElements
-- returns True.
-- The exception OutOfRange is raised if N<=0 or N>NbPnt.
is static;
HasNextCurve(me; I: Integer from Standard)
---Purpose: Returns True if the Curve I shares its last bound
-- with another curve.
returns Boolean from Standard
raises NotDone from StdFail,
DomainError from Standard,
OutOfRange from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception DomainError is raised if IdenticalElements
-- returns True.
-- The exception OutOfRange is raised if N<=0 or N>NbCurve.
is static;
NextCurve(me; I : Integer from Standard;
Opposite : in out Boolean from Standard)
---Purpose: If HasNextCurve(I) returns True, this function
-- returns the Index J of the curve which has a
-- common bound with the curve I. If Opposite ==
-- True , then the last parameter of the curve I, and
-- the last parameter of the curve J give the same
-- point. Else the last parameter of the curve I and
-- the first parameter of the curve J are the same
-- point.
returns Integer from Standard
raises NotDone from StdFail,
DomainError from Standard,
OutOfRange from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception DomainError is raised if IdenticalElements
-- returns True. It is also raised when HasNextCurve returns
-- False.
-- The exception OutOfRange is raised if N<=0 or N>NbCurve.
is static;
HasPreviousCurve(me; I: Integer from Standard)
---Purpose: Returns True if the Curve I shares its first bound
-- with another curve.
returns Boolean from Standard
raises NotDone from StdFail,
DomainError from Standard,
OutOfRange from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception DomainError is raised if IdenticalElements
-- returns True.
-- The exception OutOfRange is raised if N<=0 or N>NbCurve.
is static;
PreviousCurve(me; I : Integer from Standard;
Opposite : in out Boolean from Standard)
---Purpose: if HasPreviousCurve(I) returns True, this function
-- returns the Index J of the curve which has a
-- common bound with the curve I. If Opposite ==
-- True , then the first parameter of the curve I,
-- and the first parameter of the curve J give the
-- same point. Else the first parameter of the curve
-- I and the last parameter of the curve J are the
-- same point.
returns Integer from Standard
raises NotDone from StdFail,
DomainError from Standard,
OutOfRange from Standard
-- The exception NotDone is raised if IsDone returns False.
-- The exception DomainError is raised if IdenticalElements
-- returns True. It is also raised when HasPreviousCurve
-- returns False.
-- The exception OutOfRange is raised if N<=0 or N>NbCurve.
is static;
InternalSetNextAndPrevious(me: in out)
---Purpose: Set the next and previous fields. Private method.
is static protected;
fields
done : Boolean from Standard is protected;
identical : Boolean from Standard is protected;
TheCurve : Curve from IntAna [12] is protected;
previouscurve : Integer from Standard [12] is protected;
nextcurve : Integer from Standard [12] is protected;
NbCurves : Integer from Standard is protected;
Nbpoints : Integer from Standard is protected;
Thepoints : Pnt from gp [2] is protected;
--
myNbMaxCurves : Integer from Standard is protected;
myEpsilon : Real from Standard is protected;
myEpsilonCoeffPolyNull : Real from Standard is protected;
end IntQuadQuad;

View File

@@ -23,20 +23,23 @@
#define No_Standard_OutOfRange
#endif
//======================================================================
//== I n t e r s e c t i o n C O N E Q U A D R I Q U E
//== C Y L I N D R E Q U A D R I Q U E
//======================================================================
#include <IntAna_IntQuadQuad.ixx>
#include <gp_Ax2.hxx>
#include <gp_Ax3.hxx>
#include <gp_Cone.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Pnt.hxx>
#include <IntAna_Curve.hxx>
#include <IntAna_IntQuadQuad.hxx>
#include <IntAna_Quadric.hxx>
#include <math_TrigonometricFunctionRoots.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_OutOfRange.hxx>
#include <StdFail_NotDone.hxx>
#include <math_TrigonometricFunctionRoots.hxx>
#include <gp_Ax2.hxx>
#include <gp_Ax3.hxx>
//=======================================================================
//class : TrigonometricRoots

View File

@@ -0,0 +1,165 @@
// Created on: 1991-05-15
// Created by: Isabelle GRIGNON
// Copyright (c) 1991-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.
#ifndef _IntAna_IntQuadQuad_HeaderFile
#define _IntAna_IntQuadQuad_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <IntAna_Curve.hxx>
#include <Standard_Integer.hxx>
#include <gp_Pnt.hxx>
#include <Standard_Real.hxx>
class Standard_OutOfRange;
class StdFail_NotDone;
class Standard_DomainError;
class gp_Cylinder;
class IntAna_Quadric;
class gp_Cone;
class IntAna_Curve;
class gp_Pnt;
//! This class provides the analytic intersection between a
//! cylinder or a cone from gp and another quadric, as defined
//! in the class Quadric from IntAna.
//! This algorithm is used when the geometric intersection
//! (class QuadQuadGeo from IntAna) returns no geometric
//! solution.
//! The result of the intersection may be
//! - Curves as defined in the class Curve from IntAna
//! - Points (Pnt from gp)
class IntAna_IntQuadQuad
{
public:
DEFINE_STANDARD_ALLOC
//! Empty Constructor
Standard_EXPORT IntAna_IntQuadQuad();
//! Creates the intersection between a cylinder and a quadric .
//! Tol est a definir plus precisemment.
Standard_EXPORT IntAna_IntQuadQuad(const gp_Cylinder& C, const IntAna_Quadric& Q, const Standard_Real Tol);
//! Creates the intersection between a cone and a quadric.
//! Tol est a definir plus precisemment.
Standard_EXPORT IntAna_IntQuadQuad(const gp_Cone& C, const IntAna_Quadric& Q, const Standard_Real Tol);
//! Intersects a cylinder and a quadric .
//! Tol est a definir plus precisemment.
Standard_EXPORT void Perform (const gp_Cylinder& C, const IntAna_Quadric& Q, const Standard_Real Tol);
//! Intersects a cone and a quadric.
//! Tol est a definir plus precisemment.
Standard_EXPORT void Perform (const gp_Cone& C, const IntAna_Quadric& Q, const Standard_Real Tol);
//! Returns True if the computation was successful.
Standard_Boolean IsDone() const;
//! Returns TRUE if the cylinder, the cone or the sphere
//! is identical to the quadric.
Standard_Boolean IdenticalElements() const;
//! Returns the number of curves solution.
Standard_Integer NbCurve() const;
//! Returns the curve of range N.
Standard_EXPORT const IntAna_Curve& Curve (const Standard_Integer N) const;
//! Returns the number of contact point.
Standard_Integer NbPnt() const;
//! Returns the point of range N.
Standard_EXPORT const gp_Pnt& Point (const Standard_Integer N) const;
//! Returns the paramaters on the "explicit quadric"
//! (i.e the cylinder or the cone, the
//! first argument given to the constructor) of the
//! point of range N.
Standard_EXPORT void Parameters (const Standard_Integer N, Standard_Real& U1, Standard_Real& U2) const;
//! Returns True if the Curve I shares its last bound
//! with another curve.
Standard_EXPORT Standard_Boolean HasNextCurve (const Standard_Integer I) const;
//! If HasNextCurve(I) returns True, this function
//! returns the Index J of the curve which has a
//! common bound with the curve I. If Opposite ==
//! True , then the last parameter of the curve I, and
//! the last parameter of the curve J give the same
//! point. Else the last parameter of the curve I and
//! the first parameter of the curve J are the same
//! point.
Standard_EXPORT Standard_Integer NextCurve (const Standard_Integer I, Standard_Boolean& Opposite) const;
//! Returns True if the Curve I shares its first bound
//! with another curve.
Standard_EXPORT Standard_Boolean HasPreviousCurve (const Standard_Integer I) const;
//! if HasPreviousCurve(I) returns True, this function
//! returns the Index J of the curve which has a
//! common bound with the curve I. If Opposite ==
//! True , then the first parameter of the curve I,
//! and the first parameter of the curve J give the
//! same point. Else the first parameter of the curve
//! I and the last parameter of the curve J are the
//! same point.
Standard_EXPORT Standard_Integer PreviousCurve (const Standard_Integer I, Standard_Boolean& Opposite) const;
protected:
//! Set the next and previous fields. Private method.
Standard_EXPORT void InternalSetNextAndPrevious();
Standard_Boolean done;
Standard_Boolean identical;
IntAna_Curve TheCurve[12];
Standard_Integer previouscurve[12];
Standard_Integer nextcurve[12];
Standard_Integer NbCurves;
Standard_Integer Nbpoints;
gp_Pnt Thepoints[2];
Standard_Integer myNbMaxCurves;
Standard_Real myEpsilon;
Standard_Real myEpsilonCoeffPolyNull;
private:
};
#include <IntAna_IntQuadQuad.lxx>
#endif // _IntAna_IntQuadQuad_HeaderFile

View File

@@ -1,474 +0,0 @@
-- Created on: 1992-08-06
-- Created by: Laurent BUCHARD
-- Copyright (c) 1992-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.
class QuadQuadGeo from IntAna
---Purpose: Geometric intersections between two natural quadrics
-- (Sphere , Cylinder , Cone , Pln from gp).
-- The possible intersections are :
-- - 1 point
-- - 1 or 2 line(s)
-- - 1 Point and 1 Line
-- - 1 circle
-- - 1 ellipse
-- - 1 parabola
-- - 1 or 2 hyperbola(s).
-- - Empty : there is no intersection between the two quadrics.
-- - Same : the quadrics are identical
-- - NoGeometricSolution : there may be an intersection, but it
-- is necessary to use an analytic algorithm to determine
-- it. See class IntQuadQuad from IntAna.
uses Pln from gp,
Cylinder from gp,
Cone from gp,
Sphere from gp,
Torus from gp,
Pnt from gp,
Lin from gp,
Circ from gp,
Elips from gp,
Parab from gp,
Hypr from gp,
Dir from gp,
ResultType from IntAna
raises NotDone from StdFail,
DomainError from Standard,
OutOfRange from Standard
is
Create
---Purpose: Empty constructor.
returns QuadQuadGeo from IntAna;
Create(P1,P2 : Pln from gp;
TolAng, Tol : Real from Standard)
---Purpose: Creates the intersection between two planes.
-- TolAng is the angular tolerance used to determine
-- if the planes are parallel.
-- Tol is the tolerance used to determine if the planes
-- are identical (only when they are parallel).
returns QuadQuadGeo from IntAna;
Perform(me : in out;
P1,P2 : Pln from gp;
TolAng, Tol : Real from Standard)
---Purpose: Intersects two planes.
-- TolAng is the angular tolerance used to determine
-- if the planes are parallel.
-- Tol is the tolerance used to determine if the planes
-- are identical (only when they are parallel).
is static;
Create(P : Pln from gp;
C : Cylinder from gp;
Tolang,Tol: Real from Standard;
H : Real from Standard = 0)
---Purpose: Creates the intersection between a plane and a cylinder.
-- TolAng is the angular tolerance used to determine
-- if the axis of the cylinder is parallel to the plane.
-- Tol is the tolerance used to determine if the result
-- is a circle or an ellipse. If the maximum distance between
-- the ellipse solution and the circle centered at the ellipse
-- center is less than Tol, the result will be the circle.
-- H is the height of the cylinder <Cyl>. It is used to check
-- whether the plane and cylinder are parallel.
returns QuadQuadGeo from IntAna;
Perform(me: in out;
P : Pln from gp;
C : Cylinder from gp;
Tolang,Tol: Real from Standard;
H :Real from Standard = 0)
---Purpose: Intersects a plane and a cylinder.
-- TolAng is the angular tolerance used to determine
-- if the axis of the cylinder is parallel to the plane.
-- Tol is the tolerance used to determine if the result
-- is a circle or an ellipse. If the maximum distance between
-- the ellipse solution and the circle centered at the ellipse
-- center is less than Tol, the result will be the circle.
-- H is the height of the cylinder <Cyl>. It is used to check
-- whether the plane and cylinder are parallel.
is static;
Create(P : Pln from gp;
S : Sphere from gp)
---Purpose: Creates the intersection between a plane and a sphere.
returns QuadQuadGeo from IntAna;
Perform(me: in out;
P : Pln from gp;
S : Sphere from gp)
---Purpose: Intersects a plane and a sphere.
is static;
Create(P : Pln from gp;
C : Cone from gp;
Tolang,Tol: Real from Standard)
---Purpose: Creates the intersection between a plane and a cone.
-- TolAng is the angular tolerance used to determine
-- if the axis of the cone is parallel or perpendicular
-- to the plane, and if the generating line of the cone
-- is parallel to the plane.
-- Tol is the tolerance used to determine if the apex
-- of the cone is in the plane.
returns QuadQuadGeo from IntAna;
Perform(me: in out;
P : Pln from gp;
C : Cone from gp;
Tolang,Tol: Real from Standard)
---Purpose: Intersects a plane and a cone.
-- TolAng is the angular tolerance used to determine
-- if the axis of the cone is parallel or perpendicular
-- to the plane, and if the generating line of the cone
-- is parallel to the plane.
-- Tol is the tolerance used to determine if the apex
-- of the cone is in the plane.
is static;
Create(Cyl1,Cyl2: Cylinder from gp;
Tol : Real from Standard)
---Purpose: Creates the intersection between two cylinders.
returns QuadQuadGeo from IntAna;
Perform(me : in out;
Cyl1,Cyl2: Cylinder from gp;
Tol : Real from Standard)
---Purpose: Intersects two cylinders
is static;
Create(Cyl: Cylinder from gp;
Sph: Sphere from gp;
Tol: Real from Standard)
---Purpose: Creates the intersection between a Cylinder and a Sphere.
returns QuadQuadGeo from IntAna;
Perform(me : in out;
Cyl: Cylinder from gp;
Sph: Sphere from gp;
Tol: Real from Standard)
---Purpose: Intersects a cylinder and a sphere.
is static;
Create(Cyl: Cylinder from gp;
Con: Cone from gp;
Tol: Real from Standard)
---Purpose: Creates the intersection between a Cylinder and a Cone
returns QuadQuadGeo from IntAna;
Perform(me : in out;
Cyl: Cylinder from gp;
Con: Cone from gp;
Tol: Real from Standard)
---Purpose: Intersects a cylinder and a cone.
is static;
Create(Sph1: Sphere from gp;
Sph2: Sphere from gp;
Tol : Real from Standard)
---Purpose: Creates the intersection between two Spheres.
returns QuadQuadGeo from IntAna;
Perform(me : in out;
Sph1: Sphere from gp;
Sph2: Sphere from gp;
Tol : Real from Standard)
---Purpose: Intersects a two spheres.
is static;
Create(Sph: Sphere from gp;
Con: Cone from gp;
Tol: Real from Standard)
---Purpose: Creates the intersection beween a Sphere and a Cone.
returns QuadQuadGeo from IntAna;
Perform(me : in out;
Sph: Sphere from gp;
Con: Cone from gp;
Tol: Real from Standard)
---Purpose: Intersects a sphere and a cone.
is static;
Create(Con1: Cone from gp;
Con2: Cone from gp;
Tol : Real from Standard)
---Purpose: Creates the intersection beween two cones.
returns QuadQuadGeo from IntAna;
Perform(me : in out;
Con1: Cone from gp;
Con2: Cone from gp;
Tol :Real from Standard)
---Purpose: Intersects two cones.
is static;
Create(Pln : Pln from gp;
Tor : Torus from gp;
Tol : Real from Standard)
---Purpose: Creates the intersection beween plane and torus.
returns QuadQuadGeo from IntAna;
Perform(me :in out;
Pln : Pln from gp;
Tor : Torus from gp;
Tol : Real from Standard)
---Purpose: Intersects plane and torus.
is static;
Create(Cyl : Cylinder from gp;
Tor : Torus from gp;
Tol : Real from Standard)
---Purpose: Creates the intersection beween cylinder and torus.
returns QuadQuadGeo from IntAna;
Perform(me : in out;
Cyl : Cylinder from gp;
Tor : Torus from gp;
Tol : Real from Standard)
---Purpose: Intersects cylinder and torus.
is static;
Create(Con : Cone from gp;
Tor : Torus from gp;
Tol : Real from Standard)
---Purpose: Creates the intersection beween cone and torus.
returns QuadQuadGeo from IntAna;
Perform(me : in out;
Con : Cone from gp;
Tor : Torus from gp;
Tol : Real from Standard)
---Purpose: Intersects cone and torus.
is static;
Create(Sph : Sphere from gp;
Tor : Torus from gp;
Tol : Real from Standard)
---Purpose: Creates the intersection beween sphere and torus.
returns QuadQuadGeo from IntAna;
Perform(me : in out;
Sph : Sphere from gp;
Tor : Torus from gp;
Tol : Real from Standard)
---Purpose: Intersects sphere and torus.
is static;
Create(Tor1 : Torus from gp;
Tor2 : Torus from gp;
Tol : Real from Standard)
---Purpose: Creates the intersection beween two toruses.
returns QuadQuadGeo from IntAna;
Perform(me : in out;
Tor1 : Torus from gp;
Tor2 : Torus from gp;
Tol : Real from Standard)
---Purpose: Intersects two toruses.
is static;
IsDone(me)
---Purpose: Returns Standard_True if the computation was successful.
--
---C++: inline
returns Boolean from Standard
is static;
TypeInter(me)
---Purpose: Returns the type of intersection.
--
---C++: inline
returns ResultType from IntAna
raises NotDone from StdFail
-- The exception NotDone is raised if IsDone return Standard_False.
is static;
NbSolutions(me)
---Purpose: Returns the number of interesections.
-- The possible intersections are :
-- - 1 point
-- - 1 or 2 line(s)
-- - 1 Point and 1 Line
-- - 1 circle
-- - 1 ellipse
-- - 1 parabola
-- - 1 or 2 hyperbola(s).
--
---C++: inline
returns Integer from Standard
raises NotDone from StdFail
-- The exception NotDone is raised if IsDone returns Standard_False.
is static;
Point(me; Num: Integer from Standard)
---Purpose: Returns the point solution of range Num.
returns Pnt from gp
raises DomainError from Standard,
OutOfRange from Standard,
NotDone from StdFail
-- The exception NotDone is raised if IsDone return Standard_False.
-- The exception DomainError is raised if TypeInter does not return
-- IntAna_Point or TypeInter does not return IntAna_PointAndCircle.
-- The exception OutOfRange is raised if Num < 1 or Num > NbSolutions.
is static;
Line(me; Num: Integer from Standard)
---Purpose: Returns the line solution of range Num.
returns Lin from gp
raises DomainError from Standard,
OutOfRange from Standard,
NotDone from StdFail
-- The exception NotDone is raised if IsDone return Standard_False.
-- The exception DomainError is raised if TypeInter does not return
-- IntAna_Line.
-- The exception OutOfRange is raised if Num < 1 or Num > NbSolutions.
is static;
Circle(me; Num: Integer from Standard)
---Purpose: Returns the circle solution of range Num.
returns Circ from gp
raises DomainError from Standard,
OutOfRange from Standard,
NotDone from StdFail
-- The exception NotDone is raised if IsDone return Standard_False.
-- The exception DomainError is raised if TypeInter does not return
-- IntAna_Circle or TypeInter does not return IntAna_PointAndCircle.
-- The exception OutOfRange is raised if Num < 1 or Num > NbSolutions.
is static;
Ellipse(me; Num: Integer from Standard)
---Purpose: Returns the ellipse solution of range Num.
returns Elips from gp
raises DomainError from Standard,
OutOfRange from Standard,
NotDone from StdFail
-- The exception NotDone is raised if IsDone return Standard_False.
-- The exception DomainError is raised if TypeInter does not return
-- IntAna_Ellipse.
-- The exception OutOfRange is raised if Num < 1 or Num > NbSolutions.
is static;
Parabola(me; Num: Integer from Standard)
---Purpose: Returns the parabola solution of range Num.
returns Parab from gp
raises DomainError from Standard,
OutOfRange from Standard,
NotDone from StdFail
-- The exception NotDone is raised if IsDone return Standard_False.
-- The exception DomainError is raised if TypeInter does not return
-- IntAna_Parabola.
-- The exception OutOfRange is raised if Num < 1 or Num > NbSolutions.
is static;
Hyperbola(me; Num: Integer from Standard)
---Purpose: Returns the hyperbola solution of range Num.
returns Hypr from gp
raises DomainError from Standard,
OutOfRange from Standard,
NotDone from StdFail
-- The exception NotDone is raised if IsDone return Standard_False.
-- The exception DomainError is raised if TypeInter does not return
-- IntAna_Hyperbola.
-- The exception OutOfRange is raised if Num < 1 or Num > NbSolutions.
is static;
HasCommonGen(me) returns Boolean from Standard;
PChar(me) returns Pnt from gp;
---C++: return const&
InitTolerances(me:out)
---Purpose: Initialize the values of inner tolerances.
is protected;
fields
done : Boolean from Standard is protected;
nbint : Integer from Standard is protected;
typeres : ResultType from IntAna is protected;
pt1 : Pnt from gp is protected;
pt2 : Pnt from gp is protected;
pt3 : Pnt from gp is protected;
pt4 : Pnt from gp is protected;
dir1 : Dir from gp is protected;
dir2 : Dir from gp is protected;
dir3 : Dir from gp is protected;
dir4 : Dir from gp is protected;
param1 : Real from Standard is protected;
param2 : Real from Standard is protected;
param3 : Real from Standard is protected;
param4 : Real from Standard is protected;
param1bis : Real from Standard is protected;
param2bis : Real from Standard is protected;
--
myEPSILON_DISTANCE : Real from Standard is protected;
myEPSILON_ANGLE_CONE : Real from Standard is protected;
myEPSILON_MINI_CIRCLE_RADIUS : Real from Standard is protected;
myEPSILON_CYLINDER_DELTA_RADIUS : Real from Standard is protected;
myEPSILON_CYLINDER_DELTA_DISTANCE: Real from Standard is protected;
myEPSILON_AXES_PARA : Real from Standard is protected;
--
myCommonGen : Boolean from Standard is protected;
myPChar : Pnt from gp is protected;
end QuadQuadGeo;

View File

@@ -24,26 +24,33 @@
#define No_Standard_OutOfRange
#endif
#include <IntAna_QuadQuadGeo.ixx>
#include <ElCLib.hxx>
#include <ElSLib.hxx>
#include <gp.hxx>
#include <gp_Circ.hxx>
#include <gp_Cone.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Dir.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Elips.hxx>
#include <gp_Hypr.hxx>
#include <gp_Lin.hxx>
#include <gp_Parab.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Sphere.hxx>
#include <gp_Torus.hxx>
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#include <gp_XYZ.hxx>
#include <IntAna_IntConicQuad.hxx>
#include <StdFail_NotDone.hxx>
#include <IntAna_QuadQuadGeo.hxx>
#include <math_DirectPolynomialRoots.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_OutOfRange.hxx>
#include <math_DirectPolynomialRoots.hxx>
#include <gp.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <ElSLib.hxx>
#include <ElCLib.hxx>
#include <gp_Dir.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Dir2d.hxx>
#include <StdFail_NotDone.hxx>
static
gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D);

View File

@@ -0,0 +1,288 @@
// Created on: 1992-08-06
// Created by: Laurent BUCHARD
// Copyright (c) 1992-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.
#ifndef _IntAna_QuadQuadGeo_HeaderFile
#define _IntAna_QuadQuadGeo_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <IntAna_ResultType.hxx>
#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <Standard_Real.hxx>
class StdFail_NotDone;
class Standard_DomainError;
class Standard_OutOfRange;
class gp_Pln;
class gp_Cylinder;
class gp_Sphere;
class gp_Cone;
class gp_Torus;
class gp_Pnt;
class gp_Lin;
class gp_Circ;
class gp_Elips;
class gp_Parab;
class gp_Hypr;
//! Geometric intersections between two natural quadrics
//! (Sphere , Cylinder , Cone , Pln from gp).
//! The possible intersections are :
//! - 1 point
//! - 1 or 2 line(s)
//! - 1 Point and 1 Line
//! - 1 circle
//! - 1 ellipse
//! - 1 parabola
//! - 1 or 2 hyperbola(s).
//! - Empty : there is no intersection between the two quadrics.
//! - Same : the quadrics are identical
//! - NoGeometricSolution : there may be an intersection, but it
//! is necessary to use an analytic algorithm to determine
//! it. See class IntQuadQuad from IntAna.
class IntAna_QuadQuadGeo
{
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor.
Standard_EXPORT IntAna_QuadQuadGeo();
//! Creates the intersection between two planes.
//! TolAng is the angular tolerance used to determine
//! if the planes are parallel.
//! Tol is the tolerance used to determine if the planes
//! are identical (only when they are parallel).
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Pln& P1, const gp_Pln& P2, const Standard_Real TolAng, const Standard_Real Tol);
//! Intersects two planes.
//! TolAng is the angular tolerance used to determine
//! if the planes are parallel.
//! Tol is the tolerance used to determine if the planes
//! are identical (only when they are parallel).
Standard_EXPORT void Perform (const gp_Pln& P1, const gp_Pln& P2, const Standard_Real TolAng, const Standard_Real Tol);
//! Creates the intersection between a plane and a cylinder.
//! TolAng is the angular tolerance used to determine
//! if the axis of the cylinder is parallel to the plane.
//! Tol is the tolerance used to determine if the result
//! is a circle or an ellipse. If the maximum distance between
//! the ellipse solution and the circle centered at the ellipse
//! center is less than Tol, the result will be the circle.
//! H is the height of the cylinder <Cyl>. It is used to check
//! whether the plane and cylinder are parallel.
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Pln& P, const gp_Cylinder& C, const Standard_Real Tolang, const Standard_Real Tol, const Standard_Real H = 0);
//! Intersects a plane and a cylinder.
//! TolAng is the angular tolerance used to determine
//! if the axis of the cylinder is parallel to the plane.
//! Tol is the tolerance used to determine if the result
//! is a circle or an ellipse. If the maximum distance between
//! the ellipse solution and the circle centered at the ellipse
//! center is less than Tol, the result will be the circle.
//! H is the height of the cylinder <Cyl>. It is used to check
//! whether the plane and cylinder are parallel.
Standard_EXPORT void Perform (const gp_Pln& P, const gp_Cylinder& C, const Standard_Real Tolang, const Standard_Real Tol, const Standard_Real H = 0);
//! Creates the intersection between a plane and a sphere.
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Pln& P, const gp_Sphere& S);
//! Intersects a plane and a sphere.
Standard_EXPORT void Perform (const gp_Pln& P, const gp_Sphere& S);
//! Creates the intersection between a plane and a cone.
//! TolAng is the angular tolerance used to determine
//! if the axis of the cone is parallel or perpendicular
//! to the plane, and if the generating line of the cone
//! is parallel to the plane.
//! Tol is the tolerance used to determine if the apex
//! of the cone is in the plane.
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Pln& P, const gp_Cone& C, const Standard_Real Tolang, const Standard_Real Tol);
//! Intersects a plane and a cone.
//! TolAng is the angular tolerance used to determine
//! if the axis of the cone is parallel or perpendicular
//! to the plane, and if the generating line of the cone
//! is parallel to the plane.
//! Tol is the tolerance used to determine if the apex
//! of the cone is in the plane.
Standard_EXPORT void Perform (const gp_Pln& P, const gp_Cone& C, const Standard_Real Tolang, const Standard_Real Tol);
//! Creates the intersection between two cylinders.
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Cylinder& Cyl1, const gp_Cylinder& Cyl2, const Standard_Real Tol);
//! Intersects two cylinders
Standard_EXPORT void Perform (const gp_Cylinder& Cyl1, const gp_Cylinder& Cyl2, const Standard_Real Tol);
//! Creates the intersection between a Cylinder and a Sphere.
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Cylinder& Cyl, const gp_Sphere& Sph, const Standard_Real Tol);
//! Intersects a cylinder and a sphere.
Standard_EXPORT void Perform (const gp_Cylinder& Cyl, const gp_Sphere& Sph, const Standard_Real Tol);
//! Creates the intersection between a Cylinder and a Cone
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Cylinder& Cyl, const gp_Cone& Con, const Standard_Real Tol);
//! Intersects a cylinder and a cone.
Standard_EXPORT void Perform (const gp_Cylinder& Cyl, const gp_Cone& Con, const Standard_Real Tol);
//! Creates the intersection between two Spheres.
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Sphere& Sph1, const gp_Sphere& Sph2, const Standard_Real Tol);
//! Intersects a two spheres.
Standard_EXPORT void Perform (const gp_Sphere& Sph1, const gp_Sphere& Sph2, const Standard_Real Tol);
//! Creates the intersection beween a Sphere and a Cone.
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Sphere& Sph, const gp_Cone& Con, const Standard_Real Tol);
//! Intersects a sphere and a cone.
Standard_EXPORT void Perform (const gp_Sphere& Sph, const gp_Cone& Con, const Standard_Real Tol);
//! Creates the intersection beween two cones.
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Cone& Con1, const gp_Cone& Con2, const Standard_Real Tol);
//! Intersects two cones.
Standard_EXPORT void Perform (const gp_Cone& Con1, const gp_Cone& Con2, const Standard_Real Tol);
//! Creates the intersection beween plane and torus.
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Pln& Pln, const gp_Torus& Tor, const Standard_Real Tol);
//! Intersects plane and torus.
Standard_EXPORT void Perform (const gp_Pln& Pln, const gp_Torus& Tor, const Standard_Real Tol);
//! Creates the intersection beween cylinder and torus.
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Cylinder& Cyl, const gp_Torus& Tor, const Standard_Real Tol);
//! Intersects cylinder and torus.
Standard_EXPORT void Perform (const gp_Cylinder& Cyl, const gp_Torus& Tor, const Standard_Real Tol);
//! Creates the intersection beween cone and torus.
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Cone& Con, const gp_Torus& Tor, const Standard_Real Tol);
//! Intersects cone and torus.
Standard_EXPORT void Perform (const gp_Cone& Con, const gp_Torus& Tor, const Standard_Real Tol);
//! Creates the intersection beween sphere and torus.
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Sphere& Sph, const gp_Torus& Tor, const Standard_Real Tol);
//! Intersects sphere and torus.
Standard_EXPORT void Perform (const gp_Sphere& Sph, const gp_Torus& Tor, const Standard_Real Tol);
//! Creates the intersection beween two toruses.
Standard_EXPORT IntAna_QuadQuadGeo(const gp_Torus& Tor1, const gp_Torus& Tor2, const Standard_Real Tol);
//! Intersects two toruses.
Standard_EXPORT void Perform (const gp_Torus& Tor1, const gp_Torus& Tor2, const Standard_Real Tol);
//! Returns Standard_True if the computation was successful.
Standard_Boolean IsDone() const;
//! Returns the type of intersection.
IntAna_ResultType TypeInter() const;
//! Returns the number of interesections.
//! The possible intersections are :
//! - 1 point
//! - 1 or 2 line(s)
//! - 1 Point and 1 Line
//! - 1 circle
//! - 1 ellipse
//! - 1 parabola
//! - 1 or 2 hyperbola(s).
Standard_Integer NbSolutions() const;
//! Returns the point solution of range Num.
Standard_EXPORT gp_Pnt Point (const Standard_Integer Num) const;
//! Returns the line solution of range Num.
Standard_EXPORT gp_Lin Line (const Standard_Integer Num) const;
//! Returns the circle solution of range Num.
Standard_EXPORT gp_Circ Circle (const Standard_Integer Num) const;
//! Returns the ellipse solution of range Num.
Standard_EXPORT gp_Elips Ellipse (const Standard_Integer Num) const;
//! Returns the parabola solution of range Num.
Standard_EXPORT gp_Parab Parabola (const Standard_Integer Num) const;
//! Returns the hyperbola solution of range Num.
Standard_EXPORT gp_Hypr Hyperbola (const Standard_Integer Num) const;
Standard_EXPORT Standard_Boolean HasCommonGen() const;
Standard_EXPORT const gp_Pnt& PChar() const;
protected:
//! Initialize the values of inner tolerances.
Standard_EXPORT void InitTolerances();
Standard_Boolean done;
Standard_Integer nbint;
IntAna_ResultType typeres;
gp_Pnt pt1;
gp_Pnt pt2;
gp_Pnt pt3;
gp_Pnt pt4;
gp_Dir dir1;
gp_Dir dir2;
gp_Dir dir3;
gp_Dir dir4;
Standard_Real param1;
Standard_Real param2;
Standard_Real param3;
Standard_Real param4;
Standard_Real param1bis;
Standard_Real param2bis;
Standard_Real myEPSILON_DISTANCE;
Standard_Real myEPSILON_ANGLE_CONE;
Standard_Real myEPSILON_MINI_CIRCLE_RADIUS;
Standard_Real myEPSILON_CYLINDER_DELTA_RADIUS;
Standard_Real myEPSILON_CYLINDER_DELTA_DISTANCE;
Standard_Real myEPSILON_AXES_PARA;
Standard_Boolean myCommonGen;
gp_Pnt myPChar;
private:
};
#include <IntAna_QuadQuadGeo.lxx>
#endif // _IntAna_QuadQuadGeo_HeaderFile

View File

@@ -1,133 +0,0 @@
-- Created on: 1992-07-01
-- Created by: Laurent BUCHARD
-- Copyright (c) 1992-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.
class Quadric from IntAna
---Purpose: This class provides a description of Quadrics by their
-- Coefficients in natural coordinate system.
uses Ax3 from gp,
Cylinder from gp,
Cone from gp,
Sphere from gp,
Pln from gp
is
Create
---Purpose: Empty Constructor
returns Quadric from IntAna;
Create(P : Pln from gp)
---Purpose: Creates a Quadric from a Pln
returns Quadric from IntAna;
Create(Sph: Sphere from gp)
---Purpose: Creates a Quadric from a Sphere
returns Quadric from IntAna;
Create(Cyl: Cylinder from gp)
---Purpose: Creates a Quadric from a Cylinder
returns Quadric from IntAna;
Create(Cone: Cone from gp)
---Purpose: Creates a Quadric from a Cone
returns Quadric from IntAna;
SetQuadric(me: in out; P: Pln from gp)
---Purpose: Initializes the quadric with a Pln
is static;
SetQuadric(me: in out; Sph: Sphere from gp)
---Purpose: Initialize the quadric with a Sphere
is static;
SetQuadric(me: in out; Con: Cone from gp)
---Purpose: Initializes the quadric with a Cone
is static;
SetQuadric(me: in out; Cyl: Cylinder from gp)
---Purpose: Initializes the quadric with a Cylinder
is static;
Coefficients(me; xCXX,xCYY,xCZZ,xCXY
,xCXZ,xCYZ,xCX,xCY,xCZ,xCCte: out Real from Standard)
---Purpose: Returns the coefficients of the polynomial equation
-- which define the quadric:
-- xCXX x**2 + xCYY y**2 + xCZZ z**2
-- + 2 ( xCXY x y + xCXZ x z + xCYZ y z )
-- + 2 ( xCX x + xCY y + xCZ z )
-- + xCCte
is static;
NewCoefficients(me; xCXX,xCYY,xCZZ,xCXY,xCXZ
,xCYZ,xCX,xCY,xCZ,xCCte: in out Real from Standard;
Axis: Ax3 from gp)
---Purpose: Returns the coefficients of the polynomial equation
-- ( written in the natural coordinates system )
-- in the local coordinates system defined by Axis
is static;
fields
CXX : Real from Standard;
CYY : Real from Standard;
CZZ : Real from Standard;
CXY : Real from Standard;
CXZ : Real from Standard;
CYZ : Real from Standard;
CX : Real from Standard;
CY : Real from Standard;
CZ : Real from Standard;
CCte : Real from Standard;
end Quadric;

View File

@@ -19,9 +19,15 @@
#define No_Standard_OutOfRange
#endif
#include <IntAna_Quadric.ixx>
#include <gp_Ax3.hxx>
#include <gp_Cone.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Pln.hxx>
#include <gp_Sphere.hxx>
#include <gp_Trsf.hxx>
#include <gp_Vec.hxx>
#include <IntAna_Quadric.hxx>
//----------------------------------------------------------------------
//--
@@ -37,11 +43,6 @@
//--
//--
//----------------------------------------------------------------------
//----------------------------------------------------------------------
//-- Quadric Vide
//----------------------------------------------------------------------

View File

@@ -0,0 +1,114 @@
// Created on: 1992-07-01
// Created by: Laurent BUCHARD
// Copyright (c) 1992-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.
#ifndef _IntAna_Quadric_HeaderFile
#define _IntAna_Quadric_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
class gp_Pln;
class gp_Sphere;
class gp_Cylinder;
class gp_Cone;
class gp_Ax3;
//! This class provides a description of Quadrics by their
//! Coefficients in natural coordinate system.
class IntAna_Quadric
{
public:
DEFINE_STANDARD_ALLOC
//! Empty Constructor
Standard_EXPORT IntAna_Quadric();
//! Creates a Quadric from a Pln
Standard_EXPORT IntAna_Quadric(const gp_Pln& P);
//! Creates a Quadric from a Sphere
Standard_EXPORT IntAna_Quadric(const gp_Sphere& Sph);
//! Creates a Quadric from a Cylinder
Standard_EXPORT IntAna_Quadric(const gp_Cylinder& Cyl);
//! Creates a Quadric from a Cone
Standard_EXPORT IntAna_Quadric(const gp_Cone& Cone);
//! Initializes the quadric with a Pln
Standard_EXPORT void SetQuadric (const gp_Pln& P);
//! Initialize the quadric with a Sphere
Standard_EXPORT void SetQuadric (const gp_Sphere& Sph);
//! Initializes the quadric with a Cone
Standard_EXPORT void SetQuadric (const gp_Cone& Con);
//! Initializes the quadric with a Cylinder
Standard_EXPORT void SetQuadric (const gp_Cylinder& Cyl);
//! Returns the coefficients of the polynomial equation
//! which define the quadric:
//! xCXX x**2 + xCYY y**2 + xCZZ z**2
//! + 2 ( xCXY x y + xCXZ x z + xCYZ y z )
//! + 2 ( xCX x + xCY y + xCZ z )
//! + xCCte
Standard_EXPORT void Coefficients (Standard_Real& xCXX, Standard_Real& xCYY, Standard_Real& xCZZ, Standard_Real& xCXY, Standard_Real& xCXZ, Standard_Real& xCYZ, Standard_Real& xCX, Standard_Real& xCY, Standard_Real& xCZ, Standard_Real& xCCte) const;
//! Returns the coefficients of the polynomial equation
//! ( written in the natural coordinates system )
//! in the local coordinates system defined by Axis
Standard_EXPORT void NewCoefficients (Standard_Real& xCXX, Standard_Real& xCYY, Standard_Real& xCZZ, Standard_Real& xCXY, Standard_Real& xCXZ, Standard_Real& xCYZ, Standard_Real& xCX, Standard_Real& xCY, Standard_Real& xCZ, Standard_Real& xCCte, const gp_Ax3& Axis) const;
protected:
private:
Standard_Real CXX;
Standard_Real CYY;
Standard_Real CZZ;
Standard_Real CXY;
Standard_Real CXZ;
Standard_Real CYZ;
Standard_Real CX;
Standard_Real CY;
Standard_Real CZ;
Standard_Real CCte;
};
#endif // _IntAna_Quadric_HeaderFile

View File

@@ -0,0 +1,35 @@
// Created on: 1992-06-30
// Created by: Laurent BUCHARD
// Copyright (c) 1992-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.
#ifndef _IntAna_ResultType_HeaderFile
#define _IntAna_ResultType_HeaderFile
enum IntAna_ResultType
{
IntAna_Point,
IntAna_Line,
IntAna_Circle,
IntAna_PointAndCircle,
IntAna_Ellipse,
IntAna_Parabola,
IntAna_Hyperbola,
IntAna_Empty,
IntAna_Same,
IntAna_NoGeometricSolution
};
#endif // _IntAna_ResultType_HeaderFile