xmsextractor
1.0
|
Implementation for XmUGrid2dDataExtractor. More...
Public Member Functions | |
XmUGrid2dDataExtractorImpl (std::shared_ptr< XmUGrid > a_ugrid) | |
Construct from a UGrid. More... | |
XmUGrid2dDataExtractorImpl (BSHP< XmUGrid2dDataExtractorImpl > a_extractor) | |
Create a new XmUGrid2dDataExtractorImpl using shallow copy from existing extractor. More... | |
virtual void | SetGridPointScalars (const VecFlt &a_pointScalars, const DynBitset &a_activity, DataLocationEnum a_activityLocation) override |
Setup point scalars to be used to extract interpolated data. More... | |
virtual void | SetGridCellScalars (const VecFlt &a_cellScalars, const DynBitset &a_activity, DataLocationEnum a_activityLocation) override |
Setup cell scalars to be used to extract interpolated data. More... | |
virtual void | SetExtractLocations (const VecPt3d &a_locations) override |
Sets locations of points to extract interpolated scalar data from. More... | |
virtual void | ExtractData (VecFlt &a_outData) override |
Extract interpolated data for the previously set locations. More... | |
virtual float | ExtractAtLocation (const Pt3d &a_location) override |
Extract interpolated data for the previously set locations. More... | |
virtual void | SetUseIdwForPointData (bool a_) override |
Set to use IDW to calculate point scalar values from cell scalars. More... | |
virtual void | SetNoDataValue (float a_value) override |
Set value to use when extracted value is in inactive cell or doesn't intersect with the grid. More... | |
virtual void | BuildTriangles (DataLocationEnum a_location) override |
Build triangles for UGrid for either point or cell scalars. More... | |
virtual const BSHP< XmUGridTriangles2d > | GetUGridTriangles () const override |
Get the UGrid triangles. More... | |
virtual const VecFlt & | GetScalars () const override |
Gets the scalars. More... | |
virtual DataLocationEnum | GetScalarLocation () const override |
Gets the location of the scalars (points or cells) More... | |
virtual const VecPt3d & | GetExtractLocations () const override |
Gets locations of points to extract interpolated scalar data from. More... | |
virtual const VecInt & | GetCellIndexes () const |
Gets cell indexes associated with the extract location points. More... | |
virtual bool | GetUseIdwForPointData () const override |
Gets the option for using IDW for point data. More... | |
virtual float | GetNoDataValue () const override |
Gets the no data value. More... | |
Public Member Functions inherited from xms::XmUGrid2dDataExtractor | |
virtual | ~XmUGrid2dDataExtractor () |
Destructor. | |
Private Member Functions | |
void | ApplyActivity (const DynBitset &a_activity, DataLocationEnum a_location, DynBitset &a_cellActivity) |
Apply point or cell activity to triangles. More... | |
void | SetGridPointActivity (const DynBitset &a_pointActivity, DynBitset &a_cellActivity) |
Set point activity. Turns off each cell attached to an inactive point. More... | |
void | SetGridCellActivity (const DynBitset &a_cellActivity) |
Set activity on cells. More... | |
void | PushPointDataToCentroids (const DynBitset &a_cellActivity) |
Push point scalar data to cell centroids using average. More... | |
void | PushCellDataToTrianglePoints (const VecFlt &a_cellScalars, const DynBitset &a_cellActivity) |
Push cell scalar data to triangle points using cells connected to a point with average or IDW. More... | |
float | CalculatePointByAverage (const VecInt &a_cellIdxs, const VecFlt &a_cellScalars, const DynBitset &a_cellActivity) |
Calculate the average of the cell values connected to a point. More... | |
float | CalculatePointByIdw (int a_pointIdx, const VecInt &a_cellIdxs, const VecFlt &a_cellScalars, const DynBitset &a_cellActivity) |
Calculate the point value by IDW method from surrounding cells. More... | |
Private Attributes | |
std::shared_ptr< XmUGrid > | m_ugrid |
UGrid for dataset. | |
DataLocationEnum | m_triangleType |
if triangles been generated for points or cells | |
BSHP< XmUGridTriangles2d > | m_triangles |
triangles generated from UGrid to use for data extraction | |
VecPt3d | m_extractLocations |
output locations for interpolated values | |
VecFlt | m_pointScalars |
scalars to interpolate from | |
VecInt | m_cellIdxs |
ugrid cell indexes | |
bool | m_useIdwForPointData |
use IDW to calculate point data from cell data | |
float | m_noDataValue |
value to use for inactive result | |
Additional Inherited Members | |
Static Public Member Functions inherited from xms::XmUGrid2dDataExtractor | |
static BSHP< XmUGrid2dDataExtractor > | New (std::shared_ptr< XmUGrid > a_ugrid) |
Create a new XmUGrid2dDataExtractor. More... | |
static BSHP< XmUGrid2dDataExtractor > | New (BSHP< XmUGrid2dDataExtractor > a_extractor) |
Create a new XmUGrid2dDataExtractor using shallow copy from existing extractor. More... | |
Protected Member Functions inherited from xms::XmUGrid2dDataExtractor | |
XmUGrid2dDataExtractor () | |
Constructor. | |
Implementation for XmUGrid2dDataExtractor.
Implementation for XmUGrid2dDataExtractor which provides ability to extract dataset values at points for an unstructured grid.
Definition at line 52 of file XmUGrid2dDataExtractor.cpp.
xms::XmUGrid2dDataExtractorImpl::XmUGrid2dDataExtractorImpl | ( | std::shared_ptr< XmUGrid > | a_ugrid | ) |
Construct from a UGrid.
[in] | a_ugrid | The UGrid to construct an extractor for. |
Definition at line 130 of file XmUGrid2dDataExtractor.cpp.
xms::XmUGrid2dDataExtractorImpl::XmUGrid2dDataExtractorImpl | ( | BSHP< XmUGrid2dDataExtractorImpl > | a_extractor | ) |
Create a new XmUGrid2dDataExtractorImpl using shallow copy from existing extractor.
[in] | a_extractor | The extractor to shallow copy |
Definition at line 147 of file XmUGrid2dDataExtractor.cpp.
|
private |
Apply point or cell activity to triangles.
[in] | a_activity | The activity of the scalar values. |
[in] | a_location | The location of the activity (cells or points). |
[out] | a_cellActivity | The cell activity of the scalar values. |
Definition at line 285 of file XmUGrid2dDataExtractor.cpp.
References SetGridCellActivity(), and SetGridPointActivity().
Referenced by SetGridCellScalars(), and SetGridPointScalars().
|
overridevirtual |
Build triangles for UGrid for either point or cell scalars.
[in] | a_location | Location to build on (points or cells). |
Implements xms::XmUGrid2dDataExtractor.
Definition at line 496 of file XmUGrid2dDataExtractor.cpp.
References m_triangles, m_triangleType, and m_ugrid.
Referenced by SetGridCellScalars(), and SetGridPointScalars().
|
private |
Calculate the average of the cell values connected to a point.
[in] | a_cellIdxs | the cells surrounding the point. |
[in] | a_cellScalars | the cell scalar values. |
[in] | a_cellActivity | the cell activity vector. |
Definition at line 427 of file XmUGrid2dDataExtractor.cpp.
References m_noDataValue.
Referenced by CalculatePointByIdw(), and PushCellDataToTrianglePoints().
|
private |
Calculate the point value by IDW method from surrounding cells.
[in] | a_pointIdx | the point to calculate the value for. |
[in] | a_cellIdxs | the cells surrounding the point. |
[in] | a_cellScalars | the cell scalar values. |
[in] | a_cellActivity | the cell activity vector. |
Definition at line 456 of file XmUGrid2dDataExtractor.cpp.
References CalculatePointByAverage(), m_triangles, and m_ugrid.
Referenced by PushCellDataToTrianglePoints().
|
overridevirtual |
Extract interpolated data for the previously set locations.
[in] | a_location | The location to get the interpolated scalar. |
Implements xms::XmUGrid2dDataExtractor.
Definition at line 254 of file XmUGrid2dDataExtractor.cpp.
References ExtractData(), and SetExtractLocations().
|
overridevirtual |
Extract interpolated data for the previously set locations.
[out] | a_outData | The interpolated scalars. |
Implements xms::XmUGrid2dDataExtractor.
Definition at line 217 of file XmUGrid2dDataExtractor.cpp.
References m_cellIdxs, m_extractLocations, m_noDataValue, m_pointScalars, and m_triangles.
Referenced by ExtractAtLocation().
|
inlinevirtual |
Gets cell indexes associated with the extract location points.
Implements xms::XmUGrid2dDataExtractor.
Definition at line 86 of file XmUGrid2dDataExtractor.cpp.
References m_cellIdxs.
|
inlineoverridevirtual |
Gets locations of points to extract interpolated scalar data from.
Implements xms::XmUGrid2dDataExtractor.
Definition at line 83 of file XmUGrid2dDataExtractor.cpp.
References m_extractLocations.
|
inlineoverridevirtual |
Gets the no data value.
Implements xms::XmUGrid2dDataExtractor.
Definition at line 92 of file XmUGrid2dDataExtractor.cpp.
References m_noDataValue.
|
inlineoverridevirtual |
Gets the location of the scalars (points or cells)
Implements xms::XmUGrid2dDataExtractor.
Definition at line 80 of file XmUGrid2dDataExtractor.cpp.
References m_triangleType.
|
inlineoverridevirtual |
Gets the scalars.
Implements xms::XmUGrid2dDataExtractor.
Definition at line 77 of file XmUGrid2dDataExtractor.cpp.
References m_pointScalars.
|
overridevirtual |
Get the UGrid triangles.
Implements xms::XmUGrid2dDataExtractor.
Definition at line 509 of file XmUGrid2dDataExtractor.cpp.
References m_triangles.
|
inlineoverridevirtual |
Gets the option for using IDW for point data.
Implements xms::XmUGrid2dDataExtractor.
Definition at line 89 of file XmUGrid2dDataExtractor.cpp.
References m_useIdwForPointData.
|
private |
Push cell scalar data to triangle points using cells connected to a point with average or IDW.
[in] | a_cellScalars | the cell scalar values. |
[in] | a_cellActivity | the cell activity vector. |
Definition at line 392 of file XmUGrid2dDataExtractor.cpp.
References CalculatePointByAverage(), CalculatePointByIdw(), m_pointScalars, m_triangles, m_ugrid, and m_useIdwForPointData.
Referenced by SetGridCellScalars().
|
private |
Push point scalar data to cell centroids using average.
[in] | a_cellActivity | The cell activity of the scalar values. |
Definition at line 362 of file XmUGrid2dDataExtractor.cpp.
References m_pointScalars, m_triangles, and m_ugrid.
Referenced by SetGridPointScalars().
|
overridevirtual |
Sets locations of points to extract interpolated scalar data from.
[in] | a_locations | The locations. |
Implements xms::XmUGrid2dDataExtractor.
Definition at line 209 of file XmUGrid2dDataExtractor.cpp.
References m_extractLocations.
Referenced by ExtractAtLocation().
|
private |
Set activity on cells.
[in] | a_cellActivity | The cell activity of the scalar values. |
Definition at line 350 of file XmUGrid2dDataExtractor.cpp.
References m_triangles, and m_ugrid.
Referenced by ApplyActivity().
|
overridevirtual |
Setup cell scalars to be used to extract interpolated data.
[in] | a_cellScalars | The point scalars. |
[in] | a_activity | The activity of the cells. |
[in] | a_activityLocation | The location at which the data is currently stored. |
Implements xms::XmUGrid2dDataExtractor.
Definition at line 189 of file XmUGrid2dDataExtractor.cpp.
References ApplyActivity(), BuildTriangles(), m_ugrid, and PushCellDataToTrianglePoints().
|
private |
Set point activity. Turns off each cell attached to an inactive point.
[in] | a_pointActivity | The activity for the UGrid points. |
[out] | a_cellActivity | The resulting activity transfered to the cells. |
Definition at line 314 of file XmUGrid2dDataExtractor.cpp.
References m_triangles, and m_ugrid.
Referenced by ApplyActivity().
|
overridevirtual |
Setup point scalars to be used to extract interpolated data.
[in] | a_pointScalars | The point scalars. |
[in] | a_activity | The activity of the cells. |
[in] | a_activityLocation | The location at which the data is currently stored. |
Implements xms::XmUGrid2dDataExtractor.
Definition at line 165 of file XmUGrid2dDataExtractor.cpp.
References ApplyActivity(), BuildTriangles(), m_pointScalars, m_ugrid, and PushPointDataToCentroids().
|
overridevirtual |
Set value to use when extracted value is in inactive cell or doesn't intersect with the grid.
[in] | a_value | The no data value |
Implements xms::XmUGrid2dDataExtractor.
Definition at line 275 of file XmUGrid2dDataExtractor.cpp.
References m_noDataValue.
|
overridevirtual |
Set to use IDW to calculate point scalar values from cell scalars.
a_useIdw | Whether to turn IDW on or off. |
Implements xms::XmUGrid2dDataExtractor.
Definition at line 266 of file XmUGrid2dDataExtractor.cpp.
References m_useIdwForPointData.