Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

DisplayRep2D.h

Go to the documentation of this file.
00001 //     $Id: DisplayRep2D.h,v 1.1.1.1 2001/01/04 01:01:11 burnett Exp $
00002 //  Author: T. Burnett
00003 // Project: gui
00004 
00005 #ifndef DisplayRep2D_H
00006 #define DisplayRep2D_H 1
00007 
00008 
00009 #include "gui/DisplayRep.h"
00010 #include "gui/ViewPort.h"
00011 
00012 
00013 namespace gui {
00014 
00015 //Special Rep that draws directly to the canvas: subclass must implement
00016 // the draw(Draw2D*) method
00017 class DisplayRep2D : public DisplayRep {
00018 public:
00019     
00020     virtual void draw(ViewPort* port);
00021     // override to draw directly to the canvas, accessible from the ViewPort
00022     
00023     virtual void draw2D(Draw2D* canvas)=0;
00024     // subclass must define to draw directly to the canvas
00025     
00026     virtual void update(){};
00027     // must define to be an DisplayRep: however, drawing is done with the draw above
00028     
00029 private:
00030     
00031 };
00032 
00033 inline void DisplayRep2D::draw(ViewPort* port)
00034 {
00035     if( !hidden() ) draw2D(port->canvas());
00036 }
00037 
00038 } // namespace gui
00039 
00040 #endif //DisplayRep2D_H

Generated at Wed Nov 21 12:20:55 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000