18 #include "pandabase.h" 19 #include "config_pgraphnodes.h" 20 #include "pandaNode.h" 33 INLINE
LODNode(
const string &name);
35 static PT(LODNode) make_default_lod(
const string &name);
38 INLINE LODNode(
const LODNode ©);
46 virtual void output(ostream &out)
const;
56 INLINE
void add_switch(PN_stdfloat in, PN_stdfloat out);
57 INLINE
bool set_switch(
int index, PN_stdfloat in, PN_stdfloat out);
58 INLINE
void clear_switches();
60 INLINE
int get_num_switches()
const;
61 INLINE PN_stdfloat get_in(
int index)
const;
62 MAKE_SEQ(get_ins, get_num_switches, get_in);
63 INLINE PN_stdfloat get_out(
int index)
const;
64 MAKE_SEQ(get_outs, get_num_switches, get_out);
66 INLINE
int get_lowest_switch()
const;
67 INLINE
int get_highest_switch()
const;
69 INLINE
void force_switch(
int index);
70 INLINE
void clear_force_switch();
74 INLINE
void set_lod_scale(PN_stdfloat value);
75 INLINE PN_stdfloat get_lod_scale()
const;
78 INLINE
void set_center(
const LPoint3 ¢er);
79 INLINE
const LPoint3 &get_center()
const;
81 void show_switch(
int index);
83 void hide_switch(
int index);
84 void show_all_switches();
85 void hide_all_switches();
86 INLINE
bool is_any_shown()
const;
88 bool verify_child_bounds()
const;
94 virtual void compute_internal_bounds(CPT(
BoundingVolume) &internal_bounds,
95 int &internal_vertices,
97 Thread *current_thread)
const;
105 void do_show_switch(CData *cdata,
int index,
const LColor &color);
106 void do_hide_switch(CData *cdata,
int index);
107 bool do_verify_child_bounds(
const CData *cdata,
int index,
108 PN_stdfloat &suggested_radius)
const;
111 static const LColor &get_default_show_color(
int index);
116 INLINE Switch(PN_stdfloat in, PN_stdfloat out);
117 INLINE PN_stdfloat get_in()
const;
118 INLINE PN_stdfloat get_out()
const;
120 INLINE
void set_range(PN_stdfloat in, PN_stdfloat out);
121 INLINE
bool in_range(PN_stdfloat dist)
const;
122 INLINE
bool in_range_2(PN_stdfloat dist2)
const;
124 INLINE
void rescale(PN_stdfloat factor);
126 INLINE
bool is_shown()
const;
127 INLINE
void show(
const LColor &color);
131 INLINE
PandaNode *get_spindle_viz()
const;
132 INLINE
const RenderState *get_viz_model_state()
const;
134 INLINE
void write_datagram(
Datagram &destination)
const;
138 INLINE
void clear_ring_viz();
140 void compute_ring_viz();
141 void compute_spindle_viz();
142 void compute_viz_model_state();
160 class EXPCL_PANDA_PGRAPH CData :
public CycleData {
163 INLINE CData(
const CData ©);
171 return LODNode::get_class_type();
175 SwitchVector _switch_vector;
176 size_t _lowest, _highest;
179 bool _got_force_switch;
182 PN_stdfloat _lod_scale;
193 static void register_with_read_factory();
204 static void init_type() {
205 PandaNode::init_type();
206 register_type(_type_handle,
"LODNode",
207 PandaNode::get_class_type());
210 return get_class_type();
212 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
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...
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.
This is an "unaligned" LVecBase4.
virtual bool safe_to_combine_children() const
Returns true if it is generally safe to combine the children of this PandaNode with each other...
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
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...
This is a 4-by-4 transform matrix.
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...
This is the base class for all three-component vectors and points.
This class is similar to CycleDataReader, except it allows reading from a particular stage of the pip...
A thread; that is, a lightweight process.
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...