diff --git a/NOMADVRLib/ConfigFile.cpp b/NOMADVRLib/ConfigFile.cpp index 832317f50c8528251ea7cd4bcf6a774c5b71ad44..3a6e073eaafed0f19d4b4d485ff34075c633e11a 100644 --- a/NOMADVRLib/ConfigFile.cpp +++ b/NOMADVRLib/ConfigFile.cpp @@ -77,6 +77,8 @@ float ** markercolours; float animationspeed; float movementspeed; +menubutton_t menubutton; + std::vector info; const char * loadConfigFileErrors[] = @@ -233,6 +235,10 @@ void initState() infolinecolour[1] = 1.0f; infolinecolour[2] = 0.0f; infolinecolour[3] = 1.0f; + + menubutton = Record; + + bondscaling = 0.7f; } int loadConfigFile(const char * f) @@ -636,10 +642,25 @@ int loadConfigFile(const char * f) r=fscanf (F, "%f %f %f", infolinecolour, infolinecolour+1, infolinecolour+2); if (r<3) eprintf ("Error reading atomtrajectorycolour value"); - } else if (!strcmp (s, "animationspeed")) { - r=fscanf (F, "%f", &animationspeed); + } + else if (!strcmp(s, "animationspeed")) { + r = fscanf(F, "%f", &animationspeed); + if (r < 1) + eprintf("Error reading animationspeed"); + } + else if (!strcmp(s, "")) { + r = fscanf(F, "%f", &bondscaling); if (r<1) - eprintf ("Error reading animationspeed"); + eprintf("Error reading bondscaling"); + bondscaling = sqrt(bondscaling); + } else if (!strcmp(s, "menubutton")) { + r = fscanf(F, "%s", s); + if (!strcmp(s, "Record")) + menubutton = Record; + else if (!strcmp(s, "Infobox")) + menubutton = Infobox; + else if (!strcmp (s, "Nothing")) + menubutton = Nothing; } else if (!strcmp (s, "movementspeed")) { r=fscanf (F, "%f", &movementspeed); if (r<1) diff --git a/NOMADVRLib/ConfigFile.h b/NOMADVRLib/ConfigFile.h index e6910f4a31f49d14f2a196b6f45def528f61d1fc..ec4ac4a7b782dacaedfe6c39ecdb86527752f21c 100644 --- a/NOMADVRLib/ConfigFile.h +++ b/NOMADVRLib/ConfigFile.h @@ -89,6 +89,15 @@ struct information { GLuint tex; }; +typedef enum { + Record, + Infobox, + Nothing +} menubutton_t; + +extern menubutton_t menubutton; + extern std::vector info; + #endif //__CONFIGFILE_H diff --git a/NOMADVRLib/ConfigFileAtoms.cpp b/NOMADVRLib/ConfigFileAtoms.cpp index ccc27f5a4ef6659a81c9674864c0f66b633bc166..673bb121f7b45e3e63ac3fb82574d161e50f1c99 100644 --- a/NOMADVRLib/ConfigFileAtoms.cpp +++ b/NOMADVRLib/ConfigFileAtoms.cpp @@ -25,3 +25,5 @@ float cubetrans[3]; float supercell[3]; int voxelSize[3]; + +float bondscaling; \ No newline at end of file diff --git a/NOMADVRLib/ConfigFileAtoms.h b/NOMADVRLib/ConfigFileAtoms.h index 199ae65ddfe8baf2ddc636a0f968ba1fc445ced4..a277cdd7b9d02ef305dae320258322b8a9b10dd5 100644 --- a/NOMADVRLib/ConfigFileAtoms.h +++ b/NOMADVRLib/ConfigFileAtoms.h @@ -29,4 +29,6 @@ extern int voxelSize[3]; extern float supercell[3]; +extern float bondscaling; + #endif //CONFIGFILEATOMS_H diff --git a/NOMADVRLib/atomsGL.cpp b/NOMADVRLib/atomsGL.cpp index e495b4725a541fb5cd89008748b7b61cb238a4e7..523d08cc090d73c2762bc90c1251eb21596fdb72 100644 --- a/NOMADVRLib/atomsGL.cpp +++ b/NOMADVRLib/atomsGL.cpp @@ -280,69 +280,76 @@ GLenum SetupAtoms(GLuint **AtomVAO /*[4]*/, GLuint **AtomVertBuffer /*[3]*/, GLu float *current=tmp; const int atomlimit=30; - const float bondscaling=0.7f; - numBonds=new int[getAtomTimesteps() ]; for (int p=0;p(atoms[p][4 * a1 + 3]))+ - atomRadius(static_cast(atoms[p][4 * a2 + 3])); - if (d*bondscaling(atoms[p][4 * a1 + 3]))+ + atomRadius(static_cast(atoms[p][4 * a2 + 3])); + if (d*bondscalingatoms[p][4*a+k]) - m[k]=atoms[p][4*a+k]; - if (M[k] found=g.find(atoms[p]+4*a); - for (int b=0;batoms[p][4*a+k]) + m[k]=atoms[p][4*a+k]; + if (M[k] found=g.find(atoms[p]+4*a); + for (int b=0;b