@prerequisites
1. CMake (>=2.8.12.2)
- 3. Visualization Toolkit -VTK- (>=6.1.0)
- 3.1 Required cmake flags:
+ 2. Visualization Toolkit -VTK- (>=6.1.0)
+ 2.1 Required cmake flags:
BUILD_SHARED_LIBS:BOOL=ON
- 4. Insight Toolkit -ITK- (>=4.6.0)
- 4.1 Required cmake flags:
+ 3. Insight Toolkit -ITK- (>=4.6.0)
+ 3.1 Required cmake flags:
BUILD_SHARED_LIBS:BOOL=ON
Module_ITKVtkGlue:BOOL=ON
+ 4. WARNING: Notes on compilation on MS-Windows
+ As the time being (circa dec 2014), I've been using MSVC-2013
+ (compiler version 12). As expected, weird behavior is related to
+ this config. Please take into account the following in order to
+ have a successful compilation:
+ 4.1 If you want to build the Qt-based code, please be sure that
+ it was compiled with EXACTLY the same compiler you are using.
+ 4.2 Since the dll load-unload procedure in MSWin is kind of magic,
+ VTK should be compiled as shared libraries and ITK should be
+ compiled as static libraries. This allows a correct
+ execution of the SmartPointer's thus preventing anoying crashes.
+ 4.3 If you found more problems in any MSWin config, please let us know at
+ florez-l@javeriana.edu.co
+
+
@cmake_flags
BUILD_DEMOS:BOOL
Build example applications? (most of them are command line)
#include <QFileDialog>
#include <QMessageBox>
+#ifdef _WIN32
+# define PLUGIN_EXT "dll"
+# define PLUGIN_REGEX "Plugins file (*.dll);;All files (*)"
+#else
+# define PLUGIN_EXT "so"
+# define PLUGIN_REGEX "Plugins file (*.so);;All files (*)"
+#endif // _WIN32
+
// -------------------------------------------------------------------------
ImageMPR::ImageMPR( QWidget* parent )
: QMainWindow( parent ),
QFileDialog dialog( this );
dialog.setFileMode( QFileDialog::ExistingFile );
dialog.setDirectory( "." );
- dialog.setNameFilter(
- tr( "Plugins file (*.so);;All files (*)" )
- );
- dialog.setDefaultSuffix( tr( "so" ) );
+ dialog.setNameFilter( tr( PLUGIN_REGEX ) );
+ dialog.setDefaultSuffix( tr( PLUGIN_EXT ) );
if( !( dialog.exec( ) ) )
return;
#endif // _WIN32
-#ifdef _WIN32
-
-typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
-typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
-PFNWGLSWAPINTERVALEXTPROC pwglSwapIntervalEXT = 0;
-PFNWGLGETSWAPINTERVALEXTPROC pwglGetSwapIntervalEXT = 0;
-#define wglSwapIntervalEXT pwglSwapIntervalEXT
-#define wglGetSwapIntervalEXT pwglGetSwapIntervalEXT
-
-#endif // _WIN32
-
// some definitions for what the polydata has in it
#define CPPLUGINS_VTK_PDM_NORMALS 0x0001
#define CPPLUGINS_VTK_PDM_COLORS 0x0002
if( input == NULL )
return( false );
-#ifdef _WIN32
- // get pointers to GL functions
- glGenBuffers =
- ( PFNGLGENBUFFERSARBPROC )wglGetProcAddress( "glGenBuffers" );
- glBindBuffer =
- ( PFNGLBINDBUFFERARBPROC )wglGetProcAddress( "glBindBuffer" );
- glBufferData =
- ( PFNGLBUFFERDATAARBPROC )wglGetProcAddress( "glBufferData" );
- glBufferSubData =
- ( PFNGLBUFFERSUBDATAARBPROC )wglGetProcAddress( "glBufferSubData" );
- glDeleteBuffers =
- ( PFNGLDELETEBUFFERSARBPROC )wglGetProcAddress( "glDeleteBuffers" );
+#ifdef _WIN32
+ // Get pointers to GL functions
+ glGenBuffers = reinterpret_cast< PFNGLGENBUFFERSARBPROC >
+ ( wglGetProcAddress( "glGenBuffers" ) );
+ glBindBuffer = reinterpret_cast< PFNGLBINDBUFFERARBPROC >
+ ( wglGetProcAddress( "glBindBuffer" ) );
+ glBufferData = reinterpret_cast< PFNGLBUFFERDATAARBPROC >
+ ( wglGetProcAddress( "glBufferData" ) );
+ glBufferSubData = reinterpret_cast< PFNGLBUFFERSUBDATAARBPROC >
+ ( wglGetProcAddress( "glBufferSubData" ) );
+ glDeleteBuffers = reinterpret_cast< PFNGLDELETEBUFFERSARBPROC >
+ ( wglGetProcAddress( "glDeleteBuffers" ) );
glGetBufferParameteriv =
- ( PFNGLGETBUFFERPARAMETERIVARBPROC )wglGetProcAddress(
- "glGetBufferParameteriv"
- );
- glMapBuffer =
- ( PFNGLMAPBUFFERARBPROC )wglGetProcAddress( "glMapBuffer" );
- glUnmapBuffer =
- ( PFNGLUNMAPBUFFERARBPROC )wglGetProcAddress( "glUnmapBuffer" );
-
- // check once again VBO extension
+ reinterpret_cast< PFNGLGETBUFFERPARAMETERIVARBPROC >
+ ( wglGetProcAddress( "glGetBufferParameteriv" ) );
+ glMapBuffer = reinterpret_cast< PFNGLMAPBUFFERARBPROC >
+ ( wglGetProcAddress( "glMapBuffer" ) );
+ glUnmapBuffer = reinterpret_cast< PFNGLUNMAPBUFFERARBPROC >
+ ( wglGetProcAddress( "glUnmapBuffer" ) );
+
+ // Check once again VBO extension
if(
glGenBuffers != NULL &&
glBindBuffer != NULL &&
this->VBOSupported = true;
else
this->VBOSupported = false;
-
- // check EXT_swap_control is supported
- /* TODO: really needed?
- wglSwapIntervalEXT =
- ( PFNWGLSWAPINTERVALEXTPROC )wglGetProcAddress( "wglSwapIntervalEXT" );
- wglGetSwapIntervalEXT =
- ( PFNWGLGETSWAPINTERVALEXTPROC )wglGetProcAddress(
- "wglGetSwapIntervalEXT"
- );
- if( wglSwapIntervalEXT != NULL && wglGetSwapIntervalEXT != NULL )
- wglSwapIntervalEXT( 0 );
- */
#else // _WIN32
// Check if VBO ( Vertex Buffer Object ) is supported
std::string str = ( const char* )( glGetString( GL_EXTENSIONS ) );