112 return _color_inter_func;
141 return _is_modulated;
169 _color_inter_func =
function;
180 _t_total = _t_end-_t_begin;
191 _t_total = _t_end-_t_begin;
201 _is_modulated = flag;
230 for(iter = _i_segs.begin();iter != _i_segs.end();++iter)
231 if( seg_id == (*iter)->get_id() )
245 std::ostringstream output;
247 for(iter = _i_segs.begin();iter != _i_segs.end();++iter)
248 output << (*iter)->get_id() <<
" ";
250 std::string str = output.str();
251 return str.substr(0, str.length()-1);
void set_width_a(const PN_stdfloat w)
Sets the primary width of the function.
void set_width_b(const PN_stdfloat w)
Sets the secondary width of the function.
PN_stdfloat get_width_a() const
Returns the primary width of the function.
A single unit of interpolation.
LColor get_color_b() const
Returns the secondary color of the function.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
void set_enabled(const bool enabled)
Sets whether the segments effects should be applied.
void set_time_end(const PN_stdfloat time)
Sets the point in the particle's lifetime at which this segment's effect ends.
bool is_enabled() const
Returns whether the segments effects are being applied.
void set_period(const PN_stdfloat p)
Sets the time to transition from A to B then back to A again.
void set_default_color(const LColor &c)
Sets the color to used if no segments are present.
This is our own Panda specialization on the default STL vector.
LColor get_color_a() const
Returns the primary color of the function.
void set_function(ColorInterpolationFunction *function)
Sets the function that the segment will use for its interpolation calculations.
int get_id() const
Returns the id assigned to this segment by the manager that created it.
std::string get_segment_id_list()
Returns a space delimited list of all of the ids in the manager at the time.
TypedReferenceCount * get_function() const
Returns a reference to the function object corresponding to this segment.
void set_is_modulated(const bool flag)
Sets how the function is applied to the final color.
PN_stdfloat get_time_begin() const
Returns the point in the particle's lifetime at which this segment begins its effect.
PN_stdfloat get_width_b() const
Returns the secondary width of the function.
Abstract class from which all other functions should inherit.
void set_color_a(const LColor &c)
Sets the primary color of the function.
PN_stdfloat get_time_end() const
Returns the point in the particle's lifetime at which this segment's effect stops.
ColorInterpolationSegment * get_segment(const int seg_id)
Returns the segment that corresponds to 'seg_id'.
void set_color_b(const LColor &c)
Sets the secondary color of the function.
bool is_modulated() const
Returns whether the function is additive or modulated.
void set_time_begin(const PN_stdfloat time)
Sets the point in the particle's lifetime at which this segment begins its effect.
PN_stdfloat get_period() const
Returns the time to transition from A to B then back to A again.