/**************************************************************************** Copyright (C) 2010-2012 the Office National des ForĂȘts (ONF), France All rights reserved. Contact : alexandre.piboule@onf.fr Developers : Alexandre PIBOULE (ONF) This file is part of PluginONF library. PluginONF is free library: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. PluginONF is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with PluginONF. If not, see . *****************************************************************************/ #ifndef ONF_STEPLOADBUFFEREDRASTERS_H #define ONF_STEPLOADBUFFEREDRASTERS_H #include "ct_step/abstract/ct_abstractstep.h" #include "ct_itemdrawable/abstract/ct_abstractsingularitemdrawable.h" #include "ct_itemdrawable/abstract/ct_abstractitemdrawablewithpointcloud.h" #include "ct_itemdrawable/ct_fileheader.h" #include "ct_itemdrawable/ct_box2d.h" #include "ct_itemdrawable/ct_loopcounter.h" #include "ctlibio/readers/ct_reader_gdal.h" class ONF_StepLoadBufferedRasters : public CT_AbstractStep { // IMPORTANT in order to obtain step name Q_OBJECT using SuperClass = CT_AbstractStep; public: ONF_StepLoadBufferedRasters(); QString description() const override; QString detailledDescription() const override; QString inputDescription() const override; QString outputDescription() const override; QString detailsDescription() const override; CT_VirtualAbstractStep* createNewInstance() const final; protected: void declareInputModels(CT_StepInModelStructureManager& manager) final; void fillPostInputConfigurationDialog(CT_StepConfigurableDialog* postInputConfigDialog) final; void declareOutputModels(CT_StepOutModelStructureManager& manager) final; void compute() final; private: class RasterData { public: RasterData(const CT_Reader_GDAL* readerGdal, QString name, const CT_Box2D* area) { _reader = const_cast(readerGdal); _name = name; area->getAreaData().getBoundingBox(_minArea, _maxArea); } RasterData() { _reader = nullptr; _name = ""; } CT_Reader_GDAL* _reader; QString _name; Eigen::Vector3d _minArea; Eigen::Vector3d _maxArea; }; QMap _rasterList; CT_HandleInResultGroup<> _InResultCounter; CT_HandleInStdGroup<> _InGroupCounter; CT_HandleInSingularItem _InLoopCounter; CT_HandleInResultGroupCopy<> _inResult; CT_HandleInStdZeroOrMoreGroup _inZeroOrMoreRootGroup; CT_HandleInStdGroup<> _inGroup; CT_HandleInSingularItem _inItem; CT_HandleInItemAttribute _inAttName; CT_HandleInResultGroup<> _inResultRasters; CT_HandleInStdZeroOrMoreGroup _inZeroOrMoreRootGroupRasters; CT_HandleInStdGroup<> _inGroupRasters; CT_HandleInSingularItem _inReaderItem; CT_HandleInItemAttribute _inAttFileName; CT_HandleInSingularItem _inArea; CT_HandleOutSingularItem > _outRaster; CT_HandleOutSingularItem _outArea; CT_HandleOutSingularItem _outAreaBuffer; double _bufferSize; QString _rasterName; bool intersection2D(const Eigen::Vector3d &minBase, const Eigen::Vector3d &maxBase, const Eigen::Vector3d &min, const Eigen::Vector3d &max, Eigen::Vector3d &minOut, Eigen::Vector3d &maxOut); }; #endif // ONF_STEPLOADBUFFEREDRASTERS_H