ug4
|
#include <file_io_ugx.h>
Classes | |
struct | GridInfo |
struct | SubsetHandlerInfo |
struct | SubsetInfo |
Public Member Functions | |
bool | grid_has_edges (size_t gridInd) const |
bool | grid_has_faces (size_t gridInd) const |
bool | grid_has_vertices (size_t gridInd) const |
bool | grid_has_volumes (size_t gridInd) const |
std::string | grid_name (size_t gridInd) const |
size_t | grid_world_dimension (size_t gridInd) const |
Returns the dimension of the world-coordinates required for the given grid. More... | |
size_t | num_grids () const |
size_t | num_subset_handlers (size_t gridInd) const |
size_t | num_subsets (size_t gridInd, size_t shInd) const |
bool | parse_file (const char *filename) |
size_t | physical_grid_dimension (size_t gridInd) const |
Returns the physical dimension of the given grid. More... | |
std::string | subset_handler_name (size_t gridInd, size_t shInd) const |
std::string | subset_name (size_t gridInd, size_t shInd, size_t subsetInd) const |
size_t | topological_grid_dimension (size_t gridInd) const |
Returns the topological dimension of the given grid. More... | |
UGXFileInfo () | |
Private Member Functions | |
bool | calculate_vertex_node_bbox (rapidxml::xml_node<> *vrtNode, AABox< vector3 > &bb) const |
calculates the bounding box of a group of vertices More... | |
void | check_file_parsed () const |
throws an error if no file has been parsed yet More... | |
const GridInfo & | grid_info (size_t index) const |
return the queried grid info and throws an error if the grid index is out of range More... | |
std::string | node_name (rapidxml::xml_node<> *n) const |
returns the name-attribute of the node or "" if none exists More... | |
const SubsetHandlerInfo & | subset_handler_info (size_t gridInd, size_t shInd) const |
throws an error if the subset handler index is out of range More... | |
const SubsetInfo & | subset_info (size_t gridInd, size_t shInd, size_t subsetInd) const |
throws an error if the subset index is out of range. More... | |
Private Attributes | |
bool | m_fileParsed |
std::vector< GridInfo > | m_grids |
ug::UGXFileInfo::UGXFileInfo | ( | ) |
|
private |
calculates the bounding box of a group of vertices
[in] | vrtNode | node in the xml file (containing vertex information) |
[out] | bb | output bounding box |
References UG_ASSERT.
Referenced by parse_file().
|
private |
throws an error if no file has been parsed yet
References m_fileParsed, and UG_THROW.
Referenced by grid_info(), and num_grids().
bool ug::UGXFileInfo::grid_has_edges | ( | size_t | gridInd | ) | const |
References grid_info(), and ug::UGXFileInfo::GridInfo::m_hasEdges.
bool ug::UGXFileInfo::grid_has_faces | ( | size_t | gridInd | ) | const |
References grid_info(), and ug::UGXFileInfo::GridInfo::m_hasFaces.
bool ug::UGXFileInfo::grid_has_vertices | ( | size_t | gridInd | ) | const |
References grid_info(), and ug::UGXFileInfo::GridInfo::m_hasVertices.
bool ug::UGXFileInfo::grid_has_volumes | ( | size_t | gridInd | ) | const |
References grid_info(), and ug::UGXFileInfo::GridInfo::m_hasVolumes.
|
private |
return the queried grid info and throws an error if the grid index is out of range
Also calls check_file_parsed().
References check_file_parsed(), m_grids, and UG_THROW.
Referenced by grid_has_edges(), grid_has_faces(), grid_has_vertices(), grid_has_volumes(), grid_name(), num_subset_handlers(), physical_grid_dimension(), subset_handler_info(), and topological_grid_dimension().
std::string ug::UGXFileInfo::grid_name | ( | size_t | gridInd | ) | const |
References grid_info(), and ug::UGXFileInfo::GridInfo::m_name.
size_t ug::UGXFileInfo::grid_world_dimension | ( | size_t | gridInd | ) | const |
Returns the dimension of the world-coordinates required for the given grid.
We define the 'maximal range' as the maximum of the ranges of the the particular coordinates. Then the result is 3 - if the z-coordinate are in a range that is larger than SMALL times the maximal range; 2 - if it is not 3 and the y-coordinate are in a range that is larger than SMALL times the maximal range; 1 - if it is not 0 or 1 and the x-coordinate are in a range that is larger than SMALL times the maximal range; 0 - if it is not 3 or 2 or 1 (i.e. if the geometry resides in one point).
References physical_grid_dimension().
|
private |
returns the name-attribute of the node or "" if none exists
Referenced by parse_file().
size_t ug::UGXFileInfo::num_grids | ( | ) | const |
References check_file_parsed(), and m_grids.
size_t ug::UGXFileInfo::num_subset_handlers | ( | size_t | gridInd | ) | const |
References grid_info(), and ug::UGXFileInfo::GridInfo::m_subsetHandlers.
size_t ug::UGXFileInfo::num_subsets | ( | size_t | gridInd, |
size_t | shInd | ||
) | const |
References ug::UGXFileInfo::SubsetHandlerInfo::m_subsets, and subset_handler_info().
bool ug::UGXFileInfo::parse_file | ( | const char * | filename | ) |
References calculate_vertex_node_bbox(), ug::AABox< vector_t >::extension(), ug::FindFileInStandardPaths(), ug::UGXFileInfo::GridInfo::m_extension, m_fileParsed, m_grids, ug::UGXFileInfo::GridInfo::m_hasEdges, ug::UGXFileInfo::GridInfo::m_hasFaces, ug::UGXFileInfo::GridInfo::m_hasVertices, ug::UGXFileInfo::GridInfo::m_hasVolumes, ug::UGXFileInfo::SubsetInfo::m_name, ug::UGXFileInfo::SubsetHandlerInfo::m_name, ug::UGXFileInfo::GridInfo::m_name, ug::UGXFileInfo::GridInfo::m_subsetHandlers, ug::UGXFileInfo::SubsetHandlerInfo::m_subsets, node_name(), PROFILE_FUNC_GROUP, and UG_COND_THROW.
size_t ug::UGXFileInfo::physical_grid_dimension | ( | size_t | gridInd | ) | const |
Returns the physical dimension of the given grid.
We define the 'maximal range' as the maximum of the ranges of the the particular coordinates. Then the result is 3 - if the z-coordinate are in a range that is larger than SMALL times the maximal range; 2 - if it is not 3 and the y-coordinate are in a range that is larger than SMALL times the maximal range; 1 - if it is not 0 or 1 and the x-coordinate are in a range that is larger than SMALL times the maximal range; 0 - if it is not 3 or 2 or 1 (i.e. if the geometry resides in one point).
References grid_info(), ug::UGXFileInfo::GridInfo::m_extension, and ug::SMALL.
Referenced by grid_world_dimension().
|
private |
throws an error if the subset handler index is out of range
Also calls check_grid_index.
References grid_info(), ug::UGXFileInfo::GridInfo::m_subsetHandlers, and UG_THROW.
Referenced by num_subsets(), subset_handler_name(), and subset_info().
std::string ug::UGXFileInfo::subset_handler_name | ( | size_t | gridInd, |
size_t | shInd | ||
) | const |
References ug::UGXFileInfo::SubsetHandlerInfo::m_name, and subset_handler_info().
|
private |
throws an error if the subset index is out of range.
Also calls check_subset_handler_index.
References ug::UGXFileInfo::SubsetHandlerInfo::m_subsets, subset_handler_info(), and UG_THROW.
Referenced by subset_name().
std::string ug::UGXFileInfo::subset_name | ( | size_t | gridInd, |
size_t | shInd, | ||
size_t | subsetInd | ||
) | const |
References ug::UGXFileInfo::SubsetInfo::m_name, and subset_info().
size_t ug::UGXFileInfo::topological_grid_dimension | ( | size_t | gridInd | ) | const |
Returns the topological dimension of the given grid.
That is the dimension of the element of highest dimension in the given grid.
References grid_info(), ug::UGXFileInfo::GridInfo::m_hasEdges, ug::UGXFileInfo::GridInfo::m_hasFaces, and ug::UGXFileInfo::GridInfo::m_hasVolumes.
|
private |
Referenced by check_file_parsed(), and parse_file().
|
private |
Referenced by grid_info(), num_grids(), and parse_file().