xmsextractor  1.0
xms::XmUGrid2dDataExtractorImpl Class Reference

Implementation for XmUGrid2dDataExtractor. More...

Inheritance diagram for xms::XmUGrid2dDataExtractorImpl:
xms::XmUGrid2dDataExtractor

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< XmUGridTriangles2dGetUGridTriangles () 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< XmUGridTriangles2dm_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< XmUGrid2dDataExtractorNew (std::shared_ptr< XmUGrid > a_ugrid)
 Create a new XmUGrid2dDataExtractor. More...
 
static BSHP< XmUGrid2dDataExtractorNew (BSHP< XmUGrid2dDataExtractor > a_extractor)
 Create a new XmUGrid2dDataExtractor using shallow copy from existing extractor. More...
 
- Protected Member Functions inherited from xms::XmUGrid2dDataExtractor
 XmUGrid2dDataExtractor ()
 Constructor.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ XmUGrid2dDataExtractorImpl() [1/2]

xms::XmUGrid2dDataExtractorImpl::XmUGrid2dDataExtractorImpl ( std::shared_ptr< XmUGrid >  a_ugrid)

Construct from a UGrid.

Parameters
[in]a_ugridThe UGrid to construct an extractor for.

Definition at line 130 of file XmUGrid2dDataExtractor.cpp.

◆ XmUGrid2dDataExtractorImpl() [2/2]

xms::XmUGrid2dDataExtractorImpl::XmUGrid2dDataExtractorImpl ( BSHP< XmUGrid2dDataExtractorImpl a_extractor)

Create a new XmUGrid2dDataExtractorImpl using shallow copy from existing extractor.

Parameters
[in]a_extractorThe extractor to shallow copy
Returns
the new XmUGrid2dDataExtractorImpl.

Definition at line 147 of file XmUGrid2dDataExtractor.cpp.

Member Function Documentation

◆ ApplyActivity()

void xms::XmUGrid2dDataExtractorImpl::ApplyActivity ( const DynBitset &  a_activity,
DataLocationEnum  a_location,
DynBitset &  a_cellActivity 
)
private

Apply point or cell activity to triangles.

Parameters
[in]a_activityThe activity of the scalar values.
[in]a_locationThe location of the activity (cells or points).
[out]a_cellActivityThe cell activity of the scalar values.

Definition at line 285 of file XmUGrid2dDataExtractor.cpp.

References SetGridCellActivity(), and SetGridPointActivity().

Referenced by SetGridCellScalars(), and SetGridPointScalars().

◆ BuildTriangles()

void xms::XmUGrid2dDataExtractorImpl::BuildTriangles ( DataLocationEnum  a_location)
overridevirtual

Build triangles for UGrid for either point or cell scalars.

Parameters
[in]a_locationLocation 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().

◆ CalculatePointByAverage()

float xms::XmUGrid2dDataExtractorImpl::CalculatePointByAverage ( const VecInt &  a_cellIdxs,
const VecFlt &  a_cellScalars,
const DynBitset &  a_cellActivity 
)
private

Calculate the average of the cell values connected to a point.

Parameters
[in]a_cellIdxsthe cells surrounding the point.
[in]a_cellScalarsthe cell scalar values.
[in]a_cellActivitythe cell activity vector.
Returns
Average of active surrounding cell scalars.

Definition at line 427 of file XmUGrid2dDataExtractor.cpp.

References m_noDataValue.

Referenced by CalculatePointByIdw(), and PushCellDataToTrianglePoints().

◆ CalculatePointByIdw()

float xms::XmUGrid2dDataExtractorImpl::CalculatePointByIdw ( int  a_pointIdx,
const VecInt &  a_cellIdxs,
const VecFlt &  a_cellScalars,
const DynBitset &  a_cellActivity 
)
private

Calculate the point value by IDW method from surrounding cells.

Parameters
[in]a_pointIdxthe point to calculate the value for.
[in]a_cellIdxsthe cells surrounding the point.
[in]a_cellScalarsthe cell scalar values.
[in]a_cellActivitythe cell activity vector.
Returns
IDW interpolated value of active surrounding cell scalars.

Definition at line 456 of file XmUGrid2dDataExtractor.cpp.

References CalculatePointByAverage(), m_triangles, and m_ugrid.

Referenced by PushCellDataToTrianglePoints().

◆ ExtractAtLocation()

float xms::XmUGrid2dDataExtractorImpl::ExtractAtLocation ( const Pt3d &  a_location)
overridevirtual

Extract interpolated data for the previously set locations.

Parameters
[in]a_locationThe location to get the interpolated scalar.
Returns
The interpolated value.

Implements xms::XmUGrid2dDataExtractor.

Definition at line 254 of file XmUGrid2dDataExtractor.cpp.

References ExtractData(), and SetExtractLocations().

◆ ExtractData()

void xms::XmUGrid2dDataExtractorImpl::ExtractData ( VecFlt &  a_outData)
overridevirtual

Extract interpolated data for the previously set locations.

Parameters
[out]a_outDataThe 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().

◆ GetCellIndexes()

virtual const VecInt& xms::XmUGrid2dDataExtractorImpl::GetCellIndexes ( ) const
inlinevirtual

Gets cell indexes associated with the extract location points.

Returns
The cell indexes.

Implements xms::XmUGrid2dDataExtractor.

Definition at line 86 of file XmUGrid2dDataExtractor.cpp.

References m_cellIdxs.

◆ GetExtractLocations()

virtual const VecPt3d& xms::XmUGrid2dDataExtractorImpl::GetExtractLocations ( ) const
inlineoverridevirtual

Gets locations of points to extract interpolated scalar data from.

Returns
The locations.

Implements xms::XmUGrid2dDataExtractor.

Definition at line 83 of file XmUGrid2dDataExtractor.cpp.

References m_extractLocations.

◆ GetNoDataValue()

virtual float xms::XmUGrid2dDataExtractorImpl::GetNoDataValue ( ) const
inlineoverridevirtual

Gets the no data value.

Returns
The no data value.

Implements xms::XmUGrid2dDataExtractor.

Definition at line 92 of file XmUGrid2dDataExtractor.cpp.

References m_noDataValue.

◆ GetScalarLocation()

virtual DataLocationEnum xms::XmUGrid2dDataExtractorImpl::GetScalarLocation ( ) const
inlineoverridevirtual

Gets the location of the scalars (points or cells)

Returns
The location of the scalars.

Implements xms::XmUGrid2dDataExtractor.

Definition at line 80 of file XmUGrid2dDataExtractor.cpp.

References m_triangleType.

◆ GetScalars()

virtual const VecFlt& xms::XmUGrid2dDataExtractorImpl::GetScalars ( ) const
inlineoverridevirtual

Gets the scalars.

Returns
The scalars.

Implements xms::XmUGrid2dDataExtractor.

Definition at line 77 of file XmUGrid2dDataExtractor.cpp.

References m_pointScalars.

◆ GetUGridTriangles()

const BSHP< XmUGridTriangles2d > xms::XmUGrid2dDataExtractorImpl::GetUGridTriangles ( ) const
overridevirtual

Get the UGrid triangles.

Returns
The UGrid triangles.

Implements xms::XmUGrid2dDataExtractor.

Definition at line 509 of file XmUGrid2dDataExtractor.cpp.

References m_triangles.

◆ GetUseIdwForPointData()

virtual bool xms::XmUGrid2dDataExtractorImpl::GetUseIdwForPointData ( ) const
inlineoverridevirtual

Gets the option for using IDW for point data.

Returns
The option.

Implements xms::XmUGrid2dDataExtractor.

Definition at line 89 of file XmUGrid2dDataExtractor.cpp.

References m_useIdwForPointData.

◆ PushCellDataToTrianglePoints()

void xms::XmUGrid2dDataExtractorImpl::PushCellDataToTrianglePoints ( const VecFlt &  a_cellScalars,
const DynBitset &  a_cellActivity 
)
private

Push cell scalar data to triangle points using cells connected to a point with average or IDW.

Parameters
[in]a_cellScalarsthe cell scalar values.
[in]a_cellActivitythe 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().

◆ PushPointDataToCentroids()

void xms::XmUGrid2dDataExtractorImpl::PushPointDataToCentroids ( const DynBitset &  a_cellActivity)
private

Push point scalar data to cell centroids using average.

Parameters
[in]a_cellActivityThe 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().

◆ SetExtractLocations()

void xms::XmUGrid2dDataExtractorImpl::SetExtractLocations ( const VecPt3d &  a_locations)
overridevirtual

Sets locations of points to extract interpolated scalar data from.

Parameters
[in]a_locationsThe locations.

Implements xms::XmUGrid2dDataExtractor.

Definition at line 209 of file XmUGrid2dDataExtractor.cpp.

References m_extractLocations.

Referenced by ExtractAtLocation().

◆ SetGridCellActivity()

void xms::XmUGrid2dDataExtractorImpl::SetGridCellActivity ( const DynBitset &  a_cellActivity)
private

Set activity on cells.

Parameters
[in]a_cellActivityThe cell activity of the scalar values.

Definition at line 350 of file XmUGrid2dDataExtractor.cpp.

References m_triangles, and m_ugrid.

Referenced by ApplyActivity().

◆ SetGridCellScalars()

void xms::XmUGrid2dDataExtractorImpl::SetGridCellScalars ( const VecFlt &  a_cellScalars,
const DynBitset &  a_activity,
DataLocationEnum  a_activityLocation 
)
overridevirtual

Setup cell scalars to be used to extract interpolated data.

Parameters
[in]a_cellScalarsThe point scalars.
[in]a_activityThe activity of the cells.
[in]a_activityLocationThe 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().

◆ SetGridPointActivity()

void xms::XmUGrid2dDataExtractorImpl::SetGridPointActivity ( const DynBitset &  a_pointActivity,
DynBitset &  a_cellActivity 
)
private

Set point activity. Turns off each cell attached to an inactive point.

Parameters
[in]a_pointActivityThe activity for the UGrid points.
[out]a_cellActivityThe resulting activity transfered to the cells.

Definition at line 314 of file XmUGrid2dDataExtractor.cpp.

References m_triangles, and m_ugrid.

Referenced by ApplyActivity().

◆ SetGridPointScalars()

void xms::XmUGrid2dDataExtractorImpl::SetGridPointScalars ( const VecFlt &  a_pointScalars,
const DynBitset &  a_activity,
DataLocationEnum  a_activityLocation 
)
overridevirtual

Setup point scalars to be used to extract interpolated data.

Parameters
[in]a_pointScalarsThe point scalars.
[in]a_activityThe activity of the cells.
[in]a_activityLocationThe 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().

◆ SetNoDataValue()

void xms::XmUGrid2dDataExtractorImpl::SetNoDataValue ( float  a_value)
overridevirtual

Set value to use when extracted value is in inactive cell or doesn't intersect with the grid.

Parameters
[in]a_valueThe no data value

Implements xms::XmUGrid2dDataExtractor.

Definition at line 275 of file XmUGrid2dDataExtractor.cpp.

References m_noDataValue.

◆ SetUseIdwForPointData()

void xms::XmUGrid2dDataExtractorImpl::SetUseIdwForPointData ( bool  a_useIdw)
overridevirtual

Set to use IDW to calculate point scalar values from cell scalars.

Parameters
a_useIdwWhether to turn IDW on or off.

Implements xms::XmUGrid2dDataExtractor.

Definition at line 266 of file XmUGrid2dDataExtractor.cpp.

References m_useIdwForPointData.


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