Panda3D
|
This interval contains a list of nested intervals, each of which has its own begin and end times. More...
#include "cMetaInterval.h"
Classes | |
class | EventQueueEntry |
class | IntervalDef |
class | PlaybackEvent |
Public Types | |
enum | DefType { DT_c_interval, DT_ext_index, DT_push_level, DT_pop_level } |
enum | EventType { ET_initialize, ET_instant, ET_step, ET_finalize, ET_reverse_initialize, ET_reverse_instant, ET_reverse_finalize, ET_interrupt } |
enum | RelativeStart { RS_previous_end, RS_previous_begin, RS_level_begin } |
enum | State { S_initial, S_started, S_paused, S_final } |
Public Member Functions | |
CMetaInterval (const string &name) | |
int | add_c_interval (CInterval *c_interval, double rel_time=0.0f, RelativeStart rel_to=RS_previous_end) |
Adds a new CInterval to the list. | |
int | add_ext_index (int ext_index, const string &name, double duration, bool open_ended, double rel_time, RelativeStart rel_to) |
Adds a new external interval to the list. | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
bool | check_t_callback () |
Returns true if the wants_t_callback() flag is true and the interval's t value has changed since the last call to check_t_callback(), false otherwise. | |
void | clear_intervals () |
Resets the list of intervals and prepares for receiving a new list. | |
void | clear_to_initial () |
Pauses the interval, if it is playing, and resets its state to its initial state, abandoning any state changes already in progress in the middle of the interval. | |
void | finish () |
Stops the interval from playing and sets it to its final state. | |
virtual TypeHandle | force_init_type () |
bool | get_auto_finish () const |
Returns the state of the 'auto_finish' flag. | |
bool | get_auto_pause () const |
Returns the state of the 'auto_pause' flag. | |
int | get_best_parent_from_Set (const std::set< int > &) const |
CInterval * | get_c_interval (int n) const |
Return the CInterval pointer associated with the nth interval definition. | |
DefType | get_def_type (int n) const |
Returns the type of the nth interval definition that has been added. | |
const string & | get_done_event () const |
Returns the event that is generated whenever the interval reaches its final state, whether it is explicitly finished or whether it gets there on its own. | |
double | get_duration () const |
Returns the duration of the interval in seconds. | |
int | get_event_index () const |
If a previous call to is_event_ready() returned true, this returns the index number (added via add_event_index()) of the external interval that needs to be played. | |
double | get_event_t () const |
If a previous call to is_event_ready() returned true, this returns the t value that should be fed to the given interval. | |
EventType | get_event_type () const |
If a previous call to is_event_ready() returned true, this returns the type of the event (initialize, step, finalize, etc.) for the given interval. | |
int | get_ext_index (int n) const |
Return the external interval index number associated with the nth interval definition. | |
double | get_interval_end_time (const string &name) const |
Returns the actual end time, relative to the beginning of the interval, of the child interval with the given name, if found, or -1 if the interval is not found. | |
double | get_interval_start_time (const string &name) const |
Returns the actual start time, relative to the beginning of the interval, of the child interval with the given name, if found, or -1 if the interval is not found. | |
CIntervalManager * | get_manager () const |
Returns the CIntervalManager object which will be responsible for playing this interval. | |
const string & | get_name () const |
Returns the interval's name. | |
int | get_num_defs () const |
Returns the number of interval and push/pop definitions that have been added to the meta interval. | |
bool | get_open_ended () const |
Returns the state of the "open_ended" flag. | |
double | get_play_rate () const |
Returns the play rate as set by the last call to start(), loop(), or set_play_rate(). | |
double | get_precision () const |
Returns the precision with which time measurements are compared. | |
int | get_ref_count () const |
Returns the current reference count. | |
State | get_state () const |
Indicates the state the interval believes it is in: whether it has been started, is currently in the middle, or has been finalized. | |
double | get_t () const |
Returns the current time of the interval: the last value of t passed to priv_initialize(), priv_step(), or priv_finalize(). | |
virtual TypeHandle | get_type () const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
bool | get_wants_t_callback () const |
Returns the state of the 'wants_t_callback' flag. | |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. | |
bool | is_event_ready () |
Returns true if a recent call to priv_initialize(), priv_step(), or priv_finalize() has left some external intervals ready to play. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
bool | is_playing () const |
Returns true if the interval is currently playing, false otherwise. | |
bool | is_stopped () const |
Returns true if the interval is in either its initial or final states (but not in a running or paused state). | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. | |
void | loop (double start_t=0.0, double end_t=-1.0, double play_rate=1.0) |
Starts the interval playing by registering it with the current CIntervalManager. | |
void | mark_dirty () |
Called by a derived class to indicate the interval has been changed internally and must be recomputed before its duration may be returned. | |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete[] (void *, void *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *, void *) |
void | operator delete[] (void *ptr) |
void * | operator new (size_t size, void *ptr) |
void * | operator new (size_t size, void *ptr) |
void * | operator new (size_t size) |
void * | operator new (size_t size) |
void * | operator new[] (size_t size, void *ptr) |
void * | operator new[] (size_t size) |
void * | operator new[] (size_t size) |
void * | operator new[] (size_t size, void *ptr) |
virtual void | output (ostream &out) const |
double | pause () |
Stops the interval from playing but leaves it in its current state. | |
void | pop_event () |
Acknowledges that the external interval on the top of the queue has been extracted, and is about to be serviced by the scripting language. | |
int | pop_level (double duration=-1.0) |
Finishes a level marked by a previous call to push_level(), and returns to the previous level. | |
void | priv_do_event (double t, EventType event) |
Calls the appropriate event function indicated by the EventType. | |
virtual void | priv_finalize () |
This is called when an interval is interrupted. | |
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_instant () |
This is called in lieu of priv_initialize() . | |
virtual void | priv_interrupt () |
This is called while the interval is playing to indicate that it is about to be interrupted; that is, priv_step() will not be called for a length of time. | |
virtual void | priv_reverse_finalize () |
Called generally following a priv_reverse_initialize(), this indicates the interval should set itself to the initial state. | |
virtual void | priv_reverse_initialize (double t) |
Similar to priv_initialize(), but this is called when the interval is being played backwards; it indicates that the interval should start at the finishing state and undo any intervening intervals. | |
virtual void | priv_reverse_instant () |
This is called in lieu of priv_reverse_initialize() | |
virtual void | priv_step (double t) |
Advances the time on the interval. | |
int | push_level (const string &name, double rel_time, RelativeStart rel_to) |
Marks the beginning of a nested level of child intervals. | |
void | ref () const |
Explicitly increments the reference count. | |
void | resume (double start_t) |
Restarts the interval from the indicated point after a previous call to pause(). | |
void | resume () |
Restarts the interval from its current point after a previous call to pause(). | |
void | resume_until (double end_t) |
Restarts the interval from the current point after a previous call to pause() (or a previous play-to-point-and-stop), to play until the indicated point and then stop. | |
void | set_auto_finish (bool auto_finish) |
Changes the state of the 'auto_finish' flag. | |
void | set_auto_pause (bool auto_pause) |
Changes the state of the 'auto_pause' flag. | |
void | set_done_event (const string &event) |
Sets the event that is generated whenever the interval reaches its final state, whether it is explicitly finished or whether it gets there on its own. | |
bool | set_interval_start_time (const string &name, double rel_time, RelativeStart rel_to=RS_level_begin) |
Adjusts the start time of the child interval with the given name, if found. | |
void | set_manager (CIntervalManager *manager) |
Indicates the CIntervalManager object which will be responsible for playing this interval. | |
void | set_play_rate (double play_rate) |
Changes the play rate of the interval. | |
void | set_precision (double precision) |
Indicates the precision with which time measurements are compared. | |
void | set_t (double t) |
Explicitly sets the time within the interval. | |
void | set_wants_t_callback (bool wants_t_callback) |
Changes the state of the 'wants_t_callback' flag. | |
void | setup_play (double start_time, double end_time, double play_rate, bool do_loop) |
Called to prepare the interval for automatic timed playback, e.g. | |
void | setup_resume () |
Called to prepare the interval for restarting at the current point within the interval after an interruption. | |
void | setup_resume_until (double end_t) |
Called to prepare the interval for restarting from the current point after a previous call to pause() (or a previous play-to-point-and-stop), to play until the indicated point and then stop. | |
void | start (double start_t=0.0, double end_t=-1.0, double play_rate=1.0) |
Starts the interval playing by registering it with the current CIntervalManager. | |
bool | step_play () |
Should be called once per frame to execute the automatic timed playback begun with setup_play(). | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
void | timeline (ostream &out) const |
Outputs a list of all events in the order in which they occur. | |
virtual bool | unref () const |
Explicitly decrements the reference count. | |
void | weak_ref (WeakPointerToVoid *ptv) |
Adds the indicated PointerToVoid as a weak reference to this object. | |
void | weak_unref (WeakPointerToVoid *ptv) |
Removes the indicated PointerToVoid as a weak reference to this object. | |
virtual void | write (ostream &out, int indent_level) const |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
Protected Member Functions | |
void | check_started (TypeHandle type, const char *method_name) const |
Issues a warning if our internal state is not in one of the started states. | |
void | check_stopped (TypeHandle type, const char *method_name) const |
Issues a warning if our internal state is not in one of the stopped states. | |
virtual void | do_recompute () |
Recomputes all of the events (and the duration) according to the set of interval defs. | |
bool | do_test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | do_test_ref_count_nonzero () const |
Returns true if the reference count is nonzero, false otherwise. | |
void | interval_done () |
Called internally whenever the interval reaches its final state. | |
void | recompute () const |
Calls do_recompute() if the dirty flag has been set. | |
Protected Attributes | |
bool | _auto_finish |
bool | _auto_pause |
double | _clock_start |
double | _curr_t |
bool | _do_loop |
string | _done_event |
double | _duration |
double | _end_t |
bool | _end_t_at_end |
double | _last_t_callback |
int | _loop_count |
CIntervalManager * | _manager |
string | _name |
double | _play_rate |
string | _pname |
double | _start_t |
bool | _start_t_at_start |
State | _state |
bool | _wants_t_callback |
This interval contains a list of nested intervals, each of which has its own begin and end times.
Some of them may overlap and some of them may not.
Definition at line 34 of file cMetaInterval.h.
int CMetaInterval::add_c_interval | ( | CInterval * | c_interval, |
double | rel_time = 0.0f , |
||
RelativeStart | rel_to = RS_previous_end |
||
) |
Adds a new CInterval to the list.
The interval will be played when the indicated time (relative to the given point) has been reached.
The return value is the index of the def entry representing the new interval.
Definition at line 137 of file cMetaInterval.cxx.
References CInterval::mark_dirty().
int CMetaInterval::add_ext_index | ( | int | ext_index, |
const string & | name, | ||
double | duration, | ||
bool | open_ended, | ||
double | rel_time, | ||
RelativeStart | rel_to | ||
) |
Adds a new external interval to the list.
This represents some object in the external scripting language that has properties similar to a CInterval (for instance, a Python Interval object).
The CMetaInterval object cannot play this external interval directly, but it records a placeholder for it and will ask the scripting language to play it when it is time, via is_event_ready() and related methods.
The ext_index number itself is simply a handle that the scripting language makes up and associates with its interval object somehow. The CMetaInterval object does not attempt to interpret this value.
The return value is the index of the def entry representing the new interval.
Definition at line 178 of file cMetaInterval.cxx.
References CInterval::mark_dirty().
TypedObject * TypedObject::as_typed_object | ( | ) | [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 99 of file typedObject.I.
const TypedObject * TypedObject::as_typed_object | ( | ) | const [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 110 of file typedObject.I.
void CInterval::check_started | ( | TypeHandle | type, |
const char * | method_name | ||
) | const [inline, protected, inherited] |
Issues a warning if our internal state is not in one of the started states.
Definition at line 275 of file cInterval.I.
References CInterval::get_name(), and TypeHandle::get_name().
Referenced by CInterval::priv_finalize(), CInterval::priv_interrupt(), CInterval::priv_reverse_finalize(), CConstrainPosInterval::priv_step(), CConstrainTransformInterval::priv_step(), CInterval::priv_step(), priv_step(), CLerpAnimEffectInterval::priv_step(), CConstrainHprInterval::priv_step(), CConstrainPosHprInterval::priv_step(), WaitInterval::priv_step(), and CLerpNodePathInterval::priv_step().
void CInterval::check_stopped | ( | TypeHandle | type, |
const char * | method_name | ||
) | const [inline, protected, inherited] |
Issues a warning if our internal state is not in one of the stopped states.
Definition at line 259 of file cInterval.I.
References CInterval::get_name(), and TypeHandle::get_name().
Referenced by priv_initialize(), CLerpNodePathInterval::priv_initialize(), CInterval::priv_initialize(), CLerpNodePathInterval::priv_instant(), CInterval::priv_instant(), HideInterval::priv_instant(), priv_instant(), ShowInterval::priv_instant(), priv_reverse_initialize(), CLerpNodePathInterval::priv_reverse_initialize(), CInterval::priv_reverse_initialize(), CLerpNodePathInterval::priv_reverse_instant(), priv_reverse_instant(), HideInterval::priv_reverse_instant(), CInterval::priv_reverse_instant(), and ShowInterval::priv_reverse_instant().
bool CInterval::check_t_callback | ( | ) | [inline, inherited] |
Returns true if the wants_t_callback() flag is true and the interval's t value has changed since the last call to check_t_callback(), false otherwise.
Definition at line 232 of file cInterval.I.
References CInterval::get_t(), and CInterval::get_wants_t_callback().
void CMetaInterval::clear_intervals | ( | ) |
Resets the list of intervals and prepares for receiving a new list.
Definition at line 59 of file cMetaInterval.cxx.
void CInterval::clear_to_initial | ( | ) | [inherited] |
Pauses the interval, if it is playing, and resets its state to its initial state, abandoning any state changes already in progress in the middle of the interval.
Calling this is like pausing the interval and discarding it, creating a new one in its place.
Definition at line 268 of file cInterval.cxx.
References CInterval::pause().
void CMetaInterval::do_recompute | ( | ) | [protected, virtual] |
Recomputes all of the events (and the duration) according to the set of interval defs.
Reimplemented from CInterval.
Definition at line 820 of file cMetaInterval.cxx.
bool ReferenceCount::do_test_ref_count_integrity | ( | ) | const [protected, inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Returns true if ok, false otherwise.
Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.
Definition at line 29 of file referenceCount.cxx.
Referenced by ReferenceCount::do_test_ref_count_nonzero(), and ReferenceCount::test_ref_count_integrity().
bool ReferenceCount::do_test_ref_count_nonzero | ( | ) | const [protected, inherited] |
Returns true if the reference count is nonzero, false otherwise.
Definition at line 56 of file referenceCount.cxx.
References ReferenceCount::do_test_ref_count_integrity().
Referenced by ReferenceCount::test_ref_count_nonzero().
void CInterval::finish | ( | ) | [inherited] |
Stops the interval from playing and sets it to its final state.
Definition at line 239 of file cInterval.cxx.
References CIntervalManager::find_c_interval(), CInterval::get_name(), CInterval::get_state(), CInterval::priv_finalize(), CInterval::priv_instant(), and CIntervalManager::remove_c_interval().
bool CInterval::get_auto_finish | ( | ) | const [inline, inherited] |
Returns the state of the 'auto_finish' flag.
See set_auto_finish().
Definition at line 165 of file cInterval.I.
bool CInterval::get_auto_pause | ( | ) | const [inline, inherited] |
Returns the state of the 'auto_pause' flag.
See set_auto_pause().
Definition at line 138 of file cInterval.I.
CInterval * CMetaInterval::get_c_interval | ( | int | n | ) | const [inline] |
Return the CInterval pointer associated with the nth interval definition.
It is only valid to call this if get_def_type(n) returns DT_c_interval.
Definition at line 77 of file cMetaInterval.I.
CMetaInterval::DefType CMetaInterval::get_def_type | ( | int | n | ) | const [inline] |
Returns the type of the nth interval definition that has been added.
Definition at line 64 of file cMetaInterval.I.
const string & CInterval::get_done_event | ( | ) | const [inline, inherited] |
Returns the event that is generated whenever the interval reaches its final state, whether it is explicitly finished or whether it gets there on its own.
Definition at line 99 of file cInterval.I.
double CInterval::get_duration | ( | ) | const [inline, inherited] |
Returns the duration of the interval in seconds.
Definition at line 32 of file cInterval.I.
References CInterval::recompute().
Referenced by CLerpInterval::compute_delta(), priv_finalize(), CInterval::priv_finalize(), priv_instant(), CLerpNodePathInterval::priv_instant(), CInterval::priv_instant(), CInterval::setup_play(), CInterval::setup_resume_until(), and CInterval::step_play().
int CMetaInterval::get_event_index | ( | ) | const [inline] |
If a previous call to is_event_ready() returned true, this returns the index number (added via add_event_index()) of the external interval that needs to be played.
Definition at line 120 of file cMetaInterval.I.
double CMetaInterval::get_event_t | ( | ) | const [inline] |
If a previous call to is_event_ready() returned true, this returns the t value that should be fed to the given interval.
Definition at line 136 of file cMetaInterval.I.
CInterval::EventType CMetaInterval::get_event_type | ( | ) | const [inline] |
If a previous call to is_event_ready() returned true, this returns the type of the event (initialize, step, finalize, etc.) for the given interval.
Definition at line 149 of file cMetaInterval.I.
int CMetaInterval::get_ext_index | ( | int | n | ) | const [inline] |
Return the external interval index number associated with the nth interval definition.
It is only valid to call this if get_def_type(n) returns DT_ext_index.
Definition at line 91 of file cMetaInterval.I.
double CMetaInterval::get_interval_end_time | ( | const string & | name | ) | const |
Returns the actual end time, relative to the beginning of the interval, of the child interval with the given name, if found, or -1 if the interval is not found.
Definition at line 318 of file cMetaInterval.cxx.
References CInterval::recompute().
double CMetaInterval::get_interval_start_time | ( | const string & | name | ) | const |
Returns the actual start time, relative to the beginning of the interval, of the child interval with the given name, if found, or -1 if the interval is not found.
Definition at line 281 of file cMetaInterval.cxx.
References CInterval::recompute().
CIntervalManager * CInterval::get_manager | ( | ) | const [inline, inherited] |
Returns the CIntervalManager object which will be responsible for playing this interval.
Note that this can only return a C++ object; if the particular CIntervalManager object has been extended in the scripting language, this will return the encapsulated C++ object, not the full extended object.
Definition at line 220 of file cInterval.I.
const string & CInterval::get_name | ( | ) | const [inline, inherited] |
Returns the interval's name.
Definition at line 22 of file cInterval.I.
Referenced by CIntervalManager::add_c_interval(), CInterval::check_started(), CInterval::check_stopped(), CInterval::finish(), CInterval::is_playing(), and CInterval::pause().
int CMetaInterval::get_num_defs | ( | ) | const [inline] |
Returns the number of interval and push/pop definitions that have been added to the meta interval.
Definition at line 53 of file cMetaInterval.I.
bool CInterval::get_open_ended | ( | ) | const [inline, inherited] |
Returns the state of the "open_ended" flag.
This is primarily intended for instantaneous intervals like FunctionIntervals; it indicates true if the interval has some lasting effect that should be applied even if the interval doesn't get started until after its finish time, or false if the interval is a transitive thing that doesn't need to be called late.
Definition at line 49 of file cInterval.I.
Referenced by CInterval::step_play().
double CInterval::get_play_rate | ( | ) | const [inherited] |
Returns the play rate as set by the last call to start(), loop(), or set_play_rate().
Definition at line 294 of file cInterval.cxx.
double CMetaInterval::get_precision | ( | ) | const [inline] |
Returns the precision with which time measurements are compared.
See set_precision().
Definition at line 41 of file cMetaInterval.I.
int ReferenceCount::get_ref_count | ( | ) | const [inline, inherited] |
Returns the current reference count.
Definition at line 155 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by TransformState::clear_cache(), RenderState::clear_cache(), RenderState::finalize(), RenderEffects::finalize(), RenderEffect::finalize(), RenderAttrib::finalize(), InternalName::finalize(), TransformState::get_num_unused_states(), RenderState::get_num_unused_states(), TransformState::list_cycles(), RenderState::list_cycles(), GeomVertexFormat::remove_column(), TransformState::unref(), RenderState::unref(), RenderState::~RenderState(), and TransformState::~TransformState().
CInterval::State CInterval::get_state | ( | ) | const [inline, inherited] |
Indicates the state the interval believes it is in: whether it has been started, is currently in the middle, or has been finalized.
Definition at line 61 of file cInterval.I.
Referenced by CInterval::finish(), CInterval::pause(), and CInterval::set_t().
double CInterval::get_t | ( | ) | const [inline, inherited] |
Returns the current time of the interval: the last value of t passed to priv_initialize(), priv_step(), or priv_finalize().
Definition at line 111 of file cInterval.I.
Referenced by CInterval::check_t_callback(), CInterval::pause(), and CInterval::setup_resume().
int TypedObject::get_type_index | ( | ) | const [inline, inherited] |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
This is equivalent to get_type().get_index().
Definition at line 52 of file typedObject.I.
References TypeHandle::get_index().
bool CInterval::get_wants_t_callback | ( | ) | const [inline, inherited] |
Returns the state of the 'wants_t_callback' flag.
Definition at line 191 of file cInterval.I.
Referenced by CInterval::check_t_callback().
WeakReferenceList * ReferenceCount::get_weak_list | ( | ) | const [inline, inherited] |
Returns the WeakReferenceList associated with this ReferenceCount object.
If there has never been a WeakReferenceList associated with this object, creates one now.
Definition at line 307 of file referenceCount.I.
Referenced by ReferenceCount::weak_ref().
bool ReferenceCount::has_weak_list | ( | ) | const [inline, inherited] |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
In general, this will be true if there was ever a WeakPointerTo created for this object (even if there is not any for it now).
Definition at line 294 of file referenceCount.I.
Referenced by ReferenceCount::weak_unref().
static void CMetaInterval::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from CInterval.
Definition at line 191 of file cMetaInterval.h.
References CInterval::init_type().
void CInterval::interval_done | ( | ) | [protected, inherited] |
Called internally whenever the interval reaches its final state.
Definition at line 763 of file cInterval.cxx.
References CIntervalManager::get_event_queue().
Referenced by CInterval::priv_finalize(), priv_finalize(), CInterval::priv_instant(), and priv_instant().
bool CMetaInterval::is_event_ready | ( | ) | [inline] |
Returns true if a recent call to priv_initialize(), priv_step(), or priv_finalize() has left some external intervals ready to play.
If this returns true, call get_event_index(), get_event_t(), and pop_event() to retrieve the relevant information.
Definition at line 107 of file cMetaInterval.I.
Referenced by CIntervalManager::get_next_event().
bool TypedObject::is_exact_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is the indicated type exactly.
Definition at line 74 of file typedObject.I.
References TypeHandle::get_name().
Referenced by GraphicsStateGuardian::async_reload_texture(), PortalNode::combine_with(), PandaNode::combine_with(), GeomNode::combine_with(), CollisionNode::combine_with(), Character::combine_with(), PGItem::cull_callback(), FactoryParams::get_param_of_type(), CollisionHandlerPusher::handle_entries(), SceneGraphReducer::r_flatten(), ConnectionWriter::send(), FltToEggLevelState::set_transform(), and VirtualFileSystem::unmount().
bool TypedObject::is_of_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is or derives from the indicated type.
Definition at line 63 of file typedObject.I.
References TypeHandle::is_derived_from().
Referenced by EggSliderData::add_back_pointer(), EggJointData::add_back_pointer(), CIntervalManager::add_c_interval(), XFileNode::add_child(), CollisionTraverser::add_collider(), CollisionHandlerPhysical::add_collider(), EggXfmSAnim::add_data(), CharacterJointBundle::add_node(), NonlinearImager::add_screen(), EggGroupNode::apply_first_attribute(), EggGroupNode::apply_last_attribute(), DeferredNodeProperty::apply_to_node(), RecorderController::begin_playback(), NodePath::clear_clip_plane(), EggGroupNode::clear_connected_shading(), NodePath::clear_light(), EggBase::convert_paths(), NodePath::decode_from_bam_stream(), VrpnClient::disconnect_device(), PhysicsManager::do_physics(), GraphicsStateGuardian::fetch_specified_part(), EggRenderState::fill_state(), AnimBundleNode::find_anim_bundle(), EggGroupNode::find_coordsys_entry(), XFile::find_data_object(), Character::find_joint(), EggGroupNode::find_materials(), Character::find_slider(), XFile::find_template(), EggGroupNode::find_textures(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggGroupNode::force_filenames(), EggJointData::force_initial_rest_frame(), WindowFramework::get_aspect_2d(), EggPoolUniquifier::get_category(), EggGroupUniquifier::get_category(), EggGroupNode::get_connected_shading(), PandaFramework::get_mouse(), FactoryParams::get_param_of_type(), EggGroupNode::has_absolute_pathnames(), NodePath::has_clip_plane(), NodePath::has_clip_plane_off(), NodePath::has_light(), PandaFramework::hide_collision_solids(), x11GraphicsWindow::open_window(), eglGraphicsWindow::open_window(), EggNode::parse_egg(), CharacterMaker::part_to_node(), EggGroupNode::post_apply_flat_attribute(), EggBinner::prepare_node(), PortalClipper::prepare_portal(), NodePath::project_texture(), EggMatrixTablePointer::quantize_channels(), ParametricCurveCollection::r_add_curves(), SceneGraphReducer::r_collect_vertex_data(), EggGroupNode::r_load_externals(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::remove_invalid_primitives(), EggGroupNode::remove_unused_vertices(), EggLoader::reparent_decals(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggGroupNode::resolve_filenames(), EggGroupNode::reverse_vertex_ordering(), NodePath::set_clip_plane(), NodePath::set_clip_plane_off(), NodePath::set_light(), ProjectionScreen::set_projector(), NonlinearImager::set_source_camera(), EggXfmSAnim::set_value(), NonlinearImager::set_viewer_camera(), PandaFramework::show_collision_solids(), BamCache::store(), XFileToEggConverter::strip_nodes(), EggGroupNode::strip_normals(), DataGraphTraverser::traverse(), DataGraphTraverser::traverse_below(), EggGroupNode::triangulate_polygons(), EggGroupNode::unify_attributes(), EggNameUniquifier::uniquify(), NodeCullCallbackData::upcall(), PhysicsCollisionHandler::validate_target(), EggXfmSAnim::write(), EggGroup::write(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_entities().
bool CInterval::is_playing | ( | ) | const [inherited] |
Returns true if the interval is currently playing, false otherwise.
Definition at line 282 of file cInterval.cxx.
References CIntervalManager::find_c_interval(), and CInterval::get_name().
Referenced by CInterval::set_play_rate(), and CInterval::set_t().
bool CInterval::is_stopped | ( | ) | const [inline, inherited] |
Returns true if the interval is in either its initial or final states (but not in a running or paused state).
Definition at line 73 of file cInterval.I.
Referenced by CInterval::step_play().
void ReferenceCount::local_object | ( | ) | [inline, inherited] |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
This allows the object to be passed to functions that will increment and decrement the object's reference count temporarily, and it will prevent the object from being deleted (inappropriately), when the reference count returns to zero. It actually achieves this by setting a large positive value in the reference count field.
Definition at line 276 of file referenceCount.I.
Referenced by PGTop::cull_callback(), BoundingSphere::extend_by_hexahedron(), AsyncTaskManager::find_task(), AsyncTaskManager::find_tasks(), and AsyncTaskManager::find_tasks_matching().
void CInterval::loop | ( | double | start_t = 0.0 , |
double | end_t = -1.0 , |
||
double | play_rate = 1.0 |
||
) | [inherited] |
Starts the interval playing by registering it with the current CIntervalManager.
The interval will play until it is interrupted with finish() or pause(), looping back to start_t when it reaches end_t.
If end_t is less than zero, it indicates the end of the interval.
Definition at line 169 of file cInterval.cxx.
References CIntervalManager::add_c_interval(), and CInterval::setup_play().
void CInterval::mark_dirty | ( | ) | [inherited] |
Called by a derived class to indicate the interval has been changed internally and must be recomputed before its duration may be returned.
Definition at line 746 of file cInterval.cxx.
Referenced by add_c_interval(), add_ext_index(), pop_level(), push_level(), set_interval_start_time(), and set_precision().
double CInterval::pause | ( | ) | [inherited] |
Stops the interval from playing but leaves it in its current state.
It may later be resumed from this point by calling resume().
Definition at line 182 of file cInterval.cxx.
References CIntervalManager::find_c_interval(), CInterval::get_name(), CInterval::get_state(), CInterval::get_t(), CInterval::priv_interrupt(), and CIntervalManager::remove_c_interval().
Referenced by CInterval::clear_to_initial(), and CInterval::set_play_rate().
void CMetaInterval::pop_event | ( | ) |
Acknowledges that the external interval on the top of the queue has been extracted, and is about to be serviced by the scripting language.
This prepares the interval so the next call to is_event_ready() will return information about the next external interval on the queue, if any.
Definition at line 725 of file cMetaInterval.cxx.
int CMetaInterval::pop_level | ( | double | duration = -1.0 | ) |
Finishes a level marked by a previous call to push_level(), and returns to the previous level.
If the duration is not negative, it represents a phony duration to assign to the level, for the purposes of sequencing later intervals. Otherwise, the level's duration is computed based on the intervals within the level.
Definition at line 210 of file cMetaInterval.cxx.
References CInterval::mark_dirty().
void CInterval::priv_do_event | ( | double | t, |
EventType | event | ||
) | [inherited] |
Calls the appropriate event function indicated by the EventType.
Definition at line 325 of file cInterval.cxx.
References CInterval::priv_finalize(), CInterval::priv_initialize(), CInterval::priv_instant(), CInterval::priv_interrupt(), CInterval::priv_reverse_finalize(), CInterval::priv_reverse_initialize(), CInterval::priv_reverse_instant(), and CInterval::priv_step().
void CMetaInterval::priv_finalize | ( | ) | [virtual] |
This is called when an interval is interrupted.
It should advance the time as if priv_step() were called, and also perform whatever cleanup might be required.
Reimplemented from CInterval.
Definition at line 519 of file cMetaInterval.cxx.
References CInterval::get_duration(), CInterval::interval_done(), and priv_initialize().
void CMetaInterval::priv_initialize | ( | double | t | ) | [virtual] |
This replaces the first call to priv_step(), and indicates that the interval has just begun.
This may be overridden by derived classes that need to do some explicit initialization on the first call.
Reimplemented from CInterval.
Definition at line 358 of file cMetaInterval.cxx.
References CInterval::check_stopped(), and CInterval::recompute().
Referenced by priv_finalize(), and priv_reverse_finalize().
void CMetaInterval::priv_instant | ( | ) | [virtual] |
This is called in lieu of priv_initialize() .
. priv_step() .. priv_finalize(), when everything is to happen within one frame. The interval should initialize itself, then leave itself in the final state.
Reimplemented from CInterval.
Definition at line 413 of file cMetaInterval.cxx.
References CInterval::check_stopped(), CInterval::get_duration(), CInterval::interval_done(), and CInterval::recompute().
void CMetaInterval::priv_interrupt | ( | ) | [virtual] |
This is called while the interval is playing to indicate that it is about to be interrupted; that is, priv_step() will not be called for a length of time.
But the interval should remain in its current state in anticipation of being eventually restarted when the calls to priv_step() eventually resume.
The purpose of this function is to allow self-running intervals like sound intervals to stop the actual sound playback during the pause.
Reimplemented from CInterval.
Definition at line 695 of file cMetaInterval.cxx.
void CMetaInterval::priv_reverse_finalize | ( | ) | [virtual] |
Called generally following a priv_reverse_initialize(), this indicates the interval should set itself to the initial state.
Reimplemented from CInterval.
Definition at line 653 of file cMetaInterval.cxx.
References priv_initialize().
void CMetaInterval::priv_reverse_initialize | ( | double | t | ) | [virtual] |
Similar to priv_initialize(), but this is called when the interval is being played backwards; it indicates that the interval should start at the finishing state and undo any intervening intervals.
Reimplemented from CInterval.
Definition at line 562 of file cMetaInterval.cxx.
References CInterval::check_stopped(), and CInterval::recompute().
void CMetaInterval::priv_reverse_instant | ( | ) | [virtual] |
This is called in lieu of priv_reverse_initialize()
. priv_step() .. priv_reverse_finalize(), when everything is to happen within one frame. The interval should initialize itself, then leave itself in the initial state.
Reimplemented from CInterval.
Definition at line 618 of file cMetaInterval.cxx.
References CInterval::check_stopped(), and CInterval::recompute().
void CMetaInterval::priv_step | ( | double | t | ) | [virtual] |
Advances the time on the interval.
The time may either increase (the normal case) or decrease (e.g. if the interval is being played by a slider).
Reimplemented from CInterval.
Definition at line 454 of file cMetaInterval.cxx.
References CInterval::check_started().
int CMetaInterval::push_level | ( | const string & | name, |
double | rel_time, | ||
RelativeStart | rel_to | ||
) |
Marks the beginning of a nested level of child intervals.
Within the nested level, a RelativeStart time of RS_level_begin refers to the start of the level, and the first interval added within the level is always relative to the start of the level.
The return value is the index of the def entry created by this push.
Definition at line 111 of file cMetaInterval.cxx.
References CInterval::mark_dirty().
void CInterval::recompute | ( | ) | const [inline, protected, inherited] |
Calls do_recompute() if the dirty flag has been set.
Definition at line 246 of file cInterval.I.
Referenced by CInterval::get_duration(), get_interval_end_time(), get_interval_start_time(), priv_initialize(), CLerpNodePathInterval::priv_initialize(), CInterval::priv_initialize(), priv_instant(), CLerpNodePathInterval::priv_instant(), CInterval::priv_instant(), priv_reverse_initialize(), CLerpNodePathInterval::priv_reverse_initialize(), CInterval::priv_reverse_initialize(), priv_reverse_instant(), CLerpNodePathInterval::priv_reverse_instant(), CInterval::priv_reverse_instant(), and timeline().
void ReferenceCount::ref | ( | ) | const [inline, inherited] |
Explicitly increments the reference count.
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
Definition at line 179 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by CachedTypedWritableReferenceCount::cache_ref(), TypedWritable::decode_raw_from_bam_stream(), NodeCachedReferenceCount::node_ref(), NodeReferenceCount::node_ref(), BamCacheRecord::set_data(), CullableObject::set_draw_callback(), and ModelRoot::set_reference().
void CInterval::resume | ( | ) | [inherited] |
Restarts the interval from its current point after a previous call to pause().
Definition at line 200 of file cInterval.cxx.
References CIntervalManager::add_c_interval(), and CInterval::setup_resume().
Referenced by CInterval::set_play_rate().
void CInterval::resume | ( | double | start_t | ) | [inherited] |
Restarts the interval from the indicated point after a previous call to pause().
Definition at line 212 of file cInterval.cxx.
References CIntervalManager::add_c_interval(), CInterval::set_t(), and CInterval::setup_resume().
void CInterval::resume_until | ( | double | end_t | ) | [inherited] |
Restarts the interval from the current point after a previous call to pause() (or a previous play-to-point-and-stop), to play until the indicated point and then stop.
Definition at line 227 of file cInterval.cxx.
References CIntervalManager::add_c_interval(), and CInterval::setup_resume_until().
void CInterval::set_auto_finish | ( | bool | auto_finish | ) | [inline, inherited] |
Changes the state of the 'auto_finish' flag.
If this is true, the interval may be arbitrarily finished when the system needs to reset due to some external event by calling CIntervalManager::interrupt(). If this is false (the default), the interval must always be explicitly finished or paused.
Definition at line 154 of file cInterval.I.
void CInterval::set_auto_pause | ( | bool | auto_pause | ) | [inline, inherited] |
Changes the state of the 'auto_pause' flag.
If this is true, the interval may be arbitrarily interrupted when the system needs to reset due to some external event by calling CIntervalManager::interrupt(). If this is false (the default), the interval must always be explicitly finished or paused.
Definition at line 127 of file cInterval.I.
void CInterval::set_done_event | ( | const string & | event | ) | [inline, inherited] |
Sets the event that is generated whenever the interval reaches its final state, whether it is explicitly finished or whether it gets there on its own.
Definition at line 86 of file cInterval.I.
bool CMetaInterval::set_interval_start_time | ( | const string & | name, |
double | rel_time, | ||
CMetaInterval::RelativeStart | rel_to = RS_level_begin |
||
) |
Adjusts the start time of the child interval with the given name, if found.
This may be either a C++ interval added via add_c_interval(), or an external interval added via add_ext_index(); the name must match exactly.
If the interval is found, its start time is adjusted, and all subsequent intervals are adjusting accordingly, and true is returned. If a matching interval is not found, nothing is changed and false is returned.
Definition at line 240 of file cMetaInterval.cxx.
References CInterval::mark_dirty().
void CInterval::set_manager | ( | CIntervalManager * | manager | ) | [inline, inherited] |
Indicates the CIntervalManager object which will be responsible for playing this interval.
This defaults to the global CIntervalManager; you should need to change this only if you have special requirements for playing this interval.
Definition at line 205 of file cInterval.I.
void CInterval::set_play_rate | ( | double | play_rate | ) | [inherited] |
Changes the play rate of the interval.
If the interval is already started, this changes its speed on-the-fly. Note that since play_rate is a parameter to start() and loop(), the next call to start() or loop() will reset this parameter.
Definition at line 308 of file cInterval.cxx.
References CInterval::is_playing(), CInterval::pause(), and CInterval::resume().
void CMetaInterval::set_precision | ( | double | precision | ) | [inline] |
Indicates the precision with which time measurements are compared.
For numerical accuracy, all floating-point time values are converted to integer values internally by scaling by the precision factor. The larger the number given here, the smaller the delta of time that can be differentiated; the limit is the maximum integer that can be represented in the system.
Definition at line 29 of file cMetaInterval.I.
References CInterval::mark_dirty().
void CInterval::set_t | ( | double | t | ) | [inherited] |
Explicitly sets the time within the interval.
Normally, you would use start() .. finish() to let the time play normally, but this may be used to set the time to some particular value.
Definition at line 95 of file cInterval.cxx.
References CInterval::get_state(), CInterval::is_playing(), CInterval::priv_initialize(), CInterval::priv_interrupt(), CInterval::priv_reverse_initialize(), CInterval::priv_step(), and CInterval::setup_resume().
Referenced by CInterval::resume().
void CInterval::set_wants_t_callback | ( | bool | wants_t_callback | ) | [inline, inherited] |
Changes the state of the 'wants_t_callback' flag.
If this is true, the interval will be returned by CIntervalManager::get_event() each time the interval's time value has been changed, regardless of whether it has any external events.
Definition at line 179 of file cInterval.I.
void CInterval::setup_play | ( | double | start_t, |
double | end_t, | ||
double | play_rate, | ||
bool | do_loop | ||
) | [inherited] |
Called to prepare the interval for automatic timed playback, e.g.
via a Python task. The interval will be played from start_t to end_t, at a time factor specified by play_rate. start_t must always be less than end_t (except for the exception for end_t == -1, below), but if play_rate is negative the interval will be played backwards.
Specify end_t of -1 to play the entire interval from start_t.
Call step_play() repeatedly to execute the interval.
Definition at line 538 of file cInterval.cxx.
References CInterval::get_duration(), ClockObject::get_frame_time(), and ClockObject::get_global_clock().
Referenced by CInterval::loop(), and CInterval::start().
void CInterval::setup_resume | ( | ) | [inherited] |
Called to prepare the interval for restarting at the current point within the interval after an interruption.
Definition at line 577 of file cInterval.cxx.
References ClockObject::get_frame_time(), ClockObject::get_global_clock(), and CInterval::get_t().
Referenced by CInterval::resume(), CInterval::set_t(), and CInterval::setup_resume_until().
void CInterval::setup_resume_until | ( | double | end_t | ) | [inherited] |
Called to prepare the interval for restarting from the current point after a previous call to pause() (or a previous play-to-point-and-stop), to play until the indicated point and then stop.
Definition at line 597 of file cInterval.cxx.
References CInterval::get_duration(), and CInterval::setup_resume().
Referenced by CInterval::resume_until().
void CInterval::start | ( | double | start_t = 0.0 , |
double | end_t = -1.0 , |
||
double | play_rate = 1.0 |
||
) | [inherited] |
Starts the interval playing by registering it with the current CIntervalManager.
The interval will play to the end and stop.
If end_t is less than zero, it indicates the end of the interval.
Definition at line 151 of file cInterval.cxx.
References CIntervalManager::add_c_interval(), and CInterval::setup_play().
bool CInterval::step_play | ( | ) | [inherited] |
Should be called once per frame to execute the automatic timed playback begun with setup_play().
Returns true if the interval should continue, false if it is done and should stop.
Definition at line 621 of file cInterval.cxx.
References CInterval::get_duration(), ClockObject::get_frame_time(), ClockObject::get_global_clock(), CInterval::get_open_ended(), CInterval::is_stopped(), CInterval::priv_finalize(), CInterval::priv_initialize(), CInterval::priv_instant(), CInterval::priv_interrupt(), CInterval::priv_reverse_finalize(), CInterval::priv_reverse_initialize(), CInterval::priv_reverse_instant(), and CInterval::priv_step().
bool ReferenceCount::test_ref_count_integrity | ( | ) | const [inline, inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Returns true if ok, false otherwise.
Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.
Definition at line 236 of file referenceCount.I.
References ReferenceCount::do_test_ref_count_integrity().
Referenced by EggGroupNode::add_child(), InternalName::find_ancestor(), InternalName::get_ancestor(), ReferenceCount::get_ref_count(), InternalName::get_top(), ReferenceCount::ref(), EggVertex::test_gref_integrity(), EggVertex::test_pref_integrity(), EggNode::test_under_integrity(), EggPrimitive::test_vref_integrity(), EggGroup::test_vref_integrity(), MouseWatcher::throw_event_pattern(), ReferenceCount::unref(), and EggNode::update_under().
bool ReferenceCount::test_ref_count_nonzero | ( | ) | const [inline, inherited] |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
Returns true if ok, false otherwise.
Definition at line 252 of file referenceCount.I.
References ReferenceCount::do_test_ref_count_nonzero().
Referenced by CopyOnWritePointer::test_ref_count_nonzero().
void CMetaInterval::timeline | ( | ostream & | out | ) | const |
Outputs a list of all events in the order in which they occur.
Definition at line 773 of file cMetaInterval.cxx.
References CInterval::recompute().
bool ReferenceCount::unref | ( | ) | const [inline, virtual, inherited] |
Explicitly decrements the reference count.
Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete().
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
The return value is true if the new reference count is nonzero, false if it is zero.
Reimplemented in GeomVertexArrayFormat, GeomVertexFormat, InternalName, RenderAttrib, RenderEffects, RenderState, and TransformState.
Definition at line 214 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by CachedTypedWritableReferenceCount::cache_unref(), TypedWritable::decode_raw_from_bam_stream(), RenderEffect::finalize(), NodeCachedReferenceCount::node_unref(), NodeReferenceCount::node_unref(), TransformState::unref(), RenderState::unref(), RenderEffects::unref(), RenderAttrib::unref(), InternalName::unref(), GeomVertexFormat::unref(), and GeomVertexArrayFormat::unref().
void ReferenceCount::weak_ref | ( | WeakPointerToVoid * | ptv | ) | [inline, inherited] |
Adds the indicated PointerToVoid as a weak reference to this object.
Definition at line 321 of file referenceCount.I.
References WeakReferenceList::add_reference(), and ReferenceCount::get_weak_list().
void ReferenceCount::weak_unref | ( | WeakPointerToVoid * | ptv | ) | [inline, inherited] |
Removes the indicated PointerToVoid as a weak reference to this object.
It must have previously been added via a call to weak_ref().
Definition at line 334 of file referenceCount.I.
References WeakReferenceList::clear_reference(), and ReferenceCount::has_weak_list().