ImageGraph.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00007 /*  This is free software; you can redistribute it and/or
00008  *  modify it under the terms of the GNU General Public
00009  *  License as published by the Free Software Foundation; either
00010  *  version 2 of the License, or (at your option) any later version.
00011  *
00012  *  This software is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  *  Lesser General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public
00018  *  License along with this software. If not, see
00019  *  <http://www.gnu.org/licenses/>.
00020  *
00021  */
00022 
00023 #ifndef _PANODATA_IMAGEGRAPH_H
00024 #define _PANODATA_IMAGEGRAPH_H
00025 
00026 #include <hugin_shared.h>
00027 
00028 #include <panodata/PanoramaData.h>
00029 #include <algorithms/basic/CalculateOverlap.h>
00030 
00031 namespace HuginGraph
00032 {
00033 
00035 class IMPEX BreadthFirstSearchVisitor
00036 {
00037 public:
00038     virtual void Visit(const size_t vertex, const HuginBase::UIntSet& visitedNeighbors, const HuginBase::UIntSet& unvisitedNeighbors) = 0;
00039 };
00040 
00044 class IMPEX ImageGraph
00045 {
00046 public:
00048     typedef std::vector<HuginBase::UIntSet> GraphList;
00050     typedef std::vector<HuginBase::UIntSet> Components;
00052     ImageGraph(const HuginBase::PanoramaData& pano, bool ignoreLinkedPosition = false);
00054     ImageGraph(const HuginBase::CalculateImageOverlap& overlap);
00059     Components GetComponents();
00065     bool IsConnected();
00071     void VisitAllImages(const size_t startImg, bool forceAllComponents, BreadthFirstSearchVisitor* visitor);
00072 private:
00073     GraphList m_graph;
00074 }; // class ImageGraph
00075 
00076 } // namespace HuginGraph
00077 
00078 #endif // _PANODATA_IMAGEGRAPH_H

Generated on 26 Aug 2016 for Hugintrunk by  doxygen 1.4.7