Public Member Functions

MeshNormalFace Class Reference

Search for all occurrences

Detailed Description

See Also: class MeshNormalSpec

This class is available in release 6.0 and later only.

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.

#include <MeshNormalSpec.h>

Inheritance diagram for MeshNormalFace:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  MeshNormalFace ()
  Constructor - sets all corners to "unspecified".
DllExport void  Clear ()
  Resets all corners to "unspecified".
int  GetNormalID (int corner)
  Accessor for normal in a particular corner of the face.
void  SetNormalID (int corner, int norm)
  Setter for the normal used in a particular corner of the face.
int *  GetNormalIDArray ()
  return an array of 3 normal IDs
bool  GetSpecified (int corner)
  Indicates whether the normal used in a particular corner is specified or not.
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)
  Sets this face to have all its normals specified.
DllExport void  Flip ()
  Reverses the order of the normals.
DllExport MeshNormalFace operator= (const MeshNormalFace &from)
  Standard = operator.
DllExport void  MyDebugPrint (bool printAll=false)
  Using DebugPrint, output information about this MeshNormalFace.
DllExport IOResult  Save (ISave *isave)
  Save to file.
DllExport IOResult  Load (ILoad *iload)
  Load from file.

Constructor & Destructor Documentation

MeshNormalFace ( ) [inline]

Constructor - sets all corners to "unspecified".

: mSpecified(0x0) { }

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:
corner The (zero-based) index of the corner of the face
Returns:
The index of the normal (in the owner MeshNormalSpec's normal array)
{ 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:
corner The (zero-based) index of the corner of the face
norm The index of the normal (in the owner MeshNormalSpec's normal array).
{ 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
{ return mNormalID; }
bool GetSpecified ( int  corner ) [inline]

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

{ 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.

{ 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 )
DllExport IOResult Load ( ILoad iload )

Load from file.


MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace
MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace MeshNormalFace