14#ifndef CMETAINTERVAL_H
15#define CMETAINTERVAL_H
43 INLINE
void set_precision(
double precision);
44 INLINE
double get_precision()
const;
46 void clear_intervals();
47 int push_level(
const std::string &name,
48 double rel_time, RelativeStart rel_to);
50 double rel_time = 0.0f,
51 RelativeStart rel_to = RS_previous_end);
52 int add_ext_index(
int ext_index,
const std::string &name,
53 double duration,
bool open_ended,
54 double rel_time, RelativeStart rel_to);
55 int pop_level(
double duration = -1.0);
57 bool set_interval_start_time(
const std::string &name,
double rel_time,
58 RelativeStart rel_to = RS_level_begin);
59 double get_interval_start_time(
const std::string &name)
const;
60 double get_interval_end_time(
const std::string &name)
const;
69 INLINE
int get_num_defs()
const;
70 INLINE DefType get_def_type(
int n)
const;
71 INLINE
CInterval *get_c_interval(
int n)
const;
72 INLINE
int get_ext_index(
int n)
const;
83 INLINE
bool is_event_ready();
84 INLINE
int get_event_index()
const;
85 INLINE
double get_event_t()
const;
86 INLINE EventType get_event_type()
const;
89 virtual void write(std::ostream &out,
int indent_level)
const;
90 void timeline(std::ostream &out)
const;
93 virtual void do_recompute();
101 std::string _ext_name;
102 double _ext_duration;
103 bool _ext_open_ended;
105 RelativeStart _rel_to;
106 int _actual_begin_time;
109 enum PlaybackEventType {
115 class PlaybackEvent {
117 INLINE PlaybackEvent(
int time,
int n, PlaybackEventType type);
118 INLINE
bool operator < (
const PlaybackEvent &other)
const;
121 PlaybackEventType _type;
122 PlaybackEvent *_begin_event;
125 class EventQueueEntry {
127 INLINE EventQueueEntry(
int n, EventType event_type,
int time);
129 EventType _event_type;
141 INLINE
int double_to_int_time(
double t)
const;
142 INLINE
double int_to_double_time(
int time)
const;
145 void do_event_forward(PlaybackEvent *event,
ActiveEvents &new_active,
147 void finish_events_forward(
int now,
ActiveEvents &new_active);
148 void do_event_reverse(PlaybackEvent *event,
ActiveEvents &new_active,
150 void finish_events_reverse(
int now,
ActiveEvents &new_active);
152 void enqueue_event(
int n, CInterval::EventType event_type,
bool is_initial,
154 void enqueue_self_event(CInterval::EventType event_type,
double t = 0.0);
155 void enqueue_done_event();
156 bool service_event_queue();
158 int recompute_level(
int n,
int level_begin,
int &level_end);
159 int get_begin_time(
const IntervalDef &def,
int level_begin,
160 int previous_begin,
int previous_end);
162 void write_event_desc(std::ostream &out,
const IntervalDef &def,
163 int &extra_indent_level)
const;
168 int _current_nesting_level;
174 size_t _next_event_index;
175 bool _processing_events;
188 static void init_type() {
189 CInterval::init_type();
191 CInterval::get_class_type());
194 return get_class_type();
196 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The base class for timeline components.
virtual void priv_reverse_finalize()
Called generally following a priv_reverse_initialize(), this indicates the interval should set itself...
virtual void priv_step(double t)
Advances the time on the interval.
virtual void priv_initialize(double t)
This replaces the first call to priv_step(), and indicates that the interval has just begun.
virtual void priv_reverse_initialize(double t)
Similar to priv_initialize(), but this is called when the interval is being played backwards; it indi...
virtual void priv_finalize()
This is called to stop an interval, forcing it to whatever state it would be after it played all the ...
virtual void priv_reverse_instant()
This is called in lieu of priv_reverse_initialize() .
virtual void priv_interrupt()
This is called while the interval is playing to indicate that it is about to be interrupted; that is,...
virtual void priv_instant()
This is called in lieu of priv_initialize() .
TypeHandle is the identifier used to differentiate C++ class types.
This is our own Panda specialization on the default STL deque.
This is our own Panda specialization on the default STL list.
This is our own Panda specialization on the default STL vector.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...