Exemple #1
0
void MyFrame::OnReadFile (wxString filename)
{
   if (mol.ReadPdb((const char*)filename.mb_str(wxConvUTF8) )) {
       if ((mol.natm==0) && (mol.nhetatm!=0)) geoSettings.showHetatm=true;
       MyTab::EnableGeom();
       UpdateShadowmap();
       wxString name( mol.GetMolName(), wxConvUTF8 ); 
       SetTitle(  name.BeforeLast('.')+ _T(" - QuteMol") );
       m_tb->SetTitleText(name);
       geoSettings.Apply();

       // redo shaders, as texture size could have changed 
       cgSettings.UpdateShaders();

   } else {
      wxMessageBox(wxString::FromAscii(QAtom::lastReadError), _T(":-("), wxOK | wxICON_EXCLAMATION, this);
      m_tb->SetTitleText();
   }
   
  // remake shaders cos texture size could have changed...

   
   //theText->LoadFile(openFileDialog->GetFilename());
   //SetStatusText(GetCurrentFilename(), 0);      
}
Exemple #2
0
int InitQuteMol(const char * filename)
{
  
  CubeMapSamp::SetSize(CSIZE);
  OctaMapSamp::SetSize(CSIZE);

  if (filename==NULL) filename="porin.pdb";
   
  mol.ReadPdb(filename);
  cgSettings.SetDefaults();
  // initGl gets called from the GL canvas on startup.  It's not 
  // legal to call it before that time because the OpenGL context
  // does not exist yet.
    
  /*if (!initGl()) {
    printf("failed to initialize! :(\n");
    return 0;
  }*/

  //FillRandomTexture();
  //mol.DuplicateTexels(texture, TSIZE);
  //ReloadTexture(texture, bilinear);
  return 1;
}