56 typedef vector_PT_EggVertex Vertices;
70 INLINE
explicit EggPrimitive(
const std::string &name =
"");
85 INLINE std::string get_sort_name()
const;
87 virtual Shading get_shading()
const;
88 INLINE
void clear_connected_shading();
89 INLINE Shading get_connected_shading()
const;
92 INLINE
bool has_texture()
const;
93 INLINE
bool has_texture(
EggTexture *texture)
const;
97 INLINE
void clear_texture();
98 INLINE
int get_num_textures()
const;
100 MAKE_SEQ(get_textures, get_num_textures, get_texture);
103 INLINE
void clear_material();
105 INLINE
bool has_material()
const;
107 INLINE
void set_bface_flag(
bool flag);
108 INLINE
bool get_bface_flag()
const;
110 MAKE_PROPERTY(sort_name, get_sort_name);
111 MAKE_PROPERTY(shading, get_shading);
112 MAKE_PROPERTY(connected_shading, get_connected_shading);
114 MAKE_SEQ_PROPERTY(textures, get_num_textures, get_texture);
115 MAKE_PROPERTY2(material, has_material, get_material, set_material, clear_material);
116 MAKE_PROPERTY(bface_flag, get_bface_flag, set_bface_flag);
121 bool has_vertex_normal()
const;
122 bool has_vertex_color()
const;
124 virtual void unify_attributes(Shading shading);
125 virtual void apply_last_attribute();
126 virtual void apply_first_attribute();
127 virtual void post_apply_flat_attribute();
128 virtual void reverse_vertex_ordering();
129 virtual bool cleanup();
131 void remove_doubled_verts(
bool closed);
132 void remove_nonunique_verts();
133 virtual bool has_primitives()
const;
134 virtual bool joint_has_primitives()
const;
135 virtual bool has_normals()
const;
142#if defined(WIN32_VC) || defined(WIN64_VC)
143 typedef PT_EggVertex *pointer;
144 typedef PT_EggVertex *const_pointer;
146 typedef Vertices::const_pointer pointer;
147 typedef Vertices::const_pointer const_pointer;
149 typedef Vertices::const_reference reference;
150 typedef Vertices::const_reference const_reference;
151 typedef Vertices::const_iterator iterator;
152 typedef Vertices::const_iterator const_iterator;
153 typedef Vertices::const_reverse_iterator reverse_iterator;
154 typedef Vertices::const_reverse_iterator const_reverse_iterator;
155 typedef Vertices::size_type size_type;
156 typedef Vertices::difference_type difference_type;
158 INLINE iterator begin()
const;
159 INLINE iterator end()
const;
160 INLINE reverse_iterator rbegin()
const;
161 INLINE reverse_iterator rend()
const;
162 INLINE
bool empty()
const;
163 INLINE size_type size()
const;
165 INLINE
EggVertex *operator [] (
int index)
const;
167 INLINE iterator insert(iterator position,
EggVertex *x);
168 INLINE iterator erase(iterator position);
169 iterator erase(iterator first, iterator last);
170 INLINE
void replace(iterator position,
EggVertex *vertex);
178 void remove_vertex(
size_t index);
182 INLINE
size_t get_num_vertices()
const;
183 INLINE
EggVertex *get_vertex(
size_t index)
const;
184 INLINE
void set_vertex(
size_t index,
EggVertex *vertex);
185 INLINE
void insert_vertex(
size_t index,
EggVertex *vertex);
186 MAKE_SEQ(get_vertices, get_num_vertices, get_vertex);
190 MAKE_SEQ_PROPERTY(vertices, get_num_vertices, get_vertex, set_vertex, remove_vertex, insert_vertex);
191 MAKE_PROPERTY(pool, get_pool);
193 virtual void write(std::ostream &out,
int indent_level)
const=0;
196 void test_vref_integrity()
const;
198 void test_vref_integrity()
const { }
207 virtual void prepare_add_vertex(
EggVertex *vertex,
int i,
int n);
208 virtual void prepare_remove_vertex(
EggVertex *vertex,
int i,
int n);
211 void write_body(std::ostream &out,
int indent_level)
const;
213 virtual bool egg_start_parse_body();
214 virtual void r_transform(
const LMatrix4d &mat,
const LMatrix4d &inv,
215 CoordinateSystem to_cs);
216 virtual void r_flatten_transforms();
219 void do_apply_flat_attribute(
int vertex_index,
EggAttributes *attrib);
222 void set_connected_shading(Shading shading,
const EggAttributes *neighbor);
224 class ConnectedShadingNode {
231 void r_set_connected_shading(
int depth_count,
233 ConnectedShadingNodes &connected_nodes);
236 typedef vector_PT_EggTexture Textures;
238 PT_EggMaterial _material;
240 Shading _connected_shading;
247 static void init_type() {
248 EggNode::init_type();
249 EggAttributes::init_type();
250 EggRenderMode::get_class_type();
252 EggNode::get_class_type(),
253 EggAttributes::get_class_type(),
254 EggRenderMode::get_class_type());
257 return get_class_type();
259 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
This is a collection of textures by TRef name.
Defines a texture map that may be applied to geometry.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.