00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PGFRAMESTYLE_H
00020 #define PGFRAMESTYLE_H
00021
00022 #include "pandabase.h"
00023
00024 #include "luse.h"
00025
00026 class PandaNode;
00027 class NodePath;
00028
00029
00030
00031
00032
00033 class EXPCL_PANDA PGFrameStyle {
00034 PUBLISHED:
00035 INLINE PGFrameStyle();
00036 INLINE PGFrameStyle(const PGFrameStyle ©);
00037 INLINE void operator = (const PGFrameStyle ©);
00038
00039 INLINE ~PGFrameStyle();
00040
00041 enum Type {
00042 T_none,
00043 T_flat,
00044 T_bevel_out,
00045 T_bevel_in,
00046 T_groove,
00047 T_ridge
00048 };
00049
00050 INLINE void set_type(Type type);
00051 INLINE Type get_type() const;
00052
00053 INLINE void set_color(float r, float g, float b, float a);
00054 INLINE void set_color(const Colorf &color);
00055 INLINE const Colorf &get_color() const;
00056
00057 INLINE void set_width(float x, float y);
00058 INLINE void set_width(const LVecBase2f &width);
00059 INLINE const LVecBase2f &get_width() const;
00060
00061 void output(ostream &out) const;
00062
00063 public:
00064 bool xform(const LMatrix4f &mat);
00065 NodePath generate_into(const NodePath &parent, const LVecBase4f &frame);
00066
00067 private:
00068 PT(PandaNode) generate_flat_geom(const LVecBase4f &frame);
00069 PT(PandaNode) generate_bevel_geom(const LVecBase4f &frame, bool in);
00070 PT(PandaNode) generate_groove_geom(const LVecBase4f &frame, bool in);
00071
00072 private:
00073 Type _type;
00074 Colorf _color;
00075 LVecBase2f _width;
00076 };
00077
00078 INLINE ostream &operator << (ostream &out, const PGFrameStyle &pfs);
00079 ostream &operator << (ostream &out, PGFrameStyle::Type type);
00080
00081 #include "pgFrameStyle.I"
00082
00083 #endif