#!/usr/bin/env python

from nanotechsoftware.base import *
from nanotechsoftware.chemistry import *
from nanotechsoftware.chemistry.framework import *
from nanotechsoftware.chemistry.core import *

import os



c = StaticAtom()
c.setElement(getElements().fetchElement("C"))

h1 = StaticAtom()
h1.setElement(getElements().fetchElement("H"))

h2 = StaticAtom()
h2.setElement(getElements().fetchElement("H"))

h3 = StaticAtom()
h3.setElement(getElements().fetchElement("H"))

h4 = StaticAtom()
h4.setElement(getElements().fetchElement("H"))

h1.setPosition(Vector3( 0.0000,        0.0000,       -1.0836))
h2.setPosition(Vector3( 0.0000,        1.0216,        0.3612)) 
h3.setPosition(Vector3( 0.8848,       -0.5108,        0.3612)) 
h4.setPosition(Vector3(-0.8848,       -0.5108,        0.3612)) 

mol = Molecule()

mol.insert(c)
mol.insert(h1)
mol.insert(h2)
mol.insert(h3)
mol.insert(h4)

b1 = Bond(c, h1)
b2 = Bond(c, h2)
b3 = Bond(c, h3)
b4 = Bond(c, h4)

print mol.countAtoms()
print c.countBonds()
print h1.countBonds()
print h2.countBonds()
print h3.countBonds()
print h4.countBonds()

vec = c.getPosition() - h1.getPosition()

print vec.norm()


