Panda3D
colorScaleAttrib.I
1 // Filename: colorScaleAttrib.I
2 // Created by: drose (14Mar02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: ColorScaleAttrib::Copy Constructor
18 // Access: Protected
19 // Description: Use ColorScaleAttrib::make() to construct a new
20 // ColorScaleAttrib object.
21 ////////////////////////////////////////////////////////////////////
22 INLINE ColorScaleAttrib::
23 ColorScaleAttrib(const ColorScaleAttrib &copy) :
24  _off(copy._off),
25  _has_scale(copy._has_scale),
26  _has_rgb_scale(copy._has_rgb_scale),
27  _has_alpha_scale(copy._has_alpha_scale),
28  _scale(copy._scale)
29 {
30 }
31 
32 ////////////////////////////////////////////////////////////////////
33 // Function: ColorScaleAttrib::is_off
34 // Access: Published
35 // Description: Returns true if the ColorScaleAttrib will ignore any
36 // color scales inherited from above, false otherwise.
37 // This is not the same thing as !has_scale(); a
38 // ColorScaleAttrib may have the "off" flag set and also
39 // have another scale specified.
40 ////////////////////////////////////////////////////////////////////
41 INLINE bool ColorScaleAttrib::
42 is_off() const {
43  return _off;
44 }
45 
46 ////////////////////////////////////////////////////////////////////
47 // Function: ColorScaleAttrib::is_identity
48 // Access: Published
49 // Description: Returns true if the ColorScaleAttrib is an identity
50 // attrib, false if it is either an off attrib or it has
51 // a scale.
52 ////////////////////////////////////////////////////////////////////
53 INLINE bool ColorScaleAttrib::
54 is_identity() const {
55  return !_off && !_has_scale;
56 }
57 
58 ////////////////////////////////////////////////////////////////////
59 // Function: ColorScaleAttrib::has_scale
60 // Access: Published
61 // Description: Returns true if the ColorScaleAttrib has a
62 // non-identity scale, false otherwise (in which case it
63 // might be an off attrib or an identity attrib).
64 ////////////////////////////////////////////////////////////////////
65 INLINE bool ColorScaleAttrib::
66 has_scale() const {
67  return _has_scale;
68 }
69 
70 ////////////////////////////////////////////////////////////////////
71 // Function: ColorScaleAttrib::has_rgb_scale
72 // Access: Published
73 // Description: Returns true if the ColorScaleAttrib has a
74 // non-identity scale in the RGB components (ignoring
75 // alpha), or false otherwise.
76 ////////////////////////////////////////////////////////////////////
77 INLINE bool ColorScaleAttrib::
78 has_rgb_scale() const {
79  return _has_rgb_scale;
80 }
81 
82 ////////////////////////////////////////////////////////////////////
83 // Function: ColorScaleAttrib::has_alpha_scale
84 // Access: Published
85 // Description: Returns true if the ColorScaleAttrib has a
86 // non-identity scale in the alpha component (ignoring
87 // RGB), or false otherwise.
88 ////////////////////////////////////////////////////////////////////
89 INLINE bool ColorScaleAttrib::
90 has_alpha_scale() const {
91  return _has_alpha_scale;
92 }
93 
94 ////////////////////////////////////////////////////////////////////
95 // Function: ColorScaleAttrib::get_scale
96 // Access: Published
97 // Description: Returns the scale to be applied to colors.
98 ////////////////////////////////////////////////////////////////////
99 INLINE const LVecBase4 &ColorScaleAttrib::
100 get_scale() const {
101  return _scale;
102 }
bool has_scale() const
Returns true if the ColorScaleAttrib has a non-identity scale, false otherwise (in which case it migh...
bool has_alpha_scale() const
Returns true if the ColorScaleAttrib has a non-identity scale in the alpha component (ignoring RGB)...
const LVecBase4 & get_scale() const
Returns the scale to be applied to colors.
bool is_identity() const
Returns true if the ColorScaleAttrib is an identity attrib, false if it is either an off attrib or it...
bool has_rgb_scale() const
Returns true if the ColorScaleAttrib has a non-identity scale in the RGB components (ignoring alpha)...
bool is_off() const
Returns true if the ColorScaleAttrib will ignore any color scales inherited from above, false otherwise.
Applies a scale to colors in the scene graph and on vertices.
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111