0030520: VIS - IVtkTools_ShapePicker::GetPickPosition() returns incorrect point
[occt.git] / src / HLRBRep / HLRBRep_Intersector.hxx
1 // Created on: 1992-08-26
2 // Created by: Christophe MARION
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _HLRBRep_Intersector_HeaderFile
18 #define _HLRBRep_Intersector_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <IntRes2d_IntersectionPoint.hxx>
25 #include <Standard_Integer.hxx>
26 #include <HLRBRep_CInter.hxx>
27 #include <HLRBRep_InterCSurf.hxx>
28 #include <Standard_Address.hxx>
29 #include <Standard_Real.hxx>
30 #include <Standard_Boolean.hxx>
31 class StdFail_UndefinedDerivative;
32 class gp_Lin;
33 class IntRes2d_IntersectionPoint;
34 class IntCurveSurface_IntersectionPoint;
35 class IntRes2d_IntersectionSegment;
36 class IntCurveSurface_IntersectionSegment;
37
38
39 //! The Intersector  computes 2D  intersections of the
40 //! projections of 3D curves.
41 //!
42 //! It can also computes the intersection of a 3D line
43 //! and a surface.
44 class HLRBRep_Intersector 
45 {
46 public:
47
48   DEFINE_STANDARD_ALLOC
49
50   
51   Standard_EXPORT HLRBRep_Intersector();
52   
53   //! Performs the auto  intersection  of  an edge. The
54   //! edge domain is cutted at start with da1*(b-a) and
55   //! at end with db1*(b-a).
56   Standard_EXPORT void Perform (const Standard_Address A1, const Standard_Real da1, const Standard_Real db1);
57   
58   //! Performs the  intersection between the two edges.
59   //! The  edges  domains  are  cutted  at  start  with
60   //! da*(b-a) and at end with db*(b-a).
61   Standard_EXPORT void Perform (const Standard_Integer nA, const Standard_Address A1, const Standard_Real da1, const Standard_Real db1, const Standard_Integer nB, const Standard_Address A2, const Standard_Real da2, const Standard_Real db2, const Standard_Boolean NoBound);
62   
63   //! Create a single IntersectionPoint (U on A1) (V on A2)
64   //! The point is middle on both curves.
65   Standard_EXPORT void SimulateOnePoint (const Standard_Address A1, const Standard_Real U, const Standard_Address A2, const Standard_Real V);
66   
67   Standard_EXPORT void Load (Standard_Address& A);
68   
69   Standard_EXPORT void Perform (const gp_Lin& L, const Standard_Real P);
70   
71   Standard_EXPORT Standard_Boolean IsDone() const;
72   
73   Standard_EXPORT Standard_Integer NbPoints() const;
74   
75   Standard_EXPORT const IntRes2d_IntersectionPoint& Point (const Standard_Integer N) const;
76   
77   Standard_EXPORT const IntCurveSurface_IntersectionPoint& CSPoint (const Standard_Integer N) const;
78   
79   Standard_EXPORT Standard_Integer NbSegments() const;
80   
81   Standard_EXPORT const IntRes2d_IntersectionSegment& Segment (const Standard_Integer N) const;
82   
83   Standard_EXPORT const IntCurveSurface_IntersectionSegment& CSSegment (const Standard_Integer N) const;
84   
85   Standard_EXPORT void Destroy();
86 ~HLRBRep_Intersector()
87 {
88   Destroy();
89 }
90
91
92
93
94 protected:
95
96
97
98
99
100 private:
101
102
103
104   IntRes2d_IntersectionPoint mySinglePoint;
105   Standard_Integer myTypePerform;
106   HLRBRep_CInter myIntersector;
107   HLRBRep_InterCSurf myCSIntersector;
108   Standard_Address mySurface;
109   HLRBRep_ThePolyhedronOfInterCSurf* myPolyhedron;
110
111
112 };
113
114
115
116
117
118
119
120 #endif // _HLRBRep_Intersector_HeaderFile