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();
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
00123 const Matrix4x4& getNCS(Position p) const;
00124
00128 Matrix4x4& getNCS(Position p);
00129
00133 bool isgivenNCS(Position p) const;
00134
00138 bool insertNCS(Position p, Matrix4x4 ncsm, bool is_given = 0);
00139
00140 void pushbackNCS(Matrix4x4 ncsm, bool is_given = 0);
00141
00145 bool eraseNCS(Position p);
00146
00147 const Matrix4x4& getCart2Frac() const;
00148 const Matrix4x4& getFrac2Cart() const;
00149
00153
00156
00157 void persistentWrite(PersistenceManager& pm, const char* name) const;
00158
00161
00162 void persistentRead(PersistenceManager& pm);
00163
00165
00166
00167 protected:
00168
00169 void calculateMatrices_();
00170 bool retrieveSymOps_(const String& sg);
00171
00172 String space_group_;
00173 Vector3 cell_dimensions_;
00174 Angle alpha_, beta_, gamma_;
00175 int z_score_;
00176 String filename_;
00177
00178 Matrix4x4 cart2frac_;
00179 Matrix4x4 frac2cart_;
00180
00181 vector<Matrix4x4> ncs_symops_;
00182 vector<bool> ncs_isgiven_;
00183 vector<Matrix4x4> sg_symops_;
00184
00185 };
00186 }
00187
00188 #endif // BALL_XRAY_CRYSTALINFO_H