freComponentSetup.h

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: freComponentSetup.h,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 #ifndef __freComponentSetup_h
00023 #define __freComponentSetup_h
00024 
00025 #include "freXMLStreamObject.h"
00026 #include "freComponentID.h"
00027 #include "freIDPath.h"
00028 #include "freParameterCollection.h"
00029 #include "freComponentMediaLinks.h"
00030 
00031 #include "itkLightObject.h"
00032 
00033 namespace FREE
00034 {
00035 
00036 class ComponentSetupCollection; //forwarding because also used in SetupSections
00037 
00049 class ComponentSetup : public XMLStreamObject, public itk::LightObject
00050 {
00051 public:
00052   typedef ComponentSetup  Self;
00053   typedef itk::LightObject Superclass;
00054   typedef itk::SmartPointer<Self>        Pointer;
00055   typedef itk::SmartPointer<const Self>  ConstPointer;
00056 
00057         itkTypeMacro(ComponentSetup, XMLStreamObject);
00058   itkNewMacro(ComponentSetup);
00059   static Pointer New(ComponentSetup* pParentComponent, const ComponentID& compID = cComp_NotDefined);
00060 
00061   inline bool ControllerIsAssigned() const { return GetControllerID()!=csUndefinedController; };
00062 
00065   void SetControllerID(const std::string& sControllerID);
00069   std::string GetControllerID() const { return m_sControllerID; };
00070 
00073   void SetComment(const std::string& sComment) { m_sComment = sComment; };
00075   std::string GetComment() const { return m_sComment; };
00076 
00079   void SetComponentID( const ComponentID& componentID );
00082   const ComponentID& GetComponentID() const { return m_ComponentID; };
00085   ComponentID& GetComponentID() { return m_ComponentID; };
00086 
00089   void SetTemplateID(const std::string& sTemplateID) {m_sTemplateID = sTemplateID; };
00091   const std::string& GetTemplateID() const { return m_sTemplateID; };
00094   bool IsTemplateBased() const {return m_sTemplateID.size()>0;};
00095 
00098   ParameterCollection& Parameters() { return m_Parameters; };
00099   const ParameterCollection& Parameters() const { return m_Parameters; };
00100 
00103   ComponentMediaLinks& MediaLinks() { return m_Links; };
00104   const ComponentMediaLinks& MediaLinks() const { return m_Links; };
00105 
00108   ComponentSetupCollection& Components() { return *m_Components; };
00109   const ComponentSetupCollection& Components() const { return *m_Components; };
00110 
00112   bool HasParentComponent() const;
00115   const ComponentSetup* GetParentComponent() const;
00117   ComponentSetup* GetParentComponent();
00118 
00123   const ComponentSetup* GetRootComponent() const;
00125   ComponentSetup* GetRootComponent();
00126 
00131   ComponentSetup* GetComponentByIDPath(const IDPath& idPath);
00132 
00134   IDPath GetIDPath() const;
00135 
00138   bool operator == (const std::string& sControllerID) const;
00139 
00141   virtual ComponentSetup& operator = (const ComponentSetup& rComponentSetup);
00142 
00143   virtual void ResetParameters ();
00144 
00147   virtual void Reset();
00148 
00149 protected:
00151   ComponentSetup( );
00152 
00157   ComponentSetup(ComponentSetup* pParentComponent, const ComponentID& compID = cComp_NotDefined);
00158 
00159   virtual ~ComponentSetup();
00160 
00162   virtual void SubElementLoadProcessing(const std::string& rsXMLSubTag, const std::string& rsXMLSubElement, const std::string& rsXMLSubData);
00163 
00165   virtual std::string SaveData(const unsigned int& iDepth, bool& bHasSubElements) const;
00166 
00168   virtual void AttributesLoadProcessing(const AttributesType& rAttributes);
00169 
00171   virtual void SaveAttributes(AttributesSaveListType& rAttributes) const;
00172 
00177   std::string m_sControllerID;
00178 
00180   std::string m_sComment;
00181 
00185   ComponentID m_ComponentID;
00186 
00192   std::string m_sTemplateID;
00193 
00195   ParameterCollection m_Parameters;
00196 
00198   ComponentMediaLinks m_Links;
00199 
00201   ComponentSetupCollection* m_Components;
00202 
00204   ComponentSetup* m_pParent;
00205 
00206 private:
00207     ComponentSetup( const ComponentSetup& rComponentSetup); //suppressing default generation
00208 };
00209 
00210 }//end of namespace FREE
00211 
00212 #endif

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