Allink
v0.1
|
00001 #ifndef ELPOLY_H 00002 #define ELPOLY_H 00003 #include "../include/VarData.h" 00004 #include "../include/Cubo.h" 00005 //#include "../include/Draw.h" 00006 #ifdef USE_GL 00007 #include <GL/glut.h> 00008 #endif//USE_GL 00009 #include "../include/Draw.h" 00010 #include "../include/SingProc.h" 00012 enum ElVisualize{ 00014 EL_PART = 0x0000, 00016 EL_QUAD , 00018 EL_CHAIN , 00020 EL_VECTORS , 00022 EL_DENS , 00024 EL_QUAD1 , 00026 EL_POTENTIAL , 00028 EL_SURF , 00030 EL_CROSS , 00032 EL_ISOIPSE , 00034 EL_SAMPLE , 00036 EL_SPECTRUM, 00038 EL_COLOR, 00040 EL_VORONOI, 00042 EL_SKIN, 00044 EL_STALK, 00046 EL_TRIA, 00048 EL_MESH, 00050 EL_ISOLEVEL, 00052 EL_POLYGON, 00054 EL_SQUAREMESH, 00056 EL_OPENGL, 00058 EL_POVRAY 00059 }; 00061 class ElPoly : public VarData{ 00062 private: 00064 char **cFile; 00065 public: 00067 ElPoly(int argc,char **argv,int *FilePos); 00069 ~ElPoly(); 00070 //-----------------ElPolyProfile.cpp------------------ 00072 int DensProf(int NBin,int NSample,int Coord); 00074 void DensProfNormalSlab(int NBin,int NSample,int Coord); 00076 int Diff2Files(int NBin,int How); 00078 void RestPress(int NBin); 00080 void SlabProf(int NBin,int nNano,int Coord1); 00082 void PrintDens(FILE *FileToWrite,double **Plot,double *LatDim,int NBin); 00084 void RadDens2Thick(int NBin); 00086 void RadDens2Thick2d(int NBin); 00088 int Temperature(int NBin,int Coord); 00090 void CartDens(int NBin,int nNano); 00092 void RadDistrF(int NBin,int How,int nNano); 00094 void BondDistr(int NSample); 00096 void E2EDistr(int NSample); 00098 void SplayDistr(int NSample); 00100 int RadialShell(int NBin); 00102 int NanoParticle(int NBin); 00104 int WormF(int Partition,int NBin); 00106 void StalkF(int NSample); 00108 void ThickFromDens(int NBin); 00110 void AreaDistrF(int NBin); 00112 void RadNormPos(int NBin,int NGrid); 00114 int SurfTens(int NBin); 00116 void SumTens(); 00118 int PressTrace(); 00120 int PressRadial(); 00122 int Tens2dCartRad(); 00124 void StalkLineProfF(int NBin); 00126 void Prova(); 00127 //-----------------ElPolyMeasure.cpp------------------ 00129 void PairCorr(int NBin,int NDim); 00131 int PairCorrelationF(int NBin,int How); 00133 int Diffusivity(); 00135 void DiffSlab(int NSlab); 00137 int ScatteringF(int NBin,int How); 00139 int NChainPSquareF(); 00141 void AreaCompr(int NSample); 00143 int SpectrumF(int NBin); 00145 void Midplane(int NBin); 00147 void SpectrumMidplane(int NBin); 00149 void HeaderAverage(int nNano); 00151 void WidomOut(char *InFile,int NBin); 00153 void WidomOut(); 00155 void WidomIn(char *InFile,int NBin); 00157 void WidomIn(); 00159 void End2EndDistr(char *OutFile); 00161 void BondDistr(char *OutFile,int NBin); 00163 void Decoupling(int What); 00165 void ElasticCoupling(int NSample); 00167 void ElasticCouplingNVT(); 00169 void BilayerDistance(char *OutFile,int NBin); 00171 void EndToEndDist(); 00172 //-----------------ElPolyRepr.cpp--------------------- 00174 int ProjectionF(int NBin,int Coord); 00176 int CoreF(int NBin,int How); 00178 int Surface(int NBin,int Coord); 00180 int From3To2d(int Coord,double Param); 00182 int From2To1d(int Coord); 00184 int From3To1d(int Coord); 00186 void IsoSurf(int NSample,double *IsoValue,int NIso); 00188 void IsoLine(int NSample,double *IsoValue,int NIso,int How); 00190 void IsoLine(FILE *F2Write,double *Plot,int NSample,double *IsoLevel,int NIso); 00192 void FetchStalk(); 00194 void FetchPore(); 00196 void StalkArea(); 00198 void AvSnap(); 00200 void SlabAngleProfs(int NBin,int NAngle,int Coord); 00202 void Sample(int NSample); 00203 //-----------------ElPolyOutput.cpp------------------- 00205 void Conv2Tecplot(int NBin,int How); 00207 void Conv2Vmd(); 00209 void Conv2Povray(); 00211 void Conv2rzd(int NSample); 00213 void Conv2xyzd(int NSample); 00215 void DrField(int NGrid,double IsoLevel,int nNano,FILE *FWrite); 00217 void DrBondPovRay(double *Pos1,double *Pos2,float *Color); 00219 void HeaderPovRay(); 00221 void DrNanoPovRay(int n); 00223 void DrPartPovRay(int p); 00225 void ConvLattice(int NSample,char *FName); 00226 //-----------------ElPolyEl.cpp----------------------- 00228 void RemoveChains(); 00230 int Angle(int NBin); 00232 double ContactAngle(double x); 00234 int CenterOfMass(int Coord); 00236 int ChangeFile(); 00238 int SpecifyCoord(); 00240 int OpenFile(int f); 00242 int OpenFile(char *FileName); 00244 int PropertiesF(); 00246 char *ChooseDraw(int ExtWhat2Draw); 00248 void ChooseDraw(char *String); 00250 void DivideLayers(int How); 00252 void SetBoundFile(int InitFile,int EndFile); 00254 void Processing(int f); 00256 void Shift2Center(); 00258 void SetBackFold(int Bf){ 00259 NBackFold = Bf; 00260 } 00262 void SetNVisSkip(int NSkip){ 00263 if(NSkip > 0){ 00264 NVisSkip = NSkip; 00265 } 00266 } 00267 #ifdef __glut_h__ 00268 //---------------ElPolyDraw.cpp---------------------- 00270 void RenderPart(void); 00272 void DrRunTime(); 00274 void DrColor(); 00276 void DrPartList(); 00278 void DrVector(Vettore v,Vettore Origin); 00280 void DrVectors(); 00282 int DrIntorno(int p,double Blue); 00284 void DrCrossLinks(); 00286 int Graphics(int argc,char **argv); 00288 void ESlide(); 00290 void ESlide1(); 00292 void DrProtein(const char *FileName,int nBlock); 00294 void DrNano(); 00296 void DrCrossLinks(char *FileName); 00298 typedef void(ElPoly::*DRAW_PART)(int p); 00300 DRAW_PART Draw_Part; 00302 void DrawPart(int p){(*this.*Draw_Part)(p);} 00304 void DrPartOpenGl(int p); 00306 DRAW_PART Draw_Nano; 00308 void DrawNano(int n){(*this.*Draw_Nano)(n);} 00310 void DrNanoOpenGl(int n); 00312 void DrawFuncHeader(); 00314 void DrawFuncFooter(); 00316 typedef void(ElPoly::*DRAW_BOND)(double *Pos1,double *Pos2,float *Color); 00318 DRAW_BOND Draw_Bond; 00320 void DrBond(int p); 00322 void DrawBond(double *Pos1,double *Pos2,float *Color){(*this.*Draw_Bond)(Pos1,Pos2,Color);} 00324 void DrBondNo(double *Pos1,double *Pos2,float *Color){}; 00326 void DrBondOpenGl(double *Pos1,double *Pos2,float *Color); 00327 //---------------ElPolyDrawControl.cpp---------------------- 00329 void keyboard(unsigned char key,int x, int y); 00330 /* /// Definition of the key bindings */ 00331 /* void keyboardDraw(unsigned char key); */ 00333 void ElDrawMouse(int button,int state,int x,int y); 00335 void CompileList(); 00337 void DrPosCol(); 00339 void Menu(); 00341 void ElMenuChoise(int option); 00343 void ElMenuVisual(int option); 00345 void CreateMenu(); 00346 //---------------ElPolyDrawSurf.cpp---------------------- 00348 void DrIsoipse(int NBin,int NIsoipse,int CoordN); 00350 void DrSurface(); 00352 void DrSmooth(double *Plot,int NSample,double Min,double Max); 00354 void DrSample(int NSample); 00356 void DrSpectrum(); 00358 void DrDerivative(); 00360 void DrChains(); 00362 void DrPolygon(); 00364 void DrQuad(); 00366 void DrDensity(); 00368 void DrQuad1(); 00370 void DrPotential(); 00372 void DrShell(); 00374 void DrVoronoi(); 00376 void DrInterpSurface(); 00378 void DrIsolevel(int NSample,double IsoLevel); 00380 void DrField(int NGrid,double IsoLevel,int nNano); 00382 void DrSquareMesh(); 00384 void DrNormalPoint(int p,int NEdge); 00385 //----------------------------------------------- 00386 GLuint Quad,Point,*Cylinder,MetalCylinder,Hexagon,Cube,Arrow,GlWall; 00388 double Saturation; 00390 char Block2Draw[20]; 00392 void DrTria(Vettore *v00,Vettore *v01,Vettore *v11,Vettore *vN); 00394 void DrTriaContour(Vettore *v00,Vettore *v01,Vettore *v11); 00396 void DrDoubleTria(Vettore *v00,Vettore *v01,Vettore *v11,Vettore *v10,Vettore *vN); 00398 void DrCreateStalk(); 00400 void DrStalk(); 00402 void Tile(); 00403 //----------------------------ElPolyDrawCGAL---------------- 00405 void DrTriangulate(); 00407 void DrMesh(); 00409 void DrGenMesh(); 00411 void DrCells(); 00413 void DefineSkin(int NSample); 00415 void DefineSurf(); 00416 #endif //__glut_h__ 00417 00418 int NFile[2]; 00420 int NFileTot; 00422 int NPro ; 00424 int quando; 00425 // int NBin; 00427 int LineSize; 00429 int IfIntorno; 00431 //int IfColour; 00433 //int IfChains; 00435 int IfLine; 00437 int IfChType; 00439 int NBackFold; 00441 int What2Draw; 00443 int NVisSkip; 00445 //int *ChainTypes; 00447 int DrawOutput; 00449 //double Diameter; 00451 //double StepDiameter; 00453 //double ExtraDiam; 00455 double Vicinanze; 00457 double InvScaleUn; 00459 double ExtParam; 00461 double ScaleFact; 00463 FILE *DrawOutFile; 00464 #ifdef USE_MPI 00465 SingProc *Proc; 00466 #endif 00467 }; 00468 static int IfImage; 00469 00470 extern void Slide(); 00471 #ifdef __glut_h__ 00472 #endif//__glut_h__ 00473 #endif //ELPOLY_H