Terra 1.0
|
Transformation operator. More...
#include <archestree.h>
Public Member Functions | |
TerraFrame (TerraNode *, const Frame2 &) | |
Create a transformation node. | |
TerraFrame (TerraNode *, const Linear &, const Vector2 &=Vector(1.0), const Frame2 &=Frame2::Id) | |
Create a transformation node. | |
TerraFrame (TerraNode *, const double &, const Vector2 &=Vector2::Null) | |
Create a rotation node. | |
~TerraFrame () | |
Recursively destroys the sub-tree. | |
ScalarAlpha | ElevationAlpha (const Vector2 &) const |
Compute the elevation and weight. | |
virtual int | Memory () const |
Compute the size of a node. | |
![]() | |
TerraUnary (TerraNode *) | |
Create an unary node. | |
~TerraUnary () | |
Recusively destroy the sub-tree. | |
virtual int | Traversal (const Vector2 &) const |
Compute the number of nodes that are traversed when evaluating the tree. | |
![]() | |
TerraNode (const Box2 &=Box2::Infinity) | |
Create a node. | |
virtual Box2 | GetBox () const |
Returns the bouding box of a node. | |
virtual double | Elevation (const Vector2 &) const |
Compute the elevation at a given position. | |
virtual double | Alpha (const Vector2 &) const |
Compute the alpha mask at a given position. | |
virtual Vector2 | Gradient (const Vector2 &) const |
Compute the gradient at a given position. | |
virtual Vector | Normal (const Vector2 &) const |
Compute the normal at a given position. | |
virtual void | writeJson (QJsonObject &) |
Compute the Json Document of the subtree. | |
ScalarField2 | Sample (const Array2 &) const |
Create a discrete scalar field by sampling the elevation over a given domain. | |
ScalarField2 | Alpha (const Array2 &) const |
Create a discrete scalar field by sampling the elevation over a given domain. | |
void | Blend (HeightField &) const |
Blend a given node with an existing terrain over an input heightfield. | |
void | Add (HeightField &) const |
Add a given node with an existing heightfield. | |
virtual void | Draw (QGraphicsScene &) const |
Renders the node into a QGraphicsScene. | |
Protected Attributes | |
Vector2 | scale = Vector2(1.0) |
Horizontal scaling. | |
Frame2 | frame = Frame2::Id |
Frame. | |
Linear | zscale = Linear::Id |
Linear transformation. | |
![]() | |
TerraNode * | node = nullptr |
Sub-tree. | |
![]() | |
Box2 | box = Box2::Infinity |
Bounding box. | |
Additional Inherited Members | |
![]() | |
static TerraNode * | PutAt (TerraNode *, const Vector &, const double &, const Vector2 &) |
Place a node at a given location. | |
static TerraNode * | PutAt (TerraNode *, const double &, const Vector2 &) |
Place a node at a given location. | |
![]() | |
static const double | epsilon = 1e-2 |
Epsilon value for gradient computations. | |
Transformation operator.
Create a transformation node.
n | Sub-tree. |
f | Frame. |
References TerraFrame().
Referenced by Memory(), TerraFrame(), and TerraFrame().
|
explicit |
Create a transformation node.
n | Sub-tree. |
s | Scaling. |
f | Frame. |
References TerraNode::box, frame, TerraUnary::node, scale, TerraUnary::TerraUnary(), and zscale.
|
explicit |
Create a rotation node.
n | Sub-tree. |
a | Angle of rotation (radians). |
c | Center of rotation. |
References TerraFrame().
|
virtual |
Compute the elevation and weight.
p | Point. |
Reimplemented from TerraNode.
References ScalarAlpha::Alpha(), TerraNode::box, ScalarAlpha::Empty, frame, TerraUnary::node, scale, Vector2::Scaled(), and zscale.
|
virtual |
Compute the size of a node.
Reimplemented from TerraUnary.
References TerraUnary::node, and TerraFrame().