]> Creatis software - gdcm.git/blobdiff - src/gdcmDocEntrySet.cxx
Forget to remove cout ..
[gdcm.git] / src / gdcmDocEntrySet.cxx
index 7ba938fbe1bafd65fe0a4bbc78c767dbe1bdc4d6..7be85dff36dd317cc05cb37a282d7ef5326daf29 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntrySet.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/01/27 10:01:33 $
-  Version:   $Revision: 1.69 $
+  Date:      $Date: 2006/03/22 13:19:25 $
+  Version:   $Revision: 1.71 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -121,7 +121,7 @@ SeqEntry *DocEntrySet::GetSeqEntry(uint16_t group, uint16_t elem)
    DocEntry *currentEntry = GetDocEntry(group, elem);
    if ( !currentEntry )
       return NULL;
-      
+
    return dynamic_cast<SeqEntry*>(currentEntry);
 }
 
@@ -214,8 +214,8 @@ bool DocEntrySet::SetEntryBinArea(uint8_t *content, int lgth, DataEntry *entry)
  *          failed).
  */ 
 DataEntry *DocEntrySet::InsertEntryString(std::string const &value, 
-                                             uint16_t group, uint16_t elem,
-                                             VRKey const &vr )
+                                          uint16_t group, uint16_t elem,
+                                          VRKey const &vr )
 {
    DataEntry *dataEntry = 0;
    DocEntry *currentEntry = GetDocEntry( group, elem );
@@ -272,8 +272,8 @@ DataEntry *DocEntrySet::InsertEntryString(std::string const &value,
  *          failed).
  */
 DataEntry *DocEntrySet::InsertEntryBinArea(uint8_t *binArea, int lgth, 
-                                              uint16_t group, uint16_t elem,
-                                              VRKey const &vr )
+                                           uint16_t group, uint16_t elem,
+                                           VRKey const &vr )
 {
    DataEntry *dataEntry = 0;
    DocEntry *currentEntry = GetDocEntry( group, elem );
@@ -442,7 +442,7 @@ SeqEntry* DocEntrySet::NewSeqEntry(uint16_t group, uint16_t elem)
       gdcmWarningMacro( "Failed to allocate SeqEntry for ("
          <<std::hex << group << "|" << elem <<")" );
       return 0;
-   }
+   }     
    return newEntry;
 }
 
@@ -461,6 +461,8 @@ SeqEntry* DocEntrySet::NewSeqEntry(uint16_t group, uint16_t elem)
 DictEntry *DocEntrySet::GetDictEntry(uint16_t group,uint16_t elem) 
 {
    DictEntry *found = 0;
+   /// \todo store the DefaultPubDict somwhere, in order not to access the HTable
+   ///       every time !
    Dict *pubDict = Global::GetDicts()->GetDefaultPubDict();
    if (!pubDict) 
    {
@@ -478,7 +480,7 @@ DictEntry *DocEntrySet::GetDictEntry(uint16_t group,uint16_t elem)
 /**
  * \brief   Searches [both] the public [and the shadow dictionary (when they
  *          exist)] for the presence of the DictEntry with given
- *          group and element, and create a new virtual DictEntry if necessary
+ *          group and element, and creates a new virtual DictEntry if necessary
  * @param   group  group number of the searched DictEntry
  * @param   elem element number of the searched DictEntry
  * @param   vr V(alue) R(epresentation) to use, if necessary 
@@ -492,14 +494,14 @@ DictEntry *DocEntrySet::GetDictEntry(uint16_t group, uint16_t elem,
    DictEntry *goodEntry = dictEntry;
    VRKey goodVR = vr;
    TagName vm;
-   if (elem == 0x0000) 
+   if (elem == 0x0000)
       goodVR="UL";
 
    if ( goodEntry )
    {
       if ( goodVR != goodEntry->GetVR()
         && goodVR != GDCM_VRUNKNOWN )
-      { 
+      {
          gdcmWarningMacro("For (" << std::hex << group << "|"
             << elem << "), found VR : [" << vr << "]"
             << " expected: [" << goodEntry->GetVR() << "]" ) ;
@@ -520,7 +522,7 @@ DictEntry *DocEntrySet::GetDictEntry(uint16_t group, uint16_t elem,
       if (dictEntry)
       {
 
-         goodEntry = DictEntry::New(group, elem, goodVR, vm,//"FIXME", 
+         goodEntry = DictEntry::New(group, elem, goodVR, vm,
                                     dictEntry->GetName() );
       }
       else