15 #include "geomVertexWriter.h"
21 unsigned char GeomVertexWriter::empty_buffer[100] = { 0 };
57 writer.check_array_writers();
58 return set_vertex_column(array, column, &writer);
61 return set_array_column(column);
86 writer.check_array_writers();
87 result = writer.reserve_num_rows(num_rows);
88 _handle = writer.get_array_writer(_array);
93 result = _handle->reserve_num_rows(num_rows);
104 void GeomVertexWriter::
105 output(ostream &out)
const {
108 out <<
"GeomVertexWriter()";
112 <<
", column = " << column->
get_name()
113 <<
" (" << get_packer()->get_name()
123 void GeomVertexWriter::
127 _pointer_begin = NULL;
139 bool GeomVertexWriter::
151 nassertr(array >= 0 && array < _vertex_data->get_num_arrays(),
false);
155 _handle = data_writer->get_array_writer(_array);
156 _stride = _handle->get_array_format()->get_stride();
158 _packer = column->_packer;
159 set_pointer(_start_row);
171 bool GeomVertexWriter::
179 _handle = _array_data->modify_handle();
180 _stride = _handle->get_array_format()->get_stride();
182 _packer = column->_packer;
183 set_pointer(_start_row);
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*(...
const InternalName * get_name() const
Returns the name of this particular data field, e.g.
Encapsulates the data from a GeomVertexData, pre-fetched for one stage of the pipeline.
This defines how a single column is interleaved within a vertex array stored within a Geom...
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 r...
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
GeomVertexArrayData * get_array_data() const
Returns the particular array object that the writer is currently processing.
const GeomVertexColumn * get_column() const
Returns the description of the data type that the writer is working on.
bool set_column(int column)
Sets up the writer to use the nth data type of the GeomVertexFormat, numbering from 0...
This is the data for one array of a GeomVertexData structure.