DelaunayTriangulation
A C++ Object Oriented data structure with algorithms that could be used to generate a Delaunay triangulation
Loading...
Searching...
No Matches
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.
 
 Vertex ()
 Default constructor.
 
 ~Vertex ()
 Default destructor.
 
int getIndex () const
 Accessor for private member index.
 
void setIndex (int index)
 Mutator for private member index.
 
const std::vector< double > & getAttributes () const
 Accessor for private member attributes.
 
void setAttributes (const std::vector< double > &attributes)
 Mutator for private member attributes.
 
const VecgetVec () const
 Accessor for private member vec.
 
void setVec (const Vec &vec)
 Mutator for private member vec.
 
bool operator== (const Vertex &rhs) const
 Equality operator.
 
bool operator!= (const Vertex &rhs) const
 Non-equality operator.
 

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.
 
std::ostream & operator<< (std::ostream &os, Vertex &vertex)
 Output stream operator.
 
std::ofstream & operator<< (std::ofstream &ofs, Vertex &vertex)
 Output filestream operator.
 

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 Symbol 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: