Panda3D

Loading...
Searching...
No Matches
geomPatches.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 geomPatches.h
10 * @author drose
11 * @date 2012-04-27
12 */
13
14#ifndef GEOMPATCHES_H
15#define GEOMPATCHES_H
16
17#include "pandabase.h"
18#include "geomPrimitive.h"
19
20/**
21 * Defines a series of "patches", fixed-size groupings of vertices that must
22 * be processed by a tessellation shader.
23 */
24 class EXPCL_PANDA_GOBJ GeomPatches : public GeomPrimitive {
25PUBLISHED:
26 explicit GeomPatches(int num_vertices_per_patch, UsageHint usage_hint);
27 GeomPatches(const GeomPatches &copy);
28 virtual ~GeomPatches();
29 ALLOC_DELETED_CHAIN(GeomPatches);
30
31 public:
32 virtual PT(GeomPrimitive) make_copy() const;
33 virtual PrimitiveType get_primitive_type() const;
34
35 virtual int get_num_vertices_per_primitive() const;
36
37 public:
38 virtual bool draw(GraphicsStateGuardianBase *gsg,
39 const GeomPrimitivePipelineReader *reader,
40 bool force) const;
41
42 private:
43 int _num_vertices_per_patch;
44
45 public:
46 static void register_with_read_factory();
47 virtual void write_datagram(BamWriter *manager, Datagram &dg);
48
49 protected:
50 void fillin(DatagramIterator &scan, BamReader *manager);
51 static TypedWritable *make_from_bam(const FactoryParams &params);
52
53 public:
54 static TypeHandle get_class_type() {
55 return _type_handle;
56 }
57 static void init_type() {
58 GeomPrimitive::init_type();
59 register_type(_type_handle, "GeomPatches",
60 GeomPrimitive::get_class_type());
61 }
62 virtual TypeHandle get_type() const {
63 return get_class_type();
64 }
65 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
66
67 private:
68 static TypeHandle _type_handle;
69
70 friend class Geom;
71};
72
73#endif
BamReader
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition bamReader.h:110
BamWriter
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition bamWriter.h:63
DatagramIterator
A class to retrieve the individual data elements previously stored in a Datagram.
Definition datagramIterator.h:30
Datagram
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition datagram.h:38
FactoryParams
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition factoryParams.h:36
GeomPatches::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type Geom.
Definition geomPatches.cxx:102
GeomPatches::GeomPatches
GeomPatches(int num_vertices_per_patch, UsageHint usage_hint)
The number of vertices per patch must be specified to the GeomPatches constructor,...
Definition geomPatches.cxx:30
GeomPatches::draw
virtual bool draw(GraphicsStateGuardianBase *gsg, const GeomPrimitivePipelineReader *reader, bool force) const
Calls the appropriate method on the GSG to draw the primitive.
Definition geomPatches.cxx:93
GeomPatches::get_primitive_type
virtual PrimitiveType get_primitive_type() const
Returns the fundamental rendering type of this primitive: whether it is points, lines,...
Definition geomPatches.cxx:70
GeomPrimitive::write_datagram
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
Definition geomPrimitive.cxx:2169
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
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