Panda3D
geomTristrips.h
1 // Filename: geomTristrips.h
2 // Created by: drose (08Mar05)
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 GEOMTRISTRIPS_H
16 #define GEOMTRISTRIPS_H
17 
18 #include "pandabase.h"
19 #include "geomPrimitive.h"
20 
21 ////////////////////////////////////////////////////////////////////
22 // Class : GeomTristrips
23 // Description : Defines a series of triangle strips.
24 ////////////////////////////////////////////////////////////////////
25 class EXPCL_PANDA_GOBJ GeomTristrips : public GeomPrimitive {
26 PUBLISHED:
27  GeomTristrips(UsageHint usage_hint);
28  GeomTristrips(const GeomTristrips &copy);
29  virtual ~GeomTristrips();
30  ALLOC_DELETED_CHAIN(GeomTristrips);
31 
32 public:
33  virtual PT(GeomPrimitive) make_copy() const;
34  virtual PrimitiveType get_primitive_type() const;
35  virtual int get_geom_rendering() const;
36  virtual int get_min_num_vertices_per_primitive() const;
37  virtual int get_num_unused_vertices_per_primitive() const;
38 
39 public:
40  virtual bool draw(GraphicsStateGuardianBase *gsg,
41  const GeomPrimitivePipelineReader *reader,
42  bool force) const;
43 
44 protected:
45  virtual CPT(GeomPrimitive) decompose_impl() const;
46  virtual CPT(GeomPrimitive) doubleside_impl() const;
47  virtual CPT(GeomPrimitive) reverse_impl() const;
48  virtual CPT(GeomVertexArrayData) rotate_impl() const;
49  virtual bool requires_unused_vertices() const;
50  virtual void append_unused_vertices(GeomVertexArrayData *vertices,
51  int vertex);
52 
53 public:
54  static void register_with_read_factory();
55 
56 protected:
57  static TypedWritable *make_from_bam(const FactoryParams &params);
58 
59 public:
60  static TypeHandle get_class_type() {
61  return _type_handle;
62  }
63  static void init_type() {
64  GeomPrimitive::init_type();
65  register_type(_type_handle, "GeomTristrips",
66  GeomPrimitive::get_class_type());
67  }
68  virtual TypeHandle get_type() const {
69  return get_class_type();
70  }
71  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
72 
73 private:
74  static TypeHandle _type_handle;
75 
76  friend class Geom;
77 };
78 
79 #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
Defines a series of triangle strips.
Definition: geomTristrips.h:25
virtual int get_num_unused_vertices_per_primitive() const
Returns the number of vertices that are added between primitives that aren't, strictly speaking...
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...
virtual int get_geom_rendering() const
Returns the set of GeomRendering bits that represent the rendering properties required to properly re...
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.
virtual int get_min_num_vertices_per_primitive() const
Returns the minimum number of vertices that must be added before close_primitive() may legally be cal...
This is the data for one array of a GeomVertexData structure.