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
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
54 typedef plist<EggMesherStrip *> Strips;
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
EggMesherEdge
Represents one edge of a triangle, as used by the EggMesher to discover connected triangles.
Definition eggMesherEdge.h:29
EggMesherEdge::remove
void remove(EggMesherStrip *strip)
Removes an edge from a particular strip.
Definition eggMesherEdge.cxx:21
EggMesherEdge::EggMesherEdge
EggMesherEdge(int vi_a, int vi_b)
Defines an edge as a pair of vertices.
Definition eggMesherEdge.I:19
EggMesherEdge::change_strip
void change_strip(EggMesherStrip *from, EggMesherStrip *to)
Reparents the edge from strip "from" to strip "to".
Definition eggMesherEdge.cxx:33
EggMesherEdge::output
void output(std::ostream &out) const
Formats the edge for output in some sensible way.
Definition eggMesherEdge.cxx:55
EggMesherEdge::compute_length
double compute_length(const EggVertexPool *vertex_pool) const
Returns the length of the edge in model units.
Definition eggMesherEdge.I:96
EggMesherEdge::matches
bool matches(const EggMesherEdge &other) const
Returns true if this edge represents the same line segment as the other edge, in either direction.
Definition eggMesherEdge.I:49
EggMesherEdge::common_ptr
EggMesherEdge * common_ptr()
Returns an arbitrary pointer that is used to represent both this edge and its opposite.
Definition eggMesherEdge.I:60
EggMesherEdge::compute_box
LVecBase3d compute_box(const EggVertexPool *vertex_pool) const
Returns a 3-component vector that represents the lengths of the sides of the smalled axis-aligned box...
Definition eggMesherEdge.I:108
EggMesherEdge::contains_vertex
bool contains_vertex(int vi) const
Returns true if the edge contains the indicated vertex index, false otherwise.
Definition eggMesherEdge.I:40
EggMesherStrip
Represents a triangle strip or quad strip in progress, as assembled by the mesher.
Definition eggMesherStrip.h:30
EggVertexPool
A collection of vertices.
Definition eggVertexPool.h:41
plist
This is our own Panda specialization on the default STL list.
Definition plist.h:35
eggMesherEdge.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
eggVertexPool.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
eggVertex.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
plist.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.