75 Eigen::Vector3d
barycentric(
const Eigen::Vector2d &p)
const;
122 const circumcircle &
getCc()
const;
127 void setCc(
const circumcircle &
cc);
132 const std::vector<IMesh::edge> &
getEdges()
const;
Shallow class allowing Mesh to be imported in classes which Mesh owns.
Definition: IMesh.hpp:14
Class representing a polygon with 3 points and its member functions.
Definition: Triangle.hpp:17
double x
x coordinate of the circumcentre
Definition: Triangle.hpp:26
int getIndex() const
Accessor for private member index.
Definition: Triangle.cpp:17
std::vector< IMesh::edge > edges
Vector of edges making up the Triangle.
Definition: Triangle.hpp:42
Triangle(int index, IMesh *owner)
Constructor populating index and owner.
Definition: Triangle.hpp:54
const std::vector< IMesh::edge > & getEdges() const
Accessor for private member edges.
Definition: Triangle.cpp:183
const std::vector< double > & getAttributes() const
Accessor for private member attributes.
Definition: Triangle.cpp:43
const circumcircle & getCc() const
Accessor for private member cc.
Definition: Triangle.cpp:175
Eigen::Vector3d barycentric(const Eigen::Vector2d &p) const
Get the barycentric coordinates of a point in relation to the triangle.
Definition: Triangle.cpp:153
void setIndex(int i)
Mutator for private member index.
Definition: Triangle.cpp:21
bool circumcircleContainsPoint(const Eigen::Vector2d &p) const
Check if the circumcircle of the Triangle contains a point.
Definition: Triangle.cpp:132
~Triangle()
Default destructor.
Definition: Triangle.hpp:58
double area() const
Calculate the area of the triangle in 2d (x & y coords)
Definition: Triangle.cpp:216
const std::vector< int > & getVertices() const
Accessor for private member vertices.
Definition: Triangle.cpp:25
bool containsPoint(const Eigen::Vector2d &p) const
Check if the Triangle contains a point.
Definition: Triangle.cpp:169
bool operator!=(const Triangle &rhs) const
Non-equality operator.
Definition: Triangle.cpp:199
void setVertices(const std::vector< int > &vertices)
Mutator for private member vertices.
Definition: Triangle.cpp:29
double radius
radius of the circumcircle
Definition: Triangle.hpp:34
circumcircle cc
Circumcircle of the current triangle.
Definition: Triangle.hpp:38
friend std::istream & operator>>(std::istream &is, Triangle &triangle)
Input stream operator.
Definition: Triangle.cpp:51
int index
Index of the triangle (loaded from file)
Definition: Triangle.hpp:37
void setAttributes(const std::vector< double > &attributes)
Mutator for private member attributes.
Definition: Triangle.cpp:47
IMesh * getOwner() const
Accessor for private member owner.
Definition: Triangle.cpp:224
Triangle()
Default constructor.
Definition: Triangle.hpp:48
double y
y coordinate of the circumcentre
Definition: Triangle.hpp:30
IMesh * owner
Pointer to interface class of the Mesh the Triangle is part of.
Definition: Triangle.hpp:39
void setCc(const circumcircle &cc)
Mutator for private member cc.
Definition: Triangle.cpp:179
friend std::ostream & operator<<(std::ostream &os, Triangle &triangle)
Output stream operator.
Definition: Triangle.cpp:203
std::vector< double > attributes
Vector of attributes of the Triangle (16 points of precision)
Definition: Triangle.hpp:40
std::vector< IMesh::vertInd > vertices
Vector of vertex indices making up the Triangle.
Definition: Triangle.hpp:41
void calcCircumcircle()
Calculate the circumcircle of the Triangle.
Definition: Triangle.cpp:104
void setEdges(const std::vector< IMesh::edge > &edges)
Mutator for private member edges.
Definition: Triangle.cpp:187
bool operator==(const Triangle &rhs) const
Equality operator.
Definition: Triangle.cpp:191
Circumcircle object.
Definition: Triangle.hpp:22