Loading...
Searching...
No Matches
connectedComponentsProcessor.h
Go to the documentation of this file.
#ifndef BALL_STRUCTURE_CONNECTEDCOMPONENTSPROCESSOR_H
#define BALL_STRUCTURE_CONNECTEDCOMPONENTSPROCESSOR_H
#ifndef BALL_CONCEPT_PROCESSOR_H
# include <BALL/CONCEPT/processor.h>
#endif
#ifndef BALL_KERNEL_MOLECULE_H
#include <BALL/KERNEL/molecule.h>
#endif
#ifndef BOOST_PENDING_DISJOINT_SETS_HPP
#include <boost/pending/disjoint_sets.hpp>
#endif
namespace BALL
{
class BALL_EXPORT ConnectedComponentsProcessor
: public UnaryProcessor<AtomContainer>
{
public:
typedef std::vector<Atom*> Component;
typedef std::vector<Molecule> MolVec;
typedef std::vector<Component> ComponentVector;
BALL_CREATE(ConnectedComponentsProcessor);
ConnectedComponentsProcessor();
virtual ~ConnectedComponentsProcessor();
virtual bool start();
void clear();
virtual Processor::Result operator ()(AtomContainer& ac);
virtual bool finish();
Size getNumberOfConnectedComponents();
void getComponents(ComponentVector &comp);
void getLargestComponent(Molecule &result);
void getMinAtomsComponents(MolVec &result, size_t min);
void getAllComponents(MolVec& results);
protected:
typedef boost::disjoint_sets < int*, int*,
boost::find_with_full_path_compression > DisjointSet;
ComponentVector components_;
};
}
#endif // BALL_STRUCTURE_CONNECTEDCOMPONENTSPROCESSOR_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::AtomContainer
Definition atomContainer.h:32
BALL::ConnectedComponentsProcessor::clear
void clear()
BALL::ConnectedComponentsProcessor::Component
std::vector< Atom * > Component
Definition connectedComponentsProcessor.h:38
BALL::ConnectedComponentsProcessor::DisjointSet
boost::disjoint_sets< int *, int *, boost::find_with_full_path_compression > DisjointSet
Definition connectedComponentsProcessor.h:135
BALL::ConnectedComponentsProcessor::start
virtual bool start()
Processor method which is called before the operator()-call.
BALL::ConnectedComponentsProcessor::getAllComponents
void getAllComponents(MolVec &results)
BALL::ConnectedComponentsProcessor::MolVec
std::vector< Molecule > MolVec
Definition connectedComponentsProcessor.h:39
BALL::ConnectedComponentsProcessor::getComponents
void getComponents(ComponentVector &comp)
BALL::ConnectedComponentsProcessor::getNumberOfConnectedComponents
Size getNumberOfConnectedComponents()
Returns the number of connected components found.
BALL::ConnectedComponentsProcessor::components_
ComponentVector components_
Definition connectedComponentsProcessor.h:136
BALL::ConnectedComponentsProcessor::finish
virtual bool finish()
Processor method which is called after the operator()-call.
BALL::ConnectedComponentsProcessor::ConnectedComponentsProcessor
ConnectedComponentsProcessor()
Default Constructor.
BALL::ConnectedComponentsProcessor::getLargestComponent
void getLargestComponent(Molecule &result)
BALL::ConnectedComponentsProcessor::~ConnectedComponentsProcessor
virtual ~ConnectedComponentsProcessor()
Destructor.
BALL::ConnectedComponentsProcessor::ComponentVector
std::vector< Component > ComponentVector
Definition connectedComponentsProcessor.h:40
BALL::ConnectedComponentsProcessor::getMinAtomsComponents
void getMinAtomsComponents(MolVec &result, size_t min)
BALL::ConnectedComponentsProcessor::BALL_CREATE
BALL_CREATE(ConnectedComponentsProcessor)
BALL::Molecule
Definition molecule.h:31
BALL::Processor::Result
int Result
Definition processor.h:36
BALL::UnaryProcessor< AtomContainer >::UnaryProcessor
UnaryProcessor()
Definition processor.h:69
molecule.h
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
processor.h