/**********************************************************************
*<
FILE: MeshNormalSpec.h
DESCRIPTION: User-specifiable normals for Triangle Meshes
CREATED BY: Steve Anderson
HISTORY: created July 2002 during SIGGraph
*> Copyright (c) 2002 Autodesk, Inc., All Rights Reserved.
**********************************************************************/
// Necessary prior inclusions...?
#ifndef __MESH_NORMALS_H_
#define __MESH_NORMALS_H_
#include "baseinterface.h"
#include "ipipelineclient.h"
#define MESH_NORMAL_SPEC_INTERFACE Interface_ID(0xa4e770b, 0x47aa3cf9)
///
/// 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.
///
class MeshNormalFace {
int mNormalID[3];
UBYTE mSpecified;
public:
/// Constructor - sets all corners to "unspecified"
MeshNormalFace () : mSpecified(0x0) { }
/// Resets all corners to "unspecified".
DllExport void Clear();
/// Accessor for normal in a particular corner of the face.
/// The (zero-based) index of the corner of the face
/// The index of the normal (in the owner MeshNormalSpec's normal array)
// used in that corner, or -1 for error
int GetNormalID(int corner) { return ((corner>-1) && (corner<3)) ? mNormalID[corner] : -1; }
/// Setter for the normal used in a particular corner of the face
/// The (zero-based) index of the corner of the face
/// The index of the normal (in the owner MeshNormalSpec's normal array).
void SetNormalID (int corner, int norm) { if ((corner>-1) && (corner<3)) mNormalID[corner] = norm; }
int *GetNormalIDArray () { return mNormalID; }
bool GetSpecified (int corner) { return ((corner>-1) && (corner<3) && (mSpecified & (1<