Panda3D
pgFrameStyle.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file pgFrameStyle.h
10  * @author drose
11  * @date 2001-07-03
12  */
13 
14 #ifndef PGFRAMESTYLE_H
15 #define PGFRAMESTYLE_H
16 
17 #include "pandabase.h"
18 
19 #include "luse.h"
20 #include "texture.h"
21 #include "pointerTo.h"
22 
23 class PandaNode;
24 class NodePath;
25 
26 /**
27  *
28  */
29 class EXPCL_PANDA_PGUI PGFrameStyle {
30 PUBLISHED:
31  INLINE PGFrameStyle();
32  INLINE PGFrameStyle(const PGFrameStyle &copy);
33  INLINE void operator = (const PGFrameStyle &copy);
34 
35  INLINE ~PGFrameStyle();
36 
37  enum Type {
38  T_none,
39  T_flat,
40  T_bevel_out,
41  T_bevel_in,
42  T_groove,
43  T_ridge,
44  T_texture_border
45  };
46 
47  INLINE void set_type(Type type);
48  INLINE Type get_type() const;
49 
50  INLINE void set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a);
51  INLINE void set_color(const LColor &color);
52  INLINE LColor get_color() const;
53 
54  INLINE void set_texture(Texture *texture);
55  INLINE bool has_texture() const;
56  INLINE Texture *get_texture() const;
57  INLINE void clear_texture();
58 
59  INLINE void set_width(PN_stdfloat x, PN_stdfloat y);
60  INLINE void set_width(const LVecBase2 &width);
61  INLINE const LVecBase2 &get_width() const;
62 
63  INLINE void set_uv_width(PN_stdfloat u, PN_stdfloat v);
64  INLINE void set_uv_width(const LVecBase2 &uv_width);
65  INLINE const LVecBase2 &get_uv_width() const;
66 
67  INLINE void set_visible_scale(PN_stdfloat x, PN_stdfloat y);
68  INLINE void set_visible_scale(const LVecBase2 &visible_scale);
69  INLINE const LVecBase2 &get_visible_scale() const;
70 
71  LVecBase4 get_internal_frame(const LVecBase4 &frame) const;
72 
73  void output(std::ostream &out) const;
74 
75 public:
76  bool xform(const LMatrix4 &mat);
77  NodePath generate_into(const NodePath &parent, const LVecBase4 &frame,
78  int sort = 0);
79 
80 private:
81  PT(PandaNode) generate_flat_geom(const LVecBase4 &frame);
82  PT(PandaNode) generate_bevel_geom(const LVecBase4 &frame, bool in);
83  PT(PandaNode) generate_groove_geom(const LVecBase4 &frame, bool in);
84  PT(PandaNode) generate_texture_border_geom(const LVecBase4 &frame);
85 
86 private:
87  Type _type;
88  UnalignedLVecBase4 _color;
89  PT(Texture) _texture;
90  LVecBase2 _width;
91  LVecBase2 _uv_width;
92  LVecBase2 _visible_scale;
93 };
94 
95 INLINE std::ostream &operator << (std::ostream &out, const PGFrameStyle &pfs);
96 std::ostream &operator << (std::ostream &out, PGFrameStyle::Type type);
97 
98 #include "pgFrameStyle.I"
99 
100 #endif
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
Definition: texture.h:71
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:161