16 #ifndef QGSCHUNKEDENTITY_P_H 
   17 #define QGSCHUNKEDENTITY_P_H 
   30 #include <Qt3DCore/QEntity> 
   38 class QgsChunkQueueJob;
 
   39 class QgsChunkLoaderFactory;
 
   40 class QgsChunkBoundsEntity;
 
   41 class QgsChunkQueueJobFactory;
 
   62 class QgsChunkedEntity : 
public Qt3DCore::QEntity
 
   67     QgsChunkedEntity( 
float tau, QgsChunkLoaderFactory *loaderFactory, 
bool ownsFactory, 
int primitivesBudget = std::numeric_limits<int>::max(), Qt3DCore::QNode *parent = 
nullptr );
 
   68     ~QgsChunkedEntity() 
override;
 
   76       QMatrix4x4 viewProjectionMatrix; 
 
   80     void update( 
const SceneState &state );
 
   83     bool needsUpdate()
 const { 
return mNeedsUpdate; }
 
   86     void setShowBoundingBoxes( 
bool enabled );
 
   89     void updateNodes( 
const QList<QgsChunkNode *> &nodes, QgsChunkQueueJobFactory *updateJobFactory );
 
   92     QList<QgsChunkNode *> activeNodes()
 const { 
return mActiveNodes; }
 
   94     QgsChunkNode *rootNode()
 const { 
return mRootNode; }
 
   97     int pendingJobsCount() 
const;
 
  100     void setPickingEnabled( 
bool enabled );
 
  102     bool hasPickingEnabled()
 const { 
return mPickingEnabled; }
 
  105     void setUsingAdditiveStrategy( 
bool additive ) { mAdditiveStrategy = additive; }
 
  112     bool usingAditiveStrategy()
 const { 
return mAdditiveStrategy; }
 
  116     void cancelActiveJob( QgsChunkQueueJob *job );
 
  117     void cancelActiveJobs();
 
  119     void setNeedsUpdate( 
bool needsUpdate ) { mNeedsUpdate = needsUpdate; }
 
  122     void update( QgsChunkNode *node, 
const SceneState &state );
 
  125     void requestResidency( QgsChunkNode *node );
 
  128     QgsChunkQueueJob *startJob( QgsChunkNode *node );
 
  131     void onActiveJobFinished();
 
  133     void onPickEvent( Qt3DRender::QPickEvent *event );
 
  137     void pendingJobsCountChanged();
 
  140     void newEntityCreated( Qt3DCore::QEntity *entity );
 
  143     void pickedObject( Qt3DRender::QPickEvent *pickEvent, 
QgsFeatureId fid );
 
  147     QgsChunkNode *mRootNode = 
nullptr;
 
  149     bool mNeedsUpdate = 
false;
 
  160     QgsChunkLoaderFactory *mChunkLoaderFactory = 
nullptr;
 
  162     bool mOwnsFactory = 
true;
 
  164     QgsChunkList *mChunkLoaderQueue = 
nullptr;
 
  166     QgsChunkList *mReplacementQueue = 
nullptr;
 
  168     QList<QgsChunkNode *> mActiveNodes;
 
  170     int mFrustumCulled = 0;
 
  177     int mMaxLoadedChunks = 512;
 
  180     QgsChunkBoundsEntity *mBboxesEntity = 
nullptr;
 
  183     QList<QgsChunkQueueJob *> mActiveJobs;
 
  186     bool mPickingEnabled = 
false;
 
  192     bool mAdditiveStrategy = 
false;
 
  194     bool mIsValid = 
true;
 
  196     int mPrimitivesBudget = std::numeric_limits<int>::max();
 
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features