Blob 1.0
Public Member Functions | List of all members
TreeBlendSquared Class Reference

Hyper-quadric blending. More...

#include <blobtree.h>

Inheritance diagram for TreeBlendSquared:
TreeBinary TreeOperator TreeNode

Public Member Functions

 TreeBlendSquared (TreeNode *, TreeNode *, TreeNode *=nullptr, TreeNode *=nullptr)
 Creates a blending operator node given a set of children nodes. More...
 
virtual ~TreeBlendSquared ()
 Destroy a hyper-blending node.
 
double Intensity (const Vector &) const
 Compute the field value of a hyper-blending node at a given point in space. More...
 
Vector Gradient (const Vector &) const
 Computes the gradient for a hyper-blend node. This function has been optimized to reduce function calls. More...
 
virtual TreeNodeCopy () const
 Creates a deep copy of node.
 
double K () const
 Computes the gradient Lipschitz constant of the sub-tree.
 
double K (const Box &) const
 Compute the local Lipschitz constant in a box. More...
 
double K (const Segment &) const
 Compute the Lipschitz constant along a segment. More...
 
double K (const Sphere &) const
 Computes the Lipschitz constant of the sub-tree. More...
 
double K (const Ray &) const
 Computes the Lipschitz constant of the sub-tree. More...
 
Color GetMaterial (const Vector &, const Vector &=Vector::Null) const
 Blend textures using squared blending. More...
 
TreeNodeCut (const Box &) const
 Cuts the node to simplify its structure inside a box. More...
 
- Public Member Functions inherited from TreeBinary
 TreeBinary (TreeNode *, TreeNode *)
 Creates a union operator node given a small set of children nodes. More...
 
virtual ~TreeBinary ()
 Destroys an operator, destroying all existing children.
 
virtual int Memory () const
 Compute the size of the sub-tree.
 
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...
 
virtual double K (const RayStep &) const
 Compute the Lipschitz constant along an optimized ray-stepping segment. 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...
 

Additional Inherited Members

- Protected Attributes inherited from TreeNode
Box box = Box::Null
 Bounding box of the node.
 
double T = 0.5
 Threshold value.
 
- Static Protected Attributes inherited from TreeNode
static const double Epsilon = 1e-6
 Epsilon value for gradient computation.
 

Detailed Description

Hyper-quadric blending.

The leaves of this node should generate a positive field everywhere in space.

See also
TreeHyperBlend

Constructor & Destructor Documentation

◆ TreeBlendSquared()

TreeBlendSquared::TreeBlendSquared ( TreeNode n0,
TreeNode n1,
TreeNode n2 = nullptr,
TreeNode n3 = nullptr 
)

Creates a blending operator node given a set of children nodes.

Parameters
n0,n1,n2,n3Set of sub-trees.

Member Function Documentation

◆ Cut()

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

Cuts the node to simplify its structure inside a box.

Parameters
bThe box.

Implements TreeNode.

◆ GetMaterial()

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

Blend textures using squared blending.

Parameters
pPoint.
nNormal.

Reimplemented from TreeNode.

◆ Gradient()

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

Computes the gradient for a hyper-blend node. This function has been optimized to reduce function calls.

Parameters
pPoint.

Reimplemented from TreeNode.

◆ Intensity()

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

Compute the field value of a hyper-blending node at a given point in space.

Parameters
pPoint.

Implements TreeNode.

◆ K() [1/4]

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

Compute the local Lipschitz constant in a box.

Implements TreeNode.

◆ K() [2/4]

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

Computes the Lipschitz constant of the sub-tree.

Parameters
rayThe ray.

Implements TreeNode.

◆ K() [3/4]

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

Compute the Lipschitz constant along a segment.

Parameters
sThe segment.

Reimplemented from TreeNode.

◆ K() [4/4]

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

Computes the Lipschitz constant of the sub-tree.

Parameters
sThe sphere.

Reimplemented from TreeNode.