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

crystalbond.h

00001 // -*- C++ -*-
00002 
00003 /* 
00004  * Gnome Chemistry Utils
00005  * crystalbond.h 
00006  *
00007  * Copyright (C) 2002-2004
00008  *
00009  * Developed by Jean Bréfort <jean.brefort@ac-dijon.fr>
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_BOND_H
00028 #define CRYSTAL_BOND_H
00029 
00030 #include <libxml/parser.h>
00031 #include <list>
00032 #include "bond.h"
00033 
00034 using namespace std;
00035 
00036 namespace gcu
00037 {
00038 
00042 class CrystalBond: public Bond 
00043 {
00044 public:
00045         CrystalBond();
00046         virtual ~CrystalBond();
00047 
00048 public :
00049         CrystalBond(double X1, double Y1, double Z1, double X2, double Y2, double Z2, double r, float red, float green, float blue, float alpha);
00050         CrystalBond(CrystalBond& cbBond);
00051         CrystalBond& operator=(CrystalBond&);
00052 
00053         void Draw();
00054         double X1(void) {return m_dx;}
00055         double Y1(void) {return m_dy;}
00056         double Z1(void) {return m_dz;}
00057         double X2(void) {return m_dx2;}
00058         double Y2(void) {return m_dy2;}
00059         double Z2(void) {return m_dz2;}
00060         double Xmax();
00061         double Ymax();
00062         double Zmax();
00063         double Xmin();
00064         double Ymin();
00065         double Zmin();
00066         double Long() {return m_dl;}
00067         void SetPosition(double x, double y, double z, double x1, double y1, double z1);
00068         void SetColor(float red, float green, float blue, float alpha);
00069         void GetColor(double *red, double *green, double *blue, double *alpha);
00070         void SetRadius(double r);
00071         double GetRadius() {return m_dr;};
00072         bool operator==(CrystalBond&);
00073         virtual void Move(double x, double y, double z);
00074         double ScalProd(int h, int k, int l);
00075         void Cleave() {m_nCleave++;}
00076         void NetToCartesian(double a, double b, double c, double alpha, double beta, double gamma);
00077         double Distance(double x, double y, double z, bool bFixed);
00078         bool IsCleaved() {return m_nCleave != 0;}
00079         void GetRotation(double& x, double& y, double& z, double& th);
00080         virtual xmlNodePtr Save(xmlDocPtr xml);
00081         virtual bool Load(xmlNodePtr node);
00082         
00083 private :
00084         float m_fBlue, m_fRed, m_fGreen, m_fAlpha;
00085         double m_dx, m_dy, m_dz, m_dx2, m_dy2, m_dz2, m_dr, m_dl;
00086         double m_dxrot, m_dyrot, m_darot;//rotation axis coordinates (z = 0) and angle
00087         int m_nCleave; //0 if not cleaved
00088 };
00089 
00090 typedef list<CrystalBond*> CrystalBondList;
00091 
00092 }// namespace gcu
00093 
00094 #endif // CRYSTAL_BOND_H

Generated on Sun Jun 13 13:49:36 2004 for The Gnome Chemistry Utils by doxygen 1.3.3