summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-03-03 17:41:37 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-03-03 17:41:37 (GMT)
commitbacaa2b1b916f7672e2b971337232caef9cb22a2 (patch)
tree600980169762db7de33d29767fc0b7470000aeec /tests
parent2b2dc7a078e92193f0d27d901d3a1b4af9f5a1d9 (diff)
fix bugs in testing
Diffstat (limited to 'tests')
-rw-r--r--tests/cgalpngtest.cc11
-rw-r--r--tests/csgtestcore.cc13
2 files changed, 11 insertions, 13 deletions
diff --git a/tests/cgalpngtest.cc b/tests/cgalpngtest.cc
index a3532af..52205fd 100644
--- a/tests/cgalpngtest.cc
+++ b/tests/cgalpngtest.cc
@@ -156,15 +156,14 @@ int main(int argc, char **argv)
bbox = cgalRenderer.polyset->getBoundingBox();
}
- VectorCamera vc;
- vc.center = getBoundingCenter(bbox);
+ Camera cam(Camera::VECTOR);
+ cam.center = getBoundingCenter(bbox);
double radius = getBoundingRadius(bbox);
Vector3d cameradir(1, 1, -0.5);
- vc.eye = vc.center - radius*2*cameradir;
- csgInfo.glview->setCamera(vc);
-
-
+ cam.eye = cam.center - radius*2*cameradir;
+ csgInfo.glview->setCamera( cam );
+
csgInfo.glview->setRenderer(&cgalRenderer);
csgInfo.glview->paintGL();
csgInfo.glview->save(outfile);
diff --git a/tests/csgtestcore.cc b/tests/csgtestcore.cc
index 02ca0be..5820e44 100644
--- a/tests/csgtestcore.cc
+++ b/tests/csgtestcore.cc
@@ -167,8 +167,7 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type)
Tree tree(root_node);
CsgInfo csgInfo = CsgInfo();
- int result = csgInfo.prep_chains( tree );
- if ( result == 1 ) return result;
+ if ( !csgInfo.prep_chains( tree ) ) return 1;
fs::current_path(original_path);
@@ -180,18 +179,18 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type)
}
if (sysinfo_dump) cout << info_dump(csgInfo.glview);
- VectorCamera vc;
- vc.center << 0,0,0;
+ Camera camera(Camera::VECTOR);
+ camera.center << 0,0,0;
double radius = 1.0;
if (csgInfo.root_chain) {
BoundingBox bbox = csgInfo.root_chain->getBoundingBox();
- vc.center = (bbox.min() + bbox.max()) / 2;
+ camera.center = (bbox.min() + bbox.max()) / 2;
radius = (bbox.max() - bbox.min()).norm() / 2;
}
Vector3d cameradir(1, 1, -0.5);
- vc.eye = vc.center - radius*1.8*cameradir;
- csgInfo.glview->setCamera(vc);
+ camera.eye = camera.center - radius*1.8*cameradir;
+ csgInfo.glview->setCamera(camera);
OpenCSGRenderer opencsgRenderer(csgInfo.root_chain, csgInfo.highlights_chain, csgInfo.background_chain, csgInfo.glview->shaderinfo);
ThrownTogetherRenderer thrownTogetherRenderer(csgInfo.root_chain, csgInfo.highlights_chain, csgInfo.background_chain);
contact: Jan Huwald // Impressum