3Depict
|
A helper class to define a bounding cube. More...
#include <basics.h>
Public Member Functions | |
BoundCube () | |
BoundCube (const Point3D &p1, const Point3D &p2) | |
void | setBounds (float xMin, float yMin, float zMin, float xMax, float yMax, float zMax) |
void | setBounds (const BoundCube &b) |
void | setInvalid () |
void | setInverseLimits (bool setAsValid=false) |
void | setBound (unsigned int bound, unsigned int minMax, float value) |
float | getBound (unsigned int bound, unsigned int minMax) const |
void | getBound (Point3D &bound, unsigned int minMax) const |
Point3D | getCentroid () const |
Return the centroid. More... | |
void | getBounds (Point3D &low, Point3D &high) const |
Get the bounds. More... | |
float | getSize (unsigned int dim) const |
Return the side length of the cube along the specified dimension. More... | |
bool | isValid () const |
Returns true if all bounds are valid. More... | |
bool | isFlat () const |
Returns true if any bound is of null thickness. More... | |
bool | isNumericallyBig () const |
Returns true if any bound of datacube is considered to be "large" in magnitude compared to. More... | |
void | setBounds (const Point3D *ptArray, unsigned int nPoints) |
Obtain bounds from an array of Point3Ds. More... | |
void | setBounds (const Point3D &p, const Point3D &q) |
Use two points to set bounds – does not need to be high,low. this is worked out/. More... | |
void | setBounds (const std::vector< Point3D > &ptArray) |
Obtain bounds from an array of Point3Ds. More... | |
void | setBounds (const Point3D &p, float radius) |
Set bounds via cube that contains given sphere. More... | |
bool | intersects (const Point3D &pt, float sqrRad) const |
Checks if a point intersects a sphere of centre Pt, radius^2 sqrRad. More... | |
BoundCube | makeUnion (const BoundCube &b) const |
bool | containsPt (const Point3D &pt) const |
bool | contains (const BoundCube &b) const |
bool | containedInSphere (const Point3D &pt, float sqrRad) const |
Is this bounding cube completely contained within a sphere centred on pt of sqr size sqrRad? More... | |
unsigned int | segmentTriple (unsigned int dim, float slice) const |
float | getMaxDistanceToBox (const Point3D &pt) const |
Returns maximum distnace to box corners (which is an upper bound on max box distance). More... | |
float | getLargestDim () const |
float | volume () const |
void | limits () |
const BoundCube & | operator= (const BoundCube &) |
void | expand (const BoundCube &b) |
Expand (as needed) volume such that the argument bounding cube is enclosed by this one. More... | |
void | expand (const Point3D &p) |
Expand such that point is contained in this volume. Existing volume must be valid. More... | |
void | expand (float v) |
Expand by a specified thickness. More... | |
Point3D | getVertex (unsigned int idx) const |
Obtain a corner point of the cube. More... | |
void | getVertices (std::vector< Point3D > &p, bool centre=false) const |
Obtain the corner points of the cube. More... | |
void | getPlaneIntersectVertices (const Point3D &planeOrigin, const Point3D &normal, std::vector< Point3D > &intersectPts) const |
Obtain the vertices that arise from the intersection of a plane with the cube. More... | |
Friends | |
class | K3DTree |
class | K3DTreeMk2 |
std::ostream & | operator<< (std::ostream &stream, const BoundCube &b) |
A helper class to define a bounding cube.
|
inline |
bool BoundCube::containedInSphere | ( | const Point3D & | pt, |
float | sqrRad | ||
) | const |
Is this bounding cube completely contained within a sphere centred on pt of sqr size sqrRad?
References ASSERT, and Point3D::sqrDist().
Referenced by K3DTreeMk2::getTreesInSphere(), and K3DTreeMk2::ptsInSphere().
bool BoundCube::contains | ( | const BoundCube & | b | ) | const |
References getBounds().
Referenced by K3DTreeMk2::getBoxInTree().
bool BoundCube::containsPt | ( | const Point3D & | pt | ) | const |
References ASSERT, and Point3D::getValue().
Referenced by Mesh::getContainedNodes(), Voxels< float >::getEdgeEnds(), Voxels< float >::getInterpolatedData(), marchingCubes(), Mesh::pointsInside(), and IonClipFilter::setPropFromBinding().
void BoundCube::expand | ( | const BoundCube & | b | ) |
Expand (as needed) volume such that the argument bounding cube is enclosed by this one.
References isValid().
Referenced by Scene::addDrawable(), DrawDispList::addDrawable(), Scene::addRefDrawable(), Scene::computeSceneLimits(), countBinnedIons(), Mesh::divideMeshSurface(), IonHit::getBoundCube(), Voxels< float >::getEdgeEnds(), getRectilinearBounds(), TransformFilter::refresh(), BoundingBoxFilter::refresh(), VoxeliseFilter::refresh(), Mesh::resurface(), and IonClipFilter::setPropFromBinding().
void BoundCube::expand | ( | const Point3D & | p | ) |
Expand such that point is contained in this volume. Existing volume must be valid.
void BoundCube::expand | ( | float | v | ) |
Expand by a specified thickness.
float BoundCube::getBound | ( | unsigned int | bound, |
unsigned int | minMax | ||
) | const |
References ASSERT.
Referenced by countBinnedIons(), IonHit::getBoundCube(), MainWindowFrame::OnUpdateTimer(), MainWindowFrame::realignCameraButton(), setGridABCoords(), TransformFilter::setPropFromBinding(), and VoxeliseFilter::setPropFromBinding().
void BoundCube::getBound | ( | Point3D & | bound, |
unsigned int | minMax | ||
) | const |
Get the bounds.
References ASSERT, and Point3D::setValue().
Referenced by VoxeliseFilter::calculateNumBinsFromWidths(), VoxeliseFilter::calculateWidthsFromNumBins(), contains(), BoxCropEffect::enable(), BoxCropEffect::getCroppedBounds(), Voxels< float >::init(), BoundingBoxFilter::numBytesForCache(), IonInfoFilter::refresh(), VoxeliseFilter::refresh(), DrawRectPrism::setAxisAligned(), and VoxeliseFilter::setPropFromBinding().
Point3D BoundCube::getCentroid | ( | ) | const |
Return the centroid.
References ASSERT.
Referenced by Scene::applyDevice(), Scene::computeSceneLimits(), Scene::draw(), CameraLookAt::ensureVisible(), MainWindowFrame::realignCameraButton(), TransformFilter::refresh(), VoxeliseFilter::refresh(), and DrawTriangleMesh::setData().
float BoundCube::getLargestDim | ( | ) | const |
float BoundCube::getMaxDistanceToBox | ( | const Point3D & | pt | ) | const |
Returns maximum distnace to box corners (which is an upper bound on max box distance).
References ASSERT, and Point3D::sqrDist().
Referenced by CameraLookAt::apply(), and BasicGLPane::saveImage().
void BoundCube::getPlaneIntersectVertices | ( | const Point3D & | planeOrigin, |
const Point3D & | normal, | ||
std::vector< Point3D > & | intersectPts | ||
) | const |
Obtain the vertices that arise from the intersection of a plane with the cube.
References ASSERT, Point3D::centroid(), clockwiseAngle(), Point3D::normalise(), and vectorMultiErase().
Referenced by VoxeliseFilter::refresh(), and rmFile().
float BoundCube::getSize | ( | unsigned int | dim | ) | const |
Return the side length of the cube along the specified dimension.
References ASSERT.
Referenced by countBinnedIons(), and CameraLookAt::ensureVisible().
Point3D BoundCube::getVertex | ( | unsigned int | idx | ) | const |
Obtain a corner point of the cube.
References ASSERT.
void BoundCube::getVertices | ( | std::vector< Point3D > & | p, |
bool | centre = false |
||
) | const |
Obtain the corner points of the cube.
Referenced by DrawGLText::getBoundingBox().
bool BoundCube::intersects | ( | const Point3D & | pt, |
float | sqrRad | ||
) | const |
Checks if a point intersects a sphere of centre Pt, radius^2 sqrRad.
References Point3D::getValue(), Point3D::setValue(), and Point3D::sqrDist().
Referenced by K3DTree::findNearest(), K3DTreeMk2::findNearestUntagged(), K3DTreeMk2::findNearestWithSkip(), K3DTreeMk2::getTreesInSphere(), and K3DTreeMk2::ptsInSphere().
bool BoundCube::isFlat | ( | ) | const |
Returns true if any bound is of null thickness.
Referenced by VoxeliseFilter::refresh().
bool BoundCube::isNumericallyBig | ( | ) | const |
Returns true if any bound of datacube is considered to be "large" in magnitude compared to.
Referenced by DataLoadFilter::refresh().
bool BoundCube::isValid | ( | ) | const |
Returns true if all bounds are valid.
Referenced by Scene::addDrawable(), Scene::addRefDrawable(), Scene::computeSceneLimits(), DrawDispList::endList(), expand(), IonHit::getBoundCube(), getRectilinearBounds(), Scene::glSelect(), TransformFilter::refresh(), BoundingBoxFilter::refresh(), IonInfoFilter::refresh(), VoxeliseFilter::refresh(), VoxeliseFilter::setPropFromBinding(), ClusterAnalysisFilter::setPropFromBinding(), VisController::updateScene(), and Scene::~Scene().
void BoundCube::limits | ( | ) |
References ColourRGBA::a(), ColourRGBA::b(), and setBound().
Referenced by K3DTreeMk2::getBoxInTree().
unsigned int BoundCube::segmentTriple | ( | unsigned int | dim, |
float | slice | ||
) | const |
References ASSERT.
Referenced by K3DTreeMk2::getBoxInTree().
void BoundCube::setBound | ( | unsigned int | bound, |
unsigned int | minMax, | ||
float | value | ||
) |
References ASSERT.
Referenced by IonHit::getBoundCube(), DrawSphere::getBoundingBox(), K3DTreeMk2::getBoxInTree(), and makeUnion().
|
inline |
Referenced by K3DTreeMk2::clearAllTags(), DataLoadFilter::cloneUncached(), Scene::computeSceneLimits(), Mesh::divideMeshSurface(), generate1DAxialDistHistSweep(), generate1DAxialNNHist(), generateDistHist(), generateNNHist(), IonHit::getBoundCube(), K3DTreeMk2::getBoundCube(), DrawManyPoints::getBoundingBox(), DrawVector::getBoundingBox(), DrawTriangle::getBoundingBox(), DrawQuad::getBoundingBox(), DrawPolygon::getBoundingBox(), DrawTriangleMesh::getBoundingBox(), DrawCylinder::getBoundingBox(), DrawGLText::getBoundingBox(), DrawRectPrism::getBoundingBox(), DrawField3D::getBoundingBox(), DrawIsoSurface::getBoundingBox(), Draw2DCircle::getBoundingBox(), Mesh::getBounds(), Voxels< float >::getBounds(), BoxCropEffect::getCroppedBounds(), Voxels< float >::getEdgeEnds(), getRectilinearBounds(), marchingCubes(), Mesh::pointsInside(), Mesh::print(), BoundingBoxFilter::refresh(), VoxeliseFilter::refresh(), Mesh::resurface(), IonClipFilter::setPropFromBinding(), SpatialAnalysisFilter::setPropFromBinding(), and VoxeliseFilter::VoxeliseFilter().
|
inline |
void BoundCube::setBounds | ( | const Point3D * | ptArray, |
unsigned int | nPoints | ||
) |
Obtain bounds from an array of Point3Ds.
Use two points to set bounds – does not need to be high,low. this is worked out/.
void BoundCube::setBounds | ( | const std::vector< Point3D > & | ptArray | ) |
Obtain bounds from an array of Point3Ds.
References ASSERT.
void BoundCube::setBounds | ( | const Point3D & | p, |
float | radius | ||
) |
Set bounds via cube that contains given sphere.
References ColourRGBA::r().
|
inline |
Referenced by DrawPoint::getBoundingBox(), DrawableOverlay::getBoundingBox(), DrawAxis::getBoundingBox(), and getRectilinearBounds().
void BoundCube::setInverseLimits | ( | bool | setAsValid = false | ) |
Referenced by Scene::clearAll(), Scene::computeSceneLimits(), DataLoadFilter::DataLoadFilter(), Mesh::divideMeshSurface(), IonHit::getBoundCube(), DrawGLText::getBoundingBox(), DrawIsoSurface::getBoundingBox(), TransformFilter::refresh(), BoundingBoxFilter::refresh(), VoxeliseFilter::refresh(), Mesh::resurface(), and DrawDispList::startList().
|
inline |
References operator<<().
Referenced by countBinnedIons(), IonInfoFilter::refresh(), and TransformFilter::setPropFromBinding().
|
friend |
|
friend |
|
friend |