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_LIST_H 00011 # include <BALL/DATATYPE/list.h> 00012 #endif 00013 00014 #ifndef BALL_DATATYPE_HASHSET_H 00015 # include <BALL/DATATYPE/hashSet.h> 00016 #endif 00017 00018 #ifndef BALL_VIEW_MODELS_MODELPROCESSOR_H 00019 # include <BALL/VIEW/MODELS/modelProcessor.h> 00020 #endif 00021 00022 namespace BALL 00023 { 00024 class Atom; 00025 class Bond; 00026 00027 namespace VIEW 00028 { 00035 class BALL_VIEW_EXPORT AtomBondModelBaseProcessor 00036 : public ModelProcessor 00037 { 00038 public: 00039 00040 BALL_CREATE(AtomBondModelBaseProcessor) 00041 00042 00045 00049 AtomBondModelBaseProcessor(); 00050 00053 AtomBondModelBaseProcessor(const AtomBondModelBaseProcessor& baseProcessor); 00054 00057 virtual ~AtomBondModelBaseProcessor(); 00058 00066 virtual void clear(); 00067 00069 00072 00077 void set(const AtomBondModelBaseProcessor& processor); 00078 00082 const AtomBondModelBaseProcessor& operator = (const AtomBondModelBaseProcessor& processor); 00083 00085 00088 00096 virtual Processor::Result operator() (Composite& composite); 00097 00099 00102 00110 virtual void dump(std::ostream& s = std::cout, Size depth = 0) const; 00111 00113 virtual void clearComposites(); 00114 00116 virtual bool createGeometricObjects(); 00117 00118 protected: 00119 00121 00130 00136 void insertAtom_(const Atom* atom); 00137 00140 void clearUsedAtoms_(); 00141 00144 List<const Atom*>& getAtomList_(); 00145 00148 HashSet<const Atom*>& getAtomSet_(); 00149 00155 void buildBondModels_(); 00156 00158 00159 virtual void visualiseBond_(const Bond& bond); 00160 00161 virtual void visualiseRings_(){}; 00162 00163 vector<vector<Atom*> > rings_; 00164 HashSet<const Atom*> ring_atoms_; 00165 00166 private: 00167 00168 List<const Atom*> used_atoms_; 00169 HashSet<const Atom*> atom_set_; 00170 }; 00171 00172 # ifndef BALL_NO_INLINE_FUNCTIONS 00173 # include <BALL/VIEW/MODELS/atomBondModelBaseProcessor.iC> 00174 # endif 00175 00176 } } // namespaces 00177 00178 #endif // BALL_VIEW_MODELS_ATOMBONDMODELBASEPROCESSOR_H