BALL
1.4.1
|
00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 00005 #ifndef BALL_STRUCTURE_GEOMETRICPROPERTIES_H 00006 #define BALL_STRUCTURE_GEOMETRICPROPERTIES_H 00007 00008 #ifndef BALL_COMMON_H 00009 # include <BALL/common.h> 00010 #endif 00011 00012 #ifndef BALL_MATHS_VECTOR3_H 00013 # include <BALL/MATHS/vector3.h> 00014 #endif 00015 00016 #ifndef BALL_MATHS_SIMPLEBOX3_H 00017 # include <BALL/MATHS/simpleBox3.h> 00018 #endif 00019 00020 #ifndef BALL_KERNEL_ATOM_H 00021 # include <BALL/KERNEL/atom.h> 00022 #endif 00023 00024 #ifndef BALL_KERNEL_FRAGMENT_H 00025 # include <BALL/KERNEL/fragment.h> 00026 #endif 00027 00028 #ifndef BALL_CONCEPT_PROCESSOR_H 00029 # include <BALL/CONCEPT/processor.h> 00030 #endif 00031 00032 #ifndef BALL_DATATYPE_STRING_H 00033 # include <BALL/DATATYPE/string.h> 00034 #endif 00035 00036 #include <vector> 00037 00038 namespace BALL 00039 { 00040 00056 class BALL_EXPORT BoundingBoxProcessor 00057 : public UnaryProcessor<Atom> 00058 { 00059 public: 00060 00064 00067 virtual bool start() 00068 ; 00069 00072 virtual bool finish() 00073 ; 00074 00077 virtual Processor::Result operator () (Atom& atom) 00078 { return operator() (atom.getPosition());} 00079 00082 virtual Processor::Result operator () (const Vector3& v) 00083 ; 00084 00085 00087 00090 00093 SimpleBox3 getBox() const 00094 ; 00095 00098 const Vector3& getLower() const 00099 ; 00100 00103 const Vector3& getUpper() const 00104 ; 00105 00107 00108 private: 00109 00110 Vector3 lower_; 00111 Vector3 upper_; 00112 }; 00113 00124 class BALL_EXPORT GeometricCenterProcessor 00125 : public UnaryProcessor<Atom> 00126 { 00127 public: 00128 00132 00135 virtual bool start() 00136 ; 00137 00140 virtual bool finish() 00141 ; 00142 00145 virtual Processor::Result operator()(Atom& atom) 00146 { return operator()(atom.getPosition());} 00147 00150 virtual Processor::Result operator()(const Vector3& v) 00151 ; 00152 00154 00157 00160 Vector3& getCenter() 00161 ; 00162 00164 00165 private: 00166 00167 Vector3 center_; 00168 Size n_; 00169 }; 00170 00171 00189 class BALL_EXPORT FragmentDistanceCollector 00190 : public UnaryProcessor<Composite> 00191 { 00192 public: 00193 00197 00200 FragmentDistanceCollector() 00201 ; 00202 00207 FragmentDistanceCollector(const Composite& composite) 00208 ; 00209 00215 FragmentDistanceCollector(const Composite& composite, float distance) 00216 ; 00217 00218 virtual ~FragmentDistanceCollector() 00219 00220 {} 00221 00223 00226 00229 virtual bool start() 00230 ; 00231 00234 virtual bool finish() 00235 ; 00236 00239 virtual Processor::Result operator()(Composite& composite) 00240 ; 00241 00243 00246 00250 Size getNumberOfFragments() 00251 ; 00252 00256 void setComposite(const Composite& composite) 00257 ; 00258 00262 const Composite* getComposite() const 00263 ; 00264 00268 float getDistance() const 00269 ; 00270 00274 void setDistance(float distance) 00275 ; 00276 00278 00281 std::vector<Fragment*> fragments; 00282 00283 00284 protected: 00285 00286 std::vector<Fragment*> all_fragments_; 00287 const Composite* reference_composite_; 00288 float squared_distance_; 00289 }; 00290 00291 00293 00297 00300 BALL_EXPORT Angle calculateTorsionAngle(const Atom& a1, const Atom& a2, const Atom& a3, const Atom& a4) 00301 throw(Exception::IllegalPosition); 00302 00311 BALL_EXPORT bool setTorsionAngle(const Atom& a1, const Atom& a2, Atom& a3, const Atom& a4, Angle angle); 00312 00315 BALL_EXPORT Angle calculateBondAngle(const Atom& a1, const Atom& a2, const Atom& a3) 00316 throw(Exception::IllegalPosition); 00317 00319 } // namespace BALL 00320 00321 #endif // BALL_STRUCTURE_GEOMETRICPROPERTIES_H