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

Noise inside a sphere primitive. More...

#include <blobtree.h>

Inheritance diagram for TreeNoiseSphere:
TreeElement TreeNode

Public Member Functions

 TreeNoiseSphere (const Vector &, const double &, const double &, BlendCompact *)
 Create a sphere element with noise. More...
 
virtual ~TreeNoiseSphere ()
 Empty.
 
double Intensity (const Vector &) const
 Compute the field function value at a given point in space.
 
double K () const
 Returns the Lipschitz constant of the element. More...
 
double K (const Ray &) const
 Returns a local Lipschitz constant along a ray. More...
 
double K (const Segment &) const
 Returns a local Lipschitz constant along a segment. More...
 
double K (const RayStep &) const
 Compute the Lipschitz constant along an optimized ray-stepping segment. More...
 
virtual TreeNodeCopy () const
 Create a deep copy of the element.
 
int Memory () const
 Compute the size of a node.
 
- Public Member Functions inherited from TreeElement
 TreeElement (BlendCompact *=nullptr)
 Creates a new element given a blending function.
 
virtual ~TreeElement ()
 Destroys an element. More...
 
double K (const Box &) const
 Returns a local Lipschitz constant within a box domain. More...
 
double K (const Sphere &) const
 Returns a local Lipschitz constant in a sphere. More...
 
TreeNodeCut (const Box &) const
 Cuts the node to simplify its structure inside a box. More...
 
- 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 Vector Gradient (const Vector &) const
 Computes the gradient of the field function 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 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 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

Sphere s
 Sphere shape.
 
double a
 Uniform scale in space (frequency).
 
- 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

Noise inside a sphere primitive.

The sphere primitive provides a compact support for the noise.

Constructor & Destructor Documentation

◆ TreeNoiseSphere()

TreeNoiseSphere::TreeNoiseSphere ( const Vector c,
const double &  r,
const double &  a,
BlendCompact blend 
)
explicit

Create a sphere element with noise.

Parameters
cCenter of the sphere.
rRadius.
aScaling factor of the noise (frequency).
blendFalloff function.

Member Function Documentation

◆ K() [1/4]

double TreeNoiseSphere::K ( ) const
virtual

Returns the Lipschitz constant of the element.

Basically returns the Lipschitz constant of the potential function.

Reimplemented from TreeElement.

◆ K() [2/4]

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

Returns a local Lipschitz constant along a ray.

Returns the Lipschitz constant of the element if argument ray intersects the element's bounding box.

Parameters
rayThe ray.

Reimplemented from TreeElement.

◆ K() [3/4]

double TreeNoiseSphere::K ( const RayStep raystep) const
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.

Parameters
raystepThe step.

Reimplemented from TreeNode.

◆ K() [4/4]

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

Returns a local Lipschitz constant along a segment.

Returns the Lipschitz constant of the element if segment intersects the element's bounding box.

Parameters
sSegment.

Reimplemented from TreeElement.