70 INLINE
size_t get_hash()
const;
76 INLINE
static CPT(
TransformState) make_quat(
const LQuaternion &quat);
77 INLINE
static CPT(
TransformState) make_pos_hpr(
const LVecBase3 &pos,
78 const LVecBase3 &hpr);
80 INLINE
static CPT(
TransformState) make_scale(
const LVecBase3 &scale);
81 INLINE
static CPT(
TransformState) make_shear(
const LVecBase3 &shear);
82 INLINE
static CPT(
TransformState) make_pos_hpr_scale(
const LVecBase3 &pos,
84 const LVecBase3 &scale);
85 INLINE
static CPT(
TransformState) make_pos_quat_scale(
const LVecBase3 &pos,
86 const LQuaternion &quat,
87 const LVecBase3 &scale);
88 static CPT(
TransformState) make_pos_hpr_scale_shear(
const LVecBase3 &pos,
90 const LVecBase3 &scale,
91 const LVecBase3 &shear);
92 static CPT(
TransformState) make_pos_quat_scale_shear(
const LVecBase3 &pos,
93 const LQuaternion &quat,
94 const LVecBase3 &scale,
95 const LVecBase3 &shear);
99 INLINE
static CPT(
TransformState) make_pos2d(
const LVecBase2 &pos);
100 INLINE
static CPT(
TransformState) make_rotate2d(PN_stdfloat rotate);
101 INLINE
static CPT(
TransformState) make_pos_rotate2d(
const LVecBase2 &pos,
103 INLINE
static CPT(
TransformState) make_scale2d(PN_stdfloat scale);
104 INLINE
static CPT(
TransformState) make_scale2d(
const LVecBase2 &scale);
105 INLINE
static CPT(
TransformState) make_shear2d(PN_stdfloat shear);
106 INLINE
static CPT(
TransformState) make_pos_rotate_scale2d(
const LVecBase2 &pos,
108 const LVecBase2 &scale);
109 static CPT(
TransformState) make_pos_rotate_scale_shear2d(
const LVecBase2 &pos,
111 const LVecBase2 &scale,
116 INLINE
bool is_identity()
const;
117 INLINE
bool is_invalid()
const;
118 INLINE
bool is_singular()
const;
119 INLINE
bool is_2d()
const;
121 INLINE
bool has_components()
const;
122 INLINE
bool components_given()
const;
123 INLINE
bool hpr_given()
const;
124 INLINE
bool quat_given()
const;
125 INLINE
bool has_pos()
const;
126 INLINE
bool has_hpr()
const;
127 INLINE
bool has_quat()
const;
128 INLINE
bool has_scale()
const;
129 INLINE
bool has_identity_scale()
const;
130 INLINE
bool has_uniform_scale()
const;
131 INLINE
bool has_shear()
const;
132 INLINE
bool has_nonzero_shear()
const;
133 INLINE
bool has_mat()
const;
137 LPoint3 get_pos()
const;
138 LVecBase3 get_hpr()
const;
139 LQuaternion get_quat()
const;
140 LQuaternion get_norm_quat()
const;
141 LVecBase3 get_scale()
const;
142 PN_stdfloat get_uniform_scale()
const;
143 LVecBase3 get_shear()
const;
144 LMatrix4 get_mat()
const;
146 INLINE
const LPoint3 &get_pos()
const;
147 INLINE
const LVecBase3 &get_hpr()
const;
148 INLINE
const LQuaternion &get_quat()
const;
149 INLINE
const LQuaternion &get_norm_quat()
const;
150 INLINE
const LVecBase3 &get_scale()
const;
151 INLINE PN_stdfloat get_uniform_scale()
const;
152 INLINE
const LVecBase3 &get_shear()
const;
153 INLINE
const LMatrix4 &get_mat()
const;
156 INLINE LVecBase2 get_pos2d()
const;
157 INLINE PN_stdfloat get_rotate2d()
const;
158 INLINE LVecBase2 get_scale2d()
const;
159 INLINE PN_stdfloat get_shear2d()
const;
160 INLINE LMatrix3 get_mat3()
const;
162 MAKE_PROPERTY(pos, get_pos);
163 MAKE_PROPERTY(hpr, get_hpr);
164 MAKE_PROPERTY(quat, get_quat);
165 MAKE_PROPERTY(norm_quat, get_norm_quat);
166 MAKE_PROPERTY(scale, get_scale);
167 MAKE_PROPERTY(shear, get_shear);
168 MAKE_PROPERTY(mat, get_mat);
187 INLINE
int get_geom_rendering(
int geom_rendering)
const;
196 INLINE
size_t get_composition_cache_num_entries()
const;
197 INLINE
size_t get_invert_composition_cache_num_entries()
const;
199 INLINE
size_t get_composition_cache_size()
const;
200 INLINE
const TransformState *get_composition_cache_source(
size_t n)
const;
201 INLINE
const TransformState *get_composition_cache_result(
size_t n)
const;
202 INLINE
size_t get_invert_composition_cache_size()
const;
203 INLINE
const TransformState *get_invert_composition_cache_source(
size_t n)
const;
204 INLINE
const TransformState *get_invert_composition_cache_result(
size_t n)
const;
205 bool validate_composition_cache()
const;
206 EXTENSION(PyObject *get_composition_cache()
const);
207 EXTENSION(PyObject *get_invert_composition_cache()
const);
209 void output(std::ostream &out)
const;
210 void write(std::ostream &out,
int indent_level)
const;
211 void write_composition_cache(std::ostream &out,
int indent_level)
const;
213 static int get_num_states();
214 static int get_num_unused_states();
215 static int clear_cache();
216 static int garbage_collect();
217 static void list_cycles(std::ostream &out);
218 static void list_states(std::ostream &out);
219 static bool validate_states();
220 EXTENSION(
static PyObject *get_states());
221 EXTENSION(
static PyObject *get_unused_states());
224 static void init_states();
226 INLINE
static void flush_level();
231 INLINE
void cache_unref_only()
const;
234 INLINE
bool do_cache_unref()
const;
235 INLINE
bool do_node_unref()
const;
237 class CompositionCycleDescEntry {
254 void detect_and_break_cycles();
258 CompositionCycleDesc *cycle_desc);
259 static bool r_detect_reverse_cycles(
const TransformState *start_state,
262 CompositionCycleDesc *cycle_desc);
265 void remove_cache_pointers();
273 static States *_states;
294 INLINE Composition();
295 INLINE Composition(
const Composition ©);
303 mutable CompositionCache _composition_cache;
304 mutable CompositionCache _invert_composition_cache;
312 static size_t _garbage_index;
314 static bool _uniquify_matrix;
331 INLINE
void check_hash()
const;
332 INLINE
void check_singular()
const;
333 INLINE
void check_components()
const;
334 INLINE
void check_hpr()
const;
335 INLINE
void check_quat()
const;
336 INLINE
void check_norm_quat()
const;
337 INLINE
void check_mat()
const;
338 INLINE
void calc_hash();
340 void calc_singular();
341 INLINE
void calc_components();
342 void do_calc_components();
343 INLINE
void calc_hpr();
346 void calc_norm_quat();
347 INLINE
void calc_mat();
350 INLINE
void check_uniform_scale();
351 INLINE
void check_uniform_scale2d();
353 INLINE
void set_destructing();
354 INLINE
bool is_destructing()
const;
356 INLINE
void consider_update_pstats(
int old_referenced_bits)
const;
357 static void update_pstats(
int old_referenced_bits,
int new_referenced_bits);
360 F_is_identity = 0x00000001,
361 F_is_singular = 0x00000002,
362 F_singular_known = 0x00000004,
363 F_components_given = 0x00000008,
364 F_components_known = 0x00000010,
365 F_has_components = 0x00000020,
366 F_mat_known = 0x00000040,
367 F_is_invalid = 0x00000080,
368 F_quat_given = 0x00000100,
369 F_quat_known = 0x00000200,
370 F_hpr_given = 0x00000400,
371 F_hpr_known = 0x00000800,
372 F_uniform_scale = 0x00001000,
373 F_identity_scale = 0x00002000,
374 F_has_nonzero_shear = 0x00004000,
375 F_is_destructing = 0x00008000,
376 F_is_2d = 0x00010000,
377 F_hash_known = 0x00020000,
378 F_norm_quat_known = 0x00040000,
381 LVecBase3 _hpr, _scale, _shear;
382 LQuaternion _quat, _norm_quat;
395 static void register_with_read_factory();
407 static void init_type() {
408 NodeCachedReferenceCount::init_type();
410 NodeCachedReferenceCount::get_class_type());
413 return get_class_type();
415 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}