0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / HLRBRep / HLRBRep_CLProps.hxx
CommitLineData
42cf5bc1 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_CLProps_HeaderFile
18#define _HLRBRep_CLProps_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
42cf5bc1 24#include <Standard_Real.hxx>
25#include <Standard_Integer.hxx>
26#include <gp_Pnt2d.hxx>
27#include <gp_Vec2d.hxx>
28#include <gp_Dir2d.hxx>
29#include <LProp_Status.hxx>
30#include <Standard_Boolean.hxx>
31class LProp_BadContinuity;
32class Standard_DomainError;
33class Standard_OutOfRange;
34class LProp_NotDefined;
35class gp_Vec2d;
36class gp_Pnt2d;
37class gp_Dir2d;
38class HLRBRep_CLPropsATool;
681f3919 39class HLRBRep_Curve;
42cf5bc1 40
41
42
43class HLRBRep_CLProps
44{
45public:
46
47 DEFINE_STANDARD_ALLOC
48
49
36b9ff75 50 //! Initializes the local properties of the curve <C>
51 //! The current point and the derivatives are
52 //! computed at the same time, which allows an
53 //! optimization of the computation time.
54 //! <N> indicates the maximum number of derivations to
55 //! be done (0, 1, 2 or 3). For example, to compute
56 //! only the tangent, N should be equal to 1.
57 //! <Resolution> is the linear tolerance (it is used to test
58 //! if a vector is null).
681f3919 59 Standard_EXPORT HLRBRep_CLProps(const HLRBRep_Curve*& C, const Standard_Integer N, const Standard_Real Resolution);
42cf5bc1 60
36b9ff75 61 //! Same as previous constructor but here the parameter is
62 //! set to the value <U>.
63 //! All the computations done will be related to <C> and <U>.
681f3919 64 Standard_EXPORT HLRBRep_CLProps(const HLRBRep_Curve*& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution);
42cf5bc1 65
36b9ff75 66 //! Same as previous constructor but here the parameter is
67 //! set to the value <U> and the curve is set
68 //! with SetCurve.
69 //! the curve can have a empty constructor
70 //! All the computations done will be related to <C> and <U>
71 //! when the functions "set" will be done.
42cf5bc1 72 Standard_EXPORT HLRBRep_CLProps(const Standard_Integer N, const Standard_Real Resolution);
73
36b9ff75 74 //! Initializes the local properties of the curve
75 //! for the parameter value <U>.
42cf5bc1 76 Standard_EXPORT void SetParameter (const Standard_Real U);
77
36b9ff75 78 //! Initializes the local properties of the curve
79 //! for the new curve.
681f3919 80 Standard_EXPORT void SetCurve (const HLRBRep_Curve*& C);
42cf5bc1 81
36b9ff75 82 //! Returns the Point.
42cf5bc1 83 Standard_EXPORT const gp_Pnt2d& Value() const;
84
36b9ff75 85 //! Returns the first derivative.
86 //! The derivative is computed if it has not been yet.
42cf5bc1 87 Standard_EXPORT const gp_Vec2d& D1();
88
36b9ff75 89 //! Returns the second derivative.
90 //! The derivative is computed if it has not been yet.
42cf5bc1 91 Standard_EXPORT const gp_Vec2d& D2();
92
36b9ff75 93 //! Returns the third derivative.
94 //! The derivative is computed if it has not been yet.
42cf5bc1 95 Standard_EXPORT const gp_Vec2d& D3();
96
36b9ff75 97 //! Returns True if the tangent is defined.
98 //! For example, the tangent is not defined if the
99 //! three first derivatives are all null.
42cf5bc1 100 Standard_EXPORT Standard_Boolean IsTangentDefined();
101
36b9ff75 102 //! output the tangent direction <D>
42cf5bc1 103 Standard_EXPORT void Tangent (gp_Dir2d& D);
104
36b9ff75 105 //! Returns the curvature.
42cf5bc1 106 Standard_EXPORT Standard_Real Curvature();
107
36b9ff75 108 //! Returns the normal direction <N>.
42cf5bc1 109 Standard_EXPORT void Normal (gp_Dir2d& N);
110
36b9ff75 111 //! Returns the centre of curvature <P>.
42cf5bc1 112 Standard_EXPORT void CentreOfCurvature (gp_Pnt2d& P);
113
114
115
116
117protected:
118
119
120
121
122
123private:
124
125
126
681f3919 127 const HLRBRep_Curve* myCurve;
42cf5bc1 128 Standard_Real myU;
129 Standard_Integer myDerOrder;
130 Standard_Real myCN;
131 Standard_Real myLinTol;
132 gp_Pnt2d myPnt;
133 gp_Vec2d myDerivArr[3];
134 gp_Dir2d myTangent;
135 Standard_Real myCurvature;
136 LProp_Status myTangentStatus;
137 Standard_Integer mySignificantFirstDerivativeOrder;
138
139
140};
141
142
143
144
145
146
147
148#endif // _HLRBRep_CLProps_HeaderFile