Panda3D
modelLoadRequest.I
1 // Filename: modelLoadRequest.I
2 // Created by: drose (29Aug06)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: ModelLoadRequest::get_filename
18 // Access: Published
19 // Description: Returns the filename associated with this
20 // asynchronous ModelLoadRequest.
21 ////////////////////////////////////////////////////////////////////
22 INLINE const Filename &ModelLoadRequest::
23 get_filename() const {
24  return _filename;
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: ModelLoadRequest::get_options
29 // Access: Published
30 // Description: Returns the LoaderOptions associated with this
31 // asynchronous ModelLoadRequest.
32 ////////////////////////////////////////////////////////////////////
34 get_options() const {
35  return _options;
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: ModelLoadRequest::get_loader
40 // Access: Published
41 // Description: Returns the Loader object associated with this
42 // asynchronous ModelLoadRequest.
43 ////////////////////////////////////////////////////////////////////
45 get_loader() const {
46  return _loader;
47 }
48 
49 ////////////////////////////////////////////////////////////////////
50 // Function: ModelLoadRequest::is_ready
51 // Access: Published
52 // Description: Returns true if this request has completed, false if
53 // it is still pending. When this returns true, you may
54 // retrieve the model loaded by calling get_model().
55 ////////////////////////////////////////////////////////////////////
56 INLINE bool ModelLoadRequest::
57 is_ready() const {
58  return _is_ready;
59 }
60 
61 ////////////////////////////////////////////////////////////////////
62 // Function: ModelLoadRequest::get_model
63 // Access: Published
64 // Description: Returns the model that was loaded asynchronously, if
65 // any, or NULL if there was an error. It is an error
66 // to call this unless is_ready() returns true.
67 ////////////////////////////////////////////////////////////////////
69 get_model() const {
70  nassertr(_is_ready, NULL);
71  return _model;
72 }
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
bool is_ready() const
Returns true if this request has completed, false if it is still pending.
Specifies parameters that may be passed to the loader.
Definition: loaderOptions.h:26
A convenient class for loading models from disk, in bam or egg format (or any of a number of other fo...
Definition: loader.h:47
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
PandaNode * get_model() const
Returns the model that was loaded asynchronously, if any, or NULL if there was an error...
const Filename & get_filename() const
Returns the filename associated with this asynchronous ModelLoadRequest.
const LoaderOptions & get_options() const
Returns the LoaderOptions associated with this asynchronous ModelLoadRequest.
Loader * get_loader() const
Returns the Loader object associated with this asynchronous ModelLoadRequest.