Panda3D
Loading...
Searching...
No Matches
findApproxPath.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file findApproxPath.I
10 * @author drose
11 * @date 2002-03-13
12 */
13
14/**
15 *
16 */
17INLINE FindApproxPath::
18FindApproxPath() {
19 _return_hidden = true;
20 _return_stashed = false;
21 _case_insensitive = false;
22}
23
24/**
25 * Returns the number of components in the path.
26 */
28get_num_components() const {
29 return _path.size();
30}
31
32/**
33 * Returns true if the nth component is of type match_many, which will require
34 * special handling.
35 */
37is_component_match_many(int index) const {
38 nassertr(index >= 0 && index < (int)_path.size(), false);
39 return (_path[index]._type == CT_match_many);
40}
41
42/**
43 * Returns true if the nth component of the path matches the indicated node,
44 * false otherwise.
45 */
47matches_component(int index, PandaNode *node) const {
48 nassertr(index >= 0 && index < (int)_path.size(), false);
49 return (_path[index].matches(node));
50}
51
52/**
53 * Returns true if the nth component of the path matches a stashed node only,
54 * false otherwise.
55 */
57matches_stashed(int index) const {
58 if (index >= 0 && index < (int)_path.size()) {
59 return ((_path[index]._flags & CF_stashed) != 0);
60 } else {
61 return false;
62 }
63}
64
65/**
66 * Returns true if this path allows returning of hidden nodes, false
67 * otherwise.
68 */
70return_hidden() const {
71 return _return_hidden;
72}
73
74/**
75 * Returns true if this path allows returning of stashed nodes, false
76 * otherwise.
77 */
79return_stashed() const {
80 return _return_stashed;
81}
82
83/**
84 * Returns true if the search is case-insensitive, false if it is case-
85 * sensitive.
86 */
88case_insensitive() const {
89 return _case_insensitive;
90}
91
92/**
93 * Formats the nth component of the path to the indicated output stream.
94 */
96output_component(std::ostream &out, int index) const {
97 nassertv(index >= 0 && index < (int)_path.size());
98 out << _path[index];
99}
bool matches_component(int index, PandaNode *node) const
Returns true if the nth component of the path matches the indicated node, false otherwise.
void output_component(std::ostream &out, int index) const
Formats the nth component of the path to the indicated output stream.
bool return_hidden() const
Returns true if this path allows returning of hidden nodes, false otherwise.
bool matches_stashed(int index) const
Returns true if the nth component of the path matches a stashed node only, false otherwise.
bool return_stashed() const
Returns true if this path allows returning of stashed nodes, false otherwise.
bool case_insensitive() const
Returns true if the search is case-insensitive, false if it is case- sensitive.
bool is_component_match_many(int index) const
Returns true if the nth component is of type match_many, which will require special handling.
int get_num_components() const
Returns the number of components in the path.
A basic node of the scene graph or data graph.
Definition pandaNode.h:65