]> Creatis software - cpPlugins.git/commitdiff
First modifications to make this work on MS-Windows
authorLeonardo Florez Valencia <florez-l@javeriana.edu.co>
Fri, 26 Dec 2014 11:14:33 +0000 (12:14 +0100)
committerLeonardo Florez Valencia <florez-l@javeriana.edu.co>
Fri, 26 Dec 2014 11:14:33 +0000 (12:14 +0100)
appli/ImageMPR/main.cxx
lib/cpPlugins/Extensions/DataStructures/QuadEdgeMesh.hxx
lib/cpPlugins/Extensions/Visualization/MPRActors.cxx
lib/cpPlugins/Extensions/Visualization/MPRWithDifferentWindows.h
lib/cpPlugins/Interface/Object.h
lib/cpPlugins/Plugins/CMakeLists.txt
lib/third_party/Pluma/CMakeLists.txt
lib/third_party/Pluma/Config.hpp
lib/third_party/Pluma/PluginManager.cpp

index 78d5bc568d08501ebda33e0aa65f21778e80ab93..5ec79cfa2a282a2c9fd005c0d01116a830ab40a1 100644 (file)
@@ -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( );
index cfcf232a00c4e690fd8300239fc3d68e67018a84..5fd57d63521657bcdf9527c0ea42e6166091ab94 100644 (file)
@@ -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
index e16ba0ad9e76a839cb1191185739fedc157abf99..9808111ad8a380b9ac88ae96f8fa82ed8114add3 100644 (file)
@@ -301,6 +301,7 @@ ResetWindowLevel( )
 vtkPlane* cpPlugins::Extensions::Visualization::MPRActors::
 GetSlicePlane( const int& axis ) const
 {
+  return( NULL );
 }
 
 // -------------------------------------------------------------------------
index b0f8c40de6a8d7b18aa1aa6e6c8eaceb3409c435..ceff1ebcfefaa490891c21b355d69c5cd7f814a9 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <cpPlugins/Extensions/Visualization/MPRActors.h>
 #include <cpPlugins/Extensions/Visualization/ImageInteractorStyle.h>
+#include <cpPlugins/Extensions/cpPlugins_Extensions_Export.h>
 
 #include <vtkImageData.h>
 #include <vtkRenderer.h>
@@ -38,7 +39,7 @@ namespace cpPlugins
     {
       /**
        */
-      class MPRWithDifferentWindows
+      class cpPlugins_Extensions_EXPORT MPRWithDifferentWindows
       {
       public:
         typedef cpPlugins::Extensions::Visualization::
index 33cfdd7079cd61ab1e361369a3af305c271d3872..a51f657add190bd983f23b0975109292ae84c90f 100644 (file)
@@ -7,11 +7,30 @@
 #include <itkObjectFactory.h>
 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
 
+
+// -------------------------------------------------------------------------
+#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 ) \
index 372b1504dbb12cfb3f07cc48392fff9958a773ea..d32fafbaecc7e9b307118c558ae385962fe5eb43 100644 (file)
@@ -32,7 +32,6 @@ GENERATE_EXPORT_HEADER(
 TARGET_LINK_LIBRARIES(
   ${LIBRARY_NAME}
   cpPlugins_Interface
-  ${ITK_LIBRARIES}
   )
 
 ## eof - $RCSfile$
index c1a1261948167d1c40d0456e4b3933de3b112e3f..9a86949bb35a7b4d009c2603aff2dd0f1055e0c3 100644 (file)
@@ -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$
index efd98c93186d754106e8fe01b8e7ace4da66895c..23c1635fb80fe9087f93ed0d7bc3d5f579ee29ec 100644 (file)
 ////////////////////////////////////////////////////////////\r
 // Define portable import / export macros\r
 ////////////////////////////////////////////////////////////\r
+\r
+#include <Pluma/cpPlugins_Pluma_Export.h>\r
+#define PLUMA_API cpPlugins_Pluma_EXPORT\r
+\r
+/* ===================================================================\r
+ * florez-l@javeriana.edu.co: use dll macro defined from cmake instead\r
+ * =================================================================== \r
 #if defined(PLUMA_SYS_WINDOWS)\r
 \r
     #ifndef PLUMA_STATIC\r
     #define PLUMA_API\r
 \r
 #endif\r
-\r
-\r
-\r
+*/\r
 \r
 #endif // PLUMA_CONFIG_HPP\r
index 1124505c3bb5c11afd453b4e68e1db0291ed294a..9579da2f2fe4ff59f408e2757adb9e5b5aea03a3 100644 (file)
@@ -117,7 +117,6 @@ bool PluginManager::unload(const std::string& pluginName){
     return false;\r
 }\r
 \r
-\r
 ////////////////////////////////////////////////////////////\r
 void PluginManager::unloadAll(){\r
 \r