Blob 1.0
TreeTaper Class Reference

A tapering node in the BlobTree. More...

#include <blobtree.h>

Inheritance diagram for TreeTaper:
TreeWarp Taper TreeUnary Axis TreeOperator TreeNode

Public Member Functions

 TreeTaper (TreeNode *, const Vector &, const Vector &, const Cubic &)
 Creates a tapering node.
 
virtual ~TreeTaper ()
 Destroys a tapering node in the tree.
 
double Intensity (const Vector &) const
 Computes the intensity.
 
Vector Gradient (const Vector &) const
 Computes the gradient of the field function.
 
virtual TreeNodeCopy () const
 Deep copy.
 
int Memory () const
 Compute the size of a node.
 
double K () const
 Computes the Lipschitz constant of the sub-tree.
 
double K (const Box &) const
 Computes the Lipschitz constant of the sub-tree.
 
double K (const Ray &) const
 Returns a local Lipschitz constant along a ray.
 
double K (const Sphere &) const
 Computes the Lipschitz constant of the sub-tree.
 
double K (const Segment &) const
 Computes the Lipschitz constant of the sub-tree.
 
double K (const RayStep &) const
 Computes the Lipschitz constant of the sub-tree.
 
Color GetMaterial (const Vector &, const Vector &=Vector::Null) const
 Compute the surface parameters at a given point of space.
 
TreeNodeCut (const Box &) const
 Cuts the node to simplify its structure inside a box.
 
- Public Member Functions inherited from TreeWarp
 TreeWarp (TreeNode *=nullptr)
 Create a warping node.
 
virtual ~TreeWarp ()
 Recursively destroys the structure.
 
- Public Member Functions inherited from TreeUnary
 TreeUnary (TreeNode *)
 Create a generic warping node.
 
virtual ~TreeUnary ()
 Recursively destroys the structure.
 
virtual int Nodes () const
 Compute the number of nodes of the sub-tree.
 
virtual int Depth () const
 Compute the dpeth of the sub-tree.
 
virtual void SetThreshold (const double &)
 Recursively setup the threshold value.
 
- Public Member Functions inherited from TreeOperator
 TreeOperator ()
 Creates an operator node.
 
virtual ~TreeOperator ()
 Destroys an operator.
 
- Public Member Functions inherited from TreeNode
 TreeNode ()
 Create a virtual node of the Blob-Tree structure.
 
virtual ~TreeNode ()
 Destroys a node.
 
virtual double Omega (const Vector &) const
 Return the squared distance to the compact support of the node.
 
virtual void IntensityGradient (const Vector &, double &, Vector &) const
 Computes the field value and the gradient at a given point in space.
 
virtual TreeNodeBlend (TreeNode *)
 Insert a blending node that blends the old and the new sub-tree together.
 
virtual TreeNodeUnion (TreeNode *)
 Insert a union node that unions the old and the new sub-tree together.
 
virtual TreeNodeDifference (TreeNode *)
 Insert a difference node.
 
virtual TreeNodeTranslate (const Vector &)
 Insert a translation node.
 
virtual TreeNodeRotate (const Matrix &)
 Insert a rotation node.
 
virtual TreeNodeScale (const Vector &)
 Insert a scaling node.
 
Box GetBox () const
 Return the bounding box of the node.
 
virtual QString Show (int=0) const
 Show the tree hierarchy.
 
virtual Vector Dichotomy (Vector, Vector, double, double, double, const double &=1.0e-4)
 Compute the intersection between the implicit surface and a segment.
 

Protected Attributes

double k
 Lipschitz factor for tapering.
 
- Protected Attributes inherited from TreeNode
Box box = Box::Null
 Bounding box of the node.
 
double T = 0.5
 Threshold value.
 

Additional Inherited Members

- Static Protected Attributes inherited from TreeNode
static const double Epsilon = 1e-6
 Epsilon value for gradient computation.
 

Detailed Description

A tapering node in the BlobTree.

Tapering is performed along an axis. Within the corresponding cylinder, the tapering coefficient is defined by a cubic spline curve. Outside the cylinder, tapering is kept constant.

,

Example of how to code a taper:

TreeNode* edge=new TreeEdge(Vector(0.0,0.0,-4.0),Vector(0.0,0.0,4.0),new BlendCubic(2.0,1.0));
TreeNode* taper=new TreeTaper(edge,Vector(0.0,0.0,-2.0),Vector(0.0,0.0,2.0),1.0,2.0,0.0,0.0);
Normalized blending functions (1-r2)3.
Definition blend.h:91
Segment skeletal primitive.
Definition blobtree.h:694
The generic nodes with some pure virtual functions.
Definition blobtree.h:28
TreeTaper(TreeNode *, const Vector &, const Vector &, const Cubic &)
Creates a tapering node.
Definition treetaper.cpp:28

Constructor & Destructor Documentation

◆ TreeTaper()

TreeTaper::TreeTaper ( TreeNode * node,
const Vector & a,
const Vector & b,
const Cubic & c )
explicit

Creates a tapering node.

Parameters
nodeChild node.
a,bEnd vertices of the axis.
cCubic function characterizing the tapering radius.

◆ ~TreeTaper()

TreeTaper::~TreeTaper ( )
virtual

Destroys a tapering node in the tree.

Implicitly calls TreeWarp::~TreeWarp() that recursively calls the destructor of the sub-tree.

Member Function Documentation

◆ Intensity()

double TreeTaper::Intensity ( const Vector & p) const
virtual

Computes the intensity.

Transform the point according to the taper parameters, and compute the intensity at the warped location.

Parameters
pPoint.

Implements TreeNode.

◆ Gradient()

Vector TreeTaper::Gradient ( const Vector & p) const
virtual

Computes the gradient of the field function.

Parameters
pPoint.

Reimplemented from TreeNode.

◆ K() [1/5]

double TreeTaper::K ( const Box & b) const
virtual

Computes the Lipschitz constant of the sub-tree.

Parameters
bThe box.

Implements TreeNode.

◆ K() [2/5]

double TreeTaper::K ( const Ray & ray) const
virtual

Returns a local Lipschitz constant along a ray.

Returns the Lipschitz constant of the element if argument ray intersects the element's bounding box.

Parameters
rayThe ray.

Implements TreeNode.

◆ K() [3/5]

double TreeTaper::K ( const Sphere & s) const
virtual

Computes the Lipschitz constant of the sub-tree.

Parameters
sThe sphere.

Reimplemented from TreeNode.

◆ K() [4/5]

double TreeTaper::K ( const Segment & s) const
virtual

Computes the Lipschitz constant of the sub-tree.

Parameters
sThe segment.

Reimplemented from TreeNode.

◆ K() [5/5]

double TreeTaper::K ( const RayStep & raystep) const
virtual

Computes the Lipschitz constant of the sub-tree.

Parameters
raystepThe segment.

Reimplemented from TreeNode.

◆ GetMaterial()

Color TreeTaper::GetMaterial ( const Vector & p,
const Vector & n = Vector::Null ) const
virtual

Compute the surface parameters at a given point of space.

Parameters
pPoint.
nNormal.

Implements TreeWarp.

◆ Cut()

TreeNode * TreeTaper::Cut ( const Box & b) const
virtual

Cuts the node to simplify its structure inside a box.

Parameters
bThe box.

Implements TreeNode.