#ifndef CT_ABSTRACTGLOBALCLOUDMANAGERT_H #define CT_ABSTRACTGLOBALCLOUDMANAGERT_H #include "ct_cloud/tools/abstract/ct_abstractglobalcloudmanager.h" #include "ct_cloudindex/tools/abstract/ct_abstractcloudindexregistrationmanagert.h" #include "ct_global/ct_context.h" /** * Utility class who manage a global cloud of T (point, face, etc...). It will inform the CT_AbstractCloudIndexRegistrationManagerT and all * CT_AbstractCloudSyncToGlobalCloudManagerT when elements of the cloud is deleted or added. So we can sync index and * other cloud with this global cloud. */ template class CT_AbstractGlobalCloudManagerT : public CT_AbstractGlobalCloudManager { public: typedef typename CT_AbstractCloudIndexRegistrationManagerT::CT_AbstractModifiableCIR CT_AbstractModifiableCIR; typedef typename CT_AbstractCloudIndexRegistrationManagerT::CT_AbstractNotModifiableCIR CT_AbstractNotModifiableCIR; typedef typename CT_AbstractCloudIndexRegistrationManagerT::CT_AbstractCIR CT_AbstractCIR; enum IndexOptimization { MemoryOptimized = 0, AccessSpeedOptimized }; CT_AbstractGlobalCloudManagerT(); /** * @brief Returns the global cloud of T */ virtual CT_AbstractCloudT* globalAbstractCloudT() const = 0; protected: QList< CT_AbstractCloudIndexRegisteredT* > m_cirArray; QList< CT_AbstractCloudIndexRegisteredT* > m_cirArrayUnsync; void shiftAllCloudIndexFrom(const int &from, const size_t &offset, const bool &negativeOffset); void lockAllDocuments(); void unlockAllDocuments(); template std::vector< ct_index_type >* getInternalDataOfIndex(CI *index) const; template CIR* createNewIndexRegistered(CI *index) const; friend class CT_Mesh; // called by CT_Mesh (and must only be called by CT_Mesh) void setEnableSyncForCIR(CT_AbstractCloudIndexRegisteredT *cir, bool enable); // called by inherited class to know index to ignore to sync bool nextIndexToIgnoreToSync(const size_t ¤tIndex, size_t &beginIndex, size_t &endIndex); }; #include "ct_cloud/tools/abstract/ct_abstractglobalcloudmanagert.hpp" #endif // CT_ABSTRACTGLOBALCLOUDMANAGERT_H