Panda3D
Loading...
Searching...
No Matches
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 */
19operator < (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 */
29operator != (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 */
38operator == (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 */
46is_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 */
55is_valid() const {
56 return (_edges.size() > 2);
57}
58
59/**
60 * Returns true if the strip and the other strip are coplanar.
61 */
63is_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
69INLINE std::ostream &
70operator << (std::ostream &out, const EggMesherFanMaker &fm) {
71 fm.output(out);
72 return out;
73}
This class is used by EggMesher::find_fans() to attempt to make an EggTriangleFan out of the polygons...
bool operator==(const EggMesherFanMaker &other) const
Provides a unique ordering between different fan makers based on the leading edge.
bool operator<(const EggMesherFanMaker &other) const
Provides a unique ordering between different fan makers based on the leading edge.
bool operator!=(const EggMesherFanMaker &other) const
Provides a unique ordering between different fan makers based on the leading edge.
bool is_coplanar_with(const EggMesherFanMaker &other) const
Returns true if the strip and the other strip are coplanar.
bool is_empty() const
Returns true if the fan maker has no edges, false otherwise.
bool is_valid() const
Returns true if the fan maker has enough edges to define at least one fan, false otherwise.