Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions

# CMetaInterval Class Reference

Inheritance diagram for CMetaInterval:

List of all members.

## Public Types
enum | DefType { DTCInterval = 0, DTExtIndex = 1, DTPushLevel = 2, DTPopLevel = 3 }
enum | RelativeStart { RSPreviousEnd = 0, RSPreviousBegin = 1, RSLevelBegin = 2 }
## Public Member Functions
| CMetaInterval (string name)
int | addCInterval (CInterval c_interval)
| Adds a new CInterval to the list.
int | addCInterval (CInterval c_interval, double rel_time, RelativeStart rel_to)
| Adds a new CInterval to the list.
int | addCInterval (CInterval c_interval, double rel_time)
| Adds a new CInterval to the list.
int | addExtIndex (int ext_index, string name, double duration, bool open_ended, double rel_time, RelativeStart rel_to)
| Adds a new external interval to the list.
| clearIntervals ()
| Resets the list of intervals and prepares for receiving a new list.
CInterval | getCInterval (int n)
| Return the CInterval pointer associated with the nth interval definition.
DefType | getDefType (int n)
| Returns the type of the nth interval definition that has been added.
int | getEventIndex ()
| 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 | getEventT ()
| If a previous call to is_event_ready() returned true, this returns the t value that should be fed to the given interval.
EventType | getEventType ()
| 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 | getExtIndex (int n)
| Return the external interval index number associated with the nth interval definition.
double | getIntervalEndTime (string name)
| 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 | getIntervalStartTime (string name)
| 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.
int | getNumDefs ()
| Returns the number of interval and push/pop definitions that have been added to the meta interval.
double | getPrecision ()
| Returns the precision with which time measurements are compared.
bool | isEventReady ()
| Returns true if a recent call to priv_initialize(), priv_step(), or priv_finalize() has left some external intervals ready to play.
| popEvent ()
| 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 | popLevel (double duration)
| Finishes a level marked by a previous call to push_level(), and returns to the previous level.
int | popLevel ()
| Finishes a level marked by a previous call to push_level(), and returns to the previous level.
int | pushLevel (string name, double rel_time, RelativeStart rel_to)
| Marks the beginning of a nested level of child intervals.
bool | setIntervalStartTime (string name, double rel_time, RelativeStart rel_to)
| Adjusts the start time of the child interval with the given name, if found.
bool | setIntervalStartTime (string name, double rel_time)
| Adjusts the start time of the child interval with the given name, if found.
| setPrecision (double precision)
| Indicates the precision with which time measurements are compared.
| timeline (ostream out)
| Outputs a list of all events in the order in which they occur.
## Static Public Member Functions
static TypeHandle | getClassType ()

## Member Enumeration Documentation

enum DefType

Enumerator:

  DTCInterval |
  DTExtIndex |
  DTPushLevel |
  DTPopLevel |

enum RelativeStart

Enumerator:

  RSPreviousEnd |
  RSPreviousBegin |
  RSLevelBegin |

## Constructor & Destructor Documentation

CMetaInterval | ( | string | name | ) |

## Member Function Documentation

int addCInterval | ( | CInterval | c_interval,
|  | double | rel_time,
|  | RelativeStart | rel_to
| ) |  |

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.

int addCInterval | ( | CInterval | c_interval,
|  | double | rel_time
| ) |  |

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.

int addCInterval | ( | CInterval | c_interval | ) |

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.

int addExtIndex | ( | int | ext_index,
|  | 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.

clearIntervals | ( |  | ) |

Resets the list of intervals and prepares for receiving a new list.

CInterval getCInterval | ( | int | n | ) |

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.

static TypeHandle getClassType | ( |  | ) | `[static]`

Reimplemented from CInterval.

DefType getDefType | ( | int | n | ) |

Returns the type of the nth interval definition that has been added.

int getEventIndex | ( |  | ) |

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 getEventT | ( |  | ) |

If a previous call to is_event_ready() returned true, this returns the t value that should be fed to the given interval.

EventType getEventType | ( |  | ) |

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 getExtIndex | ( | int | n | ) |

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.

double getIntervalEndTime | ( | string | name | ) |

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 getIntervalStartTime | ( | string | name | ) |

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.

int getNumDefs | ( |  | ) |

Returns the number of interval and push/pop definitions that have been added to the meta interval.

double getPrecision | ( |  | ) |

Returns the precision with which time measurements are compared.

See set_precision().

bool isEventReady | ( |  | ) |

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.

popEvent | ( |  | ) |

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.

int popLevel | ( |  | ) |

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.

int popLevel | ( | double | duration | ) |

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.

int pushLevel | ( | 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.

bool setIntervalStartTime | ( | string | name,
|  | double | rel_time,
|  | RelativeStart | rel_to
| ) |  |

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.

bool setIntervalStartTime | ( | string | name,
|  | double | rel_time
| ) |  |

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.

setPrecision | ( | double | precision | ) |

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.

timeline | ( | ostream | out | ) |

Outputs a list of all events in the order in which they occur.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties