class TcGfxVisitor

Abstract base class for visitors and controllers

Inheritance:


Public Methods

TcGfxVisitor()
Default constructor
virtual ~TcGfxVisitor()
Destructor
virtual void visitGfxComponent(TcGfxComponent *c)
Root base class vistor method
virtual void visitGfxObject(TcGfxObject *o)
Common base class TcGfxObject visit method
virtual void visitGfxGroup(TcGfxGroup *g)
Common base cass TcGfxGroup method
virtual void visitGfxPfObject(TdGfxPfObject *o)
TdGfxPfObject visit method.
virtual void visitGfxPfGroup(TdGfxPfGroup *g)
TdGfxPfGroup visit method.
virtual void visitGfxGLObject(TcGfxGLObject *o)
TcGfxGLObject visit method.
virtual void visitGfxGLGroup(TdGfxGLGroup *g)
TdGfxGLGroup visit method.

Documentation

Abstract base class for visitors and controllers. Description: This abstract base class provides an interface for all actions that must distinguish the type of TcGfxComponent in order to carry out their behavior. It also allows clients to extend the behavior of the TcGfxComponent hierarchy.

Collaborators: ConcreteVisitors inherit from this class and then implement each of these interface methods. A client who holds a TcGfxComponent instance calls accept(visitor v) and passes a visitor instance as argument. See visitGfxComponent() for further detail.

TcGfxVisitor()
Default constructor

virtual ~TcGfxVisitor()
Destructor

virtual void visitGfxComponent(TcGfxComponent *c)
Root base class vistor method. Description: This method provides an interface to specify default behavior for a Concrete Visitor.

Comments: To specify default behavior, a concrete visitor would place it into this method: ConcreteVisitor::visitGfxComponent(TcGfxComponent c) {...}

Then when implementing any of the class specific visitors the default behavior could be extended.

eg. ConcreteVisitor::visitPfGfxObject(TcGfxObject *o) { visitGfxComponent(o); <...> < extended implementation code> }

In addition this is a catchall for extensions to the TcGfx hierarchy. See visitGfxObject for an example.

virtual void visitGfxObject(TcGfxObject *o)
Common base class TcGfxObject visit method. Description: This is an interface for default TcGfxObject visitor behavior, see visitGfxComponent.

Comments: Like visitGfxComponent, this is a catchall for extensions to the TcGfxComponent hierarchy.

For example consider a new class called MyClassObject which inherits from TcGfxObject. MyClassObject::accept(visitor v) { Because the visitor interface is not able to include new classes without recoding we call default behavior v->visitGfxComponent(this) v->visitTcGfxObject(this); } New visitors could implement visitTcGfxObject as follows:

void myNewVisitor::visitGfxObject(TcGfxObject *o) { visitGfxComponent(o);

MyClassObject *obj = dynamic_cast<MyClassObject *> (o); if (obj) { <MyClassObject specific visitor code goes here> } else { <TcGfxObject generic visitor code goes here> } }

virtual void visitGfxGroup(TcGfxGroup *g)
Common base cass TcGfxGroup method. See TcGfxObject for an example.

virtual void visitGfxPfObject(TdGfxPfObject *o)
TdGfxPfObject visit method.

virtual void visitGfxPfGroup(TdGfxPfGroup *g)
TdGfxPfGroup visit method.

virtual void visitGfxGLObject(TcGfxGLObject *o)
TcGfxGLObject visit method.

virtual void visitGfxGLGroup(TdGfxGLGroup *g)
TdGfxGLGroup visit method.


Direct child classes:
TdGfxPfGrabController

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de