0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / Contap / Contap_Point.hxx
1 // Created on: 1993-03-04
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1993-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 _Contap_Point_HeaderFile
18 #define _Contap_Point_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <gp_Pnt.hxx>
25 #include <Standard_Real.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <IntSurf_Transition.hxx>
28 class Adaptor2d_HCurve2d;
29 class Adaptor3d_HVertex;
30 class Standard_DomainError;
31 class gp_Pnt;
32 class IntSurf_Transition;
33
34
35 //! Definition of a vertex on the contour line.
36 //! Most of the time, such a point is an intersection
37 //! between the contour and a restriction of the surface.
38 //! When it is not tyhe method IsOnArc return False.
39 //! Such a point is contains geometrical informations (see
40 //! the Value method) and logical informations.
41 class Contap_Point 
42 {
43 public:
44
45   DEFINE_STANDARD_ALLOC
46
47   
48   //! Empty constructor.
49   Standard_EXPORT Contap_Point();
50   
51   //! Creates a point.
52   Standard_EXPORT Contap_Point(const gp_Pnt& Pt, const Standard_Real U, const Standard_Real V);
53   
54   //! Sets the values for a point.
55     void SetValue (const gp_Pnt& Pt, const Standard_Real U, const Standard_Real V);
56   
57   //! Set the value of the parameter on the intersection line.
58     void SetParameter (const Standard_Real Para);
59   
60   //! Sets the values of a point which is a vertex on
61   //! the initial facet of restriction of one
62   //! of the surface.
63     void SetVertex (const Handle(Adaptor3d_HVertex)& V);
64   
65   //! Sets the value of the arc and of the parameter on
66   //! this arc of the point.
67     void SetArc (const Handle(Adaptor2d_HCurve2d)& A, const Standard_Real Param, const IntSurf_Transition& TLine, const IntSurf_Transition& TArc);
68   
69     void SetMultiple();
70   
71     void SetInternal();
72   
73   //! Returns the intersection point (geometric information).
74     const gp_Pnt& Value() const;
75   
76   //! This method returns the parameter of the point
77   //! on the intersection line.
78   //! If the points does not belong to an intersection line,
79   //! the value returned does not have any sens.
80     Standard_Real ParameterOnLine() const;
81   
82   //! Returns the parameters on the surface of the point.
83     void Parameters (Standard_Real& U1, Standard_Real& V1) const;
84   
85   //! Returns True when the point is an intersection between
86   //! the contour and a restriction.
87     Standard_Boolean IsOnArc() const;
88   
89   //! Returns the arc of restriction containing the
90   //! vertex.
91     const Handle(Adaptor2d_HCurve2d)& Arc() const;
92   
93   //! Returns the parameter of the point on the
94   //! arc returned by the method Arc().
95     Standard_Real ParameterOnArc() const;
96   
97   //! Returns the transition of the point on the contour.
98     const IntSurf_Transition& TransitionOnLine() const;
99   
100   //! Returns the transition of the point on the arc.
101     const IntSurf_Transition& TransitionOnArc() const;
102   
103   //! Returns TRUE if the point is a vertex on the initial
104   //! restriction facet of the surface.
105     Standard_Boolean IsVertex() const;
106   
107   //! Returns the information about the point when it is
108   //! on the domain of the patch, i-e when the function
109   //! IsVertex returns True.
110   //! Otherwise, an exception is raised.
111     const Handle(Adaptor3d_HVertex)& Vertex() const;
112   
113   //! Returns True if the point belongs to several
114   //! lines.
115     Standard_Boolean IsMultiple() const;
116   
117   //! Returns True if the point  is an internal one, i.e
118   //! if the  tangent to the line on  the point  and the
119   //! eye direction are parallel.
120     Standard_Boolean IsInternal() const;
121
122
123
124
125 protected:
126
127
128
129
130
131 private:
132
133
134
135   gp_Pnt pt;
136   Standard_Real uparam;
137   Standard_Real vparam;
138   Standard_Real paraline;
139   Standard_Boolean onarc;
140   Handle(Adaptor2d_HCurve2d) arc;
141   IntSurf_Transition traline;
142   IntSurf_Transition traarc;
143   Standard_Real prmarc;
144   Standard_Boolean isvtx;
145   Handle(Adaptor3d_HVertex) vtx;
146   Standard_Boolean ismult;
147   Standard_Boolean myInternal;
148
149
150 };
151
152
153 #include <Contap_Point.lxx>
154
155
156
157
158
159 #endif // _Contap_Point_HeaderFile