Panda3D
animateVerticesRequest.h
1 // Filename: animateVerticesRequest.h
2 // Created by: pratt (20Nov07)
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 ANIMATEVERTICESREQUEST
16 #define ANIMATEVERTICESREQUEST
17 
18 #include "pandabase.h"
19 
20 #include "asyncTask.h"
21 #include "geomVertexData.h"
22 #include "pointerTo.h"
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : AnimateVerticesRequest
26 // Description : This class object manages a single asynchronous
27 // request to animate vertices on a GeomVertexData
28 // object. animate_vertices will be called with
29 // force=true (i.e. blocking) in a sub-thread (if
30 // threading is available). No result is stored or
31 // returned from this object. It is expected that the
32 // result will be cached and available for immediate
33 // use later during rendering. Thus it is important
34 // that the main thread block while these requests
35 // are being run (presumably on multiple CPUs/cores),
36 // to ensure that the data has been computed by the
37 // time it's needed.
38 ////////////////////////////////////////////////////////////////////
39 class EXPCL_PANDA_PGRAPH AnimateVerticesRequest : public AsyncTask {
40 public:
41  ALLOC_DELETED_CHAIN(AnimateVerticesRequest);
42 
43 PUBLISHED:
44  INLINE AnimateVerticesRequest(GeomVertexData *geom_vertex_data);
45 
46  INLINE bool is_ready() const;
47 
48 protected:
49  virtual AsyncTask::DoneStatus do_task();
50 
51 private:
52  PT(GeomVertexData) _geom_vertex_data;
53  bool _is_ready;
54 
55 public:
56  static TypeHandle get_class_type() {
57  return _type_handle;
58  }
59  static void init_type() {
60  AsyncTask::init_type();
61  register_type(_type_handle, "AnimateVerticesRequest",
62  AsyncTask::get_class_type());
63  }
64  virtual TypeHandle get_type() const {
65  return get_class_type();
66  }
67  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
68 
69 private:
70  static TypeHandle _type_handle;
71 };
72 
73 #include "animateVerticesRequest.I"
74 
75 #endif
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
This class represents a concrete task performed by an AsyncManager.
Definition: asyncTask.h:43
This class object manages a single asynchronous request to animate vertices on a GeomVertexData objec...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85