// -*- C++ -*-
#ifndef RIRAYOBJECTVISITOR_H
#define RIRAYOBJECTVISITOR_H
/* Copyright 1996 
 * Wed Aug 20 10:08:16 1997  Brian Smits  (bes@phoenix.cs.utah.edu)
 * 
 * RiRayObjectVisitor.H
 * 
 *	
 * 
 * $Id: RiRayObjectVisitor.H,v 1.1 1997/08/20 23:27:35 bes Exp $ 
 * 
 */
#ifndef RICOMMON_H
#include <RiCommon.H>
#endif

#ifndef RIMATERIAL_H
#include <RiMaterial.H>
#endif

#ifndef RIAFFINETMATRIX3_H
#include <RiAffineTMatrix3.H>
#endif

#ifndef RIRAYOBJECT_H
#include <RiRayObject.H>
#endif


/***************************************************************
CLASS
    RiRayObjectVisitor
     Visitor for RiRayObjects, allowing object specific actions to be performed for each object.

DESCRIPTION
     The visitor is accepted by all RiRayObjects. Any appropriate state actions are called
     by the object and then if the object has any children, the visitor is sent to each
     child. The VisitComposite action is called AFTER descending to the children (this
     allows the visitor to do any necessary initialization first.   The appropriate
     actions are called in a specific order. <BR> 
     Traversal Ordering <BR>
     VisitMaterial <BR>
     VisitTransform <BR>
     Descend to children if they exist <BR>
     Visit[Composite|Simple] <BR>

PATTERN
     Visitor
     Template Method (since multiple VisitXXXX functions may be called depending upon the object)
     
****************************************************************/

class RiRayObjectVisitor {
  public:
				//// Destructor
    virtual ~RiRayObjectVisitor() {};
				// GROUP: Members
				////  Actions for objects with materials (default is do nothing)
    virtual void VisitMaterial(RiRayObject *obj, RiMaterial *mat);
				//// Actions for objects with transformations on children
				// (default is do nothing)
    virtual void VisitTransform(RiRayObject *obj, const RiAffineTMatrix3 &mat);
				//// Actions for Composite objects (default is do nothing)
    virtual void VisitComposite(RiRayObject *obj);
				//// Actions for Simple (Leaf) objects (default is do nothing)
    virtual void VisitSimple(RiRayObject *obj);
};


#endif /* RIRAYOBJECTVISITOR_H */

