[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Meshlab and Qutemol



On 4/25/07, Michael Banck <mbanck@debian.org> wrote:
On Tue, Apr 24, 2007 at 12:23:39PM +0200, Teemu Ikonen wrote:
> Meshlab depends on the VCG library [3], which is also used in a
> molecular graphics program Qutemol [4], all written by the same group.
> Qutemol has very impressive graphics output and would be a nice
> addition to Debian / Ubuntu as well, but needs modern OpenGL hardware
> which I don't have access to at the moment.
>
> [3] http://vcg.sourceforge.net
> [4] http://qutemol.sourceforge.net/
>
> I could go on and package Meshlab with a static copy of VCG included,
> but if there's someone with suitable hardware, time and interest to
> package Qutemol, then maybe VCG should be in a separate package.
> Anybody interested?

I'd (Or debichem) be interested in Qutemol, but looking at the source,
at least the build system looks pretty Windows-specific.  It seems to
use wxwidgets so might be portable, but it would need some porting I
guess.

Anybody tried to build it on GNU/Linux?

Just out of curiosity I tried Qutemol to see if it worked on my
hardware (it didn't, as expected). The source needed some patching in
order to build, and in Debian you need to get wxwidgets2.8 from
somewhere (i.e. Ubuntu) but in the end it seems that it could work on
suitable hardware on Linux without problems. A patch to fix the build
problems is attached.

Teemu
=== modified file 'Makefile'
--- Makefile	2007-05-28 14:18:02 +0000
+++ Makefile	2007-05-28 20:00:36 +0000
@@ -1,9 +1,8 @@
-
 INCDIRS = -Ivcg -Isrc -I.
 OPTFLAGS = -Os -Wall -g
 
 CXXFLAGS = $(INCDIRS) $(OPTFLAGS) `wx-config --cppflags`
-LIBS = $(CXXFLAGS) `wx-config --libs core,base --gl-libs` -lGLEW -lGLU -lGL
+LIBS = $(CXXFLAGS) `wx-config --libs core,base --gl-libs` -lGLEW -lGLU -lGL -lungif
 
 OBJS = \
 			 src/AO.o  \
@@ -16,6 +15,11 @@
 			 src/MyTab.o \
 			 src/Sampling.o \
 			 src/ShadowMap.o \
+			 src/progress.o \
+			 src/MyCanvas.o \
+			 src/saveSnapDialog.o \
+			 src/pngSave.o \
+			 src/gifSave.o \
 			 src/main.o \
 			 src/wx_trackball.o \
 			 vcg/wrap/gui/trackball.o \

=== modified file 'src/AO.cpp'
--- src/AO.cpp	2007-05-28 14:18:02 +0000
+++ src/AO.cpp	2007-05-28 20:00:36 +0000
@@ -60,7 +60,7 @@
 }
 
 
-void AO::CheckAtom(Atom &a){
+void AO::CheckAtom(QAtom &a){
 
    int n=a.s.nsamp();
    for (int i=0; i<n; i++) {
@@ -110,7 +110,7 @@
   buf.resize(target*target,infty);
   
   for (int i=0; i<m.atom.size()-1; i++) {
-    Atom &a=m.atom[i];
+    QAtom &a=m.atom[i];
     CheckAtom(a);
     RenderSphere( a.trp[0], a.trp[1], a.trp[2], a.trr );
     PrintBuffer();

=== modified file 'src/AO.h'
--- src/AO.h	2007-05-28 14:18:02 +0000
+++ src/AO.h	2007-05-28 20:00:36 +0000
@@ -19,7 +19,7 @@
 
   void PrintBuffer();
   void RenderSphere(float cx, float cy, float cz, float rad);  
-  void CheckAtom(Atom &a);
+  void CheckAtom(QAtom &a);
   
 public:
 

=== modified file 'src/Mol.cpp'
--- src/Mol.cpp	2007-05-28 14:18:02 +0000
+++ src/Mol.cpp	2007-05-28 20:00:36 +0000
@@ -14,7 +14,7 @@
 #include "Mol.h"
 #include "HardSettings.h"
 
-#include "Progress.h"
+#include "progress.h"
 #include "AtomColor.h"
 
 #include "MyCanvas.h"

=== modified file 'src/MyCanvas.cpp'
--- src/MyCanvas.cpp	2007-05-28 14:18:02 +0000
+++ src/MyCanvas.cpp	2007-05-28 20:00:36 +0000
@@ -28,6 +28,7 @@
 
 bool MyCanvas::SetAsTexture(){
   glBindTexture( GL_TEXTURE_2D, textureID[ currentRes ] );
+  return true;   
 }
   
 MyCanvas::MyCanvas(Kind k, int size){
@@ -116,9 +117,6 @@
     case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
       //printf("Incompl: missing attach  FB!\n"); 
       return false;  
-    case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT:
-      //printf("Incompl: dupicate attach  FB!\n"); 
-      return false;  
     case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
       //printf("Incompl: dimensions!\n"); 
       return false;  

=== modified file 'src/MyCanvas.h'
--- src/MyCanvas.h	2007-05-28 14:18:02 +0000
+++ src/MyCanvas.h	2007-05-28 20:00:36 +0000
@@ -1,5 +1,3 @@
-
-
 class MyCanvas{
 public:
   
@@ -42,6 +40,8 @@
   int softRes; // subset image, not a power of 2
 };
 
-extern MyCanvas mainCanvas, haloCanvas, moltextureCanvas, shadowmapCanvas, shadowAOCanvas;
-
-
+extern MyCanvas mainCanvas;
+extern MyCanvas haloCanvas;
+extern MyCanvas moltextureCanvas;
+extern MyCanvas shadowmapCanvas;
+extern MyCanvas shadowAOCanvas;

=== modified file 'src/ShadowMap.h'
--- src/ShadowMap.h	2007-05-28 14:18:02 +0000
+++ src/ShadowMap.h	2007-05-28 20:00:36 +0000
@@ -12,7 +12,7 @@
   
   
   // adapt to current PVMatrix
-  static void ShadowMap::GetCurrentPVMatrix();
+  static void GetCurrentPVMatrix();
   
   // feed parametmers to FP
   static void FeedParameters();

=== modified file 'src/main.cpp'
--- src/main.cpp	2007-05-28 14:18:02 +0000
+++ src/main.cpp	2007-05-28 20:00:36 +0000
@@ -11,7 +11,7 @@
 
 
 
-#include <gl/glew.h>
+#include <GL/glew.h>
 
 
 #ifdef __GNUG__
@@ -55,6 +55,7 @@
 
 typedef unsigned char Byte;
 typedef unsigned int uint;
+typedef Byte byte;
 
 #include "CgUtil.h"
 
@@ -107,9 +108,9 @@
 #include "gifSave.h"
 
 // defined in pngSave
-bool PNGSaveWithAlpha( const char * filename, const byte * const data, int sx, int sy, int reverse = 0);
-void downsample2x2(byte * data, int sx, int sy);
-void downsample2x2NoAlpha(byte * data, int sx, int sy);
+bool PNGSaveWithAlpha(const char *filename, const byte *data, int sx, int sy, int reverse = 0);
+void downsample2x2(byte *data, int sx, int sy);
+void downsample2x2NoAlpha(byte *data, int sx, int sy);
 
 
 
@@ -166,8 +167,9 @@
 public:
     MyDropTarget(MyFrame *_parent) { parent = _parent;  }
 
-    virtual bool OnDropFiles(wxCoord x, wxCoord y,  const wxArrayString& filenames){
+    virtual bool OnDropFiles(wxCoord x, wxCoord y,  const wxArrayString& filenames) {
       parent->OnReadFile(filenames[0]);
+      return true;
     };
 
 private:
@@ -231,9 +233,9 @@
   parent=_parent;
   
   // let's build notebook
-  /*wxNotebook **/notebook = new wxNotebook(
+  notebook = new wxNotebook(
     this, id, pos, size, 
-    0,/*style/*|wxNO_FULL_REPAINT_ON_RESIZE|wxNB_TOP,*/
+    0,/*style|wxNO_FULL_REPAINT_ON_RESIZE|wxNB_TOP,*/
     name);
     
   for (int i=0; i<MyTab::Count(); i++) {
@@ -559,7 +561,9 @@
 BEGIN_EVENT_TABLE(TestGLCanvas, wxGLCanvas)
     EVT_SIZE(TestGLCanvas::OnSize)
     EVT_PAINT(TestGLCanvas::OnPaint)
+#if defined(_WIN32)	    
     EVT_ERASE_BACKGROUND(TestGLCanvas::OnEraseBackground)
+#endif		
     EVT_MOUSE_EVENTS(TestGLCanvas::OnMouse)
     EVT_KEY_DOWN(TestGLCanvas::OnKeyDown)
     EVT_KEY_UP(TestGLCanvas::OnKeyUp)
@@ -621,22 +625,26 @@
       }
     }
     
-    if (!initdone) wxGLCanvas::OnPaint(event); else
-    if (mol.IsReady()) { 
-      if (mustDoHQ) {
-        drawFrame( hardSettings.STILL_QUALITY );  
-        shownHQ=true;
-        mustDoHQ=false;
-      } else {
-        drawFrame( hardSettings.MOVING_QUALITY );  
-        shownHQ=false;
-      }
-      SwapBuffers();  
-    }  
+    if (!initdone) {
+//       wxGLCanvas::OnPaint(event);
+    }
     else {
-      clearFrame();
-      SwapBuffers();  
-    }   
+       if (mol.IsReady()) { 
+	  if (mustDoHQ) {
+	     drawFrame( hardSettings.STILL_QUALITY );  
+	     shownHQ=true;
+	     mustDoHQ=false;
+	  } else {
+	     drawFrame( hardSettings.MOVING_QUALITY );  
+	     shownHQ=false;
+	  }
+	  SwapBuffers();  
+       }  
+       else {
+	  clearFrame();
+	  SwapBuffers();  
+       }  
+    }
 }
 
 void TestGLCanvas::OnSize(wxSizeEvent& event)
@@ -658,7 +666,7 @@
     }
 }
 
-
+#if defined(_WIN32)
 void MyFrame::OnEraseBackground(wxEraseEvent& event)
 {
   wxFrame::OnEraseBackground(event);
@@ -667,9 +675,11 @@
 
 void TestGLCanvas::OnEraseBackground(wxEraseEvent& event)
 {
-  if (!initdone) wxGLCanvas::OnEraseBackground(event);
+  if (!initdone) 
+    wxGLCanvas::OnEraseBackground(event);
     /* Do else do nothing, to avoid flashing on MSW */
 }
+#endif
 
 bool wxConsumeTrackBallEvent(wxMouseEvent& event, Trackball &track);
 bool wxConsumeTrackBallEvent(wxKeyEvent& event, bool down, Trackball &track);

=== modified file 'src/pngSave.cpp'
--- src/pngSave.cpp	2007-05-28 14:18:02 +0000
+++ src/pngSave.cpp	2007-05-28 20:00:36 +0000
@@ -15,7 +15,7 @@
 #include <iostream>
 using namespace std;
 
-#include <libpng13/png.h>
+#include <png.h>
  
 #include "progress.h"
 

=== modified file 'src/progress.cpp'
--- src/progress.cpp	2007-05-28 14:18:02 +0000
+++ src/progress.cpp	2007-05-28 20:00:36 +0000
@@ -13,7 +13,8 @@
 
 void StartProgress(char* str, int N){
   EndProgress();
-  wxString st; st.Printf("QuteMol: %s...",str);
+  wxString st; 
+  st.Printf((const wxChar*) "QuteMol: %s...", str);
   globalProgress= new wxProgressDialog(
     //_T("QuteMol"), st,
     st,  _T(""),

=== modified file 'src/saveSnapDialog.cpp'
--- src/saveSnapDialog.cpp	2007-05-28 14:18:02 +0000
+++ src/saveSnapDialog.cpp	2007-05-28 20:00:36 +0000
@@ -3,15 +3,17 @@
 #endif
 
 #include <vector>
-#include "SaveSnapDialog.h"
+#include "saveSnapDialog.h"
 #include "HardSettings.h"
 
 
 enum{ ID_ResUp=500, ID_ResDown, ID_Res, ID_AntiAlias, ID_Alpha};
 
-static wxString title[]={"PNG snapshot options","JPG snapshot options","GIF animation options"};
-static wxTextCtrl * resText;
-static wxCheckBox *wxCheckAntia, *wxTransp ;
+static wxString title[] = { wxString((wxChar) "PNG snapshot options"), 
+   wxString((wxChar) "JPG snapshot options"), 
+   wxString((wxChar) "GIF animation options") };
+//static wxTextCtrl * resText;
+//static wxCheckBox *wxCheckAntia, *wxTransp ;
 
 class EventTableEntry{
 public:
@@ -134,10 +136,12 @@
 
   bool EndEnableGroup(){
     enableif=NULL;
+    return true;
   }
   
   bool StartEnableGroup(){
     enableif=lastRadio;
+    return true;     
   }
   
   bool pressButton(wxWindowID x){
@@ -210,7 +214,7 @@
     //checkButton but=new 
   }
   
-  void AddNewInt(wxString label, int *dataz, int min, int max, bool pow2=false, int delta){
+  void AddNewInt(wxString label, int *dataz, int min, int max, bool pow2, int delta) {
     EventTableEntry e;
     
     e.idText=newID();

=== modified file 'src/saveSnapDialog.h'
--- src/saveSnapDialog.h	2007-05-28 14:18:02 +0000
+++ src/saveSnapDialog.h	2007-05-28 20:00:36 +0000
@@ -1,7 +1,7 @@
 
 
 
-class savesnapDialog:public wxDialog{
+class savesnapDialog : public wxDialog {
 public: 
   savesnapDialog(
     wxWindow* parent, 


Reply to: