#include <mnmesh.h>
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.
Public Member Functions | |
MNEdge () | |
Constructor. More... | |
MNEdge (int vv1, int vv2, int fc) | |
Constructor. More... | |
void | Init () |
Initializes v1, v2 and f1 to 0, f2 to -1 and track to -1. More... | |
int | OtherFace (int ff) |
Assuming that ff is one of the faces using this edge, OtherFace will return the other. More... | |
int | OtherVert (int vv) |
Assuming that vv is one of the vertices on this edge, OtherVert will return the other. More... | |
void | Invert () |
Flips the edge around, so that it now goes from what was v2 to what was v1. More... | |
DllExport void | ReplaceFace (int of, int nf, int vv1=-1) |
Replaces face of with face nf in the edge records. More... | |
void | ReplaceVert (int ov, int nv) |
Replaces vertex ov in the edge records with vertex nv. More... | |
DllExport bool | Uncrossable () |
If this edge has the MN_EDGE_NOCROSS flag set, or if it has no second face, this method returns TRUE. More... | |
DllExport MNEdge & | operator= (const MNEdge &from) |
Assignment operator. More... | |
bool | operator== (MNEdge &f) |
Comparison operator. More... | |
int & | operator[] (int i) |
Vertex access operator. More... | |
const int & | operator[] (int i) const |
Vertex access operator. More... | |
DllExport void | MNDebugPrint () |
Uses DebugPrint to print out edge information to the Debug Results window in DevStudio. More... | |
Public Member Functions inherited from FlagUser | |
FlagUser () | |
void | SetFlag (DWORD fl, bool val=TRUE) |
void | ClearFlag (DWORD fl) |
bool | GetFlag (DWORD fl) const |
void | ClearAllFlags () |
void | CopyFlags (DWORD fl) |
void | CopyFlags (const FlagUser &fu) |
void | CopyFlags (const FlagUser *fu) |
void | CopyFlags (DWORD fl, DWORD mask) |
void | CopyFlags (const FlagUser &fu, DWORD mask) |
void | CopyFlags (const FlagUser *fu, DWORD mask) |
void | OrFlags (const FlagUser &fu) |
void | OrFlags (const FlagUser *fu) |
void | AndFlags (const FlagUser &fu) |
void | AndFlags (const FlagUser *fu) |
bool | FlagMatch (DWORD fmask, DWORD fl) const |
bool | FlagMatch (DWORD fmask, const FlagUser &fu) const |
bool | FlagMatch (DWORD fmask, const FlagUser *fu) const |
DWORD | ExportFlags () const |
void | ImportFlags (DWORD fl) |
IOResult | WriteFlags (ISave *isave, ULONG *nb) const |
IOResult | ReadFlags (ILoad *iload, ULONG *nb) |
Public Attributes | |
int | v1 |
The start vertex index into the parent MNMesh's list of MNVerts. More... | |
int | v2 |
The end vertex index into the parent MNMesh's list of MNVerts. More... | |
int | f1 |
The (unique) face that references this edge in the forward direction. More... | |
int | f2 |
The face (if any) that references this edge in the backward direction. More... | |
int | track |
Additional Inherited Members | |
Static Public Member Functions inherited from MaxHeapOperators | |
static UtilExport void * | operator new (size_t size) |
Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e) |
Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new (size_t size, const char *filename, int line) |
New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, const char *filename, int line) |
New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new (size_t size, unsigned long flags) |
New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, unsigned long flags) |
New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new[] (size_t size) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new[] (size_t size, const char *filename, int line) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate arrays of objects. More... | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new[] (size_t size, unsigned long flags) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, unsigned long flags) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void | operator delete (void *ptr) |
Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e) |
Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete (void *ptr, const char *filename, int line) |
Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, int block_type, const char *filename, int line) |
Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete (void *ptr, unsigned long flags) |
Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags) |
Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete[] (void *ptr) |
Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e) |
Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete[] (void *ptr, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, int block_type, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete[] (void *ptr, unsigned long flags) |
Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags) |
Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, void *placement_ptr) |
Placement new operator. More... | |
static UtilExport void | operator delete (void *ptr, void *placement_ptr) |
Placement delete operator. More... | |
static UtilExport void * | aligned_malloc (size_t size, size_t alignment) |
Allocates memory on a specified alignment boundary. More... | |
static UtilExport void * | aligned_realloc (void *ptr, size_t size, size_t alignment) |
Reallocates memory on a specified alignment boundary. More... | |
static UtilExport void | aligned_free (void *ptr) |
Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More... | |
|
inline |
Constructor.
Initializes both faces to -1 and both vertices to 0.
Constructor.
Initializes edge to run from vv1 to vv2 with f1 set to fc.
|
inline |
Initializes v1, v2 and f1 to 0, f2 to -1 and track to -1.
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.
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.
|
inline |
Flips the edge around, so that it now goes from what was v2 to what was v1.
f1 and f2 are also switched. This should not be called on one-sided edges.
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.
Replaces vertex ov in the edge records with vertex nv.
NOTE that this method causes an assertion failure if vertex ov is not used by this edge
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)).
|
inline |
Comparison operator.
Vertex access operator.
Vertex access operator.
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:
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.