Panda3D
 All Classes Functions Variables Enumerations
animChannelScalarTable.h
1 // Filename: animChannelScalarTable.h
2 // Created by: drose (22Feb99)
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 ANIMCHANNELSCALARTABLE_H
16 #define ANIMCHANNELSCALARTABLE_H
17 
18 #include "pandabase.h"
19 
20 #include "animChannel.h"
21 
22 #include "pointerToArray.h"
23 #include "pta_stdfloat.h"
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : AnimChannelScalarTable
27 // Description : An animation channel that issues a scalar each frame,
28 // read from a table such as might have been read from
29 // an egg file.
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDA_CHAN AnimChannelScalarTable : public AnimChannelScalar {
32 protected:
35 
36 public:
37  AnimChannelScalarTable(AnimGroup *parent, const string &name);
38 
39  virtual bool has_changed(int last_frame, double last_frac,
40  int this_frame, double this_frac);
41  virtual void get_value(int frame, PN_stdfloat &value);
42 
43 PUBLISHED:
44  void set_table(const CPTA_stdfloat &table);
45  INLINE CPTA_stdfloat get_table() const;
46 
47  INLINE bool has_table() const;
48  INLINE void clear_table();
49 
50 public:
51  virtual void write(ostream &out, int indent_level) const;
52 
53 protected:
54  virtual AnimGroup *make_copy(AnimGroup *parent) const;
55 
56 protected:
57  CPTA_stdfloat _table;
58 
59 public:
60  static void register_with_read_factory();
61  virtual void write_datagram(BamWriter* manager, Datagram &me);
62 
63  static TypedWritable *make_AnimChannelScalarTable(const FactoryParams &params);
64 
65 protected:
66  void fillin(DatagramIterator& scan, BamReader* manager);
67 
68 public:
69  virtual TypeHandle get_type() const {
70  return get_class_type();
71  }
72  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
73  static TypeHandle get_class_type() {
74  return _type_handle;
75  }
76  static void init_type() {
77  AnimChannelScalar::init_type();
78  register_type(_type_handle, "AnimChannelScalarTable",
79  AnimChannelScalar::get_class_type());
80  }
81 
82 private:
83  static TypeHandle _type_handle;
84 };
85 
86 #include "animChannelScalarTable.I"
87 
88 #endif
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
static void register_with_read_factory()
Factory method to generate a AnimGroup object.
Definition: animGroup.cxx:362
An animation channel that issues a scalar each frame, read from a table such as might have been read ...
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:73
This template class is the parent class for all kinds of AnimChannels that return different values...
Definition: animChannel.h:30
virtual bool has_changed(int last_frame, double last_frac, int this_frame, double this_frac)
Returns true if the value has changed since the last call to has_changed().
virtual void write(ostream &out, int indent_level) const
Writes a brief description of the group and all of its descendants.
Definition: animGroup.cxx:225
This is the base class for AnimChannel and AnimBundle.
Definition: animGroup.h:36
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
virtual void write_datagram(BamWriter *manager, Datagram &me)
Function to write the important information in the particular object to a Datagram.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43
Similar to PointerToArray, except that its contents may not be modified.