00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef MOUSESUBREGION_H
00016 #define MOUSESUBREGION_H
00017
00018 #include "pandabase.h"
00019
00020 #include "mouseInterfaceNode.h"
00021 #include "luse.h"
00022 #include "linmath_events.h"
00023 #include "buttonEventList.h"
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class EXPCL_PANDA_TFORM MouseSubregion : public MouseInterfaceNode {
00038 PUBLISHED:
00039 MouseSubregion(const string &name);
00040 ~MouseSubregion();
00041
00042 INLINE PN_stdfloat get_left() const;
00043 INLINE PN_stdfloat get_right() const;
00044 INLINE PN_stdfloat get_bottom() const;
00045 INLINE PN_stdfloat get_top() const;
00046 INLINE void set_dimensions(PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t);
00047
00048 protected:
00049
00050 virtual void do_transmit_data(DataGraphTraverser *trav,
00051 const DataNodeTransmit &input,
00052 DataNodeTransmit &output);
00053
00054 private:
00055 PN_stdfloat _l;
00056 PN_stdfloat _r;
00057 PN_stdfloat _b;
00058 PN_stdfloat _t;
00059
00060 PN_stdfloat _minx, _miny;
00061 PN_stdfloat _scalex, _scaley;
00062
00063 private:
00064
00065 int _pixel_xy_input;
00066 int _pixel_size_input;
00067 int _xy_input;
00068 int _button_events_input;
00069
00070
00071 int _pixel_xy_output;
00072 int _pixel_size_output;
00073 int _xy_output;
00074 int _button_events_output;
00075
00076 PT(EventStoreVec2) _pixel_xy;
00077 PT(EventStoreVec2) _pixel_size;
00078 PT(EventStoreVec2) _xy;
00079 PT(ButtonEventList) _button_events;
00080
00081 public:
00082 static TypeHandle get_class_type() {
00083 return _type_handle;
00084 }
00085 static void init_type() {
00086 MouseInterfaceNode::init_type();
00087 register_type(_type_handle, "MouseSubregion",
00088 MouseInterfaceNode::get_class_type());
00089 }
00090 virtual TypeHandle get_type() const {
00091 return get_class_type();
00092 }
00093 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00094
00095 private:
00096 static TypeHandle _type_handle;
00097 };
00098
00099 #include "mouseSubregion.I"
00100
00101 #endif