14#ifndef EGGCOMPOSITEPRIMITIVE_H
15#define EGGCOMPOSITEPRIMITIVE_H
26class EXPCL_PANDA_EGG EggCompositePrimitive :
public EggPrimitive {
28 INLINE
explicit EggCompositePrimitive(
const std::string &name =
"");
29 INLINE EggCompositePrimitive(
const EggCompositePrimitive ©);
30 INLINE EggCompositePrimitive &operator = (
const EggCompositePrimitive ©);
31 virtual ~EggCompositePrimitive();
39 INLINE
void set_component(
size_t i,
const EggAttributes *attrib);
44 PT(EggCompositePrimitive) triangulate_in_place();
53 virtual int get_num_lead_vertices()
const=0;
54 virtual void prepare_add_vertex(
EggVertex *vertex,
int i,
int n);
55 virtual void prepare_remove_vertex(
EggVertex *vertex,
int i,
int n);
57 virtual bool do_triangulate(EggGroupNode *container)
const;
59 void write_body(std::ostream &out,
int indent_level)
const;
62 typedef pvector<EggAttributes *> Components;
63 Components _components;
70 static void init_type() {
71 EggPrimitive::init_type();
73 EggPrimitive::get_class_type());
75 virtual TypeHandle get_type()
const {
76 return get_class_type();
78 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
81 static TypeHandle _type_handle;
bool triangulate_into(EggGroupNode *container) const
Subdivides the composite primitive into triangles and adds those triangles to the indicated container...
get_num_components
Returns the number of individual component triangles within the composite.
set_component
Changes the attributes for the nth component triangle.
get_component
Returns the attributes for the nth component triangle.
virtual void unify_attributes(Shading shading)
If the shading property is S_per_vertex, ensures that all vertices have a normal and a color,...
get_shading
Returns the shading properties apparent on this particular primitive.
virtual void apply_first_attribute()
Sets the first vertex of the triangle (or each component) to the primitive normal and/or color,...
virtual void post_apply_flat_attribute()
Intended as a followup to apply_last_attribute(), this also sets an attribute on the first vertices o...
virtual void apply_last_attribute()
Sets the last vertex of the triangle (or each component) to the primitive normal and/or color,...
virtual bool cleanup()
Cleans up modeling errors in whatever context this makes sense.
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...