Index: realspace_modeling/geoshapespy/tests/Make.mm
===================================================================
--- realspace_modeling/geoshapespy/tests/Make.mm	(revision a778da591a2680b9cec2b94403f040cefd931b7f)
+++ realspace_modeling/geoshapespy/tests/Make.mm	(revision a778da591a2680b9cec2b94403f040cefd931b7f)
@@ -0,0 +1,59 @@
+# -*- Makefile -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+#
+# <LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+PROJECT = geoshapespy
+PACKAGE = tests
+
+PROJ_CLEAN += $(PROJ_CPPTESTS)
+
+PROJ_CXX_INCLUDES += ../../iqPy/libiqPy   \
+                     ../../iqPy/libiqPy/tnt \
+                     ../libgeoshapespy   \
+		     ../../pointsmodelpy/libpointsmodelpy
+
+PROJ_PYTESTS = 
+PROJ_CPPTESTS = testpoint
+
+PROJ_TESTS = $(PROJ_PYTESTS) $(PROJ_CPPTESTS)
+PROJ_LIBRARIES = -L$(BLD_LIBDIR) -lgeoshapespy -liqPy -lpointsmodelpy
+
+
+#--------------------------------------------------------------------------
+#
+
+all: $(PROJ_TESTS)
+
+test:
+	for test in $(PROJ_TESTS) ; do $${test}; done
+
+release: tidy
+	cvs release .
+
+update: clean
+	cvs update .
+
+#--------------------------------------------------------------------------
+#
+
+testshapes: testshapes.cc $(BLD_LIBDIR)/libgeoshapespy.$(EXT_SAR)
+	$(CXX) $(CXXFLAGS) $(LCXXFLAGS) -o $@ testshapes.cc $(PROJ_LIBRARIES)
+
+testpoint: testPoint.cc $(BLD_LIBDIR)/libgeoshapespy.$(EXT_SAR)
+	$(CXX) $(CXXFLAGS) $(LCXXFLAGS) -o $@ testPoint.cc $(PROJ_LIBRARIES)
+
+testtransformation:  testtransformation.cc $(BLD_LIBDIR)/libgeoshapespy.$(EXT_SAR)
+	$(CXX) $(CXXFLAGS) $(LCXXFLAGS) -o $@ testtransformation.cc $(PROJ_LIBRARIES)
+
+# version
+# $Id$
+
+# End of file
Index: realspace_modeling/geoshapespy/tests/testPoint.cc
===================================================================
--- realspace_modeling/geoshapespy/tests/testPoint.cc	(revision a778da591a2680b9cec2b94403f040cefd931b7f)
+++ realspace_modeling/geoshapespy/tests/testPoint.cc	(revision a778da591a2680b9cec2b94403f040cefd931b7f)
@@ -0,0 +1,40 @@
+#include <iostream>
+#include <vector>
+#include "Point3D.h"
+
+
+using namespace std;
+
+int main(){
+
+  cout << "test 1:initialize a point, set orientation, set center"
+       << " and perform transform" <<endl;
+  Point3D apoint(3,4,5);
+
+  vector<double> orient(3),center(3);
+  for (int i = 0; i!=3; ++i){
+    center[i] = 0;
+  }
+  orient[0]=10;
+  orient[1]=0;
+  orient[2]=30;
+
+  apoint.Transform(orient,center);
+
+  cout << apoint.getX() <<" "<<apoint.getY()<<" "<<apoint.getZ()<<endl;
+  cout << orient[0] <<" "<<orient[1]<<" "<<orient[2]<<endl;
+
+  cout << "test 2: initialize a point, and perform transformation \n"
+       << "through a rotation matrix and a translation" <<endl;
+
+  vector<double> rotmatrix(9,1);
+  for (size_t i = 0; i != rotmatrix.size(); ++i){
+    cout << rotmatrix[i] <<" ";
+  }
+
+  Point3D pp(1,1,1);
+  pp.TransformMatrix(rotmatrix, center);
+
+  cout << pp.getX() <<" "<<pp.getY()<<" "<<pp.getZ()<<endl;
+  return 0;
+}
Index: realspace_modeling/geoshapespy/tests/testorientation.cc
===================================================================
--- realspace_modeling/geoshapespy/tests/testorientation.cc	(revision a778da591a2680b9cec2b94403f040cefd931b7f)
+++ realspace_modeling/geoshapespy/tests/testorientation.cc	(revision a778da591a2680b9cec2b94403f040cefd931b7f)
@@ -0,0 +1,13 @@
+#include "sphere.h"
+#include <iostream>
+
+int main(){
+  Sphere sph1(10);
+  sph1.SetOrientation(10,20,30);
+  sph1.SetCenter(1,5,10);
+
+  vector<double> v1 = sph1.GetOrientation();
+  cout << v1[0] <<endl;
+
+  return 0;
+}
Index: realspace_modeling/geoshapespy/tests/testshapes.cc
===================================================================
--- realspace_modeling/geoshapespy/tests/testshapes.cc	(revision a778da591a2680b9cec2b94403f040cefd931b7f)
+++ realspace_modeling/geoshapespy/tests/testshapes.cc	(revision a778da591a2680b9cec2b94403f040cefd931b7f)
@@ -0,0 +1,171 @@
+#include <cassert>
+#include <iostream>
+#include <vector>
+#include "sphere.h"
+#include "cylinder.h"
+#include "hollow_sphere.h"
+#include "ellipsoid.h"
+#include "single_helix.h"
+#include "iq.h"
+
+using namespace std;
+
+void TestGetFormFactor_sphere() {
+  Sphere sphere(1.0);
+
+  IQ iq1(10,0.001, 0.3);
+  sphere.GetFormFactor(&iq1);
+
+  for (int i = 0; i< iq1.iq_data.dim1(); i++)
+    cout << iq1.iq_data[i][0]<< " " << iq1.iq_data[i][1] <<endl;
+}
+
+void TestGetShapeType_sphere() {
+  Sphere sphere;
+  //if (assert(sphere.GetShapeType() == SPHERE))
+  //  cout << " it is a sphere" << endl;
+  cout << sphere.GetShapeType() << endl;
+}
+
+void TestGetShapeType(GeoShape &gs){
+  cout <<gs.GetShapeType() << endl;
+}
+
+void TestGetVolume_sphere() {
+  Sphere s(1);
+  cout << "volume is " << s.GetVolume();
+}
+
+void TestGetAPoint_sphere(){
+  Sphere asphere(10);
+  cout << asphere.GetAPoint(1) << endl;
+}
+
+void TestGetFormFactor_HS(){
+
+  HollowSphere hs(10, 2);
+
+  IQ iq1(10, 0.001, 0.3);
+  hs.GetFormFactor(&iq1);
+
+  for (int i = 0; i< iq1.iq_data.dim1(); i++)
+    cout << iq1.iq_data[i][0]<< " " << iq1.iq_data[i][1] <<endl;
+
+
+}
+
+void TestGetShapeType_HS(){
+  HollowSphere hs1;
+  assert(hs1.GetShapeType() == HOLLOWSPHERE);
+}
+
+void TestIsInside_sphere(){
+  cout << "Testing IsInside(): ";
+  Sphere s1(10);
+  Point3D pp(20,30,30);
+  Point3D pp2(1,1,1);
+
+  cout << s1.IsInside(pp) <<" " << s1.IsInside(pp2) << " ";
+  cout << "Finished testing IsInside()" <<endl;
+}
+
+void TestCylinder(){
+  Cylinder c1(10,20);
+  Point3D p1 = c1.GetAPoint(1);
+  Point3D p4 = c1.GetAPoint(1);
+  cout << "Got two points inside the cylinder" << endl;
+  cout << "the distance is: " << p1.distanceToPoint(p4);
+  cout << p1 << endl;
+  cout << "is this point inside?:" << c1.IsInside(p1) << endl;
+  
+  Point3D p2(20,20,20);
+  cout << "this point should be outside:" << c1.IsInside(p2) <<endl;
+
+  c1.SetOrientation(10,10,10);
+  c1.SetCenter(20,20,20);
+
+  vector<double> ori;
+  ori.push_back(10);
+  ori.push_back(10);
+  ori.push_back(20);
+
+  vector<double> cen;
+  cen.push_back(20);
+  cen.push_back(20);
+  cen.push_back(20);
+
+  p1.Transform(ori,cen);
+  cout << "is the p1 still inside after orientation?" << c1.IsInside(p1) << endl;
+  cout << "p1 p2 distance: " <<p1.distanceToPoint(p4) << endl;
+
+  Point3D p3(0,0,0);
+  cout <<" this origin point should be outside after transformation:" << c1.IsInside(p3) <<endl;
+
+  Point3D pp1(6.8,-2.11,11);
+  cout <<"is pp1 inside? "<< c1.IsInside(pp1) << endl;
+
+}
+
+void TestEllipsoid(){
+  Ellipsoid e1(5,10,15);
+  cout << "generated an ellipsoid:"<<e1.GetRadiusX()<<" ";
+  cout <<e1.GetRadiusY()<<" " << e1.GetRadiusZ() << endl;
+  cout << "maximum radius is: " << e1.GetMaxRadius() << endl;
+  cout << "volume is : " << e1.GetVolume() << endl;
+  cout << "Get a point: " << e1.GetAPoint(1.0) << endl;
+
+  Point3D p1(1,2,3);
+  Point3D p2(6,11,16);
+  Point3D p3(100,100,100);
+  cout <<"is " << p1 << " inside? " << e1.IsInside(p1) << endl;
+  cout <<"is " << p2 << " inside? " << e1.IsInside(p2) << endl;
+
+  e1.SetCenter(10,10,10);
+  Point3D p4(11,12,13);
+  cout <<"is " << p2 << " inside after moved? " << e1.IsInside(p2) << endl;
+
+  e1.SetOrientation(90,90,90);
+  cout <<"is " << p3 << " inside after rotated? " << e1.IsInside(p3) << endl;
+
+}
+
+void TestSingleHelix(){
+
+  cout <<" Testing single helix" << endl;
+  SingleHelix sh(10,3,30,1);
+  cout << "Get a point" << sh.GetAPoint(1.0) << endl;  
+
+  Point3D p1(1,1,-50); //cannot be in sh(10,3,30,1)
+  cout <<"is " << p1 <<" inside?" << sh.IsInside(p1)<< endl;
+  Point3D p2(-3.15922, -11.6193, 20.5302); //should be inside
+  cout <<"is " << p2 <<" inside?" << sh.IsInside(p2)<< endl;
+
+}
+
+int main(){
+ 
+  //cout << "testing sphere :\n" ;
+  //TestGetAPoint_sphere();
+  //TestGetShapeType_sphere();
+  //testing getting shape type from parent
+  //Sphere ss(1);
+  //TestGetShapeType(ss);
+  //TestGetVolume_sphere();
+  //TestIsInside_sphere();
+
+  //cout << "testing hollowsphere: \n" ;	
+  //TestGetFormFactor_HS();
+  //TestGetShapeType_HS();
+  //  TestGetVolume();
+  
+  //cout << "testing cylinder:\n";
+  //TestCylinder();
+  
+  //cout << "testing ellipsoid :\n";
+  //TestEllipsoid();
+
+  TestSingleHelix();
+  printf("PASS.\n");
+
+  return 0;
+}
Index: realspace_modeling/geoshapespy/tests/testshapes.py
===================================================================
--- realspace_modeling/geoshapespy/tests/testshapes.py	(revision a778da591a2680b9cec2b94403f040cefd931b7f)
+++ realspace_modeling/geoshapespy/tests/testshapes.py	(revision a778da591a2680b9cec2b94403f040cefd931b7f)
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+# 
+#  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# 
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+# 
+#  <LicenseText>
+# 
+#  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# 
+
+if __name__ == "__main__":
+
+    from SANSsimulation import geoshapespy
+
+    print
+    print "module information:"
+    print "    file:", geoshapespy.__file__
+    print "    doc:", geoshapespy.__doc__
+    print "    contents:", dir(geoshapespy)
+
+    sp = geoshapespy.new_sphere(10)
+#    geoshapespy.set_orientation(sp,10,20,10)
+    cy = geoshapespy.new_cylinder(2,6)
+
+    el = geoshapespy.new_ellipsoid(25,15,10)
+
+    hs = geoshapespy.new_hollowsphere(10,2)
+
+    sh = geoshapespy.new_singlehelix(10,2,30,2)
+
+# version
+__id__ = "$Id$"
+
+#  End of file 
Index: realspace_modeling/geoshapespy/tests/testsphere.cc
===================================================================
--- realspace_modeling/geoshapespy/tests/testsphere.cc	(revision a778da591a2680b9cec2b94403f040cefd931b7f)
+++ realspace_modeling/geoshapespy/tests/testsphere.cc	(revision a778da591a2680b9cec2b94403f040cefd931b7f)
@@ -0,0 +1,36 @@
+#include <cassert>
+#include <iostream>
+#include "sphere.h"
+#include "iq.h"
+
+using namespace std;
+
+void TestGetAnalyticalIQ() {
+  Sphere sphere(1.0);
+
+  IQ iq1(10,0.001, 0.3);
+  sphere.GetFormFactor(&iq1);
+
+  for (int i = 0; i< iq1.iq_data.dim1(); i++)
+    cout << iq1.iq_data[i][0]<< " " << iq1.iq_data[i][1] <<endl;
+}
+
+void TestGetShapeType() {
+  Sphere sphere;
+  assert(sphere.GetShapeType() == SPHERE);
+}
+
+void TestGetVolume() {
+  Sphere s(1);
+  cout << "volume is " << s.GetVolume();
+}
+
+int main(){
+  TestGetAnalyticalIQ();
+  TestGetShapeType();
+  TestGetVolume();
+
+  printf("PASS.\n");
+
+  return 0;
+}
