Panda3D
modelSaveRequest.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 modelSaveRequest.I
10  * @author drose
11  * @date 2012-12-19
12  */
13 
14 /**
15  * Returns the filename associated with this asynchronous ModelSaveRequest.
16  */
17 INLINE const Filename &ModelSaveRequest::
18 get_filename() const {
19  return _filename;
20 }
21 
22 /**
23  * Returns the LoaderOptions associated with this asynchronous
24  * ModelSaveRequest.
25  */
26 INLINE const LoaderOptions &ModelSaveRequest::
27 get_options() const {
28  return _options;
29 }
30 
31 /**
32  * Returns the node that was passed to the constructor.
33  */
34 INLINE PandaNode *ModelSaveRequest::
35 get_node() const {
36  return _node;
37 }
38 
39 /**
40  * Returns the Loader object associated with this asynchronous
41  * ModelSaveRequest.
42  */
43 INLINE Loader *ModelSaveRequest::
44 get_loader() const {
45  return _loader;
46 }
47 
48 /**
49  * Returns true if this request has completed, false if it is still pending.
50  * When this returns true, you may retrieve the success flag with
51  * get_success().
52  * Equivalent to `req.done() and not req.cancelled()`.
53  * @see done()
54  */
55 INLINE bool ModelSaveRequest::
56 is_ready() const {
57  return (FutureState)AtomicAdjust::get(_future_state) == FS_finished;
58 }
59 
60 /**
61  * Returns the true if the model was saved successfully, false otherwise. It
62  * is an error to call this unless done() returns true.
63  */
64 INLINE bool ModelSaveRequest::
65 get_success() const {
66  nassertr_always(done(), false);
67  return _success;
68 }
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
Specifies parameters that may be passed to the loader.
Definition: loaderOptions.h:23
A convenient class for loading models from disk, in bam or egg format (or any of a number of other fo...
Definition: loader.h:42
bool done() const
Returns true if the future is done or has been cancelled.
Definition: asyncFuture.I:29
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:39
static Integer get(const Integer &var)
Atomically retrieves the snapshot value of the indicated variable.
bool get_success() const
Returns the true if the model was saved successfully, false otherwise.
bool is_ready() const
Returns true if this request has completed, false if it is still pending.