/******************************************************************************
** Copyright (c) 2022 MAK Technologies, Inc.
** All rights reserved.
******************************************************************************/
#pragma once

//! \file DtCDBTextureCollectionPolicy.h
//! \brief DtCDBTextureCollectionPolicy
//! \ingroup osgdb_osgearth_model_cdb


#include <vrvOsg/DtIndirectTextureCollectionPolicy.h>
#include <vrvOsg/DtEffectTextureType.h>

#include <vector>

namespace makVrv 
{
   class DtDe;
   class DtIndirectTexturePrototypeManager;
   namespace oe 
   {
      namespace CDB
      {
         //! specialization of DtIndirectTextureCollectionPolicy to collect textures for indirect rendering
         //! for cdb cdb effect textures
         class DtCDBTextureCollectionPolicy : public DtIndirectTextureCollectionPolicy
         {
         public:
            //! friend creator class so it can build the policys
            friend class DtCDBTextureCollectionPolicyCreator;

            //! destructor
            virtual ~DtCDBTextureCollectionPolicy();

         protected:
            //! constructor
            DtCDBTextureCollectionPolicy(DtDe& de);
         private:
            //! not allowed
            DtCDBTextureCollectionPolicy(const DtCDBTextureCollectionPolicy&) = delete;
            //! not allowed
            DtCDBTextureCollectionPolicy& operator=(const DtCDBTextureCollectionPolicy&) = delete;
            
         public:
            //! inherited
            //! \see makVrv::DtIndirectTextureCollectionPolicy::collectTextures
            virtual void collectTextures(DtIndirectGeometryTextures& textures, const osg::StateSet* stateSet, const std::string &modelName) const override;         
         protected:
            virtual void setTextureKeyIfNeeded(osg::Texture* texture) const;
         };

         //! creator for DtCDBTextureCollectionPolicy
         class DtCDBTextureCollectionPolicyCreator : public DtIndirectTextureCollectionPolicyCreator
         {
         public:
            //! brief CTOR
            DtCDBTextureCollectionPolicyCreator();

            //! brief DTOR
            virtual ~DtCDBTextureCollectionPolicyCreator();

            //! inherited
            virtual DtCDBTextureCollectionPolicy* create(DtDe& de);

         };
      }
   }
}
