00001 //=========================================================================== 00002 // GoTools - SINTEF Geometry Tools version 1.1 00003 // 00004 // GoTools module: parametrization 00005 // 00006 // Copyright (C) 2000-2005 SINTEF ICT, Applied Mathematics, Norway. 00007 // 00008 // This program is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU General Public License 00010 // as published by the Free Software Foundation version 2 of the License. 00011 // 00012 // This program is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with this program; if not, write to the Free Software 00019 // Foundation, Inc., 00020 // 59 Temple Place - Suite 330, 00021 // Boston, MA 02111-1307, USA. 00022 // 00023 // Contact information: E-mail: tor.dokken@sintef.no 00024 // SINTEF ICT, Department of Applied Mathematics, 00025 // P.O. Box 124 Blindern, 00026 // 0314 Oslo, Norway. 00027 // 00028 // Other licenses are also available for this software, notably licenses 00029 // for: 00030 // - Building commercial software. 00031 // - Building software whose source code you wish to keep private. 00032 //=========================================================================== 00033 #ifndef PRNODE_H 00034 #define PRNODE_H 00035 00036 00037 #include "Array.h" 00038 using Go::Vector2D; 00039 using Go::Vector3D; 00040 00053 class PrNode 00054 { 00055 private: 00056 Vector3D pt_; 00057 double u_,v_; 00058 int tr_; 00059 00060 public: 00061 PrNode() 00062 : pt_(), u_(0), v_(0), tr_(0) 00063 {} 00064 PrNode(double x, double y, double z, double u, double v, int tr) 00065 : pt_(x, y, z), u_(u), v_(v), tr_(tr) 00066 {} 00067 00068 00069 inline void init(double x, double y, double z, double u, double v, int tr); 00070 00071 inline const Vector3D& point() const { return pt_; } 00072 inline const double& u() const; 00073 inline const double& v() const; 00074 inline const double& x() const; 00075 inline const double& y() const; 00076 inline const double& z() const; 00077 inline const int& tr() const; 00078 00079 00080 inline double& u(); 00081 inline double& v(); 00082 inline double& x(); 00083 inline double& y(); 00084 inline double& z(); 00085 inline int& tr(); 00086 00087 // print and scan routines 00088 void print(std::ostream& os) const; 00089 void printXYZ(std::ostream& os) const; 00090 void printUV(std::ostream& os) const; 00091 void scan(std::istream& is); 00092 }; 00093 00094 /*>PrNode-syntax: */ 00095 00096 //----------------------------------------------------------------------------- 00097 inline void PrNode::init(double x, double y, double z, double u, double v, int tr) 00098 //----------------------------------------------------------------------------- 00099 { 00100 pt_[0] = x; 00101 pt_[1] = y; 00102 pt_[2] = z; 00103 u_ = u; 00104 v_ = v; 00105 tr_ = tr; 00106 } 00107 00108 //----------------------------------------------------------------------------- 00109 inline const double& PrNode::u() const 00110 //----------------------------------------------------------------------------- 00111 { 00112 return u_; 00113 } 00114 00115 //----------------------------------------------------------------------------- 00116 inline const double& PrNode::v() const 00117 //----------------------------------------------------------------------------- 00118 { 00119 return v_; 00120 } 00121 00122 //----------------------------------------------------------------------------- 00123 inline const int& PrNode::tr() const 00124 //----------------------------------------------------------------------------- 00125 { 00126 return tr_; 00127 } 00128 00129 //----------------------------------------------------------------------------- 00130 inline double& PrNode::u() 00131 //----------------------------------------------------------------------------- 00132 { 00133 return u_; 00134 } 00135 00136 //----------------------------------------------------------------------------- 00137 inline double& PrNode::v() 00138 //----------------------------------------------------------------------------- 00139 { 00140 return v_; 00141 } 00142 00143 //----------------------------------------------------------------------------- 00144 inline int& PrNode::tr() 00145 //----------------------------------------------------------------------------- 00146 { 00147 return tr_; 00148 } 00149 00150 //----------------------------------------------------------------------------- 00151 inline const double& PrNode::x() const 00152 //----------------------------------------------------------------------------- 00153 { 00154 return pt_[0]; 00155 } 00156 00157 //----------------------------------------------------------------------------- 00158 inline double& PrNode::x() 00159 //----------------------------------------------------------------------------- 00160 { 00161 return pt_[0]; 00162 } 00163 00164 //----------------------------------------------------------------------------- 00165 inline const double& PrNode::y() const 00166 //----------------------------------------------------------------------------- 00167 { 00168 return pt_[1]; 00169 } 00170 00171 //----------------------------------------------------------------------------- 00172 inline double& PrNode::y() 00173 //----------------------------------------------------------------------------- 00174 { 00175 return pt_[1]; 00176 } 00177 00178 //----------------------------------------------------------------------------- 00179 inline const double& PrNode::z() const 00180 //----------------------------------------------------------------------------- 00181 { 00182 return pt_[2]; 00183 } 00184 00185 //----------------------------------------------------------------------------- 00186 inline double& PrNode::z() 00187 //----------------------------------------------------------------------------- 00188 { 00189 return pt_[2]; 00190 } 00191 00192 /*Class:PrNode 00193 00194 Name: PrNode 00195 Syntax: @PrNode-syntax 00196 Keywords: 00197 Description: This class represents a node for use in 00198 PrTriangulation_OP. It has double x,y,z values contained 00199 in its parent class Vector3D. It also has double 00200 u and v values (parameter values) and the index 00201 of its "first" incident triangle tr. If the node 00202 is interior then tr is any incident triangle. Otherwise 00203 the node is a boundary node, in which case tr is the 00204 incident triangle which is the first one in the 00205 anticlockwise direction around the node (equivalently 00206 the only triangle containing the node whose right 00207 neighbour from the point of view of the node is 0). 00208 Member functions: 00209 00210 Constructors: 00211 Files: 00212 Example: 00213 See also: 00214 Developed by: SINTEF Applied Mathematics, Oslo, Norway 00215 Author: Michael Floater, SINTEF 00216 Date: August 97 00217 */ 00218 00219 #endif // PRNODE_H