From 351f2e4ce6e3b11e77ba27998d41ff4310b806ad Mon Sep 17 00:00:00 2001 From: Leonardo Florez Valencia Date: Fri, 26 Dec 2014 12:14:33 +0100 Subject: [PATCH] First modifications to make this work on MS-Windows --- appli/ImageMPR/main.cxx | 2 +- .../DataStructures/QuadEdgeMesh.hxx | 15 ++++++------ .../Extensions/Visualization/MPRActors.cxx | 1 + .../Visualization/MPRWithDifferentWindows.h | 3 ++- lib/cpPlugins/Interface/Object.h | 23 +++++++++++++++++-- lib/cpPlugins/Plugins/CMakeLists.txt | 1 - lib/third_party/Pluma/CMakeLists.txt | 10 ++++---- lib/third_party/Pluma/Config.hpp | 11 ++++++--- lib/third_party/Pluma/PluginManager.cpp | 1 - 9 files changed, 46 insertions(+), 21 deletions(-) diff --git a/appli/ImageMPR/main.cxx b/appli/ImageMPR/main.cxx index 78d5bc5..5ec79cf 100644 --- a/appli/ImageMPR/main.cxx +++ b/appli/ImageMPR/main.cxx @@ -5,7 +5,7 @@ // ------------------------------------------------------------------------- int main( int argc, char* argv[] ) { - ::setenv( "LC_NUMERIC", "POSIX", 1 ); +// TODO ::setenv( "LC_NUMERIC", "POSIX", 1 ); QApplication a( argc, argv ); ImageMPR w; w.show( ); diff --git a/lib/cpPlugins/Extensions/DataStructures/QuadEdgeMesh.hxx b/lib/cpPlugins/Extensions/DataStructures/QuadEdgeMesh.hxx index cfcf232..5fd57d6 100644 --- a/lib/cpPlugins/Extensions/DataStructures/QuadEdgeMesh.hxx +++ b/lib/cpPlugins/Extensions/DataStructures/QuadEdgeMesh.hxx @@ -478,9 +478,7 @@ typename cpPlugins::Extensions::DataStructures::QuadEdgeMesh< P, D, T >:: VectorType cpPlugins::Extensions::DataStructures::QuadEdgeMesh< P, D, T >:: _ComputePointNormal( const TPrimalEdge* e ) const { - static const TScalar zero = TScalar( 0 ); - - VectorType n( zero ); + VectorType n( TScalar( 0 ) ); if( Superclass::PointDimension == 3 ) { PointType p0 = this->GetPoint( e->GetOrigin( ) ); @@ -495,17 +493,18 @@ _ComputePointNormal( const TPrimalEdge* e ) const if( nIt == e->EndOnext( ) ) nIt = e->BeginOnext( ); - n += itk::CrossProduct( - this->GetPoint( ( *eIt )->GetDestination( ) ) - p0, - this->GetPoint( ( *nIt )->GetDestination( ) ) - p0 - ); + VectorType pe = this->GetPoint( ( *eIt )->GetDestination( ) ) - p0; + VectorType pn = this->GetPoint( ( *nIt )->GetDestination( ) ) - p0; + n[ 0 ] += ( pe[ 1 ] * pn[ 2 ] ) - ( pe[ 2 ] * pn[ 1 ] ); + n[ 1 ] += ( pe[ 2 ] * pn[ 0 ] ) - ( pe[ 0 ] * pn[ 2 ] ); + n[ 2 ] += ( pe[ 0 ] * pn[ 1 ] ) - ( pe[ 1 ] * pn[ 0 ] ); count++; } // fi } // rof TScalar nn = n.GetNorm( ); - if( nn > zero && count > 0 ) + if( nn > TScalar( 0 ) && count > 0 ) n /= nn * TScalar( count ); } // fi diff --git a/lib/cpPlugins/Extensions/Visualization/MPRActors.cxx b/lib/cpPlugins/Extensions/Visualization/MPRActors.cxx index e16ba0a..9808111 100644 --- a/lib/cpPlugins/Extensions/Visualization/MPRActors.cxx +++ b/lib/cpPlugins/Extensions/Visualization/MPRActors.cxx @@ -301,6 +301,7 @@ ResetWindowLevel( ) vtkPlane* cpPlugins::Extensions::Visualization::MPRActors:: GetSlicePlane( const int& axis ) const { + return( NULL ); } // ------------------------------------------------------------------------- diff --git a/lib/cpPlugins/Extensions/Visualization/MPRWithDifferentWindows.h b/lib/cpPlugins/Extensions/Visualization/MPRWithDifferentWindows.h index b0f8c40..ceff1eb 100644 --- a/lib/cpPlugins/Extensions/Visualization/MPRWithDifferentWindows.h +++ b/lib/cpPlugins/Extensions/Visualization/MPRWithDifferentWindows.h @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -38,7 +39,7 @@ namespace cpPlugins { /** */ - class MPRWithDifferentWindows + class cpPlugins_Extensions_EXPORT MPRWithDifferentWindows { public: typedef cpPlugins::Extensions::Visualization:: diff --git a/lib/cpPlugins/Interface/Object.h b/lib/cpPlugins/Interface/Object.h index 33cfdd7..a51f657 100644 --- a/lib/cpPlugins/Interface/Object.h +++ b/lib/cpPlugins/Interface/Object.h @@ -7,11 +7,30 @@ #include #include + +// ------------------------------------------------------------------------- +#define PLUMA_PROVIDER_HEADER_BEGIN_CPPLUGINS( TYPE )\ +class cpPlugins_Interface_EXPORT TYPE##Provider\ +: public pluma::Provider{\ +private:\ + friend class pluma::Pluma;\ + static const unsigned int PLUMA_INTERFACE_VERSION;\ + static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION;\ + static const std::string PLUMA_PROVIDER_TYPE;\ + std::string plumaGetType( ) const\ +{ return( PLUMA_PROVIDER_TYPE ); }\ +public:\ + unsigned int getVersion( ) const\ +{ return( PLUMA_INTERFACE_VERSION ); } + +// ------------------------------------------------------------------------- +#define PLUMA_PROVIDER_HEADER_END_CPPLUGINS }; + // ------------------------------------------------------------------------- #define PLUMA_PROVIDER_HEADER_CPPLUGINS( TYPE ) \ - PLUMA_PROVIDER_HEADER_BEGIN( TYPE ) \ + PLUMA_PROVIDER_HEADER_BEGIN_CPPLUGINS( TYPE ) \ virtual TYPE::Pointer create( ) const = 0; \ - PLUMA_PROVIDER_HEADER_END + PLUMA_PROVIDER_HEADER_END_CPPLUGINS // ------------------------------------------------------------------------- #define PLUMA_INHERIT_PROVIDER_CPPLUGINS( TYPE, SUPER ) \ diff --git a/lib/cpPlugins/Plugins/CMakeLists.txt b/lib/cpPlugins/Plugins/CMakeLists.txt index 372b150..d32fafb 100644 --- a/lib/cpPlugins/Plugins/CMakeLists.txt +++ b/lib/cpPlugins/Plugins/CMakeLists.txt @@ -32,7 +32,6 @@ GENERATE_EXPORT_HEADER( TARGET_LINK_LIBRARIES( ${LIBRARY_NAME} cpPlugins_Interface - ${ITK_LIBRARIES} ) ## eof - $RCSfile$ diff --git a/lib/third_party/Pluma/CMakeLists.txt b/lib/third_party/Pluma/CMakeLists.txt index c1a1261..9a86949 100644 --- a/lib/third_party/Pluma/CMakeLists.txt +++ b/lib/third_party/Pluma/CMakeLists.txt @@ -29,9 +29,11 @@ GENERATE_EXPORT_HEADER( EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/third_party/Pluma/${LIBRARY_NAME}_Export.h STATIC_DEFINE ${LIBRARY_NAME}_BUILT_AS_STATIC ) -TARGET_LINK_LIBRARIES( - ${LIBRARY_NAME} - dl - ) +IF(NOT WIN32) + TARGET_LINK_LIBRARIES( + ${LIBRARY_NAME} + dl + ) +ENDIF(NOT WIN32) ## eof - $RCSfile$ diff --git a/lib/third_party/Pluma/Config.hpp b/lib/third_party/Pluma/Config.hpp index efd98c9..23c1635 100644 --- a/lib/third_party/Pluma/Config.hpp +++ b/lib/third_party/Pluma/Config.hpp @@ -95,6 +95,13 @@ //////////////////////////////////////////////////////////// // Define portable import / export macros //////////////////////////////////////////////////////////// + +#include +#define PLUMA_API cpPlugins_Pluma_EXPORT + +/* =================================================================== + * florez-l@javeriana.edu.co: use dll macro defined from cmake instead + * =================================================================== #if defined(PLUMA_SYS_WINDOWS) #ifndef PLUMA_STATIC @@ -134,8 +141,6 @@ #define PLUMA_API #endif - - - +*/ #endif // PLUMA_CONFIG_HPP diff --git a/lib/third_party/Pluma/PluginManager.cpp b/lib/third_party/Pluma/PluginManager.cpp index 1124505..9579da2 100644 --- a/lib/third_party/Pluma/PluginManager.cpp +++ b/lib/third_party/Pluma/PluginManager.cpp @@ -117,7 +117,6 @@ bool PluginManager::unload(const std::string& pluginName){ return false; } - //////////////////////////////////////////////////////////// void PluginManager::unloadAll(){ -- 2.45.1