Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

crystalline.h

00001 // -*- C++ -*- 00002 00003 /* 00004 * Gnome Chemistry Utils 00005 * crystalline.h 00006 * 00007 * Copyright (C) 2002-2004 00008 * 00009 * Developed by Jean Bréfort <jean.brefort@normalesup.org> 00010 * 00011 * This library is free software; you can redistribute it and/or 00012 * modify it under the terms of the GNU Lesser General Public 00013 * License as published by the Free Software Foundation; either 00014 * version 2.1 of the License, or (at your option) any later version. 00015 * 00016 * This library is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 * Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this library; if not, write to the 00023 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00024 * Boston, MA 02111-1307, USA. 00025 */ 00026 00027 #ifndef CRYSTAL_LINE_H 00028 #define CRYSTAL_LINE_H 00029 00030 #include <libxml/parser.h> 00031 #include <list> 00032 00033 using namespace std; 00034 00035 namespace gcu 00036 { 00037 00046 enum CrystalLineType 00047 { 00048 edges = 0, 00049 diagonals, 00050 medians, 00051 normal, 00052 unique 00053 }; 00054 00058 class CrystalLine 00059 { 00060 public: 00064 CrystalLine (); 00068 virtual ~CrystalLine (); 00069 00070 public : 00087 CrystalLine (CrystalLineType Type, double X1, double Y1, double Z1, double X2, double Y2, double Z2, double r, float red, float green, float blue, float alpha); 00093 CrystalLine (CrystalLine& clLine); 00100 CrystalLine& operator= (CrystalLine& clLine); 00101 00105 void Draw (); 00109 double X1 (void) {return m_dx;} 00113 double Y1 (void) {return m_dy;} 00117 double Z1 (void) {return m_dz;} 00121 double X2 (void) {return m_dx2;} 00125 double Y2 (void) {return m_dy2;} 00129 double Z2 (void) {return m_dz2;} 00133 double Xmax (); 00137 double Ymax (); 00141 double Zmax (); 00145 double Xmin (); 00149 double Ymin (); 00153 double Zmin (); 00157 double Long () {return m_dl;} 00161 CrystalLineType Type () {return m_nType;} 00172 void SetPosition (double x, double y, double z, double x1, double y1, double z1); 00181 void SetColor (float red, float green, float blue, float alpha); 00190 void GetColor (double *red, double *green, double *blue, double *alpha); 00196 void SetRadius (double r); 00200 double GetRadius () {return m_dr;}; 00205 bool operator== (CrystalLine& clLine); 00213 virtual void Move (double x, double y, double z); 00224 double ScalProd (int h, int k, int l); 00229 void Cleave () {m_nCleave++;} 00242 void NetToCartesian (double a, double b, double c, double alpha, double beta, double gamma); 00255 double Distance (double x, double y, double z, bool bFixed); 00259 bool IsCleaved () {return m_nCleave != 0;} 00269 void GetRotation (double& x, double& y, double& z, double& th); 00276 virtual xmlNodePtr Save (xmlDocPtr xml); 00282 virtual bool Load (xmlNodePtr node); 00283 00284 protected : 00288 float m_fBlue; 00292 float m_fRed; 00296 float m_fGreen; 00300 float m_fAlpha; 00304 double m_dx; 00308 double m_dy; 00312 double m_dz; 00316 double m_dx2; 00320 double m_dy2; 00324 double m_dz2; 00328 double m_dr; 00334 int m_nCleave; //0 if not cleaved 00343 CrystalLineType m_nType; 00344 00345 private: 00346 double m_dl; 00347 double m_dxrot; 00348 double m_dyrot; 00349 double m_darot;//rotation axis coordinates (z = 0) and angle 00350 }; 00351 00355 typedef list<CrystalLine*> CrystalLineList; 00356 00357 }// namespace gcu 00358 00359 #endif // CRYSTAL_BOND_H

Generated on Mon Dec 13 15:25:37 2004 for The Gnome Chemistry Utils by doxygen 1.3.8