3Depict
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Enumerations | Functions | Variables
spatial.cpp File Reference
#include "spatial.h"
#include "../filterCommon.h"
#include <gsl/gsl_sf_gamma.h>
#include <qhull/qhull_a.h>
Include dependency graph for spatial.cpp:

Enumerations

enum  PointDir { POINTDIR_TOGETHER =0, POINTDIR_IN_COMMON, POINTDIR_APART }
 

Functions

unsigned int vectorPointDir (const Point3D &pA, const Point3D &pB, const Point3D &vC, const Point3D &vD)
 Check which way vectors attached to two 3D points "point",. More...
 
float distanceToSegment (const Point3D &fA, const Point3D &fB, const Point3D &p)
 Returns the shortest distance between a line segment and a given point. More...
 
float distanceToFacet (const Point3D &fA, const Point3D &fB, const Point3D &fC, const Point3D &p, const Point3D &normal)
 Find the distance between a point, and a triangular facet – may be positive or negative. More...
 
unsigned int GetReducedHullPts (const vector< Point3D > &points, float reductionDim, unsigned int *progress, ATOMIC_BOOL &wantAbort, vector< Point3D > &pointResult)
 Returns a subset of points guaranteed to lie at least reductionDim inside hull of input points. More...
 
unsigned int generateNNHist (const vector< Point3D > &pointList, const K3DTree &tree, unsigned int nnMax, unsigned int numBins, vector< vector< size_t > > &histogram, float *binWidth, unsigned int *progressPtr, ATOMIC_BOOL &wantAbort)
 Generate an NN histogram using NN-max cutoffs. More...
 
unsigned int generate1DAxialDistHist (const vector< Point3D > &pointList, const K3DTreeMk2 &tree, const Point3D &axisDir, unsigned int *histogram, float distMax, unsigned int numBins, unsigned int *progressPtr, ATOMIC_BOOL &wantAbort)
 
unsigned int generate1DAxialNNHist (const vector< Point3D > &pointList, const K3DTreeMk2 &tree, const Point3D &axisDir, unsigned int *histogram, float &binWidth, unsigned int nnMax, unsigned int numBins, unsigned int *progressPtr, ATOMIC_BOOL &wantAbort)
 
unsigned int generateDistHist (const vector< Point3D > &pointList, const K3DTree &tree, unsigned int *histogram, float distMax, unsigned int numBins, unsigned int &warnBiasCount, unsigned int *progressPtr, ATOMIC_BOOL &wantAbort)
 Generate an NN histogram using distance max cutoffs. Input histogram must be zeroed,. More...
 
void generateKnnTheoreticalDist (const std::vector< float > &radii, float density, unsigned int nn, std::vector< float > &nnDist)
 
unsigned int generate1DAxialDistHistSweep (const std::vector< Point3D > &pointList, K3DTreeMk2 &tree, float distMax, float dTheta, float dPhi, unsigned int &prog, std::vector< std::vector< std::vector< unsigned int > > > &histogram)
 
bool qhullTest ()
 

Variables

const unsigned int CALLBACK_REDUCE =5000
 
const unsigned int MAX_NN_DISTS = 0x8000000
 

Enumeration Type Documentation

◆ PointDir

enum PointDir
Enumerator
POINTDIR_TOGETHER 
POINTDIR_IN_COMMON 
POINTDIR_APART 

Function Documentation

◆ distanceToFacet()

float distanceToFacet ( const Point3D fA,
const Point3D fB,
const Point3D fC,
const Point3D p,
const Point3D normal 
)

Find the distance between a point, and a triangular facet – may be positive or negative.

References ASSERT, distanceToSegment(), POINTDIR_APART, Point3D::sqrDist(), Point3D::sqrMag(), and vectorPointDir().

Referenced by GetReducedHullPts().

Here is the caller graph for this function:

◆ distanceToSegment()

float distanceToSegment ( const Point3D fA,
const Point3D fB,
const Point3D p 
)

Returns the shortest distance between a line segment and a given point.

References Point3D::crossProd(), POINTDIR_TOGETHER, Point3D::sqrDist(), Point3D::sqrMag(), and vectorPointDir().

Referenced by distanceToFacet().

Here is the caller graph for this function:

◆ generate1DAxialDistHist()

unsigned int generate1DAxialDistHist ( const vector< Point3D > &  pointList,
const K3DTreeMk2 tree,
const Point3D axisDir,
unsigned int *  histogram,
float  distMax,
unsigned int  numBins,
unsigned int *  progressPtr,
ATOMIC_BOOL wantAbort 
)

◆ generate1DAxialDistHistSweep()

unsigned int generate1DAxialDistHistSweep ( const std::vector< Point3D > &  pointList,
K3DTreeMk2 tree,
float  distMax,
float  dTheta,
float  dPhi,
unsigned int &  prog,
std::vector< std::vector< std::vector< unsigned int > > > &  histogram 
)

◆ generate1DAxialNNHist()

unsigned int generate1DAxialNNHist ( const vector< Point3D > &  pointList,
const K3DTreeMk2 tree,
const Point3D axisDir,
unsigned int *  histogram,
float &  binWidth,
unsigned int  nnMax,
unsigned int  numBins,
unsigned int *  progressPtr,
ATOMIC_BOOL wantAbort 
)

◆ generateDistHist()

unsigned int generateDistHist ( const vector< Point3D > &  pointList,
const K3DTree tree,
unsigned int *  histogram,
float  distMax,
unsigned int  numBins,
unsigned int &  warnBiasCount,
unsigned int *  progressPtr,
ATOMIC_BOOL wantAbort 
)

Generate an NN histogram using distance max cutoffs. Input histogram must be zeroed,.

References ASSERT, CALLBACK_REDUCE, K3DTree::findNearest(), RDF_ABORT_FAIL, BoundCube::setBounds(), and Point3D::sqrDist().

Referenced by SpatialAnalysisFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ generateKnnTheoreticalDist()

void generateKnnTheoreticalDist ( const std::vector< float > &  radii,
float  density,
unsigned int  nn,
std::vector< float > &  nnDist 
)

References ASSERT, and M_PI.

Referenced by SpatialAnalysisFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ generateNNHist()

unsigned int generateNNHist ( const vector< Point3D > &  pointList,
const K3DTree tree,
unsigned int  nnMax,
unsigned int  numBins,
vector< vector< size_t > > &  histogram,
float *  binWidth,
unsigned int *  progressPtr,
ATOMIC_BOOL wantAbort 
)

Generate an NN histogram using NN-max cutoffs.

Generate the NN histogram specified up to a given NN.

References ASSERT, CALLBACK_REDUCE, K3DTree::findKNearest(), RDF_ABORT_FAIL, RDF_ERR_INSUFFICIENT_INPUT_POINTS, and BoundCube::setBounds().

Referenced by SpatialAnalysisFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ GetReducedHullPts()

unsigned int GetReducedHullPts ( const std::vector< Point3D > &  pts,
float  reductionDim,
unsigned int *  progress,
ATOMIC_BOOL wantAbort,
std::vector< Point3D > &  returnIons 
)

Returns a subset of points guaranteed to lie at least reductionDim inside hull of input points.

Calculates the hull of the input ions and then scales the hull such that the smallest distance between the scaled hull and the original hull is exactly reductionDim

References ASSERT, computeConvexHull(), distanceToFacet(), dotProduct(), freeConvexHull(), pyramidVol(), and RDF_ERR_NEGATIVE_SCALE_FACT.

Referenced by SpatialAnalysisFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ qhullTest()

bool qhullTest ( )

References COMPILE_ASSERT.

◆ vectorPointDir()

unsigned int vectorPointDir ( const Point3D pA,
const Point3D pB,
const Point3D vC,
const Point3D vD 
)

Check which way vectors attached to two 3D points "point",.

Two vectors may point "together", /__\ "apart" __/ or "In common" /__/ or __\

References ASSERT, POINTDIR_APART, POINTDIR_IN_COMMON, and POINTDIR_TOGETHER.

Referenced by distanceToFacet(), and distanceToSegment().

Here is the caller graph for this function:

Variable Documentation

◆ CALLBACK_REDUCE

const unsigned int CALLBACK_REDUCE =5000

◆ MAX_NN_DISTS

const unsigned int MAX_NN_DISTS = 0x8000000