Panda3D
Public Member Functions | Protected Member Functions
GeomVertexWriter Class Reference

This object provides a high-level interface for quickly writing a sequence of numeric values from a vertex table. More...

#include "geomVertexWriter.h"

Inheritance diagram for GeomVertexWriter:
GeomEnums GeomVertexRewriter

List of all members.

Public Member Functions

 GeomVertexWriter (Thread *current_thread=Thread::get_current_thread())
 Constructs an invalid GeomVertexWriter.
 GeomVertexWriter (GeomVertexData *vertex_data, Thread *current_thread=Thread::get_current_thread())
 Constructs a new writer to process the vertices of the indicated data object.
 GeomVertexWriter (GeomVertexData *vertex_data, const string &name, Thread *current_thread=Thread::get_current_thread())
 Constructs a new writer to process the vertices of the indicated data object.
 GeomVertexWriter (GeomVertexData *vertex_data, const InternalName *name, Thread *current_thread=Thread::get_current_thread())
 Constructs a new writer to process the vertices of the indicated data object.
 GeomVertexWriter (GeomVertexArrayData *array_data, Thread *current_thread=Thread::get_current_thread())
 Constructs a new writer to process the vertices of the indicated array only.
 GeomVertexWriter (GeomVertexArrayData *array_data, int column, Thread *current_thread=Thread::get_current_thread())
 Constructs a new writer to process the vertices of the indicated array only.
 GeomVertexWriter (GeomVertexDataPipelineWriter *data_writer, const InternalName *name)
 Constructs a new writer to process the vertices of the indicated data object.
 GeomVertexWriter (const GeomVertexWriter &copy)
void add_data1 (PN_stdfloat data)
 Sets the write row to a particular 1-component value, and advances the write row.
void add_data1d (double data)
 Sets the write row to a particular 1-component value, and advances the write row.
void add_data1f (float data)
 Sets the write row to a particular 1-component value, and advances the write row.
void add_data1i (int data)
 Sets the write row to a particular 1-component value, and advances the write row.
void add_data2 (PN_stdfloat x, PN_stdfloat y)
 Sets the write row to a particular 2-component value, and advances the write row.
void add_data2 (const LVecBase2 &data)
 Sets the write row to a particular 2-component value, and advances the write row.
void add_data2d (double x, double y)
 Sets the write row to a particular 2-component value, and advances the write row.
void add_data2d (const LVecBase2d &data)
 Sets the write row to a particular 2-component value, and advances the write row.
void add_data2f (float x, float y)
 Sets the write row to a particular 2-component value, and advances the write row.
void add_data2f (const LVecBase2f &data)
 Sets the write row to a particular 2-component value, and advances the write row.
void add_data2i (int a, int b)
 Sets the write row to a particular 2-component value, and advances the write row.
void add_data2i (const int data[2])
 Sets the write row to a particular 2-component value, and advances the write row.
void add_data3 (PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
 Sets the write row to a particular 3-component value, and advances the write row.
void add_data3 (const LVecBase3 &data)
 Sets the write row to a particular 3-component value, and advances the write row.
void add_data3d (double x, double y, double z)
 Sets the write row to a particular 3-component value, and advances the write row.
void add_data3d (const LVecBase3d &data)
 Sets the write row to a particular 3-component value, and advances the write row.
void add_data3f (float x, float y, float z)
 Sets the write row to a particular 3-component value, and advances the write row.
void add_data3f (const LVecBase3f &data)
 Sets the write row to a particular 3-component value, and advances the write row.
void add_data3i (int a, int b, int c)
 Sets the write row to a particular 3-component value, and advances the write row.
void add_data3i (const int data[3])
 Sets the write row to a particular 3-component value, and advances the write row.
void add_data4 (PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat w)
 Sets the write row to a particular 4-component value, and advances the write row.
void add_data4 (const LVecBase4 &data)
 Sets the write row to a particular 4-component value, and advances the write row.
void add_data4d (double x, double y, double z, double w)
 Sets the write row to a particular 4-component value, and advances the write row.
void add_data4d (const LVecBase4d &data)
 Sets the write row to a particular 4-component value, and advances the write row.
void add_data4f (float x, float y, float z, float w)
 Sets the write row to a particular 4-component value, and advances the write row.
void add_data4f (const LVecBase4f &data)
 Sets the write row to a particular 4-component value, and advances the write row.
void add_data4i (int a, int b, int c, int d)
 Sets the write row to a particular 4-component value, and advances the write row.
void add_data4i (const int data[4])
 Sets the write row to a particular 4-component value, and advances the write row.
void clear ()
 Resets the GeomVertexWriter to the initial state.
int get_array () const
 Returns the array index containing the data type that the writer is working on.
GeomVertexArrayDataget_array_data () const
 Returns the particular array object that the writer is currently processing.
GeomVertexArrayDataHandleget_array_handle () const
 Returns the write handle to the array object that the writer is currently processing.
const GeomVertexColumnget_column () const
 Returns the description of the data type that the writer is working on.
Threadget_current_thread () const
 Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this object.
int get_start_row () const
 Returns the row index at which the writer started.
size_t get_stride () const
 Returns the per-row stride (bytes between consecutive rows) of the underlying vertex array.
GeomVertexDataget_vertex_data () const
 Returns the vertex data object that the writer is processing.
int get_write_row () const
 Returns the row index to which the data will be written at the next call to set_data*() or add_data*().
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 writer is currently at the end of the list of vertices, false otherwise.
void operator= (const GeomVertexWriter &copy)
void output (ostream &out) const
bool reserve_num_rows (int num_rows)
 This ensures that enough memory space for num_rows is allocated, so that you may add up to num_rows rows without causing a new memory allocation.
bool set_column (int column)
 Sets up the writer to use the nth data type of the GeomVertexFormat, numbering from 0.
bool set_column (const string &name)
 Sets up the writer to use the data type with the indicated name.
bool set_column (const InternalName *name)
 Sets up the writer to use the data type with the indicated name.
bool set_column (int array, const GeomVertexColumn *column)
 Sets up the writer to use the indicated column description on the given array.
void set_data1 (PN_stdfloat data)
 Sets the write row to a particular 1-component value, and advances the write row.
void set_data1d (double data)
 Sets the write row to a particular 1-component value, and advances the write row.
void set_data1f (float data)
 Sets the write row to a particular 1-component value, and advances the write row.
void set_data1i (int data)
 Sets the write row to a particular 1-component value, and advances the write row.
void set_data2 (PN_stdfloat x, PN_stdfloat y)
 Sets the write row to a particular 2-component value, and advances the write row.
void set_data2 (const LVecBase2 &data)
 Sets the write row to a particular 2-component value, and advances the write row.
void set_data2d (double x, double y)
 Sets the write row to a particular 2-component value, and advances the write row.
void set_data2d (const LVecBase2d &data)
 Sets the write row to a particular 2-component value, and advances the write row.
void set_data2f (float x, float y)
 Sets the write row to a particular 2-component value, and advances the write row.
void set_data2f (const LVecBase2f &data)
 Sets the write row to a particular 2-component value, and advances the write row.
void set_data2i (int a, int b)
 Sets the write row to a particular 2-component value, and advances the write row.
void set_data2i (const int data[2])
 Sets the write row to a particular 2-component value, and advances the write row.
void set_data3 (PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
 Sets the write row to a particular 3-component value, and advances the write row.
void set_data3 (const LVecBase3 &data)
 Sets the write row to a particular 3-component value, and advances the write row.
void set_data3d (double x, double y, double z)
 Sets the write row to a particular 3-component value, and advances the write row.
void set_data3d (const LVecBase3d &data)
 Sets the write row to a particular 3-component value, and advances the write row.
void set_data3f (float x, float y, float z)
 Sets the write row to a particular 3-component value, and advances the write row.
void set_data3f (const LVecBase3f &data)
 Sets the write row to a particular 3-component value, and advances the write row.
void set_data3i (int a, int b, int c)
 Sets the write row to a particular 3-component value, and advances the write row.
void set_data3i (const int data[3])
 Sets the write row to a particular 3-component value, and advances the write row.
void set_data4 (PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat w)
 Sets the write row to a particular 4-component value, and advances the write row.
void set_data4 (const LVecBase4 &data)
 Sets the write row to a particular 4-component value, and advances the write row.
void set_data4d (double x, double y, double z, double w)
 Sets the write row to a particular 4-component value, and advances the write row.
void set_data4d (const LVecBase4d &data)
 Sets the write row to a particular 4-component value, and advances the write row.
void set_data4f (float x, float y, float z, float w)
 Sets the write row to a particular 4-component value, and advances the write row.
void set_data4f (const LVecBase4f &data)
 Sets the write row to a particular 4-component value, and advances the write row.
void set_data4i (int a, int b, int c, int d)
 Sets the write row to a particular 4-component value, and advances the write row.
void set_data4i (const int data[4])
 Sets the write row to a particular 4-component value, and advances the write row.
void set_row (int row)
 Sets the start row to the indicated value.
void set_row_unsafe (int row)
 Sets the start row to the indicated value, without internal checks.

Protected Member Functions

GeomVertexColumn::Packer * get_packer () const
 Returns the writer's Packer object.

Detailed Description

This object provides a high-level interface for quickly writing a sequence of numeric values from a vertex table.

This object can be used both to replace existing vertices in the table, or to extend the table with new vertices. The set_data*() family of methods can only be used to replace existing data; it is an error to allow these to run past the end of the data. The add_data*() family of methods, on the other hand, can be used to replace existing data or add new data; if you call set_row() into the middle of existing data the add_data*() methods will behave like the corresponding set_data*(), but if they run past the end of existing data they will quietly add new vertices.

Like GeomVertexReader, the writer is particularly optimized for writing a single column of data values for a series of vertices, without changing columns between each number. Although you can also use one GeomVertexWriter to write across the columns if it is convenient, by calling set_column() repeatedly at each vertex, it is faster to write down the columns, and to use a different GeomVertexWriter for each column.

Note that, like a GeomVertexReader, a GeomVertexWriter does not keep a reference count to the actual vertex data buffer. This means that it is important not to keep a GeomVertexWriter object around over a long period of time in which the data buffer is likely to be deallocated; it is intended for making a quick pass over the data in one session.

It also means that you should create any GeomVertexWriters *before* creating GeomVertexReaders on the same data, since the writer itself might cause the vertex buffer to be deallocated. Better yet, use a GeomVertexRewriter if you are going to create both of them anyway.

Definition at line 69 of file geomVertexWriter.h.


Constructor & Destructor Documentation

Constructs an invalid GeomVertexWriter.

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

Definition at line 25 of file geomVertexWriter.I.

Referenced by clear().

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

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

Definition at line 39 of file geomVertexWriter.I.

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

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

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

Definition at line 54 of file geomVertexWriter.I.

References set_column().

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

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

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

Definition at line 71 of file geomVertexWriter.I.

References set_column().

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

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

Definition at line 87 of file geomVertexWriter.I.

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

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

Definition at line 102 of file geomVertexWriter.I.

References set_column().

GeomVertexWriter::GeomVertexWriter ( GeomVertexDataPipelineWriter data_writer,
const InternalName name 
) [inline]

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

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

Definition at line 119 of file geomVertexWriter.I.

References GeomVertexFormat::get_array_with(), and GeomVertexFormat::get_column().


Member Function Documentation

void GeomVertexWriter::add_data1 ( PN_stdfloat  data) [inline]

Sets the write row to a particular 1-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1085 of file geomVertexWriter.I.

References add_data1d(), and add_data1f().

void GeomVertexWriter::add_data1d ( double  data) [inline]

Sets the write row to a particular 1-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 983 of file geomVertexWriter.I.

References has_column().

Referenced by add_data1().

void GeomVertexWriter::add_data1f ( float  data) [inline]

Sets the write row to a particular 1-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 881 of file geomVertexWriter.I.

References has_column().

Referenced by add_data1().

void GeomVertexWriter::add_data1i ( int  data) [inline]

Sets the write row to a particular 1-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1211 of file geomVertexWriter.I.

References has_column().

Referenced by GeomPrimitive::add_consecutive_vertices(), GeomPrimitive::add_vertex(), GeomTristrips::append_unused_vertices(), and GeomPrimitive::pack_vertices().

void GeomVertexWriter::add_data2 ( PN_stdfloat  x,
PN_stdfloat  y 
) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1103 of file geomVertexWriter.I.

References add_data2d(), and add_data2f().

Referenced by CMotionTrail::add_geometry_quad(), PfmFile::generate_vis_points(), MeshDrawer2D::quad_raw(), and MeshDrawer::tri().

void GeomVertexWriter::add_data2 ( const LVecBase2 data) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1121 of file geomVertexWriter.I.

References add_data2d(), and add_data2f().

void GeomVertexWriter::add_data2d ( double  x,
double  y 
) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 998 of file geomVertexWriter.I.

Referenced by add_data2().

void GeomVertexWriter::add_data2d ( const LVecBase2d data) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1012 of file geomVertexWriter.I.

References has_column().

void GeomVertexWriter::add_data2f ( float  x,
float  y 
) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 896 of file geomVertexWriter.I.

Referenced by add_data2(), and PhysxSoftBodyNode::set_from_geom().

void GeomVertexWriter::add_data2f ( const LVecBase2f data) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 910 of file geomVertexWriter.I.

References has_column().

void GeomVertexWriter::add_data2i ( int  a,
int  b 
) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1226 of file geomVertexWriter.I.

References has_column().

Referenced by add_data2i().

void GeomVertexWriter::add_data2i ( const int  data[2]) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1241 of file geomVertexWriter.I.

References add_data2i().

void GeomVertexWriter::add_data3 ( PN_stdfloat  x,
PN_stdfloat  y,
PN_stdfloat  z 
) [inline]
void GeomVertexWriter::add_data3 ( const LVecBase3 data) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1157 of file geomVertexWriter.I.

References add_data3d(), and add_data3f().

void GeomVertexWriter::add_data3d ( double  x,
double  y,
double  z 
) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1027 of file geomVertexWriter.I.

Referenced by add_data3().

void GeomVertexWriter::add_data3d ( const LVecBase3d data) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1041 of file geomVertexWriter.I.

References has_column().

void GeomVertexWriter::add_data3f ( float  x,
float  y,
float  z 
) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 925 of file geomVertexWriter.I.

Referenced by add_data3(), and PhysxSoftBodyNode::set_from_geom().

void GeomVertexWriter::add_data3f ( const LVecBase3f data) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 939 of file geomVertexWriter.I.

References has_column().

void GeomVertexWriter::add_data3i ( int  a,
int  b,
int  c 
) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1255 of file geomVertexWriter.I.

References has_column().

Referenced by add_data3i().

void GeomVertexWriter::add_data3i ( const int  data[3]) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1270 of file geomVertexWriter.I.

References add_data3i().

void GeomVertexWriter::add_data4 ( PN_stdfloat  x,
PN_stdfloat  y,
PN_stdfloat  z,
PN_stdfloat  w 
) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1175 of file geomVertexWriter.I.

References add_data4d(), and add_data4f().

Referenced by CMotionTrail::add_geometry_quad(), LineSegs::create(), PortalClipper::draw_lines(), CollisionLine::fill_viz_geom(), CollisionRay::fill_viz_geom(), CollisionParabola::fill_viz_geom(), MeshDrawer2D::quad_raw(), and MeshDrawer::tri().

void GeomVertexWriter::add_data4 ( const LVecBase4 data) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1193 of file geomVertexWriter.I.

References add_data4d(), and add_data4f().

void GeomVertexWriter::add_data4d ( double  x,
double  y,
double  z,
double  w 
) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1056 of file geomVertexWriter.I.

Referenced by add_data4().

void GeomVertexWriter::add_data4d ( const LVecBase4d data) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1070 of file geomVertexWriter.I.

References has_column().

void GeomVertexWriter::add_data4f ( float  x,
float  y,
float  z,
float  w 
) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 954 of file geomVertexWriter.I.

Referenced by add_data4().

void GeomVertexWriter::add_data4f ( const LVecBase4f data) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 968 of file geomVertexWriter.I.

References has_column().

void GeomVertexWriter::add_data4i ( int  a,
int  b,
int  c,
int  d 
) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1284 of file geomVertexWriter.I.

References has_column().

Referenced by add_data4i().

void GeomVertexWriter::add_data4i ( const int  data[4]) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

If the write row advances past the end of data, implicitly adds a new row to the data.

Definition at line 1299 of file geomVertexWriter.I.

References add_data4i().

void GeomVertexWriter::clear ( ) [inline]

Resets the GeomVertexWriter to the initial state.

Reimplemented in GeomVertexRewriter.

Definition at line 324 of file geomVertexWriter.I.

References GeomVertexWriter().

int GeomVertexWriter::get_array ( ) const [inline]

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

Reimplemented in GeomVertexRewriter.

Definition at line 347 of file geomVertexWriter.I.

Referenced by GeomVertexData::copy_from(), GeomVertexData::describe_vertex(), and GeomVertexRewriter::get_array().

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

Reimplemented in GeomVertexRewriter.

Definition at line 200 of file geomVertexWriter.I.

Referenced by GeomVertexRewriter::get_array_data().

Returns the write handle to the array object that the writer is currently processing.

This low-level call should be used with caution; be careful with modifying the data in the handle out from under the GeomVertexWriter.

Reimplemented in GeomVertexRewriter.

Definition at line 214 of file geomVertexWriter.I.

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

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

Reimplemented in GeomVertexRewriter.

Definition at line 358 of file geomVertexWriter.I.

Referenced by GeomVertexRewriter::get_column(), and GeomVertexRewriter::has_column().

Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this object.

Reimplemented in GeomVertexRewriter.

Definition at line 238 of file geomVertexWriter.I.

Referenced by GeomVertexData::clear_rows(), GeomVertexRewriter::get_current_thread(), GeomVertexData::set_format(), and GeomVertexData::set_transform_table().

GeomVertexColumn::Packer * GeomVertexWriter::get_packer ( ) const [inline, protected]

Returns the writer's Packer object.

Definition at line 1309 of file geomVertexWriter.I.

int GeomVertexWriter::get_start_row ( ) const [inline]

Returns the row index at which the writer started.

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

Reimplemented in GeomVertexRewriter.

Definition at line 409 of file geomVertexWriter.I.

Referenced by GeomVertexRewriter::get_start_row().

size_t GeomVertexWriter::get_stride ( ) const [inline]

Returns the per-row stride (bytes between consecutive rows) of the underlying vertex array.

This low-level information is normally not needed to use the GeomVertexWriter directly.

Reimplemented in GeomVertexRewriter.

Definition at line 227 of file geomVertexWriter.I.

Referenced by GeomVertexRewriter::get_stride().

Returns the vertex data object that the writer is processing.

This may return NULL if the writer was constructed with just an array pointer.

Reimplemented in GeomVertexRewriter.

Definition at line 189 of file geomVertexWriter.I.

Referenced by GeomVertexRewriter::get_vertex_data().

int GeomVertexWriter::get_write_row ( ) const [inline]

Returns the row index to which the data will be written at the next call to set_data*() or add_data*().

Definition at line 421 of file geomVertexWriter.I.

bool GeomVertexWriter::has_column ( ) const [inline]
bool GeomVertexWriter::is_at_end ( ) const [inline]

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

If this is true, another call to set_data*() will result in a crash, but another call to add_data*() will add a new row.

Reimplemented in GeomVertexRewriter.

Definition at line 435 of file geomVertexWriter.I.

bool GeomVertexWriter::reserve_num_rows ( int  num_rows)

This ensures that enough memory space for num_rows is allocated, so that you may add up to num_rows rows without causing a new memory allocation.

This is a performance optimization only; it is especially useful when you know the number of rows you will be adding ahead of time.

Definition at line 79 of file geomVertexWriter.cxx.

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

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

This also resets the write row number 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 in GeomVertexRewriter.

Definition at line 256 of file geomVertexWriter.I.

References GeomVertexFormat::get_array_with(), and GeomVertexFormat::get_column().

Referenced by GeomVertexData::copy_from(), GeomVertexWriter(), and set_column().

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

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

This also resets the write row number 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 in GeomVertexRewriter.

Definition at line 285 of file geomVertexWriter.I.

References set_column().

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

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

This also resets the write number 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 in GeomVertexRewriter.

Definition at line 303 of file geomVertexWriter.I.

References GeomVertexFormat::get_array_with(), and GeomVertexFormat::get_column().

bool GeomVertexWriter::set_column ( int  array,
const GeomVertexColumn column 
)

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

This also resets the current write row number 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 in GeomVertexRewriter.

Definition at line 38 of file geomVertexWriter.cxx.

void GeomVertexWriter::set_data1 ( PN_stdfloat  data) [inline]

Sets the write row to a particular 1-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 653 of file geomVertexWriter.I.

References set_data1d(), and set_data1f().

void GeomVertexWriter::set_data1d ( double  data) [inline]

Sets the write row to a particular 1-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 551 of file geomVertexWriter.I.

References has_column().

Referenced by set_data1().

void GeomVertexWriter::set_data1f ( float  data) [inline]

Sets the write row to a particular 1-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 449 of file geomVertexWriter.I.

References has_column().

Referenced by set_data1().

void GeomVertexWriter::set_data1i ( int  data) [inline]

Sets the write row to a particular 1-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 779 of file geomVertexWriter.I.

References has_column().

Referenced by GeomPrimitive::offset_vertices().

void GeomVertexWriter::set_data2 ( PN_stdfloat  x,
PN_stdfloat  y 
) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 671 of file geomVertexWriter.I.

References set_data2d(), and set_data2f().

void GeomVertexWriter::set_data2 ( const LVecBase2 data) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 689 of file geomVertexWriter.I.

References set_data2d(), and set_data2f().

void GeomVertexWriter::set_data2d ( double  x,
double  y 
) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 566 of file geomVertexWriter.I.

Referenced by set_data2().

void GeomVertexWriter::set_data2d ( const LVecBase2d data) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 580 of file geomVertexWriter.I.

References has_column().

void GeomVertexWriter::set_data2f ( float  x,
float  y 
) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 464 of file geomVertexWriter.I.

Referenced by set_data2().

void GeomVertexWriter::set_data2f ( const LVecBase2f data) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 478 of file geomVertexWriter.I.

References has_column().

void GeomVertexWriter::set_data2i ( int  a,
int  b 
) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 794 of file geomVertexWriter.I.

References has_column().

Referenced by set_data2i().

void GeomVertexWriter::set_data2i ( const int  data[2]) [inline]

Sets the write row to a particular 2-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 809 of file geomVertexWriter.I.

References set_data2i().

void GeomVertexWriter::set_data3 ( PN_stdfloat  x,
PN_stdfloat  y,
PN_stdfloat  z 
) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 707 of file geomVertexWriter.I.

References set_data3d(), and set_data3f().

Referenced by STBasicTerrain::fill_vertices(), and LineSegs::set_vertex().

void GeomVertexWriter::set_data3 ( const LVecBase3 data) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 725 of file geomVertexWriter.I.

References set_data3d(), and set_data3f().

void GeomVertexWriter::set_data3d ( double  x,
double  y,
double  z 
) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 595 of file geomVertexWriter.I.

Referenced by set_data3().

void GeomVertexWriter::set_data3d ( const LVecBase3d data) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 609 of file geomVertexWriter.I.

References has_column().

void GeomVertexWriter::set_data3f ( float  x,
float  y,
float  z 
) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 493 of file geomVertexWriter.I.

Referenced by set_data3().

void GeomVertexWriter::set_data3f ( const LVecBase3f data) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 507 of file geomVertexWriter.I.

References has_column().

void GeomVertexWriter::set_data3i ( int  a,
int  b,
int  c 
) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 823 of file geomVertexWriter.I.

References has_column().

Referenced by set_data3i().

void GeomVertexWriter::set_data3i ( const int  data[3]) [inline]

Sets the write row to a particular 3-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 838 of file geomVertexWriter.I.

References set_data3i().

void GeomVertexWriter::set_data4 ( PN_stdfloat  x,
PN_stdfloat  y,
PN_stdfloat  z,
PN_stdfloat  w 
) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 743 of file geomVertexWriter.I.

References set_data4d(), and set_data4f().

Referenced by GeomVertexData::copy_from(), LineSegs::set_vertex_color(), and GeomTransformer::transform_texcoords().

void GeomVertexWriter::set_data4 ( const LVecBase4 data) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 761 of file geomVertexWriter.I.

References set_data4d(), and set_data4f().

void GeomVertexWriter::set_data4d ( double  x,
double  y,
double  z,
double  w 
) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 624 of file geomVertexWriter.I.

Referenced by set_data4().

void GeomVertexWriter::set_data4d ( const LVecBase4d data) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 638 of file geomVertexWriter.I.

References has_column().

void GeomVertexWriter::set_data4f ( float  x,
float  y,
float  z,
float  w 
) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 522 of file geomVertexWriter.I.

Referenced by set_data4().

void GeomVertexWriter::set_data4f ( const LVecBase4f data) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 536 of file geomVertexWriter.I.

References has_column().

void GeomVertexWriter::set_data4i ( int  a,
int  b,
int  c,
int  d 
) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 852 of file geomVertexWriter.I.

References has_column().

Referenced by GeomVertexData::copy_from(), and set_data4i().

void GeomVertexWriter::set_data4i ( const int  data[4]) [inline]

Sets the write row to a particular 4-component value, and advances the write row.

It is an error for the write row to advance past the end of data.

Definition at line 867 of file geomVertexWriter.I.

References set_data4i().

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

Sets the start row to the indicated value.

The writer will begin writing to the indicated row; each subsequent set_data*() call will store the data into the subsequent row. If set_column() is called, the writer will return to this row.

Reimplemented in GeomVertexRewriter.

Definition at line 394 of file geomVertexWriter.I.

References has_column().

void GeomVertexWriter::set_row_unsafe ( int  row) [inline]

Sets the start row to the indicated value, without internal checks.

This is the same as set_row(), but it does not check for the possibility that the array has been reallocated internally for some reason; use only when you are confident that the array is unchanged and you really need every bit of available performance.

Reimplemented in GeomVertexRewriter.

Definition at line 377 of file geomVertexWriter.I.

References has_column().

Referenced by GeomPrimitive::add_consecutive_vertices(), GeomPrimitive::add_vertex(), GeomTristrips::append_unused_vertices(), LineSegs::set_vertex(), and LineSegs::set_vertex_color().


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