summaryrefslogtreecommitdiff
path: root/src/AdvApp2Var/AdvApp2Var_Node.cxx
blob: 46b388d2efc1853f6896560dc3c6441b5f0f0755 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// File:	AdvApp2Var_Node.cxx
// Created:	Tue Jul  2 12:12:24 1996
// Author:	Joelle CHAUVET
//		<jct@sgi38>


#include <AdvApp2Var_Node.ixx>
#include <TColgp_HArray2OfPnt.hxx>
#include <TColStd_HArray2OfReal.hxx>


//=======================================================================
//function : AdvApp2Var_Node
//purpose  : 
//=======================================================================

AdvApp2Var_Node::AdvApp2Var_Node()  :
myOrdInU(2),
myOrdInV(2)
{
  myTruePoints = new TColgp_HArray2OfPnt  ( 0, 2, 0, 2);
  gp_Pnt P0(0.,0.,0.);
  myTruePoints->Init(P0);
  myErrors     = new TColStd_HArray2OfReal( 0, 2, 0, 2);
  myErrors->Init(0.);
}

//=======================================================================
//function : AdvApp2Var_Node
//purpose  : 
//=======================================================================

AdvApp2Var_Node::AdvApp2Var_Node(const Standard_Integer iu,
				 const Standard_Integer iv) :
myOrdInU(iu),
myOrdInV(iv)
{
  myTruePoints = new TColgp_HArray2OfPnt  ( 0, Max(0,iu), 0, Max(0,iv));
  gp_Pnt P0(0.,0.,0.);
  myTruePoints->Init(P0);
  myErrors     = new TColStd_HArray2OfReal( 0, Max(0,iu), 0, Max(0,iv));
  myErrors->Init(0.);
}

//=======================================================================
//function : AdvApp2Var_Node
//purpose  : 
//=======================================================================

AdvApp2Var_Node::AdvApp2Var_Node(const gp_XY& UV,
				 const Standard_Integer iu,
				 const Standard_Integer iv) :
myCoord(UV),
myOrdInU(iu),
myOrdInV(iv)
{
  myTruePoints = new TColgp_HArray2OfPnt  ( 0, iu, 0, iv);
  gp_Pnt P0(0.,0.,0.);
  myTruePoints->Init(P0);
  myErrors     = new TColStd_HArray2OfReal( 0, iu, 0, iv);
  myErrors->Init(0.);
}


//=======================================================================
//function : Coord
//purpose  : returns the coordinates (U,V) of the node
//=======================================================================

gp_XY AdvApp2Var_Node::Coord() const
{
  return myCoord;
}

//=======================================================================
//function : SetCoord
//purpose  : changes the coordinates (U,V) to (x1,x2)
//=======================================================================

void AdvApp2Var_Node::SetCoord(const Standard_Real x1,
			       const Standard_Real x2)
{
  myCoord.SetX(x1);
  myCoord.SetY(x2);
}

//=======================================================================
//function : UOrder
//purpose  : returns the continuity order in U of the node
//=======================================================================

Standard_Integer AdvApp2Var_Node::UOrder() const
{
  return myOrdInU;
}

//=======================================================================
//function : VOrder
//purpose  : returns the continuity order in V of the node
//=======================================================================

Standard_Integer AdvApp2Var_Node::VOrder() const
{
  return myOrdInV;
}


//=======================================================================
//function : SetPoint
//purpose  : affects the value F(U,V) or its derivates on the node (U,V)
//=======================================================================

void AdvApp2Var_Node::SetPoint(const Standard_Integer iu,
			       const Standard_Integer iv,
			       const gp_Pnt& Pt)
{
  myTruePoints->SetValue(iu, iv, Pt);
}


//=======================================================================
//function : Point
//purpose  : returns the value F(U,V) or its derivates on the node (U,V)
//=======================================================================

gp_Pnt AdvApp2Var_Node::Point(const Standard_Integer iu,
			      const Standard_Integer iv) const
{
  return myTruePoints->Value(iu, iv);
}


//=======================================================================
//function : SetError
//purpose  : affects the error between F(U,V) and its approximation
//=======================================================================

void AdvApp2Var_Node::SetError(const Standard_Integer iu,
			       const Standard_Integer iv,
			       const Standard_Real error)
{
  myErrors->SetValue(iu, iv, error);
}


//=======================================================================
//function : Error
//purpose  : returns the error between F(U,V) and its approximation
//=======================================================================

Standard_Real AdvApp2Var_Node::Error(const Standard_Integer iu,
				     const Standard_Integer iv) const
{
  return myErrors->Value(iu, iv);
}