3ds Max C++ API Reference
|
This class is an interface used to store user-specified normals (such as those created in the Edit Normals modifier). More...
#include <MeshNormalSpec.h>
Public Member Functions | |
MeshNormalSpec () | |
~MeshNormalSpec () | |
void | SetFlag (DWORD fl, bool val=true) |
Sets flags in the MeshNormalSpec. | |
void | ClearFlag (DWORD fl) |
Clears the flags given. See GetFlag for more details on MeshNormalSpec flags. | |
bool | GetFlag (DWORD fl) const |
Gets flags in the MeshNormalSpec. | |
DllExport void | Initialize () |
Initializes all data members - do not use if already allocated! | |
DllExport bool | NAlloc (int num, bool keep=TRUE) |
DllExport void | NShrink () |
shrinks allocation down to actual number of normals. | |
DllExport bool | FAlloc (int num, bool keep=TRUE) |
DllExport void | FShrink () |
DllExport void | Clear () |
Deletes everything. | |
DllExport void | ClearAndFree () |
Deletes everything, frees all memory. | |
int | GetNumFaces () const |
DllExport bool | SetNumFaces (int numFaces) |
int | GetNumNormals () const |
DllExport bool | SetNumNormals (int numNormals) |
const Point3 & | Normal (int normID) const |
Point3 & | Normal (int normID) |
const Point3 * | GetNormalArray () const |
Point3 * | GetNormalArray () |
bool | GetNormalExplicit (int normID) const |
void | SetNormalExplicit (int normID, bool value) |
bool | AnyExplicitNormalsSet () const |
Returns true if there are any explicit normals set. | |
void | SetAllExplicit (bool value=true) |
Set all normals to be explicit. | |
const MeshNormalFace & | Face (int faceID) const |
MeshNormalFace & | Face (int faceID) |
const MeshNormalFace * | GetFaceArray () const |
MeshNormalFace * | GetFaceArray () |
void | SetParent (Mesh *pMesh) |
DllExport const Point3 & | GetNormal (int face, int corner) const |
DllExport Point3 & | GetNormal (int face, int corner) |
DllExport void | SetNormal (int face, int corner, Point3 &normal) |
DllExport int | GetNormalIndex (int face, int corner) const |
DllExport void | SetNormalIndex (int face, int corner, int normalIndex) |
DllExport int | NewNormal (Point3 normal, bool explic=true) |
DllExport void | SetSelection (BitArray &newSelection) |
const BitArray & | GetSelection () const |
BitArray & | GetSelection () |
void | SetDisplayLength (float displayLength) |
float | GetDisplayLength () const |
DllExport void | Display (GraphicsWindow *gw, bool showSel) |
DllExport bool | HitTest (GraphicsWindow *gw, HitRegion *hr, DWORD flags, SubObjHitList &hitList) |
DllExport Box3 | GetBoundingBox (const Matrix3 *tm=NULL, bool selectedOnly=false) const |
DllExport void | ClearNormals () |
This method dumps all unspecified normals. Best to use only from within CheckNormals. | |
DllExport void | BuildNormals () |
Fills in the mpSpecNormal data by building all the unspecified normals, and computing non-explicit ones. | |
DllExport void | ComputeNormals () |
This method just recomputes the directions of non-explicit normals, without rebuilding the normal list. | |
DllExport void | CheckNormals () |
This checks our flags and calls BuildNormals, ComputeNormals as needed. | |
DllExport MeshNormalSpec & | operator= (const MeshNormalSpec &from) |
DllExport void | CopySpecified (const MeshNormalSpec &from) |
DllExport bool | CopySpecified (const MeshNormalSpec &sourceNormals, const Tab< int > &faceIndexMap, int offset=0) |
For each face index map entry faceIndexMap[f] which is valid, i.e. | |
DllExport MeshNormalSpec & | operator+= (const MeshNormalSpec &from) |
DllExport void | MyDebugPrint (bool printAll=false) |
DllExport bool | CheckAllData (int numParentFaces) |
DllExport IOResult | Save (ISave *isave) |
DllExport IOResult | Save (ISave *isave, ChannelMask channels) |
DllExport IOResult | Load (ILoad *iload) |
DllExport IOResult | Load (ILoad *iload, ChannelMask channels) |
Interface_ID | GetID () override |
DllExport void | DeleteInterface () override |
DllExport BaseInterface * | GetInterface (Interface_ID id) override |
DllExport BaseInterface * | CloneInterface (void *remapDir=NULL) override |
DllExport void | ShallowCopy (IPipelineClient *from, ChannelMask channels) override |
DllExport void | DeepCopy (IPipelineClient *from, ChannelMask channels) override |
DllExport void | NewAndCopyChannels (ChannelMask channels) override |
DllExport void | FreeChannels (ChannelMask channels, int zeroOthers=1) override |
DllExport void | ZeroChannels (ChannelMask channels) override |
DllExport void | AppendAllChannels (IPipelineClient *from) override |
DllExport bool | Transform (const Matrix3 &transformMat, bool useSelelection=false, const BitArray *normalSelection=nullptr, bool isGeomTransform=true) |
Transforms the normals. | |
DllExport bool | Translate (Point3 &translate, BOOL useSel=true, BitArray *normalSelection=NULL) |
DllExport bool | BreakNormals (BOOL useSel=true, BitArray *normalSelection=NULL, BOOL toAverage=false) |
DllExport bool | UnifyNormals (BOOL useSel=true, BitArray *normalSelection=NULL, BOOL toAverage=false) |
DllExport bool | AverageNormals (BOOL useThresh=false, float threshold=0.0f, BOOL useSel=true, BitArray *normalSelection=NULL) |
DllExport bool | SpecifyNormals (BOOL useSel=true, BitArray *normalSelection=NULL) |
DllExport bool | MakeNormalsExplicit (BOOL useSel=true, BitArray *normalSelection=NULL, bool value=true) |
DllExport bool | ResetNormals (BOOL useSel=true, BitArray *normalSelection=NULL) |
virtual void | ShallowCopy (IPipelineClient *from, ChannelMask channels)=0 |
virtual void | DeepCopy (IPipelineClient *from, ChannelMask channels)=0 |
virtual void | NewAndCopyChannels (ChannelMask channels)=0 |
virtual void | FreeChannels (ChannelMask channels, int zeroOthers=1)=0 |
virtual void | ZeroChannels (ChannelMask channels)=0 |
virtual void | AppendAllChannels (IPipelineClient *from)=0 |
virtual Interface_ID | GetID () |
![]() | |
virtual UtilExport | ~BaseInterface () |
Destructor. | |
UtilExport BaseInterface * | GetInterface (Interface_ID id) override |
virtual UtilExport Interface_ID | GetID () |
virtual LifetimeType | LifetimeControl () |
virtual bool | RegisterNotifyCallback (InterfaceNotifyCallback *incb) |
virtual void | UnRegisterNotifyCallback (InterfaceNotifyCallback *incb) |
virtual BaseInterface * | AcquireInterface () |
virtual void | ReleaseInterface () |
virtual void | DeleteInterface () |
virtual BaseInterface * | CloneInterface (void *remapDir=nullptr) |
![]() | |
virtual UtilExport | ~InterfaceServer () |
Destructor. | |
virtual UtilExport BaseInterface * | GetInterface (Interface_ID id) |
template<class InterfaceType > | |
InterfaceType * | GetTypedInterface () |
Additional Inherited Members | |
![]() | |
enum | LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled } |
![]() | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
static UtilExport void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate arrays of objects. | |
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. | |
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. | |
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. | |
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 void * | operator 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 void * | aligned_malloc (size_t size, size_t alignment) |
Allocates memory on a specified alignment boundary. | |
static UtilExport void * | aligned_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. | |
This class is an interface used to store user-specified normals (such as those created in the Edit Normals modifier).
These normals have very limited pipeline support. They are used for viewport display, but not for rendering.
The MeshNormalSpec contains three types of normals:
|
inline |
|
inline |
|
inline |
Sets flags in the MeshNormalSpec.
Generally, the only flag that clients should set is the MESH_NORMAL_MODIFIER_SUPPORT flag. See GetFlag for more details.
|
inline |
Clears the flags given. See GetFlag for more details on MeshNormalSpec flags.
|
inline |
Gets flags in the MeshNormalSpec.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns true if there are any explicit normals set.
|
inline |
Set all normals to be explicit.
value | - If true, all normals will be set to explicit. If false, all normals will be set to non-explicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
DllExport void Display | ( | GraphicsWindow * | gw, |
bool | showSel | ||
) |
DllExport bool HitTest | ( | GraphicsWindow * | gw, |
HitRegion * | hr, | ||
DWORD | flags, | ||
SubObjHitList & | hitList | ||
) |
This method dumps all unspecified normals. Best to use only from within CheckNormals.
Fills in the mpSpecNormal data by building all the unspecified normals, and computing non-explicit ones.
This method just recomputes the directions of non-explicit normals, without rebuilding the normal list.
This checks our flags and calls BuildNormals, ComputeNormals as needed.
DllExport MeshNormalSpec & operator= | ( | const MeshNormalSpec & | from | ) |
DllExport void CopySpecified | ( | const MeshNormalSpec & | from | ) |
DllExport bool CopySpecified | ( | const MeshNormalSpec & | sourceNormals, |
const Tab< int > & | faceIndexMap, | ||
int | offset = 0 |
||
) |
For each face index map entry faceIndexMap[f] which is valid, i.e.
faceIndexMap[f] >= 0, the face targetFace = faceIndexMap[f] + offset of this object is defined as a copy of source face f of object sourceNormals, which may be the same as this object. In particular, face targetFace is allocated if necessary, and any vertex normals which are set as specified for the source face are copied to the corresponding vertices of the target face. The explicitness of normals is also preserved in the copy. Note that the operation will fail if sourceNormals is the same as this object, and the index map contains undefined copies, i.e. if for any f we have the conditions 0 <= faceIndexMap[f], targetFace < faceIndexMap.Count(), and faceIndexMap[targetFace] >= 0.
[in] | sourceNormals | specified normals object containing the source face data |
[in] | faceIndexMap | map from source to target faces; the condition faceIndexMap[f] < 0 indicates that source face f is not to be copied |
[in] | offset | index offset to be applied to all valid entries of faceIndexMap in order to obtain the target face index; note that nnegative values are invalid, and will result in failure and a false return value |
DllExport MeshNormalSpec & operator+= | ( | const MeshNormalSpec & | from | ) |
DllExport IOResult Save | ( | ISave * | isave, |
ChannelMask | channels | ||
) |
DllExport IOResult Load | ( | ILoad * | iload, |
ChannelMask | channels | ||
) |
|
inlineoverridevirtual |
Reimplemented from BaseInterface.
|
overridevirtual |
Reimplemented from BaseInterface.
|
overridevirtual |
Reimplemented from BaseInterface.
|
overridevirtual |
Implements IPipelineClient.
|
overridevirtual |
Implements IPipelineClient.
|
overridevirtual |
Implements IPipelineClient.
|
overridevirtual |
Implements IPipelineClient.
|
overridevirtual |
Implements IPipelineClient.
|
overridevirtual |
Implements IPipelineClient.
DllExport bool Transform | ( | const Matrix3 & | transformMat, |
bool | useSelelection = false , |
||
const BitArray * | normalSelection = nullptr , |
||
bool | isGeomTransform = true |
||
) |
Transforms the normals.
If isGeomTransform is true, the normals are transformed consistent with the transformation defined by matrix transformMat being applied to the geometry, meaning that the normal vectors are multiplied by transpose of the inverse of transformMat. If isGeomTransform is false, then the matrix portion of transformMat is simply applied directly. In both cases, we disregard the translation vector, and renormalize the affected normal vectors. Note that if transformMat represents a rotation, then the result is independent of the choice of isGeomTransform, since the matrix will be orthogonal.
[in] | transformMat | matrix representing the transformation to be applied |
[in] | useSelelection | when true, only selected normals are altered, otherwise, the transformation is applied to all defined normals |
[in] | normalSelection | when useSelection is true, the selected normals are defined by normalSelection if not null, or the usual member selection, otherwise |
[in] | isGeomTransform | when true, matrix transformMat is interpreted as a transformation applied to the associated geometry, as discussed above |
DllExport bool Translate | ( | Point3 & | translate, |
BOOL | useSel = true , |
||
BitArray * | normalSelection = NULL |
||
) |
DllExport bool BreakNormals | ( | BOOL | useSel = true , |
BitArray * | normalSelection = NULL , |
||
BOOL | toAverage = false |
||
) |
DllExport bool UnifyNormals | ( | BOOL | useSel = true , |
BitArray * | normalSelection = NULL , |
||
BOOL | toAverage = false |
||
) |
DllExport bool AverageNormals | ( | BOOL | useThresh = false , |
float | threshold = 0.0f , |
||
BOOL | useSel = true , |
||
BitArray * | normalSelection = NULL |
||
) |
DllExport bool MakeNormalsExplicit | ( | BOOL | useSel = true , |
BitArray * | normalSelection = NULL , |
||
bool | value = true |
||
) |