0022550: Fixing data races
[occt.git] / src / AdvApp2Var / AdvApp2Var_Node.cxx
CommitLineData
7fd59977 1// File: AdvApp2Var_Node.cxx
2// Created: Tue Jul 2 12:12:24 1996
3// Author: Joelle CHAUVET
4// <jct@sgi38>
5
6
7#include <AdvApp2Var_Node.ixx>
8#include <TColgp_HArray2OfPnt.hxx>
9#include <TColStd_HArray2OfReal.hxx>
10
11
12//=======================================================================
13//function : AdvApp2Var_Node
14//purpose :
15//=======================================================================
16
17AdvApp2Var_Node::AdvApp2Var_Node() :
18myOrdInU(2),
19myOrdInV(2)
20{
21 myTruePoints = new TColgp_HArray2OfPnt ( 0, 2, 0, 2);
22 gp_Pnt P0(0.,0.,0.);
23 myTruePoints->Init(P0);
24 myErrors = new TColStd_HArray2OfReal( 0, 2, 0, 2);
25 myErrors->Init(0.);
26}
27
28//=======================================================================
29//function : AdvApp2Var_Node
30//purpose :
31//=======================================================================
32
33AdvApp2Var_Node::AdvApp2Var_Node(const Standard_Integer iu,
34 const Standard_Integer iv) :
35myOrdInU(iu),
36myOrdInV(iv)
37{
38 myTruePoints = new TColgp_HArray2OfPnt ( 0, Max(0,iu), 0, Max(0,iv));
39 gp_Pnt P0(0.,0.,0.);
40 myTruePoints->Init(P0);
41 myErrors = new TColStd_HArray2OfReal( 0, Max(0,iu), 0, Max(0,iv));
42 myErrors->Init(0.);
43}
44
45//=======================================================================
46//function : AdvApp2Var_Node
47//purpose :
48//=======================================================================
49
50AdvApp2Var_Node::AdvApp2Var_Node(const gp_XY& UV,
51 const Standard_Integer iu,
52 const Standard_Integer iv) :
53myCoord(UV),
54myOrdInU(iu),
55myOrdInV(iv)
56{
57 myTruePoints = new TColgp_HArray2OfPnt ( 0, iu, 0, iv);
58 gp_Pnt P0(0.,0.,0.);
59 myTruePoints->Init(P0);
60 myErrors = new TColStd_HArray2OfReal( 0, iu, 0, iv);
61 myErrors->Init(0.);
62}
63
64
65//=======================================================================
66//function : Coord
67//purpose : returns the coordinates (U,V) of the node
68//=======================================================================
69
70gp_XY AdvApp2Var_Node::Coord() const
71{
72 return myCoord;
73}
74
75//=======================================================================
76//function : SetCoord
77//purpose : changes the coordinates (U,V) to (x1,x2)
78//=======================================================================
79
80void AdvApp2Var_Node::SetCoord(const Standard_Real x1,
81 const Standard_Real x2)
82{
83 myCoord.SetX(x1);
84 myCoord.SetY(x2);
85}
86
87//=======================================================================
88//function : UOrder
89//purpose : returns the continuity order in U of the node
90//=======================================================================
91
92Standard_Integer AdvApp2Var_Node::UOrder() const
93{
94 return myOrdInU;
95}
96
97//=======================================================================
98//function : VOrder
99//purpose : returns the continuity order in V of the node
100//=======================================================================
101
102Standard_Integer AdvApp2Var_Node::VOrder() const
103{
104 return myOrdInV;
105}
106
107
108//=======================================================================
109//function : SetPoint
110//purpose : affects the value F(U,V) or its derivates on the node (U,V)
111//=======================================================================
112
113void AdvApp2Var_Node::SetPoint(const Standard_Integer iu,
114 const Standard_Integer iv,
115 const gp_Pnt& Pt)
116{
117 myTruePoints->SetValue(iu, iv, Pt);
118}
119
120
121//=======================================================================
122//function : Point
123//purpose : returns the value F(U,V) or its derivates on the node (U,V)
124//=======================================================================
125
126gp_Pnt AdvApp2Var_Node::Point(const Standard_Integer iu,
127 const Standard_Integer iv) const
128{
129 return myTruePoints->Value(iu, iv);
130}
131
132
133//=======================================================================
134//function : SetError
135//purpose : affects the error between F(U,V) and its approximation
136//=======================================================================
137
138void AdvApp2Var_Node::SetError(const Standard_Integer iu,
139 const Standard_Integer iv,
140 const Standard_Real error)
141{
142 myErrors->SetValue(iu, iv, error);
143}
144
145
146//=======================================================================
147//function : Error
148//purpose : returns the error between F(U,V) and its approximation
149//=======================================================================
150
151Standard_Real AdvApp2Var_Node::Error(const Standard_Integer iu,
152 const Standard_Integer iv) const
153{
154 return myErrors->Value(iu, iv);
155}
156
157
158
159
160
161
162
163
164
165
166