00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef LODNODE_H
00020 #define LODNODE_H
00021
00022 #include "pandabase.h"
00023
00024 #include "selectiveChildNode.h"
00025
00026 #include "LOD.h"
00027
00028
00029
00030
00031
00032
00033
00034
00035 class EXPCL_PANDA LODNode : public SelectiveChildNode {
00036 PUBLISHED:
00037 INLINE LODNode(const string &name);
00038
00039 protected:
00040 INLINE LODNode(const LODNode ©);
00041 public:
00042 virtual PandaNode *make_copy() const;
00043 virtual bool safe_to_combine() const;
00044 virtual void xform(const LMatrix4f &mat);
00045 virtual bool has_cull_callback() const;
00046 virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
00047
00048 virtual void output(ostream &out) const;
00049
00050 PUBLISHED:
00051
00052
00053
00054
00055
00056 INLINE void add_switch(float in, float out);
00057 INLINE bool set_switch(int index, float in, float out);
00058 INLINE void clear_switches(void);
00059
00060 INLINE int get_num_switches() const;
00061 INLINE float get_in(int index) const;
00062 INLINE float get_out(int index) const;
00063
00064 INLINE void set_center(const LPoint3f ¢er);
00065 INLINE const LPoint3f &get_center() const;
00066
00067 public:
00068 static void register_with_read_factory();
00069 virtual void write_datagram(BamWriter *manager, Datagram &dg);
00070
00071 protected:
00072 static TypedWritable *make_from_bam(const FactoryParams ¶ms);
00073 void fillin(DatagramIterator &scan, BamReader *manager);
00074
00075 private:
00076 class EXPCL_PANDA CData : public CycleData {
00077 public:
00078 INLINE CData();
00079 INLINE CData(const CData ©);
00080 virtual CycleData *make_copy() const;
00081 virtual void write_datagram(BamWriter *manager, Datagram &dg) const;
00082 virtual void fillin(DatagramIterator &scan, BamReader *manager);
00083
00084 LOD _lod;
00085 };
00086
00087 PipelineCycler<CData> _cycler;
00088 typedef CycleDataReader<CData> CDReader;
00089 typedef CycleDataWriter<CData> CDWriter;
00090
00091 public:
00092 static TypeHandle get_class_type() {
00093 return _type_handle;
00094 }
00095 static void init_type() {
00096 SelectiveChildNode::init_type();
00097 register_type(_type_handle, "LODNode",
00098 SelectiveChildNode::get_class_type());
00099 }
00100 virtual TypeHandle get_type() const {
00101 return get_class_type();
00102 }
00103 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00104
00105 private:
00106 static TypeHandle _type_handle;
00107 };
00108
00109 #include "lodNode.I"
00110
00111 #endif