Panda3D
Loading...
Searching...
No Matches
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
22class 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 */
29class EXPCL_PANDA_EGG EggMesherEdge {
30public:
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
59INLINE std::ostream &
60operator << (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.
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.
This is our own Panda specialization on the default STL list.
Definition plist.h:35
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.