#include <Vertex.hpp>


Public Types | |
| enum | |
| typedef real_t | ValueType |
| The type of values stored in the TinyVector. | |
Public Member Functions | |
| bool | operator== (const Vertex &V) const |
| const Vertex & | operator= (const Vertex &V) |
| real_t & | x () |
| real_t & | y () |
| real_t & | z () |
| const real_t & | x () const |
| const real_t & | y () const |
| const real_t & | z () const |
| size_t & | reference () |
| const size_t & | reference () const |
| Vertex () | |
| Vertex (const real_t &x, const real_t &y, const real_t &z, const size_t &reference=0) | |
| Vertex (const TinyVector< 3, real_t > &v, const size_t &reference=0) | |
| Vertex (const Vertex &v) | |
| ~Vertex () | |
| real_t | distance (const TinyVector< 3, real_t > &V) const |
| real_t | distance2 (const TinyVector< 3, real_t > &V) const |
| size_t | size () const |
| real_t & | operator[] (const size_t &i) |
| const real_t & | operator[] (const size_t &i) const |
| TinyVector< N, real_t > | operator* (const real_t &t) const |
| real_t | operator* (const TinyVector< N, real_t > &V) const |
| const TinyVector< N, real_t > & | operator*= (const real_t &t) |
| const TinyVector< N, real_t > & | operator/= (const real_t &t) |
| TinyVector< N, real_t > | operator- (const TinyVector< N, real_t > &V) const |
| const TinyVector< N, real_t > & | operator-= (const TinyVector< N, real_t > &V) |
| TinyVector< N, real_t > | operator^ (const TinyVector< N, real_t > &V) const |
| TinyVector< N, real_t > | operator+ (const TinyVector< N, real_t > &V) const |
| TinyVector< N, real_t > & | operator+= (const TinyVector< N, real_t > &V) |
| bool | operator== (const TinyVector< N, real_t > &V) const |
| bool | operator!= (const TinyVector< N, real_t > &V) const |
| bool | operator< (const TinyVector< N, real_t > &V) const |
Protected Attributes | |
| real_t | __x [N] |
| stored data | |
Private Attributes | |
| size_t | __reference |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Vertex &V) |
| TinyVector< N, real_t > | operator* (const real_t &a, const TinyVector< N, real_t > &V) |
| TinyVector< N, real_t > | sqrt (const TinyVector< N, real_t > &V) |
| real_t | Norm (const TinyVector< N, real_t > &V) |
| std::ostream & | operator<< (std::ostream &os, const TinyVector< N, real_t > &V) |
Definition at line 37 of file Vertex.hpp.
typedef real_t TinyVector< N, real_t >::ValueType [inherited] |
anonymous enum [inherited] |
| Vertex::Vertex | ( | ) | [inline] |
Default constructor. Coordinates and references are set to 0
Definition at line 164 of file Vertex.hpp.
00165 : TinyVector<3, real_t>(0,0,0), 00166 __reference(0) 00167 { 00168 ; 00169 }
| Vertex::Vertex | ( | const real_t & | x, | |
| const real_t & | y, | |||
| const real_t & | z, | |||
| const size_t & | reference = 0 | |||
| ) | [inline] |
Constructor
| x | first coordinate | |
| y | second coordinate | |
| z | third coordinate | |
| reference | the reference |
Definition at line 181 of file Vertex.hpp.
00185 : TinyVector<3, real_t>(x,y,z), 00186 __reference(reference) 00187 { 00188 ; 00189 }
| Vertex::Vertex | ( | const TinyVector< 3, real_t > & | v, | |
| const size_t & | reference = 0 | |||
| ) | [inline] |
Constructor
| v | coordinates | |
| reference | the reference |
Definition at line 199 of file Vertex.hpp.
00201 : TinyVector<3, real_t>(v), 00202 __reference(reference) 00203 { 00204 ; 00205 }
| Vertex::Vertex | ( | const Vertex & | v | ) | [inline] |
Copy constructor
| v | a given vertex |
Definition at line 213 of file Vertex.hpp.
00214 : TinyVector<3, real_t>(v), 00215 __reference(v.__reference) 00216 { 00217 ; 00218 }
| Vertex::~Vertex | ( | ) | [inline] |
| bool Vertex::operator== | ( | const Vertex & | V | ) | const [inline] |
Compares two vertices. Result is false if vertices are not the same variable in memory.
| V | the vertex to compare with |
Definition at line 52 of file Vertex.hpp.
Sets the vertex equal to a given one
| V | the model vertex |
vertex Definition at line 64 of file Vertex.hpp.
References __reference, and TinyVector< N, T >::operator=().
00065 { 00066 TinyVector<3, real_t>::operator = (V); 00067 __reference = V.__reference; 00068 return (*this); 00069 }

| real_t& Vertex::x | ( | ) | [inline] |
Access to the first coordinate of the vertex
Definition at line 77 of file Vertex.hpp.
Referenced by Cube::__inShape(), distance(), distance2(), Triangulation::export_mesh(), operator<<(), SpectralMesh::SpectralMesh(), Structured3DMesh::Structured3DMesh(), Structured3DMesh::vertexIndex(), and SpectralMesh::vertexIndex().
| real_t& Vertex::y | ( | ) | [inline] |
Access to the second coordinate of the vertex
Definition at line 88 of file Vertex.hpp.
Referenced by Cube::__inShape(), distance(), distance2(), operator<<(), SpectralMesh::SpectralMesh(), Structured3DMesh::Structured3DMesh(), Structured3DMesh::vertexIndex(), and SpectralMesh::vertexIndex().
| real_t& Vertex::z | ( | ) | [inline] |
Access to the third coordinate of the vertex
Definition at line 100 of file Vertex.hpp.
Referenced by Cube::__inShape(), distance(), distance2(), operator<<(), SpectralMesh::SpectralMesh(), Structured3DMesh::Structured3DMesh(), Structured3DMesh::vertexIndex(), and SpectralMesh::vertexIndex().
| const real_t& Vertex::x | ( | ) | const [inline] |
Read-only access to the first coordinate of the vertex
Definition at line 111 of file Vertex.hpp.
| const real_t& Vertex::y | ( | ) | const [inline] |
Read-only access to the second coordinate of the vertex
Definition at line 122 of file Vertex.hpp.
| const real_t& Vertex::z | ( | ) | const [inline] |
Read-only access to the third coordinate of the vertex
Definition at line 133 of file Vertex.hpp.
| size_t& Vertex::reference | ( | ) | [inline] |
Access to the reference of the vertex
Definition at line 144 of file Vertex.hpp.
References __reference.
Referenced by SurfaceMeshGenerator::Internals::__createSurface(), MeshTransformer::__transformSurface(), MeshTransformer::__transformVolume(), and FunctionExpressionMeshReferences::execute().
00145 { 00146 return __reference; 00147 }
| const size_t& Vertex::reference | ( | ) | const [inline] |
Read-only access to the reference of the vertex
Definition at line 155 of file Vertex.hpp.
References __reference.
00156 { 00157 return __reference; 00158 }
| real_t Vertex::distance | ( | const TinyVector< 3, real_t > & | V | ) | const [inline] |
Computes the of the distance to another point
| V | the point to compute the distance with |
Definition at line 236 of file Vertex.hpp.
00237 { 00238 return std::sqrt((V[0]-x())*(V[0]-x()) 00239 +(V[1]-y())*(V[1]-y()) 00240 +(V[2]-z())*(V[2]-z())); 00241 }

| real_t Vertex::distance2 | ( | const TinyVector< 3, real_t > & | V | ) | const [inline] |
Computes the square of the distance to another point
| V | the vertex to compute the distance with |
Definition at line 250 of file Vertex.hpp.
Referenced by Sphere::__inShape().
00251 { 00252 return ((V[0]-x())*(V[0]-x()) 00253 +(V[1]-y())*(V[1]-y()) 00254 +(V[2]-z())*(V[2]-z())); 00255 }

| size_t TinyVector< N, real_t >::size | ( | ) | const [inline, inherited] |
Read-only access to the dimension of the TinyVector.
Definition at line 63 of file TinyVector.hpp.
| real_t & TinyVector< N, real_t >::operator[] | ( | const size_t & | i | ) | [inline, inherited] |
Access to the i th coordinate.
| i | the component number |
Definition at line 75 of file TinyVector.hpp.
| const real_t & TinyVector< N, real_t >::operator[] | ( | const size_t & | i | ) | const [inline, inherited] |
Read-only access to the i th component.
| i | the component number |
Definition at line 88 of file TinyVector.hpp.
| TinyVector<N, real_t > TinyVector< N, real_t >::operator* | ( | const real_t & | t | ) | const [inline, inherited] |
Returns multiplication by a T from the right ...
| t | the value |
where
is the current vector Definition at line 129 of file TinyVector.hpp.
00130 { 00131 TinyVector<N, T> W; 00132 for (size_t i=0; i<N; i++) 00133 W.__x[i] = __x[i] * t; 00134 return W; 00135 }
| real_t TinyVector< N, real_t >::operator* | ( | const TinyVector< N, real_t > & | V | ) | const [inline, inherited] |
Computes the scalar product with another vector
| V | the other vector |
Definition at line 144 of file TinyVector.hpp.
00145 { 00146 ASSERT(typeid(T) == typeid(real_t)); 00147 real_t s=0; 00148 for (size_t i=0; i<N; i++) 00149 s += __x[i] * V.__x[i]; 00150 return s; 00151 }
| const TinyVector<N, real_t >& TinyVector< N, real_t >::operator*= | ( | const real_t & | t | ) | [inline, inherited] |
Multiplies the TinyVector by a T
| t | the given value |
Definition at line 160 of file TinyVector.hpp.
00161 { 00162 for (size_t i=0; i<N; i++) 00163 __x[i] *= t; 00164 return (*this); 00165 }
| const TinyVector<N, real_t >& TinyVector< N, real_t >::operator/= | ( | const real_t & | t | ) | [inline, inherited] |
Multiplies the TinyVector by the inverse of a T
| t | the given value |
Definition at line 174 of file TinyVector.hpp.
00175 { 00176 const T temp = 1./t; 00177 this->operator*=(temp); 00178 return (*this); 00179 }
| TinyVector<N, real_t > TinyVector< N, real_t >::operator- | ( | const TinyVector< N, real_t > & | V | ) | const [inline, inherited] |
Computes the difference with an other vector
| V | the other vector |
Definition at line 188 of file TinyVector.hpp.
00189 { 00190 TinyVector<N, T> v = 0; 00191 for (size_t i=0; i<N; i++) 00192 v[i] = __x[i] - V.__x[i]; 00193 return v; 00194 }
| const TinyVector<N, real_t >& TinyVector< N, real_t >::operator-= | ( | const TinyVector< N, real_t > & | V | ) | [inline, inherited] |
Substracts a vector.
| V | the vector to remove |
Definition at line 203 of file TinyVector.hpp.
| TinyVector<N, real_t > TinyVector< N, real_t >::operator^ | ( | const TinyVector< N, real_t > & | V | ) | const [inline, inherited] |
Computes the vectorial product with a vector
| V | the given vector |
Definition at line 217 of file TinyVector.hpp.
00218 { 00219 TinyVector<N, T> W=0; 00220 for (size_t i=0; i<N; i++) 00221 W[i] += __x[(i+1)%N] * V.__x[(i+2)%N] - __x[(i+2)%N] * V.__x[(i+1)%N]; 00222 return W; 00223 }
| TinyVector<N, real_t > TinyVector< N, real_t >::operator+ | ( | const TinyVector< N, real_t > & | V | ) | const [inline, inherited] |
Computes the sum with another vector
| V | the other vector |
Definition at line 232 of file TinyVector.hpp.
00233 { 00234 TinyVector<N, T> W(*this); 00235 for (size_t i=0; i<N; i++) 00236 W.__x[i] += V.__x[i]; 00237 return W; 00238 }
| TinyVector<N, real_t >& TinyVector< N, real_t >::operator+= | ( | const TinyVector< N, real_t > & | V | ) | [inline, inherited] |
Adds a vector
| V | the vector to add |
Definition at line 247 of file TinyVector.hpp.
| bool TinyVector< N, real_t >::operator== | ( | const TinyVector< N, real_t > & | V | ) | const [inline, inherited] |
Compares two vectors
| V | the vector to compare with |
Definition at line 263 of file TinyVector.hpp.
00264 { 00265 for (size_t i=0; i<N; i++) { 00266 if (__x[i] != V.__x[i]) { 00267 return false; 00268 } 00269 } 00270 return true; 00271 }
| bool TinyVector< N, real_t >::operator!= | ( | const TinyVector< N, real_t > & | V | ) | const [inline, inherited] |
Compares 2 vectors. true if they are not exactly the same
| V | the vector to compare with |
Definition at line 280 of file TinyVector.hpp.
00281 { 00282 for (size_t i=0; i<N; i++) { 00283 if (__x[i] != V.__x[i]) { 00284 return true; 00285 } 00286 } 00287 return false; 00288 }
| bool TinyVector< N, real_t >::operator< | ( | const TinyVector< N, real_t > & | V | ) | const [inline, inherited] |
Compares two vectors
| V | the vector to compare with |
Definition at line 299 of file TinyVector.hpp.
00300 { 00301 for (size_t i=0; i<N; ++i) { 00302 if(__x[i] != V.__x[i]) { 00303 return (__x[i] < V.__x[i]); 00304 } 00305 } 00306 return false; 00307 }
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const Vertex & | V | |||
| ) | [friend] |
Prints a given vertex to a stream
| os | the given stream | |
| V | the vertex |
Definition at line 30 of file Vertex.cpp.
| TinyVector<N, real_t > operator* | ( | const real_t & | a, | |
| const TinyVector< N, real_t > & | V | |||
| ) | [friend, inherited] |
Returns the multiplication of a TinyVector by a T on the left.
| a | the multiplicative constant | |
| V | the vector to multiply |
Definition at line 352 of file TinyVector.hpp.
| TinyVector<N, real_t > sqrt | ( | const TinyVector< N, real_t > & | V | ) | [friend, inherited] |
Returns the square root of a vector. (ie: it returns the vector whoose componnents are square roots of arg)
| V | the given vector |
Definition at line 317 of file TinyVector.hpp.
00318 { 00319 using namespace std; 00320 TinyVector<N, T> W; 00321 for (size_t i=0; i<N; i++) 00322 W.__x[i] = sqrt(V.__x[i]); 00323 return W; 00324 }
| real_t Norm | ( | const TinyVector< N, real_t > & | V | ) | [friend, inherited] |
Returns the Euclidean norm of the vector.
| V | the vector which norm is to compute |
Definition at line 333 of file TinyVector.hpp.
00334 { 00335 T t = 0; 00336 for (size_t i=0; i<N; i++) { 00337 t += V.__x[i]*V.__x[i]; 00338 } 00339 00340 using namespace std; 00341 return sqrt(t); 00342 }
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const TinyVector< N, real_t > & | V | |||
| ) | [friend, inherited] |
Prints out the transposed of a vector in a stream
| os | the given stream | |
| V | the vector |
Definition at line 365 of file TinyVector.hpp.
00367 { 00368 ASSERT (N>0); 00369 os << '('; 00370 for (size_t i=0; i<N-1; i++) 00371 os << V[i] << ", "; 00372 os << V[N-1] << ')'; 00373 return os; 00374 }
size_t Vertex::__reference [private] |
The reference of the vertex
Definition at line 41 of file Vertex.hpp.
Referenced by operator=(), and reference().
real_t TinyVector< N, real_t >::__x[N] [protected, inherited] |
1.5.6