Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

gdcmDictEntry.cxx

Go to the documentation of this file.
00001 /*=========================================================================
00002                                                                                 
00003   Program:   gdcm
00004   Module:    $RCSfile: gdcmDictEntry.cxx,v $
00005   Language:  C++
00006   Date:      $Date: 2005/11/30 08:48:17 $
00007   Version:   $Revision: 1.59 $
00008                                                                                 
00009   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
00010   l'Image). All rights reserved. See Doc/License.txt or
00011   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
00012                                                                                 
00013      This software is distributed WITHOUT ANY WARRANTY; without even
00014      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00015      PURPOSE.  See the above copyright notices for more information.
00016                                                                                 
00017 =========================================================================*/
00018 
00019 #include "gdcmDictEntry.h"
00020 #include "gdcmDebug.h"
00021 #include "gdcmUtil.h"
00022 
00023 #include <iomanip> // for std::ios::left, ...
00024 #include <fstream>
00025 #include <stdio.h> // for sprintf
00026 
00027 namespace gdcm 
00028 {
00029 //-----------------------------------------------------------------------------
00030 // Constructor / Destructor
00039 DictEntry::DictEntry(uint16_t group, uint16_t elem,
00040                      VRKey const &vr, 
00041                      TagName const &vm,
00042                      TagName const &name)
00043 
00044 {
00045    Tag.SetGroup(group);
00046    Tag.SetElement(elem);
00047    VR      = vr;
00048    VM      = vm;
00049    Name    = name;
00050 }
00051 
00055 DictEntry::~DictEntry()
00056 {
00057 }
00058 //-----------------------------------------------------------------------------
00059 // Public
00068 DictEntry *DictEntry::New(uint16_t group, uint16_t elem,
00069                           VRKey const &vr,
00070                           TagName const &vm,
00071                           TagName const &name)
00072 {
00073    return new DictEntry(group,elem,vr,vm,name);
00074 }
00075 
00083 TagKey DictEntry::TranslateToKey(uint16_t group, uint16_t elem)
00084 {
00085    // according to 'Purify', TranslateToKey is one of the most
00086    // time consuming methods.
00087    // Let's try to shorten it !
00088    return TagKey(group,elem);
00089 }
00090 
00091 //-----------------------------------------------------------------------------
00092 // Protected
00093 
00094 //-----------------------------------------------------------------------------
00095 // Private
00096 
00097 //-----------------------------------------------------------------------------
00098 // Print
00104 void DictEntry::Print(std::ostream &os, std::string const & )
00105 {
00106    os << GetKey(); 
00107    os << " [" << VR  << "] ";
00108 
00109    std::ostringstream s;
00110 
00111    if ( PrintLevel >= 1 )
00112    {
00113       s.setf(std::ios::left);
00114       s << std::setw(66-GetName().length()) << " ";
00115    }
00116 
00117    s << "[" << GetName()<< "]";
00118    os << s.str() << std::endl;
00119 }
00120 
00121 //-----------------------------------------------------------------------------
00122 } // end namespace gdcm
00123 

Generated on Fri Jan 20 10:14:24 2006 for gdcm by  doxygen 1.4.4