0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / AdvApp2Var / AdvApp2Var_Node.hxx
CommitLineData
42cf5bc1 1// Created on: 1996-04-09
2// Created by: Joelle CHAUVET
3// Copyright (c) 1996-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
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
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _AdvApp2Var_Node_HeaderFile
18#define _AdvApp2Var_Node_HeaderFile
19
158f2931 20#include <gp_XY.hxx>
42cf5bc1 21#include <Standard.hxx>
42cf5bc1 22#include <Standard_Handle.hxx>
158f2931 23#include <Standard_Type.hxx>
24#include <TColgp_Array2OfPnt.hxx>
25#include <TColStd_Array2OfReal.hxx>
42cf5bc1 26
27//! used to store constraints on a (Ui,Vj) point
158f2931 28class AdvApp2Var_Node : public Standard_Transient
42cf5bc1 29{
158f2931 30 DEFINE_STANDARD_RTTIEXT(AdvApp2Var_Node, Standard_Transient)
42cf5bc1 31public:
32
42cf5bc1 33 Standard_EXPORT AdvApp2Var_Node();
34
35 Standard_EXPORT AdvApp2Var_Node(const Standard_Integer iu, const Standard_Integer iv);
36
37 Standard_EXPORT AdvApp2Var_Node(const gp_XY& UV, const Standard_Integer iu, const Standard_Integer iv);
42cf5bc1 38
158f2931 39 //! Returns the coordinates (U,V) of the node
40 const gp_XY& Coord() const { return myCoord; }
41
42 //! changes the coordinates (U,V) to (x1,x2)
43 void SetCoord (const Standard_Real x1, const Standard_Real x2)
44 {
45 myCoord.SetX(x1);
46 myCoord.SetY(x2);
47 }
48
49 //! returns the continuity order in U of the node
50 Standard_Integer UOrder() const { return myOrdInU; }
51
52 //! returns the continuity order in V of the node
53 Standard_Integer VOrder() const { return myOrdInV; }
54
55 //! affects the value F(U,V) or its derivates on the node (U,V)
56 void SetPoint (const Standard_Integer iu, const Standard_Integer iv, const gp_Pnt& Pt)
57 {
58 myTruePoints.SetValue(iu, iv, Pt);
59 }
60
61 //! returns the value F(U,V) or its derivates on the node (U,V)
62 const gp_Pnt& Point (const Standard_Integer iu, const Standard_Integer iv) const
63 {
64 return myTruePoints.Value(iu, iv);
65 }
66
67 //! affects the error between F(U,V) and its approximation
68 void SetError (const Standard_Integer iu, const Standard_Integer iv, const Standard_Real error)
69 {
70 myErrors.SetValue(iu, iv, error);
71 }
72
73 //! returns the error between F(U,V) and its approximation
74 Standard_Real Error (const Standard_Integer iu, const Standard_Integer iv) const { return myErrors.Value(iu, iv); }
75
76 //! Assign operator.
77 AdvApp2Var_Node& operator= (const AdvApp2Var_Node& theOther)
78 {
79 myTruePoints = theOther.myTruePoints;
80 myErrors = theOther.myErrors;
81 myCoord = theOther.myCoord;
82 myOrdInU = theOther.myOrdInU;
83 myOrdInV = theOther.myOrdInV;
84 return *this;
85 }
42cf5bc1 86
87private:
88
158f2931 89 AdvApp2Var_Node (const AdvApp2Var_Node& theOther);
42cf5bc1 90
158f2931 91private:
42cf5bc1 92
158f2931 93 TColgp_Array2OfPnt myTruePoints;
94 TColStd_Array2OfReal myErrors;
42cf5bc1 95 gp_XY myCoord;
96 Standard_Integer myOrdInU;
97 Standard_Integer myOrdInV;
42cf5bc1 98
99};
100
42cf5bc1 101#endif // _AdvApp2Var_Node_HeaderFile