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

The blending node which is the same blend as for Blobs. More...

#include <blobtree.h>

Inheritance diagram for TreeBlend:
TreeBinary TreeOperator TreeNode

Public Member Functions

 TreeBlend (TreeNode *, TreeNode *, TreeNode *=nullptr, TreeNode *=nullptr)
 Create a blending operator node given at most four children nodes.
 
virtual ~TreeBlend ()
 Destroy a blending node. More...
 
double Intensity (const Vector &) const
 Computes the field value at a given point in space. More...
 
Vector Gradient (const Vector &) const
 Computes the gradient of the blend. More...
 
void IntensityGradient (const Vector &, double &, Vector &) const
 Compute the intensity of a blending node for a given point on a ray. More...
 
virtual TreeNodeCopy () const
 Create a deep copy of blending node.
 
double K () const
 Computes the gradient Lipschitz constant of the blending sub-tree.
 
double K (const Box &) const
 Compute the local Lipschitz constant in 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 an optimized ray-stepping 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 blending sub-tree intersecting a ray.
 
Color GetMaterial (const Vector &, const Vector &=Vector::Null) const
 Get the texture of blending node. More...
 
TreeNodeCut (const Box &) const
 Cuts the node to simplify its structure inside a box.
 
virtual TreeNodeBlend (TreeNode *)
 Inserts a new node at blending node. More...
 
virtual TreeNodeTranslate (const Vector &)
 Translate the blend. More...
 
virtual TreeNodeRotate (const Matrix &)
 Rotates an element. 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 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 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 TreeNodeVertexSet (const QVector< Vector > &, const QVector< double > &, const QVector< double > &)
 Create a cluster of (small) point primitives given their centers, radii and strength. More...
 
static TreeNodeVertexSet (const QVector< Vector > &, const QVector< double > &, const double &)
 Create a cluster of (small) point primitives given their centers and radii, strength is constant. More...
 
static TreeNodeVertexSet (const QVector< Vector > &, const double &, const double &)
 Create a cluster of (small) point primitives given their centers, and common radius and strength. More...
 
static TreeNodeCurveVertex (const Vector &, const Vector &, const double &, const double &, const Vector &, const Vector &, const double &, const double &, const double &, int)
 Create a set of TreeVertex primitives blending together along a curve. More...
 
static TreeNodeSet (const QVector< TreeNode * > &)
 Blend a set of sub-trees. More...
 
static TreeNodeBVHRecursive (QVector< TreeNode * > &, int, int)
 Create a bounding box hierarchy. More...
 
static TreeNodeOptimizeHierarchy (QVector< TreeNode * > &, int, int)
 Recursive BVH Tree construction from a vector<TNode*>. 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 blending node which is the same blend as for Blobs.

Example of how to code such a node:

TreeNode* node=new TreeBlend(
new TreeVertex(Vector(1,0,-2),new BlendCubic(2.0,1.0))),
new TreeVertex(Vector(-1,4,0),new BlendWyvill(1.0,1.0)))
);
Normalized blending functions (1-r2)3.
Definition: blend.h:114
Wyvill's cubic falloff function.
Definition: blend.h:156
TreeBlend(TreeNode *, TreeNode *, TreeNode *=nullptr, TreeNode *=nullptr)
Create a blending operator node given at most four children nodes.
Definition: treeblend.cpp:22
The generic nodes with some pure virtual functions.
Definition: blobtree.h:27
A point skeleton element.
Definition: blobtree.h:550

,

Constructor & Destructor Documentation

◆ ~TreeBlend()

TreeBlend::~TreeBlend ( )
virtual

Destroy a blending node.

Implicitly calls TreeOperator::~TreeOperator().

Member Function Documentation

◆ Blend()

TreeNode * TreeBlend::Blend ( TreeNode e)
virtual

Inserts a new node at blending node.

Instead of inserting a new blending node that blends the old and the new sub-tree together, this member function explores the tree recursively to find the best location where to blend the new node.

Parameters
eElement that will be blended.

Reimplemented from TreeNode.

◆ BVHRecursive()

TreeNode * TreeBlend::BVHRecursive ( QVector< TreeNode * > &  pts,
int  begin,
int  end 
)
static

Create a bounding box hierarchy.

Parameters
ptsSet of nodes.
begin,endIndexes of the nodes that should be organized into the hierarchy.

◆ CurveVertex()

TreeNode * TreeBlend::CurveVertex ( const Vector a,
const Vector na,
const double &  ra,
const double &  fa,
const Vector b,
const Vector nb,
const double &  rb,
const double &  fb,
const double &  s,
int  n 
)
static

Create a set of TreeVertex primitives blending together along a curve.

Parameters
a,bEnd vertices.
na,nbTangents.
ra,rbEnd radii.
fa,fbRadius derivatives.
sIntensity of the vertex components.
nNumber of samples.

◆ GetMaterial()

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

Get the texture of blending node.

Simply get the colors of the children nodes and weight those parameters with the field of the nodes.

Parameters
pPoint.
nNormal.

Reimplemented from TreeNode.

◆ Gradient()

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

Computes the gradient of the blend.

The gradient is the sum of the gradients of the contributing elements.

Parameters
pPoint.

Reimplemented from TreeNode.

◆ Intensity()

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

Computes the field value at a given point in space.

Parameters
pPoint.

Implements TreeNode.

◆ IntensityGradient()

void TreeBlend::IntensityGradient ( const Vector p,
double &  value,
Vector gradient 
) const
virtual

Compute the intensity of a blending node for a given point on a ray.

Parameters
pPoint.
valueReturned field value.
gradientReturned gradient.

Reimplemented from TreeNode.

◆ K() [1/4]

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

Compute the local Lipschitz constant in a box.

Implements TreeNode.

◆ K() [2/4]

double TreeBlend::K ( const RayStep s) const
virtual

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

Parameters
sThe segment.

Reimplemented from TreeNode.

◆ K() [3/4]

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

Compute the Lipschitz constant along a segment.

Parameters
sThe segment.

Reimplemented from TreeNode.

◆ K() [4/4]

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

Compute the Lipschitz constant in a sphere.

Parameters
sThe sphere.

Reimplemented from TreeNode.

◆ OptimizeHierarchy()

TreeNode * TreeBlend::OptimizeHierarchy ( QVector< TreeNode * > &  s,
int  begin,
int  end 
)
static

Recursive BVH Tree construction from a vector<TNode*>.

Parameters
sSet of sub-trees.
begin,endFirst and last indexes

◆ Rotate()

TreeNode * TreeBlend::Rotate ( const Matrix r)
virtual

Rotates an element.

Instead of inserting a rotation node in the tree, this member simply updates the vertices of the cylinder as well as its internal parameters.

Parameters
rRotation matrix.

Reimplemented from TreeNode.

◆ Set()

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

Blend a set of sub-trees.

Parameters
setSet of nodes.

◆ Translate()

TreeNode * TreeBlend::Translate ( const Vector t)
virtual

Translate the blend.

Parameters
tTranslation vector.

Reimplemented from TreeNode.

◆ VertexSet() [1/3]

TreeNode * TreeBlend::VertexSet ( const QVector< Vector > &  c,
const double &  r,
const double &  s 
)
static

Create a cluster of (small) point primitives given their centers, and common radius and strength.

See also
TreeBlend::VertexSet(const QVector<Vector>&, const QVector<double>&, const QVector<double>&)
Parameters
cSet of centers.
rRadius.
sStrength.

◆ VertexSet() [2/3]

TreeNode * TreeBlend::VertexSet ( const QVector< Vector > &  c,
const QVector< double > &  r,
const double &  s 
)
static

Create a cluster of (small) point primitives given their centers and radii, strength is constant.

The blending function is always a BlendCubic.

Parameters
cSet of centers.
rSet of radii.
sSet of strength.

◆ VertexSet() [3/3]

TreeNode * TreeBlend::VertexSet ( const QVector< Vector > &  c,
const QVector< double > &  r,
const QVector< double > &  s 
)
static

Create a cluster of (small) point primitives given their centers, radii and strength.

The blending function is always a BlendCubic.

Parameters
cSet of centers.
rSet of radii.
sSet of strength.