This reference page is linked to from the following overview topics: MNMesh Edges, MNMesh Note on Debugging.
An edge used with the MNMesh mesh.
MNEdges are winged-edge structures, which means they keep track of a start vertex, an end vertex, and the (unique) face that uses the start and end vertices in that order. If there is a face that uses the end and start vertices in that order, i.e. that travels this edge in the other direction, it is also recorded. All methods of this class are implemented by the system.
#include <mnmesh.h>
Public Member Functions |
|
MNEdge () | |
Constructor. |
|
MNEdge (int vv1, int vv2, int fc) | |
Constructor. |
|
void | Init () |
Initializes v1, v2 and f1 to 0, f2 to -1 and
track to -1. |
|
int | OtherFace (int ff) |
Assuming that ff is one of the faces using
this edge, OtherFace will return the other. |
|
int | OtherVert (int vv) |
Assuming that vv is one of the vertices on
this edge, OtherVert will return the other. |
|
void | Invert () |
Flips the edge around, so that it now goes
from what was v2 to what was v1. |
|
DllExport void | ReplaceFace (int of, int nf, int vv1=-1) |
Replaces face of with face nf in the edge
records. |
|
void | ReplaceVert (int ov, int nv) |
Replaces vertex ov in the edge records with
vertex nv. |
|
DllExport bool | Uncrossable () |
If this edge has the MN_EDGE_NOCROSS flag
set, or if it has no second face, this method returns TRUE.
|
|
DllExport MNEdge & | operator= (const MNEdge &from) |
Assignment operator. |
|
bool | operator== (MNEdge &f) |
Comparison operator. |
|
int & | operator[] (int i) |
Vertex access operator. |
|
const int & | operator[] (int i) const |
Vertex access operator. |
|
DllExport void | MNDebugPrint () |
Uses DebugPrint to print out edge
information to the Debug Results window in DevStudio. |
|
Public Attributes |
|
int | v1 |
The start vertex index into the parent
MNMesh's list of MNVerts. |
|
int | v2 |
The end vertex index into the parent
MNMesh's list of MNVerts. |
|
int | f1 |
The (unique) face that references this edge
in the forward direction. |
|
int | f2 |
The face (if any) that references this edge
in the backward direction. |
|
int | track |
MNEdge | ( | int | vv1, |
int | vv2, | ||
int | fc | ||
) | [inline] |
void Init | ( | ) | [inline] |
int OtherFace | ( | int | ff | ) | [inline] |
Assuming that ff is one of the faces using this edge, OtherFace will return the other.
If the edge is one-sided, -1 will be returned. If ff is not one of the faces, f2 (which may be -1) will be returned.
int OtherVert | ( | int | vv | ) | [inline] |
Assuming that vv is one of the vertices on this edge, OtherVert will return the other.
If vv is not one of the faces, v2 will be returned.
void Invert | ( | ) | [inline] |
DllExport void ReplaceFace | ( | int | of, |
int | nf, | ||
int | vv1 = -1 |
||
) |
Replaces face of with face nf in the edge records.
NOTE that this method causes an assertion failure if face of is not currently used by the edge. If of is on both sides of the edge, which is possible on some valid NONTRI meshes, a nonnegative vv1 is used to specify which side is replaced. Vv1 should be the "starting vertex" for the edge on face of. Assertion failures will also result if vv1 is nonnegative and is not either of the edge's verts, or if vv1 indicates that of should be the edge's f1, but it is not, etc.
void ReplaceVert | ( | int | ov, |
int | nv | ||
) | [inline] |
DllExport bool Uncrossable | ( | ) |
If this edge has the MN_EDGE_NOCROSS flag set, or if it has no second face, this method returns TRUE.
Otherwise, it returns FALSE. It's a shorthand equivalent for (GetFlag(MN_EDGE_NOCROSS) || (f2<0)).
bool operator== | ( | MNEdge & | f | ) | [inline] |
Comparison operator.
{ return (f.v1==v1)&&(f.v2==v2)&&(f.f1==f1)&&(f.f2==f2)&&(f.ExportFlags()==ExportFlags()); }
DllExport void MNDebugPrint | ( | ) |
Uses DebugPrint to print out edge information to the Debug Results window in DevStudio.
The information consists of the vertices and faces using this edge. It is generally a good idea to put in a DebugPrint immediately before this with the index of the edge, so you know which one is being printed out:
DebugPrint(_M("Edge %d: "), eid);\n\n E(eid)-\>MNDebugPrint();
int v1 |
The start vertex index into the parent MNMesh's list of MNVerts.
int v2 |
The end vertex index into the parent MNMesh's list of MNVerts.
int f1 |
The (unique) face that references this edge in the forward direction.
This value is an index into the parent MNMesh's list of MNFaces.
int f2 |
The face (if any) that references this edge in the backward direction.
Faces with f2=-1 are considered "one-sided", and lie on the boundary of a hole in the mesh. This value is an index into the parent MNMesh's list of MNFaces.
int track |
General purpose value.