Blob 1.0
Public Member Functions | Static Public Member Functions | List of all members

The union node. More...

#include <blobtree.h>

Inheritance diagram for TreeUnion:
TreeBinary TreeOperator TreeNode

Public Member Functions

 TreeUnion (TreeNode *, TreeNode *)
 Creates a union operator given a two sub-trees. More...
 
 TreeUnion (TreeNode **, int)
 Creates a union operator node given an array of nodes. More...
 
 TreeUnion (TreeNode *, TreeNode *, TreeNode *, TreeNode *=nullptr)
 Creates a union operator node given up to four children nodes.
 
virtual ~TreeUnion ()
 Destroy a union node. More...
 
double Intensity (const Vector &) const
 Computes the field value at a given point in space. More...
 
Vector Gradient (const Vector &) const
 Compute the gradient. More...
 
virtual TreeNodeCopy () const
 Performs a deep copy.
 
double K () const
 Computes the gradient Lipschitz constant of the sub-tree.
 
double K (const Box &) const
 Computes the Lipschitz constant of the sub-tree within a box. More...
 
double K (const Segment &) const
 Compute the Lipschitz constant along a segment. More...
 
double K (const RayStep &) const
 Compute the Lipschitz constant along a segment. More...
 
double K (const Sphere &) const
 Compute the Lipschitz constant in a sphere. More...
 
double K (const Ray &) const
 Computes the Lipschitz constant of the sub-tree along a ray. More...
 
Color GetMaterial (const Vector &, const Vector &=Vector::Null) const
 Computes the texture at a given point in space. More...
 
TreeNodeCut (const Box &) const
 Cuts the 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...
 
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...
 

Static Public Member Functions

static TreeUnionQuadricSurface (const Vector &, const Vector &, const double &, const double &, Vector2 *, int)
 This function creates a surface of revolution. More...
 
static TreeUnionQuadricCurve (const double &, const double &, Vector *, int)
 This function creates a quadric Bézier curve controled by an array of control knots. More...
 
static TreeNodeSet (const QVector< TreeNode * > &)
 Union a set of sub-trees. 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

The union node.

Example of how to code such a node:

TreeNode* node=new TreeUnion(
new TreeVertex(Vector(1,0,-2),new BlendCubic(2.0,1.0)),
new TreeVertex(Vector(-1,4,0),new BlendCubic(1.0,1.0)));
Normalized blending functions (1-r2)3.
Definition: blend.h:114
The generic nodes with some pure virtual functions.
Definition: blobtree.h:27
TreeUnion(TreeNode *, TreeNode *)
Creates a union operator given a two sub-trees.
Definition: treeunion.cpp:40
A point skeleton element.
Definition: blobtree.h:550

,

Constructor & Destructor Documentation

◆ TreeUnion() [1/2]

TreeUnion::TreeUnion ( TreeNode a,
TreeNode b 
)
explicit

Creates a union operator given a two sub-trees.

Parameters
a,bSub-trees.

◆ TreeUnion() [2/2]

TreeUnion::TreeUnion ( TreeNode **  a,
int  n 
)
explicit

Creates a union operator node given an array of nodes.

Note that the array should contain at least two elements.

◆ ~TreeUnion()

TreeUnion::~TreeUnion ( )
virtual

Destroy a union node.

Implicitly calls TreeOperator::~TreeOperator().

Member Function Documentation

◆ Cut()

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

Cuts the to simplify its structure inside a box.

This function returns a null pointer either if the box does not intersect the bounding box of the union, or if it misses the bounding box of all children.

Parameters
bThe box.

Implements TreeNode.

◆ GetMaterial()

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

Computes the texture at a given point in space.

Returns the color of the child node with highest field value.

Parameters
pPoint.
nNormal.

Reimplemented from TreeNode.

◆ Gradient()

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

Compute the gradient.

The returned vector is the gradient of the maximum contributing field function.

Parameters
pPoint.

Reimplemented from TreeNode.

◆ Intensity()

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

Computes the field value at a given point in space.

Parameters
pPoint.

Implements TreeNode.

◆ K() [1/5]

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

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

Parameters
bThe box.

Implements TreeNode.

◆ K() [2/5]

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

Computes the Lipschitz constant of the sub-tree along a ray.

Parameters
rayThe ray.

Implements TreeNode.

◆ K() [3/5]

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

Compute the Lipschitz constant along a segment.

Parameters
raystepThe segment.

Reimplemented from TreeNode.

◆ K() [4/5]

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

Compute the Lipschitz constant along a segment.

Parameters
sThe segment.

Reimplemented from TreeNode.

◆ K() [5/5]

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

Compute the Lipschitz constant in a sphere.

Parameters
sThe sphere.

Reimplemented from TreeNode.

◆ QuadricCurve()

TreeUnion * TreeUnion::QuadricCurve ( const double &  r,
const double &  s,
Vector p,
int  n 
)
static

This function creates a quadric Bézier curve controled by an array of control knots.

The field functions are simple normalized cubics (i.e. skeletal elements use the BlendCubic class).

Parameters
r,sThe radius of influence and the strength of the field function.
pThe array of control vertices.
nThe number of vertices.

◆ QuadricSurface()

TreeUnion * TreeUnion::QuadricSurface ( const Vector a,
const Vector b,
const double &  r,
const double &  s,
Vector2 p,
int  n 
)
static

This function creates a surface of revolution.

The profile is a quadric Bézier curve controled by an array of control knots.

The field functions are simple normalized cubics (i.e. skeletal elements use the BlendCubic class).

Parameters
a,bThe end vertices of the axis.
r,sThe radius of influence and the strength of the field function.
pThe array of control vertices.
nThe number of vertices.

◆ Set()

TreeNode * TreeUnion::Set ( const QVector< TreeNode * > &  set)
static

Union a set of sub-trees.

Parameters
setSet of nodes.