Panda3D
modelFlattenRequest.h
1 // Filename: modelFlattenRequest.h
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 #ifndef MODELFLATTENREQUEST
16 #define MODELFLATTENREQUEST
17 
18 #include "pandabase.h"
19 
20 #include "asyncTask.h"
21 #include "pandaNode.h"
22 #include "pointerTo.h"
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : ModelFlattenRequest
26 // Description : This class object manages a single asynchronous
27 // request to flatten a model. The model will be
28 // duplicated and flattened in a sub-thread (if
29 // threading is available), without affecting the
30 // original model; and when the result is done it may be
31 // retrieved from this object.
32 ////////////////////////////////////////////////////////////////////
33 class EXPCL_PANDA_PGRAPH ModelFlattenRequest : public AsyncTask {
34 public:
35  ALLOC_DELETED_CHAIN(ModelFlattenRequest);
36 
37 PUBLISHED:
38  INLINE ModelFlattenRequest(PandaNode *orig);
39 
40  INLINE PandaNode *get_orig() const;
41 
42  INLINE bool is_ready() const;
43  INLINE PandaNode *get_model() const;
44 
45 protected:
46  virtual DoneStatus do_task();
47 
48 private:
49  PT(PandaNode) _orig;
50  bool _is_ready;
51  PT(PandaNode) _model;
52 
53 public:
54  static TypeHandle get_class_type() {
55  return _type_handle;
56  }
57  static void init_type() {
58  AsyncTask::init_type();
59  register_type(_type_handle, "ModelFlattenRequest",
60  AsyncTask::get_class_type());
61  }
62  virtual TypeHandle get_type() const {
63  return get_class_type();
64  }
65  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
66 
67 private:
68  static TypeHandle _type_handle;
69 };
70 
71 #include "modelFlattenRequest.I"
72 
73 #endif
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:72
This class represents a concrete task performed by an AsyncManager.
Definition: asyncTask.h:43
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85