00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 INLINE NodePath::
00022 NodePath() :
00023 _error_type(ET_ok)
00024 {
00025 _backup_key = 0;
00026 }
00027
00028
00029
00030
00031
00032
00033
00034
00035 INLINE NodePath::
00036 NodePath(const string &top_node_name, Thread *current_thread) :
00037 _error_type(ET_ok)
00038 {
00039 PandaNode *top_node = new PandaNode(top_node_name);
00040 int pipeline_stage = current_thread->get_pipeline_stage();
00041 _head = top_node->get_generic_component(false, pipeline_stage, current_thread);
00042 _backup_key = 0;
00043 }
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 INLINE NodePath::
00057 NodePath(PandaNode *node, Thread *current_thread) :
00058 _error_type(ET_ok)
00059 {
00060 if (node != (PandaNode *)NULL) {
00061 int pipeline_stage = current_thread->get_pipeline_stage();
00062 _head = node->get_generic_component(false, pipeline_stage, current_thread);
00063 }
00064 _backup_key = 0;
00065 }
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 INLINE NodePath NodePath::
00077 any_path(PandaNode *node, Thread *current_thread) {
00078 NodePath result;
00079 if (node != (PandaNode *)NULL) {
00080 int pipeline_stage = current_thread->get_pipeline_stage();
00081 result._head = node->get_generic_component(true, pipeline_stage,
00082 current_thread);
00083 }
00084 return result;
00085 }
00086
00087
00088
00089
00090
00091
00092 INLINE NodePath::
00093 NodePath(const NodePath ©) :
00094 _head(copy._head),
00095 _backup_key(copy._backup_key),
00096 _error_type(copy._error_type)
00097 {
00098 }
00099
00100
00101
00102
00103
00104
00105 INLINE void NodePath::
00106 operator = (const NodePath ©) {
00107 _head = copy._head;
00108 _backup_key = copy._backup_key;
00109 _error_type = copy._error_type;
00110 }
00111
00112
00113
00114
00115
00116
00117
00118 INLINE NodePath NodePath::
00119 not_found() {
00120 NodePath result;
00121 result._error_type = ET_not_found;
00122 return result;
00123 }
00124
00125
00126
00127
00128
00129
00130
00131 INLINE NodePath NodePath::
00132 removed() {
00133 NodePath result;
00134 result._error_type = ET_removed;
00135 return result;
00136 }
00137
00138
00139
00140
00141
00142
00143
00144 INLINE NodePath NodePath::
00145 fail() {
00146 NodePath result;
00147 result._error_type = ET_fail;
00148 return result;
00149 }
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174 INLINE void NodePath::
00175 set_max_search_depth(int max_search_depth) {
00176 _max_search_depth = max_search_depth;
00177 }
00178
00179
00180
00181
00182
00183
00184
00185 INLINE int NodePath::
00186 get_max_search_depth() {
00187 return _max_search_depth;
00188 }
00189
00190
00191
00192
00193
00194
00195 INLINE bool NodePath::
00196 is_empty() const {
00197 return (_head == (NodePathComponent *)NULL);
00198 }
00199
00200
00201
00202
00203
00204
00205
00206 INLINE bool NodePath::
00207 is_singleton(Thread *current_thread) const {
00208 int pipeline_stage = current_thread->get_pipeline_stage();
00209 return (_head != (NodePathComponent *)NULL && _head->is_top_node(pipeline_stage, current_thread));
00210 }
00211
00212
00213
00214
00215
00216
00217
00218 INLINE NodePath::ErrorType NodePath::
00219 get_error_type() const {
00220 return _error_type;
00221 }
00222
00223
00224
00225
00226
00227
00228
00229 INLINE PandaNode *NodePath::
00230 get_top_node(Thread *current_thread) const {
00231 if (is_empty()) {
00232 return (PandaNode *)NULL;
00233 }
00234
00235 return get_top(current_thread).node();
00236 }
00237
00238
00239
00240
00241
00242
00243 INLINE PandaNode *NodePath::
00244 node() const {
00245 nassertr_always(!is_empty(), (PandaNode *)NULL);
00246 return _head->get_node();
00247 }
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266 INLINE int NodePath::
00267 get_key() const {
00268 if (is_empty()) {
00269 return _backup_key;
00270 }
00271 return _head->get_key();
00272 }
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289 INLINE size_t NodePath::
00290 add_hash(size_t hash) const {
00291 return pointer_hash::add_hash(hash, _head);
00292 }
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303 INLINE bool NodePath::
00304 is_same_graph(const NodePath &other, Thread *current_thread) const {
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315 int a_count, b_count;
00316 return (find_common_ancestor(*this, other, a_count, b_count, current_thread) != (NodePathComponent *)NULL);
00317 }
00318
00319
00320
00321
00322
00323
00324
00325
00326 INLINE bool NodePath::
00327 is_ancestor_of(const NodePath &other, Thread *current_thread) const {
00328 int a_count, b_count;
00329 if (find_common_ancestor(*this, other, a_count, b_count, current_thread) == (NodePathComponent *)NULL) {
00330
00331 return false;
00332 }
00333
00334
00335
00336 return (a_count == 0);
00337 }
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347 INLINE NodePath NodePath::
00348 get_common_ancestor(const NodePath &other, Thread *current_thread) const {
00349 int a_count, b_count;
00350 NodePathComponent *common = find_common_ancestor(*this, other, a_count, b_count, current_thread);
00351 if (common == (NodePathComponent *)NULL) {
00352 return NodePath::not_found();
00353 }
00354
00355 NodePath result;
00356 result._head = common;
00357 return result;
00358 }
00359
00360
00361
00362
00363
00364
00365 INLINE int NodePath::
00366 get_num_children(Thread *current_thread) const {
00367 nassertr_always(!is_empty(), 0);
00368 return _head->get_node()->get_num_children(current_thread);
00369 }
00370
00371
00372
00373
00374
00375
00376
00377 INLINE NodePath NodePath::
00378 get_child(int n, Thread *current_thread) const {
00379 nassertr_always(n >= 0 && n < get_num_children(current_thread), NodePath());
00380 NodePath child;
00381 int pipeline_stage = current_thread->get_pipeline_stage();
00382 child._head = PandaNode::get_component(_head, _head->get_node()->get_child(n, current_thread),
00383 pipeline_stage, current_thread);
00384 return child;
00385 }
00386
00387
00388
00389
00390
00391
00392 INLINE int NodePath::
00393 count_num_descendants() const {
00394 if (is_empty()) {
00395 return 0;
00396 }
00397 return _head->get_node()->count_num_descendants();
00398 }
00399
00400
00401
00402
00403
00404
00405
00406 INLINE bool NodePath::
00407 has_parent(Thread *current_thread) const {
00408 return !is_empty() && !is_singleton(current_thread);
00409 }
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419 INLINE NodePath NodePath::
00420 get_parent(Thread *current_thread) const {
00421 if (!has_parent(current_thread)) {
00422 return NodePath();
00423 }
00424
00425 int pipeline_stage = current_thread->get_pipeline_stage();
00426
00427 NodePath parent;
00428 parent._head = _head->get_next(pipeline_stage, current_thread);
00429 return parent;
00430 }
00431
00432
00433
00434
00435
00436
00437
00438
00439 INLINE NodePath NodePath::
00440 attach_new_node(const string &name, int sort, Thread *current_thread) const {
00441 nassertr(verify_complete(current_thread), NodePath::fail());
00442
00443 return attach_new_node(new PandaNode(name), sort, current_thread);
00444 }
00445
00446
00447
00448
00449
00450
00451 INLINE void NodePath::
00452 ls() const {
00453 ls(nout);
00454 }
00455
00456
00457
00458
00459
00460
00461 INLINE void NodePath::
00462 ls(ostream &out, int indent_level) const {
00463 if (is_empty()) {
00464 out << "(empty)\n";
00465 } else {
00466 node()->ls(out, indent_level);
00467 }
00468 }
00469
00470
00471
00472
00473
00474
00475 INLINE void NodePath::
00476 reverse_ls() const {
00477 reverse_ls(nout);
00478 }
00479
00480
00481
00482
00483
00484
00485 INLINE int NodePath::
00486 reverse_ls(ostream &out, int indent_level) const {
00487 if (is_empty()) {
00488 out << "(empty)\n";
00489 return 0;
00490 } else if (has_parent()) {
00491 indent_level = get_parent().reverse_ls(out, indent_level);
00492 }
00493 node()->write(out, indent_level);
00494 return indent_level + 2;
00495 }
00496
00497
00498
00499
00500
00501
00502 INLINE void NodePath::
00503 set_state(const RenderState *state, Thread *current_thread) {
00504 nassertv_always(!is_empty());
00505 node()->set_state(state, current_thread);
00506 }
00507
00508
00509
00510
00511
00512
00513 INLINE CPT(RenderState) NodePath::
00514 get_net_state(Thread *current_thread) const {
00515 nassertr(_error_type == ET_ok, RenderState::make_empty());
00516 return r_get_net_state(_head, current_thread);
00517 }
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527 INLINE void NodePath::
00528 set_attrib(const RenderAttrib *attrib, int priority) {
00529 nassertv_always(!is_empty());
00530 node()->set_attrib(attrib, priority);
00531 }
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542 INLINE const RenderAttrib *NodePath::
00543 get_attrib(TypeHandle type) const {
00544 nassertr_always(!is_empty(), NULL);
00545 return node()->get_attrib(type);
00546 }
00547
00548
00549
00550
00551
00552
00553
00554
00555 INLINE bool NodePath::
00556 has_attrib(TypeHandle type) const {
00557 nassertr_always(!is_empty(), false);
00558 return node()->has_attrib(type);
00559 }
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569 INLINE void NodePath::
00570 clear_attrib(TypeHandle type) {
00571 nassertv_always(!is_empty());
00572 node()->clear_attrib(type);
00573 }
00574
00575
00576
00577
00578
00579
00580
00581
00582 INLINE void NodePath::
00583 set_effect(const RenderEffect *effect) {
00584 nassertv_always(!is_empty());
00585 node()->set_effect(effect);
00586 }
00587
00588
00589
00590
00591
00592
00593
00594 INLINE const RenderEffect *NodePath::
00595 get_effect(TypeHandle type) const {
00596 nassertr_always(!is_empty(), NULL);
00597 return node()->get_effect(type);
00598 }
00599
00600
00601
00602
00603
00604
00605
00606
00607 INLINE bool NodePath::
00608 has_effect(TypeHandle type) const {
00609 nassertr_always(!is_empty(), false);
00610 return node()->has_effect(type);
00611 }
00612
00613
00614
00615
00616
00617
00618
00619 INLINE void NodePath::
00620 clear_effect(TypeHandle type) {
00621 nassertv_always(!is_empty());
00622 node()->clear_effect(type);
00623 }
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633 INLINE void NodePath::
00634 set_effects(const RenderEffects *effects) {
00635 nassertv_always(!is_empty());
00636 node()->set_effects(effects);
00637 }
00638
00639
00640
00641
00642
00643
00644
00645 INLINE const RenderEffects *NodePath::
00646 get_effects() const {
00647 nassertr_always(!is_empty(), RenderEffects::make_empty());
00648 return node()->get_effects();
00649 }
00650
00651
00652
00653
00654
00655
00656 INLINE void NodePath::
00657 clear_effects() {
00658 nassertv_always(!is_empty());
00659 node()->clear_effects();
00660 }
00661
00662
00663
00664
00665
00666
00667 INLINE void NodePath::
00668 clear_transform(Thread *current_thread) {
00669 set_transform(TransformState::make_identity(), current_thread);
00670 }
00671
00672
00673
00674
00675
00676
00677 INLINE void NodePath::
00678 set_transform(const TransformState *transform, Thread *current_thread) {
00679 nassertv_always(!is_empty());
00680 node()->set_transform(transform, current_thread);
00681 }
00682
00683
00684
00685
00686
00687
00688
00689
00690 INLINE void NodePath::
00691 clear_transform(const NodePath &other, Thread *current_thread) {
00692 set_transform(other, TransformState::make_identity(), current_thread);
00693 }
00694
00695
00696
00697
00698
00699
00700 INLINE CPT(TransformState) NodePath::
00701 get_net_transform(Thread *current_thread) const {
00702 nassertr(_error_type == ET_ok, TransformState::make_identity());
00703 return r_get_net_transform(_head, current_thread);
00704 }
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714 INLINE void NodePath::
00715 set_prev_transform(const TransformState *transform, Thread *current_thread) {
00716 nassertv_always(!is_empty());
00717 node()->set_prev_transform(transform, current_thread);
00718 }
00719
00720
00721
00722
00723
00724
00725
00726 INLINE CPT(TransformState) NodePath::
00727 get_net_prev_transform(Thread *current_thread) const {
00728 nassertr(_error_type == ET_ok, TransformState::make_identity());
00729 return r_get_net_prev_transform(_head, current_thread);
00730 }
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742 INLINE void NodePath::
00743 set_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
00744 set_pos(LPoint3(x, y, z));
00745 }
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755 INLINE void NodePath::
00756 set_fluid_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
00757 set_fluid_pos(LPoint3(x, y, z));
00758 }
00759
00760 INLINE PN_stdfloat NodePath::
00761 get_x() const {
00762 return get_pos()[0];
00763 }
00764
00765 INLINE PN_stdfloat NodePath::
00766 get_y() const {
00767 return get_pos()[1];
00768 }
00769
00770 INLINE PN_stdfloat NodePath::
00771 get_z() const {
00772 return get_pos()[2];
00773 }
00774
00775
00776
00777
00778
00779
00780
00781 INLINE void NodePath::
00782 set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
00783 set_hpr(LVecBase3(h, p, r));
00784 }
00785
00786 INLINE PN_stdfloat NodePath::
00787 get_h() const {
00788 return get_hpr()[0];
00789 }
00790
00791 INLINE PN_stdfloat NodePath::
00792 get_p() const {
00793 return get_hpr()[1];
00794 }
00795
00796 INLINE PN_stdfloat NodePath::
00797 get_r() const {
00798 return get_hpr()[2];
00799 }
00800
00801
00802
00803
00804
00805
00806
00807 INLINE void NodePath::
00808 set_scale(PN_stdfloat scale) {
00809 set_scale(LVecBase3(scale, scale, scale));
00810 }
00811
00812 INLINE void NodePath::
00813 set_scale(PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
00814 set_scale(LVecBase3(sx, sy, sz));
00815 }
00816
00817 INLINE PN_stdfloat NodePath::
00818 get_sx() const {
00819 return get_scale()[0];
00820 }
00821
00822 INLINE PN_stdfloat NodePath::
00823 get_sy() const {
00824 return get_scale()[1];
00825 }
00826
00827 INLINE PN_stdfloat NodePath::
00828 get_sz() const {
00829 return get_scale()[2];
00830 }
00831
00832
00833
00834
00835
00836
00837
00838 INLINE void NodePath::
00839 set_shear(PN_stdfloat shxy, PN_stdfloat shxz, PN_stdfloat shyz) {
00840 set_shear(LVecBase3(shxy, shxz, shyz));
00841 }
00842
00843 INLINE PN_stdfloat NodePath::
00844 get_shxy() const {
00845 return get_shear()[0];
00846 }
00847
00848 INLINE PN_stdfloat NodePath::
00849 get_shxz() const {
00850 return get_shear()[1];
00851 }
00852
00853 INLINE PN_stdfloat NodePath::
00854 get_shyz() const {
00855 return get_shear()[2];
00856 }
00857
00858
00859
00860
00861
00862
00863
00864 INLINE void NodePath::
00865 set_pos_hpr(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
00866 set_pos_hpr(LVecBase3(x, y, z), LVecBase3(h, p, r));
00867 }
00868
00869
00870
00871
00872
00873
00874
00875 INLINE void NodePath::
00876 set_hpr_scale(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
00877 set_hpr_scale(LVecBase3(h, p, r), LVecBase3(sx, sy, sz));
00878 }
00879
00880
00881
00882
00883
00884
00885
00886 INLINE void NodePath::
00887 set_pos_hpr_scale(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r,
00888 PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
00889 set_pos_hpr_scale(LVecBase3(x, y, z), LVecBase3(h, p, r),
00890 LVecBase3(sx, sy, sz));
00891 }
00892
00893
00894
00895
00896
00897
00898
00899 INLINE void NodePath::
00900 clear_mat() {
00901 nassertv_always(!is_empty());
00902 node()->clear_transform();
00903 }
00904
00905
00906
00907
00908
00909
00910
00911 INLINE bool NodePath::
00912 has_mat() const {
00913 nassertr_always(!is_empty(), false);
00914 return !node()->get_transform()->is_identity();
00915 }
00916
00917
00918
00919
00920
00921
00922
00923
00924 INLINE const LMatrix4 &NodePath::
00925 get_mat() const {
00926 nassertr_always(!is_empty(), LMatrix4::ident_mat());
00927
00928 return node()->get_transform()->get_mat();
00929 }
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940 INLINE void NodePath::
00941 look_at(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
00942 look_at(LPoint3(x, y, z));
00943 }
00944
00945
00946
00947
00948
00949
00950
00951
00952 INLINE void NodePath::
00953 heads_up(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
00954 heads_up(LPoint3(x, y, z));
00955 }
00956
00957
00958
00959
00960
00961
00962
00963 INLINE void NodePath::
00964 set_pos(const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
00965 set_pos(other, LPoint3(x, y, z));
00966 }
00967
00968
00969
00970
00971
00972
00973
00974
00975
00976 INLINE void NodePath::
00977 set_fluid_pos(const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
00978 set_fluid_pos(other, LPoint3(x, y, z));
00979 }
00980
00981 INLINE PN_stdfloat NodePath::
00982 get_x(const NodePath &other) const {
00983 return get_pos(other)[0];
00984 }
00985
00986 INLINE PN_stdfloat NodePath::
00987 get_y(const NodePath &other) const {
00988 return get_pos(other)[1];
00989 }
00990
00991 INLINE PN_stdfloat NodePath::
00992 get_z(const NodePath &other) const {
00993 return get_pos(other)[2];
00994 }
00995
00996
00997
00998
00999
01000
01001
01002 INLINE void NodePath::
01003 set_hpr(const NodePath &other, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
01004 set_hpr(other, LPoint3(h, p, r));
01005 }
01006
01007 INLINE PN_stdfloat NodePath::
01008 get_h(const NodePath &other) const {
01009 return get_hpr(other)[0];
01010 }
01011
01012 INLINE PN_stdfloat NodePath::
01013 get_p(const NodePath &other) const {
01014 return get_hpr(other)[1];
01015 }
01016
01017 INLINE PN_stdfloat NodePath::
01018 get_r(const NodePath &other) const {
01019 return get_hpr(other)[2];
01020 }
01021
01022
01023
01024
01025
01026
01027
01028 INLINE void NodePath::
01029 set_scale(const NodePath &other, PN_stdfloat scale) {
01030 set_scale(other, LPoint3(scale, scale, scale));
01031 }
01032
01033
01034
01035
01036
01037
01038
01039 INLINE void NodePath::
01040 set_scale(const NodePath &other, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
01041 set_scale(other, LPoint3(sx, sy, sz));
01042 }
01043
01044
01045
01046
01047
01048
01049
01050 INLINE PN_stdfloat NodePath::
01051 get_sx(const NodePath &other) const {
01052 return get_scale(other)[0];
01053 }
01054
01055 INLINE PN_stdfloat NodePath::
01056 get_sy(const NodePath &other) const {
01057 return get_scale(other)[1];
01058 }
01059
01060 INLINE PN_stdfloat NodePath::
01061 get_sz(const NodePath &other) const {
01062 return get_scale(other)[2];
01063 }
01064
01065
01066
01067
01068
01069
01070
01071 INLINE void NodePath::
01072 set_shear(const NodePath &other, PN_stdfloat shxy, PN_stdfloat shxz, PN_stdfloat shyz) {
01073 set_shear(other, LPoint3(shxy, shxz, shyz));
01074 }
01075
01076
01077
01078
01079
01080
01081
01082 INLINE PN_stdfloat NodePath::
01083 get_shxy(const NodePath &other) const {
01084 return get_shear(other)[0];
01085 }
01086
01087 INLINE PN_stdfloat NodePath::
01088 get_shxz(const NodePath &other) const {
01089 return get_shear(other)[1];
01090 }
01091
01092 INLINE PN_stdfloat NodePath::
01093 get_shyz(const NodePath &other) const {
01094 return get_shear(other)[2];
01095 }
01096
01097
01098
01099
01100
01101
01102
01103 INLINE void NodePath::
01104 set_pos_hpr(const NodePath &other,
01105 PN_stdfloat x, PN_stdfloat y, PN_stdfloat z,
01106 PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
01107 set_pos_hpr(other, LVecBase3(x, y, z), LVecBase3(h, p, r));
01108 }
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118 INLINE void NodePath::
01119 set_hpr_scale(const NodePath &other,
01120 PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
01121 set_hpr_scale(other, LVecBase3(h, p, r), LVecBase3(sx, sy, sz));
01122 }
01123
01124
01125
01126
01127
01128
01129
01130
01131 INLINE void NodePath::
01132 set_pos_hpr_scale(const NodePath &other,
01133 PN_stdfloat x, PN_stdfloat y, PN_stdfloat z,
01134 PN_stdfloat h, PN_stdfloat p, PN_stdfloat r,
01135 PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
01136 set_pos_hpr_scale(other, LVecBase3(x, y, z), LVecBase3(h, p, r),
01137 LVecBase3(sx, sy, sz));
01138 }
01139
01140
01141
01142
01143
01144
01145
01146
01147 INLINE void NodePath::
01148 look_at(const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
01149 look_at(other, LPoint3(x, y, z));
01150 }
01151
01152
01153
01154
01155
01156
01157
01158
01159 INLINE void NodePath::
01160 heads_up(const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
01161 heads_up(other, LPoint3(x, y, z));
01162 }
01163
01164
01165
01166
01167
01168
01169
01170
01171 INLINE PN_stdfloat NodePath::
01172 get_distance(const NodePath &other) const {
01173 LPoint3 pos = get_pos(other);
01174 return length(LVector3(pos));
01175 }
01176
01177
01178
01179
01180
01181
01182 INLINE void NodePath::
01183 set_color_scale(PN_stdfloat sr, PN_stdfloat sg, PN_stdfloat sb, PN_stdfloat sa, int priority) {
01184 set_color_scale(LVecBase4(sr, sg, sb, sa), priority);
01185 }
01186
01187
01188
01189
01190
01191
01192 INLINE void NodePath::
01193 compose_color_scale(PN_stdfloat sr, PN_stdfloat sg, PN_stdfloat sb, PN_stdfloat sa, int priority) {
01194 compose_color_scale(LVecBase4(sr, sg, sb, sa), priority);
01195 }
01196
01197
01198
01199
01200
01201
01202 INLINE void NodePath::
01203 set_sr(PN_stdfloat sr) {
01204 LVecBase4 new_scale = get_color_scale();
01205 new_scale[0] = sr;
01206
01207 set_color_scale(new_scale);
01208 }
01209
01210
01211
01212
01213
01214
01215 INLINE void NodePath::
01216 set_sg(PN_stdfloat sg) {
01217 LVecBase4 new_scale = get_color_scale();
01218 new_scale[1] = sg;
01219
01220 set_color_scale(new_scale);
01221 }
01222
01223
01224
01225
01226
01227
01228 INLINE void NodePath::
01229 set_sb(PN_stdfloat sb) {
01230 LVecBase4 new_scale = get_color_scale();
01231 new_scale[2] = sb;
01232
01233 set_color_scale(new_scale);
01234 }
01235
01236
01237
01238
01239
01240
01241 INLINE void NodePath::
01242 set_sa(PN_stdfloat sa) {
01243 LVecBase4 new_scale = get_color_scale();
01244 new_scale[3] = sa;
01245
01246 set_color_scale(new_scale);
01247 }
01248
01249
01250
01251
01252
01253
01254 INLINE PN_stdfloat NodePath::
01255 get_sr() const {
01256 return get_color_scale()[0];
01257 }
01258
01259
01260
01261
01262
01263
01264 INLINE PN_stdfloat NodePath::
01265 get_sg() const {
01266 return get_color_scale()[1];
01267 }
01268
01269
01270
01271
01272
01273
01274 INLINE PN_stdfloat NodePath::
01275 get_sb() const {
01276 return get_color_scale()[2];
01277 }
01278
01279
01280
01281
01282
01283
01284 INLINE PN_stdfloat NodePath::
01285 get_sa() const {
01286 return get_color_scale()[3];
01287 }
01288
01289
01290
01291
01292
01293
01294
01295
01296
01297
01298 INLINE void NodePath::
01299 set_tex_offset(TextureStage *stage, PN_stdfloat u, PN_stdfloat v) {
01300 set_tex_offset(stage, LVecBase2(u, v));
01301 }
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312 INLINE void NodePath::
01313 set_tex_offset(TextureStage *stage, const LVecBase2 &uv) {
01314 nassertv_always(!is_empty());
01315 set_tex_transform(stage,
01316 get_tex_transform(stage)->set_pos2d(uv));
01317 }
01318
01319
01320
01321
01322
01323
01324
01325
01326
01327
01328
01329 INLINE void NodePath::
01330 set_tex_rotate(TextureStage *stage, PN_stdfloat r) {
01331 nassertv_always(!is_empty());
01332 set_tex_transform(stage,
01333 get_tex_transform(stage)->set_rotate2d(r));
01334 }
01335
01336
01337
01338
01339
01340
01341
01342
01343
01344
01345 INLINE void NodePath::
01346 set_tex_scale(TextureStage *stage, PN_stdfloat scale) {
01347 nassertv_always(!is_empty());
01348 set_tex_transform(stage,
01349 get_tex_transform(stage)->set_scale(scale));
01350 }
01351
01352
01353
01354
01355
01356
01357
01358
01359
01360
01361 INLINE void NodePath::
01362 set_tex_scale(TextureStage *stage, PN_stdfloat su, PN_stdfloat sv) {
01363 set_tex_scale(stage, LVecBase2(su, sv));
01364 }
01365
01366
01367
01368
01369
01370
01371
01372
01373
01374
01375 INLINE void NodePath::
01376 set_tex_scale(TextureStage *stage, const LVecBase2 &scale) {
01377 nassertv_always(!is_empty());
01378 set_tex_transform(stage,
01379 get_tex_transform(stage)->set_scale2d(scale));
01380 }
01381
01382
01383
01384
01385
01386
01387
01388
01389
01390
01391 INLINE LVecBase2 NodePath::
01392 get_tex_offset(TextureStage *stage) const {
01393 nassertr_always(!is_empty(), LVecBase2::zero());
01394 return get_tex_transform(stage)->get_pos2d();
01395 }
01396
01397
01398
01399
01400
01401
01402
01403
01404
01405
01406 INLINE PN_stdfloat NodePath::
01407 get_tex_rotate(TextureStage *stage) const {
01408 nassertr_always(!is_empty(), 0.0f);
01409 return get_tex_transform(stage)->get_rotate2d();
01410 }
01411
01412
01413
01414
01415
01416
01417
01418
01419
01420
01421 INLINE LVecBase2 NodePath::
01422 get_tex_scale(TextureStage *stage) const {
01423 nassertr_always(!is_empty(), LVecBase2(1.0f, 1.0f));
01424 return get_tex_transform(stage)->get_scale2d();
01425 }
01426
01427
01428
01429
01430
01431
01432
01433
01434
01435 INLINE void NodePath::
01436 set_tex_pos(TextureStage *stage, PN_stdfloat u, PN_stdfloat v, PN_stdfloat w) {
01437 set_tex_pos(stage, LVecBase3(u, v, w));
01438 }
01439
01440
01441
01442
01443
01444
01445
01446
01447
01448 INLINE void NodePath::
01449 set_tex_pos(TextureStage *stage, const LVecBase3 &uvw) {
01450 nassertv_always(!is_empty());
01451 set_tex_transform(stage,
01452 get_tex_transform(stage)->set_pos(uvw));
01453 }
01454
01455
01456
01457
01458
01459
01460
01461
01462
01463
01464 INLINE void NodePath::
01465 set_tex_hpr(TextureStage *stage, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
01466 set_tex_hpr(stage, LVecBase3(h, p, r));
01467 }
01468
01469
01470
01471
01472
01473
01474
01475
01476
01477
01478 INLINE void NodePath::
01479 set_tex_hpr(TextureStage *stage, const LVecBase3 &hpr) {
01480 nassertv_always(!is_empty());
01481 set_tex_transform(stage,
01482 get_tex_transform(stage)->set_hpr(hpr));
01483 }
01484
01485
01486
01487
01488
01489
01490
01491
01492
01493 INLINE void NodePath::
01494 set_tex_scale(TextureStage *stage, PN_stdfloat su, PN_stdfloat sv, PN_stdfloat sw) {
01495 set_tex_scale(stage, LVecBase3(su, sv, sw));
01496 }
01497
01498
01499
01500
01501
01502
01503
01504
01505
01506 INLINE void NodePath::
01507 set_tex_scale(TextureStage *stage, const LVecBase3 &scale) {
01508 nassertv_always(!is_empty());
01509 set_tex_transform(stage,
01510 get_tex_transform(stage)->set_scale(scale));
01511 }
01512
01513
01514
01515
01516
01517
01518
01519
01520
01521 INLINE LVecBase3 NodePath::
01522 get_tex_pos(TextureStage *stage) const {
01523 nassertr_always(!is_empty(), LVecBase3::zero());
01524 return get_tex_transform(stage)->get_pos();
01525 }
01526
01527
01528
01529
01530
01531
01532
01533
01534
01535 INLINE LVecBase3 NodePath::
01536 get_tex_hpr(TextureStage *stage) const {
01537 nassertr_always(!is_empty(), LVecBase3::zero());
01538 return get_tex_transform(stage)->get_hpr();
01539 }
01540
01541
01542
01543
01544
01545
01546
01547
01548
01549 INLINE LVecBase3 NodePath::
01550 get_tex_scale_3d(TextureStage *stage) const {
01551 nassertr_always(!is_empty(), LVecBase3(1.0f, 1.0f, 1.0f));
01552 return get_tex_transform(stage)->get_scale();
01553 }
01554
01555
01556
01557
01558
01559
01560
01561
01562
01563
01564 INLINE void NodePath::
01565 set_tex_offset(const NodePath &other, TextureStage *stage, PN_stdfloat u, PN_stdfloat v) {
01566 set_tex_offset(other, stage, LVecBase2(u, v));
01567 }
01568
01569
01570
01571
01572
01573
01574
01575
01576
01577
01578 INLINE void NodePath::
01579 set_tex_offset(const NodePath &other, TextureStage *stage, const LVecBase2 &uv) {
01580 nassertv_always(!is_empty());
01581 set_tex_transform(other, stage,
01582 get_tex_transform(other, stage)->set_pos2d(uv));
01583 }
01584
01585
01586
01587
01588
01589
01590
01591
01592
01593
01594
01595 INLINE void NodePath::
01596 set_tex_rotate(const NodePath &other, TextureStage *stage, PN_stdfloat r) {
01597 nassertv_always(!is_empty());
01598 set_tex_transform(other, stage,
01599 get_tex_transform(other, stage)->set_rotate2d(r));
01600 }
01601
01602
01603
01604
01605
01606
01607
01608
01609
01610
01611 INLINE void NodePath::
01612 set_tex_scale(const NodePath &other, TextureStage *stage, PN_stdfloat scale) {
01613 nassertv_always(!is_empty());
01614 set_tex_transform(other, stage,
01615 get_tex_transform(stage)->set_scale(scale));
01616 }
01617
01618
01619
01620
01621
01622
01623
01624
01625
01626
01627 INLINE void NodePath::
01628 set_tex_scale(const NodePath &other, TextureStage *stage, PN_stdfloat su, PN_stdfloat sv) {
01629 set_tex_scale(other, stage, LVecBase2(su, sv));
01630 }
01631
01632
01633
01634
01635
01636
01637
01638
01639
01640
01641 INLINE void NodePath::
01642 set_tex_scale(const NodePath &other, TextureStage *stage, const LVecBase2 &scale) {
01643 nassertv_always(!is_empty());
01644 set_tex_transform(other, stage,
01645 get_tex_transform(stage)->set_scale2d(scale));
01646 }
01647
01648
01649
01650
01651
01652
01653
01654
01655
01656
01657 INLINE LVecBase2 NodePath::
01658 get_tex_offset(const NodePath &other, TextureStage *stage) const {
01659 nassertr_always(!is_empty(), LVecBase2::zero());
01660 return get_tex_transform(other, stage)->get_pos2d();
01661 }
01662
01663
01664
01665
01666
01667
01668
01669
01670
01671
01672 INLINE PN_stdfloat NodePath::
01673 get_tex_rotate(const NodePath &other, TextureStage *stage) const {
01674 nassertr_always(!is_empty(), 0.0f);
01675 return get_tex_transform(other, stage)->get_rotate2d();
01676 }
01677
01678
01679
01680
01681
01682
01683
01684
01685
01686
01687 INLINE LVecBase2 NodePath::
01688 get_tex_scale(const NodePath &other, TextureStage *stage) const {
01689 nassertr_always(!is_empty(), LVecBase2(1.0f, 1.0f));
01690 return get_tex_transform(other, stage)->get_scale2d();
01691 }
01692
01693
01694
01695
01696
01697
01698
01699
01700
01701 INLINE void NodePath::
01702 set_tex_pos(const NodePath &other, TextureStage *stage, PN_stdfloat u, PN_stdfloat v, PN_stdfloat w) {
01703 set_tex_pos(other, stage, LVecBase3(u, v, w));
01704 }
01705
01706
01707
01708
01709
01710
01711
01712
01713
01714 INLINE void NodePath::
01715 set_tex_pos(const NodePath &other, TextureStage *stage, const LVecBase3 &uvw) {
01716 nassertv_always(!is_empty());
01717 set_tex_transform(other, stage,
01718 get_tex_transform(stage)->set_pos(uvw));
01719 }
01720
01721
01722
01723
01724
01725
01726
01727
01728
01729
01730 INLINE void NodePath::
01731 set_tex_hpr(const NodePath &other, TextureStage *stage, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
01732 set_tex_hpr(other, stage, LVecBase3(h, p, r));
01733 }
01734
01735
01736
01737
01738
01739
01740
01741
01742
01743
01744 INLINE void NodePath::
01745 set_tex_hpr(const NodePath &other, TextureStage *stage, const LVecBase3 &hpr) {
01746 nassertv_always(!is_empty());
01747 set_tex_transform(other, stage,
01748 get_tex_transform(stage)->set_hpr(hpr));
01749 }
01750
01751
01752
01753
01754
01755
01756
01757
01758
01759 INLINE void NodePath::
01760 set_tex_scale(const NodePath &other, TextureStage *stage, PN_stdfloat su, PN_stdfloat sv, PN_stdfloat sw) {
01761 set_tex_scale(other, stage, LVecBase3(su, sv, sw));
01762 }
01763
01764
01765
01766
01767
01768
01769
01770
01771
01772 INLINE void NodePath::
01773 set_tex_scale(const NodePath &other, TextureStage *stage, const LVecBase3 &scale) {
01774 nassertv_always(!is_empty());
01775 set_tex_transform(other, stage,
01776 get_tex_transform(stage)->set_scale(scale));
01777 }
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787 INLINE LVecBase3 NodePath::
01788 get_tex_pos(const NodePath &other, TextureStage *stage) const {
01789 nassertr_always(!is_empty(), LVecBase3::zero());
01790 return get_tex_transform(stage)->get_pos();
01791 }
01792
01793
01794
01795
01796
01797
01798
01799
01800
01801 INLINE LVecBase3 NodePath::
01802 get_tex_hpr(const NodePath &other, TextureStage *stage) const {
01803 nassertr_always(!is_empty(), LVecBase3::zero());
01804 return get_tex_transform(stage)->get_hpr();
01805 }
01806
01807
01808
01809
01810
01811
01812
01813
01814
01815 INLINE LVecBase3 NodePath::
01816 get_tex_scale_3d(const NodePath &other, TextureStage *stage) const {
01817 nassertr_always(!is_empty(), LVecBase3(1.0f, 1.0f, 1.0f));
01818 return get_tex_transform(stage)->get_scale();
01819 }
01820
01821
01822
01823
01824
01825
01826 INLINE void NodePath::
01827 clear_project_texture(TextureStage *stage) {
01828 clear_texture(stage);
01829 clear_tex_gen(stage);
01830 clear_tex_projector(stage);
01831 }
01832
01833
01834
01835
01836
01837
01838
01839
01840
01841 INLINE bool NodePath::
01842 has_texcoord(const string &texcoord_name) const {
01843 return has_vertex_column(InternalName::get_texcoord_name(texcoord_name));
01844 }
01845
01846
01847
01848
01849
01850
01851
01852 INLINE void NodePath::
01853 set_billboard_axis(PN_stdfloat offset) {
01854 set_billboard_axis(NodePath(), offset);
01855 }
01856
01857
01858
01859
01860
01861
01862
01863
01864
01865 INLINE void NodePath::
01866 set_billboard_point_eye(PN_stdfloat offset) {
01867 set_billboard_point_eye(NodePath(), offset);
01868 }
01869
01870
01871
01872
01873
01874
01875
01876
01877 INLINE void NodePath::
01878 set_billboard_point_world(PN_stdfloat offset) {
01879 set_billboard_point_world(NodePath(), offset);
01880 }
01881
01882
01883
01884
01885
01886
01887
01888
01889
01890
01891
01892
01893 INLINE void NodePath::
01894 adjust_all_priorities(int adjustment) {
01895 nassertv_always(!is_empty());
01896 r_adjust_all_priorities(node(), adjustment);
01897 }
01898
01899
01900
01901
01902
01903
01904
01905
01906
01907
01908
01909 INLINE void NodePath::
01910 show() {
01911 nassertv_always(!is_empty());
01912 node()->adjust_draw_mask(DrawMask::all_off(), DrawMask::all_off(), PandaNode::get_overall_bit());
01913 }
01914
01915
01916
01917
01918
01919
01920
01921
01922
01923
01924
01925 INLINE void NodePath::
01926 show(DrawMask camera_mask) {
01927 nassertv_always(!is_empty());
01928 camera_mask &= ~PandaNode::get_overall_bit();
01929 node()->adjust_draw_mask(DrawMask::all_off(), DrawMask::all_off(), camera_mask);
01930 }
01931
01932
01933
01934
01935
01936
01937
01938
01939
01940
01941
01942 INLINE void NodePath::
01943 show_through() {
01944 nassertv_always(!is_empty());
01945 node()->adjust_draw_mask(PandaNode::get_overall_bit(), DrawMask::all_off(), DrawMask::all_off());
01946 }
01947
01948
01949
01950
01951
01952
01953
01954
01955
01956
01957
01958
01959
01960
01961 INLINE void NodePath::
01962 show_through(DrawMask camera_mask) {
01963 nassertv_always(!is_empty());
01964 camera_mask &= ~PandaNode::get_overall_bit();
01965 node()->adjust_draw_mask(camera_mask, DrawMask::all_off(), DrawMask::all_off());
01966 }
01967
01968
01969
01970
01971
01972
01973
01974
01975
01976
01977 INLINE void NodePath::
01978 hide() {
01979 nassertv_always(!is_empty());
01980 node()->adjust_draw_mask(DrawMask::all_off(), PandaNode::get_overall_bit(), DrawMask::all_off());
01981 }
01982
01983
01984
01985
01986
01987
01988
01989
01990
01991
01992
01993
01994 INLINE void NodePath::
01995 hide(DrawMask camera_mask) {
01996 nassertv_always(!is_empty());
01997 camera_mask &= ~PandaNode::get_overall_bit();
01998 node()->adjust_draw_mask(DrawMask::all_off(), camera_mask, DrawMask::all_off());
01999 }
02000
02001
02002
02003
02004
02005
02006
02007
02008 INLINE bool NodePath::
02009 is_hidden(DrawMask camera_mask) const {
02010 return !get_hidden_ancestor(camera_mask).is_empty();
02011 }
02012
02013
02014
02015
02016
02017
02018
02019 INLINE bool NodePath::
02020 is_stashed() const {
02021 return !get_stashed_ancestor().is_empty();
02022 }
02023
02024
02025
02026
02027
02028
02029
02030
02031
02032
02033
02034
02035 INLINE CollideMask NodePath::
02036 get_collide_mask() const {
02037 nassertr_always(!is_empty(), CollideMask::all_off());
02038 return node()->get_net_collide_mask();
02039 }
02040
02041
02042
02043
02044
02045
02046
02047
02048
02049
02050
02051
02052
02053
02054
02055
02056 INLINE void NodePath::
02057 set_collide_mask(CollideMask new_mask, CollideMask bits_to_change,
02058 TypeHandle node_type) {
02059 nassertv_always(!is_empty());
02060 if (node_type == TypeHandle::none()) {
02061 node_type = PandaNode::get_class_type();
02062 }
02063
02064 r_set_collide_mask(node(), ~bits_to_change, new_mask & bits_to_change,
02065 node_type);
02066 }
02067
02068
02069
02070
02071
02072
02073
02074
02075 INLINE bool NodePath::
02076 operator == (const NodePath &other) const {
02077 return _head == other._head;
02078 }
02079
02080
02081
02082
02083
02084
02085 INLINE bool NodePath::
02086 operator != (const NodePath &other) const {
02087 return _head != other._head;
02088 }
02089
02090
02091
02092
02093
02094
02095
02096
02097
02098
02099 INLINE bool NodePath::
02100 operator < (const NodePath &other) const {
02101 return _head < other._head;
02102 }
02103
02104
02105
02106
02107
02108
02109
02110
02111
02112
02113
02114
02115
02116
02117
02118
02119 INLINE int NodePath::
02120 compare_to(const NodePath &other) const {
02121
02122
02123
02124 if (_head != other._head) {
02125 return _head < other._head ? -1 : 1;
02126 }
02127 return 0;
02128 }
02129
02130
02131
02132
02133
02134
02135
02136
02137
02138
02139
02140
02141 INLINE int NodePath::
02142 clear_model_nodes() {
02143 nassertr_always(!is_empty(), 0);
02144 return r_clear_model_nodes(node());
02145 }
02146
02147
02148
02149
02150
02151
02152
02153
02154
02155
02156
02157
02158
02159
02160 INLINE void NodePath::
02161 set_tag(const string &key, const string &value) {
02162 nassertv_always(!is_empty());
02163 node()->set_tag(key, value);
02164 }
02165
02166
02167
02168
02169
02170
02171
02172
02173
02174 INLINE string NodePath::
02175 get_tag(const string &key) const {
02176
02177
02178 if (is_empty()) {
02179 return string();
02180 }
02181 return node()->get_tag(key);
02182 }
02183
02184
02185
02186
02187
02188
02189
02190
02191
02192 INLINE bool NodePath::
02193 has_tag(const string &key) const {
02194
02195
02196 if (is_empty()) {
02197 return false;
02198 }
02199 return node()->has_tag(key);
02200 }
02201
02202
02203
02204
02205
02206
02207
02208
02209 INLINE void NodePath::
02210 clear_tag(const string &key) {
02211 nassertv_always(!is_empty());
02212 node()->clear_tag(key);
02213 }
02214
02215
02216
02217
02218
02219
02220
02221
02222
02223
02224 INLINE string NodePath::
02225 get_net_tag(const string &key) const {
02226 return find_net_tag(key).get_tag(key);
02227 }
02228
02229
02230
02231
02232
02233
02234
02235
02236 INLINE bool NodePath::
02237 has_net_tag(const string &key) const {
02238 return !find_net_tag(key).is_empty();
02239 }
02240
02241 #ifdef HAVE_PYTHON
02242
02243
02244
02245
02246
02247
02248
02249
02250
02251
02252
02253
02254
02255 INLINE void NodePath::
02256 set_python_tag(const string &key, PyObject *value) {
02257 nassertv_always(!is_empty());
02258 node()->set_python_tag(key, value);
02259 }
02260 #endif // HAVE_PYTHON
02261
02262 #ifdef HAVE_PYTHON
02263
02264
02265
02266
02267
02268
02269
02270
02271 INLINE PyObject *NodePath::
02272 get_python_tag(const string &key) const {
02273
02274
02275 if (is_empty()) {
02276 Py_INCREF(Py_None);
02277 return Py_None;
02278 }
02279 return node()->get_python_tag(key);
02280 }
02281 #endif // HAVE_PYTHON
02282
02283 #ifdef HAVE_PYTHON
02284
02285
02286
02287
02288
02289
02290
02291
02292 INLINE bool NodePath::
02293 has_python_tag(const string &key) const {
02294
02295
02296 if (is_empty()) {
02297 return false;
02298 }
02299 return node()->has_python_tag(key);
02300 }
02301 #endif // HAVE_PYTHON
02302
02303 #ifdef HAVE_PYTHON
02304
02305
02306
02307
02308
02309
02310
02311
02312 INLINE void NodePath::
02313 clear_python_tag(const string &key) {
02314 nassertv_always(!is_empty());
02315 node()->clear_python_tag(key);
02316 }
02317 #endif // HAVE_PYTHON
02318
02319 #ifdef HAVE_PYTHON
02320
02321
02322
02323
02324
02325
02326
02327
02328
02329 INLINE PyObject *NodePath::
02330 get_net_python_tag(const string &key) const {
02331 return find_net_python_tag(key).get_python_tag(key);
02332 }
02333 #endif // HAVE_PYTHON
02334
02335 #ifdef HAVE_PYTHON
02336
02337
02338
02339
02340
02341
02342
02343 INLINE bool NodePath::
02344 has_net_python_tag(const string &key) const {
02345 return !find_net_python_tag(key).is_empty();
02346 }
02347 #endif // HAVE_PYTHON
02348
02349
02350
02351
02352
02353
02354
02355
02356 INLINE void NodePath::
02357 list_tags() const {
02358 nassertv_always(!is_empty());
02359 node()->list_tags(nout);
02360 nout << "\n";
02361 }
02362
02363
02364
02365
02366
02367
02368 INLINE void NodePath::
02369 set_name(const string &name) {
02370 nassertv_always(!is_empty());
02371 node()->set_name(name);
02372 }
02373
02374
02375
02376
02377
02378
02379 INLINE string NodePath::
02380 get_name() const {
02381 nassertr_always(!is_empty(), string());
02382 return node()->get_name();
02383 }
02384
02385
02386
02387
02388
02389
02390
02391
02392
02393
02394
02395
02396 INLINE string NodePath::
02397 encode_to_bam_stream() const {
02398 string data;
02399 if (!encode_to_bam_stream(data)) {
02400 return string();
02401 }
02402 return data;
02403 }
02404
02405
02406 INLINE ostream &operator << (ostream &out, const NodePath &node_path) {
02407 node_path.output(out);
02408 return out;
02409 }
02410