Panda3D
Functions
colorScaleAttrib.cxx File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

#include "colorScaleAttrib.h"
#include "graphicsStateGuardianBase.h"
#include "dcast.h"
#include "bamReader.h"
#include "bamWriter.h"
#include "datagram.h"
#include "datagramIterator.h"
#include "config_pgraph.h"

Go to the source code of this file.

Functions

 CPT (RenderAttrib) ColorScaleAttrib
 Constructs an identity scale attrib. More...
 

Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
drose
Date
2002-03-14

Definition in file colorScaleAttrib.cxx.

Function Documentation

◆ CPT()

CPT ( RenderAttrib  )

Constructs an identity scale attrib.

Returns a new ColorScaleAttrib, just like this one, but with the scale changed to the indicated value.

Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be.

Constructs a new ColorScaleAttrib object that ignores any ColorScaleAttrib inherited from above.

Constructs a new ColorScaleAttrib object that indicates geometry should be scaled by the indicated factor.

You may also specify an additional color scale to apply to geometry below (using set_scale()).

Intended to be overridden by derived RenderAttrib types to specify how two consecutive RenderAttrib objects of the same type interact.

This should return false if a RenderAttrib on a higher node will compose into a RenderAttrib on a lower node that has a higher override value, or false if the lower RenderAttrib will completely replace the state.

The default behavior is false: normally, a RenderAttrib in the graph cannot completely override a RenderAttrib above it, regardless of its override value–instead, the two attribs are composed. But for some kinds of RenderAttribs, it is useful to allow this kind of override.

This method only handles the one special case of a lower RenderAttrib with a higher override value. If the higher RenderAttrib has a higher override value, it always completely overrides. And if both RenderAttribs have the same override value, they are always composed. Intended to be overridden by derived ColorScaleAttrib types to return a unique number indicating whether this ColorScaleAttrib is equivalent to the other one.

This should return 0 if the two ColorScaleAttrib objects are equivalent, a number less than zero if this one should be sorted before the other one, and a number greater than zero otherwise.

This will only be called with two ColorScaleAttrib objects whose get_type() functions return the same. Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties. RenderAttribs that compare the same with compare_to_impl(), above, should return the same hash; RenderAttribs that compare differently should return a different hash. Intended to be overridden by derived RenderAttrib types to specify how two consecutive RenderAttrib objects of the same type interact.

This should return the result of applying the other RenderAttrib to a node in the scene graph below this RenderAttrib, which was already applied. In most cases, the result is the same as the other RenderAttrib (that is, a subsequent RenderAttrib completely replaces the preceding one). On the other hand, some kinds of RenderAttrib (for instance, ColorTransformAttrib) might combine in meaningful ways. Intended to be overridden by derived RenderAttrib types to specify how two consecutive RenderAttrib objects of the same type interact.

See invert_compose() and compose_impl(). Quantizes the color scale to the nearest multiple of 1024, just to prevent runaway accumulation of only slightly-different ColorScaleAttribs.

Definition at line 44 of file colorScaleAttrib.cxx.