summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2011-10-16 01:14:35 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2011-10-16 01:14:35 (GMT)
commit7332ec9fe260140ff74506fa2ba95e0a2bbf352e (patch)
treeab72752cc52e68d1ed77559cdd18d702ffc05b2c
parent7735f5510cdc2d396092d04ed98a2dbaec347608 (diff)
clean up linux changes to fit with win32 changes.
-rw-r--r--doc/testing.txt18
-rw-r--r--openscad.pro5
-rw-r--r--src/csgterm.cc20
-rw-r--r--src/csgterm.h1
-rw-r--r--src/mainwin.cc12
-rw-r--r--tests/CMakeLists.txt13
-rw-r--r--tests/OffscreenContext.cc2
-rw-r--r--tests/OffscreenContextWGL.cc9
-rw-r--r--tests/cgalpngtest.cc5
-rw-r--r--tests/csgtestcore.h5
-rw-r--r--tests/lodepng.h6
-rw-r--r--tests/yee_compare.h8
12 files changed, 44 insertions, 60 deletions
diff --git a/doc/testing.txt b/doc/testing.txt
index e265b96..c5fb243 100644
--- a/doc/testing.txt
+++ b/doc/testing.txt
@@ -10,10 +10,20 @@ cmake ..
make
make test
-Building on Windows:
-Follow http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Windows
-and build openscad, to verify your setup. Then, from the same command prompt,
-run the above commands, but use 'nmake -f Makefile' instead of make
+Windows:
+
+First, get a normal build working by following instructions at
+http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Windows
+Then, from the QT command prompt:
+
+cd tests
+mkdir build
+cd build
+cmake .. -DCMAKE_BUILD_TYPE=Release
+sed -i s/\/MD/\/MT/ CMakeCache.txt
+cmake ..
+nmake -f Makefile
+nmake -f Makefile test
Adding a new regression test:
------------------------------
diff --git a/openscad.pro b/openscad.pro
index bacb122..49553ad 100644
--- a/openscad.pro
+++ b/openscad.pro
@@ -14,7 +14,8 @@ win32 {
}
win32 {
- isEmpty(VERSION) VERSION = "2011.10.15"
+ isEmpty(VERSION) VERSION = $$system(date /t)
+ # isEmpty(VERSION) VERSION = "2011.10.15" # for XP, set version manually
} else {
isEmpty(VERSION) VERSION = $$system(date "+%Y.%m.%d")
}
@@ -53,7 +54,9 @@ win32:QMAKE_CXXFLAGS += -wd4800
#disable warning about CGAL's unreferenced formal parameters
win32:QMAKE_CXXFLAGS += -wd4100
+# disable Eigen SIMD optimizations for non-Mac OSX
win32:QMAKE_CXXFLAGS += -DEIGEN_DONT_ALIGN
+unix:QMAKE_CXXFLAGS += -DEIGEN_DONT_ALIGN
TEMPLATE = app
RESOURCES = openscad.qrc
diff --git a/src/csgterm.cc b/src/csgterm.cc
index c0eb2c8..16ef75f 100644
--- a/src/csgterm.cc
+++ b/src/csgterm.cc
@@ -227,26 +227,6 @@ std::string CSGChain::dump()
return dump.str();
}
-
-std::string CSGChain::fulldump()
-{
- std::stringstream dump;
- dump << "\nsizes: \n";
- dump << " polysets: " << polysets.size();
- dump << " matrices: " << matrices.size();
- dump << " colors: " << colors.size();
- dump << " types: " << types.size();
- dump << " labels: " << labels.size();
- dump << "\ndata: \n";
- for (size_t i = 0; i < polysets.size(); i++) dump << (*polysets[i]).polygons.size() << "\n";
- for (size_t i = 0; i < matrices.size(); i++) dump << matrices[i].matrix() << "\n";
- for (size_t i = 0; i < colors.size(); i++) dump << *colors[i] << "\n";
- for (size_t i = 0; i < types.size(); i++) dump << types[i] << "\n";
- for (size_t i = 0; i < labels.size(); i++) dump << labels[i] << "\n";
- dump << "\n";
- return dump.str();
-}
-
BoundingBox CSGChain::getBoundingBox() const
{
BoundingBox bbox;
diff --git a/src/csgterm.h b/src/csgterm.h
index b09b2d2..1d9d9fd 100644
--- a/src/csgterm.h
+++ b/src/csgterm.h
@@ -52,7 +52,6 @@ public:
void add(const shared_ptr<PolySet> &polyset, const Transform3d &m, double *color, CSGTerm::type_e type, std::string label);
void import(CSGTerm *term, CSGTerm::type_e type = CSGTerm::TYPE_UNION);
std::string dump();
- std::string fulldump();
BoundingBox getBoundingBox() const;
};
diff --git a/src/mainwin.cc b/src/mainwin.cc
index fafe8ed..dfa6f95 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -873,18 +873,6 @@ void MainWindow::compileCSG(bool procevents)
this->thrownTogetherRenderer = new ThrownTogetherRenderer(this->root_chain,
this->highlights_chain,
this->background_chain);
-
- fprintf(stderr, "Dump root chain\n");
- cerr << this->root_chain->fulldump();
- cerr << this->highlights_chain;
- cerr << this->background_chain;
-/* fprintf(stderr, "dump highlights\n");
- this->highlights_chain->dump();
- fprintf(stderr, "dump background\n");
- this->background_chain->dump();*/
- fprintf(stderr, "end dump\n");
-
-
PRINT("CSG generation finished.");
int s = t.elapsed() / 1000;
PRINTF("Total rendering time: %d hours, %d minutes, %d seconds", s / (60*60), (s / 60) % 60, s % 60);
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 593fa1b..35818de 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -27,11 +27,6 @@ if(WIN32_STATIC_BUILD)
endif()
endif()
-# Turn off Eigen SIMD optimization
-if(WIN32)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_DONT_ALIGN")
-endif()
-
# Disable warnings
if(WIN32)
# too long decorated names
@@ -53,8 +48,6 @@ if(WIN32)
# you have to pass -DCMAKE_VERBOSE_MAKEFILE=ON to cmake when you run it.
endif()
-# Compilation debugging
-
#
# Build test apps
@@ -71,6 +64,12 @@ find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL REQUIRED)
include(${QT_USE_FILE})
# Eigen2
+
+# Turn off Eigen SIMD optimization
+if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_DONT_ALIGN")
+endif()
+
if (NOT EIGEN2_INCLUDE_DIR)
find_path(EIGEN2_INCLUDE_DIR
Eigen/Core
diff --git a/tests/OffscreenContext.cc b/tests/OffscreenContext.cc
index f5eabe0..c50097f 100644
--- a/tests/OffscreenContext.cc
+++ b/tests/OffscreenContext.cc
@@ -197,7 +197,7 @@ OffscreenContext *create_offscreen_context(int w, int h)
}
// glewInit must come after Context creation and before FBO calls.
- glewInit();
+ GLenum err = glewInit();
if (GLEW_OK != err) {
fprintf(stderr, "Unable to init GLEW: %s\n", glewGetErrorString(err));
exit(1);
diff --git a/tests/OffscreenContextWGL.cc b/tests/OffscreenContextWGL.cc
index b4170d1..f120384 100644
--- a/tests/OffscreenContextWGL.cc
+++ b/tests/OffscreenContextWGL.cc
@@ -71,9 +71,6 @@ bool create_wgl_dummy_context(OffscreenContext &ctx)
// this function alters ctx->window and ctx->openGLContext
// and ctx->dev_context if successfull
- // stop Windows from producing dialog boxes about "this application has failed"
- SetErrorMode(SEM_NOGPFAULTERRORBOX|SEM_NOOPENFILEERRORBOX|SEM_FAILCRITICALERRORS);
-
// create window
HINSTANCE inst = GetModuleHandle(0);
@@ -84,7 +81,7 @@ bool create_wgl_dummy_context(OffscreenContext &ctx)
wc.hInstance = inst;
wc.lpszClassName = "OpenSCAD";
RegisterClass( &wc );
-
+
HWND window = CreateWindow( "OpenSCAD", "OpenSCAD",
WS_CAPTION | WS_POPUPWINDOW, //| WS_VISIBLE,
0, 0, ctx.width, ctx.height, NULL, NULL, inst, NULL );
@@ -133,7 +130,7 @@ bool create_wgl_dummy_context(OffscreenContext &ctx)
bool mcok = wglMakeCurrent( dev_context, gl_render_context );
if (!mcok) {
- cerr << "MS GDI - wglMakeCurrent failed\n";
+ cerr << "MS WGL - wglMakeCurrent failed\n";
return false;
}
@@ -154,7 +151,6 @@ OffscreenContext *create_offscreen_context(int w, int h)
// This call alters ctx->window and ctx->openGLContext
// and ctx->dev_context if successfull
if (!create_wgl_dummy_context( *ctx )) {
- cerr << "wgl dummy fail\n";
fflush(stderr);
return NULL;
}
@@ -169,7 +165,6 @@ OffscreenContext *create_offscreen_context(int w, int h)
ctx->fbo = fbo_new();
if (!fbo_init(ctx->fbo, w, h)) {
- cerr << "fbo didn't init\n";
return NULL;
}
diff --git a/tests/cgalpngtest.cc b/tests/cgalpngtest.cc
index c72bc30..7f505a6 100644
--- a/tests/cgalpngtest.cc
+++ b/tests/cgalpngtest.cc
@@ -222,9 +222,8 @@ int main(int argc, char **argv)
BoundingBox bbox;
if (cgalRenderer.polyhedron) {
CGAL::Bbox_3 cgalbbox = cgalRenderer.polyhedron->bbox();
- Vector3d min = Vector3d(cgalbbox.xmin(), cgalbbox.ymin(), cgalbbox.zmin());
- Vector3d max = Vector3d(cgalbbox.xmax(), cgalbbox.ymax(), cgalbbox.zmax());
- bbox = BoundingBox(min, max);
+ bbox = BoundingBox(Vector3d(cgalbbox.xmin(), cgalbbox.ymin(), cgalbbox.zmin()),
+ Vector3d(cgalbbox.xmax(), cgalbbox.ymax(), cgalbbox.zmax()));
} else if (cgalRenderer.polyset) {
bbox = cgalRenderer.polyset->getBoundingBox();
}
diff --git a/tests/csgtestcore.h b/tests/csgtestcore.h
index b988b21..330c894 100644
--- a/tests/csgtestcore.h
+++ b/tests/csgtestcore.h
@@ -1,3 +1,6 @@
+#ifndef CSGTESTCORE_H_
+#define CSGTESTCORE_H_
+
enum test_type_e {
TEST_THROWNTOGETHER,
TEST_OPENCSG
@@ -5,3 +8,5 @@ enum test_type_e {
int csgtestcore(int argc, char *argv[], test_type_e test_type);
+#endif
+
diff --git a/tests/lodepng.h b/tests/lodepng.h
index 64ec2e3..a0a654f 100644
--- a/tests/lodepng.h
+++ b/tests/lodepng.h
@@ -1,3 +1,6 @@
+#ifndef LODEPNG_H_
+#define LODEPNG_H_
+
/*
LodePNG version 20110908
@@ -1891,3 +1894,6 @@ Account: lode dot vandevenne.
Copyright (c) 2005-2011 Lode Vandevenne
*/
+
+#endif
+
diff --git a/tests/yee_compare.h b/tests/yee_compare.h
index 17b2e6f..041ae4c 100644
--- a/tests/yee_compare.h
+++ b/tests/yee_compare.h
@@ -1,4 +1,8 @@
+#ifndef _yee_compare_h
+#define _yee_compare_h
+
// source code modified for OpenSCAD, Sept 2011
+// original copyright notice follows:
/*
Metric
RGBAImage.h
@@ -18,9 +22,6 @@ You should have received a copy of the GNU General Public License along with thi
if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef _yee_compare_h
-#define _yee_compare_h
-
#include <string>
class RGBAImage;
@@ -123,4 +124,3 @@ protected:
};
#endif
-
contact: Jan Huwald // Impressum