Struct Vertex

Inheritance Relationships

Derived Types

Struct Documentation

struct Vertex

Vertex struct represents a general vertex.

Subclassed by gamer::SMVertex, gamer::TMEdge, gamer::TMVertex

Public Functions

Vertex()

Default constructor with x,y,z = 0.

Vertex(REAL x, REAL y, REAL z)

Constructor with initialized position.

Parameters
  • [in] x: x-position of the vertex

  • [in] y: y-position of the vertex

  • [in] z: z-position of the vertex

Vertex(REAL x, REAL y, REAL z, int m, bool sel)

Constructor with initialized position, marker, and selection.

Parameters
  • [in] x: x-position of the vertex

  • [in] y: y-position of the vertex

  • [in] z: z-position of the vertex

  • [in] m: marker ID

  • [in] sel: selection flag

Vertex(Vector &v)

Constructor seeded from a Vector.

Parameters
  • [in] v: Vector position

Vertex(Vector &&v)

Move construct a vertex from vector.

Parameters
  • v: Vector position

Vertex(const Vertex &x)

Copy Constructor.

Parameters

Vertex(const Vertex &&x)

Move Constructor.

Parameters

operator Vector() const

Implicit cast of Vertex to Vector type.

std::string to_string() const

Returns a string representation of the object.

Return

String representation of the object.

const REAL &operator[](std::size_t index) const

Const operator[] overload allows easy access to x, y, z using intuitive syntax.

Return

Reference to the value at the index

Parameters
  • [in] index: Index to access

REAL &operator[](std::size_t index)

Operator[] overload allows easy access to x, y, z using intuitive syntax.

Return

Reference to the value at the index

Parameters
  • [in] index: Index to access

void operator=(const Vertex &v)

Assignment operator overload.

Parameters
  • [in] v: vertex to assign

bool operator==(const Vertex &rhs) const

Equivalence operator.

Return

True if all values are equal

Parameters
  • [in] rhs: The right hand side

bool operator!=(const Vertex &rhs) const

Inequivalence operator.

Return

True if not equal

Parameters
  • [in] rhs: The right hand side

Vertex &operator+=(const Vector &rhs)

Add a vector to the vertex.

Return

Vertex with sum of positions

Parameters
  • [in] rhs: The right hand side

Vertex &operator-=(const Vector &rhs)

Subtracts a vector from a vertex.

Return

Vertex with difference of positions

Parameters
  • [in] rhs: The right hand side

Vertex &operator*=(const REAL x)

Multiply the Vertex by a scalar.

Return

Post multiplied vertex

Parameters
  • [in] x: The scalar to multiply by

Vertex &operator/=(const REAL x)

Divide the Vertex by a scalar.

Return

Post divided vertex

Parameters
  • [in] x: Scalar to divide by

Public Members

Vector position

a 3 tensor for x, y, z

int marker = 0

Boundary marking ID.

bool selected = false

Selection flag.

Friends

std::ostream &operator<<(std::ostream &output, const Vertex &v)

Print operator overload.

Return

the stream

Parameters
  • output: stream to print to

  • [in] v: Vertex to print