00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef NODEPATHCOLLECTION_H
00016 #define NODEPATHCOLLECTION_H
00017
00018 #include "pandabase.h"
00019 #include "nodePath.h"
00020 #include "pointerToArray.h"
00021
00022
00023
00024
00025
00026
00027
00028
00029 class EXPCL_PANDA_PGRAPH NodePathCollection {
00030 PUBLISHED:
00031 NodePathCollection();
00032 NodePathCollection(const NodePathCollection ©);
00033 void operator = (const NodePathCollection ©);
00034 INLINE ~NodePathCollection();
00035
00036 #ifdef HAVE_PYTHON
00037 NodePathCollection(PyObject *self, PyObject *sequence);
00038 PyObject *__reduce__(PyObject *self) const;
00039 #endif
00040
00041 void add_path(const NodePath &node_path);
00042 bool remove_path(const NodePath &node_path);
00043 void add_paths_from(const NodePathCollection &other);
00044 void remove_paths_from(const NodePathCollection &other);
00045 void remove_duplicate_paths();
00046 bool has_path(const NodePath &path) const;
00047 void clear();
00048
00049 bool is_empty() const;
00050 int get_num_paths() const;
00051 NodePath get_path(int index) const;
00052 MAKE_SEQ(get_paths, get_num_paths, get_path);
00053 NodePath operator [] (int index) const;
00054 int size() const;
00055 INLINE void operator += (const NodePathCollection &other);
00056 INLINE NodePathCollection operator + (const NodePathCollection &other) const;
00057
00058
00059 INLINE void append(const NodePath &node_path);
00060 INLINE void extend(const NodePathCollection &other);
00061
00062
00063 INLINE void ls() const;
00064 void ls(ostream &out, int indent_level = 0) const;
00065
00066 NodePathCollection find_all_matches(const string &path) const;
00067 void reparent_to(const NodePath &other);
00068 void wrt_reparent_to(const NodePath &other);
00069
00070 void show();
00071 void hide();
00072 void stash();
00073 void unstash();
00074 void detach();
00075
00076 CollideMask get_collide_mask() const;
00077 void set_collide_mask(CollideMask new_mask, CollideMask bits_to_change = CollideMask::all_on(),
00078 TypeHandle node_type = TypeHandle::none());
00079
00080 void set_texture(Texture *tex, int priority = 0);
00081 void set_texture(TextureStage *stage, Texture *tex, int priority = 0);
00082 void set_texture_off(int priority = 0);
00083 void set_texture_off(TextureStage *stage, int priority = 0);
00084
00085 INLINE void set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a = 1.0,
00086 int priority = 0);
00087 void set_color(const LColor &color, int priority = 0);
00088
00089 INLINE void set_color_scale(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a = 1.0,
00090 int priority = 0);
00091 void set_color_scale(const LVecBase4 &scale, int priority = 0);
00092
00093 INLINE void compose_color_scale(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a = 1.0,
00094 int priority = 0);
00095 void compose_color_scale(const LVecBase4 &scale, int priority = 0);
00096
00097 void set_attrib(const RenderAttrib *attrib, int priority = 0);
00098
00099 void output(ostream &out) const;
00100 void write(ostream &out, int indent_level = 0) const;
00101
00102 private:
00103 typedef PTA(NodePath) NodePaths;
00104 NodePaths _node_paths;
00105
00106
00107 typedef pmap<CPT(RenderState), CPT(RenderState) > StateMap;
00108 };
00109
00110 INLINE ostream &operator << (ostream &out, const NodePathCollection &col) {
00111 col.output(out);
00112 return out;
00113 }
00114
00115 #include "nodePathCollection.I"
00116
00117 #endif
00118
00119