00001 /* 00002 Test out Mgc volume computation routines. 00003 Orion Sky Lawlor, olawlor@acm.org, 2004/7/23 00004 */ 00005 #include <stdio.h> 00006 #include <stdlib.h> 00007 #include "cg3d.h" 00008 #include "MgcIntr3DTetrTetr.h" 00009 using namespace cg3d; 00010 00011 double test_vol_mgc(const PointSet3d *ps,const Tet3d &A,const Tet3d &B) 00012 { 00013 Mgc::Tetrahedron kT0,kT1; 00014 for(int i=0;i<4;i++){ 00015 CkVector3d pts0 = ps->getPoint(A.getPointIndex(i)); 00016 kT0[i] = Mgc::Vector3((double)pts0.x,(double)pts0.y,(double)pts0.z); 00017 CkVector3d pts1 = ps->getPoint(B.getPointIndex(i)); 00018 kT1[i] = Mgc::Vector3((double)pts1.x,(double)pts1.y,(double)pts1.z); 00019 } 00020 Mgc::TetrahedronVolumeConsumer vol; 00021 Mgc::FindIntersection(kT0,kT1,vol); 00022 return vol; 00023 } 00024