Blob 1.0
TreeColor Class Reference

Color node. More...

#include <blobtree.h>

Inheritance diagram for TreeColor:
TreeUnary TreeOperator TreeNode

Public Member Functions

 TreeColor (TreeNode *, const Color &)
 Create a color node.
virtual ~TreeColor ()
 Recursively destroys the color node.
double Intensity (const Vector &) const
 Compute the intensity.
Vector Gradient (const Vector &) const
 Compute the gradient.
virtual TreeNodeCopy () const
 Creates a deep copy of the node.
TreeNodeCut (const Box &) const
 Cuts the node to simplify its structure inside a box.
int Memory () const
 Compute the size of the node.
double K () const
 Returns the Lipschitz constant of the element.
double K (const Box &) const
 Compute the local Lipschitz constant in a box.
double K (const Sphere &) const
 Returns the Lipschitz constant of the node.
double K (const Segment &) const
 Returns the Lipschitz constant of the node.
double K (const Ray &) const
 Returns the Lipschitz constant of the node if the ray intersects its bounding box.
double K (const RayStep &) const
 Returns the Lipschitz constant of the node if the ray intersects its bounding box.
Color GetMaterial (const Vector &, const Vector &=Vector::Null) const
 Compute the color at a given point of space.
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.
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 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

Color color
 Color.
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

Color node.

The color node defines the color of the sub-tree.

Constructor & Destructor Documentation

◆ TreeColor()

TreeColor::TreeColor ( TreeNode * node,
const Color & color )
explicit

Create a color node.

Parameters
nodeSub-tree.
colorColor.

Member Function Documentation

◆ Intensity()

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

Compute the intensity.

Parameters
pPoint.

Implements TreeNode.

◆ Gradient()

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

Compute the gradient.

Parameters
pPoint.

Reimplemented from TreeNode.

◆ Cut()

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

Cuts the node to simplify its structure inside a box.

Parameters
bThe box.

Implements TreeNode.

◆ K() [1/6]

double TreeColor::K ( ) const
virtual

Returns the Lipschitz constant of the element.

Simply return the Lipschitz constant of the child node.

Implements TreeNode.

◆ K() [2/6]

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

Compute the local Lipschitz constant in a box.

Implements TreeNode.

◆ K() [3/6]

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

Returns the Lipschitz constant of the node.

Parameters
sThe sphere.

Reimplemented from TreeNode.

◆ K() [4/6]

double TreeColor::K ( const Segment & s) const
virtual

Returns the Lipschitz constant of the node.

Parameters
sSegment box.

Reimplemented from TreeNode.

◆ K() [5/6]

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

Returns the Lipschitz constant of the node if the ray intersects its bounding box.

Parameters
rayThe ray.

Implements TreeNode.

◆ K() [6/6]

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

Returns the Lipschitz constant of the node if the ray intersects its bounding box.

Parameters
raystepThe ray-step.

Reimplemented from TreeNode.

◆ GetMaterial()

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

Compute the color at a given point of space.

The whole sub-tree is colored by the node.

Parameters
pPoint in space.
nNormal.

Reimplemented from TreeNode.