Blob 1.0
TreeCloneRevolution Class Reference

Cloning operator. More...

#include <blobtree.h>

Inheritance diagram for TreeCloneRevolution:
TreeUnary TreeOperator TreeNode

Public Member Functions

 TreeCloneRevolution (TreeNode *, const Axis &, int)
 Create n virtual clones of the sub-tree, and locate them by rotating the sub-tree around the axis.
virtual ~TreeCloneRevolution ()
 Destructor.
double Intensity (const Vector &) const
 Compute the signed distance function.
Vector Gradient (const Vector &) const
 Compute the gradient of the signed distance function.
virtual TreeNode * Copy () const
 Creates a deep copy of the 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 within the argument box.
double K (const Ray &) const
 Computes the Lipschitz constant.
Color GetMaterial (const Vector &, const Vector &=Vector::Null) const
 Compute the color.
TreeNode * Cut (const Box &) const
 Cuts the node to simplify its structure inside a box.
virtual int Memory () const
 Compute the size of the sub-tree.
virtual QString Show (int=0) const
 Show the tree hierarchy.
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 depth 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 TreeNode * Blend (TreeNode *)
 Insert a blending node that blends the old and the new sub-tree together.
virtual TreeNode * Union (TreeNode *)
 Insert a union node that unions the old and the new sub-tree together.
virtual TreeNode * Difference (TreeNode *)
 Insert a difference node.
virtual TreeNode * Translate (const Vector &)
 Insert a translation node.
virtual TreeNode * Rotate (const Matrix &)
 Insert a rotation node.
virtual TreeNode * Scale (const Vector &)
 Insert a scaling node.
virtual double K (const Segment &) const
 Compute the Lipschitz constant along a segment.
virtual double K (const RayStep &) const
 Compute the Lipschitz constant along an optimized ray-stepping segment.
virtual double K (const Sphere &) const
 Compute the Lipschitz constant in a sphere.
Box GetBox () const
 Return the bounding box of the node.

Protected Attributes

Axis axis
 Revolution axis.
Matrix r
 Rotation matrix.
int n
 Number of clones.
Protected Attributes inherited from TreeNode
Box box = Box::Null
 Bounding box of the node.
double T = 0.5
 Threshold value.

Additional Inherited Members

Static Public Member Functions inherited from TreeNode
static TreeNode * UnitBoxCentered (TreeNode *)
 Create a unit box centered node.
Static Protected Attributes inherited from TreeNode
static const double Epsilon = 1e-6
 Epsilon value for gradient computation.

Detailed Description

Cloning operator.

See also
SDFClone

Constructor & Destructor Documentation

◆ TreeCloneRevolution()

TreeCloneRevolution::TreeCloneRevolution ( TreeNode * s,
const Axis & a,
int n )
explicit

Create n virtual clones of the sub-tree, and locate them by rotating the sub-tree around the axis.

Parameters
sSub-tree.
aAxis.
nNumber of clones.

Member Function Documentation

◆ Intensity()

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

Compute the signed distance function.

This operator preserves the Euclidean distance (if argument sub-trees provide a Euclidean distance).

Parameters
pPoint.

Implements TreeNode.

◆ Gradient()

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

Compute the gradient of the signed distance function.

Identifies the contributing clone using n calls to Signed() — one per rotated copy of the sub-tree — to find the clone with the minimum signed distance. The gradient is then computed with a single call to Gradient() on that clone and mapped back to world space through the accumulated inverse rotation. Total cost: n + 1 SDF evaluations instead of the naive 2n.

Parameters
pPoint.

Reimplemented from TreeNode.

◆ K() [1/2]

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

Computes the Lipschitz constant of the sub-tree within the argument box.

Parameters
bThe box.

Implements TreeNode.

◆ K() [2/2]

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

Computes the Lipschitz constant.

Parameters
rayThe ray.

Implements TreeNode.

◆ GetMaterial()

Color TreeCloneRevolution::GetMaterial ( const Vector & p,
const Vector & normal = Vector::Null ) const
virtual

Compute the color.

The color is that of the instance that defines the distance in Intensity(), i.e. the closest one.

Parameters
pPoint.
normalNormal.

Reimplemented from TreeNode.

◆ Cut()

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

Cuts the node to simplify its structure inside a box.

This function breaks the cloning.

Parameters
bThe box.

Implements TreeNode.

◆ Show()

QString TreeCloneRevolution::Show ( int space = 0) const
virtual

Show the tree hierarchy.

Parameters
spaceNumber of spaces.

Reimplemented from TreeNode.