Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
bitpit::Vertex Class Reference

The Vertex class defines the vertexs. More...

Classes

struct  Less
 

Public Types

enum  Coordinate { COORD_X =0 , COORD_Y , COORD_Z }
 

Public Member Functions

 Vertex ()
 
 Vertex (long id, bool interior=true)
 
 Vertex (long id, const std::array< double, 3 > &coords, bool interior=true)
 
void display (std::ostream &out, unsigned short int indent) const
 
unsigned int getBinarySize () const
 
std::array< double, 3 > & getCoords ()
 
const std::array< double, 3 > & getCoords () const
 
long getId () const
 
void initialize (long id, const std::array< double, 3 > &coords, bool interior)
 
bool isInterior () const
 
bool operator== (const Vertex &other) const
 
double & operator[] (int coord_id)
 
const double & operator[] (int coord_id) const
 
void rotate (const std::array< double, 3 > &n0, const std::array< double, 3 > &n1, double angle)
 
void rotate (double n0x, double n0y, double n0z, double n1x, double n1y, double n1z, double angle)
 
void scale (const std::array< double, 3 > &scaling, const std::array< double, 3 > &center)
 
void scale (double sx, double sy, double sz, double cx, double cy, double cz)
 
void setCoords (const std::array< double, 3 > &coords)
 
void setId (long id)
 
void swap (Vertex &other) noexcept
 
void translate (const std::array< double, 3 > &translation)
 
void translate (double sx, double sy, double sz)
 

Static Public Attributes

static BITPIT_PUBLIC_API const long NULL_ID = std::numeric_limits<long>::min()
 

Protected Member Functions

void setInterior (bool interior)
 

Friends

OBinaryStreamoperator<<) (OBinaryStream &, const Vertex &)
 
IBinaryStreamoperator>>) (IBinaryStream &, Vertex &)
 
class PatchKernel
 

Detailed Description

The Vertex class defines the vertexs.

Vertex is class that defines the vertexs.

Definition at line 42 of file vertex.hpp.

Member Enumeration Documentation

◆ Coordinate

enum bitpit::Vertex::Coordinate

Definition at line 50 of file vertex.hpp.

Constructor & Destructor Documentation

◆ Vertex() [1/3]

bitpit::Vertex::Vertex ( )

Default constructor.

Definition at line 82 of file vertex.cpp.

◆ Vertex() [2/3]

bitpit::Vertex::Vertex ( long id,
bool interior = true )

Creates a new element.

Parameters
[in]idis the id of the vertex
[in]interiorif true the vertex is flagged as interior

Definition at line 93 of file vertex.cpp.

◆ Vertex() [3/3]

bitpit::Vertex::Vertex ( long id,
const std::array< double, 3 > & coords,
bool interior = true )

Create vertex from input coordinates

Parameters
[in]idis the id of the vertex
[in]coordsare the vertex coordinates
[in]interiorif true the vertex is flagged as interior

Definition at line 105 of file vertex.cpp.

Member Function Documentation

◆ display()

void bitpit::Vertex::display ( std::ostream & out,
unsigned short int indent ) const

Displays vertex information to an output stream

Parameters
[in]outis the output stream
[in]indentis the number of trailing spaces to prepend when writing the information

Definition at line 351 of file vertex.cpp.

◆ getBinarySize()

unsigned int bitpit::Vertex::getBinarySize ( ) const

Returns the buffer size required to communicate vertex data

Returns
buffer size (in bytes)

Definition at line 370 of file vertex.cpp.

◆ getCoords() [1/2]

std::array< double, 3 > & bitpit::Vertex::getCoords ( )

Gets the coordinates of the vertex.

Returns
A pointer to the coordinates of the vertex

Definition at line 246 of file vertex.cpp.

◆ getCoords() [2/2]

const std::array< double, 3 > & bitpit::Vertex::getCoords ( ) const

Gets the coordinates of the vertex.

Returns
A pointer to the coordinates of the vertex

Definition at line 256 of file vertex.cpp.

◆ getId()

long bitpit::Vertex::getId ( ) const

Gets the ID of the vertex.

Returns
The ID of the vertex

Definition at line 226 of file vertex.cpp.

◆ initialize()

void bitpit::Vertex::initialize ( long id,
const std::array< double, 3 > & coords,
bool interior )

Initializes the data structures of the vertex.

Parameters
[in]idis the id of the vertex
[in]coordsare the vertex coordinates
[in]interiorif true the vertex is flagged as interior

Definition at line 131 of file vertex.cpp.

◆ isInterior()

bool bitpit::Vertex::isInterior ( ) const

Gets if the vertex belongs to the the interior domain.

Returns
Returns true if the vertex belongs to the the interior domain, otherwise it returns false.

Definition at line 166 of file vertex.cpp.

◆ operator==()

bool bitpit::Vertex::operator== ( const Vertex & other) const

Comparison operator

Parameters
[in]otheris the object to be compared with
Returns
Returns the boolean result of comparison of the values of the arguments, which are not modified.

Definition at line 178 of file vertex.cpp.

◆ operator[]() [1/2]

double & bitpit::Vertex::operator[] ( int coord_id)

Get a reference to the specified coordinate

Parameters
coord_idis the index of the requested coordinate
Returns
Returns a reference to requested coordinate

Definition at line 195 of file vertex.cpp.

◆ operator[]() [2/2]

const double & bitpit::Vertex::operator[] ( int coord_id) const

Get a constants reference to the specified coordinate

Parameters
coord_idis the index of the requested coordinate
Returns
Returns a constant reference to requested coordinate

Definition at line 206 of file vertex.cpp.

◆ rotate() [1/2]

void bitpit::Vertex::rotate ( const std::array< double, 3 > & n0,
const std::array< double, 3 > & n1,
double angle )

Rotates the vertex.

Parameters
[in]n0is a first point on the rotation axis
[in]n1is a second point on the rotation axis
[in]angleis the rotation angle, expressed in radiants and positive for counterclockwise rotations

Definition at line 293 of file vertex.cpp.

◆ rotate() [2/2]

void bitpit::Vertex::rotate ( double n0x,
double n0y,
double n0z,
double n1x,
double n1y,
double n1z,
double angle )

Rotates the vertex.

Parameters
[in]n0xis the x-component of a first point on the rotation axis
[in]n0yis the y-component of a first point on the rotation axis
[in]n0zis the z-component of a first point on the rotation axis
[in]n1xis the x-component of a second point on the rotation axis
[in]n1yis the y-component of a second point on the rotation axis
[in]n1zis the z-component of a second point on the rotation axis
[in]angleis the rotation angle, expressed in radiants and positive for counterclockwise rotations

Definition at line 310 of file vertex.cpp.

◆ scale() [1/2]

void bitpit::Vertex::scale ( const std::array< double, 3 > & scaling,
const std::array< double, 3 > & center )

Scales the vertex.

Parameters
[in]scalingis the scaling vector
[in]centeris the center of the scaling

Definition at line 321 of file vertex.cpp.

◆ scale() [2/2]

void bitpit::Vertex::scale ( double sx,
double sy,
double sz,
double cx,
double cy,
double cz )

Scales the vertex.

Parameters
[in]sxscaling factor along x direction
[in]syscaling factor along y direction
[in]szscaling factor along z direction
[in]cxis the x coordinate scaling center
[in]cyis the y coordinate scaling center
[in]czis the z coordinate scaling center

Definition at line 338 of file vertex.cpp.

◆ setCoords()

void bitpit::Vertex::setCoords ( const std::array< double, 3 > & coords)

Sets the coordinates of the vertex.

Parameters
coordsare the coordinates of the vertex

Definition at line 236 of file vertex.cpp.

◆ setId()

void bitpit::Vertex::setId ( long id)

Sets the ID of the vertex.

Parameters
idthe ID of the vertex

Definition at line 216 of file vertex.cpp.

◆ setInterior()

void bitpit::Vertex::setInterior ( bool interior)
protected

Sets if the vertex belongs to the the interior domain.

Parameters
interiordefines if the vertex belongs to the the interior domain

Definition at line 155 of file vertex.cpp.

◆ swap()

void bitpit::Vertex::swap ( Vertex & other)
noexcept

Exchanges the content of the vertex by the content the specified other vertex.

Parameters
otheris another vertex whose content is swapped with that of this vertex.

Definition at line 117 of file vertex.cpp.

◆ translate() [1/2]

void bitpit::Vertex::translate ( const std::array< double, 3 > & translation)

Translates the vertex.

Parameters
[in]translationis the translation vector

Definition at line 266 of file vertex.cpp.

◆ translate() [2/2]

void bitpit::Vertex::translate ( double sx,
double sy,
double sz )

Translates the vertex.

Parameters
[in]sxtranslation along x direction
[in]sytranslation along y direction
[in]sztranslation along z direction

Definition at line 280 of file vertex.cpp.

Friends And Related Symbol Documentation

◆ PatchKernel

friend class PatchKernel
friend

Definition at line 44 of file vertex.hpp.

Member Data Documentation

◆ NULL_ID

const long bitpit::Vertex::NULL_ID = std::numeric_limits<long>::min()
static

Definition at line 123 of file vertex.hpp.


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