0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / IntPatch / IntPatch_ArcFunction.hxx
1 // Created on: 1993-06-07
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 _IntPatch_ArcFunction_HeaderFile
18 #define _IntPatch_ArcFunction_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <IntSurf_Quadric.hxx>
25 #include <gp_Pnt.hxx>
26 #include <TColgp_SequenceOfPnt.hxx>
27 #include <math_FunctionWithDerivative.hxx>
28 #include <Standard_Boolean.hxx>
29 #include <Standard_Real.hxx>
30 #include <Standard_Integer.hxx>
31 class Adaptor2d_HCurve2d;
32 class Adaptor3d_HSurface;
33 class IntSurf_Quadric;
34 class gp_Pnt;
35
36
37
38 class IntPatch_ArcFunction  : public math_FunctionWithDerivative
39 {
40 public:
41
42   DEFINE_STANDARD_ALLOC
43
44   
45   Standard_EXPORT IntPatch_ArcFunction();
46   
47     void SetQuadric (const IntSurf_Quadric& Q);
48   
49     void Set (const Handle(Adaptor2d_HCurve2d)& A);
50   
51     void Set (const Handle(Adaptor3d_HSurface)& S);
52   
53   Standard_EXPORT Standard_Boolean Value (const Standard_Real X, Standard_Real& F) Standard_OVERRIDE;
54   
55   Standard_EXPORT Standard_Boolean Derivative (const Standard_Real X, Standard_Real& D) Standard_OVERRIDE;
56   
57   Standard_EXPORT Standard_Boolean Values (const Standard_Real X, Standard_Real& F, Standard_Real& D) Standard_OVERRIDE;
58   
59   Standard_EXPORT Standard_Integer NbSamples() const;
60   
61   Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
62   
63     const gp_Pnt& Valpoint (const Standard_Integer Index) const;
64   
65     const IntSurf_Quadric& Quadric() const;
66   
67     const Handle(Adaptor2d_HCurve2d)& Arc() const;
68   
69     const Handle(Adaptor3d_HSurface)& Surface() const;
70
71     //! Returns the point, which has been computed
72     //! while the last calling Value() method
73     const gp_Pnt& LastComputedPoint() const;
74
75
76
77 protected:
78
79
80
81
82
83 private:
84
85
86
87   Handle(Adaptor2d_HCurve2d) myArc;
88   Handle(Adaptor3d_HSurface) mySurf;
89   IntSurf_Quadric myQuad;
90   gp_Pnt ptsol;
91   TColgp_SequenceOfPnt seqpt;
92
93
94 };
95
96
97 #include <IntPatch_ArcFunction.lxx>
98
99
100
101
102
103 #endif // _IntPatch_ArcFunction_HeaderFile