Panda3D
eggMesherFanMaker.h
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.h
10  * @author drose
11  * @date 2005-03-22
12  */
13 
14 #ifndef EGGMESHERFANMAKER_H
15 #define EGGMESHERFANMAKER_H
16 
17 #include "pandabase.h"
18 
19 #include "eggMesherEdge.h"
20 #include "eggMesherStrip.h"
21 #include "config_egg.h"
22 #include "plist.h"
23 #include "pvector.h"
24 
25 #include "pnotify.h"
26 #include "mathNumbers.h"
27 
28 class EggMesher;
29 
30 /**
31  * This class is used by EggMesher::find_fans() to attempt to make an
32  * EggTriangleFan out of the polygons connected to the indicated vertex.
33  */
34 class EXPCL_PANDA_EGG EggMesherFanMaker {
35 public:
38 
39  EggMesherFanMaker(int vertex, EggMesherStrip *tri,
40  EggMesher *mesher);
42  void operator = (const EggMesherFanMaker &copy);
43 
44  INLINE bool operator < (const EggMesherFanMaker &other) const;
45  INLINE bool operator != (const EggMesherFanMaker &other) const;
46  INLINE bool operator == (const EggMesherFanMaker &other) const;
47 
48  INLINE bool is_empty() const;
49  INLINE bool is_valid() const;
50  INLINE bool is_coplanar_with(const EggMesherFanMaker &other) const;
51 
52  bool join(EggMesherFanMaker &other);
53  double compute_angle() const;
54 
55  int build(EggGroupNode *unrolled_tris);
56  int unroll(Strips::iterator strip_begin, Strips::iterator strip_end,
57  Edges::iterator edge_begin, Edges::iterator edge_end,
58  EggGroupNode *unrolled_tris);
59 
60  void output(std::ostream &out) const;
61 
62  int _vertex;
63  Edges _edges;
64  Strips _strips;
65  bool _planar;
66  EggMesher *_mesher;
67 };
68 
69 INLINE std::ostream &operator << (std::ostream &out, const EggMesherFanMaker &fm);
70 
71 #include "eggMesherFanMaker.I"
72 
73 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for nodes in the hierarchy that are not leaf nodes.
Definition: eggGroupNode.h:46
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is used by EggMesher::find_fans() to attempt to make an EggTriangleFan out of the polygons...
Collects together unrelated EggPrimitives, determines their edge connectivity, and generates a set of...
Definition: eggMesher.h:33
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Represents a triangle strip or quad strip in progress, as assembled by the mesher.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.