Blob 1.0
|
The generic nodes with some pure virtual functions. More...
#include <blobtree.h>
Public Member Functions | |
TreeNode () | |
Create a virtual node of the Blob-Tree structure. | |
virtual | ~TreeNode () |
Destroys a node. | |
virtual double | Intensity (const Vector &) const =0 |
Compute the field function value at a given point in space. | |
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 Vector | Gradient (const Vector &) const |
Computes the gradient of the field function at a given point in space. | |
virtual TreeNode * | Blend (TreeNode *) |
Insert a blending node that blends the old and the new sub-tree together. | |
virtual TreeNode * | Union (TreeNode *) |
Insert a union node that unions the old and the new sub-tree together. | |
virtual TreeNode * | Difference (TreeNode *) |
Insert a difference node. | |
virtual TreeNode * | Translate (const Vector &) |
Insert a translation node. | |
virtual TreeNode * | Rotate (const Matrix &) |
Insert a rotation node. | |
virtual TreeNode * | Scale (const Vector &) |
Insert a scaling node. | |
virtual TreeNode * | Copy () const =0 |
Creates a deep copy of the node, recursively traversing the whole structure. | |
virtual double | K () const =0 |
Compute the Lipschitz constant of the node. | |
virtual double | K (const Box &) const =0 |
Compute the local Lipschitz constant in a box. | |
virtual double | K (const Ray &) const =0 |
Compute the local Lipschitz along a ray. | |
virtual double | K (const Segment &) const |
Compute the Lipschitz constant along a segment. | |
virtual double | K (const RayStep &) const |
Compute the Lipschitz constant along an optimized ray-stepping segment. | |
virtual double | K (const Sphere &) const |
Compute the Lipschitz constant in a sphere. | |
Box | GetBox () const |
Return the bounding box of the node. | |
virtual void | SetThreshold (const double &) |
Set the threshold value. | |
virtual Color | GetMaterial (const Vector &, const Vector &=Vector::Null) const |
Gets the color of a node at a point. | |
virtual TreeNode * | Cut (const Box &) const =0 |
Cuts the node to simplify its structure inside a box. | |
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 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 | |
Box | box = Box::Null |
Bounding box of the node. | |
double | T = 0.5 |
Threshold value. | |
Static Protected Attributes | |
static const double | Epsilon = 1e-6 |
Epsilon value for gradient computation. | |
The generic nodes with some pure virtual functions.
All nodes include a Box to accelerate queries in the Blob-Tree such as ray-intersections, field function or gradient evaluation.
|
virtual |
Return the squared distance to the compact support of the node.
p | Point. |
Reimplemented in TreeBox, TreeCylinder, TreeEdge, TreeHemisphereDisc, TreeSphere, TreeTorus, TreeTriangle, and TreeVertex.
|
virtual |
Computes the field value and the gradient at a given point in space.
This virtual function computes the gradient and the field values separately, calling TreeNode::Intensity and TreeNode::Gradient respectively. This technique is slower however than some specific implementations which can be optimized for some primitives, in particular distance based primitives.
p | Point. |
value | Returned field value. |
gradient | Returned gradient. |
Reimplemented in TreeBlend, TreeNormal, and TreeVertex.
Computes the gradient of the field function at a given point in space.
If the closed form expression of the gradient is not implemented in derivatives of TreeNode, use this approximation instead.
p | Point. |
Reimplemented in TreeAlpha, TreeBlend, TreeBlendSquared, TreeBlendUnion, TreeCloneFrame, TreeCloneTranslate, TreeConeSphere, TreeDifference, TreeFrame, TreeHyperBlend, TreeInstantiate, TreeIntersection, TreeNormal, TreeRotate, TreeScale, TreeTaper, TreeTexture, TreeTranslate, TreeTwist, TreeUnion, and TreeVertex.
Insert a blending node that blends the old and the new sub-tree together.
e | Element. |
Reimplemented in TreeBlend.
Insert a union node that unions the old and the new sub-tree together.
e | Element. |
Insert a difference node.
e | Element. |
Insert a translation node.
t | Translation vector. |
Reimplemented in TreeBlend, TreeBubble, TreeCone, TreeConic, TreeCubic, TreeCylinder, TreeEdge, TreeQuadric, TreeRectangleDisc, TreeSphere, TreeTranslate, and TreeVertex.
Insert a rotation node.
r | Rotation matrix. |
Reimplemented in TreeBlend, TreeBubble, TreeCone, TreeConic, TreeCubic, TreeCylinder, TreeEdge, TreeQuadric, TreeRectangleDisc, TreeRotate, TreeSphere, and TreeVertex.
Insert a scaling node.
s | Scaling vector. |
Reimplemented in TreeEdge, TreeQuadric, TreeScale, and TreeVertex.
|
virtual |
Compute the Lipschitz constant along a segment.
By default return the Lipchitz constant of the bounding box of the segment.
s | The segment. |
Reimplemented in TreeAlpha, TreeBlend, TreeBlendSquared, TreeBlendUnion, TreeBox, TreeCloneFrame, TreeCloneTranslate, TreeContact, TreeDifference, TreeEdge, TreeElement, TreeFrame, TreeHyperBlend, TreeInstantiate, TreeIntersection, TreeNormal, TreeRotate, TreeScale, TreeSphere, TreeTaper, TreeTexture, TreeTranslate, TreeTwist, TreeUnion, and TreeVertex.
|
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.
raystep | The step. |
Reimplemented in TreeBlend, TreeBox, TreeCloneFrame, TreeCloneTranslate, TreeDifference, TreeEdge, TreeInstantiate, TreeIntersection, TreeNormal, TreeRotate, TreeScale, TreeSphere, TreeTaper, TreeTexture, TreeTranslate, TreeTwist, TreeUnion, and TreeVertex.
|
virtual |
Compute the Lipschitz constant in a sphere.
By default return the Lipchitz constant of the bounding box of the sphere.
s | The sphere. |
Reimplemented in TreeAlpha, TreeBlend, TreeBlendSquared, TreeCloneFrame, TreeCloneTranslate, TreeContact, TreeDifference, TreeElement, TreeFrame, TreeInstantiate, TreeIntersection, TreeNormal, TreeRotate, TreeScale, TreeTaper, TreeTexture, TreeTranslate, TreeTwist, and TreeUnion.
|
virtual |
Set the threshold value.
The threshold which may be needed for the direct evaluation of the surface under some specific circumstances.
T | Threshold. |
Reimplemented in TreeBinary, TreeCloneFrame, TreeCloneTranslate, TreeInstantiate, TreeOperator, and TreeUnary.
|
virtual |
Gets the color of a node at a point.
This function returns a default black material.
Reimplemented in TreeAlpha, TreeBlend, TreeBlendRUnion, TreeBlendSquared, TreeBlendUnion, TreeCloneFrame, TreeCloneTranslate, TreeContact, TreeDifference, TreeFrame, TreeHyperBlend, TreeInstantiate, TreeIntersection, TreeNoise, TreeRotate, TreeScale, TreeTaper, TreeTexture, TreeTranslate, TreeTwist, TreeUnion, and TreeWarp.
|
virtual |
Show the tree hierarchy.
space | Number of spaces. |
Reimplemented in TreeBlend, TreeCloneFrame, TreeCloneTranslate, TreeConeSphere, TreeCylinder, TreeDifference, TreeDisc, TreeEdge, TreeHemisphere, TreeHyperBlend, TreeIntersection, TreePoly, TreeRectangle, TreeTorus, and TreeUnion.
|
virtual |
Compute the intersection between the implicit surface and a segment.
a,b | Segment vertices. |
va,vb | Field value at segment vertices. |
length | Distance between a and b. |
epsilon | Accuracy. |