Panda3D
modelFlattenRequest.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file modelFlattenRequest.I
10  * @author drose
11  * @date 2007-03-30
12  */
13 
14 /**
15  * Create a new ModelFlattenRequest, and add it to the loader via
16  * load_async(), to begin an asynchronous load.
17  */
20  AsyncTask(orig->get_name()),
21  _orig(orig)
22 {
23 }
24 
25 /**
26  * Returns the original, unflattened node.
27  */
28 INLINE PandaNode *ModelFlattenRequest::
29 get_orig() const {
30  return _orig;
31 }
32 
33 /**
34  * Returns true if this request has completed, false if it is still pending.
35  * When this returns true, you may retrieve the model loaded by calling
36  * result().
37  * Equivalent to `req.done() and not req.cancelled()`.
38  * @see done()
39  */
40 INLINE bool ModelFlattenRequest::
41 is_ready() const {
42  return (FutureState)AtomicAdjust::get(_future_state) == FS_finished;
43 }
44 
45 /**
46  * Returns the flattened copy of the model. It is an error to call this
47  * unless done() returns true.
48  * @deprecated Use result() instead.
49  */
51 get_model() const {
52  nassertr_always(done(), nullptr);
53  return (PandaNode *)_result;
54 }
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
ModelFlattenRequest(PandaNode *orig)
Create a new ModelFlattenRequest, and add it to the loader via load_async(), to begin an asynchronous...
bool done() const
Returns true if the future is done or has been cancelled.
Definition: asyncFuture.I:29
static Integer get(const Integer &var)
Atomically retrieves the snapshot value of the indicated variable.
bool is_ready() const
Returns true if this request has completed, false if it is still pending.
This class represents a concrete task performed by an AsyncManager.
Definition: asyncTask.h:32
PandaNode * get_model() const
Returns the flattened copy of the model.