Blob 1.0
TreeInstantiate Class Reference

A simple instancing node. More...

#include <blobtree.h>

Inheritance diagram for TreeInstantiate:
TreeUnary TreeOperator TreeNode

Public Member Functions

 TreeInstantiate (TreeNode *, const QVector< Frame > &)
 Creates an virtual clone of the subtree, translated at a given position.
 
virtual ~TreeInstantiate ()
 Destroys the subtree.
 
virtual void SetThreshold (const double &)
 Recursively setup the threshold value.
 
double Intensity (const Vector &) const
 Compute the field value.
 
Vector Gradient (const Vector &) const
 Compute the gradient of the field function.
 
virtual TreeNodeCopy () const
 Creates a deep copy of the node.
 
double K () const
 Computes the Lipschitz constant of the sub-tree.
 
double K (const Box &) const
 Compute the local Lipschitz constant in a box.
 
double K (const Ray &) const
 Computes the Lipschitz constant along a ray.
 
double K (const Segment &) const
 Computes the Lipschitz constant.
 
double K (const RayStep &) const
 Compute the Lipschitz constant along an optimized ray-stepping segment.
 
double K (const Sphere &) const
 Computes the Lipschitz constant.
 
Color GetMaterial (const Vector &, const Vector &=Vector::Null) const
 Computes the texture of an alpha-node. Simply scales the texture parameters.
 
TreeNodeCut (const Box &) const
 Cuts the node to simplify its structure inside a box.
 
virtual int Memory () const
 Compute the size of the sub-tree.
 
- 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.
 
- 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

QVector< Frameframes
 Set of instances.
 
- 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 simple instancing node.

,

Constructor & Destructor Documentation

◆ TreeInstantiate()

TreeInstantiate::TreeInstantiate ( TreeNode * node,
const QVector< Frame > & f )
explicit

Creates an virtual clone of the subtree, translated at a given position.

Parameters
nodeChild node.
fSet of frames for instantiation.

Member Function Documentation

◆ SetThreshold()

void TreeInstantiate::SetThreshold ( const double & T)
virtual

Recursively setup the threshold value.

Parameters
TThreshold.

Reimplemented from TreeUnary.

◆ Intensity()

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

Compute the field value.

Parameters
pPoint.

Implements TreeNode.

◆ Gradient()

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

Compute the gradient of the field function.

Parameters
pPoint.

Reimplemented from TreeNode.

◆ K() [1/5]

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

Compute the local Lipschitz constant in a box.

Implements TreeNode.

◆ K() [2/5]

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

Computes the Lipschitz constant along a ray.

Parameters
rayThe ray.

Implements TreeNode.

◆ K() [3/5]

double TreeInstantiate::K ( const Segment & segment) const
virtual

Computes the Lipschitz constant.

Parameters
segmentThe segment.

Reimplemented from TreeNode.

◆ K() [4/5]

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

Compute the Lipschitz constant along an optimized ray-stepping segment.

By default return the Lipchitz constant of the segment, i.e. do not use optimized algorithms with pre-computed data in RayStep.

Parameters
raystepThe step.

Reimplemented from TreeNode.

◆ K() [5/5]

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

Computes the Lipschitz constant.

Parameters
sThe sphere.

Reimplemented from TreeNode.

◆ GetMaterial()

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

Computes the texture of an alpha-node. Simply scales the texture parameters.

Parameters
pPoint.
nNormal.

Reimplemented from TreeNode.

◆ Cut()

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

Cuts the node to simplify its structure inside a box.

The implementation should be improved and optimized.

Parameters
bThe box.

Implements TreeNode.