Main Page | Namespace List | Class Hierarchy | Data Structures | File List | Data Fields | Globals

scenenode.h

Go to the documentation of this file.
00001 //--- < SCENENODE.H > -----------| ViewGraph - A Flexible Graph view Framework |
00002 //
00003 // This is the default class in a scene tree.
00004 // Scene nodes can either be leafnodes and get drawn
00005 // or may modify the display/appearance of drawable 
00006 // nodes. Some nodes may do nothing but cache 
00007 // some important data and this is ok as well.
00008 // 
00009 // 
00010 // $Author: botik32 $
00011 // $Revision: 1.5 $
00012 // $Date: 2004/05/14 18:35:08 $
00013 //-----------------------------------------------------------------------------/
00014 
00015 #ifndef SCENENODE_H
00016 #define SCENENODE_H
00017 
00018 #include <cZUI/leafnode.h>
00019 #include <cZUI/event.h>
00020 
00021 class Camera;
00022 class Message;
00023 
00024 class SceneNode : public BaseSceneNode{
00025 protected:
00026         BaseSceneNode *child;
00027 public:
00028 
00029         BaseSceneNode *get_child( void );
00030         // Scene nodes handle events
00031         virtual bool handle_event( Event * );
00032 
00033         // They also pass down messages to their underlings
00034         virtual bool handle_message( Message * );
00035 
00036         // If your node paints some stuff over the leafnode, 
00037         // add its boundrect here.
00038         void get_boundrect( double&, double&, double&, double& );
00039 
00040         // If your node paints some stuff over the leafnode, 
00041         // specify additional checks here
00042         virtual bool check_event_fitspixels( Event * );
00043 
00044         // translate events up from the child
00045         virtual void register_event_listener( const char *, 
00046                 EventListener * );
00047         virtual void unregister_event_listener( const char *, 
00048                 EventListener * );
00049 
00050         void translate( double dx, double dy );
00051         void rotate( double ax, double ay, double rad );
00052         void move( double newx, double newy );
00053         
00054         SceneNode(); 
00055         SceneNode( BaseSceneNode * );
00056         void add_child( BaseSceneNode * );
00057 };
00058 
00059 #endif
00060 
00061 
00062 /// $Log: scenenode.h,v $
00063 /// Revision 1.5  2004/05/14 18:35:08  botik32
00064 /// Fixed a bug related to HUDGroups and a few that I do not
00065 /// remember now.
00066 ///
00067 /// Revision 1.4  2004/05/05 07:10:14  botik32
00068 /// Added ContainerNode class for simple element selection/unselection
00069 /// More bugfixes
00070 ///
00071 /// Revision 1.3  2004/05/03 21:02:01  botik32
00072 /// Significant changes and many bugfixes.
00073 /// ScrollableView now has a background color used to
00074 /// tell SurfaceDriver to clear with.
00075 /// SurfaceDriver's clear() requires a color now
00076 /// Added SceneEvents for all node additions/removals
00077 /// in GroupNode and Camera.
00078 /// Added paint_selected and paint_selected_invalid
00079 /// to ActiveLeaf
00080 /// Modified ActiveLeaf's mouse_down and mouse_up
00081 /// handler signatures to accept an Event* instead of
00082 /// Camera*
00083 /// - Many more bugfixes
00084 ///
00085 /// Revision 1.2  2004/04/18 12:58:31  botik32
00086 /// Changes to groupnode's handling of events.
00087 /// This speeds up the framework tremendously but
00088 /// breaks a few things.
00089 ///
00090 /// Revision 1.1.1.1  2004/03/26 10:50:24  botik32
00091 /// Initial release
00092 ///
00093 /// Revision 1.1.1.1  2004/03/26 08:53:33  botik
00094 /// initial import
00095 ///
00096 ///
00097 /// Revision 1.12  2003/11/18 10:17:24  botik
00098 /// Got HUDGroup to partially work
00099 /// Fixed a typo in leafnode that caused invalid
00100 /// movement on scroll
00101 ///
00102 /// Revision 1.11  2003/11/13 18:50:18  botik
00103 /// Fixed (almost) clear and update rect behaviour.
00104 /// Added update_rect to framework and sdl wrapper.
00105 /// Added mouse_in/mouse_out handling
00106 /// Fixed message handling
00107 /// Many small bugfixes
00108 ///
00109 /// Revision 1.10  2003/11/13 12:50:51  botik
00110 /// Refined the event handling architecture
00111 /// Got the event handling to recognize and treat mouse
00112 /// events accordingly
00113 /// Important fixes to ./Makefile
00114 ///
00115 /// Revision 1.9  2003/11/11 15:30:58  botik
00116 /// Added and compiled second framework test,
00117 /// fixed along a few bugs.
00118 ///
00119 /// Revision 1.8  2003/11/09 15:23:01  botik
00120 /// Got GraphDisplay to compile and run.
00121 ///
00122 /// Revision 1.7  2003/11/08 23:45:54  botik
00123 /// Got the framework to compile, in order to do that
00124 /// filled in some functions and added some empty
00125 /// ones as well.
00126 ///
00127 /// Revision 1.6  2003/11/08 18:54:59  botik
00128 /// Changed handle_event to return bool
00129 ///
00130 /// Revision 1.5  2003/11/06 13:35:57  botik
00131 /// Moved leafnode to basescenenode and removed cached
00132 /// boundrect stuff from leafnode. Boundrect will be
00133 /// moved to an optimizedgroupnode.
00134 ///
00135 /// Revision 1.4  2003/11/03 16:45:16  botik
00136 /// Some changes to scene nodes after careful
00137 /// consideration
00138 ///
00139 /// Revision 1.3  2003/10/28 15:43:55  botik
00140 /// More work on event framework and camera composition and
00141 /// z-ordering
00142 ///
00143 /// Revision 1.2  2003/10/24 16:29:10  botik
00144 /// Added more scene support: special scene nodes as well as a
00145 /// camera class that acts as glue between the graph master and the
00146 /// surface.
00147 ///
00148 /// Revision 1.1  2003/10/21 17:39:00  botik
00149 /// Added preliminary scene support
00150 ///

Generated on Wed Jun 23 18:47:21 2004 for cZUI by doxygen 1.3.5