3ds Max C++ API Reference
OrbazTrueBlockEnumerator Class Reference

#include <IParticleChannelTrueFalseIterator.h>

+ Inheritance diagram for OrbazTrueBlockEnumerator:

Public Member Functions

 OrbazTrueBlockEnumerator (OrbazTrueBlock *&trueBlocks)
 
virtual void proc (int n)
 
int NumBlocksSet (void)
 
OrbazTrueBlockEnumeratoroperator= (const OrbazTrueBlockEnumerator &rhs)
 

Constructor & Destructor Documentation

◆ OrbazTrueBlockEnumerator()

OrbazTrueBlockEnumerator ( OrbazTrueBlock *&  trueBlocks)
inline
142  : m_trueBlocks(trueBlocks)
143  , m_blockIndex(-1)
144  {
145  }

Member Function Documentation

◆ proc()

virtual void proc ( int  n)
inlinevirtual
Remarks
This method is called for each "1" in the BitArray.
Parameters:
int n

This is the zero based index into the BitArray of the element which is "1".

Implements BitArrayCallback.

148  {
149  int curMajorIndex = n & kMajorIndexMask;
150  if (m_blockIndex >= 0)
151  {
152  if (m_trueBlocks[m_blockIndex].GetMajorIndex() != curMajorIndex)
153  {
154  m_trueBlocks[++m_blockIndex].SetMajorIndex(curMajorIndex);
155  }
156  }
157  else
158  {
159  m_blockIndex = 0;
160  m_trueBlocks[0].SetMajorIndex(curMajorIndex);
161  }
162  m_trueBlocks[m_blockIndex].AddBlockIndex(n);
163  }
void SetMajorIndex(int index)
Definition: IParticleChannelTrueFalseIterator.h:96
void AddBlockIndex(int index)

◆ NumBlocksSet()

int NumBlocksSet ( void  )
inline
165 { return m_blockIndex+1; }

◆ operator=()

OrbazTrueBlockEnumerator& operator= ( const OrbazTrueBlockEnumerator rhs)
inline
167  {
168  if (this != &rhs)
169  {
170  m_trueBlocks = rhs.m_trueBlocks;
171  m_blockIndex = rhs.m_blockIndex;
172  }
173  return *this;
174  }