/**************************************************************************** ** ** Copyright (C) 2011 Christian B. Huebschle & George M. Sheldrick ** All rights reserved. ** Contact: chuebsch@moliso.de ** ** This file is part of the ShelXle ** ** This file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file COPYING included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** ****************************************************************************/ #ifndef FOURXLE_H #define FOURXLE_H 1 #include #include #include #include #include #include //#include //if you want you can try to uncoment this, but then you have to coment the following line #include "kissfft/kiss_fftnd.h" #include "molecule.h" #include "chgl.h" #include #include #include #include //! Rec is a reflection type of a fcf 6 file. typedef struct { int ih,//!< h ik,//!< k il;//!< l float fo,//!< F observed so,//!< \f$\sigma(observed)\f$ fc,//!< F calculated phi; //!< \f$\varphi\f$ } Rec; #define LM 2000000 //! FNode is a struct for the 3 different edges of a cube struct FNode { V3 vertex;//!< vertex is the 3d position of the node V3 normal;//!< normal is the plane normal of the surface char flag;//!< this flag is set when the surface crosses this node inline operator char (){ //! \returns the flag parameter. No Coala ;-) return flag; } inline operator V3(){ //! \returns the vertex of the node. return vertex; } friend inline double Distance( const FNode& n1, const FNode& n2 ){ /*! @param n1,n2 nodes vor which the squared distance should be calculated. \returns te positional squared distance between two nodes */ return Norm(n1.vertex-n2.vertex); } }; struct Polygn { V3 vertex; int n; int ii[13]; }; struct Ort { V3 vertex; V3 normal; GLfloat color; char direct; }; struct Node { int index; unsigned char flag; inline operator unsigned char (){return flag;} }; // //! FourXle is an QObject that loads a fcf 6 file and creates iso-surfaces in meshed style \inherit QObject class FourXle:public QObject{ Q_OBJECT public: int HKLMX;//!< Maximum of h,k and l values can be used to make a resulution cut. float *datfo,//! Planorte; QVector Planpgns; // QList data; inline int Intersect( GLfloat& vm, GLfloat& vp ){ return vm*vp <= 0.0 && (vm<0.0 || vp<0.0); } Node *nodeX; Node *nodeY; Node *nodeZ; QCheckBox *extendUnit; void CalcPlaneVertex( int ix, int iy, int iz ,V3 n,V3 ap,V3 off); void makeFacesp(int nn, Node poly[] ); void MakeElementp( int ix, int iy, int iz ,int s1, int s2); int IndexSelectedP( Node& node0, Node& node1, Node& node2, Node& node3 ); void findContour(QList &lines, GLfloat value); void makePlane(QList &lines,int a1, int a2, int a3); double min,max; V3 orig,test3; V3 pnormal,aufpunkt; QLineEdit *contMapFile, *contourValueEdit, *contEPSFile; QComboBox *aspectRatios, *centerIsOn, *sourceMap; QDoubleSpinBox *cScopeBx, *heightScale; inline double winkel(V3 a,V3 b){ return acos((a.x*b.x+a.y*b.y+a.z*b.z)/(sqrt(a.x*a.x+a.y*a.y+a.z*a.z)*sqrt(b.x*b.x+b.y*b.y+b.z*b.z))); } public slots: void bewegt(V3 v); void inimap(); void change_iso(int numsteps,int diff); void chglDestroyed(); void foactDestroyed(); void fofcactDestroyed(); void doMapsNow(bool b);//!