Chaste
Build::
|
#include <Part.hpp>
Public Member Functions | |
Part () | |
~Part () | |
boost::shared_ptr< Polygon< DIM > > | AddCircle (units::quantity< unit::length > radius, DimensionalChastePoint< DIM > centre, unsigned numSegments=24) |
void | AddCylinder (units::quantity< unit::length > radius, units::quantity< unit::length > depth, DimensionalChastePoint< DIM > centre, unsigned numSegments=24) |
void | AddCuboid (units::quantity< unit::length > sizeX, units::quantity< unit::length > sizeY, units::quantity< unit::length > sizeZ, DimensionalChastePoint< DIM > origin) |
void | AddHoleMarker (DimensionalChastePoint< DIM > location) |
boost::shared_ptr< Polygon< DIM > > | AddPolygon (std::vector< boost::shared_ptr< DimensionalChastePoint< DIM > > > vertices, bool newFacet=false, boost::shared_ptr< Facet< DIM > > pFacet=boost::shared_ptr< Facet< DIM > >()) |
boost::shared_ptr< Polygon< DIM > > | AddPolygon (boost::shared_ptr< Polygon< DIM > > pPolygon, bool newFacet=false, boost::shared_ptr< Facet< DIM > > pFacet=boost::shared_ptr< Facet< DIM > >()) |
boost::shared_ptr< Polygon< DIM > > | AddRectangle (units::quantity< unit::length > sizeX, units::quantity< unit::length > sizeY, DimensionalChastePoint< DIM > origin) |
void | AddVesselNetwork (boost::shared_ptr< VesselNetwork< DIM > > pVesselNetwork, bool surface=false) |
void | BooleanWithNetwork (boost::shared_ptr< VesselNetwork< DIM > > pVesselNetwork) |
void | Extrude (boost::shared_ptr< Polygon< DIM > > pPolygon, units::quantity< unit::length > distance) |
std::vector< units::quantity< unit::length > > | GetBoundingBox () |
std::vector< unsigned > | GetContainingGridIndices (unsigned num_x, unsigned num_y, unsigned num_z, units::quantity< unit::length > spacing) |
std::vector< DimensionalChastePoint< DIM > > | GetHoleMarkers () |
std::vector< boost::shared_ptr< Facet< DIM > > > | GetFacets () |
boost::shared_ptr< Facet< DIM > > | GetFacet (const DimensionalChastePoint< DIM > &rLocation) |
std::vector< boost::shared_ptr< Polygon< DIM > > > | GetPolygons () |
units::quantity< unit::length > | GetReferenceLengthScale () |
std::vector< std::pair< unsigned, unsigned > > | GetSegmentIndices () |
std::vector< boost::shared_ptr< DimensionalChastePoint< DIM > > > | GetVertices () |
std::vector< DimensionalChastePoint< DIM > > | GetVertexLocations () |
vtkSmartPointer< vtkPolyData > | GetVtk () |
bool | IsPointInPart (DimensionalChastePoint< DIM > location) |
std::vector< bool > | IsPointInPart (const std::vector< DimensionalChastePoint< DIM > > &location) |
void | MergeCoincidentVertices () |
void | SetReferenceLengthScale (units::quantity< unit::length > referenceLength) |
void | Translate (DimensionalChastePoint< DIM > vector) |
void | Write (const std::string &rFilename, GeometryFormat::Value format=GeometryFormat::VTP) |
Static Public Member Functions | |
static boost::shared_ptr< Part< DIM > > | Create () |
Private Attributes | |
std::vector< boost::shared_ptr< Facet< DIM > > > | mFacets |
vtkSmartPointer< vtkPolyData > | mVtkPart |
std::vector< DimensionalChastePoint< DIM > > | mHoleMarkers |
std::vector< DimensionalChastePoint< DIM > > | mRegionMarkers |
units::quantity< unit::length > | mReferenceLength |
bool | mVtkIsUpToDate |
A geometric feature described using a PLC (piecewise linear complex) description (see the tetgen manual for details:http://wias-berlin.de/software/tetgen/). These descriptions allow parts to be meshed using triangle or tetgen.
boost::shared_ptr< Polygon< DIM > > Part< DIM >::AddCircle | ( | units::quantity< unit::length > | radius, |
DimensionalChastePoint< DIM > | centre, | ||
unsigned | numSegments = 24 |
||
) |
Add a circle to the part. If a target facet is not specified the default position is normal to the z-axis.
radius | the circle radius |
centre | the centre of the circle |
numSegments | the number of linear segments the circle is described with |
Definition at line 76 of file Part.cpp.
References Part< DIM >::AddPolygon(), DimensionalChastePoint< DIM >::GetLocation(), DimensionalChastePoint< DIM >::GetReferenceLengthScale(), Part< DIM >::mReferenceLength, and Part< DIM >::mVtkIsUpToDate.
Referenced by Part< DIM >::AddCylinder().
void Part< DIM >::AddCuboid | ( | units::quantity< unit::length > | sizeX, |
units::quantity< unit::length > | sizeY, | ||
units::quantity< unit::length > | sizeZ, | ||
DimensionalChastePoint< DIM > | origin | ||
) |
Add a cuboid to the part.
sizeX | the dimension in x |
sizeY | the dimension in y |
sizeZ | the dimension in z |
origin | the bottom, left, front corner |
Definition at line 111 of file Part.cpp.
References Part< DIM >::AddRectangle(), Part< DIM >::Extrude(), and Part< DIM >::mVtkIsUpToDate.
void Part< DIM >::AddCylinder | ( | units::quantity< unit::length > | radius, |
units::quantity< unit::length > | depth, | ||
DimensionalChastePoint< DIM > | centre, | ||
unsigned | numSegments = 24 |
||
) |
Add a cylinder to the part.
radius | the radius |
depth | the depth |
centre | the centre of the base |
numSegments | the number of line segments the base is described with |
Definition at line 100 of file Part.cpp.
References Part< DIM >::AddCircle(), Part< DIM >::Extrude(), and Part< DIM >::mVtkIsUpToDate.
void Part< DIM >::AddHoleMarker | ( | DimensionalChastePoint< DIM > | location | ) |
Add a hole marker to the part
location | the location of the hole |
Definition at line 122 of file Part.cpp.
References Part< DIM >::mHoleMarkers.
Referenced by Part< DIM >::AddVesselNetwork().
boost::shared_ptr< Polygon< DIM > > Part< DIM >::AddPolygon | ( | std::vector< boost::shared_ptr< DimensionalChastePoint< DIM > > > | vertices, |
bool | newFacet = false , |
||
boost::shared_ptr< Facet< DIM > > | pFacet = boost::shared_ptr<Facet<DIM> >() |
||
) |
Add a polygon described by a vector or vertices. The vertices should be planar. This is not checked.
vertices | a vector of vertices making up the polygon |
newFacet | whether to add a new facet |
pFacet | an optional facet that the circle can be generated on |
Definition at line 128 of file Part.cpp.
References Polygon< DIM >::Create(), and Part< DIM >::mVtkIsUpToDate.
Referenced by Part< DIM >::AddCircle(), Part< DIM >::AddRectangle(), and VesselSurfaceGenerator< DIM >::GetVtkSurface().
boost::shared_ptr< Polygon< DIM > > Part< DIM >::AddPolygon | ( | boost::shared_ptr< Polygon< DIM > > | pPolygon, |
bool | newFacet = false , |
||
boost::shared_ptr< Facet< DIM > > | pFacet = boost::shared_ptr<Facet<DIM> >() |
||
) |
Add a polygon
pPolygon | a polygon to add to the part |
newFacet | whether to add a new facet |
pFacet | an optional facet that the polygon can be generated on |
Definition at line 138 of file Part.cpp.
References Part< DIM >::mFacets, and Part< DIM >::mVtkIsUpToDate.
boost::shared_ptr< Polygon< DIM > > Part< DIM >::AddRectangle | ( | units::quantity< unit::length > | sizeX, |
units::quantity< unit::length > | sizeY, | ||
DimensionalChastePoint< DIM > | origin | ||
) |
Add a rectangle to the part, oriented by default with out of plane direction along the z-axis.
sizeX | the dimension in the x direction |
sizeY | the dimension in the y direction |
origin | the bottom left corner |
Definition at line 161 of file Part.cpp.
References Part< DIM >::AddPolygon(), DimensionalChastePoint< DIM >::GetLocation(), Part< DIM >::mReferenceLength, and Part< DIM >::mVtkIsUpToDate.
Referenced by Part< DIM >::AddCuboid().
void Part< DIM >::AddVesselNetwork | ( | boost::shared_ptr< VesselNetwork< DIM > > | pVesselNetwork, |
bool | surface = false |
||
) |
Add a vessel network to the part.
pVesselNetwork | the vessel network to be added |
surface | true if a surface representation of the network is required |
Definition at line 189 of file Part.cpp.
References Part< DIM >::AddHoleMarker(), Polygon< DIM >::Create(), VesselSurfaceGenerator< DIM >::GetHoles(), VesselSurfaceGenerator< DIM >::GetSurfacePolygons(), Part< DIM >::mFacets, and Part< DIM >::mVtkIsUpToDate.
void Part< DIM >::BooleanWithNetwork | ( | boost::shared_ptr< VesselNetwork< DIM > > | pVesselNetwork | ) |
Remove vessels outside the part
pVesselNetwork | the vessel network to be pruned |
Definition at line 323 of file Part.cpp.
References Part< DIM >::IsPointInPart().
Factory constructor method
Definition at line 63 of file Part.cpp.
Referenced by VoronoiGenerator< DIM >::Generate(), MappableGridGenerator::GeneratePlane(), VesselNetworkGenerator< DIM >::SetReferenceLengthScale(), and Owen11CellPopulationGenerator< DIM >::Update().
void Part< DIM >::Extrude | ( | boost::shared_ptr< Polygon< DIM > > | pPolygon, |
units::quantity< unit::length > | distance | ||
) |
Extrude the part along the z-axis, inserting planar faces in place of edges.
pPolygon | the polygon to extrude |
distance | the extrusion distance |
Definition at line 274 of file Part.cpp.
References Polygon< DIM >::Create(), Part< DIM >::mFacets, Part< DIM >::mReferenceLength, and Part< DIM >::mVtkIsUpToDate.
Referenced by Part< DIM >::AddCuboid(), and Part< DIM >::AddCylinder().
std::vector< units::quantity< unit::length > > Part< DIM >::GetBoundingBox | ( | ) |
Return the bounding box
Definition at line 433 of file Part.cpp.
References Part< DIM >::GetVertices(), and Part< DIM >::mReferenceLength.
std::vector< unsigned > Part< DIM >::GetContainingGridIndices | ( | unsigned | num_x, |
unsigned | num_y, | ||
unsigned | num_z, | ||
units::quantity< unit::length > | spacing | ||
) |
Return the indices of the grid that are inside the part
num_x | number of grid points in x |
num_y | number of grid points in y |
num_z | number of grid points in z |
spacing | the grid spacing |
Definition at line 386 of file Part.cpp.
References Part< DIM >::IsPointInPart(), and Part< DIM >::mReferenceLength.
boost::shared_ptr< Facet< DIM > > Part< DIM >::GetFacet | ( | const DimensionalChastePoint< DIM > & | rLocation | ) |
Return the FIRST facet found on the point. Strict method, returns exception if there is no facet at the point.
rLocation | the probe point |
Definition at line 351 of file Part.cpp.
References Part< DIM >::mFacets.
Return the facets
Definition at line 472 of file Part.cpp.
References Part< DIM >::mFacets.
std::vector< DimensionalChastePoint< DIM > > Part< DIM >::GetHoleMarkers | ( | ) |
Return the hole marker locations
Definition at line 339 of file Part.cpp.
References Part< DIM >::mHoleMarkers.
std::vector< boost::shared_ptr< Polygon< DIM > > > Part< DIM >::GetPolygons | ( | ) |
Return the polygons
Definition at line 421 of file Part.cpp.
References Part< DIM >::mFacets.
Referenced by Part< DIM >::GetVertices(), Part< DIM >::GetVtk(), and Part< DIM >::MergeCoincidentVertices().
units::quantity< unit::length > Part< DIM >::GetReferenceLengthScale | ( | ) |
Return the reference length scale
Definition at line 345 of file Part.cpp.
References Part< DIM >::mReferenceLength.
std::vector< std::pair< unsigned, unsigned > > Part< DIM >::GetSegmentIndices | ( | ) |
Return the segment indexes, used for 2D meshing
Definition at line 478 of file Part.cpp.
References Part< DIM >::GetVertices(), and Part< DIM >::mFacets.
std::vector< DimensionalChastePoint< DIM > > Part< DIM >::GetVertexLocations | ( | ) |
Return the vertex locations
Definition at line 409 of file Part.cpp.
References Part< DIM >::GetVertices().
std::vector< boost::shared_ptr< DimensionalChastePoint< DIM > > > Part< DIM >::GetVertices | ( | ) |
Return the unique vertices
Definition at line 364 of file Part.cpp.
References Part< DIM >::GetPolygons().
Referenced by Part< DIM >::GetBoundingBox(), Part< DIM >::GetSegmentIndices(), Part< DIM >::GetVertexLocations(), and Part< DIM >::Translate().
vtkSmartPointer< vtkPolyData > Part< DIM >::GetVtk | ( | ) |
Return the a vtk polydata representation of the part
Definition at line 511 of file Part.cpp.
References Part< DIM >::GetPolygons(), Part< DIM >::mReferenceLength, Part< DIM >::mVtkIsUpToDate, and Part< DIM >::mVtkPart.
Referenced by VesselSurfaceGenerator< DIM >::GetVtkSurface(), Part< DIM >::IsPointInPart(), and Part< DIM >::Write().
bool Part< DIM >::IsPointInPart | ( | DimensionalChastePoint< DIM > | location | ) |
Is the point inside the part
location | the location of the point |
Definition at line 564 of file Part.cpp.
References DimensionalChastePoint< DIM >::GetLocation(), Part< DIM >::GetVtk(), and Part< DIM >::mReferenceLength.
Referenced by Part< DIM >::BooleanWithNetwork(), and Part< DIM >::GetContainingGridIndices().
std::vector< bool > Part< DIM >::IsPointInPart | ( | const std::vector< DimensionalChastePoint< DIM > > & | location | ) |
Is the point inside the part
location | the location of the point |
Definition at line 599 of file Part.cpp.
References Part< DIM >::GetVtk(), and Part< DIM >::mReferenceLength.
void Part< DIM >::MergeCoincidentVertices | ( | ) |
Merge vertices that overlap in polygons and facets
Definition at line 644 of file Part.cpp.
References Part< DIM >::GetPolygons(), Part< DIM >::mFacets, and Part< DIM >::mVtkIsUpToDate.
void Part< DIM >::SetReferenceLengthScale | ( | units::quantity< unit::length > | referenceLength | ) |
Set the reference length scale
referenceLength | the reference length scale |
Definition at line 678 of file Part.cpp.
References Part< DIM >::mReferenceLength, and Part< DIM >::mVtkIsUpToDate.
void Part< DIM >::Translate | ( | DimensionalChastePoint< DIM > | vector | ) |
Move the part along the translation vector
vector | the vector to move the part along |
Definition at line 685 of file Part.cpp.
References Part< DIM >::GetVertices(), and Part< DIM >::mVtkIsUpToDate.
void Part< DIM >::Write | ( | const std::string & | rFilename, |
GeometryFormat::Value | format = GeometryFormat::VTP |
||
) |
Write the part to file in vtk format
rFilename | the path to the file to be written, without extension |
format | the output format |
Definition at line 698 of file Part.cpp.
References Part< DIM >::GetVtk(), GeometryWriter::SetFileName(), GeometryWriter::SetInput(), GeometryWriter::SetOutputFormat(), and GeometryWriter::Write().
Planar collections of polygons
Definition at line 65 of file Part.hpp.
Referenced by Part< DIM >::AddPolygon(), Part< DIM >::AddVesselNetwork(), Part< DIM >::Extrude(), Part< DIM >::GetFacet(), Part< DIM >::GetFacets(), Part< DIM >::GetPolygons(), Part< DIM >::GetSegmentIndices(), and Part< DIM >::MergeCoincidentVertices().
|
private |
The locations of hole markers (see PLC definition)
Definition at line 75 of file Part.hpp.
Referenced by Part< DIM >::AddHoleMarker(), and Part< DIM >::GetHoleMarkers().
|
private |
The reference length scale
Definition at line 85 of file Part.hpp.
Referenced by Part< DIM >::AddCircle(), Part< DIM >::AddRectangle(), Part< DIM >::Extrude(), Part< DIM >::GetBoundingBox(), Part< DIM >::GetContainingGridIndices(), Part< DIM >::GetReferenceLengthScale(), Part< DIM >::GetVtk(), Part< DIM >::IsPointInPart(), and Part< DIM >::SetReferenceLengthScale().
|
private |
Is the vtk representation up-to-date
Definition at line 90 of file Part.hpp.
Referenced by Part< DIM >::AddCircle(), Part< DIM >::AddCuboid(), Part< DIM >::AddCylinder(), Part< DIM >::AddPolygon(), Part< DIM >::AddRectangle(), Part< DIM >::AddVesselNetwork(), Part< DIM >::Extrude(), Part< DIM >::GetVtk(), Part< DIM >::MergeCoincidentVertices(), Part< DIM >::SetReferenceLengthScale(), and Part< DIM >::Translate().
|
private |
A vtk representation of the part
Definition at line 70 of file Part.hpp.
Referenced by Part< DIM >::GetVtk().