]> Creatis software - cpPlugins.git/commitdiff
It should now compile on windows...
authorLeonardo Florez Valencia <florez-l@javeriana.edu.co>
Tue, 5 Apr 2016 22:04:54 +0000 (17:04 -0500)
committerLeonardo Florez Valencia <florez-l@javeriana.edu.co>
Tue, 5 Apr 2016 22:04:54 +0000 (17:04 -0500)
appli/bash/cpPlugins_CreateInstances.cxx
appli/bash/cpPlugins_HostCreator.cxx
lib/cpPlugins_Instances/Base_extra.cxx
lib/cpPlugins_Instances/CMakeLists.txt
lib/cpPlugins_Instances/Image.i
lib/cpPlugins_Instances/ImageITK2VTK.i
lib/cpPlugins_Instances/Mesh.i

index 2340678bc095db7b199481a607c36f1415767737..b83bdce5601ff343a390f3e4e2ef88519c2f2dec 100644 (file)
@@ -2,18 +2,24 @@
 #include <iostream>
 
 #include <algorithm>
-#include <cctype>
 #include <cstring>
 #include <map>
 #include <vector>
 #include <sstream>
 
+#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
+#  define cpPlugins_STRTOK( A, B, N ) strtok_s( A, B, N )
+#else // defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
+#  define cpPlugins_STRTOK( A, B, N ) std::strtok( A, B )
+#endif // defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
+
 // -------------------------------------------------------------------------
 typedef std::vector< std::string >      TLines;
 typedef std::map< char, TLines >        TParsedLines;
 typedef std::map< std::string, TLines > TVariables;
 
 // -------------------------------------------------------------------------
+bool cpPlugins_ISBLANK( const char& value );
 TLines Tokenize( const std::string& str, const std::string& delims );
 std::string Replace(
   const std::string& str, const std::string& sub, const std::string& nsub
@@ -146,20 +152,29 @@ int main( int argc, char* argv[] )
   return( 0 );
 }
 
+// -------------------------------------------------------------------------
+bool cpPlugins_ISBLANK( const char& value )
+{
+  return( value == ' ' || value == '\t' || value == '\n' || value == '\r' );
+}
+
 // -------------------------------------------------------------------------
 TLines Tokenize( const std::string& str, const std::string& delims )
 {
   TLines tokens;
   if( str.size( ) > 0 )
   {
-    char* buffer = new char[ str.size( ) + 1 ];
-    std::strcpy( buffer, str.c_str( ) );
-    buffer[ str.size( ) ] = '\0';
-    char* it = std::strtok( buffer, delims.c_str( ) );
+    auto ssize = str.size( );
+    char* buffer = new char[ ssize + 1 ];
+    for( unsigned long i = 0; i < ssize; ++i )
+      buffer[ i ] = str[ i ];
+    buffer[ ssize ] = '\0';
+    char* next;
+    char* it = cpPlugins_STRTOK( buffer, delims.c_str( ), &next );
     while( it != NULL )
     {
       tokens.push_back( std::string( it ) );
-      it = std::strtok( NULL, delims.c_str( ) );
+      it = cpPlugins_STRTOK( NULL, delims.c_str( ), &next );
 
     } // elihw
     delete buffer;
@@ -189,7 +204,7 @@ bool ReadFile( TParsedLines& lines, const std::string& fname )
     return( false );
   std::string buffer;
   file_stream.seekg( 0, std::ios::end );
-  buffer.reserve( file_stream.tellg( ) );
+  buffer.reserve( ( unsigned int )( file_stream.tellg( ) ) );
   file_stream.seekg( 0, std::ios::beg );
   buffer.assign(
     ( std::istreambuf_iterator< char >( file_stream ) ),
@@ -207,7 +222,7 @@ bool ReadFile( TParsedLines& lines, const std::string& fname )
     auto lIt = line.begin( );
     while( lIt != line.end( ) )
     {
-      if( !std::isblank( *lIt ) )
+      if( !cpPlugins_ISBLANK( *lIt ) )
       {
         if( cmd_pos == line.end( ) )
         {
index 4fbadeda1c40aad8d92218936dce123fd47b8d93..eb529bd60da8113b65beeb3ac0123fbc0a6ab204 100644 (file)
@@ -26,7 +26,7 @@ void process_header( TInfo& info, const std::string& file_name )
     return;
   std::string buf;
   file_stream.seekg( 0, std::ios::end );
-  buf.reserve( file_stream.tellg( ) );
+  buf.reserve( ( unsigned int )( file_stream.tellg( ) ) );
   file_stream.seekg( 0, std::ios::beg );
   buf.assign(
     ( std::istreambuf_iterator< char >( file_stream ) ),
index 77449ff7121affed142063219b5fbe48c8a546d2..e0d8a83f17f16b7773fbbf40ecaffc28924208f7 100644 (file)
@@ -4,11 +4,13 @@
 #include <itkImageRegion.h>
 #include <itkFixedArray.h>
 #include <itkPoint.h>
+#include <itkVariableLengthVector.h>
 #include <itkVector.h>
 
 #include <itkImageRegion.hxx>
 #include <itkFixedArray.hxx>
 #include <itkPoint.hxx>
+#include <itkVariableLengthVector.hxx>
 #include <itkVector.hxx>
 
 // -------------------------------------------------------------------------
@@ -44,4 +46,15 @@ cpPlugins_Base_extra_Array_AllScalars_AllDims( itk::FixedArray );
 cpPlugins_Base_extra_Array_AllScalars_AllDims( itk::Point );
 cpPlugins_Base_extra_Array_AllScalars_AllDims( itk::Vector );
 
+#define cpPlugins_Base_extra_VariableLengthVector_SetSize( T, P ) \
+  template cpPlugins_Base_EXPORT void itk::VariableLengthVector< T >:: \
+  SetSize< itk::VariableLengthVector< T >::P, \
+           itk::VariableLengthVector< T >::KeepOldValues >( \
+    unsigned int, itk::VariableLengthVector< T >::P, \
+    itk::VariableLengthVector< float >::KeepOldValues \
+  )
+
+cpPlugins_Base_extra_VariableLengthVector_SetSize( float, AlwaysReallocate );
+cpPlugins_Base_extra_VariableLengthVector_SetSize( float, ShrinkToFit );
+
 // eof - $RCSfile$
index 2be6bd84b640d2baaab9acbf3731108ca70874e9..bd6ff3354ce44334abafc00e0cf762d16f0b3cf9 100644 (file)
@@ -36,90 +36,20 @@ FOREACH(i ${libs_DEFS})
 ENDFOREACH(i)
 
 ## Target links
-TARGET_LINK_LIBRARIES(cpPlugins_Base ${ITK_LIBRARIES} ${VTK_LIBRARIES})
-TARGET_LINK_LIBRARIES(cpPlugins_Image cpPlugins_Base)
-TARGET_LINK_LIBRARIES(cpPlugins_Mesh cpPlugins_Base)
+TARGET_LINK_LIBRARIES(cpPlugins_Base ${ITK_LIBRARIES})
+TARGET_LINK_LIBRARIES(cpPlugins_Transforms ${ITK_LIBRARIES} cpPlugins_Base)
 TARGET_LINK_LIBRARIES(cpPlugins_Paths cpPlugins_Base)
-TARGET_LINK_LIBRARIES(cpPlugins_Transforms cpPlugins_Base)
-TARGET_LINK_LIBRARIES(cpPlugins_ImageIterators cpPlugins_Image)
+TARGET_LINK_LIBRARIES(cpPlugins_Mesh cpPlugins_Base)
+TARGET_LINK_LIBRARIES(cpPlugins_Image cpPlugins_Base)
+TARGET_LINK_LIBRARIES(cpPlugins_ImageIterators ${ITK_LIBRARIES} cpPlugins_Image)
 TARGET_LINK_LIBRARIES(cpPlugins_ImageFiltersBase cpPlugins_Image)
 TARGET_LINK_LIBRARIES(cpPlugins_InPlaceImageFiltersBase cpPlugins_ImageFiltersBase)
+TARGET_LINK_LIBRARIES(cpPlugins_ImageITK2VTK cpPlugins_ImageFiltersBase ${VTK_LIBRARIES})
 TARGET_LINK_LIBRARIES(cpPlugins_ThresholdFilters cpPlugins_InPlaceImageFiltersBase cpPlugins_ImageIterators)
 TARGET_LINK_LIBRARIES(cpPlugins_DistanceMapFilters cpPlugins_ThresholdFilters)
-TARGET_LINK_LIBRARIES(cpPlugins_ImageIO cpPlugins_ImageFiltersBase cpPlugins_ImageIterators)
-TARGET_LINK_LIBRARIES(cpPlugins_ImageITK2VTK cpPlugins_ImageFiltersBase)
 TARGET_LINK_LIBRARIES(cpPlugins_ResamplingFilters cpPlugins_ImageFiltersBase cpPlugins_ImageIterators cpPlugins_Transforms)
 TARGET_LINK_LIBRARIES(cpPlugins_GaussianImageFilters cpPlugins_ImageFiltersBase cpPlugins_ImageIterators)
-
-#TARGET_LINK_LIBRARIES(cpPlugins_Transforms
-#   cpPlugins_Base
-#   )
-# TARGET_LINK_LIBRARIES(
-#   cpPlugins_Image
-#   cpPlugins_Base
-#   )
-# TARGET_LINK_LIBRARIES(
-#   cpPlugins_Mesh
-#   cpPlugins_Base
-#   )
-# TARGET_LINK_LIBRARIES(
-#   cpPlugins_ImageFiltersBase
-#   cpPlugins_Image
-#   )
-# TARGET_LINK_LIBRARIES(
-#   cpPlugins_ImageITK2VTK
-#   cpPlugins_ImageFiltersBase
-#   )
-# TARGET_LINK_LIBRARIES(
-#   cpPlugins_ImageIterators
-#   cpPlugins_Image
-#   )
-# TARGET_LINK_LIBRARIES(
-#   cpPlugins_ImageIO
-#   cpPlugins_ImageFiltersBase
-#   cpPlugins_ImageIterators
-#   )
-# TARGET_LINK_LIBRARIES(
-#   cpPlugins_ThresholdFilters
-#   cpPlugins_ImageFiltersBase
-#   cpPlugins_ImageIterators
-#   )
-# TARGET_LINK_LIBRARIES(
-#   cpPlugins_DistanceMapFilters
-#   cpPlugins_ThresholdFilters
-#   )
-# TARGET_LINK_LIBRARIES(
-#   cpPlugins_ResamplingFilters
-#   cpPlugins_Transforms
-#   cpPlugins_ImageFiltersBase
-#   cpPlugins_ImageIterators
-#   )
-
-# # ===================================
-# # = Integrate all source file names =
-# # ===================================
-
-# SET(
-#   lib_HEADERS
-#   ${lib_HEADERS_H}
-#   ${lib_HEADERS_HPP}
-#   ${lib_HEADERS_HXX}
-#   )
-
-# SET(
-#   lib_SOURCES
-#   ${lib_SOURCES_C}
-#   ${lib_SOURCES_CPP}
-#   ${lib_SOURCES_CXX}
-#   )
-
-# ## =====================
-# ## = Compilation rules =
-# ## =====================
-
-# ## ========================
-# ## == Installation rules ==
-# ## ========================
+TARGET_LINK_LIBRARIES(cpPlugins_ImageIO cpPlugins_ImageFiltersBase cpPlugins_ImageIterators)
 
 # INSTALL(
 #   TARGETS ${l_NAME}
index 13879971628a1444adebed3c4da63d62519563cf..7e8c24dc543b8e6147851a9dbc43097b671ac29a 100644 (file)
@@ -17,6 +17,9 @@ d #pixels=#scalar;#color_pixels;#complex_pixels
 d #array_pixels=#lin_alg_vectors;itk::SymmetricSecondRankTensor
 d #double_array_pixels=itk::Matrix
 
+c itk::ImageRegion< #dims >
+c itk::ImageBase< #dims >
+
 c itk::ImportImageContainer< unsigned long, #pixels >
 c itk::ImportImageContainer< unsigned long, #array_pixels< #float, #dims > >
 c itk::ImportImageContainer< unsigned long, #double_array_pixels< #float, #dims, #dims > >
index 2c9315ad78b28561edb46ee118bfc26279e82749..7529a31357aab5b4345afb1714b19222ce9e6748 100644 (file)
@@ -12,9 +12,7 @@ d #color_pixels=itk::RGBPixel< #scalar >;itk::RGBAPixel< #scalar >
 d #lin_alg_vectors=itk::CovariantVector;itk::Point;itk::Vector
 d #pixels=#scalar;#color_pixels;#complex_pixels
 d #array_pixels=#lin_alg_vectors;itk::SymmetricSecondRankTensor
-d #double_array_pixels=itk::Matrix
 d #filters=itk::ImageToVTKImageFilter;itk::VTKImageToImageFilter
 
 c #filters< itk::Image< #pixels, #dims > >
 c #filters< itk::Image< #array_pixels< #float, #dims >, #dims > >
-c #filters< itk::Image< #double_array_pixels< #float, #dims, #dims >, #dims > >
index e0d68a9017deb3688991ea49b2f8277016fd257d..bd0b0c403206d501e8e8cbb0615165346a485794 100644 (file)
@@ -9,5 +9,6 @@ t itkBoundingBox.h
 t itkMapContainer.h
 t itkVectorContainer.h
 
+c itk::VectorContainer< unsigned long, itk::CellInterface< #float, itk::CellTraitsInfo< #dims, float, float, unsigned long, unsigned long, unsigned long, itk::Point< float, #dims >, itk::VectorContainer< unsigned long, itk::Point< float, #dims > >, std::set< unsigned long > > >* >
 c @{itk::PointSet;itk::Mesh}< #float, #dims >