1 // Created on: 1995-07-02
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Contap_HContTool_HeaderFile
18 #define _Contap_HContTool_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Integer.hxx>
25 #include <Standard_Real.hxx>
26 #include <Standard_Boolean.hxx>
27 class Adaptor3d_HSurface;
28 class Adaptor2d_HCurve2d;
30 class Adaptor3d_HVertex;
34 //! Tool for the intersection between 2 surfaces.
35 //! Regroupe pour l instant les methodes hors Adaptor3d...
36 class Contap_HContTool
43 Standard_EXPORT static Standard_Integer NbSamplesU (const Handle(Adaptor3d_HSurface)& S, const Standard_Real u1, const Standard_Real u2);
45 Standard_EXPORT static Standard_Integer NbSamplesV (const Handle(Adaptor3d_HSurface)& S, const Standard_Real v1, const Standard_Real v2);
47 Standard_EXPORT static Standard_Integer NbSamplePoints (const Handle(Adaptor3d_HSurface)& S);
49 Standard_EXPORT static void SamplePoint (const Handle(Adaptor3d_HSurface)& S, const Standard_Integer Index, Standard_Real& U, Standard_Real& V);
51 //! Returns True if all the intersection point and edges
52 //! are known on the Arc.
53 //! The intersection point are given as vertices.
54 //! The intersection edges are given as intervals between
56 Standard_EXPORT static Standard_Boolean HasBeenSeen (const Handle(Adaptor2d_HCurve2d)& C);
58 //! returns the number of points which is used to make
59 //! a sample on the arc. this number is a function of
60 //! the Surface and the CurveOnSurface complexity.
61 Standard_EXPORT static Standard_Integer NbSamplesOnArc (const Handle(Adaptor2d_HCurve2d)& A);
63 //! Returns the parametric limits on the arc C.
64 //! These limits must be finite : they are either
65 //! the real limits of the arc, for a finite arc,
66 //! or a bounding box for an infinite arc.
67 Standard_EXPORT static void Bounds (const Handle(Adaptor2d_HCurve2d)& C, Standard_Real& Ufirst, Standard_Real& Ulast);
69 //! Projects the point P on the arc C.
70 //! If the methods returns Standard_True, the projection is
71 //! successful, and Paramproj is the parameter on the arc
72 //! of the projected point, Ptproj is the projected Point.
73 //! If the method returns Standard_False, Param proj and Ptproj
74 //! are not significant.
75 Standard_EXPORT static Standard_Boolean Project (const Handle(Adaptor2d_HCurve2d)& C, const gp_Pnt2d& P, Standard_Real& Paramproj, gp_Pnt2d& Ptproj);
77 //! Returns the parametric tolerance used to consider
78 //! that the vertex and another point meet, i-e
79 //! if Abs(parameter(Vertex) - parameter(OtherPnt))<=
80 //! Tolerance, the points are "merged".
81 Standard_EXPORT static Standard_Real Tolerance (const Handle(Adaptor3d_HVertex)& V, const Handle(Adaptor2d_HCurve2d)& C);
83 //! Returns the parameter of the vertex V on the arc A.
84 Standard_EXPORT static Standard_Real Parameter (const Handle(Adaptor3d_HVertex)& V, const Handle(Adaptor2d_HCurve2d)& C);
86 //! Returns the number of intersection points on the arc A.
87 Standard_EXPORT static Standard_Integer NbPoints (const Handle(Adaptor2d_HCurve2d)& C);
89 //! Returns the value (Pt), the tolerance (Tol), and
90 //! the parameter (U) on the arc A , of the intersection
91 //! point of range Index.
92 Standard_EXPORT static void Value (const Handle(Adaptor2d_HCurve2d)& C, const Standard_Integer Index, gp_Pnt& Pt, Standard_Real& Tol, Standard_Real& U);
94 //! Returns True if the intersection point of range Index
95 //! corresponds with a vertex on the arc A.
96 Standard_EXPORT static Standard_Boolean IsVertex (const Handle(Adaptor2d_HCurve2d)& C, const Standard_Integer Index);
98 //! When IsVertex returns True, this method returns the
99 //! vertex on the arc A.
100 Standard_EXPORT static void Vertex (const Handle(Adaptor2d_HCurve2d)& C, const Standard_Integer Index, Handle(Adaptor3d_HVertex)& V);
102 //! returns the number of part of A solution of the
103 //! of intersection problem.
104 Standard_EXPORT static Standard_Integer NbSegments (const Handle(Adaptor2d_HCurve2d)& C);
106 //! Returns True when the segment of range Index is not
107 //! open at the left side. In that case, IndFirst is the
108 //! range in the list intersection points (see NbPoints)
109 //! of the one which defines the left bound of the segment.
110 //! Otherwise, the method has to return False, and IndFirst
112 Standard_EXPORT static Standard_Boolean HasFirstPoint (const Handle(Adaptor2d_HCurve2d)& C, const Standard_Integer Index, Standard_Integer& IndFirst);
114 //! Returns True when the segment of range Index is not
115 //! open at the right side. In that case, IndLast is the
116 //! range in the list intersection points (see NbPoints)
117 //! of the one which defines the right bound of the segment.
118 //! Otherwise, the method has to return False, and IndLast
120 Standard_EXPORT static Standard_Boolean HasLastPoint (const Handle(Adaptor2d_HCurve2d)& C, const Standard_Integer Index, Standard_Integer& IndLast);
122 //! Returns True when the whole restriction is solution
123 //! of the intersection problem.
124 Standard_EXPORT static Standard_Boolean IsAllSolution (const Handle(Adaptor2d_HCurve2d)& C);
149 #endif // _Contap_HContTool_HeaderFile