Panda3D

eggMesherFanMaker.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 eggMesherFanMaker.I
10 * @author drose
11 * @date 2005-03-22
12 */
13
14 /**
15 * Provides a unique ordering between different fan makers based on the
16 * leading edge.
17 */
18 INLINE bool EggMesherFanMaker::
19 operator < (const EggMesherFanMaker &other) const {
20 nassertr(!_edges.empty() && !other._edges.empty(), false);
21 return _edges.front() < other._edges.front();
22 }
23
24 /**
25 * Provides a unique ordering between different fan makers based on the
26 * leading edge.
27 */
28 INLINE bool EggMesherFanMaker::
29 operator != (const EggMesherFanMaker &other) const {
30 return !operator == (other);
31 }
32
33 /**
34 * Provides a unique ordering between different fan makers based on the
35 * leading edge.
36 */
37 INLINE bool EggMesherFanMaker::
38 operator == (const EggMesherFanMaker &other) const {
39 return _edges.front() == other._edges.front();
40 }
41
42 /**
43 * Returns true if the fan maker has no edges, false otherwise.
44 */
45 INLINE bool EggMesherFanMaker::
46 is_empty() const {
47 return (_edges.empty());
48 }
49
50 /**
51 * Returns true if the fan maker has enough edges to define at least one fan,
52 * false otherwise.
53 */
54 INLINE bool EggMesherFanMaker::
55 is_valid() const {
56 return (_edges.size() > 2);
57 }
58
59 /**
60 * Returns true if the strip and the other strip are coplanar.
61 */
62 INLINE bool EggMesherFanMaker::
63 is_coplanar_with(const EggMesherFanMaker &other) const {
64 return _planar && other._planar &&
65 _strips.front()->is_coplanar_with(*other._strips.front(),
66 egg_coplanar_threshold);
67 }
68
69 INLINE std::ostream &
70 operator << (std::ostream &out, const EggMesherFanMaker &fm) {
71 fm.output(out);
72 return out;
73 }
EggMesherFanMaker
This class is used by EggMesher::find_fans() to attempt to make an EggTriangleFan out of the polygons...
Definition: eggMesherFanMaker.h:34
EggMesherFanMaker::operator==
bool operator==(const EggMesherFanMaker &other) const
Provides a unique ordering between different fan makers based on the leading edge.
Definition: eggMesherFanMaker.I:38
EggMesherFanMaker::operator<
bool operator<(const EggMesherFanMaker &other) const
Provides a unique ordering between different fan makers based on the leading edge.
Definition: eggMesherFanMaker.I:19
EggMesherFanMaker::operator!=
bool operator!=(const EggMesherFanMaker &other) const
Provides a unique ordering between different fan makers based on the leading edge.
Definition: eggMesherFanMaker.I:29
EggMesherFanMaker::is_coplanar_with
bool is_coplanar_with(const EggMesherFanMaker &other) const
Returns true if the strip and the other strip are coplanar.
Definition: eggMesherFanMaker.I:63
EggMesherFanMaker::is_empty
bool is_empty() const
Returns true if the fan maker has no edges, false otherwise.
Definition: eggMesherFanMaker.I:46
EggMesherFanMaker::is_valid
bool is_valid() const
Returns true if the fan maker has enough edges to define at least one fan, false otherwise.
Definition: eggMesherFanMaker.I:55