freProfileParameter.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: freProfileParameter.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 "freProfileParameter.h"
00023 
00024 #include "freConvert.h"
00025 
00026 namespace FREE
00027 {
00028 namespace CtrlProfile
00029 {
00033 
00034 
00035 
00036 void
00037 Parameter::
00038 SetParameterSize(ValueCountType iSize)
00039 {
00040   m_iLayerSize = iSize;
00041   this->Resize(iSize);
00042 };
00043 
00044 Parameter&
00045 Parameter::
00046 operator = (const Parameter& parameter)
00047 {
00048   if (this == &parameter) return *this;
00049 
00050   FREE::Parameter::operator =(parameter);
00051 
00052   m_Access = parameter.GetAccess();
00053         m_sHint = parameter.GetHint();
00054         m_iLayerCount = parameter.GetLayerCount();
00055         m_bDynamic = parameter.GetIsMultiResDynamic();
00056         m_ValueType = parameter.GetValueType();
00057         m_iGroup = parameter.GetGroup();
00058   m_bInternal = parameter.GetInternal();
00059         
00060   return *this;
00061 };
00062 
00063 Parameter::
00064 Parameter() : FREE::Parameter("",1,0)
00065 {
00066   this->SetXMLTag(FREE::cXML_CP_Parameter);
00067   Reset();
00068 };
00069 
00070 Parameter::
00071 ~Parameter()
00072 {
00073 };
00074 
00075 void
00076 Parameter::
00077 Reset()
00078 {
00079   FREE::Parameter::Reset();
00080 
00081         m_sHint = "";
00082         m_iLayerCount = 1;
00083         m_bDynamic = false;
00084         m_ValueType = PVTString;
00085         m_iGroup = 0;
00086   m_Access = DAAny;
00087   m_bInternal = false;
00088 };
00089 
00090 void
00091 Parameter::
00092 AttributesLoadProcessing(const AttributesType& rAttributes)
00093 {
00094   for (AttributesType::const_iterator pos = rAttributes.begin(); pos!= rAttributes.end(); pos++)
00095   {
00096     if (pos->first==cXML_CP_ParamName) m_sParameterName = pos->second;
00097     else if (pos->first==cXML_CP_ParamHint) m_sHint = pos->second;
00098     else if (pos->first==cXML_CP_ParamLayerCount) m_iLayerCount = ::FREE::Convert::ToInt(pos->second);
00099                 else if (pos->first==cXML_CP_ParamDynamic) m_bDynamic = ::FREE::Convert::ToBool(pos->second);
00100                 else if (pos->first==cXML_CP_ParamSize) m_iLayerSize = ::FREE::Convert::ToInt(pos->second);
00101                 else if (pos->first==cXML_CP_ParamType) m_ValueType = ::FREE::Convert::ToParameterValueType(pos->second);
00102                 else if (pos->first==cXML_CP_Group) m_iGroup = ::FREE::Convert::ToInt(pos->second);
00103     else if (pos->first==cXML_CP_MediaAccess) m_Access = ::FREE::Convert::ToDataAccessType(pos->second);
00104     else if (pos->first==cXML_CP_MediaInternal) m_bInternal = ::FREE::Convert::ToBool(pos->second);
00105   };
00106 };
00107 
00108 void
00109 Parameter::
00110 SaveAttributes(AttributesSaveListType& rAttributes) const
00111 {
00112   rAttributes.push_back(AttributesType::value_type(cXML_CP_ParamName,m_sParameterName));
00113         rAttributes.push_back(AttributesType::value_type(cXML_CP_ParamType,Convert::ToStr(m_ValueType)));
00114 
00115         if (m_iLayerCount!=1) rAttributes.push_back(AttributesType::value_type(cXML_CP_ParamLayerCount,::FREE::Convert::ToStr(m_iLayerCount)));
00116         if (m_bDynamic) rAttributes.push_back(AttributesType::value_type(cXML_CP_ParamDynamic,"true"));
00117         if (m_sHint!="") rAttributes.push_back(AttributesType::value_type(cXML_CP_ParamHint,m_sHint));
00118         if (m_iLayerSize!=1) rAttributes.push_back(AttributesType::value_type(cXML_CP_ParamDynamic,::FREE::Convert::ToStr(m_iLayerSize)));
00119         if (m_bInternal) rAttributes.push_back(AttributesType::value_type(cXML_CP_MediaInternal,"true"));
00120         if (m_iGroup) rAttributes.push_back(AttributesType::value_type(cXML_CP_Group,::FREE::Convert::ToStr(m_iGroup)));
00121   if (m_Access!=DAAny) rAttributes.push_back(AttributesType::value_type(cXML_CP_MediaAccess,Convert::ToStr(m_Access)));
00122 }; 
00123 
00124 }//end of namespace FREE
00125 
00126 }//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