Defines a series of "patches", fixed-size groupings of vertices that must be processed by a tessellation shader. More...

#include "geomPatches.h"

Inheritance diagram for GeomPatches:
GeomPrimitive CopyOnWriteObject GeomEnums CachedTypedWritableReferenceCount TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Public Member Functions

 GeomPatches (int num_vertices_per_patch, UsageHint usage_hint)
 The number of vertices per patch must be specified to the GeomPatches constructor, and it may not be changed during the lifetime of the GeomPatches object.
 GeomPatches (const GeomPatches &copy)
virtual bool draw (GraphicsStateGuardianBase *gsg, const GeomPrimitivePipelineReader *reader, bool force) const
 Calls the appropriate method on the GSG to draw the primitive.
virtual TypeHandle force_init_type ()
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, like patches, returns the number of vertices per primitive.
virtual PrimitiveType get_primitive_type () const
 Returns the fundamental rendering type of this primitive: whether it is points, lines, or polygons.
virtual TypeHandle get_type () const
virtual PT (GeomPrimitive) make_copy() const
virtual void write_datagram (BamWriter *manager, Datagram &dg)
 Writes the contents of this object to the datagram for shipping out to a Bam file.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
static void register_with_read_factory ()
 Tells the BamReader how to create objects of type Geom.

Protected Member Functions

void fillin (DatagramIterator &scan, BamReader *manager)
 This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new GeomPatches.

Static Protected Member Functions

static TypedWritablemake_from_bam (const FactoryParams &params)
 This function is called by the BamReader's factory when a new object of type Geom is encountered in the Bam file.

Friends

class Geom

Detailed Description

Defines a series of "patches", fixed-size groupings of vertices that must be processed by a tessellation shader.

Definition at line 27 of file geomPatches.h.


Constructor & Destructor Documentation

GeomPatches::GeomPatches ( int  num_vertices_per_patch,
GeomPatches::UsageHint  usage_hint 
)

The number of vertices per patch must be specified to the GeomPatches constructor, and it may not be changed during the lifetime of the GeomPatches object.

Create a new GeomPatches if you need to have a different value.

Definition at line 34 of file geomPatches.cxx.

Referenced by make_from_bam().


Member Function Documentation

bool GeomPatches::draw ( GraphicsStateGuardianBase gsg,
const GeomPrimitivePipelineReader reader,
bool  force 
) const [virtual]

Calls the appropriate method on the GSG to draw the primitive.

Implements GeomPrimitive.

Definition at line 113 of file geomPatches.cxx.

void GeomPatches::fillin ( DatagramIterator scan,
BamReader manager 
) [protected, virtual]

This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new GeomPatches.

Reimplemented from GeomPrimitive.

Definition at line 149 of file geomPatches.cxx.

References DatagramIterator::get_uint16().

If the primitive type is a simple type in which all primitives have the same number of vertices, like patches, returns the number of vertices per primitive.

If the primitive type is a more complex type in which different primitives might have different numbers of vertices, for instance a triangle strip, returns 0.

In the case of GeomPatches, this returns the fixed number that was specified to the constructor.

Reimplemented from GeomPrimitive.

Definition at line 102 of file geomPatches.cxx.

GeomPrimitive::PrimitiveType GeomPatches::get_primitive_type ( ) const [virtual]

Returns the fundamental rendering type of this primitive: whether it is points, lines, or polygons.

This is used to set up the appropriate antialiasing settings when AntialiasAttrib::M_auto is in effect; it also implies the type of primitive that will be produced when decompose() is called.

Implements GeomPrimitive.

Definition at line 83 of file geomPatches.cxx.

TypedWritable * GeomPatches::make_from_bam ( const FactoryParams params) [static, protected]

This function is called by the BamReader's factory when a new object of type Geom is encountered in the Bam file.

It should create the Geom and extract its information from the file.

Definition at line 163 of file geomPatches.cxx.

References GeomPatches().

Referenced by register_with_read_factory().

Tells the BamReader how to create objects of type Geom.

Definition at line 125 of file geomPatches.cxx.

References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().

void GeomPatches::write_datagram ( BamWriter manager,
Datagram dg 
) [virtual]

Writes the contents of this object to the datagram for shipping out to a Bam file.

Reimplemented from GeomPrimitive.

Definition at line 136 of file geomPatches.cxx.

References Datagram::add_uint16().


The documentation for this class was generated from the following files: