V3FIT
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
vertex Class Reference

A vertex. More...

#include <vertex.hpp>

Public Member Functions

 vertex (const vector3d point_)
 vertex constructor. More...
 
 ~vertex ()
 vertex destructor. More...
 
void insert (vertex *v)
 Insert a new vertex. More...
 

Static Public Member Functions

static const vector3d get_normal (const vertex &v1, const vertex &v2)
 Normal to a line. More...
 
static const vector3d get_normal (const vertex &v1, const vertex &v2, const vertex &v3)
 Normal to a line. More...
 
static const double a (const vertex &v1, const vertex &v2)
 a coefficient. More...
 
static const double b (const vertex &v1, const vertex &v2)
 b coefficient. More...
 
static const double c (const vertex &v1, const vertex &v2)
 c coefficient. More...
 
static const double x_min (const vertex &v1, const vertex &v2, const vector3d &p)
 Minimum distance in the x direction. More...
 
static const double y_min (const vertex &v1, const vertex &v2, const vector3d &p)
 Minimum distance in the y direction. More...
 
static const double length (const vertex &v1, const vertex &v2, const vector3d &p)
 Distance to a limiter face. More...
 
static const double length (const vertex &v, const vector3d &p)
 Distance to a vertex. More...
 
static const bool in_range (const vertex &v1, const vertex &v2, const double x, const double y)
 Finds if the line to the point is in range. More...
 
static const double direction (const vertex &v, const vector3d &n, const vector3d &p)
 Finds which side of the limiter face the point is on. More...
 
static void distance (vertex *start, const vector3d &p, std::vector< double > &d)
 Find the distances to the limiter. More...
 
static void print (vertex *start)
 Print out all vertices. More...
 

Private Attributes

const vector3d point
 Vertex point.
 
vertexnext
 Vertex next vertex.
 
vertexlast
 Vertex last vertex.
 

Detailed Description

A vertex.

Class representing a vertex. Verticies are doublely linked lists containing the current vector position.

Definition at line 21 of file vertex.hpp.

Constructor & Destructor Documentation

◆ vertex()

vertex::vertex ( const vector3d  point_)

vertex constructor.

Constructs a single vertex at a point.

Parameters
[in]point_Current point to the vertex.

Definition at line 21 of file vertex.cpp.

◆ ~vertex()

vertex::~vertex ( )

vertex destructor.

Destructs the current vertext and calls the destructor on the next vertex if it exists.

Definition at line 32 of file vertex.cpp.

Member Function Documentation

◆ a()

const double vertex::a ( const vertex v1,
const vertex v2 
)
static

a coefficient.

Coefficient to find used to find the distance from a point to a line.

Parameters
[in]v1First vertex.
[in]v2Second vertex.
Returns
The a coefficient

Definition at line 92 of file vertex.cpp.

◆ b()

const double vertex::b ( const vertex v1,
const vertex v2 
)
static

b coefficient.

Coefficient to find used to find the distance from a point to a line.

Parameters
[in]v1First vertex.
[in]v2Second vertex.
Returns
The b coefficient

Definition at line 105 of file vertex.cpp.

◆ c()

const double vertex::c ( const vertex v1,
const vertex v2 
)
static

c coefficient.

Coefficient to find used to find the distance from a point to a line.

Parameters
[in]v1First vertex.
[in]v2Second vertex.
Returns
The c coefficient

Definition at line 118 of file vertex.cpp.

◆ direction()

const double vertex::direction ( const vertex v,
const vector3d n,
const vector3d p 
)
static

Finds which side of the limiter face the point is on.

A point is in range when the line normal to the limiter face that intersects the point is between the two verticies.

Parameters
[in]vFirst vertex.
[in]nVector normal to the vertex.
[in]pPoint of interest.
Returns
The length to a from a point to the line.

Definition at line 211 of file vertex.cpp.

◆ distance()

void vertex::distance ( vertex start,
const vector3d p,
std::vector< double > &  d 
)
static

Find the distances to the limiter.

Find the minimum distance to reach in range limiter face and joint between limiter faces.

Parameters
[in]startInital vertex.
[in]pPoint of interest.
[out]dMinimum distances to the limiter face.

Definition at line 225 of file vertex.cpp.

◆ get_normal() [1/2]

const vector3d vertex::get_normal ( const vertex v1,
const vertex v2 
)
static

Normal to a line.

Gets the normal to a line defined by two verices.

Parameters
[in]v1First vertex.
[in]v2Second vertex.
Returns
The normal at a face.

Definition at line 60 of file vertex.cpp.

◆ get_normal() [2/2]

const vector3d vertex::get_normal ( const vertex v1,
const vertex v2,
const vertex v3 
)
static

Normal to a line.

Normal to a line defined by the intersection of two lines. This is the average of the normals of the two lines.

Parameters
[in]v1First vertex.
[in]v2Second vertex.
[in]v3Third vertex.
Returns
The normal at a corner.

Definition at line 76 of file vertex.cpp.

◆ in_range()

const bool vertex::in_range ( const vertex v1,
const vertex v2,
const double  x,
const double  y 
)
static

Finds if the line to the point is in range.

A point is in range when the line normal to the limiter face that intersects the point is between the two verticies.

Parameters
[in]v1First vertex.
[in]v2Second vertex.
[in]xX position of the point.
[in]yY position of the point.
Returns
The length to a from a point to the line.

Definition at line 196 of file vertex.cpp.

◆ insert()

void vertex::insert ( vertex v)

Insert a new vertex.

Inserts a new vertex between the current instance the next instance.

Definition at line 44 of file vertex.cpp.

◆ length() [1/2]

const double vertex::length ( const vertex v,
const vector3d p 
)
static

Distance to a vertex.

The length of a line from a point to the vertex.

Parameters
[in]vFirst vertex.
[in]pPoint of interest.
Returns
The length to a from a point to the line.

Definition at line 180 of file vertex.cpp.

◆ length() [2/2]

const double vertex::length ( const vertex v1,
const vertex v2,
const vector3d p 
)
static

Distance to a limiter face.

The length of the line from a point to the limiter face.

Parameters
[in]v1First vertex.
[in]v2Second vertex.
[in]pPoint of interest.
Returns
The length to a from a point to the line.

Definition at line 165 of file vertex.cpp.

◆ print()

void vertex::print ( vertex start)
static

Print out all vertices.

Prints out information on each vertex.

Parameters
[in]startInital vertex.

Definition at line 257 of file vertex.cpp.

◆ x_min()

const double vertex::x_min ( const vertex v1,
const vertex v2,
const vector3d p 
)
static

Minimum distance in the x direction.

The minimum x along the line to the point.

Parameters
[in]v1First vertex.
[in]v2Second vertex.
[in]pPoint of interest.
Returns
The minimum x along the line to the point.

Definition at line 133 of file vertex.cpp.

◆ y_min()

const double vertex::y_min ( const vertex v1,
const vertex v2,
const vector3d p 
)
static

Minimum distance in the y direction.

The minimum y along the line to the point.

Parameters
[in]v1First vertex.
[in]v2Second vertex.
[in]pPoint of interest.
Returns
The minimum y along the line to the point.

Definition at line 149 of file vertex.cpp.


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