34 XMU_INVALID_CELL_TYPE = -1,
43 XMU_TRIANGLE_STRIP = 6,
52 XMU_PENTAGONAL_PRISM = 15,
53 XMU_HEXAGONAL_PRISM = 16,
56 XMU_QUADRATIC_EDGE = 21,
57 XMU_QUADRATIC_TRIANGLE = 22,
58 XMU_QUADRATIC_QUAD = 23,
59 XMU_QUADRATIC_POLYGON = 36,
60 XMU_QUADRATIC_TETRA = 24,
61 XMU_QUADRATIC_HEXAHEDRON = 25,
62 XMU_QUADRATIC_WEDGE = 26,
63 XMU_QUADRATIC_PYRAMID = 27,
64 XMU_BIQUADRATIC_QUAD = 28,
65 XMU_TRIQUADRATIC_HEXAHEDRON = 29,
66 XMU_QUADRATIC_LINEAR_QUAD = 30,
67 XMU_QUADRATIC_LINEAR_WEDGE = 31,
68 XMU_BIQUADRATIC_QUADRATIC_WEDGE = 32,
69 XMU_BIQUADRATIC_QUADRATIC_HEXAHEDRON = 33,
70 XMU_BIQUADRATIC_TRIANGLE = 34,
76 XMU_CONVEX_POINT_SET = 41,
82 XMU_PARAMETRIC_CURVE = 51,
83 XMU_PARAMETRIC_SURFACE = 52,
84 XMU_PARAMETRIC_TRI_SURFACE = 53,
85 XMU_PARAMETRIC_QUAD_SURFACE = 54,
86 XMU_PARAMETRIC_TETRA_REGION = 55,
87 XMU_PARAMETRIC_HEX_REGION = 56,
90 XMU_HIGHER_ORDER_EDGE = 60,
91 XMU_HIGHER_ORDER_TRIANGLE = 61,
92 XMU_HIGHER_ORDER_QUAD = 62,
93 XMU_HIGHER_ORDER_POLYGON = 63,
94 XMU_HIGHER_ORDER_TETRAHEDRON = 64,
95 XMU_HIGHER_ORDER_WEDGE = 65,
96 XMU_HIGHER_ORDER_PYRAMID = 66,
97 XMU_HIGHER_ORDER_HEXAHEDRON = 67,
99 XMU_NUMBER_OF_CELL_TYPES
105 XMU_ORIENTATION_UNKNOWN = -1,
106 XMU_ORIENTATION_SIDE = 0,
107 XMU_ORIENTATION_TOP = 1,
108 XMU_ORIENTATION_BOTTOM = 2,
109 XMU_ORIENTATION_NUMBER
118 static std::shared_ptr<XmUGrid>
New(
const VecPt3d& a_locations,
const VecInt& a_cellstream);
119 static std::shared_ptr<XmUGrid>
New();
176 void GetCellEdges(
int a_cellIdx, std::vector<XmEdge>& a_edges)
const;
190 int& a_neighborFace)
const;
195 std::unique_ptr<Impl>
m_impl;
210 const xms::Pt3d& a_origin);
215 const xms::Pt3d& a_origin);
std::shared_ptr< XmUGrid > TEST_XmUGrid1Left90Tri()
Builds a 1 cell (left 90 degree triangle) 2D XmUGrid for testing.
VecInt GetCellEdgeAdjacentCells(int a_cellIdx, int a_edgeIdx) const
Get the index of the adjacent cells (that shares the same cell edge)
std::shared_ptr< XmUGrid > TEST_XmUGrid3dLinear()
Builds an XmUGrid with supported 3D linear cells for testing.
VecInt GetCellAdjacentCells(int a_cellIdx) const
Get the cells neighboring a cell (cells associated with any of it's points)
bool SetCellstream(const VecInt &a_cellstream)
Set the ugrid cells for the entire UGrid using a cell stream.
bool GetCellCentroid(int a_cellIdx, Pt3d &a_centroid) const
Get the centroid location of a cell.
std::shared_ptr< xms::XmUGrid > TEST_XmUBuildHexahedronUgrid(int a_rows, int a_cols, int a_lays)
Builds a UGrid of Quads at 1 spacing for rows & cols specified.
Implementation for XmUGrid.
std::vector< int > VecInt
XmUGrid & operator=(XmUGrid a_xmUGrid)
Assignment operator.
int GetCellEdgeCount(int a_cellIdx) const
Get the number of edges for a cell.
Pt3d GetPointXy0(int a_pointIdx) const
Get the X, Y location of a point.
std::shared_ptr< xms::XmUGrid > TEST_XmUBuildPolyhedronUgrid(int a_rows, int a_cols, int a_lays)
Builds a UGrid of Quads at 1 spacing for rows & cols specified.
XmUGridCellType
Matches cell types from VTK (see vtkCellType.h)
std::shared_ptr< XmUGrid > TEST_XmUGridSimpleQuad()
Builds a 2 cell (Quad) 2D XmUGrid for testing.
VecInt GetPointsAdjacentCells(const VecInt &a_points) const
Gets the common cells from a vector of points.
bool IsValidPointChange(int a_changedPtIdx, const Pt3d &a_newPosition) const
Determine whether adjacent cells are valid after a point is moved.
Pt3d GetPointLocation(int a_pointIdx) const
Get the point.
const VecPt3d & GetLocations() const
Get vector of UGrid points.
int GetCellDimension(int a_cellIdx) const
Get the dimension of the specified cell.
std::shared_ptr< XmUGrid > TEST_XmUGrid2dLinear()
Builds an XmUGrid with supported 1D and 2D linear cells for testing.
std::unique_ptr< Impl > m_impl
implementation
void SetUseCache(bool a_useCache)
Turn on or off use of caching to speed up some operations.
void Swap(XmUGrid &a_xmUGrid)
Swap data between two XmUGrids.
int GetCellCount() const
Get the number of cells.
int GetCell3dFaceCount(int a_cellIdx) const
Get the number of cell faces for given cell.
std::vector< VecInt > VecInt2d
void SetUnmodified()
Resets the modified flag to false.
std::vector< int > GetDimensionCounts() const
Count all number of the cells with each dimenion (0, 1, 2, 3)
std::shared_ptr< XmUGrid > TEST_XmUGridHexagonalPolyhedron()
Builds a 1 cell hexagon with cell type polyhedron.
void GetCellExtents(int a_cellIdx, Pt3d &a_min, Pt3d &a_max) const
Get the extents of the given cell.
int GetCellPointCount(int a_cellIdx) const
Get the number of cell points (including polyhedron).
VecInt GetPointAdjacentCells(int a_pointIdx) const
Get the cells that are associated with the specified point.
bool GetModified() const
Returns the modified flag. Gets set when points or cells get changed.
void GetCellLocations(int a_cellIdx, VecPt3d &a_cellLocations) const
Get locations of cell points.
XmEdge GetCellEdge(int a_cellIdx, int a_edgeIdx) const
Get the points of a cell.
std::shared_ptr< xms::XmUGrid > TEST_XmUBuildQuadUGrid(int a_rows, int a_cols)
Builds a UGrid of Quads at 1 spacing for rows & cols specified.
Two integer values representing an edge of an XmUGrid. By default has a direction. Can be sorted to have minimum index first.
Geometry for an unstructured grid. An XmUGrid is defined as a vector of 3d points and a stream of cel...
XmUGridFaceOrientation
The orientation of a 3D face must be one of these.
std::shared_ptr< xms::XmUGrid > TEST_XmUBuild3DChevronUgrid()
Builds a UGrid with one 3D Chevron polyhedron.
void GetExtents(Pt3d &a_min, Pt3d &a_max) const
Get extents of all points in UGrid.
void SetLocations(const VecPt3d &a_locations)
Set UGrid points.
bool GetCellPlanViewPolygon(int a_cellIdx, VecPt3d &a_polygon) const
Get a plan view polygon of a specified cell.
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...
int GetPointAdjacentCellCount(int a_pointIdx) const
Get the number of cells that use a point.
const VecInt & GetCellstream() const
Get cell stream vector for the entire UGrid. A cellstream is defined as follows: Polyhedrons: Cell ty...
VecInt GetCellPoints(int a_cellIdx) const
Get the points of a cell (including polyhedron)
VecInt GetCell3dFacePoints(int a_cellIdx, int a_faceIdx) const
Get the cell face for given cell and face index.
int GetCell2dEdgeAdjacentCell(int a_cellIdx, int a_edgeIdx) const
Get the index of the adjacent cells (that shares the same cell edge)
void GetEdgeAdjacentCells(const XmEdge &a_edge, VecInt &a_adjacentCellIdxs) const
Get the indices of the adjacent cells (that shares the same cell edge)
XmUGridFaceOrientation GetCell3dFaceOrientation(int a_cellIdx, int a_faceIdx) const
Get the orientation of the face of a vertically prismatic cell.
void GetPointAdjacentLocations(int a_pointIdx, VecPt3d &a_edgePoints) const
Given a point gets point locations attached to the point by an edge.
VecInt2d GetCell3dFacesPoints(int a_cellIdx) const
Get the faces of a cell.
int GetCell3dFaceAdjacentCell(int a_cellIdx, int a_faceIdx) const
Get the cell face neighbors for given cell and face index.
XmUGridCellType GetCellType(int a_cellIdx) const
Get the number of cells.
int GetPointCount() const
Get the number of points.
static std::shared_ptr< XmUGrid > New()
Create a new XmUGrid.
VecPt3d GetPointsLocations(const VecInt &a_points) const
Convert a vector of point indices into a vector of point 3d.
void GetPointAdjacentPoints(int a_pointIdx, VecInt &a_edgePoints) const
Given a point gets point indices attached to the point by an edge.
bool SetPointLocation(int a_pointIdx, const Pt3d &a_location)
Set the point.
std::vector< XmEdge > GetCellEdges(int a_cellIdx) const
Get the Edges of a cell.
int GetCell3dFacePointCount(int a_cellIdx, int a_faceIdx) const
Get the number of face points for a given cell and face.
bool GetCellCellstream(int a_cellIdx, VecInt &a_cellstream) const
Get cell stream vector for a single cell.
std::vector< Pt3d > VecPt3d