V3FIT
vertex.hpp
1 //
2 // vertex.h
3 // lgrid
4 //
5 // Created by Cianciosa, Mark R. on 10/12/15.
6 // Copyright (c) 2015 Cianciosa, Mark R. All rights reserved.
7 //
8 
9 #ifndef vertex_hpp
10 #define vertex_hpp
11 
12 #include "vector3d.hpp"
13 #include <vector>
14 
15 //------------------------------------------------------------------------------
20 //------------------------------------------------------------------------------
21 class vertex {
23  const vector3d point;
24 
29 
30  public:
31 
32  vertex(const vector3d point_);
33  ~vertex();
34 
35  void insert(vertex *v);
36 
37  static const vector3d get_normal(const vertex &v1, const vertex &v2);
38  static const vector3d get_normal(const vertex &v1, const vertex &v2, const vertex &v3);
39 
40  static const double a(const vertex &v1, const vertex &v2);
41  static const double b(const vertex &v1, const vertex &v2);
42  static const double c(const vertex &v1, const vertex &v2);
43 
44  static const double x_min(const vertex &v1, const vertex &v2, const vector3d &p);
45  static const double y_min(const vertex &v1, const vertex &v2, const vector3d &p);
46 
47  static const double length(const vertex &v1, const vertex &v2, const vector3d &p);
48  static const double length(const vertex &v, const vector3d &p);
49 
50  static const bool in_range(const vertex &v1, const vertex &v2, const double x, const double y);
51 
52  static const double direction(const vertex &v, const vector3d &n, const vector3d &p);
53 
54  static void distance(vertex *start, const vector3d &p, std::vector<double> &d);
55 
56  static void print(vertex *start);
57 };
58 
59 #endif /* defined(vertex_hpp) */
vertex::y_min
static const double y_min(const vertex &v1, const vertex &v2, const vector3d &p)
Minimum distance in the y direction.
Definition: vertex.cpp:149
vertex::next
vertex * next
Vertex next vertex.
Definition: vertex.hpp:26
vertex::print
static void print(vertex *start)
Print out all vertices.
Definition: vertex.cpp:257
vertex::a
static const double a(const vertex &v1, const vertex &v2)
a coefficient.
Definition: vertex.cpp:92
vertex::b
static const double b(const vertex &v1, const vertex &v2)
b coefficient.
Definition: vertex.cpp:105
vertex
A vertex.
Definition: vertex.hpp:21
vertex::point
const vector3d point
Vertex point.
Definition: vertex.hpp:23
vertex::direction
static const double direction(const vertex &v, const vector3d &n, const vector3d &p)
Finds which side of the limiter face the point is on.
Definition: vertex.cpp:211
vector3d
A vector.
Definition: vector3d.hpp:19
vertex::vertex
vertex(const vector3d point_)
vertex constructor.
Definition: vertex.cpp:21
vertex::~vertex
~vertex()
vertex destructor.
Definition: vertex.cpp:32
vertex::length
static const double length(const vertex &v1, const vertex &v2, const vector3d &p)
Distance to a limiter face.
Definition: vertex.cpp:165
vertex::get_normal
static const vector3d get_normal(const vertex &v1, const vertex &v2)
Normal to a line.
Definition: vertex.cpp:60
vertex::in_range
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.
Definition: vertex.cpp:196
vertex::c
static const double c(const vertex &v1, const vertex &v2)
c coefficient.
Definition: vertex.cpp:118
vertex::distance
static void distance(vertex *start, const vector3d &p, std::vector< double > &d)
Find the distances to the limiter.
Definition: vertex.cpp:225
vertex::last
vertex * last
Vertex last vertex.
Definition: vertex.hpp:28
vertex::x_min
static const double x_min(const vertex &v1, const vertex &v2, const vector3d &p)
Minimum distance in the x direction.
Definition: vertex.cpp:133
vertex::insert
void insert(vertex *v)
Insert a new vertex.
Definition: vertex.cpp:44