freProfileMediaMap.cxx

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   F.R.E.E. - flexible registration evaluation engine
00004   Version:   v.1.0.0
00005   Date:      $Date: 2006/09/01 12:00:00 $
00006   Module:    $RCSfile: freProfileMediaMap.cxx,v $
00007   Language:  C++
00008 
00009 
00010 
00011   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00012   Institute for Medical Biometry and Informatics, University of Heidelberg,
00013   Germany). All rights reserved.
00014   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00015   for details.
00016 
00017      This software is distributed WITHOUT ANY WARRANTY; without even 
00018      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00019      PURPOSE.  See the above copyright notices for more information.
00020 
00021 =========================================================================*/
00022 #include "freProfileMediaMap.h"
00023 
00024 namespace FREE
00025 {
00026 namespace CtrlProfile
00027 {
00028 
00032 
00033 
00034 Media*
00035 ProfileMediaMap::
00036 AddMedia(const std::string& sName, const std::string& sType, const DataAccessType access,
00037          const Media::DimensionType& dim, const unsigned int& iGroupID, const bool& bInternal)
00038 
00039 {
00040   Media::Pointer smpMedia = this->GetElement(sName);
00041 
00042   if (smpMedia.IsNull())
00043         {
00044     smpMedia = Media::New();
00045         AddElement(smpMedia);
00046         };
00047 
00048         smpMedia->SetDimension(dim);
00049         smpMedia->SetName(sName);
00050         smpMedia->SetDataType(sType);
00051         smpMedia->SetInternal(bInternal);
00052         smpMedia->SetAccess(access);
00053   smpMedia->SetGroup(iGroupID);
00054   return smpMedia.GetPointer();
00055 };
00056 
00057 ProfileMediaMap::
00058 ProfileMediaMap()
00059 {
00060   Reset();
00061         SetXMLTag(cXML_CP_MediaMap);
00062 };
00063 
00064 ProfileMediaMap::
00065 ProfileMediaMap( const ProfileMediaMap& rMediaMap)
00066 {
00067         SetXMLTag(cXML_CP_MediaMap);
00068   *this = rMediaMap;
00069 };
00070 
00071 ProfileMediaMap::
00072 ~ProfileMediaMap()
00073 {
00074   Reset();
00075 };
00076 
00077 void
00078 ProfileMediaMap::
00079 SubElementLoadProcessing(const std::string& rsXMLSubTag, const std::string& rsXMLSubElement, const std::string& rsXMLSubData)
00080 {
00081   if (rsXMLSubTag==cXML_CP_Media)
00082   {
00083     Media::Pointer smpNewComponent = Media::New();
00084     
00085     try
00086     {
00087       smpNewComponent->LoadFromString(rsXMLSubElement);
00088     }
00089     catchAllNPassMacro("Unknown error occured while loading subcomponent definition to a collection.");
00090 
00091     AddElement(smpNewComponent);
00092   }
00093   else if (rsXMLSubTag!=cXML_Text) throwExceptionMacro("Unknown xml tag, unable to load value. Incorrect Tag: " << rsXMLSubTag);
00094 };
00095 
00096 }//end of namespace FREE
00097 }//end of namespace CtrlProfile

Generated at Sat Oct 13 17:08:47 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000