15 #ifndef COLORINTERPOLATIONMANAGER_H 16 #define COLORINTERPOLATIONMANAGER_H 20 #include "typedObject.h" 21 #include "typedReferenceCount.h" 38 virtual LColor interpolate(
const PN_stdfloat t = 0)
const = 0;
45 static void init_type() {
46 TypedReferenceCount::init_type();
47 register_type(_type_handle,
"ColorInterpolationFunction",
48 TypedReferenceCount::get_class_type());
52 return get_class_type();
54 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
67 INLINE
LColor get_color_a()
const;
69 INLINE
void set_color_a(
const LColor &c);
76 virtual LColor interpolate(
const PN_stdfloat t = 0)
const;
86 static void init_type() {
87 ColorInterpolationFunction::init_type();
88 register_type(_type_handle,
"ColorInterpolationFunctionConstant",
89 ColorInterpolationFunction::get_class_type());
93 return get_class_type();
95 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
108 INLINE
LColor get_color_b()
const;
110 INLINE
void set_color_b(
const LColor &c);
117 LColor interpolate(
const PN_stdfloat t = 0)
const;
127 static void init_type() {
128 ColorInterpolationFunctionConstant::init_type();
129 register_type(_type_handle,
"ColorInterpolationFunctionLinear",
130 ColorInterpolationFunctionConstant::get_class_type());
134 return get_class_type();
136 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
152 INLINE PN_stdfloat get_width_a()
const;
153 INLINE PN_stdfloat get_width_b()
const;
155 INLINE
void set_width_a(
const PN_stdfloat w);
156 INLINE
void set_width_b(
const PN_stdfloat w);
163 LColor interpolate(
const PN_stdfloat t = 0)
const;
174 static void init_type() {
175 ColorInterpolationFunctionLinear::init_type();
176 register_type(_type_handle,
"ColorInterpolationFunctionStepwave",
177 ColorInterpolationFunctionLinear::get_class_type());
181 return get_class_type();
183 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
200 INLINE PN_stdfloat get_period()
const;
202 INLINE
void set_period(
const PN_stdfloat p);
209 LColor interpolate(
const PN_stdfloat t = 0)
const;
219 static void init_type() {
220 ColorInterpolationFunctionLinear::init_type();
221 register_type(_type_handle,
"ColorInterpolationFunctionSinusoid",
222 ColorInterpolationFunctionLinear::get_class_type());
226 return get_class_type();
228 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
249 INLINE PN_stdfloat get_time_begin()
const;
250 INLINE PN_stdfloat get_time_end()
const;
251 INLINE
bool is_modulated()
const;
252 INLINE
int get_id()
const;
253 INLINE
bool is_enabled()
const;
256 INLINE
void set_time_begin(
const PN_stdfloat time);
257 INLINE
void set_time_end(
const PN_stdfloat time);
258 INLINE
void set_is_modulated(
const bool flag);
259 INLINE
void set_enabled(
const bool enabled);
262 LColor interpolateColor(
const PN_stdfloat t)
const;
266 PN_stdfloat _t_begin;
268 PN_stdfloat _t_total;
290 int add_constant(
const PN_stdfloat time_begin = 0.0f,
const PN_stdfloat time_end = 1.0f,
const LColor &
color =
LColor(1.0f,1.0f,1.0f,1.0f),
const bool is_modulated =
true);
291 int add_linear(
const PN_stdfloat time_begin = 0.0f,
const PN_stdfloat time_end = 1.0f,
const LColor &color_a =
LColor(1.0f,0.0f,0.0f,1.0f),
const LColor &color_b =
LColor(0.0f,1.0f,0.0f,1.0f),
const bool is_modulated =
true);
292 int add_stepwave(
const PN_stdfloat time_begin = 0.0f,
const PN_stdfloat time_end = 1.0f,
const LColor &color_a =
LColor(1.0f,0.0f,0.0f,1.0f),
const LColor &color_b =
LColor(0.0f,1.0f,0.0f,1.0f),
const PN_stdfloat width_a = 0.5f,
const PN_stdfloat width_b = 0.5f,
const bool is_modulated =
true);
293 int add_sinusoid(
const PN_stdfloat time_begin = 0.0f,
const PN_stdfloat time_end = 1.0f,
const LColor &color_a =
LColor(1.0f,0.0f,0.0f,1.0f),
const LColor &color_b =
LColor(0.0f,1.0f,0.0f,1.0f),
const PN_stdfloat period = 1.0f,
const bool is_modulated =
true);
295 INLINE
void set_default_color(
const LColor &c);
297 INLINE
string get_segment_id_list();
298 void clear_segment(
const int seg_id);
299 void clear_to_initial();
302 LColor generateColor(
const PN_stdfloat interpolated_time);
310 #include "colorInterpolationManager.I" 312 #endif //COLORINTERPOLATIONMANAGER_H A single unit of interpolation.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
High level class for color interpolation.
Defines a discrete cyclical transition between two colors.
Defines a sinusoidal blending between two colors.
Abstract class from which all other functions should inherit.
This is the base class for all three-component vectors and points.
A base class for all things that want to be reference-counted.
TypeHandle is the identifier used to differentiate C++ class types.
Defines a constant color over the lifetime of the segment.
Defines a linear interpolation over the lifetime of the segment.