Panda3D

Loading...
Searching...
No Matches
geomTrianglesAdjacency.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 geomTrianglesAdjacency.h
10 * @author rdb
11 * @date 2018-03-01
12 */
13
14#ifndef GEOMTRIANGLESADJACENCY_H
15#define GEOMTRIANGLESADJACENCY_H
16
17#include "pandabase.h"
18#include "geomPrimitive.h"
19
20/**
21 * Defines a series of disconnected triangles, with adjacency information.
22 *
23 * @since 1.10.0
24 */
25 class EXPCL_PANDA_GOBJ GeomTrianglesAdjacency : public GeomPrimitive {
26PUBLISHED:
27 explicit GeomTrianglesAdjacency(UsageHint usage_hint);
28 GeomTrianglesAdjacency(const GeomTrianglesAdjacency &copy);
29 virtual ~GeomTrianglesAdjacency();
30 ALLOC_DELETED_CHAIN(GeomTrianglesAdjacency);
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
37 virtual int get_num_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) doubleside_impl() const;
46 virtual CPT(GeomPrimitive) reverse_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, "GeomTrianglesAdjacency",
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
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_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_vertices_per_primitive
get_num_vertices_per_primitive
If the primitive type is a simple type in which all primitives have the same number of vertices,...
Definition geomPrimitive.h:194
GeomTrianglesAdjacency::get_primitive_type
virtual PrimitiveType get_primitive_type() const
Returns the fundamental rendering type of this primitive: whether it is points, lines,...
Definition geomTrianglesAdjacency.cxx:65
GeomTrianglesAdjacency::draw
virtual bool draw(GraphicsStateGuardianBase *gsg, const GeomPrimitivePipelineReader *reader, bool force) const
Calls the appropriate method on the GSG to draw the primitive.
Definition geomTrianglesAdjacency.cxx:94
GeomTrianglesAdjacency::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type Geom.
Definition geomTrianglesAdjacency.cxx:176
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