diff options
author | don bright <hugh.m.bright@gmail.com> | 2011-10-10 23:01:51 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2011-10-10 23:01:51 (GMT) |
commit | a1c698f422fceeadcf50e2ad456d5e43a01c8feb (patch) | |
tree | 5b21483b358f6fc1905f865f7c29f3228cc4c4a6 /tests/cgalpngtest.cc | |
parent | 6251fc326842b657feb4926c9a4fbb51f152248c (diff) |
enable build of cgalpngtest under windowsXP
Diffstat (limited to 'tests/cgalpngtest.cc')
-rw-r--r-- | tests/cgalpngtest.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/cgalpngtest.cc b/tests/cgalpngtest.cc index 447df45..fee44e8 100644 --- a/tests/cgalpngtest.cc +++ b/tests/cgalpngtest.cc @@ -23,6 +23,10 @@ * */ +#ifdef _MSC_VER +#define EIGEN_DONT_ALIGN +#endif + #include "myqhash.h" #include "openscad.h" #include "node.h" @@ -47,7 +51,9 @@ #include <QDir> #include <QSet> #include <QTextStream> +#ifndef _MSC_VER #include <getopt.h> +#endif #include <iostream> #include <assert.h> #include <sstream> @@ -182,7 +188,7 @@ int main(int argc, char **argv) try { csgInfo.glview = new OffscreenView(512,512); } catch (int error) { - fprintf(stderr,"Can't create OpenGL OffscreenView. exiting.\n"); + fprintf(stderr,"Can't create OpenGL OffscreenView. Code: %i. Exiting.\n", error); exit(1); } @@ -211,19 +217,21 @@ int main(int argc, char **argv) CGALRenderer cgalRenderer(N); - BoundingBox bbox; +/* Eigen::AlignedBox<double, 3> bbox; if (cgalRenderer.polyhedron) { CGAL::Bbox_3 cgalbbox = cgalRenderer.polyhedron->bbox(); bbox = BoundingBox(Vector3d(cgalbbox.xmin(), cgalbbox.ymin(), cgalbbox.zmin()), - Vector3d(cgalbbox.xmax(), cgalbbox.ymax(), cgalbbox.zmax())); + Vector3d(cgalbbox.xmax(), cgalbbox.ymax(), cgalbbox.zmax())); } else if (cgalRenderer.polyset) { bbox = cgalRenderer.polyset->getBoundingBox(); } + Vector3d center = (bbox.min() + bbox.max()) / 2; double radius = (bbox.max() - bbox.min()).norm() / 2; - - +*/ + Vector3d center(0,0,0); + double radius = 5.0; Vector3d cameradir(1, 1, -0.5); Vector3d camerapos = center - radius*2*cameradir; csgInfo.glview->setCamera(camerapos, center); |