00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef VERTEXSLIDER_H
00016 #define VERTEXSLIDER_H
00017
00018 #include "pandabase.h"
00019 #include "typedWritableReferenceCount.h"
00020 #include "internalName.h"
00021 #include "updateSeq.h"
00022 #include "pset.h"
00023 #include "cycleData.h"
00024 #include "cycleDataReader.h"
00025 #include "cycleDataWriter.h"
00026 #include "pipelineCycler.h"
00027
00028 class SliderTable;
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 class EXPCL_PANDA_GOBJ VertexSlider : public TypedWritableReferenceCount {
00042 PUBLISHED:
00043 VertexSlider(const InternalName *name);
00044 virtual ~VertexSlider();
00045
00046 INLINE const InternalName *get_name() const;
00047
00048 virtual PN_stdfloat get_slider() const=0;
00049 INLINE UpdateSeq get_modified(Thread *current_thread) const;
00050
00051 virtual void output(ostream &out) const;
00052 virtual void write(ostream &out, int indent_level) const;
00053
00054 protected:
00055 void mark_modified(Thread *current_thread);
00056
00057 protected:
00058 CPT(InternalName) _name;
00059
00060 private:
00061 typedef pset<SliderTable *> Tables;
00062 Tables _tables;
00063
00064
00065 class EXPCL_PANDA_GOBJ CData : public CycleData {
00066 public:
00067 INLINE CData();
00068 INLINE CData(const CData ©);
00069 virtual CycleData *make_copy() const;
00070 virtual void write_datagram(BamWriter *manager, Datagram &dg) const;
00071 virtual int complete_pointers(TypedWritable **plist, BamReader *manager);
00072 virtual void fillin(DatagramIterator &scan, BamReader *manager);
00073 virtual TypeHandle get_parent_type() const {
00074 return VertexSlider::get_class_type();
00075 }
00076
00077 UpdateSeq _modified;
00078 };
00079
00080 PipelineCycler<CData> _cycler;
00081 typedef CycleDataReader<CData> CDReader;
00082 typedef CycleDataWriter<CData> CDWriter;
00083
00084 public:
00085 virtual void write_datagram(BamWriter *manager, Datagram &dg);
00086
00087 protected:
00088 void fillin(DatagramIterator &scan, BamReader *manager);
00089
00090 public:
00091 static TypeHandle get_class_type() {
00092 return _type_handle;
00093 }
00094 static void init_type() {
00095 TypedWritableReferenceCount::init_type();
00096 register_type(_type_handle, "VertexSlider",
00097 TypedWritableReferenceCount::get_class_type());
00098 }
00099 virtual TypeHandle get_type() const {
00100 return get_class_type();
00101 }
00102 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00103
00104 private:
00105 static TypeHandle _type_handle;
00106
00107 friend class SliderTable;
00108 };
00109
00110 INLINE ostream &operator << (ostream &out, const VertexSlider &obj);
00111
00112 #include "vertexSlider.I"
00113
00114 #endif