X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDocument.cxx;h=34b18e5f2d2dd451484efdeb672e8b431275d18e;hb=507c357466602345e4bd9de6c475e0887cf2ba36;hp=de43533a2a901ba7de041bb099dcd45d139aac2a;hpb=427dd083a10d001c2162b9cb462be49cd4f22fac;p=gdcm.git diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index de43533a..34b18e5f 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2005/11/21 16:04:43 $ - Version: $Revision: 1.330 $ + Date: $Date: 2005/12/14 10:00:28 $ + Version: $Revision: 1.334 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -91,14 +91,6 @@ bool Document::Load( ) return DoTheLoadingDocumentJob( ); } -//#ifndef GDCM_LEGACY_REMOVE -bool Document::Load( std::string const &fileName ) -{ - Filename = fileName; - return DoTheLoadingDocumentJob( ); -} -//#endif - /** * \brief Performs the Loading Job (internal use only) * @return false if file cannot be open or no swap info was found, @@ -991,6 +983,33 @@ int Document::ComputeGroup0002Length( ) return groupLength; } +/** + * \brief CallStartMethod + */ +void Document::CallStartMethod() +{ + Progress = 0.0f; + Abort = false; + CommandManager::ExecuteCommand(this,CMD_STARTPROGRESS); +} + +/** + * \brief CallProgressMethod + */ +void Document::CallProgressMethod() +{ + CommandManager::ExecuteCommand(this,CMD_PROGRESS); +} + +/** + * \brief CallEndMethod + */ +void Document::CallEndMethod() +{ + Progress = 1.0f; + CommandManager::ExecuteCommand(this,CMD_ENDPROGRESS); +} + //----------------------------------------------------------------------------- // Private /** @@ -1022,7 +1041,7 @@ void Document::ParseDES(DocEntrySet *set, long offset, bool delim_mode_intern = delim_mode; bool first = true; gdcmDebugMacro( "Enter in ParseDES, delim-mode " << delim_mode - << " at offset " << std::hex << offset ); + << " at offset " << std::hex << "0x(" << offset << ")" ); while (true) { if ( !delim_mode && ((long)(Fp->tellg())-offset) >= l_max) @@ -1069,8 +1088,8 @@ void Document::ParseDES(DocEntrySet *set, long offset, { gdcmDebugMacro( "in ParseDES : cannot add a DataEntry " << newDataEntry->GetKey() - << " (at offset : " - << newDataEntry->GetOffset() << " )" ); + << " (at offset : 0x(" + << newDataEntry->GetOffset() << ") )" ); used=false; } else @@ -1079,7 +1098,6 @@ void Document::ParseDES(DocEntrySet *set, long offset, // Load only if we can add (not a duplicate key) LoadDocEntry( newDataEntry ); } - if ( newDataEntry->GetElement() == 0x0000 ) // if on group length { if ( newDataEntry->GetGroup()%2 != 0 ) // if Shadow Group @@ -1087,8 +1105,9 @@ void Document::ParseDES(DocEntrySet *set, long offset, if ( LoadMode & LD_NOSHADOW ) // if user asked to skip shad.gr { std::string strLgrGroup = newDataEntry->GetString(); + int lgrGroup; - if ( newDataEntry->IsUnfound() ) + //if ( newDataEntry->IsUnfound() ) /?!? JPR { lgrGroup = atoi(strLgrGroup.c_str()); Fp->seekg(lgrGroup, std::ios::cur); @@ -1177,8 +1196,8 @@ void Document::ParseDES(DocEntrySet *set, long offset, { // Don't try to parse zero-length sequences gdcmDebugMacro( "Entry in ParseSQ, delim " << delim_mode_intern - << " at offset " << std::hex - << newDocEntry->GetOffset() ); + << " at offset 0x(" << std::hex + << newDocEntry->GetOffset() << ")"); ParseSQ( newSeqEntry, newDocEntry->GetOffset(), @@ -1191,8 +1210,8 @@ void Document::ParseDES(DocEntrySet *set, long offset, { gdcmWarningMacro( "in ParseDES : cannot add a SeqEntry " << newSeqEntry->GetKey() - << " (at offset : " - << newSeqEntry->GetOffset() << " )" ); + << " (at offset : 0x(" + << newSeqEntry->GetOffset() << ") )" ); used = false; } else @@ -1303,8 +1322,8 @@ DocEntry *Document::Backtrack(DocEntry *docEntry) long offset = PreviousDocEntry->GetOffset(); gdcmDebugMacro( "Backtrack :" << std::hex << group - << "|" << elem - << " at offset " << offset ); + << "|" << elem + << " at offset 0x(" <seekg(positionOnEntry, std::ios::beg); return GDCM_VRUNKNOWN; }