00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: atomBondModelBaseProcessor.h,v 1.18 2005/12/23 17:02:17 amoll Exp $ 00005 // 00006 00007 #ifndef BALL_VIEW_MODELS_ATOMBONDMODELBASEPROCESSOR_H 00008 #define BALL_VIEW_MODELS_ATOMBONDMODELBASEPROCESSOR_H 00009 00010 #ifndef BALL_DATATYPE_HASHSET_H 00011 # include <BALL/DATATYPE/hashSet.h> 00012 #endif 00013 00014 #ifndef BALL_VIEW_MODELS_MODELPROCESSOR_H 00015 # include <BALL/VIEW/MODELS/modelProcessor.h> 00016 #endif 00017 00018 namespace BALL 00019 { 00020 class Atom; 00021 class Bond; 00022 00023 namespace VIEW 00024 { 00031 class BALL_VIEW_EXPORT AtomBondModelBaseProcessor 00032 : public ModelProcessor 00033 { 00034 public: 00035 00036 BALL_CREATE(AtomBondModelBaseProcessor) 00037 00038 00041 00045 AtomBondModelBaseProcessor(); 00046 00049 AtomBondModelBaseProcessor(const AtomBondModelBaseProcessor& baseProcessor); 00050 00053 virtual ~AtomBondModelBaseProcessor(); 00054 00062 virtual void clear(); 00063 00065 00068 00073 void set(const AtomBondModelBaseProcessor& processor); 00074 00078 const AtomBondModelBaseProcessor& operator = (const AtomBondModelBaseProcessor& processor); 00079 00081 00084 00092 virtual Processor::Result operator() (Composite& composite); 00093 00095 00098 00106 virtual void dump(std::ostream& s = std::cout, Size depth = 0) const; 00107 00109 virtual void clearComposites(); 00110 00112 virtual bool createGeometricObjects(); 00113 00114 protected: 00115 00117 00126 00132 void insertAtom_(const Atom* atom); 00133 00136 void clearUsedAtoms_(); 00137 00140 std::list<const Atom*>& getAtomList_(); 00141 00144 HashSet<const Atom*>& getAtomSet_(); 00145 00151 void buildBondModels_(); 00152 00154 00155 virtual void visualiseBond_(const Bond& bond); 00156 00157 virtual void visualiseRings_(){}; 00158 00159 vector<vector<Atom*> > rings_; 00160 HashSet<const Atom*> ring_atoms_; 00161 00162 private: 00163 00164 std::list<const Atom*> used_atoms_; 00165 HashSet<const Atom*> atom_set_; 00166 }; 00167 00168 # ifndef BALL_NO_INLINE_FUNCTIONS 00169 # include <BALL/VIEW/MODELS/atomBondModelBaseProcessor.iC> 00170 # endif 00171 00172 } } // namespaces 00173 00174 #endif // BALL_VIEW_MODELS_ATOMBONDMODELBASEPROCESSOR_H