libjbt

jbt_blobtree Class Reference

Inherited by jbt_ngnode and jbt_object.

List of all members.

Public Members

Static Public Members

Protected Members


Member Enumeration Type Documentation

enum jbt_blobtree::Type

A list of symbolic identifiers to check the type of the node. Abstract classes should not have an identifier in this list, nor implement the type function.

Enumeration values:


Member Function Documentation

virtual jbt_blobtree::~jbt_blobtree() [virtual]

float jbt_blobtree::bloomField( float x, float y, float z )

Returns a field value suitable for use with Jules Bloomenthals polygonizer from Graphics Gems IV. Namely, negative inside the surface and positive outside. This function is also the one used for the numerical ray intersection algorithm.

jFlt jbt_blobtree::intersect( const jRay&, jFlt = -1 )

Intersects the given ray with the implicit surface using a numerical method for root finding. This method is fast but not guaranteed, because it relies on the quality of the bracketing performed by the primitives. The steps are as follows:

1. Compute the brackets of the distances to the zero surfaces for each primitive, or reasonably close to these distances. 2. Find the maximum of the field value inside each of these brackets. 3. Use a numerical root finder to find a root in these brackets.

Steps 2 and 3 use respectively jRootFinder::BrentsMin() and jRootFinder::Brents() to solve these problems. These methods are quadratically convergent one-dimensional solvers which do no rely on the derivative. Perfect for our application.

There is a natural optimization. You can pass a value for the second parameter which is an initial guess for a Newtons method iteration. You should only pass the solution from a previous call which is likely to have correlation to this ray.

virtual void jbt_blobtree::beginQuery( const jVec3& ) [virtual]

Begins a query session of the implicit surface. Call this function to enable the ability to ask questions about the surface.

Parameters:
v - The world space point for the query. The point is transformed to the object space of the BlobTree. The query is propogated to the sub-trees.

Reimplemented in jbt_warp, jbt_transformation, jbt_texturingnode, jbt_primitive, jbt_parameterize, jbt_ngnode, jbt_csg and jbt_compound.

inline const jVec3& jbt_blobtree::queryPoint() const

Returns the object space point for the current query.

jFlt jbt_blobtree::field()

Returns the field value for the current query point.

jFlt jbt_blobtree::bloomField()

Returns the bloomenthal field for the current query point.

const jNorm3& jbt_blobtree::normal()

Returns the normal vector for the current query point.

const jVec2& jbt_blobtree::uv()

Returns the two dimensional ( u, v ) coordinate for the current query point. This is not generally a useful query from the root node of a BlobTree. This query is mostly used by the texturing nodes.

virtual void jbt_blobtree::attribute( jbt_attribute* ) = 0 [pure virtual]

Fills in the given attribute. To query the BlobTree for an attribute type. Create a jbt_attribute of the appropriate type and pass a pointer to it to have the data filled in. If the BlobTree does not define the attribute on the surface at the current query point then the attribute will return false in its jbt_attribute::valid() function. Since the number of different types of attributes in a tree can be any size, attribute computations are not cached. Be careful calling this function too many times. It is not terribly expensive (depending on the cost of the jbt_attribute::add() function) but it does require traversing the whole tree.

Reimplemented in jbt_primitive, jbt_ngnode, jbt_csg, jbt_blend and jbt_attributenode.

virtual void jbt_blobtree::attributes( jbt_diffuse*, jbt_specular*, jbt_scalar*, jbt_scalar*, jbt_scalar* ) = 0 [pure virtual]

An all in one attribute query. This is for efficiencies sake if you are traversing to find the attributes for a Phong type illumination equation.

Parameters:
diffuse - reflectance spectrum
specular - reflectance spectrum
diffuse - coefficient
specular - coefficient
specular - exponenet

Reimplemented in jbt_primitive, jbt_ngnode, jbt_csg, jbt_blend and jbt_attributenode.

const jVec3& jbt_blobtree::gradient()

Returns the gradient vector for the current query point. This vector is different from the normal. It is computed by sampling the field and using a numeric method to approximate the gradient. This is useful because the magnitude is approximated as well. Note that this is considerably slower than calling normal.

const jBBox& jbt_blobtree::bound() const

Returns the bounding box of the implicit surface in object space coordinates.

virtual void jbt_blobtree::computeBound() = 0 [pure virtual]

Compute the bounding box for the implicit surface. If there is a chance that the bounding box should be re-computed you should call this function.

Reimplemented in jbt_warp, jbt_union, jbt_transformation, jbt_square, jbt_primitive, jbt_polyline, jbt_point, jbt_plane, jbt_ngnode, jbt_line, jbt_intersection, jbt_disk, jbt_difference, jbt_circle and jbt_blend.

virtual void jbt_blobtree::seedPoints( jVec3list& ) const = 0 [pure virtual]

Appends seed points to the list of points. A seed point is a point on the skeleton (or some other point near the surface). This is used by some polygonization algorithms. Namely the one in bbt.

Reimplemented in jbt_warp, jbt_transformation, jbt_square, jbt_seedpoint, jbt_polyline, jbt_point, jbt_plane, jbt_ngnode, jbt_line, jbt_disk, jbt_compound and jbt_circle.

virtual bool jbt_blobtree::spanCSG( const jVec3&, const jVec3& ) [virtual]

Returns true if the two points span a CSG junction.

Reimplemented in jbt_transformation, jbt_primitive, jbt_ngnode, jbt_csg and jbt_compound.

virtual jgl_algebraic* jbt_blobtree::expression( const jMat4& ) const = 0 [pure virtual]

Returns the algebraic expression for the scalar field surrounding the skeleton. Pass the identity matrix as the parameter.

Reimplemented in jbt_transformation, jbt_primitive, jbt_ngnode, jbt_csg and jbt_blend.

Type jbt_blobtree::type() const [pure virtual]

Returns the jbt_blobtree::Type of the node. This is for rudimentary runtime type information.

Reimplemented in jbt_uvtransformation, jbt_union, jbt_twist, jbt_transformation, jbt_texturingnode, jbt_taper, jbt_square, jbt_seedpoint, jbt_polyline, jbt_point, jbt_plane, jbt_parameterize, jbt_object, jbt_ngnode, jbt_line, jbt_intersection, jbt_disk, jbt_difference, jbt_circle, jbt_bumpmap, jbt_blend, jbt_bend and jbt_attributenode.

virtual void jbt_blobtree::bracket( const jRay& ray, jbt_brackets& ) [virtual]

For internal use only.

Reimplemented in jbt_transformation, jbt_square, jbt_primitive, jbt_polyline, jbt_point, jbt_plane, jbt_ngnode, jbt_line, jbt_disk, jbt_csg, jbt_compound and jbt_circle.

virtual jNorm3 jbt_blobtree::repulse() = 0 [pure virtual]

For internal use only.

Reimplemented in jbt_object, jbt_ngnode, jbt_csg and jbt_blend.

virtual void jbt_blobtree::uv( jVec2&, jbt_blobtree*, const jMat4& ) = 0 [pure virtual]

For internal use only.

Reimplemented in jbt_uvtransformation, jbt_transformation, jbt_primitive, jbt_parameterize, jbt_object, jbt_ngnode, jbt_csg and jbt_blend.

virtual void jbt_blobtree::name( char* ) const [virtual]

Sets the name of the BlobTree. This is a string name only used in the printing of a BlobTree from the Write function. There is no need to override this function unless you care about neatness when a BlobTree is printed. The size of the buffer is 50 bytes.

bool jbt_blobtree::IsGeometric( const jbt_blobtree* ) [static]

bool jbt_blobtree::IsCompound( const jbt_blobtree* ) [static]

bool jbt_blobtree::IsPrimitive( const jbt_blobtree* ) [static]

const char* jbt_blobtree::Name( const jbt_blobtree* ) [static]

Returns a character string for the type of the node.

void jbt_blobtree::Write( const jbt_blobtree*, ostream&, int = 0 ) [static]

Writes the tree to the given stream.

void jbt_blobtree::Write( const jbt_blobtree*, FILE*, int = 0 ) [static]

Writes the tree to the given stream.

jMat4 jbt_blobtree::GetTransform( const jbt_blobtree* ) [static]

Gets the transformation that is applied to the top level geometry of the given BlobTree.

jbt_blobtree::jbt_blobtree() [protected]

virtual void jbt_blobtree::field( jFlt& ) = 0 [protected, pure virtual]

Compute and set the field value.

Reimplemented in jbt_primitive, jbt_ngnode, jbt_csg and jbt_blend.

virtual void jbt_blobtree::normal( jNorm3& ) = 0 [protected, pure virtual]

Compute and set the normal vector.

Reimplemented in jbt_warp, jbt_transformation, jbt_primitive, jbt_ngnode, jbt_difference, jbt_csg, jbt_bumpmap and jbt_blend.

jVec3 jbt_blobtree::mapToSurface( const jVec3&, jbt_blobtree*, const jMat4& ) [protected]

Maps the given point to a point on the surface according to the trajectory in chapter "Direct Application of Textures" from Tigges thesis. This trajectory maps points in a blended area inwards to the main surface. There are two motivating factors: correctness, coverage. This mapping is used by the primitive class to map points in blend onto the offset of the skeleton and by the texturingnode to map from a larger surface to the subset that it represents.

The parameters are the point to traject onto the surface, the ancestor whose surface the lies on, and the transformation matrix to transform from the ancestor to this.


Member Data Documentation

const jFlt jbt_blobtree::L [static]

The level set used to define the surface of the BlobTree.

jVec3 jbt_blobtree::qp [protected]

Query point. This is the object space location which is currently being used for implicit function evaluation.

jBBox jbt_blobtree::bnd [protected]

The bounding box of the object.


The documentation for this class was generated from the following files:
JSP / libjbt v0.1 mtigges@cpsc.ucalgary.ca