1 // Created on: 1996-07-02
2 // Created by: Joelle CHAUVET
3 // Copyright (c) 1996-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <AdvApp2Var_Node.ixx>
18 #include <TColgp_HArray2OfPnt.hxx>
19 #include <TColStd_HArray2OfReal.hxx>
22 //=======================================================================
23 //function : AdvApp2Var_Node
25 //=======================================================================
27 AdvApp2Var_Node::AdvApp2Var_Node() :
31 myTruePoints = new TColgp_HArray2OfPnt ( 0, 2, 0, 2);
33 myTruePoints->Init(P0);
34 myErrors = new TColStd_HArray2OfReal( 0, 2, 0, 2);
38 //=======================================================================
39 //function : AdvApp2Var_Node
41 //=======================================================================
43 AdvApp2Var_Node::AdvApp2Var_Node(const Standard_Integer iu,
44 const Standard_Integer iv) :
48 myTruePoints = new TColgp_HArray2OfPnt ( 0, Max(0,iu), 0, Max(0,iv));
50 myTruePoints->Init(P0);
51 myErrors = new TColStd_HArray2OfReal( 0, Max(0,iu), 0, Max(0,iv));
55 //=======================================================================
56 //function : AdvApp2Var_Node
58 //=======================================================================
60 AdvApp2Var_Node::AdvApp2Var_Node(const gp_XY& UV,
61 const Standard_Integer iu,
62 const Standard_Integer iv) :
67 myTruePoints = new TColgp_HArray2OfPnt ( 0, iu, 0, iv);
69 myTruePoints->Init(P0);
70 myErrors = new TColStd_HArray2OfReal( 0, iu, 0, iv);
75 //=======================================================================
77 //purpose : returns the coordinates (U,V) of the node
78 //=======================================================================
80 gp_XY AdvApp2Var_Node::Coord() const
85 //=======================================================================
87 //purpose : changes the coordinates (U,V) to (x1,x2)
88 //=======================================================================
90 void AdvApp2Var_Node::SetCoord(const Standard_Real x1,
91 const Standard_Real x2)
97 //=======================================================================
99 //purpose : returns the continuity order in U of the node
100 //=======================================================================
102 Standard_Integer AdvApp2Var_Node::UOrder() const
107 //=======================================================================
109 //purpose : returns the continuity order in V of the node
110 //=======================================================================
112 Standard_Integer AdvApp2Var_Node::VOrder() const
118 //=======================================================================
119 //function : SetPoint
120 //purpose : affects the value F(U,V) or its derivates on the node (U,V)
121 //=======================================================================
123 void AdvApp2Var_Node::SetPoint(const Standard_Integer iu,
124 const Standard_Integer iv,
127 myTruePoints->SetValue(iu, iv, Pt);
131 //=======================================================================
133 //purpose : returns the value F(U,V) or its derivates on the node (U,V)
134 //=======================================================================
136 gp_Pnt AdvApp2Var_Node::Point(const Standard_Integer iu,
137 const Standard_Integer iv) const
139 return myTruePoints->Value(iu, iv);
143 //=======================================================================
144 //function : SetError
145 //purpose : affects the error between F(U,V) and its approximation
146 //=======================================================================
148 void AdvApp2Var_Node::SetError(const Standard_Integer iu,
149 const Standard_Integer iv,
150 const Standard_Real error)
152 myErrors->SetValue(iu, iv, error);
156 //=======================================================================
158 //purpose : returns the error between F(U,V) and its approximation
159 //=======================================================================
161 Standard_Real AdvApp2Var_Node::Error(const Standard_Integer iu,
162 const Standard_Integer iv) const
164 return myErrors->Value(iu, iv);