xmsinterp
1.0
|
Implementation of InterpLinear. More...
Public Member Functions | |
virtual void | SetPtsTris (BSHP< VecPt3d > a_, BSHP< VecInt > a_tris) override |
Adds the triangles to the class. More... | |
virtual void | SetScalars (const float *a_scalar, size_t a_n) override |
Set the scalars that will be used to interpolate from. More... | |
virtual void | SetScalars (BSHP< VecFlt > a_scalar) override |
Set the scalars that will be used to interpolate from. More... | |
virtual void | SetPtActivity (DynBitset &a_activity) override |
Modifies the activity bitset of the class. More... | |
virtual void | SetTriActivity (DynBitset &a_activity) override |
Modifies the activity bitset of the class. More... | |
virtual const BSHP< VecPt3d > | GetPts () const override |
Returns shared pointer to points vector. More... | |
virtual const BSHP< VecInt > | GetTris () const override |
Returns shared pointer to triangles vector. More... | |
virtual const BSHP< VecFlt > | GetScalars () const override |
Returns shared pointer to scalars vector. More... | |
virtual DynBitset | GetPtActivity () const override |
Returns bitset of point activity. More... | |
virtual DynBitset | GetTriActivity () const override |
Returns bitset of triangle activity. More... | |
virtual VecInt | GetExtrapolationPointIndexes () const override |
Returns vector of point indexes for points that were outside of all triangles. More... | |
virtual float | InterpToPt (const Pt3d &a_pt) override |
Use the stored triangles to interpolate to a point. Returns extrapolation value if the point is outside the triangles. More... | |
float | InterpToPtImpl (const Pt3d &a_pt, int a_ptIdx) |
Use the stored triangles to interpolate to a point. Returns extrapolation value if the point is outside the triangles. More... | |
virtual void | InterpToPts (const VecPt3d &a_pts, VecFlt &a_scalars) override |
Calls InterpToPt in a loop. More... | |
virtual int | TriContainingPt (const Pt3d &a_pt) override |
Find the triangle containing the point. More... | |
virtual void | TriEnvelopsContainingPt (const Pt3d &a_pt, VecInt &a_tris) override |
Find all triangles whose envelop contains the point. More... | |
virtual bool | InterpWeights (const Pt3d &a_pt, VecInt &a_idxs, VecDbl &a_wts) override |
Use the stored triangles to get interpolation weights for a point. Returns false if the point is outside the triangles. More... | |
float | CloughTocherInterp (VecInt &a_idxs, const Pt3d &a_pt) |
uses Clough Tocher interpolation method to get the interpolated val More... | |
float | NatNeighInterp (const Pt3d &a_pt) |
uses Natural Neighbor interpolation method to get the interpolated val More... | |
virtual void | SetExtrapVal (double a_val) override |
Set the constant extrapolation value. More... | |
virtual void | SetTrunc (double a_sMax, double a_sMin) override |
Set the truncation values for the interpolation and turn on truncation. More... | |
virtual void | SetUseCloughTocher (bool a_, BSHP< Observer > a_prog) override |
Set the class to use the Clough Tocher interpolation method. This is a legacy feature from GMS. Compare to linear. More... | |
virtual void | SetUseNatNeigh (bool a_, int a_nodalFunc, int a_ndFuncOpt, int a_ndFuncNumNearestPts, bool a_blendWeights, BSHP< Observer > a_prog) override |
Set the class to use natural neighbor (NN) interpolation. More... | |
virtual double | GetExtrapVal () const override |
get extrapolation value More... | |
virtual bool | GetTruncateInterpolatedValues () const override |
get the option to truncate interpolated values More... | |
virtual double | GetTruncMin () const override |
get minimum truncation value More... | |
virtual double | GetTruncMax () const override |
get the maximum truncation value More... | |
virtual bool | GetUseCloughTocher () const override |
get the option for using Clough Tocher interpolation More... | |
virtual bool | GetUseNatNeigh () const override |
get the option for using Natural Neighbor interpolation More... | |
virtual int | GetNatNeighNodalFunc () const override |
get the value for the Natural Neighbor nodal function More... | |
virtual int | GetNatNeighNodalFuncNearestPtsOption () const override |
get the option for the Natural Neighbor nodal function nearest points. Nearest points or nearest natural neighbors. More... | |
virtual int | GetNatNeighNodalFuncNumNearestPts () const override |
get the value for the number of nearest points to use when calculating the nodal function More... | |
virtual bool | GetNatNeighBlendWeights () const override |
get the option for blending weights when using Natural Neighbor More... | |
BSHP< GmPtSearch > | CreatePtSearch () |
Creates a GmPtSearch class to be used for nodal function generation. More... | |
void | RecalcNodalFunc () |
Resets some members of the class. | |
virtual std::string | ToString () const override |
Write the internals to a string. More... | |
Protected Attributes | |
BSHP< GmTriSearch > | m_triSearch |
spatial index for searching triangles | |
BSHP< VecPt3d > | m_pts |
pt locations that make up triangles | |
BSHP< VecInt > | m_tris |
triangles referencing indexes of pts | |
BSHP< VecFlt > | m_scalar |
Scalars we're interpolating from. | |
double | m_extrap |
Extrapolation value. | |
bool | m_trunc |
flag to indicate if truncation is on | |
double | m_truncMax |
Maximum truncation value. All interpolated values will be <=. | |
double | m_truncMin |
Minimum truncation value. All interpolated values will be >=. | |
bool | m_cloughTocher |
flag indicating clough tocher interpolation will be used | |
bool | m_natNeigh |
flag indicating that natural neighbor interpolation will be used | |
BSHP< NodalFunc > | m_nodal |
Nodal function (constant, gradient plane, quadratic) | |
BSHP< InterpCt > | m_ct |
Clough Tocher interpolation class. | |
BSHP< InterpNatNeigh > | m_nn |
Natural neighbor interpolation class. | |
VecInt | m_extrapolationPointIndexes |
indexes of points that are outside of all triangles | |
Additional Inherited Members | |
Static Public Member Functions inherited from xms::InterpLinear | |
static BSHP< InterpLinear > | New () |
Creates an TriSearch class. More... | |
Implementation of InterpLinear.
Linear interpolation from a set of triangles Uses the boost RTree for queries.
Definition at line 50 of file InterpLinear.cpp.
uses Clough Tocher interpolation method to get the interpolated val
a_idxs | Indices to the points that form the triangle that a_pt is inside of. |
a_pt | Location that is interpolated to. |
Definition at line 436 of file InterpLinear.cpp.
References m_ct.
Referenced by InterpToPtImpl().
BSHP< GmPtSearch > xms::InterpLinearImpl::CreatePtSearch | ( | ) |
Creates a GmPtSearch class to be used for nodal function generation.
Definition at line 545 of file InterpLinear.cpp.
References m_pts, and m_triSearch.
Referenced by SetUseCloughTocher(), and SetUseNatNeigh().
|
overridevirtual |
Returns vector of point indexes for points that were outside of all triangles.
Definition at line 322 of file InterpLinear.cpp.
References m_extrapolationPointIndexes.
Referenced by InterpLinearUnitTests::testOneTriangle().
|
inlineoverridevirtual |
get extrapolation value
Definition at line 95 of file InterpLinear.cpp.
References m_extrap.
|
inlineoverridevirtual |
get the option for blending weights when using Natural Neighbor
Definition at line 139 of file InterpLinear.cpp.
References m_nodal.
|
inlineoverridevirtual |
get the value for the Natural Neighbor nodal function
Definition at line 113 of file InterpLinear.cpp.
References m_nodal.
|
inlineoverridevirtual |
get the option for the Natural Neighbor nodal function nearest points. Nearest points or nearest natural neighbors.
Definition at line 122 of file InterpLinear.cpp.
References m_nodal.
|
inlineoverridevirtual |
get the value for the number of nearest points to use when calculating the nodal function
Definition at line 131 of file InterpLinear.cpp.
References m_nodal.
|
overridevirtual |
Returns bitset of point activity.
Definition at line 305 of file InterpLinear.cpp.
References m_triSearch.
Returns shared pointer to points vector.
Definition at line 281 of file InterpLinear.cpp.
References m_pts.
Returns shared pointer to scalars vector.
Definition at line 297 of file InterpLinear.cpp.
References m_scalar.
|
overridevirtual |
Returns bitset of triangle activity.
Definition at line 313 of file InterpLinear.cpp.
References m_triSearch.
Returns shared pointer to triangles vector.
Definition at line 289 of file InterpLinear.cpp.
References m_tris.
|
inlineoverridevirtual |
get the option to truncate interpolated values
Definition at line 98 of file InterpLinear.cpp.
References m_trunc.
|
inlineoverridevirtual |
get the maximum truncation value
Definition at line 104 of file InterpLinear.cpp.
References m_truncMax.
|
inlineoverridevirtual |
get minimum truncation value
Definition at line 101 of file InterpLinear.cpp.
References m_truncMin.
|
inlineoverridevirtual |
get the option for using Clough Tocher interpolation
Definition at line 107 of file InterpLinear.cpp.
References m_cloughTocher.
|
inlineoverridevirtual |
get the option for using Natural Neighbor interpolation
Definition at line 110 of file InterpLinear.cpp.
References m_natNeigh.
|
overridevirtual |
Use the stored triangles to interpolate to a point. Returns extrapolation value if the point is outside the triangles.
a_pt | Location that is interpolated to. |
Definition at line 332 of file InterpLinear.cpp.
References InterpToPtImpl().
Referenced by InterpLinearUnitTests::testCt(), InterpLinearUnitTests::testInterp(), and InterpLinearUnitTests::testOneTriangle().
float xms::InterpLinearImpl::InterpToPtImpl | ( | const Pt3d & | a_pt, |
int | a_ptIdx | ||
) |
Use the stored triangles to interpolate to a point. Returns extrapolation value if the point is outside the triangles.
a_pt | Location that is interpolated to. |
a_ptIdx | point index |
Definition at line 343 of file InterpLinear.cpp.
References CloughTocherInterp(), EQ_TOL(), m_cloughTocher, m_extrap, m_extrapolationPointIndexes, m_natNeigh, m_triSearch, m_trunc, m_truncMax, m_truncMin, and NatNeighInterp().
Referenced by InterpToPt(), and InterpToPts().
|
overridevirtual |
Calls InterpToPt in a loop.
a_pts | Locations of points. |
a_scalars | Interpolated scalar values at a_pts. |
Definition at line 388 of file InterpLinear.cpp.
References InterpToPtImpl(), and m_extrapolationPointIndexes.
Referenced by InterpLinearUnitTests::testOneTriangle().
|
overridevirtual |
Use the stored triangles to get interpolation weights for a point. Returns false if the point is outside the triangles.
a_pt | Location that is interpolated to. |
a_idxs | Vector of triangle point indices filled in by this method. |
a_wts | Vector of triangle point weights filled in by this method. |
Definition at line 425 of file InterpLinear.cpp.
References m_triSearch.
float xms::InterpLinearImpl::NatNeighInterp | ( | const Pt3d & | a_pt | ) |
uses Natural Neighbor interpolation method to get the interpolated val
a_pt | Location that is interpolated to. |
Definition at line 447 of file InterpLinear.cpp.
References m_nn.
Referenced by InterpToPtImpl().
|
overridevirtual |
Set the constant extrapolation value.
a_val | The value assigned to extrapolated points |
Definition at line 455 of file InterpLinear.cpp.
References m_extrap.
Referenced by InterpLinearUnitTests::testOneTriangle().
|
overridevirtual |
Modifies the activity bitset of the class.
a_activity | bitset of the activity of the points |
Definition at line 263 of file InterpLinear.cpp.
References m_triSearch, and RecalcNodalFunc().
|
overridevirtual |
Adds the triangles to the class.
a_pts | Array of point locations. |
a_tris | Array of triangles that references the a_pts array. This array will have a size that is a multiple of 3. The first 3 locations in array represent the first triangle and will have indices that correspond to locations in the a_pts array. |
Definition at line 229 of file InterpLinear.cpp.
References m_pts, m_scalar, m_tris, and m_triSearch.
Referenced by InterpLinearUnitTests::testCt(), InterpLinearUnitTests::testInterp(), and InterpLinearUnitTests::testOneTriangle().
|
overridevirtual |
Set the scalars that will be used to interpolate from.
a_scalar | Array of interpolation scalar values. |
a_n | Size of the array a_scalar. |
Definition at line 243 of file InterpLinear.cpp.
References m_pts, m_scalar, RecalcNodalFunc(), and XM_ENSURE_TRUE.
Set the scalars that will be used to interpolate from.
a_scalar | Array of interpolation scalar values. |
Definition at line 253 of file InterpLinear.cpp.
References m_pts, m_scalar, RecalcNodalFunc(), and XM_ENSURE_TRUE.
|
overridevirtual |
Modifies the activity bitset of the class.
a_activity | bitset of the activity of the triangles |
Definition at line 272 of file InterpLinear.cpp.
References m_triSearch, and RecalcNodalFunc().
|
overridevirtual |
Set the truncation values for the interpolation and turn on truncation.
a_sMax | The maximum value for truncation. |
a_sMin | The minimum value for truncation. |
Definition at line 465 of file InterpLinear.cpp.
References m_trunc, m_truncMax, and m_truncMin.
Referenced by InterpLinearUnitTests::testCt().
Set the class to use the Clough Tocher interpolation method. This is a legacy feature from GMS. Compare to linear.
a_ | True/False to indicate if CT should be used. |
a_prog | Progress bar to give users feed back on the set up process of CT. If you have a really large set of triangles this may take some time. |
Definition at line 478 of file InterpLinear.cpp.
References CreatePtSearch(), xms::inAllScalarsEqual(), m_cloughTocher, m_ct, m_nodal, m_pts, m_scalar, m_triSearch, and xms::NodalFunc::New().
Referenced by InterpLinearUnitTests::testCt().
|
overridevirtual |
Set the class to use natural neighbor (NN) interpolation.
a_ | True/False to indicate if NN should be used. |
a_nodalFunc | Indicates which nodal function to use. |
a_ndFuncOpt | Indicates options for the nearest points when computing the nodal functions. |
a_ndFuncNumNearestPts | The number of nearest points for nodal function computation. |
a_blendWeights | Option to use a blending function on the calculated weights. |
a_prog | Progress bar to give user feedback for generation of the nodal functions. |
Definition at line 510 of file InterpLinear.cpp.
References CreatePtSearch(), xms::inAllScalarsEqual(), m_natNeigh, m_nn, m_nodal, m_pts, m_scalar, m_tris, m_triSearch, xms::InterpNatNeigh::New(), and xms::NodalFunc::New().
|
overridevirtual |
Write the internals to a string.
Definition at line 567 of file InterpLinear.cpp.
References m_cloughTocher, m_ct, m_extrap, m_natNeigh, m_nn, m_nodal, m_pts, m_scalar, m_tris, m_triSearch, m_trunc, m_truncMax, m_truncMin, and VecToStream().
|
overridevirtual |
Find the triangle containing the point.
a_pt | Location used to find a triangle. |
Definition at line 404 of file InterpLinear.cpp.
References m_triSearch.
|
overridevirtual |
Find all triangles whose envelop contains the point.
a_pt | Location used to find a triangle. |
a_tris | The indices to triangles whose envelop contains the point |
Definition at line 413 of file InterpLinear.cpp.
References m_triSearch.