# ModelFlattenRequest

from pandac.PandaModules import ModelFlattenRequest

Class : ModelFlattenRequest
Description : This class object manages a single asynchronous request to flatten a model. The model will be duplicated and flattened in a sub-thread (if threading is available), without affecting the original model; and when the result is done it may be retrieved from this object.

## Inheritance:

ModelFlattenRequest: AsyncTask
AsyncTask: TypedReferenceCount Namable
TypedReferenceCount: TypedObject ReferenceCount
TypedObject: MemoryBase
MemoryBase:
ReferenceCount: MemoryBase
Namable:

## Methods of ModelFlattenRequest:

ModelFlattenRequest (Constructor)
getClassType
getModel
getOrig
isReady

## Methods of AsyncTask:

clearDelay
clearName
getAverageDt
getClassType
getDelay
getDoneEvent
getDt
getElapsedFrames
getElapsedTime
getManager
getMaxDt
getNamePrefix
getPriority
getPythonObject
getSort
getStartFrame
getStartTime
getState
getTaskChain
getTaskId
getWakeTime
hasDelay
isAlive
output
recalcWakeTime
remove
setDelay
setDoneEvent
setName
setPriority
setPythonObject
setSort
setTaskChain

## Methods of TypedReferenceCount:

getClassType

## Methods of TypedObject:

getClassType
getType
getTypeIndex
isExactType
isOfType

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
testRefCountNonzero
unref

## Methods of Namable:

Namable (Constructor)
clearName
getClassType
getName
hasName
operator =
output
setName

## Constants in AsyncTask:

DSDone | (DoneStatus)
DSCont | (DoneStatus)
DSAgain | (DoneStatus)
DSPickup | (DoneStatus)
DSExit | (DoneStatus)
DSPause | (DoneStatus)
DSInterrupt | (DoneStatus)
SInactive | (State)
SActive | (State)
SServicing | (State)
SServicingRemoved | (State)
SSleeping | (State)
SActiveNested | (State)

ModelFlattenRequest ModelFlattenRequest::ModelFlattenRequest(PandaNode *orig); Description: Create a new ModelFlattenRequest, and add it to the loader via load_async(), to begin an asynchronous load.

getClassType static TypeHandle ModelFlattenRequest::get_class_type(void); Undocumented function.

getModel PandaNode *ModelFlattenRequest::get_model(void) const; Description: Returns the flattened copy of the model. It is an error to call this unless is_ready() returns true.

getOrig PandaNode *ModelFlattenRequest::get_orig(void) const; Description: Returns the original, unflattened node.

isReady bool ModelFlattenRequest::is_ready(void) const; Description: Returns true if this request has completed, false if it is still pending. When this returns true, you may retrieve the model loaded by calling get_result().

clearDelay void AsyncTask::clear_delay(void); Description: Removes any delay specified for the task. The next time the task is added to the queue, it will run immediately. This does not affect the task's wake time if it has already been added to the queue.

clearName void AsyncTask::clear_name(void); Description: Resets the task's name to empty.

getAverageDt double AsyncTask::get_average_dt(void) const; Description: Returns the average amount of time elapsed during each of the task's previous run cycles, in seconds.

getClassType static TypeHandle AsyncTask::get_class_type(void); Undocumented function.

getDelay double AsyncTask::get_delay(void) const; Description: Returns the delay value that has been set via set_delay, if any.

getDoneEvent string const &AsyncTask::get_done_event(void) const; Description: Returns the event name that will be triggered when the task finishes. See set_done_event().

getDt double AsyncTask::get_dt(void) const; HAVE_PYTHON Description: Returns the amount of time elapsed during the task's previous run cycle, in seconds.

getElapsedFrames int AsyncTask::get_elapsed_frames(void) const; Description: Returns the number of frames that have elapsed since the task was started, according to the task manager's clock. It is only valid to call this if the task's status is not S_inactive.

getElapsedTime double AsyncTask::get_elapsed_time(void) const; Description: Returns the amount of time that has elapsed since the task was started, according to the task manager's clock. It is only valid to call this if the task's status is not S_inactive.

getManager AsyncTaskManager *AsyncTask::get_manager(void) const; Description: Returns the AsyncTaskManager that this task is active on. This will be NULL if the state is S_inactive.

getMaxDt double AsyncTask::get_max_dt(void) const; Description: Returns the maximum amount of time elapsed during any one of the task's previous run cycles, in seconds.

getNamePrefix string AsyncTask::get_name_prefix(void) const; Description: Returns the initial part of the name, up to but not including any trailing digits following a hyphen or underscore.

getPriority int AsyncTask::get_priority(void) const; Description: Returns the task's current priority value. See set_priority().

getPythonObject PyObject *AsyncTask::get_python_object(void) const; Description: Returns the Python object that was specified to set_python_object(), if any, or None if no object was specified.

getSort int AsyncTask::get_sort(void) const; Description: Returns the task's current sort value. See set_sort().

getStartFrame int AsyncTask::get_start_frame(void) const; Description: Returns the frame number at which the task was started, according to the task manager's clock. It is only valid to call this if the task's status is not S_inactive.

getStartTime double AsyncTask::get_start_time(void) const; Description: Returns the time at which the task was started, according to the task manager's clock. It is only valid to call this if the task's status is not S_inactive.

getState AsyncTask::State AsyncTask::get_state(void) const; Description: Returns the current state of the task.

getTaskChain string const &AsyncTask::get_task_chain(void) const; Description: Returns the AsyncTaskChain on which this task will be running. Each task chain runs tasks independently of the others.

getTaskId long int AsyncTask::get_task_id(void) const; Description: Returns a number guaranteed to be unique for each different AsyncTask object in the universe.

getWakeTime double AsyncTask::get_wake_time(void) const; Description: If this task has been added to an AsyncTaskManager with a delay in effect, this returns the time at which the task is expected to awaken. It has no meaning if the task has not yet been added to a queue, or if there was no delay in effect at the time the task was added. If the task's status is not S_sleeping, this returns 0.0.

hasDelay bool AsyncTask::has_delay(void) const; Description: Returns true if a delay has been set for this task via set_delay(), or false otherwise.

isAlive bool AsyncTask::is_alive(void) const; Description: Returns true if the task is currently active or sleeping on some task chain, meaning that it will be executed in its turn, or false if it is not active. If the task has recently been removed while it is in the middle of execution, this will return false, because the task will not run again once it finishes.

output virtual void AsyncTask::output(ostream &out) const; Description:

recalcWakeTime void AsyncTask::recalc_wake_time(void); Description: If the task is currently sleeping on a task chain, this resets its wake time to the current time + get_delay(). It is as if the task had suddenly returned DS_again. The task will sleep for its current delay seconds before running again. This method may therefore be used to make the task wake up sooner or later than it would have otherwise. If the task is not already sleeping, this method has no effect.

remove void AsyncTask::remove(void); Description: Removes the task from its active manager, if any, and makes the state S_inactive (or possible S_servicing_removed). This is a no-op if the state is already S_inactive.

setDelay void AsyncTask::set_delay(double delay); Description: Specifies the amount of time, in seconds, by which this task will be delayed after it has been added to the AsyncTaskManager. At least the specified amount of time (and possibly more) will elapse before the task begins. You may specify a delay of 0.0 to guarantee that the task will run in the next epoch following the one in which it is added. Setting this value after the task has already been added will not affect the task's wake time; it will only affect the task if it is re-added to the queue in the future, for instance if the task returns DS_again. Howver, see recalc_wake_time() if you wish to apply the delay effect immediately.

setDoneEvent void AsyncTask::set_done_event(string const &done_event); Description: Sets the event name that will be triggered when the task finishes. This should only be called before the task has been started, or after it has finished and before it is about to be restarted (i.e. when get_state() returns S_inactive).

setName void AsyncTask::set_name(string const &name); Description:

setPriority void AsyncTask::set_priority(int priority); Description: Specifies a priority value for this task. In general, tasks with a higher priority value are executed before tasks with a lower priority value (but only for tasks with the same sort value). Unlike the sort value, tasks with different priorities may execute at the same time, if the AsyncTaskManager has more than one thread servicing tasks. Also see AsyncTaskChain::set_timeslice_priority(), which changes the meaning of this value. In the default mode, when the timeslice_priority flag is false, all tasks always run once per epoch, regardless of their priority values (that is, the priority controls the order of the task execution only, not the number of times it runs). On the other hand, if you set the timeslice_priority flag to true, then changing a task's priority has an effect on the number of times it runs.

setPythonObject void AsyncTask::set_python_object(PyObject *python_object); Description: Specifies an arbitrary Python object that will be piggybacked on the task object.

setSort void AsyncTask::set_sort(int sort); Description: Specifies a sort value for this task. Within a given AsyncTaskManager, all of the tasks with a given sort value are guaranteed to be completed before any tasks with a higher sort value are begun. To put it another way, two tasks might execute in parallel with each other only if they both have the same sort value. Tasks with a lower sort value are executed first. This is different from the priority, which makes no such exclusion guarantees.

setTaskChain void AsyncTask::set_task_chain(string const &chain_name); Description: Specifies the AsyncTaskChain on which this task will be running. Each task chain runs tasks independently of the others.

getClassType static TypeHandle TypedReferenceCount::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedObject::get_class_type(void); Undocumented function.

getType virtual TypeHandle TypedObject::get_type(void) const = 0; Derived classes should override this function to return get_class_type().

getTypeIndex int TypedObject::get_type_index(void) const; Description: 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().

isExactType bool TypedObject::is_exact_type(TypeHandle handle) const; Description: Returns true if the current object is the indicated type exactly.

isOfType bool TypedObject::is_of_type(TypeHandle handle) const; Description: Returns true if the current object is or derives from the indicated type.

getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function.

getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count.

ref void ReferenceCount::ref(void) const; Description: 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.

testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

testRefCountNonzero bool ReferenceCount::test_ref_count_nonzero(void) const; Description: Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise.

unref bool ReferenceCount::unref(void) const; Description: 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; plus, we don't have a virtual destructor anyway.) 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.

Namable Namable::Namable(string const &initial_name = ("")); Description:

clearName void Namable::clear_name(void); Description: Resets the Namable's name to empty.

getClassType static TypeHandle Namable::get_class_type(void); Undocumented function.

getName string const &Namable::get_name(void) const; Description:

hasName bool Namable::has_name(void) const; Description: Returns true if the Namable has a nonempty name set, false if the name is empty.

operator = Namable &Namable::operator =(Namable const &other); Description:

output void Namable::output(ostream &out) const; In the absence of any definition to the contrary, outputting a Namable will write out its name. Description: Outputs the Namable. This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.

setName void Namable::set_name(string const &name); Description: