Panda3D
eggTriangleFan.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file eggTriangleFan.h
10  * @author drose
11  * @date 2005-03-23
12  */
13 
14 #ifndef EGGTRIANGLEFAN_H
15 #define EGGTRIANGLEFAN_H
16 
17 #include "pandabase.h"
18 
19 #include "eggCompositePrimitive.h"
20 
21 /**
22  * A connected fan of triangles. This does not normally appear in an egg
23  * file; it is typically generated as a result of meshing.
24  */
25 class EXPCL_PANDA_EGG EggTriangleFan : public EggCompositePrimitive {
26 PUBLISHED:
27  INLINE explicit EggTriangleFan(const std::string &name = "");
28  INLINE EggTriangleFan(const EggTriangleFan &copy);
29  INLINE EggTriangleFan &operator = (const EggTriangleFan &copy);
30  virtual ~EggTriangleFan();
31 
32  virtual EggTriangleFan *make_copy() const override;
33 
34  virtual void write(std::ostream &out, int indent_level) const override;
35  virtual void apply_first_attribute() override;
36 
37 protected:
38  virtual int get_num_lead_vertices() const override;
39  virtual bool do_triangulate(EggGroupNode *container) const override;
40 
41 public:
42  static TypeHandle get_class_type() {
43  return _type_handle;
44  }
45  static void init_type() {
46  EggCompositePrimitive::init_type();
47  register_type(_type_handle, "EggTriangleFan",
48  EggCompositePrimitive::get_class_type());
49  }
50  virtual TypeHandle get_type() const override {
51  return get_class_type();
52  }
53  virtual TypeHandle force_init_type() override {
54  init_type();
55  return get_class_type();
56  }
57 
58 private:
59  static TypeHandle _type_handle;
60 };
61 
62 #include "eggTriangleFan.I"
63 
64 #endif
The base class for primitives such as triangle strips and triangle fans, which include several compon...
A base class for nodes in the hierarchy that are not leaf nodes.
Definition: eggGroupNode.h:46
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A connected fan of triangles.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
virtual void apply_first_attribute()
Sets the first vertex of the triangle (or each component) to the primitive normal and/or color,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.