ug4
|
Enumerations | |
enum | ug::PolyChainTypes { ug::PCT_UNKNOWN = 0 , ug::PCT_CLOSED = 1 , ug::PCT_OPEN = 1 << 1 , ug::PCT_SEPARATED = 1 << 2 , ug::PCT_IRREGULAR = 1 << 3 , ug::PCT_EMPTY = 1 << 4 } |
Functions | |
template<class TEdgeIter > | |
bool | ug::CreatePolyChain (std::vector< Vertex * > &polyChainOut, Grid &grid, TEdgeIter edgesBegin, TEdgeIter edgesEnd) |
given a list of edges, this method collects associated vertices in a polychain More... | |
template<class TEdgeIterator > | |
std::pair< Vertex *, Edge * > | ug::GetFirstSectionOfPolyChain (Grid &grid, TEdgeIterator edgesBegin, TEdgeIterator edgesEnd, Grid::edge_traits::callback cbEdgeIsInPolyChain) |
Returns the start-vertex and start-edge of a polygonal chain. More... | |
std::pair< Vertex *, Edge * > | ug::GetNextSectionOfPolyChain (Grid &grid, std::pair< Vertex *, Edge * > lastSection, Grid::edge_traits::callback cbEdgeIsInPolyChain) |
returns the next section in a polygonal chain. More... | |
template<class TEdgeIterator > | |
size_t | ug::GetPolyChainType (Grid &grid, TEdgeIterator edgesBegin, TEdgeIterator edgesEnd, Grid::edge_traits::callback cbEdgeIsInPolyChain) |
returns an or combination of constants enumerated in PolyChainTypes. More... | |
bool | ug::SplitIrregularPolyChain (SubsetHandler &sh, int srcIndex, int targetIndex) |
Makes sure that the polychain at srcIndex is regular and not separated. More... | |
Methods that allow to interprete parts of a grid as a polygonal chain.
enum ug::PolyChainTypes |
bool ug::CreatePolyChain | ( | std::vector< Vertex * > & | polyChainOut, |
Grid & | grid, | ||
TEdgeIter | edgesBegin, | ||
TEdgeIter | edgesEnd | ||
) |
given a list of edges, this method collects associated vertices in a polychain
This method uses Grid::mark. edges between edgesBegin and edgesEnd should build a closed regular polygon.
References ug::Grid::associated_edges_begin(), ug::Grid::associated_edges_end(), ug::Grid::begin_marking(), ug::Grid::end_marking(), ug::GetConnectedVertex(), ug::Grid::is_marked(), ug::Grid::mark(), and ug::EdgeVertices::vertex().
Referenced by ug::QualityGridGeneration(), ug::ReplaceLowValenceVertices(), and ug::TriangleFill().
std::pair< Vertex *, Edge * > ug::GetFirstSectionOfPolyChain | ( | Grid & | grid, |
TEdgeIterator | edgesBegin, | ||
TEdgeIterator | edgesEnd, | ||
Grid::edge_traits::callback | cbEdgeIsInPolyChain | ||
) |
Returns the start-vertex and start-edge of a polygonal chain.
The edges between iteratorBegin and iteratorEnd are considered to be edges of a polygonal chain. The algorithm then searches for a vertex that lies on the boundary of that chain. If a boundary vertex is found which is the first vertex in its associated chain-edge, it is preferred to a vertex, which is the second vertex of its associated chain-edge.
Returned is an std::pair. The first component points to the vertex and the second to its associated edge.
If the polygonal chain is closed, the the edge at edgesBegin and its first vertex is returned.
The given callback cbConsiderEdge has to return true for all edges between edgesBegin and edgesEnd and false for all other edges.
If there are no edges between the given iterators, std::pair(NULL, NULL) is returned.
References ug::IsBoundaryVertex1D(), and ug::EdgeVertices::vertex().
Referenced by ug::ExportGridToUG_2D(), and ug::SplitIrregularPolyChain().
std::pair< Vertex *, Edge * > ug::GetNextSectionOfPolyChain | ( | Grid & | grid, |
std::pair< Vertex *, Edge * > | lastSection, | ||
Grid::edge_traits::callback | cbEdgeIsInPolyChain | ||
) |
returns the next section in a polygonal chain.
lastSection has to contain a vertex and an associated edge, which is part of the polygonal chain. You can retrieve such a section by a call to ug::GetFirstVertexOfPolyChain or to ug::GetNextSectionInPolyChain.
If no more sections can be found, std::pair(NULL, NULL) is returned.
Be careful with closed polychains! The algorithm will always find a next section in this case.
If the polychain is irregular (more than 2 chain-edges meet at one vertex) the algorithm still terminates. However assumtions on the outcome should not be made.
References ug::Grid::associated_edges_begin(), ug::Grid::associated_edges_end(), ug::Grid::enable_options(), ug::GetConnectedVertex(), LOG, ug::Grid::option_is_enabled(), and ug::VRTOPT_STORE_ASSOCIATED_EDGES.
Referenced by ug::ExportGridToUG_2D(), and ug::SplitIrregularPolyChain().
size_t ug::GetPolyChainType | ( | Grid & | grid, |
TEdgeIterator | edgesBegin, | ||
TEdgeIterator | edgesEnd, | ||
Grid::edge_traits::callback | cbEdgeIsInPolyChain | ||
) |
returns an or combination of constants enumerated in PolyChainTypes.
References ug::Grid::associated_edges_begin(), ug::Grid::associated_edges_end(), ug::PCT_CLOSED, ug::PCT_EMPTY, ug::PCT_IRREGULAR, ug::PCT_OPEN, ug::PCT_SEPARATED, and ug::PCT_UNKNOWN.
Referenced by ug::AdjustSubsetsForLgmNg().
bool ug::SplitIrregularPolyChain | ( | SubsetHandler & | sh, |
int | srcIndex, | ||
int | targetIndex | ||
) |
Makes sure that the polychain at srcIndex is regular and not separated.
This algorithm uses Grid::mark
Makes sure that the polychain at srcIndex is regular and not separated. This is achieved by assigning all problematic edges to targetIndex.
Returns true if the chain was splitted and false if not.
References ug::GridSubsetHandler::assign_subset(), ug::Grid::associated_edges_begin(), ug::Grid::associated_edges_end(), ug::GridSubsetHandler::begin(), ug::Grid::begin_marking(), ug::Grid::enable_options(), ug::GridSubsetHandler::end(), ug::Grid::end_marking(), ug::ISubsetHandler::get_subset_index(), ug::GetConnectedVertex(), ug::GetFirstSectionOfPolyChain(), ug::GetNextSectionOfPolyChain(), ug::ISubsetHandler::grid(), ug::Grid::is_marked(), LOG, ug::Grid::mark(), ug::GridSubsetHandler::num(), ug::Grid::option_is_enabled(), and ug::VRTOPT_STORE_ASSOCIATED_EDGES.
Referenced by ug::AdjustSubsetsForLgmNg().