/******************************************************************************
** Copyright (c) 2025 MAK Technologies, Inc.
** All rights reserved.
******************************************************************************/

//! \file DtCDBVectorFeatureGs.h 
//! \brief Class to read CDB GS Feature (as a feature vector)
//! \ingroup osgearth_cdb_utils
#pragma once
#include <osgearth_cdb_utils/DtCDBVectorFeature.h>
#include <osg/ref_ptr>

namespace makVrv
{
   namespace oe
   {
      namespace CDB
      {
         //! \brief Class GS feature vector handler class
         //! \ingroup osgearth_cdb_utils
         class DT_DLL_OSGEARTH_CDB_UTILS DtCDBVectorFeatureGs : public DtCDBVectorFeature
         {
         public:
            //! \brief CTOR
            DtCDBVectorFeatureGs(const DatasetInfo& CurrentDataset, osg::ref_ptr<DtCDBDatabase> cdbDb, const osgDB::Options* dbOptions, 
               const osgEarth::CDBFeatureSource::Options* cdbFeatureSourceOptions, DtDe& de);

            //! \brief DTOR
            ~DtCDBVectorFeatureGs();

            //! \brief Read the index of the needed fields and set myIsInitialized flag to true
            virtual void initialize(const std::string& shpInstanceFile, DtCDBInstanceIndex& instanceAttrIndexes,
               const std::string& dbfClassFile, DtCDBClassIndex& classAttrIndexes,
               const std::string& dbfExtendedFile) override;

            //! \brief Read instance dbf indexes and information
            virtual void readInstance(const std::string& dbfClassFile, DtCDBInstanceIndex& instanceAttrIndexes, const CDBTileKey& key,
               const std::string& shpInstanceFile, VectFile* shpVector, VecInstancesDbfRow& vecInstanceRow, const MapStringToClassDbfRow& classMap) override;

            //! \brief Read class dbf indexes and information
            virtual void readClass(const std::string& dbfClassFile, DtCDBClassIndex& classAttrIndexes, const CDBTileKey& key, MapStringToClassDbfRow& classMap) override;

            //! \brief Process the feature list (read models or light type)
            virtual void processFeature(const std::string& dbfClassFile, const CDBTileKey& key, CdbGroupNode* groupNode, VecInstancesDbfRow& vecInstanceRow,
               DtCdbGroupNodeProgress* progress, bool& wasModelFound) override;

         };
      }
   }
}
