31GeomLines(GeomLines::UsageHint usage_hint) :
68GeomPrimitive::PrimitiveType GeomLines::
69get_primitive_type()
const {
78make_adjacency()
const {
83 int num_vertices = from.get_num_vertices();
86 new_vertices->set_num_rows(num_vertices * 2);
91 map<int, int> forward_map, reverse_map;
92 for (
int i = 0; i < num_vertices; i += 2) {
93 int v0 = from.get_vertex(i);
94 int v1 = from.get_vertex(i + 1);
103 for (
int i = 0; i < num_vertices; i += 2) {
104 int v0 = from.get_vertex(i);
105 int v1 = from.get_vertex(i + 1);
107 auto it = reverse_map.find(v0);
108 if (it != reverse_map.end()) {
109 to.set_data1i(it->second);
119 it = forward_map.find(v1);
120 if (it != forward_map.end()) {
121 to.set_data1i(it->second);
127 nassertr(to.is_at_end(),
nullptr);
130 adj->set_vertices(std::move(new_vertices));
142get_num_vertices_per_primitive()
const {
151get_min_num_vertices_per_primitive()
const {
161 return gsg->draw_lines(reader, force);
173 new_vertices->set_num_rows(num_vertices);
180 for (
int begin = 0; begin < num_vertices; begin += 2) {
181 from.set_row_unsafe(begin + 1);
182 to.set_data1i(from.get_data1i());
183 from.set_row_unsafe(begin);
184 to.set_data1i(from.get_data1i());
187 nassertr(to.is_at_end(),
nullptr);
194 for (
int begin = 0; begin < num_vertices; begin += 2) {
195 to.set_data1i(begin + 1 + first_vertex);
196 to.set_data1i(begin + first_vertex);
199 nassertr(to.is_at_end(),
nullptr);
209register_with_read_factory() {
225 object->fillin(scan, manager);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
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...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
A class to retrieve the individual data elements previously stored in a Datagram.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
Defines a series of disconnected line segments with adjacency information, for use with geometry shad...
Defines a series of disconnected line segments.
Encapsulates the data from a GeomPrimitive, pre-fetched for one stage of the pipeline.
This is an abstract base class for a family of classes that represent the fundamental geometry primit...
get_usage_hint
Returns the usage hint for this primitive.
get_num_vertices
Returns the number of indices used by all the primitives in this object.
int get_first_vertex() const
Returns the first vertex number referenced by the primitive.
bool is_indexed() const
Returns true if the primitive is indexed, false otherwise.
This is the data for one array of a GeomVertexData structure.
This object provides a high-level interface for quickly reading a sequence of numeric values from a v...
This object provides a high-level interface for quickly writing a sequence of numeric values from a v...
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.
get_current_thread
Returns a pointer to the currently-executing Thread object.
TypeHandle is the identifier used to differentiate C++ class types.
Base class for objects that can be written to and read from Bam files.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.