Panda3D
 All Classes Functions Variables Enumerations
vertexSlider.h
1 // Filename: vertexSlider.h
2 // Created by: drose (28Mar05)
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 VERTEXSLIDER_H
16 #define VERTEXSLIDER_H
17 
18 #include "pandabase.h"
19 #include "typedWritableReferenceCount.h"
20 #include "internalName.h"
21 #include "updateSeq.h"
22 #include "pset.h"
23 #include "cycleData.h"
24 #include "cycleDataReader.h"
25 #include "cycleDataWriter.h"
26 #include "pipelineCycler.h"
27 
28 class SliderTable;
29 
30 ////////////////////////////////////////////////////////////////////
31 // Class : VertexSlider
32 // Description : This is an abstract base class that retains some
33 // slider value, which is a linear value that typically
34 // ranges from 0.0 to 1.0, and is used to control the
35 // animation of morphs (blend shapes).
36 //
37 // It is similar to VertexTransform, which keeps a full
38 // 4x4 transform matrix, but the VertexSlider only keeps
39 // a single float value.
40 ////////////////////////////////////////////////////////////////////
41 class EXPCL_PANDA_GOBJ VertexSlider : public TypedWritableReferenceCount {
42 PUBLISHED:
43  VertexSlider(const InternalName *name);
44  virtual ~VertexSlider();
45 
46  INLINE const InternalName *get_name() const;
47 
48  virtual PN_stdfloat get_slider() const=0;
49  INLINE UpdateSeq get_modified(Thread *current_thread) const;
50 
51  virtual void output(ostream &out) const;
52  virtual void write(ostream &out, int indent_level) const;
53 
54 protected:
55  void mark_modified(Thread *current_thread);
56 
57 protected:
58  CPT(InternalName) _name;
59 
60 private:
62  Tables _tables;
63 
64  // This is the data that must be cycled between pipeline stages.
65  class EXPCL_PANDA_GOBJ CData : public CycleData {
66  public:
67  INLINE CData();
68  INLINE CData(const CData &copy);
69  virtual CycleData *make_copy() const;
70  virtual void write_datagram(BamWriter *manager, Datagram &dg) const;
71  virtual int complete_pointers(TypedWritable **plist, BamReader *manager);
72  virtual void fillin(DatagramIterator &scan, BamReader *manager);
73  virtual TypeHandle get_parent_type() const {
74  return VertexSlider::get_class_type();
75  }
76 
77  UpdateSeq _modified;
78  };
79 
80  PipelineCycler<CData> _cycler;
83 
84 public:
85  virtual void write_datagram(BamWriter *manager, Datagram &dg);
86 
87 protected:
88  void fillin(DatagramIterator &scan, BamReader *manager);
89 
90 public:
91  static TypeHandle get_class_type() {
92  return _type_handle;
93  }
94  static void init_type() {
95  TypedWritableReferenceCount::init_type();
96  register_type(_type_handle, "VertexSlider",
97  TypedWritableReferenceCount::get_class_type());
98  }
99  virtual TypeHandle get_type() const {
100  return get_class_type();
101  }
102  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
103 
104 private:
105  static TypeHandle _type_handle;
106 
107  friend class SliderTable;
108 };
109 
110 INLINE ostream &operator << (ostream &out, const VertexSlider &obj);
111 
112 #include "vertexSlider.I"
113 
114 #endif
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
A single page of data maintained by a PipelineCycler.
Definition: cycleData.h:50
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
This is an abstract base class that retains some slider value, which is a linear value that typically...
Definition: vertexSlider.h:41
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:73
This is our own Panda specialization on the default STL list.
Definition: plist.h:38
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
Stores the total set of VertexSliders that the vertices in a particular GeomVertexData object might d...
Definition: sliderTable.h:42
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
A base class for things which need to inherit from both TypedWritable and from ReferenceCount.
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class&#39;s make_from_bam() method to read in all...
Definition: cycleData.cxx:68
A thread; that is, a lightweight process.
Definition: thread.h:51
A class to retrieve the individual data elements previously stored in a Datagram. ...
virtual void write_datagram(BamWriter *, Datagram &) const
Writes the contents of this object to the datagram for shipping out to a Bam file.
Definition: cycleData.cxx:34
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
This is a sequence number that increments monotonically.
Definition: updateSeq.h:43
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43