#include "drawwindow.h"  // also calls global.h
#include "screen.h"
#include "peptide.h"
#include "math.h"

void initializescreen(struct screenvalue& sc,struct geometry& geo)
{
   int i;
// INITIAL SCREEN VALUES
   sc.drawgrid = -1; // If = 1 draw map grid
   sc.contourradius = 7.5; // Default contour radius (Angstroms)
   sc.pdbradius2 = sc.boneradius2 = sqr(sc.contourradius);  // Default pdb radius squared
   sc.conlevel = 1.5; //Default contour level (in std. dev)
   sc.coreradius2 = sqr(1.25*sc.contourradius);  // Default core radius squared
   sc.centerpos[0]=0.0;sc.centerpos[1]=0.0;sc.centerpos[2]= 0.0;
   sc.pickbone = -1; // Turn off picking of bone
    sc.cmmaxh= 2.0;// Initial height (for cube)  Maximum hight of visualized object
//   sc.cmeyedist = 60.0; // Too much perpective - value used for first year
//   sc.cmeyedist = 120.0;
    sc.cmeyedist = 240.0;// Increase for very large maps
//cmeyedist=30;
    sc.cmeyesep = 8.0;
    sc.mag=1.0;
    sc.cut= 1.0;  // Maximum depth of field
    sc.degfovy = sc.mag*(180.0/PI)*2.0*asin(sc.cmmaxh/(2.0*sc.cmeyedist));
    sc.printres = 1; // Initially turn on drawing of pdb labels
    sc.drawcontour = -1; //Initially turn off drawing of contours
    sc.centerres = -1; // Initially = do not center picked residues
    sc.centercore = -1; // Initially = do not center picked residues
    sc.pdbwindow = -1; // Initially  - do not window about picked residue
    sc.corewindow = -1; // Initially  - do not window about picked core
    sc.isphere = 0; // Initially - the current active sphere
    sc.windowselect = -1; // Initially - draw complete window
    sc.drawspheres = -1; // Initially turn off drawing
    sc.drawgeo = -1; // turn off drawing of geo
    sc.draweditbones = -1;// turn off drawing of edited bones
    sc.drawfit = -1;
    sc.drawrot = -1;
    sc.pickfit = -1;
    sc.refinepdbside = -1; 
    for(i=0;i<=2;i++)
      sc.cubecol[i] = greenv[i];
    for(i=0;i<=2;i++){
       backcolv[i]=blackv[i];
       writecolv[i]=whitev[i];
       sc.spherecol[i] = pinkv[i];
    }
   for(i=0;i<=2;i++){ // assign peptide colors  (fit and geo)
      geo.fitmaincol[i] = whitev[i];
      geo.fitsidecol[i] = greenv[i];
      geo.fitcocol[i] = magentav[i];
      geo.geomaincol[i] = redv[i];
      geo.geosidecol[i] = whitev[i];
      geo.geococol[i] = redv[i];
   }
   for(i=0;i<=2;i++){ // main and side chain colors for first pdb
     pdb1maincol[i] = yellowv[i];  // these are both global variable - see screen.h
     pdb1sidecol[i] = lightbluev[i];
   }
}
