GDCM 2.2.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

gdcmPresentationContext.h
Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program: GDCM (Grassroots DICOM). A DICOM library
    00004
    00005   Copyright (c) 2006-2011 Mathieu Malaterre
    00006   All rights reserved.
    00007   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
    00008
    00009      This software is distributed WITHOUT ANY WARRANTY; without even
    00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00011      PURPOSE.  See the above copyright notice for more information.
    00012
    00013 =========================================================================*/
    00014 #ifndef GDCMPRESENTATIONCONTEXT_H
    00015 #define GDCMPRESENTATIONCONTEXT_H
    00016
    00017 #include "gdcmTypes.h"
    00018 #include "gdcmUIDs.h"
    00019
    00020 #include <vector>
    00021
    00022 namespace gdcm
    00023 {
    00024
    00029 class GDCM_EXPORT PresentationContext
    00030 {
    00031 public:
    00032   PresentationContext();
    00033
    00037   PresentationContext( UIDs::TSName asname,
    00038     UIDs::TSName tsname = UIDs::ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM );
    00039
    00040   void SetAbstractSyntax( const char *as ) { AbstractSyntax = as; }
    00041   const char *GetAbstractSyntax() const { return AbstractSyntax.c_str(); }
    00042
    00043   void AddTransferSyntax( const char *tsstr );
    00044   typedef std::vector<std::string> TransferSyntaxArrayType;
    00045   typedef TransferSyntaxArrayType::size_type SizeType;
    00046   const char *GetTransferSyntax(SizeType i) const { return TransferSyntaxes[i].c_str(); }
    00047   SizeType GetNumberOfTransferSyntaxes() const { return TransferSyntaxes.size(); }
    00048
    00049   void SetPresentationContextID( uint8_t id );
    00050   uint8_t GetPresentationContextID() const;
    00051
    00052   void Print(std::ostream &os) const;
    00053
    00054   bool operator==(const PresentationContext & pc) const
    00055     {
    00056     assert( TransferSyntaxes.size() == 1 ); // TODO
    00057     assert( pc.TransferSyntaxes.size() == 1 );
    00058     return AbstractSyntax == pc.AbstractSyntax && TransferSyntaxes == pc.TransferSyntaxes;
    00059     }
    00060
    00061 private:
    00062   std::string AbstractSyntax;
    00063   std::vector<std::string> TransferSyntaxes;
    00064   uint8_t /*PresentationContext*/ID;
    00065 };
    00066
    00067 } // end namespace gdcm
    00068
    00069 #endif //GDCMPRESENTATIONCONTEXT_H