#include <container.h>
Collaboration diagram for Container:
Public Member Functions | |
int | getVertexCount (void) const |
int | getFaceCount (void) const |
int | getEdgeCount (void) const |
void | boundWorld (void) |
void | writeSummary (std::ostream &) |
void | scanDir (void) |
void | scanFiles (void) |
void | assessFile (Object *const, char const *) |
void | scanFile (Object *const, char const *) |
void | computeVertexNormals (void) |
void | createEdges (void) |
void | findVertAdj (void) |
void | readFrozen (char const *) |
void | sortAdjacentFaces (void) |
void | deleteme_checkClosestFace (int const &, int const &, std::string) |
void | checkClosestFace (int const &, std::string) |
void | checkClosestFace2 (int const &, std::string) |
void | checkClosestFace3 (int const &, std::string) |
void | checkFaces (std::string) |
void | checkFacesInOctree (void) |
void | printRegionInOctree (void) |
void | writeMeshData (int const &) const |
void | findClosestFaceToEachVertex (void) |
void | findClosestPtInFaceToLocation (vector3 const &pt, Face const *const face, vector3 &p, double &squareD) const |
void | findPtInFaceWhereNormalInt (vector3 const &pt, vector3 n, double const &, Face const *const face, vector3 &p, double &squareD) const |
bool | faceLiesOppositeToNormal (vector3 const &, Face const *const face, vector3 const &n) const |
bool | boundingBoxFullyInSearchRegion (vec_d const &sr, vec_d const &bb) const |
bool | vertexOutsideOctreeBounds (vector3 const *const new_pos) |
bool | closestPtIsInSearchCone (vector3 const &pt, vector3 const &p, vector3 const &n, double const &) const |
bool | findClosestPtToBarycenterAmongFaces (vector3 const &, Face *const f, fp_cit, fp_cit, double const &cone_radius, vector3 &, double &, Face *&, int &) const |
bool | findClosestPtToVertexAmongFaces (Vertex const *const, fp_cit, fp_cit, double const &, vector3 &, double &, Face *&, int &) const |
bool | findClosestPtToVertex (Vertex const *const, vector3 &, double &, Face *&) const |
bool | findClosestPtToBarycenter (vector3 const &pt, Face *const f, vector3 &, double &, Face *&) const |
double | getMinEdgeAngle (void) const |
double | getWorld (int const &) const |
vec_d | getSphericalConeBoundingBox (vector3 const &pt, vector3 n, double const &cone_radius) const |
mmap_oi | loadMap (char const *, s_set &) |
Object * | getObjectPointer (std::string) const |
std::vector< Complex > | loadVector (const char *filename, s_set ¬_found) |
bool | vertexIsFrozen (Vertex *const v) const |
int | getFileCount (void) const |
Static Public Member Functions | |
static Container & | instance (void) |
Public Attributes | |
hxa7241_graphics::Octree< Face > * | octree |
vec_o | o |
Container & Container::instance | ( | void | ) | [static] |
int Container::getVertexCount | ( | void | ) | const |
Get the total number of vertices in the input data.
int Container::getFaceCount | ( | void | ) | const |
Get the total number of faces in the input data.
int Container::getEdgeCount | ( | void | ) | const |
Get the total number of edges in the input data.
void Container::boundWorld | ( | void | ) |
Calculate and record limits of model along each prinicpal axis.
void Container::writeSummary | ( | std::ostream & | target | ) |
Write description and summary of this class to output stream.
[in] | target | Pre-initialized output stream. |
void Container::scanDir | ( | void | ) |
Find all .mesh files in input directory.
void Container::scanFiles | ( | void | ) |
For each .mesh file found in input directory build an instance of object class.
void Container::assessFile | ( | Object * const | obj, | |
char const * | filename | |||
) |
Scan input data file once to count total number of vertices and faces in the object.
[in] | obj | Pointer to parent Object. |
[in] | filename | Input file name. |
void Container::scanFile | ( | Object * const | obj, | |
char const * | filename | |||
) |
void Container::computeVertexNormals | ( | void | ) |
Calculate and record the normal vector of each vertex in the model.
void Container::createEdges | ( | void | ) |
For each object build instance of edge class using face and vertex class data.
void Container::findVertAdj | ( | void | ) |
For each vertex in each object add pointers to adjacent faces of vertex to vertex class.
void Container::readFrozen | ( | char const * | filename | ) |
Process frozen vertex data.
[in] | filename | Frozen vertex file name. |
void Container::sortAdjacentFaces | ( | void | ) |
Sort adjacent faces of each vertex in model.
void Container::deleteme_checkClosestFace | ( | int const & | , | |
int const & | , | |||
std::string | ||||
) |
void Container::checkClosestFace | ( | int const & | group, | |
std::string | suffix | |||
) |
Find the closest face of each vertex in container and compare with closest face stored in vertex class.
[in] | group | Number of group of vertices being moved. |
[in] | suffix | String to append to file name to identify when in the program the file was written. |
void Container::checkClosestFace2 | ( | int const & | , | |
std::string | ||||
) |
void Container::checkClosestFace3 | ( | int const & | , | |
std::string | ||||
) |
void Container::checkFaces | ( | std::string | s | ) |
Check that all faces have flag set to false.
[in] | s | Error message if face found with flag set to true. |
void Container::checkFacesInOctree | ( | void | ) |
Check that all faces are present in appropriate octree cells.
void Container::printRegionInOctree | ( | void | ) |
Print octree overlapping region.
void Container::writeMeshData | ( | int const & | group | ) | const |
Write to file the current position of all mesh objects.
[in] | group | The current group number from meshmorph.cc. |
void Container::findClosestFaceToEachVertex | ( | void | ) |
Find and record the closest face to each vertex in the model.
void Container::findClosestPtInFaceToLocation | ( | vector3 const & | pt, | |
Face const *const | face, | |||
vector3 & | closest_point, | |||
double & | fSqrDistance | |||
) | const |
Find closest point in face to input location.
[in] | pt | Location of interest. |
[in] | face | Face on which closest point to input location will be identified. |
[out] | closest_point | Closest point position, if found. |
[out] | fSqrDistance | Squared distance between input location and closest point, if found. |
void Container::findPtInFaceWhereNormalInt | ( | vector3 const & | pt, | |
vector3 | n, | |||
double const & | cone_radius, | |||
Face const *const | face, | |||
vector3 & | intersection_point, | |||
double & | fSqrDistance | |||
) | const |
Find intersection point of vertex normal vector and input face.
[in] | pt | Location of interest. |
[in] | face | Face on which intersection point of normal vector will be identified. |
[out] | intersection_point | Intersection point position, if found. |
[out] | fSqrDistance | Squared distance between input location and intersection point, if found. |
bool Container::faceLiesOppositeToNormal | ( | vector3 const & | pt, | |
Face const *const | face, | |||
vector3 const & | nn | |||
) | const |
Determine if entire input face lies in hemispace opposite to normal vector at input location.
[in] | pt | Location of interest. |
[in] | face | Face of interest. |
[in] | nn | Normal vector of this face. |
Determine if input bounding box is fully inside the input search region.
[in] | sr | Search region [xmin,xmax,ymin,ymax,zmin,zmax]. |
[in] | bb | Bounding box [xmin,xmax,ymin,ymax,zmin,zmax]. |
bool Container::vertexOutsideOctreeBounds | ( | vector3 const *const | new_pos | ) |
Check if moved vertex has breached octree boundary.
[in] | new_pos | The new position of current vertex. |
bool Container::closestPtIsInSearchCone | ( | vector3 const & | pt, | |
vector3 const & | p, | |||
vector3 const & | n, | |||
double const & | sqd_sep_dist | |||
) | const |
Determine if closest point is inside search cone.
[in] | pt | Point of interest. |
[in] | p | Closest point of interest. |
[in] | n | Vertex normal vector. |
[in] | sqd_sep_dist | Squared distance between point and vertex. |
bool Container::findClosestPtToBarycenterAmongFaces | ( | vector3 const & | pt, | |
Face *const | f, | |||
fp_cit | begin, | |||
fp_cit | end, | |||
double const & | cone_radius, | |||
vector3 & | p, | |||
double & | squareD, | |||
Face *& | ncl, | |||
int & | faces_checked | |||
) | const |
Find closest point to tile's barycenter among input faces.
[in] | pt | Barycenter of face tile for which closest point is searched. |
[in] | f | Face on which tile is located. |
[in] | begin | Iterator pointing to first face in vector of faces to check. |
[in] | end | Iterator pointing to one past the last face in vector of faces to check. |
[out] | p | Closest point position, if found. |
[out] | squareD | Squared distance between vertex and closest point, if found. |
[out] | ncl | Parent face of closest point, if found. |
[out] | faces_checked | Cumulative number of faces checked. |
bool Container::findClosestPtToVertexAmongFaces | ( | Vertex const * const | v, | |
fp_cit | begin, | |||
fp_cit | end, | |||
double const & | cone_radius, | |||
vector3 & | p, | |||
double & | squareD, | |||
Face *& | ncl, | |||
int & | faces_checked | |||
) | const |
Find closest point to vertex among input faces.
[in] | v | Vertex of interest. |
[in] | begin | Iterator pointing to first face in vector of faces to check. |
[in] | end | Iterator pointing to one past the last face in vector of faces to check. |
[out] | p | Closest point position, if found. |
[out] | squareD | Squared distance between vertex and closest point, if found. |
[out] | ncl | Parent face of closest point, if found. |
[out] | faces_checked | Cumulative number of faces checked. |
bool Container::findClosestPtToVertex | ( | Vertex const * const | v, | |
vector3 & | p, | |||
double & | sqd, | |||
Face *& | ncl | |||
) | const |
Find the closest point to a vertex.
[in] | v | Vertex for which closest point is searched. |
[out] | p | Closest point position, if found. |
[out] | sqd | Squared distance between vertex and closest point, if found. |
[out] | ncl | Parent face of closest point, if found. |
bool Container::findClosestPtToBarycenter | ( | vector3 const & | pt, | |
Face *const | f, | |||
vector3 & | p, | |||
double & | sqd, | |||
Face *& | ncl | |||
) | const |
Find the closest point to a tile's barycenter.
[in] | pt | Barycenter of face tile for which closest point is searched. |
[in] | f | Face on which tile is located. |
[out] | p | Closest point position, if found. |
[out] | sqd | Squared distance between barycenter and closest point, if found. |
[out] | ncl | Parent face of closest point, if found. |
double Container::getMinEdgeAngle | ( | void | ) | const |
Find the edge in model with smallest angle and return angle.
double Container::getWorld | ( | int const & | axis | ) | const |
Return the world limit along input axis.
[in] | axis | Requested direction 0,1,2,3,4,5 == -x,+x,-y,+y,-z,+z. |
vec_d Container::getSphericalConeBoundingBox | ( | vector3 const & | pt, | |
vector3 | n, | |||
double const & | cone_radius | |||
) | const |
Compute axis-aligned bounding box of spherical cone.
[in] | pt | Point of interest. |
[in] | n | Normal vector at point of interest. |
[in] | cone_radius | Spherical cone radius. |
Object * Container::getObjectPointer | ( | std::string | name | ) | const |
Get pointer to object with matching name.
[in] | name | Name of object of interest. |
Parse input file of vertices (obejct name and vertex index) and store data.
[in] | filename | Input file name. |
[out] | not_found | Set of object names from file that were not found in input data. |
bool Container::vertexIsFrozen | ( | Vertex *const | v | ) | const [inline] |
Check if vertex is frozen.
[in] | v | Vertex of interest. |
int Container::getFileCount | ( | void | ) | const [inline] |
Get number of input mesh files.