00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PGVIRTUALFRAME_H
00016 #define PGVIRTUALFRAME_H
00017
00018 #include "pandabase.h"
00019
00020 #include "pgItem.h"
00021 #include "modelNode.h"
00022
00023 class TransformState;
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 class EXPCL_PANDA_PGUI PGVirtualFrame : public PGItem {
00051 PUBLISHED:
00052 PGVirtualFrame(const string &name = "");
00053 virtual ~PGVirtualFrame();
00054
00055 protected:
00056 PGVirtualFrame(const PGVirtualFrame ©);
00057 virtual PandaNode *make_copy() const;
00058 virtual void r_copy_children(const PandaNode *from, InstanceMap &inst_map,
00059 Thread *current_thread);
00060
00061 PUBLISHED:
00062 void setup(PN_stdfloat width, PN_stdfloat height);
00063
00064 INLINE void set_clip_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top);
00065 void set_clip_frame(const LVecBase4 &clip_frame);
00066 INLINE const LVecBase4 &get_clip_frame() const;
00067 INLINE bool has_clip_frame() const;
00068 void clear_clip_frame();
00069
00070 INLINE void set_canvas_transform(const TransformState *transform);
00071 INLINE const TransformState *get_canvas_transform() const;
00072
00073 INLINE PandaNode *get_canvas_node() const;
00074 INLINE PandaNode *get_canvas_parent() const;
00075
00076 protected:
00077 virtual void clip_frame_changed();
00078
00079 private:
00080 void setup_child_nodes();
00081
00082 private:
00083 bool _has_clip_frame;
00084 LVecBase4 _clip_frame;
00085
00086 PT(ModelNode) _canvas_node;
00087 PT(ModelNode) _canvas_parent;
00088
00089 public:
00090 static TypeHandle get_class_type() {
00091 return _type_handle;
00092 }
00093 static void init_type() {
00094 PGItem::init_type();
00095 register_type(_type_handle, "PGVirtualFrame",
00096 PGItem::get_class_type());
00097 }
00098 virtual TypeHandle get_type() const {
00099 return get_class_type();
00100 }
00101 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00102
00103 private:
00104 static TypeHandle _type_handle;
00105 };
00106
00107 #include "pgVirtualFrame.I"
00108
00109 #endif