00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef USERVERTEXSLIDER_H
00016 #define USERVERTEXSLIDER_H
00017
00018 #include "pandabase.h"
00019 #include "vertexSlider.h"
00020 #include "cycleData.h"
00021 #include "cycleDataReader.h"
00022 #include "cycleDataWriter.h"
00023 #include "pipelineCycler.h"
00024
00025 class FactoryParams;
00026
00027
00028
00029
00030
00031
00032
00033
00034 class EXPCL_PANDA_GOBJ UserVertexSlider : public VertexSlider {
00035 PUBLISHED:
00036 UserVertexSlider(const string &name);
00037 UserVertexSlider(const InternalName *name);
00038
00039 INLINE void set_slider(PN_stdfloat slider);
00040 virtual PN_stdfloat get_slider() const;
00041
00042 private:
00043
00044 class EXPCL_PANDA_GOBJ CData : public CycleData {
00045 public:
00046 INLINE CData();
00047 INLINE CData(const CData ©);
00048 virtual CycleData *make_copy() const;
00049 virtual void write_datagram(BamWriter *manager, Datagram &dg) const;
00050 virtual void fillin(DatagramIterator &scan, BamReader *manager);
00051 virtual TypeHandle get_parent_type() const {
00052 return UserVertexSlider::get_class_type();
00053 }
00054
00055 PN_stdfloat _slider;
00056 };
00057
00058 PipelineCycler<CData> _cycler;
00059 typedef CycleDataReader<CData> CDReader;
00060 typedef CycleDataWriter<CData> CDWriter;
00061
00062 public:
00063 static void register_with_read_factory();
00064 virtual void write_datagram(BamWriter *manager, Datagram &dg);
00065
00066 protected:
00067 static TypedWritable *make_from_bam(const FactoryParams ¶ms);
00068 void fillin(DatagramIterator &scan, BamReader *manager);
00069
00070 public:
00071 static TypeHandle get_class_type() {
00072 return _type_handle;
00073 }
00074 static void init_type() {
00075 VertexSlider::init_type();
00076 register_type(_type_handle, "UserVertexSlider",
00077 VertexSlider::get_class_type());
00078 }
00079 virtual TypeHandle get_type() const {
00080 return get_class_type();
00081 }
00082 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00083
00084 private:
00085 static TypeHandle _type_handle;
00086 };
00087
00088 #include "userVertexSlider.I"
00089
00090 #endif