0024002: Overall code and build procedure refactoring -- automatic
[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//
d5f74e42 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
973c2be1 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
42cf5bc1 17
18#include <AdvApp2Var_Node.hxx>
19#include <gp_Pnt.hxx>
20#include <gp_XY.hxx>
7fd59977 21#include <TColgp_HArray2OfPnt.hxx>
22#include <TColStd_HArray2OfReal.hxx>
23
7fd59977 24//=======================================================================
25//function : AdvApp2Var_Node
26//purpose :
27//=======================================================================
7fd59977 28AdvApp2Var_Node::AdvApp2Var_Node() :
29myOrdInU(2),
30myOrdInV(2)
31{
32 myTruePoints = new TColgp_HArray2OfPnt ( 0, 2, 0, 2);
33 gp_Pnt P0(0.,0.,0.);
34 myTruePoints->Init(P0);
35 myErrors = new TColStd_HArray2OfReal( 0, 2, 0, 2);
36 myErrors->Init(0.);
37}
38
39//=======================================================================
40//function : AdvApp2Var_Node
41//purpose :
42//=======================================================================
43
44AdvApp2Var_Node::AdvApp2Var_Node(const Standard_Integer iu,
45 const Standard_Integer iv) :
46myOrdInU(iu),
47myOrdInV(iv)
48{
49 myTruePoints = new TColgp_HArray2OfPnt ( 0, Max(0,iu), 0, Max(0,iv));
50 gp_Pnt P0(0.,0.,0.);
51 myTruePoints->Init(P0);
52 myErrors = new TColStd_HArray2OfReal( 0, Max(0,iu), 0, Max(0,iv));
53 myErrors->Init(0.);
54}
55
56//=======================================================================
57//function : AdvApp2Var_Node
58//purpose :
59//=======================================================================
60
61AdvApp2Var_Node::AdvApp2Var_Node(const gp_XY& UV,
62 const Standard_Integer iu,
63 const Standard_Integer iv) :
64myCoord(UV),
65myOrdInU(iu),
66myOrdInV(iv)
67{
68 myTruePoints = new TColgp_HArray2OfPnt ( 0, iu, 0, iv);
69 gp_Pnt P0(0.,0.,0.);
70 myTruePoints->Init(P0);
71 myErrors = new TColStd_HArray2OfReal( 0, iu, 0, iv);
72 myErrors->Init(0.);
73}
74
75
76//=======================================================================
77//function : Coord
78//purpose : returns the coordinates (U,V) of the node
79//=======================================================================
80
81gp_XY AdvApp2Var_Node::Coord() const
82{
83 return myCoord;
84}
85
86//=======================================================================
87//function : SetCoord
88//purpose : changes the coordinates (U,V) to (x1,x2)
89//=======================================================================
90
91void AdvApp2Var_Node::SetCoord(const Standard_Real x1,
92 const Standard_Real x2)
93{
94 myCoord.SetX(x1);
95 myCoord.SetY(x2);
96}
97
98//=======================================================================
99//function : UOrder
100//purpose : returns the continuity order in U of the node
101//=======================================================================
102
103Standard_Integer AdvApp2Var_Node::UOrder() const
104{
105 return myOrdInU;
106}
107
108//=======================================================================
109//function : VOrder
110//purpose : returns the continuity order in V of the node
111//=======================================================================
112
113Standard_Integer AdvApp2Var_Node::VOrder() const
114{
115 return myOrdInV;
116}
117
118
119//=======================================================================
120//function : SetPoint
121//purpose : affects the value F(U,V) or its derivates on the node (U,V)
122//=======================================================================
123
124void AdvApp2Var_Node::SetPoint(const Standard_Integer iu,
125 const Standard_Integer iv,
126 const gp_Pnt& Pt)
127{
128 myTruePoints->SetValue(iu, iv, Pt);
129}
130
131
132//=======================================================================
133//function : Point
134//purpose : returns the value F(U,V) or its derivates on the node (U,V)
135//=======================================================================
136
137gp_Pnt AdvApp2Var_Node::Point(const Standard_Integer iu,
138 const Standard_Integer iv) const
139{
140 return myTruePoints->Value(iu, iv);
141}
142
143
144//=======================================================================
145//function : SetError
146//purpose : affects the error between F(U,V) and its approximation
147//=======================================================================
148
149void AdvApp2Var_Node::SetError(const Standard_Integer iu,
150 const Standard_Integer iv,
151 const Standard_Real error)
152{
153 myErrors->SetValue(iu, iv, error);
154}
155
156
157//=======================================================================
158//function : Error
159//purpose : returns the error between F(U,V) and its approximation
160//=======================================================================
161
162Standard_Real AdvApp2Var_Node::Error(const Standard_Integer iu,
163 const Standard_Integer iv) const
164{
165 return myErrors->Value(iu, iv);
166}
167
168
169
170
171
172
173
174
175
176
177