00001 //--- < LEAFNODE.H > ------------| ViewGraph - A Flexible Graph view Framework | 00002 // 00003 // Leaf node is an abstract class that only 00004 // knows its position. 00005 // Inherit from LeafNode to include specific 00006 // node pointer and paint policy class. 00007 // You may even call multiple policy painting 00008 // classes depending on context (camera). 00009 // 00010 // Please note that get_boundrect should return 00011 // a rectangle according to its position i.e. 00012 // the get_boundrect should add xpos,ypos to the 00013 // origin of the bound rectangle. 00014 // 00015 // $Author: botik32 $ 00016 // $Revision: 1.2 $ 00017 // $Date: 2004/05/03 21:02:01 $ 00018 //-----------------------------------------------------------------------------/ 00019 00020 #ifndef LEAFNODE_H 00021 #define LEAFNODE_H 00022 00023 #include <cZUI/basescenenode.h> 00024 00025 class LeafNode : public BaseSceneNode{ 00026 protected: 00027 double xpos, ypos; 00028 public: 00029 LeafNode( double, double ); 00030 00031 virtual void paint( Camera * )=0; 00032 /// You must override this function to 00033 /// provide an accurate estimation of the 00034 /// bounding rectangle. Make sure the 00035 /// function is as "light" as possible 00036 /// because it will be called very often. 00037 virtual void get_boundrect( double&, double&, 00038 double&, double& )=0; 00039 virtual void translate( double dx, double dy ); 00040 virtual void rotate( double ax, double ay, double rad ); 00041 virtual void move( double newx, double newy ); 00042 00043 bool handle_message( Message * ); 00044 bool handle_event( Event * ); 00045 00046 // mouse and repaint events require special 00047 // processing 00048 bool handle_event( MouseEvent * ); 00049 bool handle_event( RepaintEvent * ); 00050 }; 00051 00052 #endif 00053 00054 /// $Log: leafnode.h,v $ 00055 /// Revision 1.2 2004/05/03 21:02:01 botik32 00056 /// Significant changes and many bugfixes. 00057 /// ScrollableView now has a background color used to 00058 /// tell SurfaceDriver to clear with. 00059 /// SurfaceDriver's clear() requires a color now 00060 /// Added SceneEvents for all node additions/removals 00061 /// in GroupNode and Camera. 00062 /// Added paint_selected and paint_selected_invalid 00063 /// to ActiveLeaf 00064 /// Modified ActiveLeaf's mouse_down and mouse_up 00065 /// handler signatures to accept an Event* instead of 00066 /// Camera* 00067 /// - Many more bugfixes 00068 /// 00069 /// Revision 1.1.1.1 2004/03/26 10:50:23 botik32 00070 /// Initial release 00071 /// 00072 /// Revision 1.1.1.1 2004/03/26 08:53:33 botik 00073 /// initial import 00074 /// 00075 /// 00076 /// Revision 1.9 2003/11/13 18:50:18 botik 00077 /// Fixed (almost) clear and update rect behaviour. 00078 /// Added update_rect to framework and sdl wrapper. 00079 /// Added mouse_in/mouse_out handling 00080 /// Fixed message handling 00081 /// Many small bugfixes 00082 /// 00083 /// Revision 1.8 2003/11/13 12:50:51 botik 00084 /// Refined the event handling architecture 00085 /// Got the event handling to recognize and treat mouse 00086 /// events accordingly 00087 /// Important fixes to ./Makefile 00088 /// 00089 /// Revision 1.7 2003/11/11 15:30:58 botik 00090 /// Added and compiled second framework test, 00091 /// fixed along a few bugs. 00092 /// 00093 /// Revision 1.6 2003/11/11 14:44:34 botik 00094 /// Changed zoomablesurfaceview to zoom the commands 00095 /// (which it was supposed to do in the first place), 00096 /// Changed some function details in leafnode, 00097 /// Added a new test in tests 00098 /// 00099 /// Revision 1.5 2003/11/09 15:23:01 botik 00100 /// Got GraphDisplay to compile and run. 00101 /// 00102 /// Revision 1.4 2003/11/06 13:35:57 botik 00103 /// Moved leafnode to basescenenode and removed cached 00104 /// boundrect stuff from leafnode. Boundrect will be 00105 /// moved to an optimizedgroupnode. 00106 /// 00107 /// Revision 1.3 2003/11/05 17:35:21 botik 00108 /// Added a cached boundrect to the leafnode. 00109 /// 00110 /// Revision 1.2 2003/11/03 16:45:16 botik 00111 /// Some changes to scene nodes after careful 00112 /// consideration 00113 /// 00114 /// Revision 1.1 2003/10/21 17:39:00 botik 00115 /// Added preliminary scene support 00116 ///