30 INLINE
explicit LODNode(
const std::string &name);
32 static PT(
LODNode) make_default_lod(
const std::string &name);
40 virtual void xform(
const LMatrix4 &mat);
43 virtual void output(std::ostream &out)
const;
53 INLINE
void add_switch(PN_stdfloat in, PN_stdfloat out);
54 INLINE
bool set_switch(
int index, PN_stdfloat in, PN_stdfloat out);
55 INLINE
void clear_switches();
57 INLINE
int get_num_switches()
const;
58 INLINE PN_stdfloat get_in(
int index)
const;
59 MAKE_SEQ(get_ins, get_num_switches, get_in);
60 INLINE PN_stdfloat get_out(
int index)
const;
61 MAKE_SEQ(get_outs, get_num_switches, get_out);
63 INLINE
int get_lowest_switch()
const;
64 INLINE
int get_highest_switch()
const;
66 INLINE
void force_switch(
int index);
67 INLINE
void clear_force_switch();
71 INLINE
void set_lod_scale(PN_stdfloat value);
72 INLINE PN_stdfloat get_lod_scale()
const;
75 INLINE
void set_center(
const LPoint3 ¢er);
76 INLINE
const LPoint3 &get_center()
const;
78 MAKE_SEQ_PROPERTY(ins, get_num_switches, get_in);
79 MAKE_SEQ_PROPERTY(outs, get_num_switches, get_out);
80 MAKE_PROPERTY(lowest_switch, get_lowest_switch);
81 MAKE_PROPERTY(highest_switch, get_highest_switch);
82 MAKE_PROPERTY(lod_scale, get_lod_scale, set_lod_scale);
83 MAKE_PROPERTY(center, get_center, set_center);
85 void show_switch(
int index);
86 void show_switch(
int index,
const LColor &color);
87 void hide_switch(
int index);
88 void show_all_switches();
89 void hide_all_switches();
90 INLINE
bool is_any_shown()
const;
92 bool verify_child_bounds()
const;
98 virtual void compute_internal_bounds(CPT(
BoundingVolume) &internal_bounds,
99 int &internal_vertices,
101 Thread *current_thread)
const;
109 void do_show_switch(CData *cdata,
int index,
const LColor &color);
110 void do_hide_switch(CData *cdata,
int index);
111 bool do_verify_child_bounds(
const CData *cdata,
int index,
112 PN_stdfloat &suggested_radius)
const;
115 static const LColor &get_default_show_color(
int index);
120 INLINE Switch(PN_stdfloat in, PN_stdfloat out);
121 INLINE PN_stdfloat get_in()
const;
122 INLINE PN_stdfloat get_out()
const;
124 INLINE
void set_range(PN_stdfloat in, PN_stdfloat out);
125 INLINE
bool in_range(PN_stdfloat dist)
const;
126 INLINE
bool in_range_2(PN_stdfloat dist2)
const;
128 INLINE
void rescale(PN_stdfloat factor);
130 INLINE
bool is_shown()
const;
131 INLINE
void show(
const LColor &color);
135 INLINE
PandaNode *get_spindle_viz()
const;
136 INLINE
const RenderState *get_viz_model_state()
const;
138 INLINE
void write_datagram(
Datagram &destination)
const;
142 INLINE
void clear_ring_viz();
144 void compute_ring_viz();
145 void compute_spindle_viz();
146 void compute_viz_model_state();
152 UnalignedLVecBase4 _show_color;
164 class EXPCL_PANDA_PGRAPHNODES CData :
public CycleData {
167 INLINE CData(
const CData ©);
175 return LODNode::get_class_type();
179 SwitchVector _switch_vector;
180 size_t _lowest, _highest;
183 bool _got_force_switch;
186 PN_stdfloat _lod_scale;
197 static void register_with_read_factory();
208 static void init_type() {
209 PandaNode::init_type();
211 PandaNode::get_class_type());
214 return get_class_type();
216 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A basic node of the scene graph or data graph.
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.
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.
virtual bool safe_to_combine_children() const
Returns true if it is generally safe to combine the children of this PandaNode with each other.
virtual TypeHandle get_parent_type() const
Returns the type of the container that owns the CycleData.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
virtual bool safe_to_combine() const
Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of...
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
virtual void xform(const LMatrix4 &mat)
Transforms the contents of this PandaNode by the indicated matrix, if it means anything to do so.
virtual void write_datagram(BamWriter *, Datagram &) const
Writes the contents of this object to the datagram for shipping out to a Bam file.
This template class calls PipelineCycler::read() in the constructor and PipelineCycler::release_read(...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
virtual bool is_lod_node() const
A simple downcast check.
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
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 thread; that is, a lightweight process.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
This is a sequence number that increments monotonically.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...