From a7b06006e972ee6ebc04f177a1461d4d5ae2089a Mon Sep 17 00:00:00 2001 From: malaterre Date: Wed, 11 May 2005 15:01:46 +0000 Subject: [PATCH] BUG: Fix previously instroduce cmake bug, now should compile fine even without VTK at all. Fix float/double in VTK4.2 and finally backport a patch from ITK --- Testing/CMakeLists.txt | 14 +++++++++----- src/gdcmDict.cxx | 14 ++++++++++++-- src/gdcmDict.h | 5 +++-- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt index 68c49b2c..86ce368b 100644 --- a/Testing/CMakeLists.txt +++ b/Testing/CMakeLists.txt @@ -42,13 +42,17 @@ IF (GDCM_DATA_ROOT) ) # add test that require VTK: IF(GDCM_VTK) - IF(${VTK_MAJOR_VERSION} LESS 4) + IF("${VTK_MAJOR_VERSION}" LESS 4) MESSAGE(FATAL_ERROR "This VTK version is not supported, you are on your own !") - ELSE(${VTK_MAJOR_VERSION} LESS 4) - IF(${VTK_MAJOR_VERSION} EQUAL 4 AND ${VTK_MINOR_VERSION} EQUAL 4 AND ${VTK_BUILD_VERSION} LESS 3) + ELSE("${VTK_MAJOR_VERSION}" LESS 4) + IF("${VTK_MAJOR_VERSION}" EQUAL 4 AND "${VTK_MINOR_VERSION}" EQUAL 2) MESSAGE(FATAL_ERROR "This VTK version is not supported, you are on your own !" "Although gdcm should compile fine. You just need to turn BUILD_TESTING:=OFF") - ENDIF(${VTK_MAJOR_VERSION} EQUAL 4 AND ${VTK_MINOR_VERSION} EQUAL 4 AND ${VTK_BUILD_VERSION} LESS 3) + ENDIF("${VTK_MAJOR_VERSION}" EQUAL 4 AND "${VTK_MINOR_VERSION}" EQUAL 2) + IF("${VTK_MAJOR_VERSION}" EQUAL 4 AND "${VTK_MINOR_VERSION}" EQUAL 4 AND "${VTK_BUILD_VERSION}" LESS 3) + MESSAGE(FATAL_ERROR "This VTK version is not supported, you are on your own !" + "Although gdcm should compile fine. You just need to turn BUILD_TESTING:=OFF") + ENDIF("${VTK_MAJOR_VERSION}" EQUAL 4 AND "${VTK_MINOR_VERSION}" EQUAL 4 AND "${VTK_BUILD_VERSION}" LESS 3) # Include the VTK library since we know this is going to work INCLUDE(${VTK_USE_FILE}) @@ -61,7 +65,7 @@ IF (GDCM_DATA_ROOT) VTKTestWrite.cxx VTKTestWriteSeq.cxx ) - ENDIF(${VTK_MAJOR_VERSION} LESS 4) + ENDIF("${VTK_MAJOR_VERSION}" LESS 4) ENDIF(GDCM_VTK) ENDIF (GDCM_DATA_ROOT) diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index fc7c07f2..97d0eb71 100644 --- a/src/gdcmDict.cxx +++ b/src/gdcmDict.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDict.cxx,v $ Language: C++ - Date: $Date: 2005/02/11 15:22:18 $ - Version: $Revision: 1.74 $ + Date: $Date: 2005/05/11 15:01:47 $ + Version: $Revision: 1.75 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -177,6 +177,16 @@ void Dict::ClearEntry() * @param elem element of the entry to be found * @return the corresponding dictionary entry when existing, NULL otherwise */ +DictEntry *Dict::GetEntry(TagKey const &key) +{ + TagKeyHT::iterator it = KeyHt.find(key); + if ( it == KeyHt.end() ) + { + return 0; + } + return &(it->second); +} + DictEntry *Dict::GetEntry(uint16_t group, uint16_t elem) { TagKey key = DictEntry::TranslateToKey(group, elem); diff --git a/src/gdcmDict.h b/src/gdcmDict.h index 56db9453..1e83f1b6 100644 --- a/src/gdcmDict.h +++ b/src/gdcmDict.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDict.h,v $ Language: C++ - Date: $Date: 2005/02/07 09:51:03 $ - Version: $Revision: 1.38 $ + Date: $Date: 2005/05/11 15:01:47 $ + Version: $Revision: 1.39 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -61,6 +61,7 @@ public: // Tag DictEntry *GetEntry(uint16_t group, uint16_t elem); + DictEntry *GetEntry(TagKey const &key); DictEntry *GetFirstEntry(); DictEntry *GetNextEntry(); -- 2.45.1