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

borderlayer.h

Go to the documentation of this file.
00001 //--- < BORDERLAYER.H > ---------| ViewGraph - A Flexible Graph view Framework |
00002 //
00003 // The border layer provides scrolling
00004 // event generation and cursor shape 
00005 // changes. Insert this layer first 
00006 // in the layer list to catch mousemove
00007 // events.
00008 // 
00009 // $Author: botik32 $
00010 // $Revision: 1.2 $
00011 // $Date: 2004/06/03 10:33:31 $
00012 //-----------------------------------------------------------------------------/
00013 
00014 #ifndef BORDERLAYER_H
00015 #define BORDERLAYER_H
00016 
00017 #include <cZUI/layernode.h>
00018 
00019 class SurfaceCursor;
00020 
00021 /// DefaultScrollPolicy is totally relaxed
00022 /// returning true everytime
00023 class DefaultScrollPolicy
00024 {
00025 public:
00026         static bool validate_scroll( Camera *, double xscroll,
00027                 double yscroll );
00028 };
00029 
00030 /// LimitScrollPolicy limits the scroll so
00031 /// the scene is present in X percent of the
00032 /// shown area, both on X and Y axes.
00033 template<int required_percentage>
00034 class LimitScrollPolicy
00035 {
00036 public:
00037         static bool validate_scroll( Camera *, double xscroll,
00038                 double yscroll );
00039 };
00040 
00041 template<class SP>
00042 class BorderLayer : public LayerNode
00043 {
00044 protected:
00045         SurfaceCursor *scrollcursor_left;       
00046         SurfaceCursor *scrollcursor_right;      
00047         SurfaceCursor *scrollcursor_up; 
00048         SurfaceCursor *scrollcursor_down;       
00049         SurfaceCursor *scrollcursor_leftup;     
00050         SurfaceCursor *scrollcursor_rightup;    
00051         SurfaceCursor *scrollcursor_leftdown;   
00052         SurfaceCursor *scrollcursor_rightdown;  
00053         double leftzone, rightzone, topzone, 
00054                 bottomzone;
00055         double leftsz, rightsz, topsz, bottomsz;
00056         SurfaceCursor *normalcursor;
00057 
00058         // count of consecutive scroll events 
00059         // received
00060         int scrollcount;
00061 public:
00062         BorderLayer( Camera *, int zonewidth, 
00063                         SurfaceCursor* scrollcursor,
00064                         SurfaceCursor* normalc );       
00065         BorderLayer( Camera *, int lz, int rz, 
00066                         int uz, int bz, SurfaceCursor*,
00067                         SurfaceCursor* normalc );       
00068         BorderLayer( Camera *, int zonewidth, 
00069                         SurfaceCursor* scleft, SurfaceCursor *scright, 
00070                         SurfaceCursor *scup, SurfaceCursor *scdown,
00071                         SurfaceCursor* scleftup, SurfaceCursor *scrightup, 
00072                         SurfaceCursor *scleftdown, SurfaceCursor *scrightdown,
00073                         SurfaceCursor* normalc );       
00074         BorderLayer( Camera *, int lz, int rz, int uz, int bz, 
00075                         SurfaceCursor* scleft, SurfaceCursor *scright, 
00076                         SurfaceCursor *scup, SurfaceCursor *scdown,
00077                         SurfaceCursor* scleftup, SurfaceCursor *scrightup, 
00078                         SurfaceCursor *scleftdown, SurfaceCursor *scrightdown,
00079                         SurfaceCursor* normalc );       
00080 
00081         bool handle_event( Event *e );
00082         void get_boundrect( double&, double&, double&, double& );
00083 };
00084 
00085 #endif
00086 
00087 /// $Log: borderlayer.h,v $
00088 /// Revision 1.2  2004/06/03 10:33:31  botik32
00089 /// Added one more include to cZUI.h and definition of ABS
00090 /// Moved borderlayer to include dir and made it configurable
00091 /// using templates
00092 ///
00093 /// Revision 1.1.1.1  2004/03/26 10:50:26  botik32
00094 /// Initial release
00095 ///
00096 /// Revision 1.1.1.1  2004/03/26 08:53:33  botik
00097 /// initial import
00098 ///
00099 ///
00100 /// Revision 1.7  2003/11/24 16:12:10  botik
00101 /// Halfway through major redesign of a view's geometric
00102 /// parameters. This will influence zooming and repainting.
00103 ///
00104 /// Revision 1.6  2003/11/20 18:40:48  botik
00105 /// Got borderlayer to work satisfactory.
00106 /// Changed xpsdl driver to check bounds
00107 /// on rect update and clear
00108 ///
00109 /// Revision 1.5  2003/11/20 14:59:13  botik
00110 /// Added TimedEvent and TimedEventManager class.
00111 /// These will allow us to (hopefully) fix the
00112 /// borderlayer scrolling which sucks badly.
00113 ///
00114 /// Revision 1.4  2003/11/18 13:53:45  botik
00115 /// Fixed the annoying bug where + scrolling was faster
00116 /// than -.
00117 ///
00118 /// Revision 1.3  2003/11/12 12:04:27  botik
00119 /// Further refinements of contrib/borderlayer,
00120 /// added inner event generation to view and surface
00121 /// classes,
00122 /// a few minor bugfixes
00123 ///
00124 /// Revision 1.2  2003/11/09 18:05:37  botik
00125 /// Contrib/borderlayer works! Fixed a lot of small bugs.
00126 ///
00127 /// Revision 1.1  2003/11/08 19:27:03  botik
00128 /// Added borderlayer
00129 ///

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