Index: configure.ac
===================================================================
--- configure.ac	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ configure.ac	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -34,4 +34,10 @@
 #AX_BOOST_PROGRAM_OPTIONS
 #AX_BOOST_SERIALIZATION
+
+#QT4 libraries
+gw_CHECK_QT4
+AX_CHECK_GLU
+AC_MSG_NOTICE(["GLU_CFLAGS: $GLU_CFLAGS, GLU_CXXFLAGS: $GLU_CXXFLAGS, GLU_LDFLAGS: $GLU_LDFLAGS, GLU_LIBS: $GLU_LIBS"])
+
 
 # Checks for header files.
Index: doc/class structure.uxf
===================================================================
--- doc/class structure.uxf	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ doc/class structure.uxf	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -21,5 +21,5 @@
 
 
-// This text will be stored with each diagram;  use it for notes.</help_text><zoom_level>7</zoom_level><element><type>com.umlet.element.base.Class</type><coordinates><x>1855</x><y>294</y><w>147</w><h>70</h></coordinates><panel_attributes>AtomInfo
+// This text will be stored with each diagram;  use it for notes.</help_text><zoom_level>7</zoom_level><element><type>com.umlet.element.base.Class</type><coordinates><x>1855</x><y>210</y><w>147</w><h>70</h></coordinates><panel_attributes>AtomInfo
 --
 -x,v,F: Vector
@@ -28,5 +28,5 @@
 #AtomInfo();
 #~AtomInfo();
-</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1645</x><y>315</y><w>223</w><h>34</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>210;21;21;21</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1274</x><y>147</y><w>392</w><h>259</h></coordinates><panel_attributes>Element
+</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1645</x><y>231</y><w>223</w><h>34</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>210;21;21;21</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1274</x><y>63</y><w>392</w><h>259</h></coordinates><panel_attributes>Element
 --
 mass: double
@@ -49,5 +49,5 @@
 #~element();
 #Output(ofstream * const out) const: bool
-#Checkout(ofstream * const out, const int No, const int NoOfAtoms) const: bool</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1960</x><y>532</y><w>280</w><h>161</h></coordinates><panel_attributes>BondedParticle
+#Checkout(ofstream * const out, const int No, const int NoOfAtoms) const: bool</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1960</x><y>448</y><w>280</w><h>161</h></coordinates><panel_attributes>BondedParticle
 --
 --
@@ -63,6 +63,6 @@
 #OutputBondOfAtom() const
 #OutputAdjacency(ofstream *AdjacencyFile) const
-#OutputOrder(ofstream *file) const</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>2184</x><y>343</y><w>258</w><h>202</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>245;21;245;154;21;154;21;189</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1925</x><y>343</y><w>293</w><h>202</h></coordinates><panel_attributes>lt=&lt;&lt;-
-</panel_attributes><additional_attributes>21;21;21;154;280;154;280;189</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>2184</x><y>343</y><w>34</w><h>202</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;189</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>2359</x><y>294</y><w>147</w><h>70</h></coordinates><panel_attributes>BondedParticleInfo
+#OutputOrder(ofstream *file) const</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>2184</x><y>259</y><w>258</w><h>202</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>245;21;245;154;21;154;21;189</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1925</x><y>259</y><w>293</w><h>202</h></coordinates><panel_attributes>lt=&lt;&lt;-
+</panel_attributes><additional_attributes>21;21;21;154;280;154;280;189</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>2184</x><y>259</y><w>34</w><h>202</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;189</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>2359</x><y>210</y><w>147</w><h>70</h></coordinates><panel_attributes>BondedParticleInfo
 --
 AdaptiveOrder: unsigned char
@@ -71,5 +71,5 @@
 #BondedParticleInfo()
 #~BondedParticleInfo()
-</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>2079</x><y>280</y><w>217</w><h>84</h></coordinates><panel_attributes>ParticleInfo
+</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>2079</x><y>196</y><w>217</w><h>84</h></coordinates><panel_attributes>ParticleInfo
 --
 nr: int
@@ -79,5 +79,5 @@
 #~ParticleInfo()
 #ostream &amp; operator &lt;&lt; (ostream &amp;ost) const
-</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>2485</x><y>315</y><w>174</w><h>34</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>21;21;161;21</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>2646</x><y>245</y><w>147</w><h>133</h></coordinates><panel_attributes>BondList
+</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>2485</x><y>231</y><w>174</w><h>34</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>21;21;161;21</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>2646</x><y>161</y><w>147</w><h>133</h></coordinates><panel_attributes>BondList
 {Some Properties}
 --
@@ -90,5 +90,5 @@
 Responsibilities
 -- Resp1
-*-- Resp2*</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1372</x><y>427</y><w>147</w><h>105</h></coordinates><panel_attributes>GraphNodeInfo
+*-- Resp2*</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1372</x><y>343</y><w>147</w><h>105</h></coordinates><panel_attributes>GraphNodeInfo
 --
 --
@@ -102,5 +102,5 @@
 #GraphNodeInfo()
 #~GraphNodeInfo()
-</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1484</x><y>609</y><w>126</w><h>70</h></coordinates><panel_attributes>GraphNode
+</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1484</x><y>525</y><w>126</w><h>70</h></coordinates><panel_attributes>GraphNode
 --
 --
@@ -109,5 +109,5 @@
 #OutputGraphInfo() const
 #OutputComponentNumber() const
-</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1484</x><y>343</y><w>748</w><h>279</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>735;21;735;70;217;70;217;210;21;210;21;266</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1484</x><y>511</y><w>34</w><h>111</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;98</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1288</x><y>756</y><w>588</w><h>245</h></coordinates><panel_attributes>Atom
+</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1484</x><y>259</y><w>748</w><h>279</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>735;21;735;70;217;70;217;210;21;210;21;266</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1484</x><y>427</y><w>34</w><h>111</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;98</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1288</x><y>672</y><w>588</w><h>245</h></coordinates><panel_attributes>Atom
 --
 sort: int*
@@ -129,5 +129,5 @@
 #DistanceToVector(const Vector &amp;origin) const: double 
 #DistanceSquaredToVector(const Vector &amp;origin) const: double
-#IsInParallelepiped(const Vector offset, const double *parallelepiped) const: bool</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1379</x><y>511</y><w>83</w><h>258</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;182;70;182;70;245</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>2226</x><y>749</y><w>504</w><h>210</h></coordinates><panel_attributes>TrajectoryParticle
+#IsInParallelepiped(const Vector offset, const double *parallelepiped) const: bool</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1379</x><y>427</y><w>83</w><h>258</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;182;70;182;70;245</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>2226</x><y>665</y><w>504</w><h>210</h></coordinates><panel_attributes>TrajectoryParticle
 --
 --
@@ -147,5 +147,5 @@
 #Thermostat_Berendsen(int Step, double ScaleTempFactor, double *ekin, config *configuration)
 #Thermostat_NoseHoover_init(int Step, double *delta_alpha)
-#Thermostat_NoseHoover_scale(int Step, double *ekin, config *configuration)</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>2149</x><y>343</y><w>209</w><h>419</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;112;196;112;196;406</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1967</x><y>343</y><w>391</w><h>419</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;112;378;112;378;406</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1617</x><y>574</y><w>203</w><h>70</h></coordinates><panel_attributes>TrajectoryParticleInfo
+#Thermostat_NoseHoover_scale(int Step, double *ekin, config *configuration)</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>2149</x><y>259</y><w>209</w><h>419</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;112;196;112;196;406</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1967</x><y>259</y><w>391</w><h>419</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;112;378;112;378;406</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1617</x><y>490</y><w>203</w><h>70</h></coordinates><panel_attributes>TrajectoryParticleInfo
 --
 Trajectory: struct {vector&lt;Vector&gt; R,U,V}
@@ -153,5 +153,5 @@
 --
 #TrajectoryParticleInfo()
-#~TrajectoryParticleInfo()</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1757</x><y>623</y><w>601</w><h>139</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;105;588;105;588;126</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1729</x><y>623</y><w>34</w><h>146</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;133</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1519</x><y>658</y><w>244</w><h>111</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;56;231;56;231;98</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1736</x><y>448</y><w>147</w><h>112</h></coordinates><panel_attributes>TesselPoint
+#~TrajectoryParticleInfo()</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1757</x><y>539</y><w>601</w><h>139</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;105;588;105;588;126</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1729</x><y>539</y><w>34</w><h>146</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;133</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1519</x><y>574</y><w>244</w><h>111</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>21;21;21;56;231;56;231;98</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1736</x><y>364</y><w>147</w><h>112</h></coordinates><panel_attributes>TesselPoint
 --
 -id: Long
@@ -163,5 +163,5 @@
 Responsibilities
 -- Resp1
-*-- Resp2*</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1729</x><y>539</y><w>146</w><h>230</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>133;21;133;175;21;175;21;217</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1729</x><y>672</y><w>398</w><h>97</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>385;21;385;42;21;42;21;84</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1729</x><y>343</y><w>398</w><h>426</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>385;21;385;168;196;168;196;371;21;371;21;413</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1729</x><y>343</y><w>209</w><h>426</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>196;21;196;371;21;371;21;413</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>833</x><y>854</y><w>357</w><h>224</h></coordinates><panel_attributes>Bond
+*-- Resp2*</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1729</x><y>455</y><w>146</w><h>230</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>133;21;133;175;21;175;21;217</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1729</x><y>588</y><w>398</w><h>97</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>385;21;385;42;21;42;21;84</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1729</x><y>259</y><w>398</w><h>426</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>385;21;385;168;196;168;196;371;21;371;21;413</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1729</x><y>259</y><w>209</w><h>426</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>196;21;196;371;21;371;21;413</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>833</x><y>770</y><w>357</w><h>224</h></coordinates><panel_attributes>Bond
 --
 HydrogenBond: int
@@ -182,8 +182,8 @@
 #bond()
 #bond(atom *left, atom *right, const int degree=1, const int number=0)
-#~bond()</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1834</x><y>707</y><w>107</w><h>125</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-
-3</panel_attributes><additional_attributes>42;112;91;112;91;35;21;35;21;49</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1169</x><y>896</y><w>132</w><h>49</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-
-2</panel_attributes><additional_attributes>21;35;119;35</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>770</x><y>742</y><w>111</w><h>167</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-
-2</panel_attributes><additional_attributes>63;154;28;154;28;35;98;35;98;112</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1113</x><y>1330</y><w>504</w><h>168</h></coordinates><panel_attributes>BondGraph
+#~bond()</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1834</x><y>623</y><w>107</w><h>125</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-
+3</panel_attributes><additional_attributes>42;112;91;112;91;35;21;35;21;49</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1169</x><y>812</y><w>132</w><h>49</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-
+2</panel_attributes><additional_attributes>21;35;119;35</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>770</x><y>658</y><w>111</w><h>167</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-
+2</panel_attributes><additional_attributes>63;154;28;154;28;35;98;35;98;112</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1113</x><y>1246</y><w>504</w><h>168</h></coordinates><panel_attributes>BondGraph
 --
 max_distance: double
@@ -199,5 +199,5 @@
                                                         double &amp;MinDistance, double &amp;MaxDistance, bool IsAngstroem)
 #CovalentMinMaxDistance(BondedParticle * const Walker, BondedParticle * const OtherWalker,
-                                          double &amp;MinDistance, double &amp;MaxDistance, bool IsAngstroem)</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1596</x><y>1407</y><w>167</w><h>34</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>21;21;154;21</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1750</x><y>1365</y><w>147</w><h>133</h></coordinates><panel_attributes>MatrixContainer
+                                          double &amp;MinDistance, double &amp;MaxDistance, bool IsAngstroem)</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1596</x><y>1323</y><w>167</w><h>34</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>21;21;154;21</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1750</x><y>1281</y><w>147</w><h>133</h></coordinates><panel_attributes>MatrixContainer
 --
 -id: Long
@@ -209,5 +209,5 @@
 Responsibilities
 -- Resp1
-*-- Resp2*</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>0</x><y>539</y><w>511</w><h>1050</h></coordinates><panel_attributes>config
+*-- Resp2*</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>0</x><y>455</y><w>511</w><h>1050</h></coordinates><panel_attributes>config
 --
 PsiType: int
@@ -297,6 +297,6 @@
 #SetDefaultPath(const char * const path);
 #InitThermostats();
-#ParseThermostats(class ConfigFileBuffer * const fb);</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>490</x><y>1428</y><w>636</w><h>34</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>21;21;623;21</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1596</x><y>84</y><w>121</w><h>139</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-
-2</panel_attributes><additional_attributes>70;126;105;126;105;35;21;35;21;63</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>2520</x><y>980</y><w>224</w><h>140</h></coordinates><panel_attributes>&lt;&lt;Singleton&gt;&gt;
+#ParseThermostats(class ConfigFileBuffer * const fb);</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>490</x><y>1344</y><w>636</w><h>34</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>21;21;623;21</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1596</x><y>0</y><w>121</w><h>139</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-
+2</panel_attributes><additional_attributes>70;126;105;126;105;35;21;35;21;63</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>2520</x><y>896</y><w>224</w><h>140</h></coordinates><panel_attributes>&lt;&lt;Singleton&gt;&gt;
 errorLogger
 --
@@ -310,9 +310,9 @@
 #static setVerbosity(int verbosityLevel);
 #protected errorLogger()
-#protected ~errorLogger()</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>2093</x><y>1064</y><w>364</w><h>35</h></coordinates><panel_attributes>KeyCompare
+#protected ~errorLogger()</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>2093</x><y>980</y><w>364</w><h>35</h></coordinates><panel_attributes>KeyCompare
 --
 --
 #operator() (const KeySet SubgraphA, const KeySet SubgraphB) const: bool
-</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1169</x><y>1218</y><w>147</w><h>105</h></coordinates><panel_attributes>UniqueFragments
+</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1169</x><y>1134</y><w>147</w><h>105</h></coordinates><panel_attributes>UniqueFragments
 --
 ANOVAOrder: int
@@ -322,13 +322,13 @@
 ShortestPathList: int *
 UsedList: bool **
-BondsPerSPCount: int *</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>490</x><y>1253</y><w>692</w><h>34</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>679;21;21;21</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1120</x><y>980</y><w>251</w><h>307</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>49;294;21;294;21;224;238;224;238;21</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>840</x><y>1127</y><w>245</w><h>28</h></coordinates><panel_attributes>Graph
+BondsPerSPCount: int *</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>490</x><y>1169</y><w>692</w><h>34</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>679;21;21;21</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1120</x><y>896</y><w>251</w><h>307</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>49;294;21;294;21;224;238;224;238;21</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>840</x><y>1043</y><w>245</w><h>28</h></coordinates><panel_attributes>Graph
 {map &lt;KeySet, NumberValuePair, KeyCompare&gt;}
-</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>861</x><y>1134</y><w>321</w><h>153</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>308;140;21;140;21;21</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>945</x><y>1190</y><w>56</w><h>28</h></coordinates><panel_attributes>KeySet
-{set&lt;int&gt;}</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>945</x><y>1197</y><w>237</w><h>90</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>224;77;21;77;21;21</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1085</x><y>1057</y><w>99</w><h>230</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-
-0...N X 0...N</panel_attributes><additional_attributes>84;217;56;217;56;112;21;112;21;21</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1736</x><y>2282</y><w>147</w><h>42</h></coordinates><panel_attributes>LSQ_params
+</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>861</x><y>1050</y><w>321</w><h>153</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>308;140;21;140;21;21</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>945</x><y>1106</y><w>56</w><h>28</h></coordinates><panel_attributes>KeySet
+{set&lt;int&gt;}</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>945</x><y>1113</y><w>237</w><h>90</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>224;77;21;77;21;21</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1085</x><y>973</y><w>99</w><h>230</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-
+0...N X 0...N</panel_attributes><additional_attributes>84;217;56;217;56;112;21;112;21;21</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1736</x><y>2198</y><w>147</w><h>42</h></coordinates><panel_attributes>LSQ_params
 --
 vectors: const Vector **
 num: int
-</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1043</x><y>266</y><w>147</w><h>35</h></coordinates><panel_attributes>lsq_params
---
-x: gsl_vector *</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1169</x><y>266</y><w>118</w><h>34</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>21;21;105;21</additional_attributes></element></umlet_diagram>
+</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1043</x><y>182</y><w>147</w><h>35</h></coordinates><panel_attributes>lsq_params
+--
+x: gsl_vector *</panel_attributes><additional_attributes></additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1169</x><y>182</y><w>118</w><h>34</h></coordinates><panel_attributes>lt=&lt;&lt;&lt;&lt;-</panel_attributes><additional_attributes>21;21;105;21</additional_attributes></element></umlet_diagram>
Index: m4/acx_pthread.m4
===================================================================
--- m4/acx_pthread.m4	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ m4/acx_pthread.m4	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,275 @@
+# ===========================================================================
+#              http://autoconf-archive.cryp.to/acx_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+#   This macro figures out how to build C programs using POSIX threads. It
+#   sets the PTHREAD_LIBS output variable to the threads library and linker
+#   flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+#   flags that are needed. (The user can also force certain compiler
+#   flags/libs to be tested by setting these environment variables.)
+#
+#   Also sets PTHREAD_CC to any special C compiler that is needed for
+#   multi-threaded programs (defaults to the value of CC otherwise). (This
+#   is necessary on AIX to use the special cc_r compiler alias.)
+#
+#   NOTE: You are assumed to not only compile your program with these flags,
+#   but also link it with them as well. e.g. you should link with
+#   $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+#   If you are only building threads programs, you may wish to use these
+#   variables in your default LIBS, CFLAGS, and CC:
+#
+#          LIBS="$PTHREAD_LIBS $LIBS"
+#          CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+#          CC="$PTHREAD_CC"
+#
+#   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+#   has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
+#   (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+#   ACTION-IF-FOUND is a list of shell commands to run if a threads library
+#   is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+#   is not found. If ACTION-IF-FOUND is not specified, the default action
+#   will define HAVE_PTHREAD.
+#
+#   Please let the authors know if this macro fails on any platform, or if
+#   you have any other suggestions or comments. This macro was based on work
+#   by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
+#   from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
+#   Alejandro Forero Cuervo to the autoconf macro repository. We are also
+#   grateful for the helpful feedback of numerous users.
+#
+# LAST MODIFICATION
+#
+#   2008-04-12
+#
+# COPYLEFT
+#
+#   Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Macro Archive. When you make and
+#   distribute a modified version of the Autoconf Macro, you may extend this
+#   special exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([ACX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG_C
+acx_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+        AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
+        AC_MSG_RESULT($acx_pthread_ok)
+        if test x"$acx_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+#      ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+        *solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
+
+        acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
+        ;;
+esac
+
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
+
+        case $flag in
+                none)
+                AC_MSG_CHECKING([whether pthreads work without any flags])
+                ;;
+
+                -*)
+                AC_MSG_CHECKING([whether pthreads work with $flag])
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+		pthread-config)
+		AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
+		if test x"$acx_pthread_config" = xno; then continue; fi
+		PTHREAD_CFLAGS="`pthread-config --cflags`"
+		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+		;;
+
+                *)
+                AC_MSG_CHECKING([for the pthreads library -l$flag])
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+        AC_TRY_LINK([#include <pthread.h>],
+                    [pthread_t th; pthread_join(th, 0);
+                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
+                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+                    [acx_pthread_ok=yes])
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        AC_MSG_RESULT($acx_pthread_ok)
+        if test "x$acx_pthread_ok" = xyes; then
+                break;
+        fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+	AC_MSG_CHECKING([for joinable pthread attribute])
+	attr_name=unknown
+	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+	    AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
+                        [attr_name=$attr; break])
+	done
+        AC_MSG_RESULT($attr_name)
+        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+            AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+                               [Define to necessary symbol if this constant
+                                uses a non-standard name on your system.])
+        fi
+
+        AC_MSG_CHECKING([if more special flags are required for pthreads])
+        flag=no
+        case "${host_cpu}-${host_os}" in
+            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+            *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        esac
+        AC_MSG_RESULT(${flag})
+        if test "x$flag" != xno; then
+            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        # More AIX lossage: must compile with xlc_r or cc_r
+	if test x"$GCC" != xyes; then
+          AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
+        else
+          PTHREAD_CC=$CC
+	fi
+else
+        PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
+        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+        :
+else
+        acx_pthread_ok=no
+        $2
+fi
+AC_LANG_RESTORE
+])dnl ACX_PTHREAD
Index: m4/ax_check_gl.m4
===================================================================
--- m4/ax_check_gl.m4	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ m4/ax_check_gl.m4	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,87 @@
+dnl Available from the GNU Autoconf Macro Archive at:
+dnl http://www.gnu.org/software/ac-archive/htmldoc/ax_check_gl.html
+dnl
+AC_DEFUN([AX_CHECK_GL],
+[AC_REQUIRE([AC_PATH_X])dnl
+AC_REQUIRE([ACX_PTHREAD])dnl
+
+#
+# There isn't a reliable way to know we should use the Apple OpenGL framework
+# without a configure option.  A Mac OS X user may have installed an
+# alternative GL implementation (e.g., Mesa), which may or may not depend on X.
+#
+AC_ARG_WITH([apple-opengl-framework],
+            [AC_HELP_STRING([--with-apple-opengl-framework],
+                            [use Apple OpenGL framework (Mac OS X only)])])
+if test "X$with_apple_opengl_framework" = "Xyes"; then
+  AC_DEFINE([HAVE_APPLE_OPENGL_FRAMEWORK], [1],
+            [Use the Apple OpenGL framework.])
+  GL_LIBS="-framework OpenGL"
+else
+  AC_LANG_PUSH(C)
+
+  AX_LANG_COMPILER_MS
+  if test X$ax_compiler_ms = Xno; then
+    GL_CFLAGS="${PTHREAD_CFLAGS}"
+    GL_CXXFLAGS="${PTHREAD_CXXFLAGS}"
+    GL_LIBS="${PTHREAD_LIBS} -lm"
+  fi
+
+  #
+  # Use x_includes and x_libraries if they have been set (presumably by
+  # AC_PATH_X).
+  #
+  if test "X$no_x" != "Xyes"; then
+    if test -n "$x_includes"; then
+      GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}"
+      GL_CXXFLAGS="-I${x_includes} ${GL_CXXFLAGS}"
+    fi
+    if test -n "$x_libraries"; then
+      GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}"
+    fi
+  fi
+
+  AC_CHECK_HEADERS([windows.h])
+
+  AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl],
+  [ax_cv_check_gl_libgl="no"
+  ax_save_CPPFLAGS="${CPPFLAGS}"
+  CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
+  CXXFLAGS="${GL_CXXFLAGS} ${CXXFLAGS}"
+  ax_save_LIBS="${LIBS}"
+  LIBS=""
+  ax_check_libs="-lopengl32 -lGL"
+  for ax_lib in ${ax_check_libs}; do
+    if test X$ax_compiler_ms = Xyes; then
+      ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
+    else
+      ax_try_lib="${ax_lib}"
+    fi
+    LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
+    AC_LINK_IFELSE(
+    [AC_LANG_PROGRAM([[
+# if HAVE_WINDOWS_H && defined(_WIN32)
+#   include <windows.h>
+# endif
+# include <GL/gl.h>]],
+                     [[glBegin(0)]])],
+    [ax_cv_check_gl_libgl="${ax_try_lib}"; break])
+  done
+  LIBS=${ax_save_LIBS}
+  CPPFLAGS=${ax_save_CPPFLAGS}])
+
+  if test "X${ax_cv_check_gl_libgl}" = "Xno"; then
+    no_gl="yes"
+    GL_CFLAGS=""
+    GL_CXXFLAGS=""
+    GL_LIBS=""
+  else
+    GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}"
+  fi
+  AC_LANG_POP(C)
+fi
+
+AC_SUBST([GL_CFLAGS])
+AC_SUBST([GL_CXXFLAGS])
+AC_SUBST([GL_LIBS])
+])dnl
Index: m4/ax_check_glu.m4
===================================================================
--- m4/ax_check_glu.m4	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ m4/ax_check_glu.m4	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,104 @@
+AC_DEFUN([AX_CHECK_GLU],
+[AC_REQUIRE([AX_CHECK_GL])dnl
+AC_REQUIRE([AC_PROG_CXX])dnl
+GLU_CFLAGS="${GL_CFLAGS}"
+GLU_CXXFLAGS="${GL_CXXFLAGS}"
+
+ax_save_CPPFLAGS="${CPPFLAGS}"
+CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
+CFLAGS="${GL_CXXFLAGS} ${CXXFLAGS}"
+AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h])
+CPPFLAGS="${ax_save_CPPFLAGS}"
+
+m4_define([AX_CHECK_GLU_PROGRAM],
+          [AC_LANG_PROGRAM([[
+# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
+#   include <windows.h>
+# endif
+# ifdef HAVE_GL_GLU_H
+#   include <GL/glu.h>
+# elif defined(HAVE_OPENGL_GLU_H)
+#   include <OpenGL/glu.h>
+# else
+#   error no glu.h
+# endif]],
+                          [[gluBeginCurve(0)]])])
+
+AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu],
+[ax_cv_check_glu_libglu="no"
+ax_save_CPPFLAGS="${CPPFLAGS}"
+CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
+CXXFLAGS="${GL_CXXFLAGS} ${CXXFLAGS}"
+ax_save_LIBS="${LIBS}"
+
+#
+# First, check for the possibility that everything we need is already in
+# GL_LIBS.
+#
+LIBS="${GL_LIBS} ${ax_save_LIBS}"
+#
+# libGLU typically links with libstdc++ on POSIX platforms.
+# However, setting the language to C++ means that test program
+# source is named "conftest.cc"; and Microsoft cl doesn't know what
+# to do with such a file.
+#
+AC_LANG_PUSH([C++])
+AS_IF([test X$ax_compiler_ms = Xyes],
+      [AC_LANG_PUSH([C])])
+AC_LINK_IFELSE(
+[AX_CHECK_GLU_PROGRAM],
+[ax_cv_check_glu_libglu=yes],
+[LIBS=""
+ax_check_libs="-lglu32 -lGLU"
+for ax_lib in ${ax_check_libs}; do
+  AS_IF([test X$ax_compiler_ms = Xyes],
+        [ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`],
+        [ax_try_lib="${ax_lib}"])
+  LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
+  AC_LINK_IFELSE([AX_CHECK_GLU_PROGRAM],
+                 [ax_cv_check_glu_libglu="${ax_try_lib}"; break])
+done
+])
+AS_IF([test X$ax_compiler_ms = Xyes],
+      [AC_LANG_POP([C])])
+AC_LANG_POP([C++])
+
+LIBS=${ax_save_LIBS}
+CPPFLAGS=${ax_save_CPPFLAGS}])
+AS_IF([test "X$ax_cv_check_glu_libglu" = Xno],
+      [no_glu=yes; GLU_CFLAGS=""; GLU_CXXFLAGS=""; GLU_LIBS=""],
+      [AS_IF([test "X$ax_cv_check_glu_libglu" = Xyes],
+             [GLU_LIBS="$GL_LIBS"],
+             [GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}"])])
+AC_SUBST([GLU_CFLAGS])
+AC_SUBST([GLU_CXXFLAGS])
+AC_SUBST([GLU_LIBS])
+
+#
+# Some versions of Mac OS X include a broken interpretation of the GLU
+# tesselation callback function signature.
+#
+AS_IF([test "X$ax_cv_check_glu_libglu" != Xno],
+[AC_CACHE_CHECK([for varargs GLU tesselator callback function type],
+                [ax_cv_varargs_glu_tesscb],
+[ax_cv_varargs_glu_tesscb=no
+ax_save_CFLAGS="$CFLAGS"
+ax_save_CXXFLAGS="$CXXFLAGS"
+CFLAGS="$GL_CFLAGS $CFLAGS"
+CXXFLAGS="$GL_CXXFLAGS $CXXFLAGS"
+AC_COMPILE_IFELSE(
+[AC_LANG_PROGRAM([[
+# ifdef HAVE_GL_GLU_H
+#   include <GL/glu.h>
+# else
+#   include <OpenGL/glu.h>
+# endif]],
+                 [[GLvoid (*func)(...); gluTessCallback(0, 0, func)]])],
+[ax_cv_varargs_glu_tesscb=yes])
+CFLAGS="$ax_save_CFLAGS"])
+CXXFLAGS="$ax_save_CXXFLAGS"])
+AS_IF([test X$ax_cv_varargs_glu_tesscb = Xyes],
+      [AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1],
+                 [Use nonstandard varargs form for the GLU tesselator callback])])])
+])
+
Index: m4/gwqt4.m4
===================================================================
--- m4/gwqt4.m4	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ m4/gwqt4.m4	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,193 @@
+# Check for Qt compiler flags, linker flags, and binary packages
+AC_DEFUN([gw_CHECK_QT4],
+[
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PATH_X])
+
+AC_MSG_CHECKING([QTDIR])
+AC_ARG_WITH([qtdir], [  --with-qtdir=DIR        Qt installation directory [default=$QTDIR]], QTDIR=$withval)
+# Check that QTDIR is defined or that --with-qtdir given
+if test x"$QTDIR" = x ; then
+	# some usual Qt-locations
+	QT_SEARCH="/usr /usr/lib/qt /usr/X11R6 /usr/local/Trolltech/Qt-4.0.0 /usr/local/Trolltech/Qt-4.0.1 /usr/local/Trolltech/Qt-4.1.0 /usr/local/Trolltech/Qt-4.2.0 /usr/local/Trolltech/Qt-4.2.1 /usr/local/Trolltech/Qt-4.2.2"
+else
+	QT_SEARCH=$QTDIR
+	QTDIR=""
+fi
+for i in $QT_SEARCH ; do
+	QT_INCLUDE_SEARCH="include/qt4 include"
+	for j in $QT_INCLUDE_SEARCH ; do
+	        if test -f $i/$j/Qt/qglobal.h -a x$QTDIR = x ; then
+			QTDIR=$i
+			QT_INCLUDES=$i/$j
+		fi
+	done
+done
+if test x"$QTDIR" = x ; then
+	AC_MSG_ERROR([*** QTDIR must be defined, or --with-qtdir option given])
+fi
+AC_MSG_RESULT([$QTDIR])
+
+# Change backslashes in QTDIR to forward slashes to prevent escaping
+# problems later on in the build process, mainly for Cygwin build
+# environment using MSVC as the compiler
+QTDIR=`echo $QTDIR | sed 's/\\\\/\\//g'`
+
+AC_MSG_CHECKING([Qt includes])
+# Check where includes are located
+if test x"$QT_INCLUDES" = x ; then
+	AC_MSG_ERROR([*** could not find Qt-includes! Make sure you have the Qt-devel-files installed!])
+fi
+AC_MSG_RESULT([$QT_INCLUDES])
+
+
+if test -z "$QTHOSTDIR" ; then
+	case "${prefix}" in
+		/opt/mingw*)
+			QTHOSTDIR=/usr
+			;;
+		*)
+			if test -n "$QTDIR" ; then
+				QTHOSTDIR="$QTDIR"
+			else
+				QTHOSTDIR=/usr
+			fi
+			;;
+	esac
+fi
+
+
+# Check that moc is in path
+AC_CHECK_PROG(MOC, moc-qt4, $QTHOSTDIR/bin/moc-qt4,,$QTHOSTDIR/bin/)
+if test x$MOC = x ; then
+	AC_CHECK_PROG(MOC, moc, $QTHOSTDIR/bin/moc,,$QTHOSTDIR/bin/)
+	if test x$MOC = x ; then
+        	AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools installed!])
+	fi
+fi
+
+# Check that uic is in path
+AC_CHECK_PROG(UIC, uic-qt4, $QTHOSTDIR/bin/uic-qt4,,$QTHOSTDIR/bin/)
+if test x$UIC = x ; then
+	AC_CHECK_PROG(UIC, uic, $QTHOSTDIR/bin/uic,,$QTHOSTDIR/bin/)
+	if test x$UIC = x ; then
+        	AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools installed!])
+	fi
+fi
+
+# lupdate is the Qt translation-update utility.
+AC_CHECK_PROG(LUPDATE, lupdate-qt4, $QTHOSTDIR/bin/lupdate-qt4,,$QTHOSTDIR/bin/)
+if test x$LUPDATE = x ; then
+	AC_CHECK_PROG(LUPDATE, lupdate, $QTHOSTDIR/bin/lupdate,,$QTHOSTDIR/bin/)
+	if test x$MOC = x ; then
+	        AC_MSG_WARN([*** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!])
+	fi
+fi
+
+# lrelease is the Qt translation-release utility.
+AC_CHECK_PROG(LRELEASE, lrelease-qt4, $QTHOSTDIR/bin/lrelease-qt4,,$QTHOSTDIR/bin/)
+if test x$LRELEASE = x ; then
+	AC_CHECK_PROG(LRELEASE, lrelease, $QTHOSTDIR/bin/lrelease,,$QTHOSTDIR/bin/)
+	if test x$MOC = x ; then
+	        AC_MSG_WARN([*** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!])
+	fi
+fi
+
+# Calculate Qt include path
+QT_CXXFLAGS="-I$QT_INCLUDES -I$QT_INCLUDES/Qt"
+
+# On unix, figure out if we're doing a static or dynamic link
+case "${host}" in
+      *mingw32)
+        QT_IS_STATIC=`ls $QTDIR/lib/*.a 2> /dev/null`
+       	if test "x$QT_IS_STATIC" = x; then
+            QT_IS_STATIC="no"
+       	else
+            QT_IS_STATIC="yes"
+        fi
+        if test x$QT_IS_STATIC = xno ; then
+            QT_IS_DYNAMIC=`ls $QTDIR/lib/*.so 2> /dev/null` 
+            if test "x$QT_IS_DYNAMIC" = x;  then
+                AC_MSG_ERROR([*** Couldn't find any Qt libraries])
+            fi
+        fi
+	QT_LIB="-L$QTDIR/bin -lQtCore4 -lQtXml4 -lQtNetwork4 -lws2_32"
+	QT_LIB_GUI="-lQtGui4"
+	# Check that windres is in path
+	AC_PATH_PROGS([WINDRES],[i586-mingw32-windres windres],,[${prefix}/bin:$PATH])
+	if test x$WINDRES = x ; then
+		AC_MSG_ERROR([*** not found! Make sure you have binutils installed!])
+	fi
+        ;;
+    *)
+        QT_IS_STATIC=`ls $QTDIR/lib/*.a 2> /dev/null`
+       	if test "x$QT_IS_STATIC" = x; then
+            QT_IS_STATIC="no"
+       	else
+            QT_IS_STATIC="yes"
+        fi
+        if test x$QT_IS_STATIC = xno ; then
+            QT_IS_DYNAMIC=`ls $QTDIR/lib/*.so 2> /dev/null` 
+            if test "x$QT_IS_DYNAMIC" = x;  then
+                AC_MSG_ERROR([*** Couldn't find any Qt libraries])
+            fi
+        fi
+	QT_LIB="-L$QTDIR/lib -L$QTDIR/lib/qt4 -lQtCore -lQtXml -lQtNetwork"
+	QT_LIB_GUI="-lQtGui"
+        ;;
+esac
+AC_MSG_CHECKING([if Qt is static])
+AC_MSG_RESULT([$QT_IS_STATIC])
+
+QT_LIBS="$QT_LIB"
+
+
+case "${host}" in
+    *irix*)
+        QT_LIBS="$QT_LIB"
+        if test $QT_IS_STATIC = yes ; then
+            QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE"
+        fi
+        ;;
+
+    *linux*)
+        QT_LIBS="$QT_LIB"
+        if test $QT_IS_STATIC = yes ; then
+            QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE -ldl"
+        fi
+        ;;
+
+    *osf*) 
+        # Digital Unix (aka DGUX aka Tru64)
+        QT_LIBS="$QT_LIB"
+        if test $QT_IS_STATIC = yes ; then
+            QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE"
+        fi
+        ;;
+
+    *solaris*)
+        QT_LIBS="$QT_LIB"
+        if test $QT_IS_STATIC = yes ; then
+            QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE -lresolv -lsocket -lnsl"
+        fi
+        ;;
+
+esac
+
+
+QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT"
+
+QT_LDADD="$QT_LIBS"
+
+AC_MSG_CHECKING([QT_CXXFLAGS])
+AC_MSG_RESULT([$QT_CXXFLAGS])
+AC_MSG_CHECKING([QT_LDADD])
+AC_MSG_RESULT([$QT_LDADD])
+
+AC_SUBST(QT_CXXFLAGS)
+AC_SUBST(QT_LDADD)
+AC_SUBST(QT_LIB_GUI)
+
+])
+
+
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ src/Makefile.am	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -20,22 +20,41 @@
 MENUHEADER = Menu/Menu.hpp Menu/TextMenu.hpp Menu/MenuItem.hpp Menu/SubMenuItem.hpp Menu/ActionMenuItem.hpp Menu/SeperatorItem.hpp Menu/DisplayMenuItem.hpp
 
-UISOURCE = ${ACTIONSSOURCE} ${VIEWSOURCE} ${MENUSOURCE} UIElements/UIFactory.cpp UIElements/TextUIFactory.cpp UIElements/MainWindow.cpp UIElements/TextWindow.cpp UIElements/Dialog.cpp UIElements/TextDialog.cpp
-UIHEADER = ${ACTIONSHEADER} ${VIEWHEADER} ${MENUHEADER} UIElements/UIFactory.hpp UIElements/TextUIFactory.hpp UIElements/MainWindow.hpp UIElements/TextWindow.hpp UIElements/Dialog.hpp UIElements/TextDialog.hpp
+UISOURCE = ${ACTIONSSOURCE} ${VIEWSOURCE} ${MENUSOURCE} UIElements/TextUIFactory.cpp UIElements/MainWindow.cpp UIElements/TextWindow.cpp UIElements/Dialog.cpp UIElements/TextDialog.cpp
+UIHEADER = ${ACTIONSHEADER} ${VIEWHEADER} ${MENUHEADER} UIElements/TextUIFactory.hpp UIElements/MainWindow.hpp UIElements/TextWindow.hpp UIElements/Dialog.hpp UIElements/TextDialog.hpp
 
-SOURCE = ${ANALYSISSOURCE} ${ATOMSOURCE} ${PATTERNSOURCE} ${UISOURCE} bond.cpp bondgraph.cpp boundary.cpp config.cpp element.cpp ellipsoid.cpp errorlogger.cpp graph.cpp helpers.cpp info.cpp leastsquaremin.cpp linkedcell.cpp log.cpp logger.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp vector.cpp verbose.cpp menu.cpp
-HEADER = ${ANALYSISHEADER} ${ATOMHEADER} ${PATTERNHEADER} ${UIHEADER} bond.hpp bondgraph.hpp boundary.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp errorlogger.hpp graph.hpp helpers.hpp info.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp log.hpp logger.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp vector.hpp verbose.hpp menu.hpp
+FACTORYSOURCE = UIElements/UIFactory.cpp
+FACTORYHEADER = UIElements/UIFactory.hpp
+
+QTUIMOC_HEADER = UIElements/QT4/QTMainWindow.hpp UIElements/QT4/QTDialog.hpp Menu/QT4/QTMenu.hpp  Views/QT4/QTMoleculesView.hpp Views/QT4/GLMoleculeView.hpp
+QTUIMOC_TARGETS = QTMainWindow.moc.cpp QTMenu.moc.cpp QTDialog.moc.cpp QTMoleculesView.moc.cpp GLMoleculeView.moc.cpp
+
+QTUISOURCE = ${QTUIMOC_TARGETS} UIElements/QT4/QTMainWindow.cpp UIElements/QT4/QTDialog.cpp UIElements/QT4/QTUIFactory.cpp Menu/QT4/QTMenu.cpp Views/QT4/QTMoleculesView.cpp Views/QT4/GLMoleculeView.cpp
+QTUIHEADER = ${QTUIMOC_HEADER} UIElements/QT4/QTUIFactory.hpp
+
+QTUI_DEFS = 
+
+SOURCE = ${ANALYSISSOURCE} ${ATOMSOURCE} ${PATTERNSOURCE} bond.cpp bondgraph.cpp boundary.cpp config.cpp element.cpp ellipsoid.cpp errorlogger.cpp graph.cpp helpers.cpp info.cpp leastsquaremin.cpp linkedcell.cpp log.cpp logger.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp vector.cpp verbose.cpp menu.cpp
+HEADER = ${ANALYSISHEADER} ${ATOMHEADER} ${PATTERNHEADER} bond.hpp bondgraph.hpp boundary.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp errorlogger.hpp graph.hpp helpers.hpp info.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp log.hpp logger.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp vector.hpp verbose.hpp menu.hpp
 
 BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB)
 INCLUDES = -I$(top_srcdir)/src/unittests
 
-noinst_LIBRARIES = libmolecuilder.a libgslwrapper.a
-bin_PROGRAMS = molecuilder joiner analyzer
+noinst_LIBRARIES = libmolecuilder.a libgslwrapper.a libmenu.a
+bin_PROGRAMS = molecuilder molecuildergui joiner analyzer 
 molecuilderdir = ${bindir}
 libmolecuilder_a_SOURCES = ${SOURCE} ${HEADER}
+libmenu_a_SOURCES = ${UISOURCE} ${UIHEADER} 
 libgslwrapper_a_SOURCES = ${LINALGSOURCE} ${LINALGHEADER}
 molecuilder_DATA = elements.db valence.db orbitals.db Hbonddistance.db Hbondangle.db
 molecuilder_LDFLAGS = $(BOOST_LIB)
-molecuilder_SOURCES = builder.cpp
-molecuilder_LDADD = libmolecuilder.a libgslwrapper.a
+molecuilder_SOURCES = ${FACTORYSOURCE} menu.cpp builder.cpp
+molecuilder_SOURCES += $(srcdir)/version.c
+molecuilder_LDADD = libmolecuilder.a libgslwrapper.a libmenu.a
+#Stuff for building the GUI using QT
+molecuildergui_SOURCES = ${QTUISOURCE} ${FACTORYSOURCE} menu.cpp builder.cpp
+molecuildergui_SOURCES += $(srcdir)/version.c
+molecuildergui_CXXFLAGS = ${QT_CXXFLAGS} ${GLU_CXXFLAGS} -DUSE_GUI_QT
+molecuildergui_LDFLAGS = $(BOOST_LIB) ${QT_LDFLAGS} ${GLU_LDFLAGS}
+molecuildergui_LDADD = libmolecuilder.a libgslwrapper.a libmenu.a ${QT_LDADD} ${QT_LIB_GUI} -lQtOpenGL ${GLU_LIBS}
 joiner_SOURCES = joiner.cpp datacreator.cpp parser.cpp datacreator.hpp helpers.hpp parser.hpp periodentafel.hpp
 joiner_LDADD = libmolecuilder.a 
@@ -43,4 +62,18 @@
 analyzer_LDADD = libmolecuilder.a 
 
+#Rules needed for QT4
+# UI-Files are scattered throughout several subdirectories
+# Therfore `%'-rules do not seem to work
+#Quick fix to get it done otherwise
+${QTUIMOC_TARGETS}: ${QTUIMOC_HEADER}
+	list='$(QTUIMOC_HEADER)'; for header in $$list; do \
+	echo "Making mocfile for $$header"; \
+	target=`basename $$header | sed "s/\(.*\)\..*/\1.moc.cpp/"`;\
+	$(MOC) $(srcdir)/$$header -o $$target \
+	|| eval $$failcom; \
+	done;
+
+MOSTLYCLEANFILES = ${QTUIMOC_TARGETS}
+	
 #EXTRA_DIST = ${molecuilder_DATA}
 
@@ -59,3 +92,3 @@
 	echo "const char *ESPACKVersion = \"$(PACKAGE_NAME) -- git version: "`cat $(srcdir)/.git-version`"\";" > $@
 
-molecuilder_SOURCES += $(srcdir)/version.c
+
Index: src/Menu/QT4/QTMenu.cpp
===================================================================
--- src/Menu/QT4/QTMenu.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ src/Menu/QT4/QTMenu.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,55 @@
+/*
+ * QTMenu.cpp
+ *
+ *  Created on: Jan 15, 2010
+ *      Author: crueger
+ */
+
+#include "Menu/QT4/QTMenu.hpp"
+
+#include <Qt/qaction.h>
+#include "Menu/MenuItem.hpp"
+
+QTMenu::QTMenu(const char * _title) :
+  QMenu(_title)
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+QTMenu::~QTMenu()
+{
+  // TODO Auto-generated destructor stub
+}
+
+void QTMenu::addItem(MenuItem* item) {
+  const string description = item->getDescription();
+  QAction *action = addAction(QString(description.c_str()));
+  QTMenuPipe *pipe = new QTMenuPipe(item,action);
+  QObject::connect(action, SIGNAL(triggered()),pipe,SLOT(called()));
+  plumbing.push_back(pipe);
+}
+
+void QTMenu::removeItem(MenuItem* item) {
+  list<QTMenuPipe*>::iterator iter;
+  for(iter=plumbing.begin(); iter!=plumbing.end(); iter++){
+    delete (*iter);
+  }
+}
+
+void QTMenu::display() {
+
+}
+
+QTMenuPipe::QTMenuPipe(MenuItem *_item, QAction *_action) :
+    theItem(_item), theAction(_action)
+{}
+
+QTMenuPipe::~QTMenuPipe() {
+  delete theAction;
+  delete theItem;
+}
+
+void QTMenuPipe::called() {
+  theItem->doTrigger();
+}
Index: src/Menu/QT4/QTMenu.hpp
===================================================================
--- src/Menu/QT4/QTMenu.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ src/Menu/QT4/QTMenu.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,50 @@
+/*
+ * QTMenu.hpp
+ *
+ *  Created on: Jan 15, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTMENU_HPP_
+#define QTMENU_HPP_
+
+#include <list>
+
+#include <QtGui/QMenu>
+#include <QtCore/QObject>
+
+#include "Menu/Menu.hpp"
+
+class QTMenuPipe;
+
+class QTMenu : public QMenu, public Menu
+{
+  Q_OBJECT
+
+public:
+  QTMenu(const char *);
+  virtual ~QTMenu();
+
+  virtual void addItem(MenuItem*);
+  virtual void removeItem(MenuItem*);
+  virtual void display();
+private:
+  list<QTMenuPipe*> plumbing;
+};
+
+// This handles the plumbing from QT to internal Items
+// Slots from QT are redirected to internal methods.
+// This way methods can be used where no QT is available
+class QTMenuPipe : public QObject {
+  Q_OBJECT
+public:
+  QTMenuPipe(MenuItem*,QAction*);
+  virtual ~QTMenuPipe();
+public slots:
+  void called();
+private:
+  MenuItem *theItem;
+  QAction *theAction;
+};
+
+#endif /* QTMENU_HPP_ */
Index: src/UIElements/Dialog.cpp
===================================================================
--- src/UIElements/Dialog.cpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ src/UIElements/Dialog.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -31,4 +31,14 @@
 
 bool Dialog::display(){
+  if(checkAll()){
+    setAll();
+    return true;
+  }
+  else{
+    return false;
+  }
+}
+
+bool Dialog::checkAll(){
   list<Query*>::iterator iter;
   bool retval = true;
@@ -39,11 +49,12 @@
       break;
   }
-  if (retval){
-    // if all queries succeeded we can set the targets to appropriate values
-    for(iter=queries.begin(); iter!=queries.end(); iter++) {
-      (*iter)->setResult();
-    }
+  return retval;
+}
+
+void Dialog::setAll(){
+  list<Query*>::iterator iter;
+  for(iter=queries.begin(); iter!=queries.end(); iter++) {
+    (*iter)->setResult();
   }
-  return retval;
 }
 
@@ -76,5 +87,7 @@
 
 Dialog::StringQuery::StringQuery(string title,string *_target) :
-    Query(title), target(_target)
+    Query(title),
+    target(_target),
+    tmp("")
 {}
 
Index: src/UIElements/Dialog.hpp
===================================================================
--- src/UIElements/Dialog.hpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ src/UIElements/Dialog.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -29,4 +29,7 @@
 
   virtual bool display();
+
+  virtual bool checkAll();
+  virtual void setAll();
 
 protected:
Index: src/UIElements/QT4/QTDialog.cpp
===================================================================
--- src/UIElements/QT4/QTDialog.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ src/UIElements/QT4/QTDialog.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,314 @@
+/*
+ * QTDialog.cpp
+ *
+ *  Created on: Jan 18, 2010
+ *      Author: crueger
+ */
+
+#include "UIElements/QT4/QTDialog.hpp"
+
+#include <string>
+#include <sstream>
+#include <limits>
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qspinbox.h>
+#include <QtGui/QDoubleSpinBox>
+#include <Qt/qlineedit.h>
+#include <Qt/qdialogbuttonbox.h>
+#include <Qt/qpushbutton.h>
+#include <Qt/qcombobox.h>
+
+#include "atom.hpp"
+#include "molecule.hpp"
+
+
+using namespace std;
+
+QTDialog::QTDialog() :
+    QDialog(0)
+{
+  // creating and filling of the Dialog window
+  mainLayout = new QVBoxLayout();
+  inputLayout = new QVBoxLayout();
+  buttonLayout = new QVBoxLayout();
+  setLayout(mainLayout);
+  mainLayout->addLayout(inputLayout);
+  mainLayout->addLayout(buttonLayout);
+  buttons = new QDialogButtonBox(QDialogButtonBox::Ok| QDialogButtonBox::Cancel);
+  buttonLayout->addWidget(buttons);
+
+  // Disable the ok button until something was entered
+  buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
+
+  // connect the buttons to their appropriate slots
+  connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
+  connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
+}
+
+QTDialog::~QTDialog()
+{
+}
+
+bool QTDialog::display(){
+  // Button state might have changed by some update that
+  // was done during query construction. To make sure
+  // the state is correct, we just call update one more time.
+  update();
+  if(exec()) {
+    setAll();
+    return true;
+  }
+  else {
+    return false;
+  }
+}
+
+void QTDialog::update(){
+  buttons->button(QDialogButtonBox::Ok)->setEnabled(checkAll());
+}
+
+/************************** Query Infrastructure ************************/
+
+void QTDialog::queryInt(const char *title, int *target)
+{
+  registerQuery(new IntQTQuery(title,target,inputLayout,this));
+}
+
+void QTDialog::queryDouble(const char* title, double* target){
+  registerQuery(new DoubleQTQuery(title,target,inputLayout,this));
+}
+
+void QTDialog::queryString(const char* title, std::string *target)
+{
+  registerQuery(new StringQTQuery(title,target,inputLayout,this));
+}
+
+void QTDialog::queryMolecule(const char *title,molecule **target,MoleculeListClass *molecules)
+{
+  registerQuery(new MoleculeQTQuery(title,target,molecules,inputLayout,this));
+}
+
+void QTDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check) {
+  registerQuery(new VectorQTQuery(title,target,cellSize,check,inputLayout,this));
+}
+
+/************************** Query Objects *******************************/
+
+QTDialog::IntQTQuery::IntQTQuery(string _title,int *_target,QBoxLayout *_parent,QTDialog *_dialog) :
+    Dialog::IntQuery(_title,_target),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QSpinBox();
+  inputBox->setValue(0);
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new IntQTQueryPipe(&tmp,_dialog);
+  pipe->update(inputBox->value());
+  connect(inputBox,SIGNAL(valueChanged(int)),pipe,SLOT(update(int)));
+}
+
+QTDialog::IntQTQuery::~IntQTQuery()
+{
+  delete pipe;
+}
+
+// Handling is easy since the GUI makes it impossible to enter invalid values
+bool QTDialog::IntQTQuery::handle()
+{
+  return true;
+}
+
+QTDialog::DoubleQTQuery::DoubleQTQuery(string title,double *_target,QBoxLayout *_parent,QTDialog *_dialog) :
+    Dialog::DoubleQuery(title,_target),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QDoubleSpinBox();
+  inputBox->setValue(0);
+  inputBox->setRange(-numeric_limits<double>::max(),numeric_limits<double>::max());
+  inputBox->setDecimals(3);
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new DoubleQTQueryPipe(&tmp,_dialog);
+  pipe->update(inputBox->value());
+  connect(inputBox,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
+}
+
+QTDialog::DoubleQTQuery::~DoubleQTQuery()
+{
+  delete pipe;
+}
+
+bool QTDialog::DoubleQTQuery::handle() {
+  return true;
+}
+
+
+QTDialog::StringQTQuery::StringQTQuery(string _title,string *_target,QBoxLayout *_parent,QTDialog *_dialog) :
+    Dialog::StringQuery(_title,_target),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QLineEdit();
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new StringQTQueryPipe(&tmp,_dialog);
+  pipe->update(inputBox->text());
+  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(update(const QString&)));
+}
+
+QTDialog::StringQTQuery::~StringQTQuery()
+{
+  delete pipe;
+}
+
+// All values besides the empty string are valid
+bool QTDialog::StringQTQuery::handle()
+{
+  return tmp!="";
+}
+
+QTDialog::MoleculeQTQuery::MoleculeQTQuery(string _title, molecule **_target, MoleculeListClass *_molecules, QBoxLayout *_parent,QTDialog *_dialog) :
+    Dialog::MoleculeQuery(_title,_target,_molecules),
+    parent(_parent)
+{
+  MoleculeList::iterator iter;
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QComboBox();
+  // add all molecules to the combo box
+  for(iter  = molecules->ListOfMolecules.begin();
+      iter != molecules->ListOfMolecules.end();
+      iter++) {
+    stringstream sstr;
+    sstr << (*iter)->IndexNr << "\t" << (*iter)->getName();
+    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr));
+  }
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new MoleculeQTQueryPipe(&tmp,_dialog,inputBox,_molecules);
+  pipe->update(inputBox->currentIndex());
+  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
+}
+
+QTDialog::MoleculeQTQuery::~MoleculeQTQuery()
+{
+  delete pipe;
+}
+
+// Handling is easy, since the GUI makes it impossible to select invalid values
+bool QTDialog::MoleculeQTQuery::handle()
+{
+  return true;
+}
+
+QTDialog::VectorQTQuery::VectorQTQuery(std::string title, Vector *_target, const double *const _cellSize, bool _check,QBoxLayout *_parent,QTDialog *_dialog) :
+    Dialog::VectorQuery(title,_target,_cellSize,_check),
+    parent(_parent)
+{
+  // About the j: I don't know why it was done this way, but it was used this way in Vector::AskPosition, so I reused it
+  int j = -1;
+  const char *coords[3] = {"x:","y:","z:"};
+  mainLayout= new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  mainLayout->addWidget(titleLabel);
+  subLayout = new QVBoxLayout();
+  mainLayout->addLayout(subLayout);
+  for(int i=0; i<3; i++) {
+    j+=i+1;
+    coordLayout[i] = new QHBoxLayout();
+    subLayout->addLayout(coordLayout[i]);
+    coordLabel[i] = new QLabel(QString(coords[i]));
+    coordLayout[i]->addWidget(coordLabel[i]);
+    coordInput[i] = new QDoubleSpinBox();
+    coordInput[i]->setRange(0,cellSize[j]);
+    coordInput[i]->setDecimals(3);
+    coordLayout[i]->addWidget(coordInput[i]);
+    pipe[i] = new DoubleQTQueryPipe(&((*tmp)[i]),_dialog);
+    pipe[i]->update(coordInput[i]->value());
+    connect(coordInput[i],SIGNAL(valueChanged(double)),pipe[i],SLOT(update(double)));
+
+  }
+  parent->addLayout(mainLayout);
+}
+
+QTDialog::VectorQTQuery::~VectorQTQuery()
+{}
+
+bool QTDialog::VectorQTQuery::handle() {
+  return true;
+}
+
+
+/*************************** Plumbing *******************************/
+
+StringQTQueryPipe::StringQTQueryPipe(string *_content, QTDialog *_dialog) :
+  content(_content),
+  dialog(_dialog)
+{}
+
+StringQTQueryPipe::~StringQTQueryPipe()
+{}
+
+void StringQTQueryPipe::update(const QString& newText) {
+  content->assign(newText.toStdString());
+  dialog->update();
+}
+
+IntQTQueryPipe::IntQTQueryPipe(int *_content, QTDialog *_dialog) :
+  content(_content),
+  dialog(_dialog)
+{}
+
+IntQTQueryPipe::~IntQTQueryPipe()
+{}
+
+void IntQTQueryPipe::update(int newInt) {
+  (*content) = newInt;
+  dialog->update();
+}
+
+DoubleQTQueryPipe::DoubleQTQueryPipe(double *_content, QTDialog *_dialog) :
+  content(_content),
+  dialog(_dialog)
+{}
+
+DoubleQTQueryPipe::~DoubleQTQueryPipe()
+{}
+
+void DoubleQTQueryPipe::update(double newDbl) {
+  (*content) = newDbl;
+  dialog->update();
+}
+
+MoleculeQTQueryPipe::MoleculeQTQueryPipe(molecule **_content, QTDialog *_dialog, QComboBox *_theBox, MoleculeListClass *_molecules) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox),
+  molecules(_molecules)
+{}
+
+MoleculeQTQueryPipe::~MoleculeQTQueryPipe()
+{}
+
+void MoleculeQTQueryPipe::update(int newIndex) {
+  QVariant data = theBox->itemData(newIndex);
+  int idx = data.toInt();
+  (*content) = molecules->ReturnIndex(idx);
+  dialog->update();
+}
+
Index: src/UIElements/QT4/QTDialog.hpp
===================================================================
--- src/UIElements/QT4/QTDialog.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ src/UIElements/QT4/QTDialog.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,192 @@
+/*
+ * QTDialog.hpp
+ *
+ *  Created on: Jan 18, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTDIALOG_HPP_
+#define QTDIALOG_HPP_
+
+#include "UIElements/Dialog.hpp"
+#include <QtGui/QDialog>
+
+class QBoxLayout;
+class QLabel;
+class QSpinBox;
+class QDoubleSpinBox;
+class QLineEdit;
+class QComboBox;
+class QDialogButtonBox;
+
+
+// Forward declarations for plumbing
+class StringQTQueryPipe;
+class IntQTQueryPipe;
+class DoubleQTQueryPipe;
+class MoleculeQTQueryPipe;
+
+class QTDialog : public QDialog, public Dialog
+{
+  Q_OBJECT
+public:
+  QTDialog();
+  virtual ~QTDialog();
+
+  virtual void queryInt(const char *, int *);
+  virtual void queryString(const char*, std::string *);
+  virtual void queryDouble(const char*,double *);
+  virtual void queryMolecule(const char*,molecule**,MoleculeListClass*);
+  virtual void queryVector(const char*,Vector *,const double *const,bool);
+
+  virtual bool display();
+
+  virtual void update();
+
+protected:
+  class IntQTQuery : public Dialog::IntQuery {
+    public:
+      IntQTQuery(std::string _title, int *_target,QBoxLayout *_parent,QTDialog *_dialog);
+      ~IntQTQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QSpinBox *inputBox;
+
+      IntQTQueryPipe *pipe;
+    };
+
+    class DoubleQTQuery : public Dialog::DoubleQuery {
+    public:
+      DoubleQTQuery(std::string title, double *_target,QBoxLayout *_parent,QTDialog *_dialog);
+      ~DoubleQTQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QDoubleSpinBox *inputBox;
+
+      DoubleQTQueryPipe *pipe;
+    };
+
+    class StringQTQuery : public Dialog::StringQuery {
+    public:
+      StringQTQuery(std::string _title, std::string *_target, QBoxLayout *_parent,QTDialog *_dialog);
+      ~StringQTQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QLineEdit *inputBox;
+
+      StringQTQueryPipe *pipe;
+    };
+
+    class MoleculeQTQuery : public Dialog::MoleculeQuery {
+    public:
+      MoleculeQTQuery(std::string _title, molecule **_target, MoleculeListClass *_molecules, QBoxLayout *_parent,QTDialog *_dialog);
+      ~MoleculeQTQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QComboBox *inputBox;
+
+      MoleculeQTQueryPipe *pipe;
+    };
+
+    class VectorQTQuery : public Dialog::VectorQuery {
+    public:
+      VectorQTQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check,QBoxLayout *,QTDialog *);
+      ~VectorQTQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *mainLayout;
+      QLabel *titleLabel;
+      QBoxLayout *subLayout;
+      QBoxLayout *coordLayout[3];
+      QLabel *coordLabel[3];
+      QDoubleSpinBox *coordInput[3];
+
+      DoubleQTQueryPipe *pipe[3];
+    };
+
+private:
+  QBoxLayout *mainLayout;
+  QBoxLayout *inputLayout;
+  QBoxLayout *buttonLayout;
+  QDialogButtonBox *buttons;
+};
+
+// All kinds of plumbing for Queries
+// Plumbing needs to be outside of the class where it is needed,
+// since MOC doesn't like nested classes
+
+class StringQTQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  StringQTQueryPipe(std::string *_content, QTDialog *_dialog);
+  ~StringQTQueryPipe();
+
+public slots:
+  void update(const QString&);
+
+private:
+  std::string *content;
+  QTDialog *dialog;
+
+};
+
+class IntQTQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  IntQTQueryPipe(int *_content, QTDialog *_dialog);
+  ~IntQTQueryPipe();
+
+public slots:
+  void update(int);
+
+private:
+  int *content;
+  QTDialog *dialog;
+
+};
+
+class DoubleQTQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  DoubleQTQueryPipe(double *_content, QTDialog *_dialog);
+  ~DoubleQTQueryPipe();
+
+public slots:
+  void update(double);
+
+private:
+  double *content;
+  QTDialog *dialog;
+
+};
+
+class MoleculeQTQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  MoleculeQTQueryPipe(molecule **_content, QTDialog *_dialog, QComboBox *_theBox, MoleculeListClass *_molecules);
+  ~MoleculeQTQueryPipe();
+
+public slots:
+  void update(int);
+
+private:
+  molecule **content;
+  MoleculeListClass *molecules;
+  QTDialog *dialog;
+  QComboBox *theBox;
+
+};
+#endif /* QTDIALOG_HPP_ */
Index: src/UIElements/QT4/QTMainWindow.cpp
===================================================================
--- src/UIElements/QT4/QTMainWindow.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ src/UIElements/QT4/QTMainWindow.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,61 @@
+/*
+ * QTMainWindow.cpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#include "QTMainWindow.hpp"
+
+#include<Qt/qapplication.h>
+#include<Qt/qlabel.h>
+#include<Qt/qstring.h>
+#include<Qt/qmenubar.h>
+#include<Qt/qsplitter.h>
+
+#include<iostream>
+#include<boost/bind.hpp>
+
+#include "atom.hpp"
+#include "molecule.hpp"
+#include "Menu/QT4/QTMenu.hpp"
+#include "Views/QT4/QTMoleculesView.hpp"
+#include "Views/QT4/GLMoleculeView.hpp"
+
+
+using namespace std;
+
+QTMainWindow::QTMainWindow(menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName,QApplication *_theApp) :
+    theApp(_theApp)
+{
+  QSplitter *splitter1 = new QSplitter (Qt::Horizontal, this );
+  QSplitter *splitter2 = new QSplitter (Qt::Vertical, splitter1 );
+
+  moleculeDisplay = new QTMoleculesView(molecules,splitter2);
+
+  QLabel *pseudo1 = new QLabel(QString("Here be dragons"));
+  molecule3dDisplay = new GLMoleculeView();
+
+  setCentralWidget(splitter1);
+  splitter1->addWidget(splitter2);
+  splitter1->addWidget(pseudo1);
+  splitter2->addWidget(molecule3dDisplay);
+  splitter2->addWidget(moleculeDisplay);
+
+
+
+
+  editMoleculesMenu = new QTMenu("Edit Molecules");
+  populaters.MakeEditMoleculesMenu(editMoleculesMenu,molecules,configuration,periode);
+  menuBar()->addMenu(editMoleculesMenu);
+}
+
+QTMainWindow::~QTMainWindow()
+{
+  // TODO Auto-generated destructor stub
+}
+
+void QTMainWindow::display() {
+  this->show();
+  theApp->exec();
+}
Index: src/UIElements/QT4/QTMainWindow.hpp
===================================================================
--- src/UIElements/QT4/QTMainWindow.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ src/UIElements/QT4/QTMainWindow.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,39 @@
+/*
+ * QTMainWindow.hpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTMAINWINDOW_HPP_
+#define QTMAINWINDOW_HPP_
+
+#include "UIElements/MainWindow.hpp"
+#include <QtGui/QMainWindow>
+
+class QTMoleculesView;
+class StringView;
+class QTMenu;
+class GLMoleculeView;
+
+class QTMainWindow : public QMainWindow, public MainWindow
+{
+  Q_OBJECT
+
+public:
+  QTMainWindow(menuPopulaters populaters,MoleculeListClass *molecules, config *configuration,
+               periodentafel *periode, char *ConfigFileName, QApplication *_theApp);
+  virtual ~QTMainWindow();
+
+  virtual void display();
+
+private:
+  // All kinds of QTStuff used in this window
+  QApplication *theApp;
+  QTMoleculesView *moleculeDisplay;
+  QTMenu *editMoleculesMenu;
+  GLMoleculeView *molecule3dDisplay;
+
+};
+
+#endif /* QTMAINWINDOW_HPP_ */
Index: src/UIElements/QT4/QTUIFactory.cpp
===================================================================
--- src/UIElements/QT4/QTUIFactory.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ src/UIElements/QT4/QTUIFactory.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,44 @@
+/*
+ * QTUIFactory.cpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#include <iostream>
+#include <cassert>
+
+using namespace std;
+
+#include <qapplication.h>
+
+#include "UIElements/QT4/QTUIFactory.hpp"
+#include "UIElements/QT4/QTMainWindow.hpp"
+#include "UIElements/QT4/QTDialog.hpp"
+#include "defs.hpp"
+
+QTUIFactory::QTUIFactory()
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+QTUIFactory::~QTUIFactory()
+{
+  // TODO Auto-generated destructor stub
+}
+
+Dialog* QTUIFactory::makeDialog() {
+  return new QTDialog();
+}
+
+MainWindow* QTUIFactory::makeMainWindow(menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName) {
+  // For now we just fake the command line parameters to make QT happy
+  int argc=1;
+  char **argv;
+  argv = new char*[1];
+  argv[0] = new char[64];
+  strcpy(argv[0],MOLECUILDER_NAME);
+  app = new QApplication(argc,argv);
+  return new QTMainWindow(populaters,molecules,configuration,periode,ConfigFileName,app);
+}
Index: src/UIElements/QT4/QTUIFactory.hpp
===================================================================
--- src/UIElements/QT4/QTUIFactory.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ src/UIElements/QT4/QTUIFactory.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,32 @@
+/*
+ * QTUIFactory.hpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTUIFACTORY_HPP_
+#define QTUIFACTORY_HPP_
+
+#include "UIElements/UIFactory.hpp"
+
+class QApplication;
+
+class QTUIFactory : public UIFactory
+{
+  friend class UIFactory;
+
+public:
+  virtual ~QTUIFactory();
+
+  virtual Dialog* makeDialog();
+  virtual MainWindow* makeMainWindow(menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *);
+
+protected:
+  QTUIFactory();
+
+private:
+  QApplication *app;
+};
+
+#endif /* QTUIFACTORY_HPP_ */
Index: src/UIElements/TextDialog.cpp
===================================================================
--- src/UIElements/TextDialog.cpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ src/UIElements/TextDialog.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -114,3 +114,4 @@
 bool TextDialog::VectorTextQuery::handle() {
  tmp->AskPosition(cellSize,check);
+ return true;
 }
Index: src/UIElements/TextUIFactory.hpp
===================================================================
--- src/UIElements/TextUIFactory.hpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ src/UIElements/TextUIFactory.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -13,5 +13,5 @@
 class TextUIFactory : public UIFactory
 {
-friend class UIFactory;
+  friend class UIFactory;
 
 public:
Index: src/UIElements/UIFactory.cpp
===================================================================
--- src/UIElements/UIFactory.cpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ src/UIElements/UIFactory.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -12,4 +12,7 @@
 // all factories that can be used:
 #include "UIElements/TextUIFactory.hpp"
+#ifdef USE_GUI_QT
+#include "UIElements/QT4/QTUIFactory.hpp"
+#endif
 
 UIFactory *UIFactory::theFactory = 0;
@@ -32,5 +35,9 @@
       theFactory = new TextUIFactory();
       break;
-
+#ifdef USE_GUI_QT
+    case QT4 :
+      theFactory = new QTUIFactory();
+      break;
+#endif
     default:
       assert(0 && "No such Factory in stock");
Index: src/UIElements/UIFactory.hpp
===================================================================
--- src/UIElements/UIFactory.hpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ src/UIElements/UIFactory.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -22,5 +22,10 @@
 
 public:
-  enum InterfaceTypes {Text};
+  enum InterfaceTypes {
+    Text,
+#ifdef USE_GUI_QT
+    QT4
+#endif
+};
   virtual ~UIFactory();
 
Index: src/Views/QT4/GLMoleculeView.cpp
===================================================================
--- src/Views/QT4/GLMoleculeView.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ src/Views/QT4/GLMoleculeView.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,15 @@
+/*
+ * GLMoleculeView.cpp
+ *
+ *  Created on: Jan 26, 2010
+ *      Author: crueger
+ */
+
+#include "GLMoleculeView.hpp"
+
+GLMoleculeView::GLMoleculeView(QWidget *parent) :
+  QGLWidget(parent)
+{}
+
+GLMoleculeView::~GLMoleculeView()
+{}
Index: src/Views/QT4/GLMoleculeView.hpp
===================================================================
--- src/Views/QT4/GLMoleculeView.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ src/Views/QT4/GLMoleculeView.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,21 @@
+/*
+ * GLMoleculeView.hpp
+ *
+ *  Created on: Jan 26, 2010
+ *      Author: crueger
+ */
+
+#ifndef GLMOLECULEVIEW_HPP_
+#define GLMOLECULEVIEW_HPP_
+
+#include <QtOpenGL/QGLWidget>
+
+class GLMoleculeView :  public QGLWidget
+{
+  Q_OBJECT
+public:
+  GLMoleculeView(QWidget *parent=0);
+  virtual ~GLMoleculeView();
+};
+
+#endif /* GLMOLECULEVIEW_HPP_ */
Index: src/Views/QT4/QTMoleculesView.cpp
===================================================================
--- src/Views/QT4/QTMoleculesView.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ src/Views/QT4/QTMoleculesView.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,100 @@
+/*
+ * QTMoleculesView.cpp
+ *
+ *  Created on: Jan 21, 2010
+ *      Author: crueger
+ */
+
+#include "Views/QT4/QTMoleculesView.hpp"
+
+#include <iostream>
+
+#include "atom.hpp"
+#include "molecule.hpp"
+
+using namespace std;
+
+// maybe this should go with the definition of molecules
+
+// some attributes need to be easier to find for molecules
+// these attributes are skiped so far
+const int QTMoleculesView::COLUMNCOUNT = COLUMNTYPES_MAX;
+const char *QTMoleculesView::COLUMNNAMES[QTMoleculesView::COLUMNCOUNT]={"Name","Atoms"/*,"Formula"*/,"Center"/*,"Size"*/};
+
+QTMoleculesView::QTMoleculesView(MoleculeListClass *_molecules,QWidget * _parent) :
+  QTableWidget (_parent),
+  molecules(_molecules)
+{
+  setRowCount(0);
+  setColumnCount(COLUMNCOUNT);
+
+  for(int i=0; i<COLUMNCOUNT;++i) {
+    QTableWidgetItem *heading = new QTableWidgetItem();
+    heading->setText(QString(COLUMNNAMES[i]));
+    setHorizontalHeaderItem(i,heading);
+  }
+
+  molecules->signOn(this);
+  update(molecules);
+
+  connect(this,SIGNAL(cellChanged(int,int)),this,SLOT(moleculeChanged(int,int)));
+
+}
+
+QTMoleculesView::~QTMoleculesView()
+{
+  molecules->signOff(this);
+}
+
+void QTMoleculesView::update(Observable *publisher) {
+  int numMolecules = molecules->ListOfMolecules.size();
+  setRowCount(numMolecules);
+  int i;
+  MoleculeList::iterator iter;
+  for(iter = molecules->ListOfMolecules.begin(),i=0;
+      iter != molecules->ListOfMolecules.end();
+      ++i,++iter) {
+    const int index = (*iter)->IndexNr;
+    QTableWidgetItem *indexWidget = new QTableWidgetItem();
+    // there probably is an easier method to convert ints to QStrings... but i didn't find it
+    stringstream idxsstr;
+    idxsstr << index;
+    indexWidget->setText(QString(idxsstr.str().c_str()));
+    indexWidget->setData(Qt::UserRole,QVariant(index));
+    setVerticalHeaderItem(i,indexWidget);
+    const string name = (*iter)->getName();
+    QTableWidgetItem *nameWidget = new QTableWidgetItem();
+    nameWidget->setText(QString(name.c_str()));
+    setItem(i,NAME,nameWidget);
+    const int atomCount = (*iter)->AtomCount;
+    QTableWidgetItem *countWidget= new QTableWidgetItem();
+    stringstream countsstr;
+    countsstr << atomCount;
+    countWidget->setText(QString(countsstr.str().c_str()));
+    countWidget->setFlags(Qt::ItemIsEnabled);
+    setItem(i,ATOMS,countWidget);
+    const Vector center = (*iter)->Center;
+    QTableWidgetItem *centerWidget = new QTableWidgetItem();
+    stringstream centersstr;
+    centersstr << center;
+    centerWidget->setText(QString(centersstr.str().c_str()));
+    setItem(i,CENTER,centerWidget);
+    centerWidget->setFlags(Qt::ItemIsEnabled);
+  }
+}
+
+void QTMoleculesView::subjectKilled(Observable *publisher) {
+}
+
+void QTMoleculesView::moleculeChanged(int row, int column) {
+  int idx = verticalHeaderItem(row)->data(Qt::UserRole).toInt();
+  molecule *mol =molecules->ReturnIndex(idx);
+  string cellValue = item(row,NAME)->text().toStdString();
+  if(mol->getName() != cellValue && cellValue !="") {
+    mol->setName(cellValue);
+  }
+  else if(cellValue==""){
+    item(row,NAME)->setText(QString(mol->getName().c_str()));
+  }
+}
+
Index: src/Views/QT4/QTMoleculesView.hpp
===================================================================
--- src/Views/QT4/QTMoleculesView.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
+++ src/Views/QT4/QTMoleculesView.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -0,0 +1,39 @@
+/*
+ * QTMoleculesView.hpp
+ *
+ *  Created on: Jan 21, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTMOLECULESVIEW_HPP_
+#define QTMOLECULESVIEW_HPP_
+
+#include <QtGui/QTableWidget>
+#include "Patterns/Observer.hpp"
+
+class MoleculeListClass;
+
+class QTMoleculesView : public QTableWidget, public Observer
+{
+  Q_OBJECT
+
+public:
+  QTMoleculesView(MoleculeListClass *_molecules,QWidget * _parent=0);
+  virtual ~QTMoleculesView();
+
+protected:
+  virtual void update(Observable *publisher);
+  virtual void subjectKilled(Observable *publisher);
+
+  static const int COLUMNCOUNT;
+  enum {NAME,ATOMS,CENTER,COLUMNTYPES_MAX} COLUMNTYPES;
+  static const char *COLUMNNAMES[];
+
+private slots:
+  void moleculeChanged(int row, int column);
+
+private:
+  MoleculeListClass *molecules;
+};
+
+#endif /* QTMOLECULESVIEW_HPP_ */
Index: src/builder.cpp
===================================================================
--- src/builder.cpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ src/builder.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -450,4 +450,5 @@
   mol->Mirror((const Vector *)&n);
 };
+>>>>>>> MenuRefactoring:molecuilder/src/builder.cpp
 
 /** Submenu for removing the atoms from the molecule.
@@ -2159,4 +2160,5 @@
   Action *eraseMoleculeAction = new MethodAction("eraseMoleculeAction",boost::bind(&MoleculeListClass::eraseMolecule,molecules));
   new ActionMenuItem('r',"remove a molecule",editMoleculesMenu,eraseMoleculeAction);
+
 }
 
@@ -2217,7 +2219,12 @@
       populaters.MakeEditMoleculesMenu = populateEditMoleculesMenu;
 
+#ifdef USE_GUI_QT
+      UIFactory::makeUserInterface(UIFactory::QT4);
+#else
       UIFactory::makeUserInterface(UIFactory::Text);
+#endif
       MainWindow *mainWindow = UIFactory::get()->makeMainWindow(populaters,molecules, configuration, periode, ConfigFileName);
       mainWindow->display();
+
       delete mainWindow;
     }
Index: src/defs.hpp
===================================================================
--- src/defs.hpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ src/defs.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -81,3 +81,5 @@
 #define STD_SEPERATOR_SPACER '-'
 
+#define MOLECUILDER_NAME "Molecuilder"
+
 #endif /*DEFS_HPP_*/
Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ src/unittests/Makefile.am	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -4,5 +4,6 @@
 AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
 
-MENUTESTS = ActionSequenceTest
+MENUTESTS = ActionSequenceTest 
+
 
 TESTS = \
@@ -28,6 +29,6 @@
   VectorUnitTest \
   ObserverTest \
-  ${MENUTESTS}  
-    
+  ${MENUTESTS}
+
   
 check_PROGRAMS = $(TESTS) 
@@ -95,5 +96,5 @@
 
 ActionSequenceTest_SOURCES = ActionSequenceTest.cpp ActionSequenceTest.hpp
-ActionSequenceTest_LDADD = ../libmolecuilder.a
+ActionSequenceTest_LDADD = ../libmolecuilder.a ../libmenu.a
 
 ObserverTest_SOURCES = ObserverTest.cpp ObserverTest.hpp
Index: src/vector.cpp
===================================================================
--- src/vector.cpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ src/vector.cpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -20,4 +20,6 @@
 #include <gsl/gsl_permutation.h>
 #include <gsl/gsl_vector.h>
+
+#include <cassert>
 
 /************************************ Functions for class vector ************************************/
@@ -666,4 +668,9 @@
   CopyVector(src);
   return *this;
+}
+
+double& Vector::operator[](int i){
+  assert(i<NDIM && "Invalid Vector dimension requested");
+  return x[i];
 }
 
Index: src/vector.hpp
===================================================================
--- src/vector.hpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
+++ src/vector.hpp	(revision 7ba32480c6ee485679ff404928821f626f604ed1)
@@ -81,4 +81,5 @@
 
   Vector& operator=(const Vector &src);
+  double& operator[](int i);
 
 };
