Panda3D
Public Member Functions

GeomVertexRewriter Class Reference

This object provides the functionality of both a GeomVertexReader and a GeomVertexWriter, combined together into one convenient package. More...

#include "geomVertexRewriter.h"

Inheritance diagram for GeomVertexRewriter:
GeomVertexWriter GeomVertexReader GeomEnums GeomEnums

List of all members.

Public Member Functions

 GeomVertexRewriter (Thread *current_thread=Thread::get_current_thread())
 Constructs an invalid GeomVertexRewriter.
 GeomVertexRewriter (GeomVertexData *vertex_data, Thread *current_thread=Thread::get_current_thread())
 Constructs a new rewriter to process the vertices of the indicated data object.
 GeomVertexRewriter (GeomVertexData *vertex_data, const InternalName *name, Thread *current_thread=Thread::get_current_thread())
 Constructs a new rewriter to process the vertices of the indicated data object.
 GeomVertexRewriter (GeomVertexArrayData *array_data, Thread *current_thread=Thread::get_current_thread())
 Constructs a new rewriter to process the vertices of the indicated array only.
 GeomVertexRewriter (GeomVertexData *vertex_data, const string &name, Thread *current_thread=Thread::get_current_thread())
 Constructs a new rewriter to process the vertices of the indicated data object.
 GeomVertexRewriter (GeomVertexArrayData *array_data, int column, Thread *current_thread=Thread::get_current_thread())
 Constructs a new rewriter to process the vertices of the indicated array only.
 GeomVertexRewriter (const GeomVertexRewriter &copy)
void clear ()
 Resets the GeomVertexRewriter to the initial state.
int get_array () const
 Returns the array index containing the data type that the rewriter is working on.
GeomVertexArrayDataget_array_data () const
 Returns the particular array object that the rewriter is currently processing.
const GeomVertexColumnget_column () const
 Returns the description of the data type that the rewriter is working on.
int get_start_row () const
 Returns the row index at which the rewriter started.
GeomVertexDataget_vertex_data () const
 Returns the vertex data object that the rewriter is processing.
bool has_column () const
 Returns true if a valid data type has been successfully set, or false if the data type does not exist.
bool is_at_end () const
 Returns true if the reader or writer is currently at the end of the list of vertices, false otherwise.
void operator= (const GeomVertexRewriter &copy)
void output (ostream &out) const
bool set_column (int column)
 Sets up the rewriter to use the nth data type of the GeomVertexFormat, numbering from 0.
bool set_column (int array, const GeomVertexColumn *column)
 Sets up the rewriter to use the indicated column description on the given array.
bool set_column (const InternalName *name)
 Sets up the rewriter to use the data type with the indicated name.
bool set_column (const string &name)
 Sets up the rewriter to use the data type with the indicated name.
void set_row (int row)
 Sets the start, write, and write index to the indicated value.

Detailed Description

This object provides the functionality of both a GeomVertexReader and a GeomVertexWriter, combined together into one convenient package.

It is designed for making a single pass over a GeomVertexData object, modifying rows as it goes.

Although it doesn't provide any real performance benefit over using a separate reader and writer on the same data, it should probably be used in preference to a separate reader and writer, because it makes an effort to manage the reference counts properly between the reader and the writer to avoid accidentally dereferencing either array while recopying.

Definition at line 39 of file geomVertexRewriter.h.


Constructor & Destructor Documentation

GeomVertexRewriter::GeomVertexRewriter ( Thread current_thread = Thread::get_current_thread()) [inline]

Constructs an invalid GeomVertexRewriter.

You must use the assignment operator to assign a valid GeomVertexRewriter to this object before you can use it.

Definition at line 25 of file geomVertexRewriter.I.

GeomVertexRewriter::GeomVertexRewriter ( GeomVertexData vertex_data,
Thread current_thread = Thread::get_current_thread() 
) [inline]

Constructs a new rewriter to process the vertices of the indicated data object.

Definition at line 38 of file geomVertexRewriter.I.

GeomVertexRewriter::GeomVertexRewriter ( GeomVertexData vertex_data,
const string &  name,
Thread current_thread = Thread::get_current_thread() 
) [inline]

Constructs a new rewriter to process the vertices of the indicated data object.

This flavor creates the rewriter specifically to process the named data type.

Definition at line 52 of file geomVertexRewriter.I.

References set_column().

GeomVertexRewriter::GeomVertexRewriter ( GeomVertexData vertex_data,
const InternalName name,
Thread current_thread = Thread::get_current_thread() 
) [inline]

Constructs a new rewriter to process the vertices of the indicated data object.

This flavor creates the rewriter specifically to process the named data type.

Definition at line 68 of file geomVertexRewriter.I.

References set_column().

GeomVertexRewriter::GeomVertexRewriter ( GeomVertexArrayData array_data,
Thread current_thread = Thread::get_current_thread() 
) [inline]

Constructs a new rewriter to process the vertices of the indicated array only.

Definition at line 83 of file geomVertexRewriter.I.

GeomVertexRewriter::GeomVertexRewriter ( GeomVertexArrayData array_data,
int  column,
Thread current_thread = Thread::get_current_thread() 
) [inline]

Constructs a new rewriter to process the vertices of the indicated array only.

Definition at line 96 of file geomVertexRewriter.I.

References set_column().


Member Function Documentation

void GeomVertexRewriter::clear ( ) [inline]

Resets the GeomVertexRewriter to the initial state.

Reimplemented from GeomVertexReader.

Definition at line 253 of file geomVertexRewriter.I.

int GeomVertexRewriter::get_array ( ) const [inline]

Returns the array index containing the data type that the rewriter is working on.

Reimplemented from GeomVertexReader.

Definition at line 279 of file geomVertexRewriter.I.

References GeomVertexReader::get_array(), and GeomVertexWriter::get_array().

GeomVertexArrayData * GeomVertexRewriter::get_array_data ( ) const [inline]

Returns the particular array object that the rewriter is currently processing.

Reimplemented from GeomVertexReader.

Definition at line 156 of file geomVertexRewriter.I.

References GeomVertexWriter::get_array_data(), and GeomVertexReader::get_array_data().

const GeomVertexColumn * GeomVertexRewriter::get_column ( ) const [inline]

Returns the description of the data type that the rewriter is working on.

Reimplemented from GeomVertexReader.

Definition at line 292 of file geomVertexRewriter.I.

References GeomVertexReader::get_column(), and GeomVertexWriter::get_column().

int GeomVertexRewriter::get_start_row ( ) const [inline]

Returns the row index at which the rewriter started.

It will return to this row if you reset the current column.

Reimplemented from GeomVertexReader.

Definition at line 322 of file geomVertexRewriter.I.

References GeomVertexReader::get_start_row(), and GeomVertexWriter::get_start_row().

GeomVertexData * GeomVertexRewriter::get_vertex_data ( ) const [inline]

Returns the vertex data object that the rewriter is processing.

Reimplemented from GeomVertexReader.

Definition at line 143 of file geomVertexRewriter.I.

References GeomVertexReader::get_vertex_data(), and GeomVertexWriter::get_vertex_data().

bool GeomVertexRewriter::has_column ( ) const [inline]

Returns true if a valid data type has been successfully set, or false if the data type does not exist.

Reimplemented from GeomVertexReader.

Definition at line 266 of file geomVertexRewriter.I.

References GeomVertexReader::get_column(), and GeomVertexWriter::get_column().

bool GeomVertexRewriter::is_at_end ( ) const [inline]

Returns true if the reader or writer is currently at the end of the list of vertices, false otherwise.

Reimplemented from GeomVertexReader.

Definition at line 335 of file geomVertexRewriter.I.

Referenced by GeomPrimitive::offset_vertices().

bool GeomVertexRewriter::set_column ( int  array,
const GeomVertexColumn column 
) [inline]

Sets up the rewriter to use the indicated column description on the given array.

This also resets both the read and write row numbers to the start row (the same value passed to a previous call to set_row(), or 0 if set_row() was never called.)

The return value is true if the data type is valid, false otherwise.

Reimplemented from GeomVertexReader.

Definition at line 240 of file geomVertexRewriter.I.

References set_column().

bool GeomVertexRewriter::set_column ( int  column) [inline]

Sets up the rewriter to use the nth data type of the GeomVertexFormat, numbering from 0.

This also resets both the read and write row numbers to the start row (the same value passed to a previous call to set_row(), or 0 if set_row() was never called.)

The return value is true if the data type is valid, false otherwise.

Reimplemented from GeomVertexReader.

Definition at line 177 of file geomVertexRewriter.I.

Referenced by GeomVertexRewriter(), and set_column().

bool GeomVertexRewriter::set_column ( const string &  name) [inline]

Sets up the rewriter to use the data type with the indicated name.

This also resets both the read and write row numbers to the start row (the same value passed to a previous call to set_row(), or 0 if set_row() was never called.)

The return value is true if the data type is valid, false otherwise.

Reimplemented from GeomVertexReader.

Definition at line 199 of file geomVertexRewriter.I.

References set_column().

bool GeomVertexRewriter::set_column ( const InternalName name) [inline]

Sets up the rewriter to use the data type with the indicated name.

This also resets both the read and write row numbers to the start row (the same value passed to a previous call to set_row(), or 0 if set_row() was never called.)

The return value is true if the data type is valid, false otherwise.

Reimplemented from GeomVertexReader.

Definition at line 218 of file geomVertexRewriter.I.

References set_column().

void GeomVertexRewriter::set_row ( int  row) [inline]

Sets the start, write, and write index to the indicated value.

The rewriter will begin traversing from the given row.

Reimplemented from GeomVertexReader.

Definition at line 306 of file geomVertexRewriter.I.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations