0024428: Implementation of LGPL license
[occt.git] / src / AdvApp2Var / AdvApp2Var_Node.cxx
CommitLineData
b311480e 1// Created on: 1996-07-02
2// Created by: Joelle CHAUVET
3// Copyright (c) 1996-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
973c2be1 8// This library is free software; you can redistribute it and / or modify it
9// under the terms of the GNU Lesser General Public 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <AdvApp2Var_Node.ixx>
18#include <TColgp_HArray2OfPnt.hxx>
19#include <TColStd_HArray2OfReal.hxx>
20
21
22//=======================================================================
23//function : AdvApp2Var_Node
24//purpose :
25//=======================================================================
26
27AdvApp2Var_Node::AdvApp2Var_Node() :
28myOrdInU(2),
29myOrdInV(2)
30{
31 myTruePoints = new TColgp_HArray2OfPnt ( 0, 2, 0, 2);
32 gp_Pnt P0(0.,0.,0.);
33 myTruePoints->Init(P0);
34 myErrors = new TColStd_HArray2OfReal( 0, 2, 0, 2);
35 myErrors->Init(0.);
36}
37
38//=======================================================================
39//function : AdvApp2Var_Node
40//purpose :
41//=======================================================================
42
43AdvApp2Var_Node::AdvApp2Var_Node(const Standard_Integer iu,
44 const Standard_Integer iv) :
45myOrdInU(iu),
46myOrdInV(iv)
47{
48 myTruePoints = new TColgp_HArray2OfPnt ( 0, Max(0,iu), 0, Max(0,iv));
49 gp_Pnt P0(0.,0.,0.);
50 myTruePoints->Init(P0);
51 myErrors = new TColStd_HArray2OfReal( 0, Max(0,iu), 0, Max(0,iv));
52 myErrors->Init(0.);
53}
54
55//=======================================================================
56//function : AdvApp2Var_Node
57//purpose :
58//=======================================================================
59
60AdvApp2Var_Node::AdvApp2Var_Node(const gp_XY& UV,
61 const Standard_Integer iu,
62 const Standard_Integer iv) :
63myCoord(UV),
64myOrdInU(iu),
65myOrdInV(iv)
66{
67 myTruePoints = new TColgp_HArray2OfPnt ( 0, iu, 0, iv);
68 gp_Pnt P0(0.,0.,0.);
69 myTruePoints->Init(P0);
70 myErrors = new TColStd_HArray2OfReal( 0, iu, 0, iv);
71 myErrors->Init(0.);
72}
73
74
75//=======================================================================
76//function : Coord
77//purpose : returns the coordinates (U,V) of the node
78//=======================================================================
79
80gp_XY AdvApp2Var_Node::Coord() const
81{
82 return myCoord;
83}
84
85//=======================================================================
86//function : SetCoord
87//purpose : changes the coordinates (U,V) to (x1,x2)
88//=======================================================================
89
90void AdvApp2Var_Node::SetCoord(const Standard_Real x1,
91 const Standard_Real x2)
92{
93 myCoord.SetX(x1);
94 myCoord.SetY(x2);
95}
96
97//=======================================================================
98//function : UOrder
99//purpose : returns the continuity order in U of the node
100//=======================================================================
101
102Standard_Integer AdvApp2Var_Node::UOrder() const
103{
104 return myOrdInU;
105}
106
107//=======================================================================
108//function : VOrder
109//purpose : returns the continuity order in V of the node
110//=======================================================================
111
112Standard_Integer AdvApp2Var_Node::VOrder() const
113{
114 return myOrdInV;
115}
116
117
118//=======================================================================
119//function : SetPoint
120//purpose : affects the value F(U,V) or its derivates on the node (U,V)
121//=======================================================================
122
123void AdvApp2Var_Node::SetPoint(const Standard_Integer iu,
124 const Standard_Integer iv,
125 const gp_Pnt& Pt)
126{
127 myTruePoints->SetValue(iu, iv, Pt);
128}
129
130
131//=======================================================================
132//function : Point
133//purpose : returns the value F(U,V) or its derivates on the node (U,V)
134//=======================================================================
135
136gp_Pnt AdvApp2Var_Node::Point(const Standard_Integer iu,
137 const Standard_Integer iv) const
138{
139 return myTruePoints->Value(iu, iv);
140}
141
142
143//=======================================================================
144//function : SetError
145//purpose : affects the error between F(U,V) and its approximation
146//=======================================================================
147
148void AdvApp2Var_Node::SetError(const Standard_Integer iu,
149 const Standard_Integer iv,
150 const Standard_Real error)
151{
152 myErrors->SetValue(iu, iv, error);
153}
154
155
156//=======================================================================
157//function : Error
158//purpose : returns the error between F(U,V) and its approximation
159//=======================================================================
160
161Standard_Real AdvApp2Var_Node::Error(const Standard_Integer iu,
162 const Standard_Integer iv) const
163{
164 return myErrors->Value(iu, iv);
165}
166
167
168
169
170
171
172
173
174
175
176