xmsextractor  1.0
XmUGrid2dDataExtractor.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
8 //------------------------------------------------------------------------------
9 
10 //----- Included files ---------------------------------------------------------
11 
12 // 3. Standard library headers
13 
14 // 4. External library headers
15 
16 // 5. Shared code headers
17 #include <xmscore/misc/base_macros.h>
18 #include <xmscore/misc/boost_defines.h>
19 #include <xmscore/misc/DynBitset.h>
20 #include <xmscore/stl/vector.h>
21 
22 //----- Forward declarations ---------------------------------------------------
23 
24 //----- Namespace declaration --------------------------------------------------
25 
27 namespace xms
28 {
29 //----- Forward declarations ---------------------------------------------------
30 class GmMultiPolyIntersector;
31 class XmUGrid;
32 class XmUGridTriangles2d;
33 class XmUGrid2dPolylineDataExtractor;
34 
35 //----- Constants / Enumerations -----------------------------------------------
36 
38 enum DataLocationEnum { LOC_POINTS, LOC_CELLS, LOC_UNKNOWN };
39 
40 //----- Structs / Classes ------------------------------------------------------
41 
44 {
45 public:
46  static BSHP<XmUGrid2dDataExtractor> New(std::shared_ptr<XmUGrid> a_ugrid);
47  static BSHP<XmUGrid2dDataExtractor> New(BSHP<XmUGrid2dDataExtractor> a_extractor);
48  virtual ~XmUGrid2dDataExtractor();
49 
54  virtual void SetGridPointScalars(const VecFlt& a_pointScalars,
55  const DynBitset& a_activity,
56  DataLocationEnum a_activityType) = 0;
61  virtual void SetGridCellScalars(const VecFlt& a_cellScalars,
62  const DynBitset& a_activity,
63  DataLocationEnum a_activityType) = 0;
64 
67  virtual void SetExtractLocations(const VecPt3d& a_locations) = 0;
70  virtual void ExtractData(VecFlt& a_outData) = 0;
74  virtual float ExtractAtLocation(const Pt3d& a_location) = 0;
75 
78  virtual void SetUseIdwForPointData(bool a_useIdw) = 0;
82  virtual void SetNoDataValue(float a_noDataValue) = 0;
83 
86  virtual void BuildTriangles(DataLocationEnum a_location) = 0;
89  virtual const BSHP<XmUGridTriangles2d> GetUGridTriangles() const = 0;
90 
93  virtual const VecFlt& GetScalars() const = 0;
96  virtual DataLocationEnum GetScalarLocation() const = 0;
99  virtual const VecPt3d& GetExtractLocations() const = 0;
102  virtual const VecInt& GetCellIndexes() const = 0;
105  virtual bool GetUseIdwForPointData() const = 0;
108  virtual float GetNoDataValue() const = 0;
109 
110 private:
111  XM_DISALLOW_COPY_AND_ASSIGN(XmUGrid2dDataExtractor)
112 
113 protected:
115 };
116 
117 //----- Function prototypes ----------------------------------------------------
118 
119 } // namespace xms
static BSHP< XmUGrid2dDataExtractor > New(std::shared_ptr< XmUGrid > a_ugrid)
Create a new XmUGrid2dDataExtractor.
virtual void SetGridCellScalars(const VecFlt &a_cellScalars, const DynBitset &a_activity, DataLocationEnum a_activityType)=0
Setup cell scalars to be used to extract interpolated data.
virtual ~XmUGrid2dDataExtractor()
Destructor.
virtual const VecInt & GetCellIndexes() const =0
Gets cell indexes associated with the extract location points.
virtual const VecFlt & GetScalars() const =0
Gets the scalars.
virtual DataLocationEnum GetScalarLocation() const =0
Gets the location of the scalars (points or cells)
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 float GetNoDataValue() const =0
Gets the no data value.
virtual void SetGridPointScalars(const VecFlt &a_pointScalars, const DynBitset &a_activity, DataLocationEnum a_activityType)=0
Setup point scalars to be used to extract interpolated data.
virtual void ExtractData(VecFlt &a_outData)=0
Extract interpolated data for the previously set locations.
DataLocationEnum
The location at which the data will be stored.
virtual float ExtractAtLocation(const Pt3d &a_location)=0
Extract interpolated data for the previously set locations.
virtual void SetExtractLocations(const VecPt3d &a_locations)=0
Sets locations of points to extract interpolated scalar data from.
virtual bool GetUseIdwForPointData() const =0
Gets the option for using IDW for point data.
XMS Namespace.
virtual const BSHP< XmUGridTriangles2d > GetUGridTriangles() const =0
Get the UGrid triangles.
virtual void SetUseIdwForPointData(bool a_useIdw)=0
Set to use IDW to calculate point scalar values from cell scalars.
virtual void BuildTriangles(DataLocationEnum a_location)=0
Build triangles for UGrid for either point or cell scalars.
virtual const VecPt3d & GetExtractLocations() const =0
Gets locations of points to extract interpolated scalar data from.
Provides ability to interpolate and extract the scalar values points and along arcs for an unstructur...