Panda3D
 All Classes Functions Variables Enumerations
geomTriangles.h
1 // Filename: geomTriangles.h
2 // Created by: drose (06Mar05)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef GEOMTRIANGLES_H
16 #define GEOMTRIANGLES_H
17 
18 #include "pandabase.h"
19 #include "geomPrimitive.h"
20 
21 ////////////////////////////////////////////////////////////////////
22 // Class : GeomTriangles
23 // Description : Defines a series of disconnected triangles.
24 ////////////////////////////////////////////////////////////////////
25 class EXPCL_PANDA_GOBJ GeomTriangles : public GeomPrimitive {
26 PUBLISHED:
27  GeomTriangles(UsageHint usage_hint);
28  GeomTriangles(const GeomTriangles &copy);
29  virtual ~GeomTriangles();
30  ALLOC_DELETED_CHAIN(GeomTriangles);
31 
32 public:
33  virtual PT(GeomPrimitive) make_copy() const;
34  virtual PrimitiveType get_primitive_type() const;
35 
36  virtual int get_num_vertices_per_primitive() const;
37 
38 public:
39  virtual bool draw(GraphicsStateGuardianBase *gsg,
40  const GeomPrimitivePipelineReader *reader,
41  bool force) const;
42 
43 protected:
44  virtual CPT(GeomPrimitive) doubleside_impl() const;
45  virtual CPT(GeomPrimitive) reverse_impl() const;
46  virtual CPT(GeomVertexArrayData) rotate_impl() const;
47 
48 public:
49  static void register_with_read_factory();
50 
51 protected:
52  static TypedWritable *make_from_bam(const FactoryParams &params);
53 
54 public:
55  static TypeHandle get_class_type() {
56  return _type_handle;
57  }
58  static void init_type() {
59  GeomPrimitive::init_type();
60  register_type(_type_handle, "GeomTriangles",
61  GeomPrimitive::get_class_type());
62  }
63  virtual TypeHandle get_type() const {
64  return get_class_type();
65  }
66  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
67 
68 private:
69  static TypeHandle _type_handle;
70 
71  friend class Geom;
72 };
73 
74 #endif
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
This is an abstract base class for a family of classes that represent the fundamental geometry primit...
Definition: geomPrimitive.h:63
virtual int get_num_vertices_per_primitive() const
If the primitive type is a simple type in which all primitives have the same number of vertices...
A container for geometry primitives.
Definition: geom.h:58
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
Defines a series of disconnected triangles.
Definition: geomTriangles.h:25
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
Encapsulates the data from a GeomPrimitive, pre-fetched for one stage of the pipeline.
This is the data for one array of a GeomVertexData structure.