Blob 1.0
Public Member Functions | Protected Attributes | List of all members
TreeTwist Class Reference

Twisting nodes. More...

#include <blobtree.h>

Inheritance diagram for TreeTwist:
TreeWarp Twist TreeUnary Axis TreeOperator TreeNode

Public Member Functions

 TreeTwist (TreeNode *, const Vector &, const Vector &, const double &)
 Creates a twisting operator. More...
 
virtual ~TreeTwist ()
 Destroy a twisting node in the tree. More...
 
double Intensity (const Vector &) const
 Computes the intensity at a given point in space. More...
 
Vector Gradient (const Vector &) const
 Computes the gradient of the field function modified by a twist operator. More...
 
virtual TreeNodeCopy () const
 Create a deep copy of twist node.
 
int Memory () const
 Compute the size of a node.
 
double K () const
 Compute the Lipschitz constant of the node.
 
double K (const Sphere &) const
 Compute the Lipschitz constant of the node. More...
 
double K (const Segment &) const
 Compute the Lipschitz constant of the node. More...
 
double K (const RayStep &) const
 Compute the Lipschitz constant of the node. More...
 
double K (const Box &) const
 Compute the Lipschitz constant of the node if box intersects node. More...
 
double K (const Ray &) const
 Compute the Lipschitz constant of the node along the ray. More...
 
Color GetMaterial (const Vector &, const Vector &=Vector::Null) const
 Compute the texture for a twist node. 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 constant.
 
- 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

Twisting nodes.

,

Example of how to code a twist:

TreeNode *element=new TreeNodeEdge(Vector(1,0,-1),Vector(1,0,1),new BlendCubic(2.0,1.0));
TreeNode *twist=new TreeTwist(element,Vector(0,0,0),Vector(0,0,1),Math::Pi);
Normalized blending functions (1-r2)3.
Definition: blend.h:114
static const double Pi
The generic nodes with some pure virtual functions.
Definition: blobtree.h:27
TreeTwist(TreeNode *, const Vector &, const Vector &, const double &)
Creates a twisting operator.
Definition: treetwist.cpp:33

Constructor & Destructor Documentation

◆ TreeTwist()

TreeTwist::TreeTwist ( TreeNode node,
const Vector a,
const Vector b,
const double &  t 
)
explicit

Creates a twisting operator.

This function initializes some internal parameters such as the bounding box and the Lipschitz constant factor. The bounding box can be derived from the twisting axis and the bounding box of the child element in the tree.

The Lipschitz constant multiplier results from the extent of the bounding box and the twisting speed.

Parameters
nodeThe child node being twisted.
a,bEnd vertices of the twisting axis.
tthe twisting angle between end vertices

◆ ~TreeTwist()

TreeTwist::~TreeTwist ( )
virtual

Destroy a twisting node in the tree.

Implicitly calls TreeWarp::~TreeWarp() that recursively calls the destructor of its child.

Member Function Documentation

◆ Cut()

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

Cuts the node to simplify its structure inside a box.

Parameters
bThe box.

Implements TreeNode.

◆ GetMaterial()

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

Compute the texture for a twist node.

Parameters
pPoint.
nNormal.

Implements TreeWarp.

◆ Gradient()

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

Computes the gradient of the field function modified by a twist operator.

This involves the computation of the Jacobian of the warping function at the transformed position in space.

Parameters
pPoint.

Reimplemented from TreeNode.

◆ Intensity()

double TreeTwist::Intensity ( const Vector p) const
virtual

Computes the intensity at a given point in space.

Bascially transform the point according to the twist parameters, and compute the intensity at the perturbed location.

Parameters
pPoint.

Implements TreeNode.

◆ K() [1/5]

double TreeTwist::K ( const Box b) const
virtual

Compute the Lipschitz constant of the node if box intersects node.

Parameters
bThe box.

Implements TreeNode.

◆ K() [2/5]

double TreeTwist::K ( const Ray ray) const
virtual

Compute the Lipschitz constant of the node along the ray.

Parameters
rayThe ray.

Implements TreeNode.

◆ K() [3/5]

double TreeTwist::K ( const RayStep raystep) const
virtual

Compute the Lipschitz constant of the node.

Parameters
raystepThe segment.

Reimplemented from TreeNode.

◆ K() [4/5]

double TreeTwist::K ( const Segment s) const
virtual

Compute the Lipschitz constant of the node.

Parameters
sThe segment.

Reimplemented from TreeNode.

◆ K() [5/5]

double TreeTwist::K ( const Sphere s) const
virtual

Compute the Lipschitz constant of the node.

Parameters
sThe sphere.

Reimplemented from TreeNode.