Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/pgui/pgFrameStyle.h

Go to the documentation of this file.
00001 // Filename: pgFrameStyle.h
00002 // Created by:  drose (03Jul01)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
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 //       Class : PGFrameStyle
00031 // Description : 
00032 ////////////////////////////////////////////////////////////////////
00033 class EXPCL_PANDA PGFrameStyle {
00034 PUBLISHED:
00035   INLINE PGFrameStyle();
00036   INLINE PGFrameStyle(const PGFrameStyle &copy);
00037   INLINE void operator = (const PGFrameStyle &copy);
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

Generated on Fri May 2 00:42:39 2003 for Panda by doxygen1.3