Panda3D
modelFlattenRequest.h
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.h
10  * @author drose
11  * @date 2007-03-30
12  */
13 
14 #ifndef MODELFLATTENREQUEST
15 #define MODELFLATTENREQUEST
16 
17 #include "pandabase.h"
18 
19 #include "asyncTask.h"
20 #include "pandaNode.h"
21 #include "pointerTo.h"
22 #include "nodePath.h"
23 
24 /**
25  * This class object manages a single asynchronous request to flatten a model.
26  * The model will be duplicated and flattened in a sub-thread (if threading is
27  * available), without affecting the original model; and when the result is
28  * done it may be retrieved from this object.
29  */
30 class EXPCL_PANDA_PGRAPH ModelFlattenRequest : public AsyncTask {
31 public:
32  ALLOC_DELETED_CHAIN(ModelFlattenRequest);
33 
34 PUBLISHED:
35  INLINE explicit ModelFlattenRequest(PandaNode *orig);
36 
37  INLINE PandaNode *get_orig() const;
38 
39  INLINE bool is_ready() const;
40  INLINE PandaNode *get_model() const;
41 
42  MAKE_PROPERTY(orig, get_orig);
43 
44 protected:
45  virtual DoneStatus do_task();
46 
47 private:
48  PT(PandaNode) _orig;
49 
50 public:
51  static TypeHandle get_class_type() {
52  return _type_handle;
53  }
54  static void init_type() {
55  AsyncTask::init_type();
56  register_type(_type_handle, "ModelFlattenRequest",
57  AsyncTask::get_class_type());
58  }
59  virtual TypeHandle get_type() const {
60  return get_class_type();
61  }
62  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
63 
64 private:
65  static TypeHandle _type_handle;
66 };
67 
68 #include "modelFlattenRequest.I"
69 
70 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class object manages a single asynchronous request to flatten a model.
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class represents a concrete task performed by an AsyncManager.
Definition: asyncTask.h:32
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81