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 void | IntensityGradient (const Vector &, double &, Vector &) const |
Computes the field value and the gradient at a given point in space. More... | |
virtual Vector | Gradient (const Vector &) const |
Computes the gradient of the field function at a given point in space. More... | |
virtual TreeNode * | Blend (TreeNode *) |
Insert a blending node that blends the old and the new sub-tree together. More... | |
virtual TreeNode * | Union (TreeNode *) |
Insert a union node that unions the old and the new sub-tree together. More... | |
virtual TreeNode * | Difference (TreeNode *) |
Insert a difference node. More... | |
virtual TreeNode * | Translate (const Vector &) |
Insert a translation node. More... | |
virtual TreeNode * | Rotate (const Matrix &) |
Insert a rotation node. More... | |
virtual TreeNode * | Scale (const Vector &) |
Insert a scaling node. More... | |
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. More... | |
virtual double | K (const RayStep &) const |
Compute the Lipschitz constant along an optimized ray-stepping segment. More... | |
virtual double | K (const Sphere &) const |
Compute the Lipschitz constant in a sphere. More... | |
Box | GetBox () const |
Return the bounding box of the node. | |
virtual void | SetThreshold (const double &) |
Set the threshold value. More... | |
virtual Color | GetMaterial (const Vector &, const Vector &=Vector::Null) const |
Gets the color of a node at a point. More... | |
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 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 | |
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.
Insert a blending node that blends the old and the new sub-tree together.
e | Element. |
Reimplemented in TreeBlend.
|
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. |
Insert a difference node.
e | Element. |
|
virtual |
Gets the color of a node at a point.
This function returns a default black material.
Reimplemented in TreeUnion, TreeIntersection, TreeCloneTranslate, TreeCloneFrame, TreeAlpha, TreeDifference, TreeBlend, TreeHyperBlend, TreeBlendSquared, TreeContact, TreeBlendUnion, TreeBlendRUnion, TreeNoise, TreeFrame, TreeTranslate, TreeRotate, TreeScale, TreeTwist, TreeTaper, TreeTexture, and TreeWarp.
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 TreeUnion, TreeIntersection, TreeCloneTranslate, TreeCloneFrame, TreeAlpha, TreeDifference, TreeBlend, TreeHyperBlend, TreeBlendSquared, TreeBlendUnion, TreeNormal, TreeVertex, TreeConeSphere, TreeFrame, TreeTranslate, TreeRotate, TreeScale, TreeTwist, TreeTaper, and TreeTexture.
|
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.
|
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 TreeUnion, TreeIntersection, TreeCloneTranslate, TreeCloneFrame, TreeDifference, TreeBlend, TreeNormal, TreeNoiseSphere, TreeVertex, TreeSphere, TreeEdge, TreeBox, TreeTranslate, TreeRotate, TreeScale, TreeTwist, TreeTaper, and TreeTexture.
|
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 TreeUnion, TreeIntersection, TreeCloneTranslate, TreeCloneFrame, TreeAlpha, TreeDifference, TreeBlend, TreeHyperBlend, TreeBlendSquared, TreeContact, TreeBlendUnion, TreeElement, TreeNormal, TreeNoiseSphere, TreeVertex, TreeSphere, TreeEdge, TreeBox, TreeFrame, TreeTranslate, TreeRotate, TreeScale, TreeTwist, TreeTaper, and TreeTexture.
|
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 TreeUnion, TreeIntersection, TreeCloneTranslate, TreeCloneFrame, TreeAlpha, TreeDifference, TreeBlend, TreeBlendSquared, TreeContact, TreeElement, TreeNormal, TreeFrame, TreeTranslate, TreeRotate, TreeScale, TreeTwist, TreeTaper, and TreeTexture.
Insert a rotation node.
r | Rotation matrix. |
Reimplemented in TreeBlend, TreeVertex, TreeSphere, TreeBubble, TreeEdge, TreeCylinder, TreeRectangle, TreeRectangleDisc, TreeCone, TreeCubic, TreeQuadric, TreeConic, and TreeRotate.
Insert a scaling node.
s | Scaling vector. |
Reimplemented in TreeVertex, TreeEdge, TreeQuadric, and TreeScale.
|
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, TreeUnary, TreeCloneTranslate, TreeCloneFrame, and TreeOperator.
Insert a translation node.
t | Translation vector. |
Reimplemented in TreeBlend, TreeVertex, TreeSphere, TreeBubble, TreeEdge, TreeCylinder, TreeRectangle, TreeRectangleDisc, TreeCone, TreeCubic, TreeQuadric, TreeConic, and TreeTranslate.