Panda3D
Public Member Functions | List of all members
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

Public Member Functions

 GeomVertexWriter (Thread *current_thread=Thread::get_current_thread())
 Constructs an invalid GeomVertexWriter. More...
 
 GeomVertexWriter (GeomVertexData *vertex_data, Thread *current_thread=Thread::get_current_thread())
 Constructs a new writer to process the vertices of the indicated data object. More...
 
 GeomVertexWriter (GeomVertexData *vertex_data, CPT_InternalName name, Thread *current_thread=Thread::get_current_thread())
 Constructs a new writer to process the vertices of the indicated data object. More...
 
 GeomVertexWriter (GeomVertexArrayData *array_data, Thread *current_thread=Thread::get_current_thread())
 Constructs a new writer to process the vertices of the indicated array only. More...
 
 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. More...
 
 GeomVertexWriter (GeomVertexDataPipelineWriter *data_writer, const InternalName *name)
 Constructs a new writer to process the vertices of the indicated data object. More...
 
 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. More...
 
void add_data1d (double data)
 Sets the write row to a particular 1-component value, and advances the write row. More...
 
void add_data1f (float data)
 Sets the write row to a particular 1-component value, and advances the write row. More...
 
void add_data1i (int data)
 Sets the write row to a particular 1-component value, and advances the write row. More...
 
void add_data2 (PN_stdfloat x, PN_stdfloat y)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void add_data2 (const LVecBase2 &data)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void add_data2d (double x, double y)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void add_data2d (const LVecBase2d &data)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void add_data2f (float x, float y)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void add_data2f (const LVecBase2f &data)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void add_data2i (int a, int b)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void add_data2i (const LVecBase2i &data)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
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. More...
 
void add_data3 (const LVecBase3 &data)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
void add_data3d (double x, double y, double z)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
void add_data3d (const LVecBase3d &data)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
void add_data3f (float x, float y, float z)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
void add_data3f (const LVecBase3f &data)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
void add_data3i (int a, int b, int c)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
void add_data3i (const LVecBase3i &data)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
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. More...
 
void add_data4 (const LVecBase4 &data)
 Sets the write row to a particular 4-component value, and advances the write row. More...
 
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. More...
 
void add_data4d (const LVecBase4d &data)
 Sets the write row to a particular 4-component value, and advances the write row. More...
 
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. More...
 
void add_data4f (const LVecBase4f &data)
 Sets the write row to a particular 4-component value, and advances the write row. More...
 
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. More...
 
void add_data4i (const LVecBase4i &data)
 Sets the write row to a particular 4-component value, and advances the write row. More...
 
void add_matrix3 (const LMatrix3 &mat)
 Sets the write row to a 3-by-3 matrix, and advances the write row. More...
 
void add_matrix3d (const LMatrix3d &mat)
 Sets the write row to a 3-by-3 matrix, and advances the write row. More...
 
void add_matrix3f (const LMatrix3f &mat)
 Sets the write row to a 3-by-3 matrix, and advances the write row. More...
 
void add_matrix4 (const LMatrix4 &mat)
 Sets the write row to a 4-by-4 matrix, and advances the write row. More...
 
void add_matrix4d (const LMatrix4d &mat)
 Sets the write row to a 4-by-4 matrix, and advances the write row. More...
 
void add_matrix4f (const LMatrix4f &mat)
 Sets the write row to a 4-by-4 matrix, and advances the write row. More...
 
void clear ()
 Resets the GeomVertexWriter to the initial state. More...
 
int get_array () const
 Returns the array index containing the data type that the writer is working on. More...
 
GeomVertexArrayDataget_array_data () const
 Returns the particular array object that the writer is currently processing. More...
 
GeomVertexArrayDataHandleget_array_handle () const
 Returns the write handle to the array object that the writer is currently processing. More...
 
const GeomVertexColumnget_column () const
 Returns the description of the data type that the writer is working on. More...
 
Threadget_current_thread () const
 Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this object. More...
 
int get_start_row () const
 Returns the row index at which the writer started. More...
 
size_t get_stride () const
 Returns the per-row stride (bytes between consecutive rows) of the underlying vertex array. More...
 
GeomVertexDataget_vertex_data () const
 Returns the vertex data object that the writer is processing. More...
 
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*(). More...
 
bool has_column () const
 Returns true if a valid data type has been successfully set, or false if the data type does not exist. More...
 
bool is_at_end () const
 Returns true if the writer is currently at the end of the list of vertices, false otherwise. More...
 
void operator= (const GeomVertexWriter &copy)
 
void output (std::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. More...
 
bool set_column (int column)
 Sets up the writer to use the nth data type of the GeomVertexFormat, numbering from 0. More...
 
bool set_column (CPT_InternalName name)
 Sets up the writer to use the data type with the indicated name. More...
 
bool set_column (int array, const GeomVertexColumn *column)
 Sets up the writer to use the indicated column description on the given array. More...
 
void set_data1 (PN_stdfloat data)
 Sets the write row to a particular 1-component value, and advances the write row. More...
 
void set_data1d (double data)
 Sets the write row to a particular 1-component value, and advances the write row. More...
 
void set_data1f (float data)
 Sets the write row to a particular 1-component value, and advances the write row. More...
 
void set_data1i (int data)
 Sets the write row to a particular 1-component value, and advances the write row. More...
 
void set_data2 (PN_stdfloat x, PN_stdfloat y)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void set_data2 (const LVecBase2 &data)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void set_data2d (double x, double y)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void set_data2d (const LVecBase2d &data)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void set_data2f (float x, float y)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void set_data2f (const LVecBase2f &data)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void set_data2i (int a, int b)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
void set_data2i (const LVecBase2i &data)
 Sets the write row to a particular 2-component value, and advances the write row. More...
 
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. More...
 
void set_data3 (const LVecBase3 &data)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
void set_data3d (double x, double y, double z)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
void set_data3d (const LVecBase3d &data)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
void set_data3f (float x, float y, float z)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
void set_data3f (const LVecBase3f &data)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
void set_data3i (int a, int b, int c)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
void set_data3i (const LVecBase3i &data)
 Sets the write row to a particular 3-component value, and advances the write row. More...
 
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. More...
 
void set_data4 (const LVecBase4 &data)
 Sets the write row to a particular 4-component value, and advances the write row. More...
 
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. More...
 
void set_data4d (const LVecBase4d &data)
 Sets the write row to a particular 4-component value, and advances the write row. More...
 
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. More...
 
void set_data4f (const LVecBase4f &data)
 Sets the write row to a particular 4-component value, and advances the write row. More...
 
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. More...
 
void set_data4i (const LVecBase4i &data)
 Sets the write row to a particular 4-component value, and advances the write row. More...
 
void set_matrix3 (const LMatrix3 &mat)
 Sets the write row to a 3-by-3 matrix, and advances the write row. More...
 
void set_matrix3d (const LMatrix3d &mat)
 Sets the write row to a 3-by-3 matrix, and advances the write row. More...
 
void set_matrix3f (const LMatrix3f &mat)
 Sets the write row to a 3-by-3 matrix, and advances the write row. More...
 
void set_matrix4 (const LMatrix4 &mat)
 Sets the write row to a 4-by-4 matrix, and advances the write row. More...
 
void set_matrix4d (const LMatrix4d &mat)
 Sets the write row to a 4-by-4 matrix, and advances the write row. More...
 
void set_matrix4f (const LMatrix4f &mat)
 Sets the write row to a 4-by-4 matrix, and advances the write row. More...
 
void set_row (int row)
 Sets the start row to the indicated value. More...
 
void set_row_unsafe (int row)
 Sets the start row to the indicated value, without internal checks. More...
 

Additional Inherited Members

- Public Types inherited from GeomEnums
enum  AnimationType { AT_none, AT_panda, AT_hardware }
 
enum  Contents {
  C_other, C_point, C_clip_point, C_vector,
  C_texcoord, C_color, C_index, C_morph_delta,
  C_matrix, C_normal
}
 
enum  GeomRendering {
  GR_indexed_point = 0x00001, GR_indexed_other = 0x10000, GR_indexed_bits = 0x10001, GR_point = 0x00002,
  GR_point_uniform_size = 0x00004, GR_per_point_size = 0x00008, GR_point_perspective = 0x00010, GR_point_aspect_ratio = 0x00020,
  GR_point_scale = 0x00040, GR_point_rotate = 0x00080, GR_point_sprite = 0x00100, GR_point_sprite_tex_matrix = 0x00200,
  GR_point_bits = 0x003fe, GR_triangle_strip = 0x00400, GR_triangle_fan = 0x00800, GR_line_strip = 0x01000,
  GR_composite_bits = 0x01c00, GR_strip_cut_index = 0x20000, GR_flat_first_vertex = 0x02000, GR_flat_last_vertex = 0x04000,
  GR_shade_model_bits = 0x06000, GR_render_mode_wireframe = 0x40000, GR_render_mode_point = 0x80000, GR_adjacency = 0x100000
}
 
enum  NumericType {
  NT_uint8, NT_uint16, NT_uint32, NT_packed_dcba,
  NT_packed_dabc, NT_float32, NT_float64, NT_stdfloat,
  NT_int8, NT_int16, NT_int32, NT_packed_ufloat
}
 
enum  PrimitiveType {
  PT_none, PT_polygons, PT_lines, PT_points,
  PT_patches
}
 
enum  ShadeModel { SM_uniform, SM_smooth, SM_flat_first_vertex, SM_flat_last_vertex }
 
enum  UsageHint {
  UH_client, UH_stream, UH_dynamic, UH_static,
  UH_unspecified
}
 

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 55 of file geomVertexWriter.h.

Constructor & Destructor Documentation

◆ GeomVertexWriter() [1/6]

GeomVertexWriter::GeomVertexWriter ( Thread current_thread = Thread::get_current_thread())
inline

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 20 of file geomVertexWriter.I.

Referenced by clear().

◆ GeomVertexWriter() [2/6]

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 32 of file geomVertexWriter.I.

◆ GeomVertexWriter() [3/6]

GeomVertexWriter::GeomVertexWriter ( GeomVertexData vertex_data,
CPT_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 45 of file geomVertexWriter.I.

◆ GeomVertexWriter() [4/6]

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 59 of file geomVertexWriter.I.

◆ GeomVertexWriter() [5/6]

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 72 of file geomVertexWriter.I.

◆ GeomVertexWriter() [6/6]

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 87 of file geomVertexWriter.I.

Member Function Documentation

◆ add_data1()

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 1084 of file geomVertexWriter.I.

◆ add_data1d()

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 948 of file geomVertexWriter.I.

◆ add_data1f()

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 812 of file geomVertexWriter.I.

◆ add_data1i()

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 1228 of file geomVertexWriter.I.

◆ add_data2() [1/2]

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 1100 of file geomVertexWriter.I.

References add_data2d(), and add_data2f().

Referenced by CMotionTrail::add_geometry_quad(), and MeshDrawer2D::quad_raw().

◆ add_data2() [2/2]

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 1116 of file geomVertexWriter.I.

◆ add_data2d() [1/2]

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 961 of file geomVertexWriter.I.

Referenced by add_data2().

◆ add_data2d() [2/2]

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 973 of file geomVertexWriter.I.

◆ add_data2f() [1/2]

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 825 of file geomVertexWriter.I.

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

◆ add_data2f() [2/2]

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 837 of file geomVertexWriter.I.

◆ add_data2i() [1/2]

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 1241 of file geomVertexWriter.I.

◆ add_data2i() [2/2]

void GeomVertexWriter::add_data2i ( const LVecBase2i &  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 1253 of file geomVertexWriter.I.

◆ add_data3() [1/2]

void GeomVertexWriter::add_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.

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

Definition at line 1132 of file geomVertexWriter.I.

References add_data3d(), and add_data3f().

Referenced by CMotionTrail::add_geometry_quad(), PortalClipper::draw_lines(), and MeshDrawer2D::quad_raw().

◆ add_data3() [2/2]

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 1148 of file geomVertexWriter.I.

◆ add_data3d() [1/2]

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 986 of file geomVertexWriter.I.

Referenced by add_data3().

◆ add_data3d() [2/2]

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 998 of file geomVertexWriter.I.

◆ add_data3f() [1/2]

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 850 of file geomVertexWriter.I.

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

◆ add_data3f() [2/2]

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 862 of file geomVertexWriter.I.

◆ add_data3i() [1/2]

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 1266 of file geomVertexWriter.I.

◆ add_data3i() [2/2]

void GeomVertexWriter::add_data3i ( const LVecBase3i &  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 1278 of file geomVertexWriter.I.

◆ add_data4() [1/2]

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 1164 of file geomVertexWriter.I.

References add_data4d(), and add_data4f().

Referenced by CMotionTrail::add_geometry_quad(), PortalClipper::draw_lines(), and MeshDrawer2D::quad_raw().

◆ add_data4() [2/2]

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 1180 of file geomVertexWriter.I.

◆ add_data4d() [1/2]

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 1011 of file geomVertexWriter.I.

Referenced by add_data4().

◆ add_data4d() [2/2]

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 1023 of file geomVertexWriter.I.

◆ add_data4f() [1/2]

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 875 of file geomVertexWriter.I.

Referenced by add_data4().

◆ add_data4f() [2/2]

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 887 of file geomVertexWriter.I.

◆ add_data4i() [1/2]

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 1291 of file geomVertexWriter.I.

◆ add_data4i() [2/2]

void GeomVertexWriter::add_data4i ( const LVecBase4i &  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 1303 of file geomVertexWriter.I.

◆ add_matrix3()

void GeomVertexWriter::add_matrix3 ( const LMatrix3 &  mat)
inline

Sets the write row to a 3-by-3 matrix, and advances the write row.

This is a special method that can only be used on matrix columns.

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

Definition at line 1196 of file geomVertexWriter.I.

◆ add_matrix3d()

void GeomVertexWriter::add_matrix3d ( const LMatrix3d &  mat)
inline

Sets the write row to a 3-by-3 matrix, and advances the write row.

This is a special method that can only be used on matrix columns.

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

Definition at line 1036 of file geomVertexWriter.I.

◆ add_matrix3f()

void GeomVertexWriter::add_matrix3f ( const LMatrix3f &  mat)
inline

Sets the write row to a 3-by-3 matrix, and advances the write row.

This is a special method that can only be used on matrix columns.

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

Definition at line 900 of file geomVertexWriter.I.

◆ add_matrix4()

void GeomVertexWriter::add_matrix4 ( const LMatrix4 &  mat)
inline

Sets the write row to a 4-by-4 matrix, and advances the write row.

This is a special method that can only be used on matrix columns.

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

Definition at line 1212 of file geomVertexWriter.I.

◆ add_matrix4d()

void GeomVertexWriter::add_matrix4d ( const LMatrix4d &  mat)
inline

Sets the write row to a 4-by-4 matrix, and advances the write row.

This is a special method that can only be used on matrix columns.

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

Definition at line 1059 of file geomVertexWriter.I.

◆ add_matrix4f()

void GeomVertexWriter::add_matrix4f ( const LMatrix4f &  mat)
inline

Sets the write row to a 4-by-4 matrix, and advances the write row.

This is a special method that can only be used on matrix columns.

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

Definition at line 923 of file geomVertexWriter.I.

◆ clear()

void GeomVertexWriter::clear ( )
inline

Resets the GeomVertexWriter to the initial state.

Definition at line 244 of file geomVertexWriter.I.

References GeomVertexWriter().

Referenced by GeomVertexRewriter::clear().

◆ get_array()

int GeomVertexWriter::get_array ( ) const
inline

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

Definition at line 262 of file geomVertexWriter.I.

Referenced by GeomVertexData::copy_from().

◆ get_array_data()

GeomVertexArrayData * GeomVertexWriter::get_array_data ( ) const
inline

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

Definition at line 157 of file geomVertexWriter.I.

◆ get_array_handle()

GeomVertexArrayDataHandle * GeomVertexWriter::get_array_handle ( ) const
inline

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.

Definition at line 167 of file geomVertexWriter.I.

Referenced by GeomVertexRewriter::get_array_handle().

◆ get_column()

const GeomVertexColumn * GeomVertexWriter::get_column ( ) const
inline

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

Definition at line 270 of file geomVertexWriter.I.

◆ get_current_thread()

Thread * GeomVertexWriter::get_current_thread ( ) const
inline

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

Definition at line 186 of file geomVertexWriter.I.

◆ get_start_row()

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.

Definition at line 311 of file geomVertexWriter.I.

◆ get_stride()

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.

Definition at line 177 of file geomVertexWriter.I.

◆ get_vertex_data()

GeomVertexData * GeomVertexWriter::get_vertex_data ( ) const
inline

Returns the vertex data object that the writer is processing.

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

Definition at line 148 of file geomVertexWriter.I.

◆ get_write_row()

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 320 of file geomVertexWriter.I.

◆ has_column()

bool GeomVertexWriter::has_column ( ) const
inline

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

Definition at line 253 of file geomVertexWriter.I.

Referenced by set_row(), and set_row_unsafe().

◆ is_at_end()

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.

Definition at line 330 of file geomVertexWriter.I.

Referenced by GeomVertexRewriter::is_at_end().

◆ reserve_num_rows()

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 70 of file geomVertexWriter.cxx.

◆ set_column() [1/3]

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.

Definition at line 201 of file geomVertexWriter.I.

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

Referenced by GeomVertexRewriter::set_column().

◆ set_column() [2/3]

bool GeomVertexWriter::set_column ( CPT_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.

Definition at line 225 of file geomVertexWriter.I.

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

◆ set_column() [3/3]

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.

Definition at line 33 of file geomVertexWriter.cxx.

◆ set_data1()

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 595 of file geomVertexWriter.I.

◆ set_data1d()

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 468 of file geomVertexWriter.I.

◆ set_data1f()

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 341 of file geomVertexWriter.I.

◆ set_data1i()

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 730 of file geomVertexWriter.I.

◆ set_data2() [1/2]

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 610 of file geomVertexWriter.I.

References set_data2d(), and set_data2f().

◆ set_data2() [2/2]

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 625 of file geomVertexWriter.I.

◆ set_data2d() [1/2]

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 480 of file geomVertexWriter.I.

Referenced by set_data2().

◆ set_data2d() [2/2]

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 491 of file geomVertexWriter.I.

◆ set_data2f() [1/2]

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 353 of file geomVertexWriter.I.

Referenced by set_data2().

◆ set_data2f() [2/2]

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 364 of file geomVertexWriter.I.

◆ set_data2i() [1/2]

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 742 of file geomVertexWriter.I.

◆ set_data2i() [2/2]

void GeomVertexWriter::set_data2i ( const LVecBase2i &  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 753 of file geomVertexWriter.I.

◆ set_data3() [1/2]

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 640 of file geomVertexWriter.I.

References set_data3d(), and set_data3f().

◆ set_data3() [2/2]

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 655 of file geomVertexWriter.I.

◆ set_data3d() [1/2]

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 503 of file geomVertexWriter.I.

Referenced by set_data3().

◆ set_data3d() [2/2]

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 514 of file geomVertexWriter.I.

◆ set_data3f() [1/2]

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 376 of file geomVertexWriter.I.

Referenced by set_data3().

◆ set_data3f() [2/2]

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 387 of file geomVertexWriter.I.

◆ set_data3i() [1/2]

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 765 of file geomVertexWriter.I.

◆ set_data3i() [2/2]

void GeomVertexWriter::set_data3i ( const LVecBase3i &  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 776 of file geomVertexWriter.I.

◆ set_data4() [1/2]

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 670 of file geomVertexWriter.I.

References set_data4d(), and set_data4f().

◆ set_data4() [2/2]

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 685 of file geomVertexWriter.I.

◆ set_data4d() [1/2]

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 526 of file geomVertexWriter.I.

Referenced by set_data4().

◆ set_data4d() [2/2]

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 537 of file geomVertexWriter.I.

◆ set_data4f() [1/2]

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 399 of file geomVertexWriter.I.

Referenced by set_data4().

◆ set_data4f() [2/2]

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 410 of file geomVertexWriter.I.

◆ set_data4i() [1/2]

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 788 of file geomVertexWriter.I.

◆ set_data4i() [2/2]

void GeomVertexWriter::set_data4i ( const LVecBase4i &  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 799 of file geomVertexWriter.I.

◆ set_matrix3()

void GeomVertexWriter::set_matrix3 ( const LMatrix3 &  mat)
inline

Sets the write row to a 3-by-3 matrix, and advances the write row.

This is a special method that can only be used on matrix columns.

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

Definition at line 700 of file geomVertexWriter.I.

◆ set_matrix3d()

void GeomVertexWriter::set_matrix3d ( const LMatrix3d &  mat)
inline

Sets the write row to a 3-by-3 matrix, and advances the write row.

This is a special method that can only be used on matrix columns.

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

Definition at line 549 of file geomVertexWriter.I.

◆ set_matrix3f()

void GeomVertexWriter::set_matrix3f ( const LMatrix3f &  mat)
inline

Sets the write row to a 3-by-3 matrix, and advances the write row.

This is a special method that can only be used on matrix columns.

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

Definition at line 422 of file geomVertexWriter.I.

◆ set_matrix4()

void GeomVertexWriter::set_matrix4 ( const LMatrix4 &  mat)
inline

Sets the write row to a 4-by-4 matrix, and advances the write row.

This is a special method that can only be used on matrix columns.

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

Definition at line 715 of file geomVertexWriter.I.

◆ set_matrix4d()

void GeomVertexWriter::set_matrix4d ( const LMatrix4d &  mat)
inline

Sets the write row to a 4-by-4 matrix, and advances the write row.

This is a special method that can only be used on matrix columns.

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

Definition at line 571 of file geomVertexWriter.I.

◆ set_matrix4f()

void GeomVertexWriter::set_matrix4f ( const LMatrix4f &  mat)
inline

Sets the write row to a 4-by-4 matrix, and advances the write row.

This is a special method that can only be used on matrix columns.

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

Definition at line 444 of file geomVertexWriter.I.

◆ set_row()

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.

Definition at line 299 of file geomVertexWriter.I.

References has_column().

Referenced by GeomVertexRewriter::set_row().

◆ set_row_unsafe()

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.

Definition at line 285 of file geomVertexWriter.I.

References has_column().

Referenced by GeomVertexRewriter::set_row_unsafe().


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