Panda3D

Loading...
Searching...
No Matches
geomTristrips.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 geomTristrips.h
10 * @author drose
11 * @date 2005-03-08
12 */
13
14#ifndef GEOMTRISTRIPS_H
15#define GEOMTRISTRIPS_H
16
17#include "pandabase.h"
18#include "geomPrimitive.h"
19
20/**
21 * Defines a series of triangle strips.
22 */
23 class EXPCL_PANDA_GOBJ GeomTristrips : public GeomPrimitive {
24PUBLISHED:
25 explicit GeomTristrips(UsageHint usage_hint);
26 GeomTristrips(const GeomTristrips &copy);
27 virtual ~GeomTristrips();
28 ALLOC_DELETED_CHAIN(GeomTristrips);
29
30 public:
31 virtual PT(GeomPrimitive) make_copy() const;
32 virtual PrimitiveType get_primitive_type() const;
33 virtual int get_geom_rendering() const;
34
35 CPT(GeomPrimitive) make_adjacency() const;
36
37 virtual int get_min_num_vertices_per_primitive() const;
38 virtual int get_num_unused_vertices_per_primitive() const;
39
40 public:
41 virtual bool draw(GraphicsStateGuardianBase *gsg,
42 const GeomPrimitivePipelineReader *reader,
43 bool force) const;
44
45 protected:
46 virtual CPT(GeomPrimitive) decompose_impl() const;
47 virtual CPT(GeomPrimitive) doubleside_impl() const;
48 virtual CPT(GeomPrimitive) reverse_impl() const;
49 virtual CPT(GeomVertexArrayData) rotate_impl() const;
50 virtual bool requires_unused_vertices() const;
51 virtual void append_unused_vertices(GeomVertexArrayData *vertices,
52 int vertex);
53
54 public:
55 static void register_with_read_factory();
56
57 protected:
58 static TypedWritable *make_from_bam(const FactoryParams &params);
59
60 public:
61 static TypeHandle get_class_type() {
62 return _type_handle;
63 }
64 static void init_type() {
65 GeomPrimitive::init_type();
66 register_type(_type_handle, "GeomTristrips",
67 GeomPrimitive::get_class_type());
68 }
69 virtual TypeHandle get_type() const {
70 return get_class_type();
71 }
72 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
73
74 private:
75 static TypeHandle _type_handle;
76
77 friend class Geom;
78};
79
80#endif
FactoryParams
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition factoryParams.h:36
GeomPrimitive::get_min_num_vertices_per_primitive
get_min_num_vertices_per_primitive
Returns the minimum number of vertices that must be added before close_primitive() may legally be cal...
Definition geomPrimitive.h:195
GeomPrimitive::make_adjacency
virtual ConstPointerTo< GeomPrimitive > make_adjacency() const
Adds adjacency information to this primitive.
Definition geomPrimitive.cxx:1113
GeomPrimitive::get_geom_rendering
get_geom_rendering
Returns the set of GeomRendering bits that represent the rendering properties required to properly re...
Definition geomPrimitive.h:73
GeomPrimitive::get_num_unused_vertices_per_primitive
get_num_unused_vertices_per_primitive
Returns the number of vertices that are added between primitives that aren't, strictly speaking,...
Definition geomPrimitive.h:196
GeomTristrips::draw
virtual bool draw(GraphicsStateGuardianBase *gsg, const GeomPrimitivePipelineReader *reader, bool force) const
Calls the appropriate method on the GSG to draw the primitive.
Definition geomTristrips.cxx:249
GeomTristrips::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type Geom.
Definition geomTristrips.cxx:500
GeomTristrips::get_primitive_type
virtual PrimitiveType get_primitive_type() const
Returns the fundamental rendering type of this primitive: whether it is points, lines,...
Definition geomTristrips.cxx:69
GeomVertexArrayData
This is the data for one array of a GeomVertexData structure.
Definition geomVertexArrayData.h:58
GraphicsStateGuardianBase
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
Definition graphicsStateGuardianBase.h:110
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
TypedWritable
Base class for objects that can be written to and read from Bam files.
Definition typedWritable.h:35
geomPrimitive.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
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