3ds Max C++ API Reference
MapBitArray Class Reference

This class can be used to store a bit per map channel, including both negative and positive map channels, and it works with any size index. More...

#include <mesh.h>

+ Inheritance diagram for MapBitArray:

Public Member Functions

 MapBitArray ()
 Constructor. Sets all channels to false. More...
 
 MapBitArray (bool defaultValue)
 Constructor. Sets all channels to the given default value. More...
 
 MapBitArray (bool textureDefault, bool colorDefault)
 Constructor. More...
 
int Largest () const
 Returns the highest index that this MapBitArray could have a non-default value for. More...
 
int Smallest () const
 Returns the lowest index that this MapBitArray could have a non-default value for. More...
 
DllExport void Set (int mapChannel, bool val=true)
 Sets the value of the given channel. More...
 
void Clear (int mapChannel)
 Clears the value of the given channel. More...
 
DllExport bool Get (int mapChannel) const
 Gets the value of the given channel. More...
 
bool TextureDefault () const
 Returns the default value for texture channels, channels 1 and above. More...
 
bool ColorDefault () const
 Returns the default value for color channels, channels 0 and below. More...
 
void InvertTextureChannels ()
 Inverts the value of all texture channels (1 and above). More...
 
void InvertColorChannels ()
 Inverts the value of all color channels (0 and below). More...
 
void InvertAll ()
 Inverts all channel values. More...
 
DllExport IOResult Save (ISave *isave)
 Saves data to stream. More...
 
DllExport IOResult Load (ILoad *iload)
 Loads data from stream. More...
 
bool operator[] (int i) const
 Indexing operator. More...
 
DllExport BOOL operator== (const MapBitArray &b) const
 Comparison operator. More...
 
BOOL operator!= (const MapBitArray &b) const
 Inequality operator. More...
 
DllExport MapBitArrayoperator= (const MapBitArray &b)
 Assignment operator. 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...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

This class can be used to store a bit per map channel, including both negative and positive map channels, and it works with any size index.

Constructor & Destructor Documentation

◆ MapBitArray() [1/3]

MapBitArray ( )
inline

Constructor. Sets all channels to false.

589 : mTexture(false), mColor(false) { }

◆ MapBitArray() [2/3]

MapBitArray ( bool  defaultValue)
inline

Constructor. Sets all channels to the given default value.

594  : mTexture(defaultValue), mColor(defaultValue) { }

◆ MapBitArray() [3/3]

MapBitArray ( bool  textureDefault,
bool  colorDefault 
)
inline

Constructor.

Sets all texture channels (1 and above) to the texture default, and all color channels (0 and below) to the color default.

599  : mTexture(textureDefault), mColor(colorDefault) { }

Member Function Documentation

◆ Largest()

int Largest ( ) const
inline

Returns the highest index that this MapBitArray could have a non-default value for.

All indices above this are guaranteed to have value "TextureDefault()".

603 { return (mTextureFlip.GetSize()>1) ? mTextureFlip.GetSize()-1 : 0; }
int GetSize() const
Definition: bitarray.h:266

◆ Smallest()

int Smallest ( ) const
inline

Returns the lowest index that this MapBitArray could have a non-default value for.

All indices below this are guaranteed to have value "ColorDefault()".

607 { return (mColorFlip.GetSize()>1) ? 1-mColorFlip.GetSize() : 0; }

◆ Set()

DllExport void Set ( int  mapChannel,
bool  val = true 
)

Sets the value of the given channel.

◆ Clear()

void Clear ( int  mapChannel)
inline

Clears the value of the given channel.

613 { Set (mapChannel, false); }
DllExport void Set(int mapChannel, bool val=true)
Sets the value of the given channel.

◆ Get()

DllExport bool Get ( int  mapChannel) const

Gets the value of the given channel.

(If this particular channel has not been set before, the default for the channel will be returned.)

◆ TextureDefault()

bool TextureDefault ( ) const
inline

Returns the default value for texture channels, channels 1 and above.

620 { return mTexture; }

◆ ColorDefault()

bool ColorDefault ( ) const
inline

Returns the default value for color channels, channels 0 and below.

623 { return mColor; }

◆ InvertTextureChannels()

void InvertTextureChannels ( )
inline

Inverts the value of all texture channels (1 and above).

626 { mTexture=!mTexture; }

◆ InvertColorChannels()

void InvertColorChannels ( )
inline

Inverts the value of all color channels (0 and below).

629 { mColor=!mColor; }

◆ InvertAll()

void InvertAll ( )
inline

Inverts all channel values.

632 { mColor = !mColor; mTexture = !mTexture; }

◆ Save()

DllExport IOResult Save ( ISave isave)

Saves data to stream.

◆ Load()

DllExport IOResult Load ( ILoad iload)

Loads data from stream.

◆ operator[]()

bool operator[] ( int  i) const
inline

Indexing operator.

641 { return Get(i); }
DllExport bool Get(int mapChannel) const
Gets the value of the given channel.

◆ operator==()

DllExport BOOL operator== ( const MapBitArray b) const

Comparison operator.

◆ operator!=()

BOOL operator!= ( const MapBitArray b) const
inline

Inequality operator.

647 { return !(*this == b); }

◆ operator=()

DllExport MapBitArray& operator= ( const MapBitArray b)

Assignment operator.