Panda3D
eggMesherEdge.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 eggMesherEdge.h
10  * @author drose
11  * @date 2005-03-13
12  */
13 
14 #ifndef EGGMESHEREDGE_H
15 #define EGGMESHEREDGE_H
16 
17 #include "pandabase.h"
18 #include "eggVertexPool.h"
19 #include "eggVertex.h"
20 #include "plist.h"
21 
22 class EggMesherStrip;
23 
24 /**
25  * Represents one edge of a triangle, as used by the EggMesher to discover
26  * connected triangles. The edge is actually represented as a pair of vertex
27  * indices into the same vertex pool.
28  */
29 class EXPCL_PANDA_EGG EggMesherEdge {
30 public:
31  INLINE EggMesherEdge(int vi_a, int vi_b);
32  INLINE EggMesherEdge(const EggMesherEdge &copy);
33 
34  void remove(EggMesherStrip *strip);
35  void change_strip(EggMesherStrip *from, EggMesherStrip *to);
36 
37  INLINE bool contains_vertex(int vi) const;
38 
39  INLINE bool matches(const EggMesherEdge &other) const;
40 
41  INLINE EggMesherEdge *common_ptr();
42 
43  INLINE bool operator == (const EggMesherEdge &other) const;
44  INLINE bool operator != (const EggMesherEdge &other) const;
45  INLINE bool operator < (const EggMesherEdge &other) const;
46 
47  INLINE double compute_length(const EggVertexPool *vertex_pool) const;
48  INLINE LVecBase3d compute_box(const EggVertexPool *vertex_pool) const;
49 
50  void output(std::ostream &out) const;
51 
52  int _vi_a, _vi_b;
53 
55  Strips _strips;
56  EggMesherEdge *_opposite;
57 };
58 
59 INLINE std::ostream &
60 operator << (std::ostream &out, const EggMesherEdge &edge) {
61  edge.output(out);
62  return out;
63 }
64 
65 #include "eggMesherEdge.I"
66 
67 #endif
Represents one edge of a triangle, as used by the EggMesher to discover connected triangles.
Definition: eggMesherEdge.h:29
void output(std::ostream &out) const
Formats the edge for output in some sensible way.
Represents a triangle strip or quad strip in progress, as assembled by the mesher.
A collection of vertices.
Definition: eggVertexPool.h:41
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.