Panda3D

Loading...
Searching...
No Matches
modelLoadRequest.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 modelLoadRequest.I
10 * @author drose
11 * @date 2006-08-29
12 */
13
14/**
15 * Returns the filename associated with this asynchronous ModelLoadRequest.
16 */
17INLINE const Filename &ModelLoadRequest::
18 get_filename() const {
19 return _filename;
20}
21
22/**
23 * Returns the LoaderOptions associated with this asynchronous
24 * ModelLoadRequest.
25 */
26INLINE const LoaderOptions &ModelLoadRequest::
27 get_options() const {
28 return _options;
29}
30
31/**
32 * Returns the Loader object associated with this asynchronous
33 * ModelLoadRequest.
34 */
35INLINE Loader *ModelLoadRequest::
36 get_loader() const {
37 return _loader;
38}
39
40/**
41 * Returns true if this request has completed, false if it is still pending or
42 * if it has been cancelled. When this returns true, you may retrieve the
43 * model loaded by calling get_model().
44 * Equivalent to `req.done() and not req.cancelled()`.
45 * @see done()
46 */
47INLINE bool ModelLoadRequest::
48 is_ready() const {
49 return (FutureState)AtomicAdjust::get(_future_state) == FS_finished;
50}
51
52/**
53 * Returns the model that was loaded asynchronously, if any, or null if there
54 * was an error. It is an error to call this unless done() returns true.
55 * @deprecated Use result() instead.
56 */
57INLINE PandaNode *ModelLoadRequest::
58 get_model() const {
59 nassertr_always(done(), nullptr);
60 return (PandaNode *)_result;
61}
AsyncFuture::done
bool done() const
Returns true if the future is done or has been cancelled.
Definition asyncFuture.I:29
AtomicAdjustDummyImpl::get
static Integer get(const Integer &var)
Atomically retrieves the snapshot value of the indicated variable.
Definition atomicAdjustDummyImpl.I:59
Filename
The name of a file, such as a texture file or an Egg file.
Definition filename.h:44
LoaderOptions
Specifies parameters that may be passed to the loader.
Definition loaderOptions.h:23
Loader
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
ModelLoadRequest::get_model
PandaNode * get_model() const
Returns the model that was loaded asynchronously, if any, or null if there was an error.
Definition modelLoadRequest.I:58
ModelLoadRequest::get_filename
get_filename
Returns the filename associated with this asynchronous ModelLoadRequest.
Definition modelLoadRequest.h:49
ModelLoadRequest::get_loader
get_loader
Returns the Loader object associated with this asynchronous ModelLoadRequest.
Definition modelLoadRequest.h:51
ModelLoadRequest::get_options
get_options
Returns the LoaderOptions associated with this asynchronous ModelLoadRequest.
Definition modelLoadRequest.h:50
ModelLoadRequest::is_ready
bool is_ready() const
Returns true if this request has completed, false if it is still pending or if it has been cancelled.
Definition modelLoadRequest.I:48
PandaNode
A basic node of the scene graph or data graph.
Definition pandaNode.h:65