Index: coreInterface/CMakeLists.txt
===================================================================
--- coreInterface/CMakeLists.txt	(revision 63776)
+++ coreInterface/CMakeLists.txt	(working copy)
@@ -39,6 +39,8 @@
 set (ciTests_SRC
 	halfspace.cpp
 	primitives.cpp
+	Sphere.cpp
+	Cone.cpp
 )
 
 add_executable(tester_ci_primitives ${ciTests_SRC})
Index: coreInterface/Cone.cpp
===================================================================
--- coreInterface/Cone.cpp	(revision 0)
+++ coreInterface/Cone.cpp	(working copy)
@@ -0,0 +1,370 @@
+/*                      C O N E . C P P
+ * BRL-CAD
+ *
+ * Copyright (c) 2014 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/** @file Cone.cpp
+ *
+ *  BRL-CAD core C++ interface:
+ *      truncated general cone (ID_TGC) database object implementation
+ *
+ *  Origin -
+ *      TNO (Netherlands)
+ *      IABG mbH (Germany)
+ */
+
+#include <brlcad/Cone.h>
+using namespace BRLCAD;
+
+/* Tests Cone's BasePoint function */
+static int testConeBasePoint(BRLCAD::Cone c, double expectedX, double expectedY, double expectedZ)
+{
+	if(c.BasePoint().coordinates[0]==expectedX &&
+           c.BasePoint().coordinates[1]==expectedY &&
+           c.BasePoint().coordinates[2]==expectedZ) return 0;
+	return 1;
+}
+
+/* Tests Cone's SetBasePoint function */
+static int testConeSetBasePoint(BRLCAD::Cone c, Vector3D bp)
+{
+	c.SetBasePoint(bp);
+	if(bp.coordinates[0]==c.BasePoint().coordinates[0] &&
+	   bp.coordinates[1]==c.BasePoint().coordinates[1] &&
+	   bp.coordinates[2]==c.BasePoint().coordinates[2]) return 0;
+	return 1;
+}
+
+/* Tests Cone's Height function */
+static int testConeHeight(BRLCAD::Cone c, double expectedX, double expectedY, double expectedZ)
+{
+	if(c.Height().coordinates[0]==expectedX &&
+	   c.Height().coordinates[1]==expectedY &&
+	   c.Height().coordinates[2]==expectedZ) return 0;
+	return 1;
+}
+
+/* Tests Cone's SetHeight function */
+static int testConeSetBasePoint(BRLCAD::Cone c, Vector3D h)
+{
+	c.SetHeight(h);
+	if(h.coordinates[0]==c.Height().coordinates[0] &&
+	   h.coordinates[1]==c.Height().coordinates[1] &&
+	   h.coordinates[2]==c.Height().coordinates[2]) return 0;
+	return 1;
+}
+
+/* Tests Cone's SemiPrincipalAxis function */
+static int testConeSemiPrincipalAxis(BRLCAD::Cone c, Vector3D expectedResult, size_t index)
+{
+	if(c.SemiPrincipalAxis().coordinates[0]==expectedResult.coordinates[0] &&
+	   c.SemiPrincipalAxis().coordinates[1]==expectedResult.coordinates[1] &&
+           c.SemiPrincipalAxis().coordinates[2]==expectedResult.coordinates[2] &&
+	   c.SemiPrincipalAxis().index==index) return 0;
+	return 1;
+}
+
+/* Tests Cone's SetSemiPrincipalAxis function */
+static int testConeSetSemiPrincipalAxis(BRLCAD::Cone c, size_t index, Vector3D spa)
+{
+	c.SetSemiPrincipalAxis(index,spa);
+	if(spa.coordinates[0]==c.SemiPrincipalAxis().coordinates[0] &&
+	   spa.coordinates[1]==c.SemiPrincipalAxis().coordinates[1] &&
+	   spa.coordinates[2]==c.SemiPrincipalAXis().coordinates[2]) return 0;
+	return 1;
+}
+
+/* Tests Cone's Set of a right elliptical cylinder (rec) */
+static int testConeSetREC(BRLCAD::Cone rec, Vector3D bp, Vector3D h, Vector3D spaA, Vector3D spaB)
+{
+	rec.Set(bp,h,spaA,spaB);
+	if(bp.coordinates[0]==c.BasePoint().coordinates[0] &&
+	   bp.coordinates[1]==c.BasePoint().coordinates[1] &&
+	   bp.coordinates[2]==c.BasePoint().coordinates[2] &&
+	   h.coordinates[0]==c.Height().coordinates[0] &&
+	   h.coordinates[1]==c.Height().coordinates[1] &&
+	   h.coordinates[2]==c.Height().coordinates[2] &&
+	   spaA.coordinates[0]==c.SemiPrincipalAxis().coordinates[0] &&
+	   spaA.coordinates[1]==c.SemiPrincipalAxis().coordinates[1] &&
+	   spaA.coordinates[2]==c.SemiPrincipalAxis().coordinates[2]) return 0;
+	return 1;
+}
+
+/* Tests Cone's Set of a truncated general cone (tgc) */
+static int testConeSetTGC(BRLCAD::Cone tgc, Vector3D bp, Vector3D h, Vector3D spaA, Vector3D spaB, double CtoA, double BtoD)
+{
+	tgc.Set(bp,h,spaA,spaB,CtoA,BtoD);
+        if(bp.coordinates[0]==tgc.BasePoint().coordinates[0] &&
+	   bp.coordinates[1]==tgc.BasePoint().coordinates[1] &&
+	   bp.coordinates[2]==tgc.BasePoint().coordinates[2] &&
+	   h.coordinates[0]==tgc.Height().coordinates[0] &&
+	   h.coordinates[1]==tgc.Height().coordinates[1] &&
+	   h.coordinates[2]==tgc.Height().coordinates[2] &&
+	   spaA.coordinates[0]==tgc.SemiPrincipalAxis().coordinates[0] &&
+	   spaA.coordinates[1]==tgc.SemiPrincipalAxis().coordinates[1] &&
+	   spaA.coordinates[2]==tgc.SemiPrincipalAxis().coordinates[2] &&
+           CtoA==tgc.ratioCtoA &&
+ 	   BtoD==tgc.ratioBtoD) return 0;
+	return 1;
+}
+
+/* Tests Cone's Set of a truncated elliptical cone (tec) */
+static int testConeSetTEC(BRLCAD::Cone tec, Vector3D bp, Vector3D h, Vector3D spaA, Vector3D spaB, double scale)
+{
+	tec.Set(bp,h,spaA,spaB,scale);
+	if(bp.coordinates[0]==tec.BasePoint().coordinates[0] &&
+	   bp.coordinates[1]==tec.BasePoint().coordinates[1] &&
+	   bp.coordinates[2]==tec.BasePoint().coordinates[2] &&
+	   h.coordinates[0]==tec.Height().coordinates[0] &&
+	   h.coordinates[1]==tec.Height().coordinates[1] &&
+	   h.coordinates[2]==tec.Height().coordinates[2] &&
+	   spaA.coordinates[0]==tec.SemiPrincipalAxis().coordinates[0] &&
+	   spaA.coordinates[1]==tec.SemiPrincipalAxis().coordinates[1] &&
+	   spaA.coordinates[2]==tec.SemiPrincipalAxis().coordinates[2] &&
+           scale==tec.scale) return 0;
+	return 1;
+}
+
+/* Tests Cone's Set of a truncated right cone (trc) */
+static int testConeSetTRC(BRLCAD::Cone trc, Vector3D bp, Vector3D h, double radiusBase, double radiusTop)
+{
+	trc.Set(bp,h,radiusBase,radiusTop);
+	if(bp.coordinates[0]==trc.BasePoint().coordinates[0] &&
+	   bp.coordinates[1]==trc.BasePoint().coordinates[1] &&
+	   bp.coordinates[2]==trc.BasePoint().coordinates[2] &&
+	   h.coordinates[0]==trc.Height().coordinates[0] &&
+	   h.coordinates[1]==trc.Height().coordinates[1] &&
+	   h.coordinates[2]==trc.Height().coordinates[2] &&
+	   radiusBase==trc.radiusBase &&
+	   radiusTop==trc.radiusTop) return 0;
+	return 1;
+}
+
+/* Tests Cone's Set of a right circular cylinder (rcc) */
+static int testConeSetRCC(BRLCAD::Cone rcc, Vector3D bp, Vector3D h, double radius)
+{
+	rcc.Set(bp,h,radius);
+	if(bp.coordinates[0]==rcc.BasePoint().coordinates[0] &&
+	   bp.coordinates[1]==rcc.BasePoint().coordinates[1] &&
+	   bp.coordinates[2]==rcc.BasePoint().coordinates[2] &&
+	   h.coordinates[0]==rcc.Height().coordinates[0] &&
+	   h.coordinates[1]==rcc.Height().coordinates[1] &&
+	   h.coordinates[2]==rcc.Height().coordinates[2] &&
+	   radius==trc.radius) return 0;
+	return 1;
+}
+
+/* Tests Cone's Clone of a right elliptical cylinder (rec) */
+static int testConeCloneREC(BRLCAD::Cone rec)
+{
+	BRLCAD::Cone c2;
+	c2=rec.Clone();
+	if(c2.BasePoint().coordinates[0]==rec.BasePoint().coordinates[0] &&
+	   c2.BasePoint().coordinates[1]==rec.BasePoint().coordinates[1] &&
+	   c2.BasePoint().coordinates[2]==rec.BasePoint().coordinates[2] &&
+	   c2.Height().coordinates[0]==rec.Height().coordinates[0] &&
+	   c2.Height().coordinates[1]==rec.Height().coordinates[1] &&
+	   c2.Height().coordinates[2]==rec.Height().coordinates[2] &&
+	   c2.SemiPrincipalAxis().coordinates[0]==rec.SemiPrincipalAxis().coordinates[0] &&
+	   c2.SemiPrincipalAxis().coordinates[1]==rec.SemiPrincipalAxis().coordinates[1] &&
+	   c2.SemiPrincipalAxis().coordinates[2]==rec.SemiPrincipalAxis().coordinates[2]) return 0;
+	return 1;
+}
+
+/* Tests Cone's Clone of a truncated general cone (tgc) */
+static int testConeCloneTGC(BRLCAD::Cone tgc)
+{
+	BRLCAD::Cone c2;
+        c2=tgc.Clone(); 
+        if(c2.BasePoint().coordinates[0]==tgc.BasePoint().coordinates[0] &&
+	   c2.BasePoint().coordinates[1]==tgc.BasePoint().coordinates[1] &&
+	   c2.BasePoint().coordinates[2]==tgc.BasePoint().coordinates[2] &&
+	   c2.Height().coordinates[0]==tgc.Height().coordinates[0] &&
+	   c2.Height().coordinates[1]==tgc.Height().coordinates[1] &&
+	   c2.Height().coordinates[2]==tgc.Height().coordinates[2] &&
+	   c2.SemiPrincipalAxis().coordinates[0]==tgc.SemiPrincipalAxis().coordinates[0] &&
+	   c2.SemiPrincipalAxis().coordinates[1]==tgc.SemiPrincipalAxis().coordinates[1] &&
+	   c2.SemiPrincipalAxis().coordinates[2]==tgc.SemiPrincipalAxis().coordinates[2] &&
+           c2.ratioCtoA==tgc.ratioCtoA &&
+ 	   c2.ratioBtoD==tgc.ratioBtoD) return 0;
+	return 1;
+}
+
+/* Tests Cone's Clone of a truncated elliptical cone (tec) */
+static int testConeCloneTEC(BRLCAD::Cone tec)
+{
+	BRLCAD::Cone c2;
+	c2=tec.Clone();
+	if(c2.BasePoint().coordinates[0]==tec.BasePoint().coordinates[0] &&
+	   c2.BasePoint().coordinates[1]==tec.BasePoint().coordinates[1] &&
+	   c2.BasePoint().coordinates[2]==tec.BasePoint().coordinates[2] &&
+	   c2.Height().coordinates[0]==tec.Height().coordinates[0] &&
+	   c2.Height().coordinates[1]==tec.Height().coordinates[1] &&
+	   c2.Height().coordinates[2]==tec.Height().coordinates[2] &&
+	   c2.SemiPrincipalAxis().coordinates[0]==tec.SemiPrincipalAxis().coordinates[0] &&
+	   c2.SemiPrincipalAxis().coordinates[1]==tec.SemiPrincipalAxis().coordinates[1] &&
+	   c2.SemiPrincipalAxis().coordinates[2]==tec.SemiPrincipalAxis().coordinates[2] &&
+           c2.scale==tec.scale) return 0;
+	return 1;
+}
+
+/* Tests Cone's Clone of a truncated right cone (trc) */
+static int testConeCloneTRC(BRLCAD::Cone trc)
+{
+	BRLCAD::Cone c2;
+	c2=trc.Clone();
+	if(c2.BasePoint().coordinates[0]==trc.BasePoint().coordinates[0] &&
+	   c2.BasePoint().coordinates[1]==trc.BasePoint().coordinates[1] &&
+	   c2.BasePoint().coordinates[2]==trc.BasePoint().coordinates[2] &&
+	   c2.Height().coordinates[0]==trc.Height().coordinates[0] &&
+	   c2.Height().coordinates[1]==trc.Height().coordinates[1] &&
+	   c2.Height().coordinates[2]==trc.Height().coordinates[2] &&
+	   c2.radiusBase==trc.radiusBase &&
+	   c2.radiusTop==trc.radiusTop) return 0;
+	return 1;
+}
+
+/* Tests Cone's Clone of a right circular cylinder (rcc) */
+static int testConeCloneRCC(BRLCAD::Cone rcc)
+{
+	BRLCAD::Cone c2;
+	c2=rcc.Clone();
+	if(c2.BasePoint().coordinates[0]==rcc.BasePoint().coordinates[0] &&
+	   c2.BasePoint().coordinates[1]==rcc.BasePoint().coordinates[1] &&
+	   c2.BasePoint().coordinates[2]==rcc.BasePoint().coordinates[2] &&
+	   c2.Height().coordinates[0]==rcc.Height().coordinates[0] &&
+	   c2.Height().coordinates[1]==rcc.Height().coordinates[1] &&
+	   c2.Height().coordinates[2]==rcc.Height().coordinates[2] &&
+	   c2.radius==trc.radius) return 0;
+	return 1;
+}
+
+/* Tests Cone's ClassName function */
+static int testConeClassName(BRLCAD::Cone c) 
+{
+	if(c.ClassName()=="Cone") return 0;
+	return 1;
+}
+
+/* Tests Cone's Type function */
+static int testConeType(BRLCAD::Cone c)
+{
+	if(c.Type()==c.ClassName()) return 0;
+	return 1;
+}
+
+/* Tests Cone's IsValid function */
+static int testConeIsValid(BRLCAD::Cone c) 
+{
+	if(c.IsValid()==true) return 0;
+	return 1;
+}
+/* We now run all the tests */
+void test_cone(BRLCAD::Database& database)
+{	
+
+	/* Initialize a Cone to test on, with BasePoint,Height and Radius */
+	BRLCAD::Cone c;
+	c.Set(Vector3D(1.0,1.0,1.0),Vector3D(1.0,1.0,1.0),10);
+
+	/* Initialize a boolean to see if one or more of the tests failed */
+	bool ok=0;
+	
+	/* Runs all the tests */
+	if( testConeIsValid(c)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : IsValid()";
+	}
+	if( testConeType(c)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : Type()";
+	}
+	if( testConeClassName(c)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : ClassName()";
+	}
+	if( testConeBasePoint(c,1.0,1.0,1.0)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : BasePoint()";
+	}
+	if( testConeHeight(c,1.0,1.0,1.0)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : Height()";
+	}
+	c.SetSemiPrincipalAxis(1,Vector3D(1.0,1.0,1.0));
+	if( testConeSemiPrincipalAxis(c,Vector3D(1.0,1.0,1.0),1)==1 )
+	{
+		ok=1;
+		std::cout<<"Test failed at function : SemiPrincipalAxis()";
+	}
+	if( testConeSetBasePoint(c, Vector3D(2.0,2.0,2.0)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : SetBasePoint()";
+	}
+	if( testConeSetHeight(c, Vector3D(2.0,2.0,2.0)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : SetHeight()";
+	}
+	if( testConeSetSemiPrincipalAxis(c, 2, Vector3D(2.0,2.0,2.0)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : SetSemiPrincipalAxis()";
+	}
+	if( testConeSetREC(c, Vector3D(1.0,1.0,1.0), Vector3D(1.0,1.0,1.0), Vector3D(1.0,1.0,1.0), Vector3D(1.0,1.0,1.0))==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : Set(), with a right elliptical cylinder";
+	} 
+	if( testConeSetTGC(c, Vector3D(1.0,1.0,1.0), Vector3D(1.0,1.0,1.0), Vector3D(1.0,1.0,1.0), Vector3D(1.0,1.0,1.0), 2, 4)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : Set(), with a truncated general cone";
+	}
+	if( testConeSetTEC(c, Vector3D(1.0,1.0,1.0), Vector3D(1.0,1.0,1.0), Vector3D(1.0,1.0,1.0), Vector3D(1.0,1.0,1.0), 2)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : Set(), with a truncated elliptical cone";
+	}
+	if( testConeSetTRC(c, Vector3D(1.0,1.0,1.0), Vector3D(1.0,1.0,1.0), 4, 2)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : Set(), with a truncated right cone";
+	}
+	if( testConeSetRCC(c, Vector3D(1.0,1.0,1.0), Vector3D(1.0,1.0,1.0), 4)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : Set(), with a right circular cylinder";
+	}
+	if( testConeCloneREC(c)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : Clone(), with a right elliptical cylinder";
+	}
+	if( testConeCloneTGC(c)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : Clone(), with a truncated general cone";
+	}
+	if( testConeCloneTEC(c)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : Clone(), with a truncated elliptical cone";
+	}
+	if( testConeCloneTRC(c)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : Clone(), with a truncated right cone";
+	}
+	if( testConeCloneRCC(c)==1 ){
+		ok=1;
+		std::cout<<"Test failed at function : Clone(), with a right circular cylinder";
+	}
+
+	/* We only add the cone to the database if it failed no tests */
+	if( ok==0 ) database.add(c); 
+}
Index: coreInterface/primitives.cpp
===================================================================
--- coreInterface/primitives.cpp	(revision 63776)
+++ coreInterface/primitives.cpp	(working copy)
@@ -47,6 +47,8 @@
 
 	    if (database.Load(argv[1])) {
 		test_halfspace(database);
+		test_sphere(database);
+	        test_cone(database);
 	    } else {
 		std::cout << "Could not load file: " << argv[1] << std::endln;
 		ret = 2;
Index: coreInterface/primitives.h
===================================================================
--- coreInterface/primitives.h	(revision 63776)
+++ coreInterface/primitives.h	(working copy)
@@ -30,6 +30,8 @@
 
 
 void test_halfspace(BRLCAD::Database& database);
+void test_sphere(BRLCAD::Database& database);
+void test_cone(BRLCAD::Database& database);
 
 
 #endif // PRIMITIVES_H
