00001 //--- < SCENEEVENT.H > ---------| ViewGraph - A Flexible Graph view Framework | 00002 // 00003 // Defines events that change the scene (node 00004 // insertion/removal, movement), causing upwards 00005 // nodes to recompute their boundrects. 00006 // 00007 // Derive your event from SceneEvent to register an 00008 // event that changes the scene. 00009 // 00010 // $Author: botik32 $ 00011 // $Revision: 1.2 $ 00012 // $Date: 2004/05/03 21:02:01 $ 00013 //-----------------------------------------------------------------------------/ 00014 00015 #ifndef SCENEEVENT_H 00016 #define SCENEEVENT_H 00017 00018 #include <cZUI/event.h> 00019 00020 class BaseSceneNode; 00021 class LayerNode; 00022 00023 /// Defines events that change the scene (node 00024 /// insertion/removal, movement), causing upwards 00025 /// nodes to recompute their boundrects. 00026 class SceneChangedEvent : public Event{ 00027 protected: 00028 BaseSceneNode *origin; 00029 public: 00030 SceneChangedEvent( Camera *, const char *, BaseSceneNode *origin ); 00031 static const char *type; 00032 bool is_type( const char * ); 00033 }; 00034 00035 /// Changes the scene, causing upward nodes to 00036 /// recompute their boundrects. Usually sent to 00037 /// the context, which will pass it down to all. 00038 /// <br>GroupNode and LayerNode objects handle 00039 /// this event automatically. 00040 class LayerAddedEvent : public SceneChangedEvent{ 00041 public: 00042 static const char *type; 00043 LayerAddedEvent( Camera *, LayerNode * ); 00044 }; 00045 00046 /// Changes the scene, causing upward nodes to 00047 /// recompute their boundrects. Usually sent to 00048 /// the context, which will pass it down to all. 00049 /// <br>GroupNode and LayerNode objects handle 00050 /// this event automatically. 00051 class LayerEnabledEvent : public SceneChangedEvent{ 00052 public: 00053 static const char *type; 00054 LayerEnabledEvent( Camera *, LayerNode * ); 00055 }; 00056 00057 /// Changes the scene, causing upward nodes to 00058 /// recompute their boundrects. Usually sent to 00059 /// the context, which will pass it down to all. 00060 /// <br>GroupNode and LayerNode objects handle 00061 /// this event automatically. 00062 class LayerDisabledEvent : public SceneChangedEvent{ 00063 public: 00064 static const char *type; 00065 LayerDisabledEvent( Camera *, LayerNode * ); 00066 }; 00067 00068 /// Changes the scene, causing upward nodes to 00069 /// recompute their boundrects. Usually sent to 00070 /// the context, which will pass it down to all. 00071 /// <br>GroupNode and LayerNode objects handle 00072 /// this event automatically. 00073 class NodeAddedEvent : public SceneChangedEvent{ 00074 public: 00075 static const char *type; 00076 NodeAddedEvent( Camera *, BaseSceneNode * ); 00077 }; 00078 00079 /// Changes the scene, causing upward nodes to 00080 /// recompute their boundrects. Usually sent to 00081 /// the context, which will pass it down to all. 00082 /// <br>GroupNode and LayerNode objects handle 00083 /// this event automatically. 00084 class NodeRemovedEvent : public SceneChangedEvent{ 00085 public: 00086 static const char *type; 00087 NodeRemovedEvent( Camera *, BaseSceneNode * ); 00088 }; 00089 00090 /// Changes the scene, causing upward nodes to 00091 /// recompute their boundrects. Usually sent to 00092 /// the context, which will pass it down to all. 00093 /// <br>GroupNode and LayerNode objects handle 00094 /// this event automatically. 00095 class NodeMovedEvent : public SceneChangedEvent{ 00096 public: 00097 static const char *type; 00098 NodeMovedEvent( Camera *, BaseSceneNode * ); 00099 }; 00100 00101 /// Changes the scene, causing upward nodes to 00102 /// recompute their boundrects. Usually sent to 00103 /// the context, which will pass it down to all. 00104 /// <br>GroupNode and LayerNode objects handle 00105 /// this event automatically. 00106 class NodeResizedEvent : public SceneChangedEvent{ 00107 public: 00108 static const char *type; 00109 NodeResizedEvent( Camera *, BaseSceneNode * ); 00110 }; 00111 00112 #endif 00113 00114 /// $Log: sceneevent.h,v $ 00115 /// Revision 1.2 2004/05/03 21:02:01 botik32 00116 /// Significant changes and many bugfixes. 00117 /// ScrollableView now has a background color used to 00118 /// tell SurfaceDriver to clear with. 00119 /// SurfaceDriver's clear() requires a color now 00120 /// Added SceneEvents for all node additions/removals 00121 /// in GroupNode and Camera. 00122 /// Added paint_selected and paint_selected_invalid 00123 /// to ActiveLeaf 00124 /// Modified ActiveLeaf's mouse_down and mouse_up 00125 /// handler signatures to accept an Event* instead of 00126 /// Camera* 00127 /// - Many more bugfixes 00128 /// 00129 /// Revision 1.1 2004/04/30 11:55:12 botik32 00130 /// Added SceneChangedEvent class 00131 /// 00132