libjbt

jbt_primitive Class Reference

Abstract base class for primitive skeletons. More...

#include <primitive.h>

Inherits jbt_object.

Inherited by jbt_circle, jbt_disk, jbt_line, jbt_plane, jbt_point, jbt_polyline and jbt_square.

List of all members.

Public Members

Protected Members


Detailed Description

Abstract base class for primitive skeletons.

Author(s):
Mark Tigges

The primitive skeletons are the objects which contribute primitive geometry to the BlobTree. See the overridden classes for the types of geometry that can be added. Use the jbt_compound subclasses to combine the primitive classes to create complex BlobTrees. This class is abstract due to distance. You must override this function if you wish to implement a new primitive skeleton type.


Member Function Documentation

jbt_primitive::~jbt_primitive()

void jbt_primitive::setField( jbt_field* )

Sets the field function for this primitive.

jbt_field* jbt_primitive::getField() const

Gets the field function this primitive.

void jbt_primitive::setDistance( jbt_distance* )

Sets the distance measure for this primitive.

jbt_distance* jbt_primitive::getDistance() const

Gets the distance measure for this primitive.

void jbt_primitive::setR( jFlt _R )

Sets the radius of the scalar field.

jFlt jbt_primitive::getR() const

Gets the radius of the scalar field. The distance in any direction from the skeleton to the zero level surface.

void jbt_primitive::setCoefficient( jFlt _C )

Sets the coefficient of the field function. The default is 1.

jFlt jbt_primitive::getCoefficient() const

Returns the coefficient of the field function.

void jbt_primitive::beginQuery( const jVec3& )

Reimplemented from jbt_blobtree.

jbt_primitive::jbt_primitive( jFlt ) [protected]

Builds a new primitive. R sets the width of the extant of the scalar field.

virtual void jbt_primitive::precompute() [protected, virtual]

Precompute is stubbed. Override this if you need to pre-compute some values. This function gets called by beginQuery.

Reimplemented in jbt_square, jbt_polyline, jbt_disk and jbt_circle.

void jbt_primitive::field( jFlt& ) [protected]

Reimplemented from jbt_blobtree.

void jbt_primitive::normal( jNorm3& ) [protected]

Reimplemented from jbt_blobtree.

void jbt_primitive::uv( jVec2&, jbt_blobtree*, const jMat4& ) [protected]

The primitive uv function must first move the qp to a point on the default surface of the field. This means dealing with areas of blending and with dealing with odd distance metrics. Sub-classes need to override only the uv function which takes a jVec3. Sub-classes do not need to override this function.

Reimplemented from jbt_object.

virtual jVec2 jbt_primitive::uvl( const jVec3& ) [protected, virtual]

Local space uv coordinates. DO NOT use qp to compute the uv coordinate from.

Reimplemented in jbt_square, jbt_polyline, jbt_point, jbt_plane, jbt_line, jbt_disk and jbt_circle.

virtual jVec3 jbt_primitive::displacement() = 0 [protected, pure virtual]

Returns the displacement vector from the current query point to the skeleton for this primitive.

Reimplemented in jbt_square, jbt_polyline, jbt_point, jbt_plane, jbt_line, jbt_disk and jbt_circle.

int jbt_primitive::intersectSphere( jFlt, const jRay&, jFlt& a, jFlt& b ) const [protected]

Intersects a sphere with the given square of the radius. Return is the number of intersections, which if >0 will be returned in a and b.

int jbt_primitive::intersectCylinder( jFlt, const jRay&, jFlt& a, jFlt& b ) const [protected]

Intersects a cylinder (y aligned) with the given square of the radius. Return is the number of intersections, which if >0 will be returned in a and b.

void jbt_primitive::attribute( jbt_attribute* ) [protected]

Reimplemented from jbt_blobtree.

void jbt_primitive::attributes( jbt_diffuse*, jbt_specular*, jbt_scalar*, jbt_scalar*, jbt_scalar* ) [protected]

Reimplemented from jbt_blobtree.

bool jbt_primitive::spanCSG( const jVec3&, const jVec3& ) [protected]

Reimplemented from jbt_blobtree.

void jbt_primitive::bracket( const jRay&, jbt_brackets& ) [protected]

Reimplemented from jbt_blobtree.

Reimplemented in jbt_square, jbt_polyline, jbt_point, jbt_plane, jbt_line, jbt_disk and jbt_circle.

void jbt_primitive::computeBound() [protected]

This function should be called _after_ the sub classes compute the bounding box. It is just a hack to make it bigger if the field is not bounded.

Reimplemented from jbt_blobtree.

Reimplemented in jbt_square, jbt_polyline, jbt_point, jbt_plane, jbt_line, jbt_disk and jbt_circle.

jgl_algebraic* jbt_primitive::expression( const jMat4& ) const [protected]

Returns the algebraic representation.

Reimplemented from jbt_blobtree.


Member Data Documentation

jFlt jbt_primitive::R [protected]

The radius of the field. The distance in any direction from the skeleton to the zero level surface.

jBasis jbt_primitive::disB [protected]

The basis for the displacement vector. This basis should be set for during the beginQuery function. It is only necessary for some primitives. Generally if the surface generated is not homeomorphic to a sphere than you should set the basis to use. Currently only the circle and the polyline set the basis.

jbt_field* jbt_primitive::fld [protected]

jbt_distance* jbt_primitive::dist [protected]

jFlt jbt_primitive::R2 [protected]

jFlt jbt_primitive::C [protected]

jFlt jbt_primitive::d [protected]

jVec3 jbt_primitive::D [protected]

jVec3 jbt_primitive::dD [protected]


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