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

Scaling nodes in the BlobTree. More...

#include <blobtree.h>

Inheritance diagram for TreeScale:
TreeWarp TreeUnary TreeOperator TreeNode

Public Member Functions

 TreeScale (TreeNode *, const Vector &)
 Creates a scaling node in the tree structure. More...
 
 TreeScale (TreeNode *, const double &)
 Creates a scaling node in the tree structure. More...
 
virtual ~TreeScale ()
 Destroy a scaling node in the tree. More...
 
double Intensity (const Vector &) const
 Returns the intensity computed by the child node after transforming the point into local space. More...
 
Vector Gradient (const Vector &) const
 Returns the transformed gradient computed by the child node after scaling the point into local space. More...
 
virtual TreeNodeCopy () const
 Creates a deep copy of the scale node.
 
int Memory () const
 Compute the size of a node.
 
virtual double K () const
 Returns the Lipschitz constant of a scale node.
 
virtual double K (const Box &) const
 Computes the Lipschitz constant within an argument box. More...
 
virtual double K (const Ray &) const
 Computes the Lipschitz constant of the scale node if intersecting a ray. More...
 
virtual double K (const Segment &) const
 Computes the Lipschitz constant of the scale node over a segment. More...
 
virtual double K (const RayStep &) const
 Computes the Lipschitz constant of the scale node over a segment. More...
 
virtual double K (const Sphere &) const
 Computes the Lipschitz constant of the scale node in a sphere. More...
 
Color GetMaterial (const Vector &, const Vector &=Vector::Null) const
 Compute the surface parameters at a given point of space. More...
 
TreeNodeCut (const Box &) const
 Cuts the node to simplify its structure inside a box. More...
 
virtual TreeNodeScale (const Vector &)
 Scales the node in the BlobTree. 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...
 
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

Vector s
 Scaling vector.
 
double a
 Lipschitz factor.
 
- 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

Scaling nodes in the BlobTree.

Scaling nodes are very specific affine transformations with very simple and efficient code.

Example of how to code a scaling node:

TreeNode *element=new TreeNodeEdge(Vector(1,0,-1),Vector(1,0,1),new BlendCubic(2.0,1.0));
TreeNode *scaled=new TreeScale(element,Vector(2.0,1.0,4.0));
Normalized blending functions (1-r2)3.
Definition: blend.h:114
The generic nodes with some pure virtual functions.
Definition: blobtree.h:27
TreeScale(TreeNode *, const Vector &)
Creates a scaling node in the tree structure.
Definition: treescale.cpp:26

,

Constructor & Destructor Documentation

◆ TreeScale() [1/2]

TreeScale::TreeScale ( TreeNode node,
const Vector u 
)
explicit

Creates a scaling node in the tree structure.

Parameters
nodeChild node.
uScaling vector.

◆ TreeScale() [2/2]

TreeScale::TreeScale ( TreeNode node,
const double &  u 
)
explicit

Creates a scaling node in the tree structure.

Parameters
nodeChild node.
uScaling coefficient.

◆ ~TreeScale()

TreeScale::~TreeScale ( )
virtual

Destroy a scaling node in the tree.

Implicitly calls the destructor TreeWarp::TreeWarp() that recursively destroys its child node.

Member Function Documentation

◆ Cut()

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

Cuts the node to simplify its structure inside a box.

Parameters
bThe box.

Implements TreeNode.

◆ GetMaterial()

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

Compute the surface parameters at a given point of space.

Parameters
pPoint in space.
nNormal.

Implements TreeWarp.

◆ Gradient()

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

Returns the transformed gradient computed by the child node after scaling the point into local space.

Parameters
pPoint.

Reimplemented from TreeNode.

◆ Intensity()

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

Returns the intensity computed by the child node after transforming the point into local space.

Parameters
pPoint.

Implements TreeNode.

◆ K() [1/5]

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

Computes the Lipschitz constant within an argument box.

Tests if the argument box intersects the box of the node, and returns the Lipchitz constant of the tree structure times the maximum inverse scaling coefficient if intersection occurs.

Parameters
bThe box.

Implements TreeNode.

◆ K() [2/5]

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

Computes the Lipschitz constant of the scale node if intersecting a ray.

Parameters
rayThe ray.

Implements TreeNode.

◆ K() [3/5]

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

Computes the Lipschitz constant of the scale node over a segment.

Parameters
raystepThe segment.

Reimplemented from TreeNode.

◆ K() [4/5]

double TreeScale::K ( const Segment segment) const
virtual

Computes the Lipschitz constant of the scale node over a segment.

Parameters
segmentThe segment.

Reimplemented from TreeNode.

◆ K() [5/5]

double TreeScale::K ( const Sphere sphere) const
virtual

Computes the Lipschitz constant of the scale node in a sphere.

Parameters
sphereThe Sphere.

Reimplemented from TreeNode.

◆ Scale()

TreeNode * TreeScale::Scale ( const Vector u)
virtual

Scales the node in the BlobTree.

Instead of inserting a scaling node in the tree, simply updates the scaling node with the given scaling vector.

Parameters
uScaling vector.

Reimplemented from TreeNode.