31GeomLines(GeomLines::UsageHint usage_hint) :
57 return new GeomLines(*
this);
82 GeomPrimitivePipelineReader from(
this, current_thread);
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) {
103 for (
int i = 0; i < num_vertices; i += 2) {
107 auto it = reverse_map.find(v0);
108 if (it != reverse_map.end()) {
119 it = forward_map.find(v1);
120 if (it != forward_map.end()) {
130 adj->set_vertices(std::move(new_vertices));
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);
192 GeomVertexWriter to(new_vertices, 0);
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);
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.
static void register_with_read_factory()
Tells the BamReader how to create objects of type Geom.
ConstPointerTo< GeomPrimitive > make_adjacency() const
Adds adjacency information to this primitive.
virtual bool draw(GraphicsStateGuardianBase *gsg, const GeomPrimitivePipelineReader *reader, bool force) const
Calls the appropriate method on the GSG to draw the primitive.
virtual int get_min_num_vertices_per_primitive() const
Returns the minimum number of vertices that must be added before close_primitive() may legally be cal...
virtual PrimitiveType get_primitive_type() const
Returns the fundamental rendering type of this primitive: whether it is points, lines,...
virtual int get_num_vertices_per_primitive() const
If the primitive type is a simple type in which all primitives have the same number of vertices,...
int get_vertex(int i) const
Returns the ith vertex index in the table.
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...
void set_data1i(int data)
Sets the write row to a particular 1-component value, and advances the write row.
bool is_at_end() const
Returns true if the writer is currently at the end of the list of vertices, false otherwise.
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.