Blob 1.0
Public Member Functions | Protected Attributes | List of all members
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. More...
 
virtual ~TreeTaper ()
 Destroys a tapering node in the tree. More...
 
double Intensity (const Vector &) const
 Computes the intensity. More...
 
Vector Gradient (const Vector &) const
 Computes the gradient of the field function. More...
 
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. More...
 
double K (const Ray &) const
 Returns a local Lipschitz constant along a ray. More...
 
double K (const Sphere &) const
 Computes the Lipschitz constant of the sub-tree. More...
 
double K (const Segment &) const
 Computes the Lipschitz constant of the sub-tree. More...
 
double K (const RayStep &) const
 Computes the Lipschitz constant of the sub-tree. More...
 
Color GetMaterial (const Vector &, const Vector &=Vector::Null) const
 Compute the surface parameters at a given point of space. More...
 
TreeNodeCut (const Box &) const
 Cuts the node to simplify its structure inside a box. More...
 
- Public Member Functions inherited from TreeWarp
 TreeWarp (TreeNode *=nullptr)
 Create a warping node. More...
 
virtual ~TreeWarp ()
 Recursively destroys the structure. More...
 
- Public Member Functions inherited from TreeUnary
 TreeUnary (TreeNode *)
 Create a generic warping node. More...
 
virtual ~TreeUnary ()
 Recursively destroys the structure.
 
virtual int Nodes () const
 Compute the number of nodes of the sub-tree. More...
 
virtual int Depth () const
 Compute the dpeth of the sub-tree. More...
 
virtual void SetThreshold (const double &)
 Recursively setup the threshold value. More...
 
- 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 void IntensityGradient (const Vector &, double &, Vector &) const
 Computes the field value and the gradient at a given point in space. More...
 
virtual TreeNodeBlend (TreeNode *)
 Insert a blending node that blends the old and the new sub-tree together. More...
 
virtual TreeNodeUnion (TreeNode *)
 Insert a union node that unions the old and the new sub-tree together. More...
 
virtual TreeNodeDifference (TreeNode *)
 Insert a difference node. More...
 
virtual TreeNodeTranslate (const Vector &)
 Insert a translation node. More...
 
virtual TreeNodeRotate (const Matrix &)
 Insert a rotation node. More...
 
virtual TreeNodeScale (const Vector &)
 Insert a scaling node. More...
 
Box GetBox () const
 Return the bounding box of the node.
 
virtual Vector Dichotomy (Vector, Vector, double, double, double, const double &=1.0e-4)
 Compute the intersection between the implicit surface and a segment. More...
 

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:114
Segment skeletal primitive.
Definition: blobtree.h:658
The generic nodes with some pure virtual functions.
Definition: blobtree.h:27
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

◆ Cut()

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

Cuts the node to simplify its structure inside a box.

Parameters
bThe box.

Implements 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.

◆ Gradient()

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

Computes the gradient of the field function.

Parameters
pPoint.

Reimplemented from TreeNode.

◆ 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.

◆ 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 RayStep raystep) const
virtual

Computes the Lipschitz constant of the sub-tree.

Parameters
raystepThe segment.

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 Sphere s) const
virtual

Computes the Lipschitz constant of the sub-tree.

Parameters
sThe sphere.

Reimplemented from TreeNode.