36 "number of elements in pointFlag and pointPosition is not equal \n";
60 maxPoints_ = pointFlag_.capacity();
61 numPoints_ = pointFlag_.size();
67 return pointPosition_;
81 if( capacity() - activeRange_.second >= numNewPoints )
84 return makeUnique<int32IndexContainer>(
86 activeRange_.second+numNewPoints);
91 if( activeRange_.first >= numNewPoints)
93 return makeUnique<int32IndexContainer>(
109 newPoints.push_back(
static_cast<int32>(i));
113 if(numAdded == numNewPoints)
115 return makeUnique<int32IndexContainer>(
122 if( numAdded <numNewPoints && capacity() - size() >= numNewPoints - numAdded )
125 for(
int32 i=numAdded; i<numNewPoints; i++)
127 newPoints.push_back(ind);
131 return makeUnique<int32IndexContainer>(
147 pointFlag_(
"pointFlag",
"pointFlag", maxPoints_, 0 ,
RESERVE()),
148 pointPosition_(
"pointPosition",
"pointPosition", maxPoints_, 0,
RESERVE()),
160 pointFlag_(
"pointFlag",
"pointFlag", maxPoints_, 0 ,
RESERVE()),
161 pointPosition_(
"pointPosition",
"pointPosition", maxPoints_, 0,
RESERVE()),
165 pointFlag_.assign(flgVec);
167 pointPosition_.assign(posVec);
169 if( !evaluatePointStructure() )
182 pointFlag_(
"pointFlag",
"pointFlag", maxPoints_, 0 ,
RESERVE()),
183 pointPosition_(
"pointPosition",
"pointPosition", maxPoints_, 0,
RESERVE()),
187 pointPosition_.assign(posVec);
192 if( !evaluatePointStructure() )
201 return pointPosition_;
226 return numActivePoints_;
232 return numActivePoints_ == numPoints_;
242 pointPosition_.deviceVectorAll(),
243 pointFlag_.deviceVectorAll(),
244 mortonSortedIndex_) )
250 pointPosition_.sortItems(mortonSortedIndex_);
251 pointFlag_.sortItems(mortonSortedIndex_);
253 auto oldSize = size();
254 auto oldCapacity = capacity();
255 auto oldRange = activeRange();
259 activeRange_ = {0,
static_cast<int>(mortonSortedIndex_.size())};
260 numActivePoints_ = mortonSortedIndex_.size();
264 if(oldSize != size() )
269 if(oldCapacity != capacity())
274 if( oldRange != activeRange_)
280 if( !this->notify(msg) )
return false;
288 if(numPoints_==0)
return 0;
290 int32 minRange, maxRange;
297 pointPosition_.deviceVectorAll(),
298 pointFlag_.deviceVectorAll(),
300 minRange, maxRange );
304 pointFlag_.modifyOnDevice();
305 pointFlag_.syncViews();
308 if( numMarked<=numActivePoints_)
310 numActivePoints_ -= numMarked;
315 "number of points marked as delete ("<<numMarked<<
316 ") is greater than the activePoints ("<<numActivePoints_<<
321 range newRange = {minRange, maxRange};
323 if( activeRange_ != newRange )
325 activeRange_ = newRange;
329 if( !this->notify(msg) )
332 "something went wrong in notifying registered object about range change. \n";
359 auto numNew = pos.
size();
362 return makeUnique<int32IndexContainer>();
365 auto newPointsPtr = getNewPointsIndices( numNew );
367 if(!newPointsPtr)
return nullptr;
369 auto oldSize = size();
370 auto oldCapacity = capacity();
371 auto oldRange = activeRange();
373 tobeInsertedIndex_ = newPointsPtr();
377 if(!pointPosition_.insertSetElement(
382 if(!pointFlag_.insertSetElement(
384 static_cast<int8>(PointFlag::ACTIVE))
388 auto minInd = newPointsPtr().min();
389 auto maxInd = newPointsPtr().max();
394 for(
auto sfEntry:setField)
397 sfEntry.setPointFieldSelectedAll(
403 localExlusion.push_back(
411 activeRange_ = {
static_cast<int>(
min(activeRange_.first, minInd )),
412 static_cast<int>(
max(activeRange_.second, maxInd+1))};
414 numActivePoints_ += numNew;
418 if( oldRange != activeRange_ )
421 if( oldSize != size() )
424 if( oldCapacity != capacity() )
428 if( !this->notify(msg, localExlusion) )
return nullptr;
441 auto psCapacity = is.
lookupDataOrSet(
"pointStructureCapacity", maxSizeDefault_);
442 pointPosition_.reallocate(psCapacity);
443 pointFlag_.reallocate(psCapacity);
445 if( !pointPosition_.read(is))
448 "Error in reading pointPosition in pointStructure \n";
452 if(! pointFlag_.read(is,
true))
455 "Error in reading pointFlag in pointStructure \n";
460 return evaluatePointStructure();
471 if(!pointPosition_.write(os))
474 "error in writing pointPosition to file \n";
478 if(!pointFlag_.write(os))
481 "error in writing pointFlag to file \n";