xmsextractor  1.0
XmUGrid2dPolylineDataExtractor.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
9 //------------------------------------------------------------------------------
10 
11 //----- Included files ---------------------------------------------------------
12 
13 // 3. Standard library headers
14 
15 // 4. External library headers
16 
17 // 5. Shared code headers
18 #include <xmscore/misc/base_macros.h>
19 #include <xmscore/misc/boost_defines.h>
20 #include <xmscore/misc/DynBitset.h>
21 #include <xmscore/stl/vector.h>
23 
24 //----- Forward declarations ---------------------------------------------------
25 
26 //----- Namespace declaration --------------------------------------------------
27 
29 namespace xms
30 {
31 //----- Forward declarations ---------------------------------------------------
32 class XmUGrid;
33 
34 //----- Constants / Enumerations -----------------------------------------------
35 
36 //----- Structs / Classes ------------------------------------------------------
37 
40 {
41 public:
42  static BSHP<XmUGrid2dPolylineDataExtractor> New(std::shared_ptr<XmUGrid> a_ugrid,
43  DataLocationEnum a_scalarLocation);
45 
49  virtual BSHP<XmUGrid2dDataExtractor> GetDataExtractor() const = 0;
50 
55  virtual void SetGridScalars(const VecFlt& a_scalars,
56  const DynBitset& a_activity,
57  DataLocationEnum a_activityLocation) = 0;
58 
62  virtual void SetPolyline(const VecPt3d& a_polyline) = 0;
65  virtual void ExtractData(VecFlt& a_extractedData) = 0;
66 
71  virtual void ComputeLocationsAndExtractData(const VecPt3d& a_polyline,
72  VecFlt& a_extractedData,
73  VecPt3d& a_extractedLocations) = 0;
74 
77  virtual void SetUseIdwForPointData(bool a_useIdw) = 0;
81  virtual void SetNoDataValue(float a_noDataValue) = 0;
82 
85  virtual const VecFlt& GetScalars() const = 0;
88  virtual DataLocationEnum GetScalarLocation() const = 0;
91  virtual const VecPt3d& GetExtractLocations() const = 0;
94  virtual const VecInt& GetCellIndexes() const = 0;
97  virtual bool GetUseIdwForPointData() const = 0;
100  virtual float GetNoDataValue() const = 0;
101 
102 private:
103  XM_DISALLOW_COPY_AND_ASSIGN(XmUGrid2dPolylineDataExtractor)
104 
105 protected:
107 };
108 
109 //----- Function prototypes ----------------------------------------------------
110 
111 } // namespace xms
virtual DataLocationEnum GetScalarLocation() const =0
Gets the location of the scalars (points or cells)
virtual const VecFlt & GetScalars() const =0
Gets the scalars.
virtual void SetNoDataValue(float a_noDataValue)=0
Set value to use when extracted value is in inactive cell or doesn&#39;t intersect with the grid...
virtual BSHP< XmUGrid2dDataExtractor > GetDataExtractor() const =0
Gets the underlying data extractor. Convenience so a user would not have to create a new if this one ...
virtual const VecInt & GetCellIndexes() const =0
Gets cell indexes associated with the extract location points.
virtual void ComputeLocationsAndExtractData(const VecPt3d &a_polyline, VecFlt &a_extractedData, VecPt3d &a_extractedLocations)=0
Extract data for given polyline.
DataLocationEnum
The location at which the data will be stored.
virtual bool GetUseIdwForPointData() const =0
Gets the option for using IDW for point data.
Contains the XmUGrid2dDataExtractor Class and supporting data types.
virtual void SetUseIdwForPointData(bool a_useIdw)=0
Set to use IDW to calculate point scalar values from cell scalars.
XMS Namespace.
virtual float GetNoDataValue() const =0
Gets the no data value.
virtual const VecPt3d & GetExtractLocations() const =0
Gets computed locations along polyline to extract interpolated scalar data from.
virtual void SetPolyline(const VecPt3d &a_polyline)=0
Set the polyline along which to extract the scalar data. Locations crossing cell boundaries are compu...
virtual void SetGridScalars(const VecFlt &a_scalars, const DynBitset &a_activity, DataLocationEnum a_activityLocation)=0
Setup point scalars to be used to extract interpolated data.
virtual void ExtractData(VecFlt &a_extractedData)=0
Extract data at previously computed locations returned by GetExtractLocations.
static BSHP< XmUGrid2dPolylineDataExtractor > New(std::shared_ptr< XmUGrid > a_ugrid, DataLocationEnum a_scalarLocation)
Create a new XmUGrid2dPolylineDataExtractor.
Provides ability to interpolate and extract the scalar values along a polyline for an unstructured gr...