DelaunayTriangulation
A C++ Object Oriented data structure with algorithms that could be used to generate a Delaunay triangulation
Public Member Functions | Private Attributes | Friends | List of all members
Vertex Class Reference

Class representing a vertex of a cell. More...

#include <Vertex.hpp>

Collaboration diagram for Vertex:
Collaboration graph

Public Member Functions

 Vertex (int index, int dim, IMesh *owner)
 Constructor populating index and owner and instantiating vec. More...
 
 Vertex ()
 Default constructor.
 
 ~Vertex ()
 Default destructor.
 
int getIndex () const
 Accessor for private member index. More...
 
void setIndex (int index)
 Mutator for private member index. More...
 
const std::vector< double > & getAttributes () const
 Accessor for private member attributes. More...
 
void setAttributes (const std::vector< double > &attributes)
 Mutator for private member attributes. More...
 
const VecgetVec () const
 Accessor for private member vec. More...
 
void setVec (const Vec &vec)
 Mutator for private member vec. More...
 
bool operator== (const Vertex &rhs) const
 Equality operator. More...
 
bool operator!= (const Vertex &rhs) const
 Non-equality operator. More...
 

Private Attributes

int index
 Index of the triangle from file.
 
IMeshowner
 Pointer to interface class of the Mesh the Vertex is a part of.
 
Vec vec
 Vec class storing the coordinates of the vertex.
 
std::vector< double > attributes
 Vector of attributes of the Vertex (16 points of precision)
 

Friends

std::istream & operator>> (std::istream &is, Vertex &vertex)
 Input stream operator. More...
 
std::ostream & operator<< (std::ostream &os, Vertex &vertex)
 Output stream operator. More...
 
std::ofstream & operator<< (std::ofstream &ofs, Vertex &vertex)
 Output filestream operator. More...
 

Detailed Description

Class representing a vertex of a cell.

Constructor & Destructor Documentation

◆ Vertex()

Vertex::Vertex ( int  index,
int  dim,
IMesh owner 
)
inline

Constructor populating index and owner and instantiating vec.

Parameters
indexIndex of vertex according to file
dimDimensions in the mesh - passed to Vec
ownerPointer to Mesh the Vertex is a part of

Member Function Documentation

◆ getAttributes()

const std::vector< double > & Vertex::getAttributes ( ) const

Accessor for private member attributes.

Returns
vector of vertex attributes

◆ getIndex()

int Vertex::getIndex ( ) const

Accessor for private member index.

Returns
index of vertex or -1 if not part of mesh

◆ getVec()

const Vec & Vertex::getVec ( ) const

Accessor for private member vec.

Returns
Vec object of vertex

◆ operator!=()

bool Vertex::operator!= ( const Vertex rhs) const

Non-equality operator.

Parameters
rhs
Returns

◆ operator==()

bool Vertex::operator== ( const Vertex rhs) const

Equality operator.

Parameters
rhs
Returns

◆ setAttributes()

void Vertex::setAttributes ( const std::vector< double > &  attributes)

Mutator for private member attributes.

Parameters
attributesvector of vertex attributes

◆ setIndex()

void Vertex::setIndex ( int  index)

Mutator for private member index.

Parameters
indexindex of vertex

◆ setVec()

void Vertex::setVec ( const Vec vec)

Mutator for private member vec.

Parameters
vecVec object

Friends And Related Function Documentation

◆ operator<< [1/2]

std::ofstream & operator<< ( std::ofstream &  ofs,
Vertex vertex 
)
friend

Output filestream operator.

Parameters
ofs
vertex
Returns

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream &  os,
Vertex vertex 
)
friend

Output stream operator.

Parameters
os
vertex
Returns

◆ operator>>

std::istream & operator>> ( std::istream &  is,
Vertex vertex 
)
friend

Input stream operator.

Parameters
is
vertex
Returns

The documentation for this class was generated from the following files: