xmsgrid
1.0
|
Implementation for XmUGrid. More...
Public Member Functions | |
Impl ()=default | |
Default constructor. | |
Impl (const Impl &)=default | |
Default copy constructor. | |
Impl & | operator= (const Impl &a_xmUGrid)=default |
Default ssignment operator. More... | |
bool | GetModified () const |
Returns the modified flag. Gets set when points or cells get changed. More... | |
void | SetUnmodified () |
Resets the modified flag to false. | |
void | SetUseCache (bool a_useCache) |
Turn on or off use of caching. More... | |
int | GetPointCount () const |
Get the number of points. More... | |
const VecPt3d & | GetLocations () const |
Get vector of UGrid points. More... | |
void | SetLocations (const VecPt3d &a_locations) |
Set UGrid points. More... | |
Pt3d | GetPointLocation (int a_pointIdx) const |
Get the point. More... | |
bool | SetPointLocation (int a_pointIdx, const Pt3d &a_location) |
Set the point. More... | |
Pt3d | GetPointXy0 (int a_pointIdx) const |
Get the X, Y location of a point. More... | |
VecPt3d | GetPointsLocations (const VecInt &a_points) const |
Convert a vector of point indices into a vector of point 3d. More... | |
void | GetExtents (Pt3d &a_min, Pt3d &a_max) const |
Get extents of all points in UGrid. More... | |
int | GetPointAdjacentCellCount (int a_pointIdx) const |
Get the number of cells that use a point. More... | |
VecInt | GetPointAdjacentCells (int a_pointIdx) const |
Get the cells that are associated with the specified point. More... | |
void | GetPointAdjacentCells (int a_pointIdx, VecInt &a_adjacentCells) const |
Get the cells that are associated with the specified point. More... | |
VecInt | GetPointsAdjacentCells (const VecInt &a_points) const |
Gets the common cells from a vector of points. More... | |
void | GetPointsAdjacentCells (const int *a_pointIdxs, int a_numpointIdxs, VecInt &a_commonCellIdxs) const |
Gets the common cells from a vector of points. More... | |
void | GetPointsAdjacentCells (const VecInt &a_pointIdxs, VecInt &a_commonCellIdxs) const |
Gets the cells adjacent to all of a vector of points. More... | |
void | GetPointsAdjacentCells (int a_pointIdx1, int a_pointIdx2, VecInt &a_adjacentCellIdxs) const |
Gets the cells adjacent to both of the two points. More... | |
bool | IsValidPointChange (int a_changedPtIdx, const Pt3d &a_newPosition) const |
Determine whether adjacent cells are valid after a point is moved. More... | |
int | GetCellCount () const |
Get the number of cells. More... | |
int | GetCellPointCount (int a_cellIdx) const |
Get the number of cell points (including polyhedron). More... | |
VecInt | GetCellPoints (int a_cellIdx) const |
Get the points of a cell (including polyhedron) More... | |
bool | GetCellPoints (int a_cellIdx, VecInt &a_cellPoints) const |
Get the points of a cell. More... | |
void | GetCellLocations (int a_cellIdx, VecPt3d &a_cellLocations) const |
Get locations of cell points. More... | |
XmUGridCellType | GetCellType (int a_cellIdx) const |
Get the cell type of a specified cell. More... | |
std::vector< int > | GetDimensionCounts () const |
Count all number of the cells with each dimension (0, 1, 2, 3) More... | |
int | GetCellDimension (int a_cellIdx) const |
Get the dimension of the specified cell. More... | |
void | GetCellExtents (int a_cellIdx, Pt3d &a_min, Pt3d &a_max) const |
Get the extents of the given cell. More... | |
const VecInt & | GetCellstream () const |
Get cell stream vector for the entire UGrid. More... | |
bool | SetCellstream (const VecInt &a_cellstream) |
Set the ugrid cells for the entire UGrid using a cell stream. More... | |
bool | GetCellCellstream (int a_cellIdx, VecInt &a_cellstream) const |
Get cell stream vector for a single cell. More... | |
VecInt | GetCellAdjacentCells (int a_cellIdx) const |
Get the cells neighboring a cell (cells associated with any of it's points) More... | |
void | GetCellAdjacentCells (int a_cellIdx, VecInt &a_cellNeighbors) const |
Get the cells neighboring a cell (cells associated with any of it's points) More... | |
bool | GetCellPlanViewPolygon (int a_cellIdx, VecPt3d &a_polygon) const |
Get a plan view polygon of a specified cell. More... | |
bool | GetCellCentroid (int a_cellIdx, Pt3d &a_centroid) const |
Get the centroid location of a cell. More... | |
int | GetCellEdgeCount (int a_cellIdx) const |
Get the number of edges for a cell. More... | |
XmEdge | GetCellEdge (int a_cellIdx, int a_edgeIdx) const |
Get the points of a cell. More... | |
VecInt | GetCellEdgeAdjacentCells (int a_cellIdx, int a_edgeIdx) const |
Get the index of the adjacent cells (that shares the same cell edge) More... | |
void | GetCellEdgeAdjacentCells (int a_cellIdx, int a_edgeIdx, VecInt &a_adjacentCellIdxs) const |
Get the index of the adjacent cells (that shares the same cell edge) More... | |
int | GetCell2dEdgeAdjacentCell (int a_cellIdx, int a_edgeIdx) const |
Get the index of the adjacent cells (that shares the same cell edge) More... | |
void | GetEdgeAdjacentCells (const XmEdge &a_edge, VecInt &a_adjacentCellIdxs) const |
Get the indices of the adjacent cells (that shares the same cell edge) More... | |
VecInt | GetEdgeAdjacentCells (const XmEdge &a_edge) const |
Get the index of the adjacent cells (that shares the same cell edge) More... | |
std::vector< XmEdge > | GetCellEdges (int a_cellIdx) const |
Get the Edges of a cell. More... | |
void | GetCellEdges (int a_cellIdx, std::vector< XmEdge > &a_edges) const |
Get the Edges of a cell. More... | |
void | GetPointAdjacentPoints (int a_pointIdx, VecInt &a_edgePoints) const |
Given a point gets point indices attached to the point by an edge. More... | |
void | GetPointAdjacentLocations (int a_pointIdx, VecPt3d &a_edgePoints) const |
Given a point gets point locations attached to the point by an edge. More... | |
int | GetCell3dFaceCount (int a_cellIdx) const |
Get the number of cell faces for given cell. More... | |
int | GetCell3dFacePointCount (int a_cellIdx, int a_faceIdx) const |
Get the number of face points for a given cell and face. More... | |
VecInt | GetCell3dFacePoints (int a_cellIdx, int a_faceIdx) const |
Get the cell face for given cell and face index. More... | |
void | GetCell3dFacePoints (int a_cellIdx, int a_faceIdx, VecInt &a_facePtIdxs) const |
Get the cell face for given cell and face index. More... | |
VecInt2d | GetCell3dFacesPoints (int a_cellIdx) const |
Get the faces of a cell. More... | |
int | GetCell3dFaceAdjacentCell (int a_cellIdx, int a_faceIdx) const |
Get the cell face neighbors for given cell and face index. More... | |
bool | GetCell3dFaceAdjacentCell (int a_cellIdx, int a_faceIdx, int &a_neighborCell, int &a_neighborFace) const |
Get the cell face neighbors for given cell and face index. More... | |
XmUGridFaceOrientation | GetCell3dFaceOrientation (int a_cellIdx, int a_faceIdx) const |
Get the orientation of the face of a vertically prismatic cell. More... | |
XmUGridFaceOrientation | FaceOrientation (int a_cellIdx, int a_faceIdx) const |
Find the orientation of a given 3D cell face. More... | |
XmUGridFaceOrientation | VerticalOrientationFromOpposing (int a_cellIdx, int a_faceIdx) const |
Find vertical orientation of a given 3D cell face from opposing face. More... | |
bool | IsSideFace (int a_cellIdx, int a_faceIdx) const |
Determines if a cell face is a vertical side face. More... | |
XmUGridFaceOrientation | ConnectedTopOrBottom (int a_cellIdx, int a_faceIdx) const |
Determine face orientation by using cell index of connected face. Top face is connected to lower index, bottom face to higher index. More... | |
XmUGridFaceOrientation | GetOrientationFromArea (int a_cellIdx, int a_faceIdx) const |
Determine top or bottom face orientation using area. Since faces are ordered CCW looking in, the top face area is positive and the bottom negative. More... | |
Private Types | |
enum | XmUGridCacheHolder { NEEDS_CALCULATION = -2 } |
Constant for when a cached integer item needs to be calculated. More... | |
Private Member Functions | |
void | UpdateLinks () |
Update internal links to navigate between associated points and cells. | |
void | UpdateCellLinks () |
Update internal link from cells to cell stream index. | |
void | UpdatePointLinks () |
Update internal links from points to associated cells. | |
void | SetModified () |
Sets the modified flag to true. | |
bool | IsCellValidWithPointChange (int a_cellIdx, int a_changedPtIdx, const Pt3d &a_newPosition) const |
Determine whether a cell is valid after a point is moved. More... | |
bool | IsValidCellIdx (int a_cellIdx) const |
Determine if a cell index is valid. More... | |
int | GetNumberOfItemsForCell (int a_cellIdx) const |
Get number of items given cell. For polyhedron number of items is number of faces. For other cell types it is number of points. More... | |
void | GetCellCellstream (int a_cellIdx, const int **a_start, int &a_length) const |
Internal function to get start of cell stream for an individual cell. Returns nullptr and zero length for invalid cell index. More... | |
int | GetNumberOfPolyhedronEdges (int a_cellIdx) const |
Get the number of edges for a polyhedron cell. More... | |
bool | GetPlanViewPolygon2d (int a_cellIdx, VecPt3d &a_polygon) const |
Get a plan view polygon of a specified 2D cell. More... | |
bool | GetPlanViewPolygon3d (int a_cellIdx, VecPt3d &a_polygon) const |
Get a plan view polygon of a specified 3D cell. More... | |
bool | IsFaceSide (const VecInt &a_facePts) const |
Get whether the cell face is of a side orientation. Only works for plan view prismatic cells. More... | |
bool | GetCellXySegments (int cellIdx, VecPt3d &a_segments) const |
Get the XY segments of a cell. More... | |
void | GetEdgesOfFace (const VecInt &a_face, std::vector< XmEdge > &a_edges) const |
Get the edges of a cell given a face. More... | |
bool | DoEdgesCrossWithPointChange (int a_changedPtIdx, const Pt3d &a_newPosition, const std::vector< XmEdge > &a_edges) const |
Gets whether or not edges cross with a point change. More... | |
void | GetExtentsFromPoints (const VecPt3d &a_locations, Pt3d &a_min, Pt3d &a_max) const |
Function to get the extents from a list of points. Will be removed after geometry library is built. More... | |
bool | GetFaceXySegments (int a_cellIdx, int a_faceIdx, VecPt3d &a_segments) const |
Get the Xy locations of Face Points. More... | |
void | CalculateCacheValues () const |
Calculate cached values for faster lookup. | |
void | ClearCacheValues () |
Clear cached so they will be recalculated. | |
int | GetCell3dFaceCountNoCache (int a_cellIdx) const |
Get the number of cell faces for given cell. More... | |
int | GetCell3dFaceAdjacentCellNoCache (int a_cellIdx, int a_faceIdx) const |
Get the cell face neighbors for given cell and face index. More... | |
XmUGridFaceOrientation | GetCell3dFaceOrientationNoCache (int a_cellIdx, int a_faceIdx) const |
Get the orientation of the face of a vertically prismatic cell. More... | |
bool | GetNextFaceColumn (const VecInt &a_facePoints, int a_starti, int &a_columnBegin, int &a_columnEnd) const |
Get next vertical column of points with equal x/y values for side face. More... | |
void | GetFacePointSegments (const VecInt &a_facePts, int a_columnBegin, int a_columnEnd, VecPt3d &a_segments) const |
Get plan view segments of face points. More... | |
XmUGridFaceOrientation | FaceOrientationWithFail (int a_cellIdx, int a_faceIdx) const |
Find the orientation of a given 3D cell face. Check first for side face, then top or bottom based on connected face, or top or bottom based on area calculation. More... | |
Static Private Member Functions | |
static int | DimensionFromCellType (XmUGridCellType a_cellType) |
Get the dimension given the cell type (0d, 1d, 2d, or 3d). More... | |
static void | GetUniquePointsFromPolyhedronCellstream (const VecInt &a_cellstream, int a_numCellItems, int &a_currIdx, VecInt &a_uniqueGetCellPoints, VecInt &a_pointLastUsedIdx) |
Get the unique points in a flat set. More... | |
static bool | GetUniquePointsFromPolyhedronSingleCellstream (const VecInt &a_cellstream, VecInt &a_cellPoints) |
Get the unique points for cell stream of a single polyhedron cell. More... | |
static void | GetUniqueEdgesFromPolyhedronCellstream (const int *a_start, int &a_length, boost::container::flat_set< XmEdge > &a_cellEdges, int &a_currIdx) |
Get the unique edges in a flat set for a given polyhedron. More... | |
Private Attributes | |
VecPt3d | m_locations |
UGrid point locations. | |
VecInt | m_cellstream |
UGrid cell stream. More... | |
VecInt | m_cellIdxToStreamIdx |
Indexes for each cell in the cell stream. | |
VecInt | m_pointsToCells |
VecInt | m_pointIdxToPointsToCells |
bool | m_modified = false |
Has UGrid been modified since last SetUnmodified call? | |
bool | m_useCache = true |
Are we using caching for some calls? | |
VecInt | m_numberOfFaces |
Cache for number of cell faces. | |
VecInt | m_cellFaceOffset |
Cache for offset to m_faceOrientation and m_faceNeighbor. | |
VecInt | m_faceOrientation |
For vertically prismatic cell is face top, side, bottom. | |
VecInt | m_faceNeighbor |
Cache for Face neighbor. | |
VecInt | m_cellDimensionCounts |
Cache for cell dimension counts. | |
Implementation for XmUGrid.
Implementation for XmUGrid which provides geometry for an unstructured grid.
Definition at line 50 of file XmUGrid.cpp.
|
private |
Constant for when a cached integer item needs to be calculated.
Enumerator | |
---|---|
NEEDS_CALCULATION | Cached value needs to be calculated. |
Definition at line 213 of file XmUGrid.cpp.
XmUGridFaceOrientation xms::XmUGrid::Impl::ConnectedTopOrBottom | ( | int | a_cellIdx, |
int | a_faceIdx | ||
) | const |
Determine face orientation by using cell index of connected face. Top face is connected to lower index, bottom face to higher index.
[in] | a_cellIdx | The cell index. |
[in] | a_faceIdx | The face index. |
Definition at line 2773 of file XmUGrid.cpp.
References xms::XmUGrid::GetCell3dFaceAdjacentCell(), and XM_NONE.
|
staticprivate |
Get the dimension given the cell type (0d, 1d, 2d, or 3d).
[in] | a_cellType | the cell type |
Definition at line 2067 of file XmUGrid.cpp.
|
private |
Gets whether or not edges cross with a point change.
[out] | a_edges | The edges to check |
[in] | a_changedPtIdx | index of the point to be changed |
[in] | a_newPosition | location the point is to be moved to |
Definition at line 1281 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointLocation(), and xms::gmLinesCross().
XmUGridFaceOrientation xms::XmUGrid::Impl::FaceOrientation | ( | int | a_cellIdx, |
int | a_faceIdx | ||
) | const |
Find the orientation of a given 3D cell face.
[in] | a_cellIdx | The cell index. |
[in] | a_faceIdx | The face index. |
Definition at line 1872 of file XmUGrid.cpp.
References XM_ASSERT.
|
private |
Find the orientation of a given 3D cell face. Check first for side face, then top or bottom based on connected face, or top or bottom based on area calculation.
[in] | a_cellIdx | The cell index. |
[in] | a_faceIdx | The face index. |
Definition at line 2678 of file XmUGrid.cpp.
int xms::XmUGrid::Impl::GetCell2dEdgeAdjacentCell | ( | int | a_cellIdx, |
int | a_edgeIdx | ||
) | const |
Get the index of the adjacent cells (that shares the same cell edge)
[in] | a_cellIdx | the index of the cell |
[in] | a_edgeIdx | the index of the edge |
Definition at line 1472 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellDimension(), xms::XmUGrid::GetCellEdge(), xms::XmUGrid::GetCellEdgeCount(), xms::XmEdge::GetFirst(), xms::XmUGrid::GetPointAdjacentCellCount(), and xms::XmEdge::IsEquivalent().
int xms::XmUGrid::Impl::GetCell3dFaceAdjacentCell | ( | int | a_cellIdx, |
int | a_faceIdx | ||
) | const |
Get the cell face neighbors for given cell and face index.
[in] | a_cellIdx | the index of the cell |
[in] | a_faceIdx | the face index of the cell |
Definition at line 1744 of file XmUGrid.cpp.
References xms::XmUGrid::GetCell3dFaceCount().
bool xms::XmUGrid::Impl::GetCell3dFaceAdjacentCell | ( | int | a_cellIdx, |
int | a_faceIdx, | ||
int & | a_neighborCell, | ||
int & | a_neighborFace | ||
) | const |
Get the cell face neighbors for given cell and face index.
[in] | a_cellIdx | the index of the cell |
[in] | a_faceIdx | the face index of the cell |
[in] | a_neighborCell | the index of the neighboring cell |
[in] | a_neighborFace | the face index of the neighboring cell adjacent to the given face |
Definition at line 1785 of file XmUGrid.cpp.
References xms::XmUGrid::GetCell3dFaceAdjacentCell(), xms::XmUGrid::GetCell3dFaceCount(), and xms::XmUGrid::GetCell3dFacePoints().
|
private |
Get the cell face neighbors for given cell and face index.
[in] | a_cellIdx | the index of the cell |
[in] | a_faceIdx | the face index of the cell |
Definition at line 2546 of file XmUGrid.cpp.
References xms::XmUGrid::GetCell3dFacePoints(), and xms::XmUGrid::GetPointsAdjacentCells().
int xms::XmUGrid::Impl::GetCell3dFaceCount | ( | int | a_cellIdx | ) | const |
Get the number of cell faces for given cell.
[in] | a_cellIdx | the index of the cell |
Definition at line 1596 of file XmUGrid.cpp.
|
private |
Get the number of cell faces for given cell.
[in] | a_cellIdx | the index of the cell |
Definition at line 2518 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellType().
XmUGridFaceOrientation xms::XmUGrid::Impl::GetCell3dFaceOrientation | ( | int | a_cellIdx, |
int | a_faceIdx | ||
) | const |
Get the orientation of the face of a vertically prismatic cell.
[in] | a_cellIdx | the index of the cell |
[in] | a_faceIdx | the face index of the cell |
Definition at line 1834 of file XmUGrid.cpp.
References xms::XmUGrid::GetCell3dFaceCount().
|
private |
Get the orientation of the face of a vertically prismatic cell.
[in] | a_cellIdx | the index of the cell |
[in] | a_faceIdx | the face index of the cell |
Definition at line 2573 of file XmUGrid.cpp.
int xms::XmUGrid::Impl::GetCell3dFacePointCount | ( | int | a_cellIdx, |
int | a_faceIdx | ||
) | const |
Get the number of face points for a given cell and face.
[in] | a_cellIdx | The cell |
[in] | a_faceIdx | The face |
Definition at line 1616 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellCellstream(), and xms::XmUGrid::GetCellType().
VecInt xms::XmUGrid::Impl::GetCell3dFacePoints | ( | int | a_cellIdx, |
int | a_faceIdx | ||
) | const |
Get the cell face for given cell and face index.
[in] | a_cellIdx | the index of the cell |
[in] | a_faceIdx | the face index of the cell |
Definition at line 1663 of file XmUGrid.cpp.
References xms::XmUGrid::GetCell3dFacePoints().
void xms::XmUGrid::Impl::GetCell3dFacePoints | ( | int | a_cellIdx, |
int | a_faceIdx, | ||
VecInt & | a_facePtIdxs | ||
) | const |
Get the cell face for given cell and face index.
[in] | a_cellIdx | the index of the cell |
[in] | a_faceIdx | the face index of the cell |
[out] | a_facePtIdxs | a vector of point indices for the face |
Definition at line 1675 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellCellstream().
VecInt2d xms::XmUGrid::Impl::GetCell3dFacesPoints | ( | int | a_cellIdx | ) | const |
Get the faces of a cell.
[in] | a_cellIdx | the cells to whom the faces belong |
Definition at line 1727 of file XmUGrid.cpp.
References xms::XmUGrid::GetCell3dFaceCount(), and xms::XmUGrid::GetCell3dFacePoints().
VecInt xms::XmUGrid::Impl::GetCellAdjacentCells | ( | int | a_cellIdx | ) | const |
Get the cells neighboring a cell (cells associated with any of it's points)
[in] | a_cellIdx | the index of the cell |
Definition at line 1091 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellAdjacentCells().
void xms::XmUGrid::Impl::GetCellAdjacentCells | ( | int | a_cellIdx, |
VecInt & | a_cellNeighbors | ||
) | const |
Get the cells neighboring a cell (cells associated with any of it's points)
[in] | a_cellIdx | the index of the cell |
[out] | a_cellNeighbors | vector of cell indices |
Definition at line 1102 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellPoints(), and xms::XmUGrid::GetPointAdjacentCells().
bool xms::XmUGrid::Impl::GetCellCellstream | ( | int | a_cellIdx, |
VecInt & | a_cellstream | ||
) | const |
Get cell stream vector for a single cell.
[in] | a_cellIdx | the index of the cell |
[in] | a_cellstream | The cellstream of the cell |
Definition at line 1073 of file XmUGrid.cpp.
|
private |
Internal function to get start of cell stream for an individual cell. Returns nullptr and zero length for invalid cell index.
[in] | a_cellIdx | the index of the cell |
[out] | a_start | pointer to the start of the stream for the cell |
[out] | a_length | the length of the stream for the cell |
Definition at line 2193 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellType().
bool xms::XmUGrid::Impl::GetCellCentroid | ( | int | a_cellIdx, |
Pt3d & | a_centroid | ||
) | const |
Get the centroid location of a cell.
[in] | a_cellIdx | The index of the cell. |
[out] | a_centroid | The location of the cell centroid. |
Definition at line 1157 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellLocations(), xms::XmUGrid::GetCellPlanViewPolygon(), and xms::gmComputePolygonCentroid().
int xms::XmUGrid::Impl::GetCellCount | ( | ) | const |
int xms::XmUGrid::Impl::GetCellDimension | ( | int | a_cellIdx | ) | const |
Get the dimension of the specified cell.
[in] | a_cellIdx | the index of the cell |
Definition at line 1012 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellType().
XmEdge xms::XmUGrid::Impl::GetCellEdge | ( | int | a_cellIdx, |
int | a_edgeIdx | ||
) | const |
Get the points of a cell.
[in] | a_cellIdx | the index of the cell |
[in] | a_edgeIdx | the index of the edge |
Definition at line 1360 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellCellstream(), xms::XmEdge::GetFirst(), and xms::XmEdge::GetSecond().
VecInt xms::XmUGrid::Impl::GetCellEdgeAdjacentCells | ( | int | a_cellIdx, |
int | a_edgeIdx | ||
) | const |
Get the index of the adjacent cells (that shares the same cell edge)
[in] | a_cellIdx | the index of the cell |
[in] | a_edgeIdx | the index of the edge |
Definition at line 1423 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellEdgeAdjacentCells().
void xms::XmUGrid::Impl::GetCellEdgeAdjacentCells | ( | int | a_cellIdx, |
int | a_edgeIdx, | ||
VecInt & | a_adjacentCellIdxs | ||
) | const |
Get the index of the adjacent cells (that shares the same cell edge)
[in] | a_cellIdx | the index of the cell |
[in] | a_edgeIdx | the index of the edge |
[out] | a_adjacentCellIdxs | a vector of cell indices of the adjacent cells |
Definition at line 1436 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellAdjacentCells(), xms::XmUGrid::GetCellEdge(), xms::XmUGrid::GetCellEdgeCount(), and xms::XmEdge::IsEquivalent().
int xms::XmUGrid::Impl::GetCellEdgeCount | ( | int | a_cellIdx | ) | const |
Get the number of edges for a cell.
[in] | a_cellIdx | the index of the cell |
Definition at line 1320 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellType(), and XM_ASSERT.
std::vector< XmEdge > xms::XmUGrid::Impl::GetCellEdges | ( | int | a_cellIdx | ) | const |
Get the Edges of a cell.
[in] | a_cellIdx | the cells to whom the edges belong |
Definition at line 1524 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellEdges().
void xms::XmUGrid::Impl::GetCellEdges | ( | int | a_cellIdx, |
std::vector< XmEdge > & | a_edges | ||
) | const |
Get the Edges of a cell.
[in] | a_cellIdx | the cells to whom the edges belong |
[out] | a_edges | a vector of edges (organized in std::pairs) |
Definition at line 1535 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellEdge(), and xms::XmUGrid::GetCellEdgeCount().
Get the extents of the given cell.
[in] | a_cellIdx | The cell index to get the extents of. |
[out] | a_min | The minimum location. |
[out] | a_max | The maximum location. |
Definition at line 1023 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellLocations().
void xms::XmUGrid::Impl::GetCellLocations | ( | int | a_cellIdx, |
VecPt3d & | a_cellLocations | ||
) | const |
Get locations of cell points.
[in] | a_cellIdx | the index of the cell |
[out] | a_cellLocations | The locations of the cell points |
Definition at line 948 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellPoints(), and xms::XmUGrid::GetPointsLocations().
bool xms::XmUGrid::Impl::GetCellPlanViewPolygon | ( | int | a_cellIdx, |
VecPt3d & | a_polygon | ||
) | const |
Get a plan view polygon of a specified cell.
[in] | a_cellIdx | The index of the cell. |
[out] | a_polygon | Vector of Pt3d that is the plan view polygon. |
Definition at line 1137 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellDimension().
int xms::XmUGrid::Impl::GetCellPointCount | ( | int | a_cellIdx | ) | const |
Get the number of cell points (including polyhedron).
[in] | a_cellIdx | the index of the cell |
Definition at line 864 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellCellstream(), and xms::XmUGrid::GetCellType().
VecInt xms::XmUGrid::Impl::GetCellPoints | ( | int | a_cellIdx | ) | const |
Get the points of a cell (including polyhedron)
[in] | a_cellIdx | the index of the cell |
Definition at line 901 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellPoints().
bool xms::XmUGrid::Impl::GetCellPoints | ( | int | a_cellIdx, |
VecInt & | a_cellPoints | ||
) | const |
Get the points of a cell.
[in] | a_cellIdx | the index of the cell |
[out] | a_cellPoints | the points of the cell |
Definition at line 913 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellCellstream(), and XM_ENSURE_TRUE_NO_ASSERT.
const VecInt & xms::XmUGrid::Impl::GetCellstream | ( | ) | const |
Get cell stream vector for the entire UGrid.
Definition at line 1034 of file XmUGrid.cpp.
XmUGridCellType xms::XmUGrid::Impl::GetCellType | ( | int | a_cellIdx | ) | const |
Get the cell type of a specified cell.
[in] | a_cellIdx | the index of the cell |
Definition at line 959 of file XmUGrid.cpp.
|
private |
Get the XY segments of a cell.
[in] | a_cellIdx | the index of the cell |
[out] | a_segments | The XY segments of a cell |
Definition at line 2418 of file XmUGrid.cpp.
References xms::XmUGrid::GetCell3dFaceCount(), and xms::XmUGrid::GetCell3dFacePoints().
std::vector< int > xms::XmUGrid::Impl::GetDimensionCounts | ( | ) | const |
Count all number of the cells with each dimension (0, 1, 2, 3)
Definition at line 983 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellCount(), and xms::XmUGrid::GetCellDimension().
void xms::XmUGrid::Impl::GetEdgeAdjacentCells | ( | const XmEdge & | a_edge, |
VecInt & | a_adjacentCellIdxs | ||
) | const |
Get the indices of the adjacent cells (that shares the same cell edge)
[in] | a_edge | the edge (a pair of point indices) |
[out] | a_adjacentCellIdxs | a vector of cell indices of the adjacent cells |
Definition at line 1503 of file XmUGrid.cpp.
References xms::XmEdge::GetFirst(), xms::XmUGrid::GetPointsAdjacentCells(), and xms::XmEdge::GetSecond().
Get the index of the adjacent cells (that shares the same cell edge)
[in] | a_edge | the edge (a pair of point indices) |
Definition at line 1513 of file XmUGrid.cpp.
References xms::XmUGrid::GetEdgeAdjacentCells().
|
private |
Get the edges of a cell given a face.
[in] | a_face | a vector of point indices of a face |
[out] | a_edges | a vector of point indices of an edge |
Definition at line 1263 of file XmUGrid.cpp.
Get extents of all points in UGrid.
[out] | a_min | minimum extent of all points |
[out] | a_max | maximum extent of all points |
Definition at line 727 of file XmUGrid.cpp.
|
private |
Function to get the extents from a list of points. Will be removed after geometry library is built.
[in] | a_locations | The point locations to get the extents of. |
[out] | a_min | Minimum point location. |
[out] | a_max | Maximum point location. |
Definition at line 2443 of file XmUGrid.cpp.
References xms::gmAddToExtents(), xms::Pt3< T >::x, xms::Pt3< T >::y, and xms::Pt3< T >::z.
|
private |
Get plan view segments of face points.
[in] | a_facePts | The face point indices. |
[in] | a_columnBegin | The the first point of a vertical column. |
[in] | a_columnEnd | The last point of a vertical column. |
[out] | a_segments | The face point segments. |
Definition at line 2654 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointXy0().
|
private |
Get the Xy locations of Face Points.
[in] | a_cellIdx | The index of the cells whose face points are wanted. |
[in] | a_faceIdx | The index of the face whose points are wanted. |
[out] | a_segments | The points of the face segments |
Definition at line 2460 of file XmUGrid.cpp.
References xms::XmUGrid::GetCell3dFacePoints().
const VecPt3d & xms::XmUGrid::Impl::GetLocations | ( | ) | const |
Get vector of UGrid points.
Definition at line 654 of file XmUGrid.cpp.
bool xms::XmUGrid::Impl::GetModified | ( | ) | const |
Returns the modified flag. Gets set when points or cells get changed.
Definition at line 614 of file XmUGrid.cpp.
References m_modified.
|
private |
Get next vertical column of points with equal x/y values for side face.
[in] | a_facePoints | The face point indices. |
[in] | a_starti | The starting index into a_facePoints. |
[out] | a_columnBegin | The first index of the column of points. |
[out] | a_columnEnd | The last index of the column of points. |
Definition at line 2588 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointXy0().
|
private |
Get number of items given cell. For polyhedron number of items is number of faces. For other cell types it is number of points.
[in] | a_cellIdx | the index of the cell |
Definition at line 2167 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellType().
|
private |
Get the number of edges for a polyhedron cell.
[in] | a_cellIdx | the index of the cell |
Definition at line 2214 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellCellstream().
XmUGridFaceOrientation xms::XmUGrid::Impl::GetOrientationFromArea | ( | int | a_cellIdx, |
int | a_faceIdx | ||
) | const |
Determine top or bottom face orientation using area. Since faces are ordered CCW looking in, the top face area is positive and the bottom negative.
[in] | a_cellIdx | The cell index. |
[in] | a_faceIdx | The face index. |
Definition at line 2790 of file XmUGrid.cpp.
References xms::XmUGrid::GetCell3dFacePoints(), xms::XmUGrid::GetPointXy0(), and xms::gmPolygonArea().
|
private |
Get a plan view polygon of a specified 2D cell.
[in] | a_cellIdx | the index of the cell |
[out] | a_polygon | vector of Pt3d that is the plan view polygon |
Definition at line 2349 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellLocations().
|
private |
Get a plan view polygon of a specified 3D cell.
[in] | a_cellIdx | the index of the cell |
[out] | a_polygon | vector of Pt3d that is the plan view polygon |
Definition at line 2364 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellPoints(), xms::XmUGrid::GetPointLocation(), and xms::gmGetConvexHull().
int xms::XmUGrid::Impl::GetPointAdjacentCellCount | ( | int | a_pointIdx | ) | const |
Get the number of cells that use a point.
a_pointIdx | The point to check. |
Definition at line 737 of file XmUGrid.cpp.
VecInt xms::XmUGrid::Impl::GetPointAdjacentCells | ( | int | a_pointIdx | ) | const |
Get the cells that are associated with the specified point.
[in] | a_pointIdx | the index of the point |
Definition at line 750 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointAdjacentCells().
void xms::XmUGrid::Impl::GetPointAdjacentCells | ( | int | a_pointIdx, |
VecInt & | a_adjacentCells | ||
) | const |
Get the cells that are associated with the specified point.
[in] | a_pointIdx | the index of the point |
[out] | a_adjacentCells | a vector of the adjacent cell indices |
Definition at line 762 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointAdjacentCellCount().
void xms::XmUGrid::Impl::GetPointAdjacentLocations | ( | int | a_pointIdx, |
VecPt3d & | a_edgePoints | ||
) | const |
Given a point gets point locations attached to the point by an edge.
[in] | a_pointIdx | The point to get attached point from. |
[out] | a_edgePoints | A vector of points attached across edges. |
Definition at line 1583 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointAdjacentPoints(), and xms::XmUGrid::GetPointsLocations().
void xms::XmUGrid::Impl::GetPointAdjacentPoints | ( | int | a_pointIdx, |
VecInt & | a_edgePoints | ||
) | const |
Given a point gets point indices attached to the point by an edge.
[in] | a_pointIdx | The point to get adjacent points from. |
[out] | a_edgePoints | The indices of the adjacent points. |
Definition at line 1550 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellEdge(), xms::XmUGrid::GetCellEdgeCount(), xms::XmEdge::GetFirst(), xms::XmUGrid::GetPointAdjacentCells(), and xms::XmEdge::GetSecond().
int xms::XmUGrid::Impl::GetPointCount | ( | ) | const |
Pt3d xms::XmUGrid::Impl::GetPointLocation | ( | int | a_pointIdx | ) | const |
Get the point.
[in] | a_pointIdx | the index of the point |
Definition at line 672 of file XmUGrid.cpp.
Gets the common cells from a vector of points.
[in] | a_points | a vector of unique points |
Definition at line 776 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointsAdjacentCells().
void xms::XmUGrid::Impl::GetPointsAdjacentCells | ( | const int * | a_pointIdxs, |
int | a_numPointIdxs, | ||
VecInt & | a_commonCellIdxs | ||
) | const |
Gets the common cells from a vector of points.
[in] | a_pointIdxs | an array of point indices |
[in] | a_numPointIdxs | number of points in array |
[out] | a_commonCellIdxs | a vector of cell indices |
Definition at line 789 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointAdjacentCells().
void xms::XmUGrid::Impl::GetPointsAdjacentCells | ( | const VecInt & | a_pointIdxs, |
VecInt & | a_adjacentCellIdxs | ||
) | const |
Gets the cells adjacent to all of a vector of points.
[in] | a_pointIdxs | a vector of unique points |
[out] | a_adjacentCellIdxs | a vector of cell indices |
Definition at line 828 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointsAdjacentCells().
void xms::XmUGrid::Impl::GetPointsAdjacentCells | ( | int | a_pointIdx1, |
int | a_pointIdx2, | ||
VecInt & | a_adjacentCellIdxs | ||
) | const |
Gets the cells adjacent to both of the two points.
[in] | a_pointIdx1 | first point index |
[in] | a_pointIdx2 | second point index |
[out] | a_adjacentCellIdxs | a vector of cell indices |
Definition at line 840 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointsAdjacentCells().
Convert a vector of point indices into a vector of point 3d.
[in] | a_points | a vector of point indices |
Definition at line 712 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointLocation().
Pt3d xms::XmUGrid::Impl::GetPointXy0 | ( | int | a_pointIdx | ) | const |
Get the X, Y location of a point.
[in] | a_pointIdx | The index of the point. |
Definition at line 700 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointLocation(), and xms::Pt3< T >::z.
|
staticprivate |
Get the unique edges in a flat set for a given polyhedron.
[in] | a_start | the UGrid cell stream (integer pointer) |
[in] | a_length | the length of the cell stream |
[in] | a_cellEdges | Unique cell edges of the polyhedron |
[in] | a_currIdx | the index of the cell stream; this should reference the number of points in the first face. This variable will be updated to the cell type of the next cell. |
Definition at line 2316 of file XmUGrid.cpp.
|
staticprivate |
Get the unique points in a flat set.
[in] | a_cellstream | the UGrid cell stream |
[in] | a_numCellItems | the number of cell faces in the polyhedron |
[in] | a_currIdx | the index of the cell stream; this should reference the number of points in the first face. This variable will be updated to the cell type of the next cell. |
[out] | a_uniqueGetCellPoints | the unique points of the polyhedron |
[out] | a_pointLastUsedIdx | a list of integers representing when a point was last found while reading the stream. |
Definition at line 2244 of file XmUGrid.cpp.
|
staticprivate |
Get the unique points for cell stream of a single polyhedron cell.
[in] | a_cellstream | a single cell stream that is a polyhedron type |
[out] | a_cellPoints | the points of the cell |
Definition at line 2273 of file XmUGrid.cpp.
|
private |
Determine whether a cell is valid after a point is moved.
[in] | a_cellIdx | the index of the cell |
[in] | a_changedPtIdx | index of the point to be changed |
[in] | a_newPosition | location the point is to be moved to |
Definition at line 1190 of file XmUGrid.cpp.
References xms::XmUGrid::GetCell3dFacesPoints(), xms::XmUGrid::GetCellDimension(), and xms::XmUGrid::GetCellEdges().
|
private |
Get whether the cell face is of a side orientation. Only works for plan view prismatic cells.
[in] | a_facePts | the points in the face |
Definition at line 2394 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointLocation(), xms::Pt3< T >::x, and xms::Pt3< T >::y.
bool xms::XmUGrid::Impl::IsSideFace | ( | int | a_cellIdx, |
int | a_faceIdx | ||
) | const |
Determines if a cell face is a vertical side face.
[in] | a_cellIdx | The cell index. |
[in] | a_faceIdx | The face index. |
Definition at line 2744 of file XmUGrid.cpp.
References xms::XmUGrid::GetCell3dFacePoints(), and xms::XmUGrid::GetPointXy0().
|
private |
Determine if a cell index is valid.
[in] | a_cellIdx | the index of the cell |
Definition at line 1230 of file XmUGrid.cpp.
References xms::XmUGrid::GetCellCount().
bool xms::XmUGrid::Impl::IsValidPointChange | ( | int | a_changedPtIdx, |
const Pt3d & | a_newPosition | ||
) | const |
Determine whether adjacent cells are valid after a point is moved.
[in] | a_changedPtIdx | index of the point to be changed |
[in] | a_newPosition | location the point is to be moved to |
Definition at line 1240 of file XmUGrid.cpp.
References xms::XmUGrid::GetPointAdjacentCells().
Default ssignment operator.
a_xmUGrid | The XmUGrid to copy from. |
bool xms::XmUGrid::Impl::SetCellstream | ( | const VecInt & | a_cellstream | ) |
Set the ugrid cells for the entire UGrid using a cell stream.
[in] | a_cellstream | cells defined as follows: Hexahedrons, polygons, quads, triangles etc: Cell type (ElemTypeEnum), number of points, point numbers. Generally 0-based, CCW, bottom, then top. Not true for pixel or voxel. Polyhedrons: Cell type, number of faces, [num points in face, point numbers (0-based, CCW when looking in)] repeated for each face. |
Definition at line 1051 of file XmUGrid.cpp.
References xmlog::error, xms::XmUGrid::IsValidCellstream(), and XM_LOG.
void xms::XmUGrid::Impl::SetLocations | ( | const VecPt3d & | a_locations | ) |
Set UGrid points.
[in] | a_locations | vector of point locations |
Definition at line 662 of file XmUGrid.cpp.
bool xms::XmUGrid::Impl::SetPointLocation | ( | int | a_pointIdx, |
const Pt3d & | a_location | ||
) |
Set the point.
[in] | a_pointIdx | the index of the point |
[in] | a_location | The new location of the specified point |
Definition at line 684 of file XmUGrid.cpp.
void xms::XmUGrid::Impl::SetUseCache | ( | bool | a_useCache | ) |
Turn on or off use of caching.
a_useCache | Flag to determine if caching will be used. |
Definition at line 637 of file XmUGrid.cpp.
XmUGridFaceOrientation xms::XmUGrid::Impl::VerticalOrientationFromOpposing | ( | int | a_cellIdx, |
int | a_faceIdx | ||
) | const |
Find vertical orientation of a given 3D cell face from opposing face.
[in] | a_cellIdx | The cell index. |
[in] | a_faceIdx | The face index. |
Definition at line 2704 of file XmUGrid.cpp.
References xms::XmUGrid::GetCell3dFaceCount().
|
private |
|
private |
Indexes for each point in array of points cells
Definition at line 222 of file XmUGrid.cpp.
|
private |
Array of points cells (goes from pointIdx to list of cells)
Definition at line 220 of file XmUGrid.cpp.