Panda3D
occluderEffect.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 occluderEffect.I
10  * @author drose
11  * @date 2011-03-17
12  */
13 
14 /**
15  * Use OccluderEffect::make() to construct a new OccluderEffect object.
16  */
17 INLINE OccluderEffect::
18 OccluderEffect() {
19 }
20 
21 /**
22  * Use OccluderEffect::make() to construct a new OccluderEffect object. The
23  * copy constructor is only defined to facilitate methods like
24  * add_on_occluder().
25  */
26 INLINE OccluderEffect::
27 OccluderEffect(const OccluderEffect &copy) :
28  _on_occluders(copy._on_occluders)
29 {
30 }
31 
32 /**
33  * Returns the number of occluders that are enabled by the effectute.
34  */
35 INLINE int OccluderEffect::
36 get_num_on_occluders() const {
37  return _on_occluders.size();
38 }
39 
40 /**
41  * Returns the nth occluder enabled by the effectute, sorted in render order.
42  */
44 get_on_occluder(int n) const {
45  nassertr(n >= 0 && n < (int)_on_occluders.size(), NodePath::fail());
46  return _on_occluders[n];
47 }
48 
49 /**
50  * Returns true if the indicated occluder is enabled by the effect, false
51  * otherwise.
52  */
53 INLINE bool OccluderEffect::
54 has_on_occluder(const NodePath &occluder) const {
55  return _on_occluders.find(occluder) != _on_occluders.end();
56 }
57 
58 /**
59  * Returns true if this is an identity effect: it does not change the set of
60  * occluders in use.
61  */
62 INLINE bool OccluderEffect::
63 is_identity() const {
64  return _on_occluders.empty();
65 }
size_type_0 size() const
Returns the number of elements in the ordered vector.
bool has_on_occluder(const NodePath &occluder) const
Returns true if the indicated occluder is enabled by the effect, false otherwise.
iterator_0 end()
Returns the iterator that marks the end of the ordered vector.
bool empty() const
Returns true if the ordered vector is empty, false otherwise.
get_on_occluder
Returns the nth occluder enabled by the effectute, sorted in render order.
bool is_identity() const
Returns true if this is an identity effect: it does not change the set of occluders in use.
static NodePath fail()
Creates a NodePath with the ET_fail error type set.
Definition: nodePath.I:149
This functions similarly to a LightAttrib or ClipPlaneAttrib.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:161