BALL
1.4.1
|
00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: forceFieldComponent.h,v 1.20.18.1 2007/03/25 21:23:49 oliver Exp $ 00005 // 00006 00007 // Molecular Mechanics: general force field component class 00008 00009 #ifndef BALL_MOLMEC_FORCEFIELDCOMPONENT_H 00010 #define BALL_MOLMEC_FORCEFIELDCOMPONENT_H 00011 00012 #ifndef BALL_COMMON_H 00013 # include <BALL/common.h> 00014 #endif 00015 00016 #ifndef BALL_DATATYPE_STRING_H 00017 # include <BALL/DATATYPE/string.h> 00018 #endif 00019 00020 #ifndef BALL_KERNEL_ATOM_H 00021 # include <BALL/KERNEL/atom.h> 00022 #endif 00023 00024 namespace BALL 00025 { 00026 class ForceField; 00027 00032 class BALL_EXPORT ForceFieldComponent 00033 { 00034 00035 friend class ForceField; 00036 00037 public: 00038 00042 00043 public: 00044 00045 BALL_CREATE(ForceFieldComponent) 00046 00047 00049 ForceFieldComponent(); 00050 00053 ForceFieldComponent(ForceField& force_field); 00054 00059 ForceFieldComponent(const ForceFieldComponent& force_field_component); 00060 00063 virtual ~ForceFieldComponent(); 00064 00066 00070 00073 virtual bool setup() 00074 throw(Exception::TooManyErrors); 00075 00077 00080 00084 ForceField* getForceField() const; 00085 00088 void setForceField(ForceField& force_field); 00089 00092 void setName(const String& name); 00093 00096 String getName() const; 00097 00099 bool isEnabled() const { return enabled_;} 00100 00102 void setEnabled(bool state) { enabled_ = state;} 00103 00105 00108 00111 virtual double getEnergy() const; 00112 00119 virtual double updateEnergy(); 00120 00127 virtual void updateForces(); 00128 00136 virtual void update() 00137 throw(Exception::TooManyErrors); 00138 00139 protected: 00140 00142 /*_ @name Protected Attributes 00143 */ 00144 //_@{ 00145 00146 /*_ The force field this component is registered in 00147 */ 00148 ForceField* force_field_; 00149 00150 /*_ The energy of the component 00151 */ 00152 double energy_; 00153 00154 private: 00155 00156 //_@} 00157 /*_ @name Private Attributes 00158 */ 00159 //_@{ 00160 00161 /*_ The force field component name 00162 */ 00163 String name_; 00164 00165 bool enabled_; 00166 00167 //_@} 00168 00169 }; 00170 } // namespace BALL 00171 00172 #endif // BALL_MOLMEC_FORCEFIELDCOMPONENT_H