00001 //--- < CONTEXT.H > -------------| ViewGraph - A Flexible Graph view Framework | 00002 // 00003 // This class implements context storage for 00004 // scene nodes. Derive a Camera, Window or Scene 00005 // from context to present the scene node programmer 00006 // with context storage. 00007 // 00008 // Programmers: use context storage to keep scene 00009 // object state you might need later. For example, 00010 // active leaf nodes store hover state to paint 00011 // themselves differently when mouse is over them. 00012 // You may associate data with a camera, window, or 00013 // the whole scene. 00014 // 00015 // 00016 // $Author: botik32 $ 00017 // $Revision: 1.1.1.1 $ 00018 // $Date: 2004/03/26 10:50:21 $ 00019 //-----------------------------------------------------------------------------/ 00020 00021 #ifndef CONTEXT_H 00022 #define CONTEXT_H 00023 00024 #include <map> 00025 00026 class BaseSceneNode; 00027 00028 class Context 00029 { 00030 protected: 00031 std::map< BaseSceneNode*, void* > storage; 00032 public: 00033 void* register_data( BaseSceneNode*, void * ); 00034 void* remove_data( BaseSceneNode* ); 00035 void* get_data( BaseSceneNode * ); 00036 00037 Context(){}; 00038 ~Context(); 00039 }; 00040 00041 #endif 00042 00043 /// $Log: context.h,v $ 00044 /// Revision 1.1.1.1 2004/03/26 10:50:21 botik32 00045 /// Initial release 00046 /// 00047 /// Revision 1.1.1.1 2004/03/26 08:53:33 botik 00048 /// initial import 00049 /// 00050 /// 00051 /// Revision 1.1 2003/12/02 14:39:37 botik 00052 /// Changed the repaint strategy to always repaint the scene 00053 /// Added Context class to handle context-related data for 00054 /// scene nodes 00055 /// Added get_surfacerect() to ScrollableView 00056 /// Camera, Scene and GraphWindow now inherit from Context 00057 /// Changed activeleaf to use Scene context to store hover 00058 /// status 00059 ///