0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / HLRBRep / HLRBRep_ThePolygonOfInterCSurf.hxx
1 // Created on: 1992-10-14
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_ThePolygonOfInterCSurf_HeaderFile
18 #define _HLRBRep_ThePolygonOfInterCSurf_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Bnd_Box.hxx>
25 #include <Standard_Real.hxx>
26 #include <Standard_Integer.hxx>
27 #include <TColgp_Array1OfPnt.hxx>
28 #include <Standard_Boolean.hxx>
29 #include <TColStd_HArray1OfReal.hxx>
30 #include <TColStd_Array1OfReal.hxx>
31 class Standard_OutOfRange;
32 class gp_Lin;
33 class HLRBRep_LineTool;
34 class Bnd_Box;
35 class gp_Pnt;
36
37
38
39 class HLRBRep_ThePolygonOfInterCSurf 
40 {
41 public:
42
43   DEFINE_STANDARD_ALLOC
44
45   
46   Standard_EXPORT HLRBRep_ThePolygonOfInterCSurf(const gp_Lin& Curve, const Standard_Integer NbPnt);
47   
48   Standard_EXPORT HLRBRep_ThePolygonOfInterCSurf(const gp_Lin& Curve, const Standard_Real U1, const Standard_Real U2, const Standard_Integer NbPnt);
49   
50   Standard_EXPORT HLRBRep_ThePolygonOfInterCSurf(const gp_Lin& Curve, const TColStd_Array1OfReal& Upars);
51   
52   //! Give the bounding box of the polygon.
53     const Bnd_Box& Bounding() const;
54   
55     Standard_Real DeflectionOverEstimation() const;
56   
57     void SetDeflectionOverEstimation (const Standard_Real x);
58   
59     void Closed (const Standard_Boolean clos);
60   
61     Standard_Boolean Closed() const;
62   
63   //! Give the number of Segments in the polyline.
64     Standard_Integer NbSegments() const;
65   
66   //! Give the point of range Index in the Polygon.
67     const gp_Pnt& BeginOfSeg (const Standard_Integer Index) const;
68   
69   //! Give the point of range Index in the Polygon.
70     const gp_Pnt& EndOfSeg (const Standard_Integer Index) const;
71   
72   //! Returns the parameter (On the curve)
73   //! of the first point of the Polygon
74     Standard_Real InfParameter() const;
75   
76   //! Returns the parameter (On the curve)
77   //! of the last point of the Polygon
78     Standard_Real SupParameter() const;
79   
80   //! Give an approximation of the parameter on the curve
81   //! according to the discretization of the Curve.
82   Standard_EXPORT Standard_Real ApproxParamOnCurve (const Standard_Integer Index, const Standard_Real ParamOnLine) const;
83   
84   Standard_EXPORT void Dump() const;
85
86
87
88
89 protected:
90
91   
92   Standard_EXPORT void Init (const gp_Lin& Curve);
93   
94   Standard_EXPORT void Init (const gp_Lin& Curve, const TColStd_Array1OfReal& Upars);
95
96
97
98
99 private:
100
101
102
103   Bnd_Box TheBnd;
104   Standard_Real TheDeflection;
105   Standard_Integer NbPntIn;
106   TColgp_Array1OfPnt ThePnts;
107   Standard_Boolean ClosedPolygon;
108   Standard_Real Binf;
109   Standard_Real Bsup;
110   Handle(TColStd_HArray1OfReal) myParams;
111
112
113 };
114
115 #define TheCurve gp_Lin
116 #define TheCurve_hxx <gp_Lin.hxx>
117 #define TheCurveTool HLRBRep_LineTool
118 #define TheCurveTool_hxx <HLRBRep_LineTool.hxx>
119 #define IntCurveSurface_Polygon HLRBRep_ThePolygonOfInterCSurf
120 #define IntCurveSurface_Polygon_hxx <HLRBRep_ThePolygonOfInterCSurf.hxx>
121
122 #include <IntCurveSurface_Polygon.lxx>
123
124 #undef TheCurve
125 #undef TheCurve_hxx
126 #undef TheCurveTool
127 #undef TheCurveTool_hxx
128 #undef IntCurveSurface_Polygon
129 #undef IntCurveSurface_Polygon_hxx
130
131
132
133
134 #endif // _HLRBRep_ThePolygonOfInterCSurf_HeaderFile