MeshNormalFace Class Reference

MeshNormalFace Class Reference

#include <MeshNormalSpec.h>

Class Description

See Also: class MeshNormalSpec This class is used to store specified normal information for a particular face in a Mesh.

An array of these faces is used in class MeshNormalSpec to match vertex normals to vertices.

Each MeshNormalFace contains a bit indicating whether each corner is specified, and a Normal ID for each specified corner.

+ Inheritance diagram for MeshNormalFace:

Public Member Functions

 MeshNormalFace ()
 Constructor - sets all corners to "unspecified". More...
 
DllExport void Clear ()
 Resets all corners to "unspecified". More...
 
int GetNormalID (int corner)
 Accessor for normal in a particular corner of the face. More...
 
void SetNormalID (int corner, int norm)
 Setter for the normal used in a particular corner of the face. More...
 
intGetNormalIDArray ()
 return an array of 3 normal IDs More...
 
bool GetSpecified (int corner)
 Indicates whether the normal used in a particular corner is specified or not. More...
 
DllExport void SetSpecified (int corner, bool value=true)
 Sets the normal used by the corner to be specified or not. More...
 
DllExport void SpecifyNormalID (int corner, int norm)
 Sets the normal used by the corner to be specified, and to use the particular normal given. More...
 
void SpecifyAll (bool value=true)
 Sets this face to have all its normals specified. More...
 
DllExport void Flip ()
 Reverses the order of the normals. More...
 
DllExport MeshNormalFaceoperator= (const MeshNormalFace &from)
 Standard = operator. More...
 
DllExport void MyDebugPrint (bool printAll=false)
 Using DebugPrint, output information about this MeshNormalFace. More...
 
DllExport IOResult Save (ISave *isave)
 Save to file. More...
 
DllExport IOResult Load (ILoad *iload)
 Load from file. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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...
 

Constructor & Destructor Documentation

MeshNormalFace ( )
inline

Constructor - sets all corners to "unspecified".

51  : mSpecified(0x0)
52  {
53  mNormalID[0] = -1;
54  mNormalID[1] = -1;
55  mNormalID[2] = -1;
56  }

Member Function Documentation

DllExport void Clear ( )

Resets all corners to "unspecified".

int GetNormalID ( int  corner)
inline

Accessor for normal in a particular corner of the face.

Parameters
cornerThe (zero-based) index of the corner of the face
Returns
The index of the normal (in the owner MeshNormalSpec's normal array)
65 { return ((corner>-1) && (corner<3)) ? mNormalID[corner] : -1; }
void SetNormalID ( int  corner,
int  norm 
)
inline

Setter for the normal used in a particular corner of the face.

Parameters
cornerThe (zero-based) index of the corner of the face
normThe index of the normal (in the owner MeshNormalSpec's normal array).
70 { if ((corner>-1) && (corner<3)) mNormalID[corner] = norm; }
int* GetNormalIDArray ( )
inline

return an array of 3 normal IDs

Returns
an array of 3 normal IDs
74 { return mNormalID; }
bool GetSpecified ( int  corner)
inline

Indicates whether the normal used in a particular corner is specified or not.

77 { return ((corner>-1) && (corner<3) && (mSpecified & (1<<corner))) ? true : false; }
DllExport void SetSpecified ( int  corner,
bool  value = true 
)

Sets the normal used by the corner to be specified or not.

DllExport void SpecifyNormalID ( int  corner,
int  norm 
)

Sets the normal used by the corner to be specified, and to use the particular normal given.

void SpecifyAll ( bool  value = true)
inline

Sets this face to have all its normals specified.

86 { mSpecified = value ? 7 : 0; }
DllExport void Flip ( )

Reverses the order of the normals.

Corner 0 is unaffected, but corner 1 is switched with corner 2.

DllExport MeshNormalFace& operator= ( const MeshNormalFace from)

Standard = operator.

DllExport void MyDebugPrint ( bool  printAll = false)

Using DebugPrint, output information about this MeshNormalFace.

If "printAll" is true, it will print normal IDs for both specified and unspecified normals; otherwise it'll print only the specified ones. Typical output for a partially specified face: "_7 3 _5" (printAll==true) or "_ 3 _" (printAll==false). A newline is printed at the end.

DllExport IOResult Save ( ISave isave)

Save to file.

DllExport IOResult Load ( ILoad iload)

Load from file.