ug4
|
Grants read access to ugx files. More...
#include <file_io_ugx.h>
Classes | |
struct | GridEntry |
struct | SelectorEntry |
struct | SubsetHandlerEntry |
Public Member Functions | |
const char * | get_grid_name (size_t index) const |
returns the name of the i-th grid More... | |
const char * | get_projection_handler_name (size_t refGridIndex, size_t phIndex) const |
returns the name of the given projection-handler More... | |
size_t | get_projection_handler_subset_handler_index (size_t phIndex, size_t refGridIndex) |
returns the subset handler index for a projection handler More... | |
const char * | get_selector_name (size_t refGridIndex, size_t selectorIndex) const |
returns the name of the given selector More... | |
const char * | get_subset_handler_name (size_t refGridIndex, size_t subsetHandlerIndex) const |
returns the name of the given subset handler More... | |
template<class TPositionAttachment > | |
bool | grid (Grid &gridOut, size_t index, TPositionAttachment &aPos) |
returns the i-th grid. More... | |
GridReaderUGX () | |
size_t | num_grids () const |
returns the number of grids More... | |
size_t | num_projection_handlers (size_t refGridIndex) const |
returns the number of projection-handlers for the given grid More... | |
size_t | num_selectors (size_t refGridIndex) const |
returns the number of selectors for the given grid More... | |
size_t | num_subset_handlers (size_t refGridIndex) const |
returns the number of subset handlers for the given grid More... | |
bool | parse_file (const char *filename) |
parses an xml file More... | |
bool | projection_handler (ProjectionHandler &phOut, size_t phIndex, size_t refGridIndex) |
fills the given projection-handler More... | |
bool | selector (ISelector &selOut, size_t selectorIndex, size_t refGridIndex) |
fills the given selector More... | |
bool | subset_handler (ISubsetHandler &shOut, size_t subsetHandlerIndex, size_t refGridIndex) |
fills the given subset-handler More... | |
virtual | ~GridReaderUGX () |
Protected Member Functions | |
bool | create_constrained_edges (std::vector< Edge * > &edgesOut, std::vector< std::pair< int, int > > &constrainingObjsOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
bool | create_constrained_quadrilaterals (std::vector< Face * > &facesOut, std::vector< std::pair< int, int > > &constrainingObjsOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
bool | create_constrained_triangles (std::vector< Face * > &facesOut, std::vector< std::pair< int, int > > &constrainingObjsOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
template<class TAAPos > | |
bool | create_constrained_vertices (std::vector< Vertex * > &vrtsOut, std::vector< std::pair< int, int > > &constrainingObjsOut, Grid &grid, rapidxml::xml_node<> *vrtNode, TAAPos aaPos) |
bool | create_constraining_edges (std::vector< Edge * > &edgesOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
bool | create_constraining_quadrilaterals (std::vector< Face * > &facesOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
bool | create_constraining_triangles (std::vector< Face * > &facesOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
bool | create_edges (std::vector< Edge * > &edgesOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
bool | create_hexahedrons (std::vector< Volume * > &volsOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
bool | create_octahedrons (std::vector< Volume * > &volsOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
bool | create_prisms (std::vector< Volume * > &volsOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
bool | create_pyramids (std::vector< Volume * > &volsOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
bool | create_quadrilaterals (std::vector< Face * > &facesOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
bool | create_tetrahedrons (std::vector< Volume * > &volsOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
bool | create_triangles (std::vector< Face * > &facesOut, Grid &grid, rapidxml::xml_node<> *node, std::vector< Vertex * > &vrts) |
template<class TAAPos > | |
bool | create_vertices (std::vector< Vertex * > &vrtsOut, Grid &grid, rapidxml::xml_node<> *vrtNode, TAAPos aaPos) |
creates vertices from a vertex-node. More... | |
virtual bool | new_document_parsed () |
initializes internal arrays More... | |
template<class TElem > | |
bool | read_attachment (Grid &grid, rapidxml::xml_node<> *node) |
SPRefinementProjector | read_projector (rapidxml::xml_node<> *projNode) |
template<class TGeomObj > | |
bool | read_selector_elements (ISelector &selOut, const char *elemNodeName, rapidxml::xml_node<> *selNode, std::vector< TGeomObj * > &vElems) |
template<class TGeomObj > | |
bool | read_subset_handler_elements (ISubsetHandler &shOut, const char *elemNodeName, rapidxml::xml_node<> *subsetNode, int subsetIndex, std::vector< TGeomObj * > &vElems) |
Protected Attributes | |
rapidxml::xml_document | m_doc |
the xml_document which stores the data More... | |
std::vector< GridEntry > | m_entries |
holds grids which already have been created More... | |
Grants read access to ugx files.
Before any data can be retrieved using the get_* methods, a file has to be successfully loaded using load_file.
ug::GridReaderUGX::GridReaderUGX | ( | ) |
|
virtual |
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
References ug::Grid::create(), and ug::ConstrainedVertex::set_local_coordinates().
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
References ug::Grid::create(), and UG_LOG.
|
protected |
creates vertices from a vertex-node.
if aaPos has more coordinates per vertex than the vrtNode, 0's will be appended. If it has less, unused coordinates will be ignored.
References ug::Grid::create().
const char * ug::GridReaderUGX::get_grid_name | ( | size_t | index | ) | const |
returns the name of the i-th grid
const char * ug::GridReaderUGX::get_projection_handler_name | ( | size_t | refGridIndex, |
size_t | phIndex | ||
) | const |
returns the name of the given projection-handler
References ug::GridReaderUGX::GridEntry::projectionHandlerEntries, and UG_COND_THROW.
size_t ug::GridReaderUGX::get_projection_handler_subset_handler_index | ( | size_t | phIndex, |
size_t | refGridIndex | ||
) |
returns the subset handler index for a projection handler
References ug::GridReaderUGX::GridEntry::projectionHandlerEntries, and UG_COND_THROW.
Referenced by ug::LoadGridFromUGX().
const char * ug::GridReaderUGX::get_selector_name | ( | size_t | refGridIndex, |
size_t | selectorIndex | ||
) | const |
returns the name of the given selector
References ug::GridReaderUGX::GridEntry::selectorEntries, and UG_COND_THROW.
const char * ug::GridReaderUGX::get_subset_handler_name | ( | size_t | refGridIndex, |
size_t | subsetHandlerIndex | ||
) | const |
returns the name of the given subset handler
References ug::GridReaderUGX::GridEntry::subsetHandlerEntries.
Referenced by ug::LoadGridFromUGX().
bool ug::GridReaderUGX::grid | ( | Grid & | gridOut, |
size_t | index, | ||
TPositionAttachment & | aPos | ||
) |
returns the i-th grid.
TPositionAttachments value type has to be compatible with MathVector. Make sure that a file has already been loaded.
References ug::ConstrainingEdge::add_constrained_object(), ug::ConstrainingFace::add_constrained_object(), ug::Grid::attach_to_vertices(), ug::Grid::begin(), ug::Grid::get_options(), ug::GRIDOPT_NONE, ug::Grid::has_vertex_attachment(), name, ug::ConstrainedVertex::set_constraining_object(), ug::ConstrainedEdge::set_constraining_object(), ug::ConstrainedFace::set_constraining_object(), ug::Grid::set_options(), UG_LOG, and boost::vertices().
Referenced by ug::LoadGridFromUGX().
|
protectedvirtual |
initializes internal arrays
searches for all grid-nodes and stores, resizes m_entries and stores the node for each entry.
If you create your own version of this method, don't forget to call the base-class implementation!
References ug::GridReaderUGX::GridEntry::projectionHandlerEntries, ug::GridReaderUGX::GridEntry::selectorEntries, and ug::GridReaderUGX::GridEntry::subsetHandlerEntries.
|
inline |
size_t ug::GridReaderUGX::num_projection_handlers | ( | size_t | refGridIndex | ) | const |
returns the number of projection-handlers for the given grid
References UG_COND_THROW.
Referenced by ug::LoadGridFromUGX().
size_t ug::GridReaderUGX::num_selectors | ( | size_t | refGridIndex | ) | const |
returns the number of selectors for the given grid
References UG_COND_THROW.
size_t ug::GridReaderUGX::num_subset_handlers | ( | size_t | refGridIndex | ) | const |
returns the number of subset handlers for the given grid
References UG_LOG.
Referenced by ug::LoadGridFromUGX().
bool ug::GridReaderUGX::parse_file | ( | const char * | filename | ) |
parses an xml file
Referenced by ug::LoadGridFromUGX().
bool ug::GridReaderUGX::projection_handler | ( | ProjectionHandler & | phOut, |
size_t | phIndex, | ||
size_t | refGridIndex | ||
) |
fills the given projection-handler
References ug::GridReaderUGX::GridEntry::projectionHandlerEntries, ug::ProjectionHandler::set_default_projector(), ug::ProjectionHandler::set_projector(), UG_COND_THROW, and SmartPtr< T, FreePolicy >::valid().
Referenced by ug::LoadGridFromUGX().
|
protected |
|
protected |
|
protected |
References ug::ISelector::select(), and UG_LOG.
|
protected |
References ug::ISubsetHandler::assign_subset(), and UG_LOG.
bool ug::GridReaderUGX::selector | ( | ISelector & | selOut, |
size_t | selectorIndex, | ||
size_t | refGridIndex | ||
) |
fills the given selector
References ug::GridReaderUGX::GridEntry::edges, ug::ISelector::elements_are_supported(), ug::GridReaderUGX::GridEntry::faces, ug::GridReaderUGX::SelectorEntry::node, ug::GridReaderUGX::SelectorEntry::sel, ug::GridReaderUGX::GridEntry::selectorEntries, ug::SHE_EDGE, ug::SHE_FACE, ug::SHE_VERTEX, ug::SHE_VOLUME, UG_LOG, ug::GridReaderUGX::GridEntry::vertices, and ug::GridReaderUGX::GridEntry::volumes.
bool ug::GridReaderUGX::subset_handler | ( | ISubsetHandler & | shOut, |
size_t | subsetHandlerIndex, | ||
size_t | refGridIndex | ||
) |
fills the given subset-handler
References ug::SubsetInfo::color, ug::GridReaderUGX::GridEntry::edges, ug::ISubsetHandler::elements_are_supported(), ug::GridReaderUGX::GridEntry::faces, ug::SubsetInfo::name, ug::GridReaderUGX::SubsetHandlerEntry::node, ug::ISubsetHandler::set_subset_info(), ug::GridReaderUGX::SubsetHandlerEntry::sh, ug::SHE_EDGE, ug::SHE_FACE, ug::SHE_VERTEX, ug::SHE_VOLUME, ug::ISubsetHandler::subset_info(), ug::GridReaderUGX::GridEntry::subsetHandlerEntries, ug::SubsetInfo::subsetState, UG_LOG, ug::GridReaderUGX::GridEntry::vertices, and ug::GridReaderUGX::GridEntry::volumes.
Referenced by ug::LoadGridFromUGX().
|
protected |
the xml_document which stores the data
|
protected |
holds grids which already have been created
Referenced by num_grids().