14 #ifndef GEOMVERTEXARRAYDATA_H 15 #define GEOMVERTEXARRAYDATA_H 67 UsageHint usage_hint);
76 MAKE_PROPERTY(array_format, get_array_format);
78 INLINE UsageHint get_usage_hint()
const;
79 void set_usage_hint(UsageHint usage_hint);
80 MAKE_PROPERTY(usage_hint, get_usage_hint, set_usage_hint);
84 INLINE
int get_num_rows()
const;
85 INLINE
bool set_num_rows(
int n);
86 INLINE
bool unclean_set_num_rows(
int n);
87 INLINE
bool reserve_num_rows(
int n);
88 INLINE
void clear_rows();
90 INLINE
size_t get_data_size_bytes()
const;
92 MAKE_PROPERTY(data_size_bytes, get_data_size_bytes);
93 MAKE_PROPERTY(modified, get_modified);
95 void output(std::ostream &out)
const;
96 void write(std::ostream &out,
int indent_level = 0)
const;
98 INLINE
bool request_resident(
Thread *current_thread = Thread::get_current_thread())
const;
111 INLINE
static SimpleLru *get_independent_lru();
112 INLINE
static SimpleLru *get_small_lru();
113 static void lru_epoch();
117 EXTENSION(
int __getbuffer__(PyObject *
self, Py_buffer *view,
int flags));
118 EXTENSION(
int __getbuffer__(PyObject *
self, Py_buffer *view,
int flags)
const);
119 EXTENSION(
void __releasebuffer__(PyObject *
self, Py_buffer *view)
const);
127 INLINE
void mark_used();
130 void reverse_data_endianness(
unsigned char *dest,
131 const unsigned char *source,
size_t size);
147 bool _endian_reversed;
151 class EXPCL_PANDA_GOBJ CData :
public CycleData {
153 INLINE CData(UsageHint usage_hint = UH_unspecified);
154 INLINE CData(CData &&from) noexcept;
155 INLINE CData(
const CData ©);
156 INLINE
void operator = (
const CData ©);
159 ALLOC_DELETED_CHAIN(CData);
162 void *extra_data)
const;
166 return GeomVertexArrayData::get_class_type();
169 UsageHint _usage_hint;
181 static void init_type() {
217 static void init_type() {
218 CopyOnWriteObject::init_type();
220 CopyOnWriteObject::get_class_type());
224 return get_class_type();
226 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
271 INLINE
Thread *get_current_thread()
const;
273 INLINE
const unsigned char *get_read_pointer(
bool force)
const RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT);
274 unsigned char *get_write_pointer() RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT);
279 MAKE_PROPERTY(
object, get_object);
282 INLINE UsageHint get_usage_hint()
const;
283 MAKE_PROPERTY(array_format, get_array_format);
284 MAKE_PROPERTY(usage_hint, get_usage_hint);
286 INLINE
int get_num_rows()
const;
287 bool set_num_rows(
int n);
288 bool unclean_set_num_rows(
int n);
289 bool reserve_num_rows(
int n);
290 INLINE
void clear_rows();
292 INLINE
size_t get_data_size_bytes()
const;
294 MAKE_PROPERTY(data_size_bytes, get_data_size_bytes);
295 MAKE_PROPERTY(modified, get_modified);
297 INLINE
bool request_resident()
const;
303 void copy_subdata_from(
size_t to_start,
size_t to_size,
305 size_t from_start,
size_t from_size);
307 void copy_data_from(
const unsigned char *source,
size_t size);
308 void copy_subdata_from(
size_t to_start,
size_t to_size,
309 const unsigned char *source,
310 size_t from_start,
size_t from_size);
312 EXTENSION(
void copy_data_from(PyObject *buffer));
313 EXTENSION(
void copy_subdata_from(
size_t to_start,
size_t to_size,
315 EXTENSION(
void copy_subdata_from(
size_t to_start,
size_t to_size,
317 size_t from_start,
size_t from_size));
319 INLINE vector_uchar get_data()
const;
320 void set_data(
const vector_uchar &data);
321 INLINE vector_uchar get_subdata(
size_t start,
size_t size)
const;
322 void set_subdata(
size_t start,
size_t size,
const vector_uchar &data);
324 INLINE
void mark_used()
const;
328 Thread *
const _current_thread;
329 GeomVertexArrayData::CData *_cdata;
336 static void init_type() {
337 ReferenceCount::init_type();
339 ReferenceCount::get_class_type());
An implementation of a very simple LRU algorithm.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is our own Panda specialization on the default STL map.
PTA_uchar read_raw_data(BamReader *manager, DatagramIterator &source)
Called by CData::fillin to read the raw data of the array from the indicated datagram.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is similar to CycleDataWriter, except it allows writing to a particular stage of the pipel...
A single page of data maintained by a PipelineCycler.
Base class for objects that can be written to and read from Bam files.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is an abstract base class for a family of classes that represent the fundamental geometry primit...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual TypeHandle get_parent_type() const
Returns the type of the container that owns the CycleData.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This is our own Panda specialization on the default STL list.
This data object is returned by GeomVertexArrayData::get_handle() or modify_handle().
A table of objects that are saved within the graphics context for reference by handle later.
Encapsulates the data from a GeomVertexData, pre-fetched for one stage of the pipeline.
void set_lru_size(size_t lru_size)
Specifies the size of this page, presumably in bytes, although any unit is possible.
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
A single block as returned from SimpleAllocator::alloc().
virtual void write_datagram(BamWriter *, Datagram &) const
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual void evict_lru()
Evicts the page from the LRU.
One atomic piece that may be managed by a SimpleLru chain.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
This is used to keep track of, and limit the size of, the cache of munged vertices,...
A container for geometry primitives.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
A block of bytes that stores the actual raw vertex data referenced by a GeomVertexArrayData object.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Encodes a string name in a hash table, mapping it to a pointer.
A collection of VertexDataPages, which can be used to allocate new VertexDataBlock objects.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
This class is similar to CycleDataReader, except it allows reading from a particular stage of the pip...
A base class for all things that want to be reference-counted.
An STL function object class, this is intended to be used on any ordered collection of class objects ...
This base class provides basic reference counting, but also can be used with a CopyOnWritePointer to ...
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
A thread; that is, a lightweight process.
This is a special class object that holds all the information returned by a particular GSG to indicat...
Encapsulates the data from a GeomVertexData, pre-fetched for one stage of the pipeline.
static void register_with_read_factory()
Tells the BamReader how to create objects of type GeomVertexArrayData.
A class to retrieve the individual data elements previously stored in a Datagram.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
This is a sequence number that increments monotonically.
Encapsulates the data from a GeomPrimitive, pre-fetched for one stage of the pipeline.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the data for one array of a GeomVertexData structure.
virtual void finalize(BamReader *manager)
Called by the BamReader to perform any final actions needed for setting up the object after all objec...