Chaste
Build::
|
#include <Polygon.hpp>
Public Member Functions | |
Polygon (std::vector< boost::shared_ptr< DimensionalChastePoint< DIM > > > vertices) | |
Polygon (boost::shared_ptr< DimensionalChastePoint< DIM > > pVertex) | |
~Polygon () | |
void | AddVertices (std::vector< boost::shared_ptr< DimensionalChastePoint< DIM > > > vertices) |
void | AddVertex (boost::shared_ptr< DimensionalChastePoint< DIM > > pVertex) |
bool | ContainsPoint (const DimensionalChastePoint< DIM > &rLocation) |
std::vector< units::quantity< unit::length > > | GetBoundingBox () |
DimensionalChastePoint< DIM > | GetCentroid () |
units::quantity< unit::length > | GetDistance (const DimensionalChastePoint< DIM > &rLocation) |
units::quantity< unit::length > | GetDistanceToEdges (const DimensionalChastePoint< DIM > &rLocation) |
vtkSmartPointer< vtkPlane > | GetPlane () |
c_vector< double, DIM > | GetNormal () |
boost::shared_ptr< DimensionalChastePoint< DIM > > | GetVertex (unsigned idx) |
std::vector< boost::shared_ptr< DimensionalChastePoint< DIM > > > | GetVertices () |
vtkSmartPointer< vtkPolygon > | GetVtkPolygon () |
std::pair< vtkSmartPointer< vtkPoints >, vtkSmartPointer< vtkIdTypeArray > > | GetVtkVertices () |
void | ReplaceVertex (unsigned idx, boost::shared_ptr< DimensionalChastePoint< DIM > > pVertex) |
void | RotateAboutAxis (c_vector< double, 3 > axis, double angle) |
void | Translate (DimensionalChastePoint< DIM > translationVector) |
Static Public Member Functions | |
static boost::shared_ptr< Polygon > | Create (std::vector< boost::shared_ptr< DimensionalChastePoint< DIM > > > vertices) |
static boost::shared_ptr< Polygon > | Create (boost::shared_ptr< DimensionalChastePoint< DIM > > pVertex) |
Private Attributes | |
std::vector< boost::shared_ptr< DimensionalChastePoint< DIM > > > | mVertices |
units::quantity< unit::length > | mReferenceLength |
A collection of planar vertices, joined in the order they are added.
Definition at line 54 of file Polygon.hpp.
Polygon< DIM >::Polygon | ( | std::vector< boost::shared_ptr< DimensionalChastePoint< DIM > > > | vertices | ) |
Constructor
vertices | a vector of planar vertices, to be joined in the order they are added. |
Definition at line 44 of file Polygon.cpp.
Polygon< DIM >::Polygon | ( | boost::shared_ptr< DimensionalChastePoint< DIM > > | pVertex | ) |
Constructor
pVertex | a vertex |
Definition at line 52 of file Polygon.cpp.
References Polygon< DIM >::mVertices.
Desctructor
Definition at line 74 of file Polygon.cpp.
void Polygon< DIM >::AddVertex | ( | boost::shared_ptr< DimensionalChastePoint< DIM > > | pVertex | ) |
Add vertex
pVertex | a vertex to be added. It is best to add multiple vertices at once. |
Definition at line 86 of file Polygon.cpp.
References Polygon< DIM >::mVertices.
void Polygon< DIM >::AddVertices | ( | std::vector< boost::shared_ptr< DimensionalChastePoint< DIM > > > | vertices | ) |
Add vertices
vertices | a vector of planar vertices, to be joined in the order they are added. |
Definition at line 79 of file Polygon.cpp.
References Polygon< DIM >::mVertices.
bool Polygon< DIM >::ContainsPoint | ( | const DimensionalChastePoint< DIM > & | rLocation | ) |
Return true if the specified location is in the polygon, uses vtk point in polygon.
rLocation | the location to be tested |
Definition at line 273 of file Polygon.cpp.
References DimensionalChastePoint< DIM >::GetLocation(), Polygon< DIM >::GetVtkPolygon(), Polygon< DIM >::mReferenceLength, and Polygon< DIM >::mVertices.
|
static |
Factory constructor method
vertices | a vector of planar vertices, to be joined in the order they are added. |
Definition at line 60 of file Polygon.cpp.
Referenced by Part< DIM >::AddPolygon(), Part< DIM >::AddVesselNetwork(), Part< DIM >::Extrude(), VoronoiGenerator< DIM >::Generate(), and VesselSurfaceGenerator< DIM >::GetSurface().
|
static |
Factory constructor method
pVertex | a vertex |
Definition at line 67 of file Polygon.cpp.
std::vector< units::quantity< unit::length > > Polygon< DIM >::GetBoundingBox | ( | ) |
Return the bounding box of the polygon
Definition at line 165 of file Polygon.cpp.
References Polygon< DIM >::GetVtkPolygon(), and Polygon< DIM >::mReferenceLength.
DimensionalChastePoint< DIM > Polygon< DIM >::GetCentroid | ( | ) |
Return the centroid of the polygon
Definition at line 147 of file Polygon.cpp.
References Polygon< DIM >::GetVtkVertices(), and Polygon< DIM >::mReferenceLength.
Referenced by Polygon< DIM >::GetPlane().
units::quantity< unit::length > Polygon< DIM >::GetDistance | ( | const DimensionalChastePoint< DIM > & | rLocation | ) |
Return the distance to the polygon's plane
rLocation | the location of the point to get the distance from |
Definition at line 180 of file Polygon.cpp.
References DimensionalChastePoint< DIM >::GetLocation(), Polygon< DIM >::GetPlane(), and Polygon< DIM >::mReferenceLength.
units::quantity< unit::length > Polygon< DIM >::GetDistanceToEdges | ( | const DimensionalChastePoint< DIM > & | rLocation | ) |
Return the shortest distance to the polygon's edges
rLocation | the location of the point to get the distance from |
Definition at line 198 of file Polygon.cpp.
References DimensionalChastePoint< DIM >::GetLocation(), Polygon< DIM >::GetVtkPolygon(), and Polygon< DIM >::mReferenceLength.
c_vector< double, DIM > Polygon< DIM >::GetNormal | ( | ) |
Return the normal to the polygon, must have 3 or more points
Definition at line 243 of file Polygon.cpp.
References Polygon< DIM >::GetVtkVertices(), and Polygon< DIM >::mVertices.
Referenced by Polygon< DIM >::GetPlane().
vtkSmartPointer< vtkPlane > Polygon< DIM >::GetPlane | ( | ) |
Return the polygon's plane
Definition at line 224 of file Polygon.cpp.
References Polygon< DIM >::GetCentroid(), Polygon< DIM >::GetNormal(), and Polygon< DIM >::mReferenceLength.
Referenced by Polygon< DIM >::GetDistance().
boost::shared_ptr< DimensionalChastePoint< DIM > > Polygon< DIM >::GetVertex | ( | unsigned | idx | ) |
Return the vertices
idx | index of the vertex to return |
Definition at line 92 of file Polygon.cpp.
References Polygon< DIM >::mVertices.
std::vector< boost::shared_ptr< DimensionalChastePoint< DIM > > > Polygon< DIM >::GetVertices | ( | ) |
Return the vertices
Definition at line 105 of file Polygon.cpp.
References Polygon< DIM >::mVertices.
vtkSmartPointer< vtkPolygon > Polygon< DIM >::GetVtkPolygon | ( | ) |
Return a pointer to a VtkPolygon representation.
Definition at line 134 of file Polygon.cpp.
References Polygon< DIM >::GetVtkVertices().
Referenced by Polygon< DIM >::ContainsPoint(), Polygon< DIM >::GetBoundingBox(), and Polygon< DIM >::GetDistanceToEdges().
std::pair< vtkSmartPointer< vtkPoints >, vtkSmartPointer< vtkIdTypeArray > > Polygon< DIM >::GetVtkVertices | ( | ) |
Return the polygon vertices as a set of VtkPoints.
Definition at line 111 of file Polygon.cpp.
References Polygon< DIM >::mReferenceLength, and Polygon< DIM >::mVertices.
Referenced by Polygon< DIM >::GetCentroid(), Polygon< DIM >::GetNormal(), and Polygon< DIM >::GetVtkPolygon().
void Polygon< DIM >::ReplaceVertex | ( | unsigned | idx, |
boost::shared_ptr< DimensionalChastePoint< DIM > > | pVertex | ||
) |
Replace an exiting vertex with the passed in one.
idx | the index of the vertex to be replaced |
pVertex | the new vertex |
Definition at line 310 of file Polygon.cpp.
References Polygon< DIM >::mVertices.
void Polygon< DIM >::RotateAboutAxis | ( | c_vector< double, 3 > | axis, |
double | angle | ||
) |
Rotate about the specified axis by the specified angle
axis | the rotation axis |
angle | the rotation angle |
Definition at line 323 of file Polygon.cpp.
References Polygon< DIM >::mVertices.
void Polygon< DIM >::Translate | ( | DimensionalChastePoint< DIM > | translationVector | ) |
Move the polygon along the translation vector
translationVector | the new location is the original + the translationVector |
Definition at line 332 of file Polygon.cpp.
References Polygon< DIM >::mVertices.
|
private |
The reference length scale
Definition at line 65 of file Polygon.hpp.
Referenced by Polygon< DIM >::ContainsPoint(), Polygon< DIM >::GetBoundingBox(), Polygon< DIM >::GetCentroid(), Polygon< DIM >::GetDistance(), Polygon< DIM >::GetDistanceToEdges(), Polygon< DIM >::GetPlane(), and Polygon< DIM >::GetVtkVertices().
|
private |
The vertices of the polygon. They should be co-planar. Vertices should be unique, this is not ensured in the class.
Definition at line 60 of file Polygon.hpp.
Referenced by Polygon< DIM >::AddVertex(), Polygon< DIM >::AddVertices(), Polygon< DIM >::ContainsPoint(), Polygon< DIM >::GetNormal(), Polygon< DIM >::GetVertex(), Polygon< DIM >::GetVertices(), Polygon< DIM >::GetVtkVertices(), Polygon< DIM >::Polygon(), Polygon< DIM >::ReplaceVertex(), Polygon< DIM >::RotateAboutAxis(), and Polygon< DIM >::Translate().