Commit 949813b7 by Francois Gygi

simplified implementation


git-svn-id: http://qboxcode.org/svn/qb/trunk@1832 cba15fb0-1239-40c8-b417-11db7ca47a34
parent bc3c46e1
...@@ -44,19 +44,19 @@ class QboxOutputHandler(xml.sax.handler.ContentHandler): ...@@ -44,19 +44,19 @@ class QboxOutputHandler(xml.sax.handler.ContentHandler):
def endElement(self, name): def endElement(self, name):
if name == "atomset": if name == "atomset":
self.pos1 = self.buffer1.split() pos1 = self.buffer1.split()
self.pos2 = self.buffer2.split() pos2 = self.buffer2.split()
self.r1x = float(self.pos1[0]) r1x = float(pos1[0])
self.r1y = float(self.pos1[1]) r1y = float(pos1[1])
self.r1z = float(self.pos1[2]) r1z = float(pos1[2])
self.r2x = float(self.pos2[0]) r2x = float(pos2[0])
self.r2y = float(self.pos2[1]) r2y = float(pos2[1])
self.r2z = float(self.pos2[2]) r2z = float(pos2[2])
#print "r1: ",self.r1x,self.r1y,self.r1z #print "r1: ",self.r1x,self.r1y,self.r1z
#print "r2: ",self.r2x,self.r2y,self.r2z #print "r2: ",self.r2x,self.r2y,self.r2z
print '%.4f' % math.sqrt((self.r1x-self.r2x)**2+ print '%.4f' % math.sqrt((r1x-r2x)**2+
(self.r1y-self.r2y)**2+ (r1y-r2y)**2+
(self.r1z-self.r2z)**2) (r1z-r2z)**2)
elif name == "position": elif name == "position":
self.readPos1 = 0 self.readPos1 = 0
self.readPos2 = 0 self.readPos2 = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment