RiRefineStrategy

Encapsulates all behavior for refinement of an interaction.

This is an abstract class and cannot be directly instanced.


[ Rad | Source | Search | Keywords | Summary | Ancestors | All Members | Descendants ]

Quick Index

DESCRIPTION
WARNING
PATTERNS

Class Summary

class RiRefineStrategy
{
public:
enum Subdivision ;
~RiRefineStrategy() ;;
// Members
void MakeInteraction(RiRefine &data) const;
bool RefineInteraction(RiRefine &data) const;
RiReal ComputeError(RiRefine &data) const; // pure virtual
static void SetTolerance(RiReal tol);
static RiReal GetTolerance();
protected:
bool Refine(RiRefine &data) const;
void SubdivideRec(RiRefine &data) const;
void SubdivideSrc(RiRefine &data) const;
const RiRefineStrategy &GetRefinedRefineStrategy(RiRefine &data) const;
}; // RiRefineStrategy


DESCRIPTION

This class encapsulates behavior. It holds a template of a hierarchical radiosity algorithm and allows pieces of it to be overridden. This makes the system very flexible and easy to play with. It also allows several different types of refinement to go on during the same simulation. The actual computing of the transfers and building the links is handled by the RiLinkStrategy class.


WARNING

This class should have no data. It is always referenced, never copied. This allows all data to be in a class (RiRefine) with no virtual methods.


PATTERNS

Strategy Template Method

enum Subdivision ;

subdivide hint info for RiRefine RiRefineStrategy and RiLinkStrategy

    enum Subdivision {none, subRec, subSrc};

~RiRefineStrategy() ;;

Destructor

    virtual ~RiRefineStrategy()  ;
;

Function is currently defined inline.


void MakeInteraction(RiRefine &data) const;

Create an interaction (if they interact) between these two objects or their decendents.

    virtual void 	MakeInteraction(RiRefine &data) const;

bool RefineInteraction(RiRefine &data) const;

Check an existing interaction between these two objects. Refine if needed. return true if the link was refined

    virtual bool 	RefineInteraction(RiRefine &data) const;

RiReal ComputeError(RiRefine &data) const;

Compute the error and store a subdivide hint in the data

    virtual RiReal 	ComputeError(RiRefine &data) const;    

void SetTolerance(RiReal tol);

Set the tolerance for refinment

    static void 	SetTolerance(RiReal tol);

RiReal GetTolerance();

Set the tolerance for refinment

    static RiReal 	GetTolerance();

bool Refine(RiRefine &data) const;

If possible, subdivide and create new links, else return false so caller knows not to remove the current link.

    virtual bool 	Refine(RiRefine &data) const;

void SubdivideRec(RiRefine &data) const;

Subdivide the receiver and MakeInteraction with the children

    virtual void 	SubdivideRec(RiRefine &data) const;

void SubdivideSrc(RiRefine &data) const;

Subdivide the source and MakeInteraction with the children

    virtual void 	SubdivideSrc(RiRefine &data) const;

const RiRefineStrategy &GetRefinedRefineStrategy(RiRefine &data) const;

Get a refinement strategy for children based on current knowledge.

    virtual const RiRefineStrategy &GetRefinedRefineStrategy(RiRefine &data) const;

All Members

public:
enum Subdivision ;
// Members
void MakeInteraction(RiRefine &data) const;
bool RefineInteraction(RiRefine &data) const;
RiReal ComputeError(RiRefine &data) const; // pure virtual
static void SetTolerance(RiReal tol);
static RiReal GetTolerance();
protected:
bool Refine(RiRefine &data) const;
void SubdivideRec(RiRefine &data) const;
void SubdivideSrc(RiRefine &data) const;
const RiRefineStrategy &GetRefinedRefineStrategy(RiRefine &data) const;

Ancestors

Class does not inherit from any other class.


Descendants

Class is not inherited by any others.


Generated from source by the Cocoon utilities on Fri Feb 25 15:15:46 2000 .