Panda3D
modelFlattenRequest.I
1 // Filename: modelFlattenRequest.I
2 // Created by: drose (30Mar07)
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: ModelFlattenRequest::Constructor
18 // Access: Published
19 // Description: Create a new ModelFlattenRequest, and add it to the loader
20 // via load_async(), to begin an asynchronous load.
21 ////////////////////////////////////////////////////////////////////
24  AsyncTask(orig->get_name()),
25  _orig(orig),
26  _is_ready(false)
27 {
28 }
29 
30 ////////////////////////////////////////////////////////////////////
31 // Function: ModelFlattenRequest::get_orig
32 // Access: Published
33 // Description: Returns the original, unflattened node.
34 ////////////////////////////////////////////////////////////////////
36 get_orig() const {
37  return _orig;
38 }
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function: ModelFlattenRequest::is_ready
42 // Access: Published
43 // Description: Returns true if this request has completed, false if
44 // it is still pending. When this returns true, you may
45 // retrieve the model loaded by calling get_result().
46 ////////////////////////////////////////////////////////////////////
47 INLINE bool ModelFlattenRequest::
48 is_ready() const {
49  return _is_ready;
50 }
51 
52 ////////////////////////////////////////////////////////////////////
53 // Function: ModelFlattenRequest::get_model
54 // Access: Published
55 // Description: Returns the flattened copy of the model. It is an
56 // error to call this unless is_ready() returns true.
57 ////////////////////////////////////////////////////////////////////
59 get_model() const {
60  nassertr(_is_ready, NULL);
61  return _model;
62 }
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
ModelFlattenRequest(PandaNode *orig)
Create a new ModelFlattenRequest, and add it to the loader via load_async(), to begin an asynchronous...
PandaNode * get_orig() const
Returns the original, unflattened node.
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:43
PandaNode * get_model() const
Returns the flattened copy of the model.