19 unsigned char GeomVertexWriter::empty_buffer[100] = { 0 };
34 if (_vertex_data ==
nullptr &&
35 _array_data ==
nullptr) {
39 if (column ==
nullptr) {
45 _pointer_end =
nullptr;
50 if (_vertex_data !=
nullptr) {
52 writer.check_array_writers();
53 return set_vertex_column(array, column, &writer);
55 if (_array_data !=
nullptr) {
56 return set_array_column(column);
73 if (_vertex_data !=
nullptr) {
77 writer.check_array_writers();
78 result = writer.reserve_num_rows(num_rows);
79 _handle = writer.get_array_writer(_array);
84 result = _handle->reserve_num_rows(num_rows);
93 void GeomVertexWriter::
94 output(std::ostream &out)
const {
96 if (column ==
nullptr) {
97 out <<
"GeomVertexWriter()";
101 <<
", column = " << column->
get_name()
102 <<
" (" << get_packer()->get_name()
110 void GeomVertexWriter::
114 _pointer_begin =
nullptr;
115 _pointer_end =
nullptr;
124 bool GeomVertexWriter::
127 if (column ==
nullptr) {
131 nassertr(_vertex_data !=
nullptr,
false);
136 nassertr(array >= 0 && (
size_t)array < _vertex_data->get_num_arrays(),
false);
140 _handle = data_writer->get_array_writer(_array);
141 _stride = _handle->get_array_format()->get_stride();
143 _packer = column->_packer;
144 set_pointer(_start_row);
153 bool GeomVertexWriter::
155 if (column ==
nullptr) {
159 nassertr(_array_data !=
nullptr,
false);
161 _handle = _array_data->modify_handle();
162 _stride = _handle->get_array_format()->get_stride();
164 _packer = column->_packer;
165 set_pointer(_start_row);
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
GeomVertexArrayData * get_array_data() const
Returns the particular array object that the writer is currently processing.
bool set_column(int column)
Sets up the writer to use the nth data type of the GeomVertexFormat, numbering from 0.
const InternalName * get_name() const
Returns the name of this particular data field, e.g.
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 GeomVertexColumn * get_column() const
Returns the description of the data type that the writer is working on.