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

Rotations in a frame node. More...

#include <blobtree.h>

Inheritance diagram for TreeRotate:
TreeWarp TreeUnary TreeOperator TreeNode

Public Member Functions

 TreeRotate (TreeNode *, const Matrix &=Matrix::Identity)
 Creates a rotation node in the tree structure. More...
 
 TreeRotate (TreeNode *, const Vector &=Vector::Null)
 Creates a rotation node in the tree structure. More...
 
 TreeRotate (TreeNode *, const Vector &, const Vector &)
 Create a rotation node in the tree structure given two vectors. More...
 
virtual ~TreeRotate ()
 Destroy a frame node in the tree. More...
 
double Intensity (const Vector &) const
 Returns the intensity computed by the child node after transforming the point into local space. More...
 
Vector Gradient (const Vector &) const
 Compute the gradient. More...
 
virtual TreeNodeCopy () const
 Creates a deep copy of the frame node.
 
TreeNodeCut (const Box &) const
 Cuts the node to simplify its structure inside a box. More...
 
int Memory () const
 Compute the size of a node.
 
virtual double K () const
 Returns the Lipschitz constant of a frame node.
 
virtual double K (const Box &) const
 Computes the Lipschitz constant within an argument box. More...
 
virtual double K (const Ray &) const
 Computes the Lipschitz constant of the frame node intersecting a ray.
 
virtual double K (const Segment &) const
 Computes the Lipschitz constant of the frame node intersecting a segment. More...
 
virtual double K (const RayStep &) const
 Computes the Lipschitz constant of the frame node intersecting a segment. More...
 
virtual double K (const Sphere &) const
 Computes the Lipschitz constant of the frame node intersecting a sphere. More...
 
Color GetMaterial (const Vector &, const Vector &=Vector::Null) const
 Compute the texture parameters. More...
 
virtual TreeNodeRotate (const Matrix &)
 Rotates the node in the BlobTree. More...
 
- Public Member Functions inherited from TreeWarp
 TreeWarp (TreeNode *=nullptr)
 Create a warping node. More...
 
virtual ~TreeWarp ()
 Recursively destroys the structure. More...
 
- Public Member Functions inherited from TreeUnary
 TreeUnary (TreeNode *)
 Create a generic warping node. More...
 
virtual ~TreeUnary ()
 Recursively destroys the structure.
 
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 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...
 

Protected Attributes

Matrix r
 Rotation matrix.
 
- 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

Rotations in a frame node.

Rotation nodes change the whole geometry of their children nodes.

Example of how to code a rotation node:

TreeNode *element=new TreeNodeEdge(Vector(1,0,-1),Vector(1,0,1),new BlendCubic(2.0,1.0));
TreeNode *framed=new TreeRotate(element,Matrix::Rotation(Vector(Math::Pi/6,0.0,0.0)));
Normalized blending functions (1-r2)3.
Definition: blend.h:114
static const double Pi
static Matrix Rotation(const Vector &)
The generic nodes with some pure virtual functions.
Definition: blobtree.h:27
TreeRotate(TreeNode *, const Matrix &=Matrix::Identity)
Creates a rotation node in the tree structure.
Definition: treerotation.cpp:25

,

Constructor & Destructor Documentation

◆ TreeRotate() [1/3]

TreeRotate::TreeRotate ( TreeNode node,
const Matrix r = Matrix::Identity 
)
explicit

Creates a rotation node in the tree structure.

Parameters
nodeChild node.
rRotation matrix.

◆ TreeRotate() [2/3]

TreeRotate::TreeRotate ( TreeNode node,
const Vector v = Vector::Null 
)
explicit

Creates a rotation node in the tree structure.

Parameters
nodeChild node.
vVector of Euler rotation angles.

◆ TreeRotate() [3/3]

TreeRotate::TreeRotate ( TreeNode node,
const Vector a,
const Vector b 
)
explicit

Create a rotation node in the tree structure given two vectors.

Parameters
nodeChild node.
aFirst Vector
bSecond Vector

◆ ~TreeRotate()

TreeRotate::~TreeRotate ( )
virtual

Destroy a frame node in the tree.

Implicitly calls the destructor TreeWarp::TreeWarp() that recursively destroys its child node.

Member Function Documentation

◆ Cut()

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

Cuts the node to simplify its structure inside a box.

Parameters
bThe box.

Implements TreeNode.

◆ GetMaterial()

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

Compute the texture parameters.

Transforms the point into the local frame, and compute the texture descending into the tree recursively.

Implements TreeWarp.

◆ Gradient()

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

Compute the gradient.

Returns the transformed gradient computed by the child node after framing the point into local space.

Parameters
pPoint.

Reimplemented from TreeNode.

◆ Intensity()

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

Returns the intensity computed by the child node after transforming the point into local space.

Parameters
pPoint.

Implements TreeNode.

◆ K() [1/4]

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

Computes the Lipschitz constant within an argument box.

Basically tests if the argument box intersects the box of the node, and returns the Lipchitz constant of the tree structure if intersection occurs.

Implements TreeNode.

◆ K() [2/4]

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

Computes the Lipschitz constant of the frame node intersecting a segment.

Parameters
raystepThe segment.

Reimplemented from TreeNode.

◆ K() [3/4]

double TreeRotate::K ( const Segment segment) const
virtual

Computes the Lipschitz constant of the frame node intersecting a segment.

Parameters
segmentThe segment.

Reimplemented from TreeNode.

◆ K() [4/4]

double TreeRotate::K ( const Sphere sphere) const
virtual

Computes the Lipschitz constant of the frame node intersecting a sphere.

Parameters
sphereThe sphere.

Reimplemented from TreeNode.

◆ Rotate()

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

Rotates the node in the BlobTree.

Instead of inserting a rotation node in the tree, simply updates the rotation matrix of the node.

Parameters
rRotation matrix.

Reimplemented from TreeNode.