00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef NODEPATHCOMPONENT_H
00020 #define NODEPATHCOMPONENT_H
00021
00022 #include "pandabase.h"
00023
00024 #include "pandaNode.h"
00025 #include "pointerTo.h"
00026 #include "referenceCount.h"
00027 #include "cycleData.h"
00028 #include "cycleDataReader.h"
00029 #include "cycleDataWriter.h"
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 class EXPCL_PANDA NodePathComponent : public ReferenceCount {
00048 private:
00049 INLINE NodePathComponent(PandaNode *node, NodePathComponent *next = NULL);
00050 INLINE NodePathComponent(const NodePathComponent ©);
00051 INLINE void operator = (const NodePathComponent ©);
00052
00053 public:
00054 INLINE ~NodePathComponent();
00055
00056 INLINE PandaNode *get_node() const;
00057 int get_key() const;
00058 bool is_top_node() const;
00059 INLINE bool is_collapsed() const;
00060
00061 NodePathComponent *get_next() const;
00062 int get_length() const;
00063 INLINE NodePathComponent *get_collapsed() const;
00064
00065 bool fix_length();
00066 NodePathComponent *uncollapse();
00067
00068 void output(ostream &out) const;
00069
00070 private:
00071 void set_next(NodePathComponent *next);
00072 void set_top_node();
00073 void collapse_with(NodePathComponent *next);
00074
00075
00076
00077
00078
00079 PT(PandaNode) _node;
00080 int _key;
00081
00082
00083 class EXPCL_PANDA CData : public CycleData {
00084 public:
00085 INLINE CData();
00086 CData(const CData ©);
00087 virtual CycleData *make_copy() const;
00088
00089 PT(NodePathComponent) _next;
00090 int _length;
00091 };
00092
00093 PipelineCycler<CData> _cycler;
00094 typedef CycleDataReader<CData> CDReader;
00095 typedef CycleDataWriter<CData> CDWriter;
00096
00097 static int _next_key;
00098
00099 public:
00100 static TypeHandle get_class_type() {
00101 return _type_handle;
00102 }
00103 static void init_type() {
00104 ReferenceCount::init_type();
00105 register_type(_type_handle, "NodePathComponent",
00106 ReferenceCount::get_class_type());
00107 }
00108
00109 private:
00110 static TypeHandle _type_handle;
00111 friend class PandaNode;
00112 };
00113
00114 INLINE ostream &operator << (ostream &out, const NodePathComponent &comp);
00115
00116 #include "nodePathComponent.I"
00117
00118 #endif