00001
00002
00003
00004 #ifndef BALL_XRAY_CRYSTALINFO_H
00005 #define BALL_XRAY_CRYSTALINFO_H
00006
00007 #ifndef BALL_CONCEPT_PERSISTENTOBJECT_H
00008 #include <BALL/CONCEPT/persistentObject.h>
00009 #endif
00010
00011 #ifndef BALL_STRUCTURE_GEOMETRICTRANSFORMATIONS_H
00012 #include <BALL/STRUCTURE/geometricTransformations.h>
00013 #endif
00014
00015 #ifndef BALL_DATATYPE_STRING_H
00016 #include <BALL/DATATYPE/string.h>
00017 #endif
00018
00019 #ifndef BALL_COMMON_EXCEPTION_H
00020 # include <BALL/COMMON/exception.h>
00021 #endif
00022
00023 #ifndef BALL_CONCEPT_PERSISTENCEMANAGER_H
00024 # include <BALL/CONCEPT/persistenceManager.h>
00025 #endif
00026
00027
00028 #include <string>
00029
00030 namespace BALL
00031 {
00036 class BALL_EXPORT CrystalInfo
00037 : public PersistentObject
00038 {
00039 public:
00040
00044
00047 struct BALL_EXPORT Option
00048 {
00051 static const char* SPACE_GROUP_FILE;
00052 };
00053
00056 struct BALL_EXPORT Default
00057 {
00060 static const char* SPACE_GROUP_FILE;
00061 };
00062
00064
00067
00068
00071 CrystalInfo();
00072
00075 CrystalInfo(String group, Vector3 dim, Angle alpha, Angle beta, Angle gamma);
00076
00079 CrystalInfo(const CrystalInfo& ci);
00080
00081 BALL_CREATE(CrystalInfo)
00084 ~CrystalInfo() throw ();
00086
00087 bool setSpaceGroup(const String& sg);
00088 const String& getSpaceGroup() const;
00089
00090 void setCellDimensions(const Vector3& dim);
00091
00092 void setCellEdgeLengthA(const float& a);
00093 const float& getCellEdgeLengthA() const;
00094
00095 void setCellEdgeLengthB(const float& b);
00096 const float& getCellEdgeLengthB() const;
00097
00098 void setCellEdgeLengthC(const float& c);
00099 const float& getCellEdgeLengthC() const;
00100
00101 void setCellAngles(const Angle& alpha, const Angle& beta, const Angle& gamma);
00102
00103 void setCellAngleAlpha(const Angle& alpha);
00104 const Angle& getCellAngleAlpha() const;
00105
00106 void setCellAngleBeta(const Angle& beta);
00107 const Angle& getCellAngleBeta() const;
00108
00109 void setCellAngleGamma(const Angle& gamma);
00110 const Angle& getCellAngleGamma() const;
00111
00112 void setZScore(const int& zscore);
00113 const int& getZScore() const;
00114
00115 Size getNumberOfSymOps() const ;
00116 const Matrix4x4& getSymOp(Position p) const;
00117
00118 Size getNumberOfNCSSymOps() const;
00119
00120 const Matrix4x4& getNCS(Position p) const
00121 throw(Exception::IndexOverflow);
00122
00123 Matrix4x4& getNCS(Position p)
00124 throw(Exception::IndexOverflow);
00125
00126 bool isgivenNCS(Position p) const
00127 throw(Exception::IndexOverflow);
00128
00129 bool isgivenNCS(Position p)
00130 throw(Exception::IndexOverflow);
00131
00132 bool insertNCS(Position p, Matrix4x4 ncsm, bool is_given = 0)
00133 throw(Exception::IndexOverflow);
00134
00135 void pushbackNCS(Matrix4x4 ncsm, bool is_given = 0);
00136
00137 bool eraseNCS(Position p)
00138 throw(Exception::IndexOverflow);
00139
00140 const Matrix4x4& getCart2Frac() const;
00141 const Matrix4x4& getFrac2Cart() const;
00142
00146
00149
00150 void persistentWrite(PersistenceManager& pm, const char* name) const
00151 throw (Exception::GeneralException);
00152
00155
00156 void persistentRead(PersistenceManager& pm)
00157 throw (Exception::GeneralException);
00158
00160
00161
00162 protected:
00163
00164 void calculateMatrices_();
00165 bool retrieveSymOps_(const String& sg);
00166
00167 String space_group_;
00168 Vector3 cell_dimensions_;
00169 Angle alpha_, beta_, gamma_;
00170 int z_score_;
00171 String filename_;
00172
00173 Matrix4x4 cart2frac_;
00174 Matrix4x4 frac2cart_;
00175
00176 vector<Matrix4x4> ncs_symops_;
00177 vector<bool> ncs_isgiven_;
00178 vector<Matrix4x4> sg_symops_;
00179
00180 };
00181 }
00182
00183 #endif // BALL_XRAY_CRYSTALINFO_H