A single unit of interpolation. More...
#include "colorInterpolationManager.h"
Public Member Functions | |
ColorInterpolationSegment (ColorInterpolationFunction *function, const PN_stdfloat &time_begin, const PN_stdfloat &time_end, const bool is_modulated, const int id) | |
constructor More... | |
ColorInterpolationSegment (const ColorInterpolationSegment &s) | |
copy constructor More... | |
virtual | ~ColorInterpolationSegment () |
destructor More... | |
TypedReferenceCount * | get_function () const |
Returns a reference to the function object corresponding to this segment. More... | |
int | get_id () const |
Returns the id assigned to this segment by the manager that created it. More... | |
PN_stdfloat | get_time_begin () const |
Returns the point in the particle's lifetime at which this segment begins its effect. More... | |
PN_stdfloat | get_time_end () const |
Returns the point in the particle's lifetime at which this segment's effect stops. More... | |
LColor | interpolateColor (const PN_stdfloat t) const |
Returns the interpolated color according to the segment's function and start and end times. More... | |
bool | is_enabled () const |
Returns whether the segments effects are being applied. More... | |
bool | is_modulated () const |
Returns whether the function is additive or modulated. More... | |
void | set_enabled (const bool enabled) |
Sets whether the segments effects should be applied. More... | |
void | set_function (ColorInterpolationFunction *function) |
Sets the function that the segment will use for its interpolation calculations. More... | |
void | set_is_modulated (const bool flag) |
Sets how the function is applied to the final color. More... | |
void | set_time_begin (const PN_stdfloat time) |
Sets the point in the particle's lifetime at which this segment begins its effect. More... | |
void | set_time_end (const PN_stdfloat time) |
Sets the point in the particle's lifetime at which this segment's effect ends. More... | |
Public Member Functions inherited from ReferenceCount | |
int | get_ref_count () const |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. More... | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More... | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More... | |
void | ref () const |
Explicitly increments the reference count. More... | |
bool | ref_if_nonzero () const |
Atomically increases the reference count of this object if it is not zero. More... | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
virtual bool | unref () const |
Explicitly decrements the reference count. More... | |
WeakReferenceList * | weak_ref () |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref () |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ReferenceCount | |
static TypeHandle | get_class_type () |
static void | init_type () |
Public Attributes inherited from ReferenceCount | |
get_ref_count | |
Returns the current reference count. More... | |
A single unit of interpolation.
The begin and end times are interpolated over the lifetime of the particle, thus have the range of [0,1]. Each segment also has a function associated with it.
Definition at line 227 of file colorInterpolationManager.h.
ColorInterpolationSegment::ColorInterpolationSegment | ( | ColorInterpolationFunction * | function, |
const PN_stdfloat & | time_begin, | ||
const PN_stdfloat & | time_end, | ||
const bool | is_modulated, | ||
const int | id | ||
) |
constructor
Definition at line 171 of file colorInterpolationManager.cxx.
ColorInterpolationSegment::ColorInterpolationSegment | ( | const ColorInterpolationSegment & | s | ) |
copy constructor
Definition at line 190 of file colorInterpolationManager.cxx.
|
virtual |
destructor
Definition at line 205 of file colorInterpolationManager.cxx.
|
inline |
Returns a reference to the function object corresponding to this segment.
Definition at line 111 of file colorInterpolationManager.I.
|
inline |
Returns the id assigned to this segment by the manager that created it.
Definition at line 158 of file colorInterpolationManager.I.
|
inline |
Returns the point in the particle's lifetime at which this segment begins its effect.
It is an interpolated value in the range [0,1].
Definition at line 121 of file colorInterpolationManager.I.
|
inline |
Returns the point in the particle's lifetime at which this segment's effect stops.
It is an interpolated value in the range [0,1].
Definition at line 131 of file colorInterpolationManager.I.
LColor ColorInterpolationSegment::interpolateColor | ( | const PN_stdfloat | t | ) | const |
Returns the interpolated color according to the segment's function and start and end times.
't' is a value in [0-1] where corresponds to beginning of the segment and 1 corresponds to the end.
Definition at line 215 of file colorInterpolationManager.cxx.
|
inline |
Returns whether the segments effects are being applied.
Definition at line 149 of file colorInterpolationManager.I.
|
inline |
Returns whether the function is additive or modulated.
Definition at line 140 of file colorInterpolationManager.I.
|
inline |
Sets whether the segments effects should be applied.
Definition at line 209 of file colorInterpolationManager.I.
|
inline |
Sets the function that the segment will use for its interpolation calculations.
Definition at line 168 of file colorInterpolationManager.I.
|
inline |
Sets how the function is applied to the final color.
If true, the value is multiplied. If false, the value is simply added. Default is true.
Definition at line 200 of file colorInterpolationManager.I.
|
inline |
Sets the point in the particle's lifetime at which this segment begins its effect.
It is an interpolated value in the range [0,1].
Definition at line 178 of file colorInterpolationManager.I.
|
inline |
Sets the point in the particle's lifetime at which this segment's effect ends.
It is an interpolated value in the range [0,1].
Definition at line 189 of file colorInterpolationManager.I.