12 m_ChunkStart(calculateChunkStart()),
13 m_ChunkSize(calculateChunkSize()),
43 if (chkend.
x() > dim.
x()) {
47 if (chkend.
y() > dim.
y()) {
51 if (chkend.
z() > dim.
z()) {
286 printMessage(tr(
"Setting buffer to: %1").arg((
long long) buffer));
359 msg += tr(
" [%1]").arg(dep);
382 for (
int i=0; i<n; i++) {
383 if ((iw && iw[i] != 0 && iw[i] == iw[i]) || !iw) {
392 for (
int i=0; i<n; i++) {
393 if ((iw && iw[i] != 0 && iw[i] == iw[i]) || !iw) {
429 for (
int i=0; i<n; i++) {
430 if ((w && w[i] != 0) || !w) {
440 for (
int i=0; i<n; i++) {
473 printMessage(tr(
"Exceeded expected number of merges for chunk [%1] %2 > %3")
500 if (data && weights) {
517 return *data || *weights;
548 for (
int i=0; i<cksz; i++) {
void incChunksHeld(int n)
void mergeData(CctwChunkedData::MergeDataType *id, CctwChunkedData::MergeDataType *iw, int n)
int dependencyCount() const
void setChunkSize(CctwIntVector3D size)
static QAtomicInt g_Allocated(0)
CctwChunkedData::MergeDataType * m_ChunkData
bool dataAllocated() const
CctwIntVector3D m_ChunkStart
void releaseBuffer(CctwChunkedData::MergeDataType *)
void addDependency(int dep)
QList< CctwChunkedData::MergeDataType * > m_MergeWeights
CctwIntVector3D chunkSize()
void clearMergeCounters()
CctwChunkedData::MergeDataType * allocateBuffer()
CctwChunkedData::MergeDataType * m_ChunkWeights
CctwIntVector3D dimensions
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QMutex m_DependenciesLock
static QSemaphore g_Available(1000)
static QAtomicInt g_AllocationLimit(1000)
CctwChunkedData::MergeDataType weight(int lx, int ly, int lz)
CctwIntVector3D calculateChunkStart()
static int allocatedChunkCount()
static QAtomicInt g_ChunkCount
int dependency(int n) const
void mergeChunk(CctwDataChunk *c)
void setData(int lx, int ly, int lz, CctwChunkedData::MergeDataType val)
CctwChunkedData::MergeDataType * weightsPointer()
static int maxAllocated()
CctwIntVector3D calculateChunkSize()
bool popMergeData(CctwChunkedData::MergeDataType **data, CctwChunkedData::MergeDataType **weights)
bool weightsAllocated() const
int pixelOffset(int lx, int ly, int lz)
void pushMergeData(CctwChunkedData::MergeDataType *data, CctwChunkedData::MergeDataType *weights)
CctwIntVector3D chunkStart()
CctwDataChunk(CctwChunkedData *data, int index, QString name, QObject *parent)
CctwVector3D< int > CctwIntVector3D
CctwIntVector3D chunkSize
void setBuffer(void *buffer)
CctwChunkedData::MergeDataType * dataPointer()
QList< CctwChunkedData::MergeDataType * > m_MergeData
void incChunksWritten(int n)
static QAtomicInt g_MaxAllocated(0)
void setWeight(int lx, int ly, int lz, CctwChunkedData::MergeDataType val)
static void resetAllocationLimits(int nmax)
CctwChunkedData::MergeDataType data(int lx, int ly, int lz)
QVector< int > m_Dependencies
void reportDependencies()
CctwIntVector3D m_ChunkSize