planargraph/GraphComponent.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2001-2002 Vivid Solutions Inc.
* Copyright (C) 2005-2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: planargraph/GraphComponent.java rev. 1.7 (JTS-1.7)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
namespace geos {
namespace planargraph { // geos.planargraph
class GEOS_DLL GraphComponent {
protected:
bool isMarkedVar;
bool isVisitedVar;
public:
GraphComponent()
:
isMarkedVar(false),
isVisitedVar(false)
{}
virtual
~GraphComponent() {}
virtual bool
isVisited() const
{
return isVisitedVar;
}
virtual void
setVisited(bool p_isVisited)
{
isVisitedVar = p_isVisited;
}
template <typename T>
static void
setVisited(T start, T end, bool visited)
{
for(T i = start; i != end; ++i) {
(*i)->setVisited(visited);
}
}
template <typename T>
static void
setVisitedMap(T start, T end, bool visited)
{
for(T i = start; i != end; ++i) {
i->second->setVisited(visited);
}
}
template <typename T>
static void
setMarked(T start, T end, bool marked)
{
for(T i = start; i != end; ++i) {
(*i)->setMarked(marked);
}
}
template <typename T>
static void
setMarkedMap(T start, T end, bool marked)
{
for(T i = start; i != end; ++i) {
i->second->setMarked(marked);
}
}
virtual bool
isMarked() const
{
return isMarkedVar;
}
virtual void
setMarked(bool p_isMarked)
{
isMarkedVar = p_isMarked;
}
};
} // namespace geos::planargraph
} // namespace geos
geos::planargraph::GraphComponent
The base class for all graph component classes.
Definition planargraph/GraphComponent.h:45
geos::planargraph::GraphComponent::setVisited
static void setVisited(T start, T end, bool visited)
Sets the Visited state for the elements of a container, from start to end iterator.
Definition planargraph/GraphComponent.h:98
geos::planargraph::GraphComponent::setVisited
virtual void setVisited(bool p_isVisited)
Sets the visited flag for this component.
Definition planargraph/GraphComponent.h:83
geos::planargraph::GraphComponent::setMarkedMap
static void setMarkedMap(T start, T end, bool marked)
Sets the Marked state for the values of each map container element, from start to end iterator.
Definition planargraph/GraphComponent.h:150
geos::planargraph::GraphComponent::setMarked
virtual void setMarked(bool p_isMarked)
Sets the marked flag for this component.
Definition planargraph/GraphComponent.h:173
geos::planargraph::GraphComponent::setMarked
static void setMarked(T start, T end, bool marked)
Sets the Marked state for the elements of a container, from start to end iterator.
Definition planargraph/GraphComponent.h:132
geos::planargraph::GraphComponent::setVisitedMap
static void setVisitedMap(T start, T end, bool visited)
Sets the Visited state for the values of each map container element, from start to end iterator.
Definition planargraph/GraphComponent.h:115
geos::planargraph::GraphComponent::isMarkedVar
bool isMarkedVar
Variable holding ''marked'' status.
Definition planargraph/GraphComponent.h:50
geos::planargraph::GraphComponent::isVisitedVar
bool isVisitedVar
Variable holding ''visited'' status.
Definition planargraph/GraphComponent.h:53
geos::planargraph::GraphComponent::isVisited
virtual bool isVisited() const
Tests if a component has been visited during the course of a graph algorithm.
Definition planargraph/GraphComponent.h:73
geos::planargraph::GraphComponent::isMarked
virtual bool isMarked() const
Tests if a component has been marked at some point during the processing involving this graph.
Definition planargraph/GraphComponent.h:163
geos::planargraph
Contains classes to implement a planar graph data structure.
Definition namespaces.h:293
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38