3ds Max C++ API Reference
Loading...
Searching...
No Matches
MeshNormalFace Class Reference

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

#include <MeshNormalSpec.h>

+ Inheritance diagram for MeshNormalFace:

Public Member Functions

 MeshNormalFace ()
 Constructor - sets all corners to "unspecified".
 
DllExport void Clear ()
 Resets all corners to "unspecified".
 
int GetNormalID (int corner) const
 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.
 
const intGetNormalIDArray () const
 return an array of 3 normal IDs
 
intGetNormalIDArray ()
 
bool GetSpecified (int corner) const
 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 MeshNormalFaceoperator= (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.
 

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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 

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

Constructor & Destructor Documentation

◆ MeshNormalFace()

MeshNormalFace ( )
inline

Constructor - sets all corners to "unspecified".

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

Member Function Documentation

◆ Clear()

DllExport void Clear ( )

Resets all corners to "unspecified".

◆ GetNormalID()

int GetNormalID ( int  corner) const
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)
67 {
68 return ((corner > -1) && (corner < 3)) ? mNormalID[corner] : -1;
69 }

◆ SetNormalID()

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).
75 {
76 if ((corner > -1) && (corner < 3))
77 mNormalID[corner] = norm;
78 }

◆ GetNormalIDArray() [1/2]

const int * GetNormalIDArray ( ) const
inline

return an array of 3 normal IDs

Returns
an array of 3 normal IDs
83 {
84 return mNormalID;
85 }

◆ GetNormalIDArray() [2/2]

int * GetNormalIDArray ( )
inline
87 {
88 return mNormalID;
89 }

◆ GetSpecified()

bool GetSpecified ( int  corner) const
inline

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

93 {
94 return ((corner > -1) && (corner < 3) && (mSpecified & (1 << corner))) ? true : false;
95 }

◆ SetSpecified()

DllExport void SetSpecified ( int  corner,
bool  value = true 
)

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

◆ SpecifyNormalID()

DllExport void SpecifyNormalID ( int  corner,
int  norm 
)

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

◆ SpecifyAll()

void SpecifyAll ( bool  value = true)
inline

Sets this face to have all its normals specified.

105 {
106 mSpecified = value ? 7 : 0;
107 }

◆ Flip()

DllExport void Flip ( )

Reverses the order of the normals.

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

◆ operator=()

DllExport MeshNormalFace & operator= ( const MeshNormalFace from)

Standard = operator.

◆ MyDebugPrint()

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.

◆ Save()

DllExport IOResult Save ( ISave isave)

Save to file.

◆ Load()

DllExport IOResult Load ( ILoad iload)

Load from file.