xmsgrid  1.0
xms::XmUGrid Class Reference

Geometry for an unstructured grid. An XmUGrid is defined as a vector of 3d points and a stream of cells. Throughout this interface, we use these terms: More...

Classes

class  Impl
 Implementation for XmUGrid. More...
 

Public Member Functions

 XmUGrid ()
 Constructor.
 
 XmUGrid (const XmUGrid &a_xmUGrid)
 Copy constructor. More...
 
 XmUGrid (XmUGrid &&a_xmUGrid)
 Move constructor. More...
 
 ~XmUGrid ()
 Destructor.
 
XmUGridoperator= (XmUGrid a_xmUGrid)
 Assignment operator. More...
 
void Swap (XmUGrid &a_xmUGrid)
 Swap data between two XmUGrids. 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 to speed up some operations. More...
 
int GetPointCount () const
 Get the number of points. More...
 
const VecPt3dGetLocations () 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 VecInt &a_pointIdxs, VecInt &a_adjacentCellIdxs) 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 number of cells. More...
 
std::vector< int > GetDimensionCounts () const
 Count all number of the cells with each dimenion (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 VecIntGetCellstream () const
 Get cell stream vector for the entire UGrid. A cellstream is defined as follows: Polyhedrons: Cell type, number of faces, [num points in face, point numbers (0-based, CCW when looking in)] repeated for each face. Hexahedrons, polygons, quads, triangles etc: Cell type (ElemTypeEnum), number of points, point numbers. Zero-based, CCW, bottom, then top. Not true for pixel or voxel. 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< XmEdgeGetCellEdges (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...
 

Static Public Member Functions

static std::shared_ptr< XmUGridNew (const VecPt3d &a_locations, const VecInt &a_cellstream)
 Create a new XmUGrid. More...
 
static std::shared_ptr< XmUGridNew ()
 Create a new XmUGrid. More...
 
static bool IsValidCellstream (const VecInt &a_cellstream)
 Check a cell stream to make sure it's valid. Compares cell type against expected number of points. More...
 

Private Attributes

std::unique_ptr< Implm_impl
 implementation
 

Detailed Description

Geometry for an unstructured grid. An XmUGrid is defined as a vector of 3d points and a stream of cells. Throughout this interface, we use these terms:

Point or pointIdx refer to an index into the vector of points.

Location refers to the actual 3d coordinates of one or more of those points.

GetCellstream refers to a single flat vector of integers that defines the cells. The cellstream for each cell begins with an integer that defines the cell type. For most cell types, the next integer specifies the number of points in the cell (even though that number never varies for all cells of most types). That is followed by the indices for that number of points. One of the cell types is a polyhedron. It follows the cell type with a count of the faces in the polyhedron. Then for that number of faces, each face is defined by a number of points (ordered counter-clockwise from the outside), followed by that many point indices.

Cell or CellIdx refers to the n-th cell defined in the cell stream. Internally, such an value is used to index into a secondary vector that defines the offsets into the cellstream where that cell begins and ends.

Edge refers to a simple structure that contains a pair of indices to points that are connected by at least one cell's points.

EdgeIdx refers to a particular ordering of the edges of a cell. For each cell type, there is a predefined way of connecting the points of cells of that type to form an Edge. The EdgeIdx is a convenient way to loop through that set of edges on a cell without actually collecting them into a vector.

Dimension refers to the kinds of connectivity a cell type will have. Cells that represent a single point have dimension 0. Those that connect into a curve have dimension 1. Those that connect to form a surface have dimension 2. Those that represent solids have dimension 3. (All of these cell types can exist in 3 dimensional space.)

Functions that just have one word, like GetLocations(), GetCellstream(), or GetExtents() return properties of the entire XmUGrid. Those that return properties of a particular cell will begin with the word "Cell" (and have a_cellIdx as their first argument) and end with type of related objects. For example: GetCellPoints(), GetCellLocations(), GetCellType(), GetCellDimension(), GetCellAdjacentCells(), etc.

Functions that begin with "Point" have a_pointIdx as their first argument return objects relative to that point, such GetPointLocation(), GetPointXy0(), GetPointAdjacentCells(), etc. (One could expect a function like PointEdges() or GetPointAdjacentPoints() to take a_pointIdx as the first argument return a vector of Edges or PointIdxs that connect to that point.)

Functions that return the number of objects in some scope end with the word "Count" preceded by the type of things being counted and optionally a scope. So GetPointCount() and GetCellCount() return the number of points and cells respectively in the XmUGrid, while GetCellPointCount() and GetCellEdgeCount() return the number of points or edges, respectively, in a specified cell.

There is a predefined ordering of faces within the solid cell types, so faceIdx refers to the face in that ordering. Methods containing the words Cell3d or Face are specific to solids (dimension 3 cells).

Some functions begin with two scoping words and take two input index arguments; for example: GetCellEdgeAdjacentCells() or GetCell3dFacePoints().

Definition at line 115 of file XmUGrid.h.

Constructor & Destructor Documentation

◆ XmUGrid() [1/2]

xms::XmUGrid::XmUGrid ( const XmUGrid a_xmUGrid)

Copy constructor.

Parameters
a_xmUGridThe XmUGrid to copy.

Definition at line 2903 of file XmUGrid.cpp.

References m_impl.

◆ XmUGrid() [2/2]

xms::XmUGrid::XmUGrid ( XmUGrid &&  a_xmUGrid)

Move constructor.

Parameters
a_xmUGridThe XmUGrid to move.

Definition at line 2912 of file XmUGrid.cpp.

References Swap().

Member Function Documentation

◆ GetCell2dEdgeAdjacentCell()

int xms::XmUGrid::GetCell2dEdgeAdjacentCell ( int  a_cellIdx,
int  a_edgeIdx 
) const

Get the index of the adjacent cells (that shares the same cell edge)

Parameters
[in]a_cellIdxthe index of the cell
[in]a_edgeIdxthe index of the edge
Returns
index of the adjacent cell (or -1 if none).

Definition at line 3469 of file XmUGrid.cpp.

References m_impl.

◆ GetCell3dFaceAdjacentCell() [1/2]

int xms::XmUGrid::GetCell3dFaceAdjacentCell ( int  a_cellIdx,
int  a_faceIdx 
) const

Get the cell face neighbors for given cell and face index.

Parameters
[in]a_cellIdxthe index of the cell
[in]a_faceIdxthe face index of the cell
Returns
a cell index of the neighbor

Definition at line 3595 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::ConnectedTopOrBottom(), and xms::XmUGrid::Impl::GetCell3dFaceAdjacentCell().

◆ GetCell3dFaceAdjacentCell() [2/2]

bool xms::XmUGrid::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.

Parameters
[in]a_cellIdxthe index of the cell
[in]a_faceIdxthe face index of the cell
[in]a_neighborCellthe index of the neighboring cell
[in]a_neighborFacethe face index of the neighboring cell adjacent to the given face
Returns
a cell index of the neighbor

Definition at line 3609 of file XmUGrid.cpp.

References m_impl.

◆ GetCell3dFaceCount()

int xms::XmUGrid::GetCell3dFaceCount ( int  a_cellIdx) const

Get the number of cell faces for given cell.

Parameters
[in]a_cellIdxthe index of the cell
Returns
the count of cell faces

Definition at line 3541 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCell3dFaceAdjacentCell(), xms::XmUGrid::Impl::GetCell3dFaceOrientation(), xms::XmUGrid::Impl::GetCell3dFacesPoints(), xms::XmUGrid::Impl::GetCellXySegments(), and xms::XmUGrid::Impl::VerticalOrientationFromOpposing().

◆ GetCell3dFaceOrientation()

XmUGridFaceOrientation xms::XmUGrid::GetCell3dFaceOrientation ( int  a_cellIdx,
int  a_faceIdx 
) const

Get the orientation of the face of a vertically prismatic cell.

Parameters
[in]a_cellIdxthe index of the cell
[in]a_faceIdxthe face index of the cell
Returns
The orientation of the face (TOP, BOTTOM, SIDE, UNKNOWN).

Definition at line 3623 of file XmUGrid.cpp.

References m_impl.

◆ GetCell3dFacePointCount()

int xms::XmUGrid::GetCell3dFacePointCount ( int  a_cellIdx,
int  a_faceIdx 
) const

Get the number of face points for a given cell and face.

Parameters
[in]a_cellIdxThe cell
[in]a_faceIdxThe face
Returns
The number of face points or -1 if invalid face or cell index.

Definition at line 3551 of file XmUGrid.cpp.

References m_impl.

◆ GetCell3dFacePoints() [1/2]

VecInt xms::XmUGrid::GetCell3dFacePoints ( int  a_cellIdx,
int  a_faceIdx 
) const

Get the cell face for given cell and face index.

Parameters
[in]a_cellIdxthe index of the cell
[in]a_faceIdxthe face index of the cell
Returns
a vector of point indices for the face index of the cell

Definition at line 3562 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCell3dFaceAdjacentCell(), xms::XmUGrid::Impl::GetCell3dFaceAdjacentCellNoCache(), xms::XmUGrid::Impl::GetCell3dFacePoints(), xms::XmUGrid::Impl::GetCell3dFacesPoints(), xms::XmUGrid::Impl::GetCellXySegments(), xms::XmUGrid::Impl::GetFaceXySegments(), xms::XmUGrid::Impl::GetOrientationFromArea(), and xms::XmUGrid::Impl::IsSideFace().

◆ GetCell3dFacePoints() [2/2]

void xms::XmUGrid::GetCell3dFacePoints ( int  a_cellIdx,
int  a_faceIdx,
VecInt a_facePtIdxs 
) const

Get the cell face for given cell and face index.

Parameters
[in]a_cellIdxthe index of the cell
[in]a_faceIdxthe face index of the cell
[out]a_facePtIdxsa vector of point indices for the face
Returns
a vector of point indices for the face index of the cell

Definition at line 3574 of file XmUGrid.cpp.

References m_impl.

◆ GetCell3dFacesPoints()

VecInt2d xms::XmUGrid::GetCell3dFacesPoints ( int  a_cellIdx) const

Get the faces of a cell.

Parameters
[in]a_cellIdxthe cells to whom the faces belong
Returns
a vector of faces, which is a vector of point indices

Definition at line 3584 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::IsCellValidWithPointChange().

◆ GetCellAdjacentCells() [1/2]

VecInt xms::XmUGrid::GetCellAdjacentCells ( int  a_cellIdx) const

Get the cells neighboring a cell (cells associated with any of it's points)

Parameters
[in]a_cellIdxthe index of the cell
Returns
vector of cell indices

Definition at line 3379 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCellAdjacentCells(), and xms::XmUGrid::Impl::GetCellEdgeAdjacentCells().

◆ GetCellAdjacentCells() [2/2]

void xms::XmUGrid::GetCellAdjacentCells ( int  a_cellIdx,
VecInt a_cellNeighbors 
) const

Get the cells neighboring a cell (cells associated with any of it's points)

Parameters
[in]a_cellIdxthe index of the cell
[out]a_cellNeighborsvector of cell indices

Definition at line 3389 of file XmUGrid.cpp.

References m_impl.

◆ GetCellCellstream()

bool xms::XmUGrid::GetCellCellstream ( int  a_cellIdx,
VecInt a_cellstream 
) const

Get cell stream vector for a single cell.

Parameters
[in]a_cellIdxthe index of the cell
[in]a_cellstreamThe cellstream of the cell
See also
GetCellstream for more detail on cell stream definitions.
Returns
whether it was successfull or not

Definition at line 3369 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCell3dFacePointCount(), xms::XmUGrid::Impl::GetCell3dFacePoints(), xms::XmUGrid::Impl::GetCellEdge(), xms::XmUGrid::Impl::GetCellPointCount(), xms::XmUGrid::Impl::GetCellPoints(), and xms::XmUGrid::Impl::GetNumberOfPolyhedronEdges().

◆ GetCellCentroid()

bool xms::XmUGrid::GetCellCentroid ( int  a_cellIdx,
Pt3d a_centroid 
) const

Get the centroid location of a cell.

Parameters
[in]a_cellIdxThe index of the cell.
[out]a_centroidThe location of the cell centroid.
Returns
False if the cell index does not exist.

Definition at line 3412 of file XmUGrid.cpp.

References m_impl.

◆ GetCellCount()

int xms::XmUGrid::GetCellCount ( ) const

Get the number of cells.

Returns
the number of cells

Definition at line 3248 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::CalculateCacheValues(), xms::XmUGrid::Impl::GetDimensionCounts(), and xms::XmUGrid::Impl::IsValidCellIdx().

◆ GetCellDimension()

int xms::XmUGrid::GetCellDimension ( int  a_cellIdx) const

Get the dimension of the specified cell.

Parameters
[in]a_cellIdxthe index of the cell
Returns
the dimension of the cells or -1 if invalid index or invalid dimension

Definition at line 3319 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCell2dEdgeAdjacentCell(), xms::XmUGrid::Impl::GetCellPlanViewPolygon(), xms::XmUGrid::Impl::GetDimensionCounts(), and xms::XmUGrid::Impl::IsCellValidWithPointChange().

◆ GetCellEdge()

XmEdge xms::XmUGrid::GetCellEdge ( int  a_cellIdx,
int  a_edgeIdx 
) const

Get the points of a cell.

Parameters
[in]a_cellIdxthe index of the cell
[in]a_edgeIdxthe index of the edge
Returns
a standard pair of point indices (which is an edge)

Definition at line 3433 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCell2dEdgeAdjacentCell(), xms::XmUGrid::Impl::GetCellEdgeAdjacentCells(), xms::XmUGrid::Impl::GetCellEdges(), and xms::XmUGrid::Impl::GetPointAdjacentPoints().

◆ GetCellEdgeAdjacentCells() [1/2]

VecInt xms::XmUGrid::GetCellEdgeAdjacentCells ( int  a_cellIdx,
int  a_edgeIdx 
) const

Get the index of the adjacent cells (that shares the same cell edge)

Parameters
[in]a_cellIdxthe index of the cell
[in]a_edgeIdxthe index of the edge
Returns
a vector of cell indices of the adjacent cells

Definition at line 3444 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCellEdgeAdjacentCells().

◆ GetCellEdgeAdjacentCells() [2/2]

void xms::XmUGrid::GetCellEdgeAdjacentCells ( int  a_cellIdx,
int  a_edgeIdx,
VecInt a_adjacentCellIdxs 
) const

Get the index of the adjacent cells (that shares the same cell edge)

Parameters
[in]a_cellIdxthe index of the cell
[in]a_edgeIdxthe index of the edge
[out]a_adjacentCellIdxsa vector of cell indices of the adjacent cells

Definition at line 3456 of file XmUGrid.cpp.

References m_impl.

◆ GetCellEdgeCount()

int xms::XmUGrid::GetCellEdgeCount ( int  a_cellIdx) const

Get the number of edges for a cell.

Parameters
[in]a_cellIdxthe index of the cell
Returns
the count of cell edges

Definition at line 3422 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCell2dEdgeAdjacentCell(), xms::XmUGrid::Impl::GetCellEdgeAdjacentCells(), xms::XmUGrid::Impl::GetCellEdges(), and xms::XmUGrid::Impl::GetPointAdjacentPoints().

◆ GetCellEdges() [1/2]

std::vector< XmEdge > xms::XmUGrid::GetCellEdges ( int  a_cellIdx) const

Get the Edges of a cell.

Parameters
[in]a_cellIdxthe cells to whom the edges belong
Returns
a vector of edges

Definition at line 3499 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCellEdges(), and xms::XmUGrid::Impl::IsCellValidWithPointChange().

◆ GetCellEdges() [2/2]

void xms::XmUGrid::GetCellEdges ( int  a_cellIdx,
std::vector< XmEdge > &  a_edges 
) const

Get the Edges of a cell.

Parameters
[in]a_cellIdxthe cells to whom the edges belong
[out]a_edgesa vector of edges

Definition at line 3509 of file XmUGrid.cpp.

References m_impl.

◆ GetCellExtents()

void xms::XmUGrid::GetCellExtents ( int  a_cellIdx,
Pt3d a_min,
Pt3d a_max 
) const

Get the extents of the given cell.

Parameters
[in]a_cellIdxThe cell index to get the extents of.
[out]a_minThe minimum location.
[out]a_maxThe maximum location.

Definition at line 3330 of file XmUGrid.cpp.

References m_impl.

◆ GetCellLocations()

void xms::XmUGrid::GetCellLocations ( int  a_cellIdx,
VecPt3d a_cellLocations 
) const

Get locations of cell points.

Parameters
[in]a_cellIdxthe index of the cell
[out]a_cellLocationsThe locations of the cell points

Definition at line 3289 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCellCentroid(), xms::XmUGrid::Impl::GetCellExtents(), and xms::XmUGrid::Impl::GetPlanViewPolygon2d().

◆ GetCellPlanViewPolygon()

bool xms::XmUGrid::GetCellPlanViewPolygon ( int  a_cellIdx,
VecPt3d a_polygon 
) const

Get a plan view polygon of a specified cell.

Parameters
[in]a_cellIdxThe index of the cell.
[out]a_polygonVector of Pt3d that is the plan view polygon.
Returns
False if the cell index does not exist or if the cell is not 2 or 3 dimensional.

Definition at line 3401 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCellCentroid().

◆ GetCellPointCount()

int xms::XmUGrid::GetCellPointCount ( int  a_cellIdx) const

Get the number of cell points (including polyhedron).

Parameters
[in]a_cellIdxthe index of the cell
Returns
a vector of point indices

Definition at line 3258 of file XmUGrid.cpp.

References m_impl.

◆ GetCellPoints() [1/2]

VecInt xms::XmUGrid::GetCellPoints ( int  a_cellIdx) const

Get the points of a cell (including polyhedron)

Parameters
[in]a_cellIdxthe index of the cell
Returns
a vector of point indices

Definition at line 3268 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCellAdjacentCells(), xms::XmUGrid::Impl::GetCellLocations(), xms::XmUGrid::Impl::GetCellPoints(), and xms::XmUGrid::Impl::GetPlanViewPolygon3d().

◆ GetCellPoints() [2/2]

bool xms::XmUGrid::GetCellPoints ( int  a_cellIdx,
VecInt a_cellPoints 
) const

Get the points of a cell.

Parameters
[in]a_cellIdxthe index of the cell
[out]a_cellPointsthe points of the cell
Returns
if the cell index is valid

Definition at line 3279 of file XmUGrid.cpp.

References m_impl.

◆ GetCellstream()

const VecInt & xms::XmUGrid::GetCellstream ( ) const

Get cell stream vector for the entire UGrid. A cellstream is defined as follows: Polyhedrons: Cell type, number of faces, [num points in face, point numbers (0-based, CCW when looking in)] repeated for each face. Hexahedrons, polygons, quads, triangles etc: Cell type (ElemTypeEnum), number of points, point numbers. Zero-based, CCW, bottom, then top. Not true for pixel or voxel.

Returns
constant reference to the cell stream vector

Definition at line 3346 of file XmUGrid.cpp.

References m_impl.

◆ GetCellType()

XmUGridCellType xms::XmUGrid::GetCellType ( int  a_cellIdx) const

◆ GetDimensionCounts()

std::vector< int > xms::XmUGrid::GetDimensionCounts ( ) const

Count all number of the cells with each dimenion (0, 1, 2, 3)

Returns
the count of dimensions of all of the cells of the ugrid

Definition at line 3308 of file XmUGrid.cpp.

References m_impl.

◆ GetEdgeAdjacentCells() [1/2]

void xms::XmUGrid::GetEdgeAdjacentCells ( const XmEdge a_edge,
VecInt a_adjacentCellIdxs 
) const

Get the indices of the adjacent cells (that shares the same cell edge)

Parameters
[in]a_edgethe edge (a pair of point indices)
[out]a_adjacentCellIdxsa vector of cell indices of the adjacent cells

Definition at line 3479 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetEdgeAdjacentCells().

◆ GetEdgeAdjacentCells() [2/2]

VecInt xms::XmUGrid::GetEdgeAdjacentCells ( const XmEdge a_edge) const

Get the index of the adjacent cells (that shares the same cell edge)

Parameters
[in]a_edgethe edge (a pair of point indices)
Returns
a vector of cell indices of the adjacent cells

Definition at line 3489 of file XmUGrid.cpp.

References m_impl.

◆ GetExtents()

void xms::XmUGrid::GetExtents ( Pt3d a_min,
Pt3d a_max 
) const

Get extents of all points in UGrid.

Parameters
[out]a_minminimum extent of all points
[out]a_maxmaximum extent of all points

Definition at line 3161 of file XmUGrid.cpp.

References m_impl.

◆ GetLocations()

const VecPt3d & xms::XmUGrid::GetLocations ( ) const

Get vector of UGrid points.

Returns
a vector of point locations

Definition at line 3101 of file XmUGrid.cpp.

References m_impl.

Referenced by XmUGridUnitTests::testOperators().

◆ GetModified()

bool xms::XmUGrid::GetModified ( ) const

Returns the modified flag. Gets set when points or cells get changed.

Returns
the modified flag

Definition at line 3064 of file XmUGrid.cpp.

References m_impl.

◆ GetPointAdjacentCellCount()

int xms::XmUGrid::GetPointAdjacentCellCount ( int  a_pointIdx) const

Get the number of cells that use a point.

Parameters
a_pointIdxThe point to check.
Returns
The number of cells that use the point.

Definition at line 3171 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCell2dEdgeAdjacentCell(), and xms::XmUGrid::Impl::GetPointAdjacentCells().

◆ GetPointAdjacentCells() [1/2]

VecInt xms::XmUGrid::GetPointAdjacentCells ( int  a_pointIdx) const

Get the cells that are associated with the specified point.

Parameters
[in]a_pointIdxthe index of the point
Returns
a vector of the cell indices associated with this point

Definition at line 3181 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCellAdjacentCells(), xms::XmUGrid::Impl::GetPointAdjacentCells(), xms::XmUGrid::Impl::GetPointAdjacentPoints(), xms::XmUGrid::Impl::GetPointsAdjacentCells(), and xms::XmUGrid::Impl::IsValidPointChange().

◆ GetPointAdjacentCells() [2/2]

void xms::XmUGrid::GetPointAdjacentCells ( int  a_pointIdx,
VecInt a_adjacentCells 
) const

Get the cells that are associated with the specified point.

Parameters
[in]a_pointIdxthe index of the point
[out]a_adjacentCellsa vector of the adjacent cell indices
Returns
a vector of the cell indices associated with this point

Definition at line 3192 of file XmUGrid.cpp.

References m_impl.

◆ GetPointAdjacentLocations()

void xms::XmUGrid::GetPointAdjacentLocations ( int  a_pointIdx,
VecPt3d a_edgePoints 
) const

Given a point gets point locations attached to the point by an edge.

Parameters
[in]a_pointIdxThe point to get attached point from.
[out]a_edgePointsA vector of points attached across edges.

Definition at line 3529 of file XmUGrid.cpp.

References m_impl.

◆ GetPointAdjacentPoints()

void xms::XmUGrid::GetPointAdjacentPoints ( int  a_pointIdx,
VecInt a_edgePoints 
) const

Given a point gets point indices attached to the point by an edge.

Parameters
[in]a_pointIdxThe point to get adjacent points from.
[out]a_edgePointsThe indices of the adjacent points.

Definition at line 3519 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetPointAdjacentLocations().

◆ GetPointCount()

int xms::XmUGrid::GetPointCount ( ) const

Get the number of points.

Returns
the number of points

Definition at line 3092 of file XmUGrid.cpp.

References m_impl.

◆ GetPointLocation()

Pt3d xms::XmUGrid::GetPointLocation ( int  a_pointIdx) const

Get the point.

Parameters
[in]a_pointIdxthe index of the point
Returns
the point or an initialize point if the index is invalid

Definition at line 3120 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::DoEdgesCrossWithPointChange(), xms::XmUGrid::Impl::GetPlanViewPolygon3d(), xms::XmUGrid::Impl::GetPointsLocations(), xms::XmUGrid::Impl::GetPointXy0(), and xms::XmUGrid::Impl::IsFaceSide().

◆ GetPointsAdjacentCells() [1/3]

VecInt xms::XmUGrid::GetPointsAdjacentCells ( const VecInt a_points) const

Gets the common cells from a vector of points.

Parameters
[in]a_pointsa vector of unique points
Returns
a vector of cell indices

Definition at line 3202 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCell3dFaceAdjacentCellNoCache(), xms::XmUGrid::Impl::GetEdgeAdjacentCells(), and xms::XmUGrid::Impl::GetPointsAdjacentCells().

◆ GetPointsAdjacentCells() [2/3]

void xms::XmUGrid::GetPointsAdjacentCells ( const VecInt a_pointIdxs,
VecInt a_adjacentCellIdxs 
) const

Gets the cells adjacent to all of a vector of points.

Parameters
[in]a_pointIdxsan array of point indices
[out]a_adjacentCellIdxsa vector of cell indices

Definition at line 3211 of file XmUGrid.cpp.

References m_impl.

◆ GetPointsAdjacentCells() [3/3]

void xms::XmUGrid::GetPointsAdjacentCells ( int  a_pointIdx1,
int  a_pointIdx2,
VecInt a_adjacentCellIdxs 
) const

Gets the cells adjacent to both of the two points.

Parameters
[in]a_pointIdx1first point index
[in]a_pointIdx2second point index
[out]a_adjacentCellIdxsa vector of cell indices

Definition at line 3224 of file XmUGrid.cpp.

References m_impl.

◆ GetPointsLocations()

VecPt3d xms::XmUGrid::GetPointsLocations ( const VecInt a_points) const

Convert a vector of point indices into a vector of point 3d.

Parameters
[in]a_pointsa vector of point indices
Returns
vector of point 3d

Definition at line 3151 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetCellLocations(), and xms::XmUGrid::Impl::GetPointAdjacentLocations().

◆ GetPointXy0()

Pt3d xms::XmUGrid::GetPointXy0 ( int  a_pointIdx) const

Get the X, Y location of a point.

Parameters
[in]a_pointIdxThe index of the point.
Returns
The location of the point with Z set to 0.0.

Definition at line 3141 of file XmUGrid.cpp.

References m_impl.

Referenced by xms::XmUGrid::Impl::GetFacePointSegments(), xms::XmUGrid::Impl::GetNextFaceColumn(), xms::XmUGrid::Impl::GetOrientationFromArea(), and xms::XmUGrid::Impl::IsSideFace().

◆ IsValidCellstream()

bool xms::XmUGrid::IsValidCellstream ( const VecInt a_cellstream)
static

Check a cell stream to make sure it's valid. Compares cell type against expected number of points.

Parameters
[in]a_cellstreamthe cell stream to check
Returns
true if cell stream is valid

Definition at line 2947 of file XmUGrid.cpp.

Referenced by xms::XmUGrid::Impl::SetCellstream(), and XmUGridUnitTests::testUGridStreams().

◆ IsValidPointChange()

bool xms::XmUGrid::IsValidPointChange ( int  a_changedPtIdx,
const Pt3d a_newPosition 
) const

Determine whether adjacent cells are valid after a point is moved.

Parameters
[in]a_changedPtIdxindex of the point to be changed
[in]a_newPositionlocation the point is to be moved to
Returns
whether the change is valid

Definition at line 3239 of file XmUGrid.cpp.

References m_impl.

◆ New() [1/2]

std::shared_ptr< XmUGrid > xms::XmUGrid::New ( const VecPt3d a_locations,
const VecInt a_cellstream 
)
static

Create a new XmUGrid.

Parameters
[in]a_locationsthe UGrid points
[in]a_cellstreamthe UGrid cell stream
Returns
the new XmUGrid.

Definition at line 2885 of file XmUGrid.cpp.

References New().

◆ New() [2/2]

◆ operator=()

XmUGrid & xms::XmUGrid::operator= ( XmUGrid  a_xmUGrid)

Assignment operator.

Parameters
a_xmUGridThe XmUGrid to copy from.
Returns
The reference to this.

Definition at line 2928 of file XmUGrid.cpp.

References Swap().

◆ SetCellstream()

bool xms::XmUGrid::SetCellstream ( const VecInt a_cellstream)

Set the ugrid cells for the entire UGrid using a cell stream.

Parameters
[in]a_cellstreamThe cellstream for the UGrid.
See also
CellStream
Returns
if successfully set

Definition at line 3357 of file XmUGrid.cpp.

References m_impl.

◆ SetLocations()

void xms::XmUGrid::SetLocations ( const VecPt3d a_locations)

Set UGrid points.

Parameters
[in]a_locationsvector of point locations

Definition at line 3110 of file XmUGrid.cpp.

References m_impl.

◆ SetPointLocation()

bool xms::XmUGrid::SetPointLocation ( int  a_pointIdx,
const Pt3d a_location 
)

Set the point.

Parameters
[in]a_pointIdxthe index of the point
[in]a_locationThe new location of the specified point
Returns
whether the point was successfully set

Definition at line 3131 of file XmUGrid.cpp.

References m_impl.

◆ SetUseCache()

void xms::XmUGrid::SetUseCache ( bool  a_useCache)

Turn on or off use of caching to speed up some operations.

Parameters
a_useCacheFlag to determine if caching will be used.

Definition at line 3081 of file XmUGrid.cpp.

References m_impl.

◆ Swap()

void xms::XmUGrid::Swap ( XmUGrid a_xmUGrid)

Swap data between two XmUGrids.

Parameters
a_xmUGridThe other XmUGrid.

Definition at line 2937 of file XmUGrid.cpp.

References m_impl.

Referenced by operator=(), and XmUGrid().


The documentation for this class was generated from the following files: