00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision: 11256 $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #include "QmitkBaseComponent.h" 00018 #include <itkCommand.h> 00019 #include <qgroupbox.h> 00020 00021 /*************** CONSTRUCTOR ***************/ 00022 QmitkBaseComponent::QmitkBaseComponent(QObject *parent, const char* name) 00023 : QObject(parent), 00024 m_FuncName(name), 00025 m_Parent(parent) 00026 { 00027 } 00028 00029 /*************** DESTRUCTOR ***************/ 00030 QmitkBaseComponent::~QmitkBaseComponent() 00031 { 00032 } 00033 00034 /*************** CONNECTIONS ***************/ 00035 void QmitkBaseComponent::CreateConnections() 00036 { 00037 } 00038 00039 /*************** CREATE CONTAINER WIDGET **************/ 00040 QWidget* QmitkBaseComponent::CreateControlWidget(QWidget* /*parent*/) 00041 { 00042 return (QWidget*) NULL; 00043 } 00044 00045 /*************** TREE CHANGED ( ) ***************/ 00046 void QmitkBaseComponent::TreeChanged() 00047 { 00048 } 00049 00050 00051 /*************** GET DATA TREE ITERATOR ***************/ 00052 QWidget* QmitkBaseComponent::GetGUIControls() 00053 { 00054 return (QWidget*) NULL; 00055 } 00056 00057 /*************** SET FUNCTIONALITY NAME ***************/ 00058 void QmitkBaseComponent::SetFunctionalityName(QString name) 00059 { 00060 m_FuncName = name; 00061 } 00062 00063 /*************** GET FUNCTIONALITY NAME ***************/ 00064 QString QmitkBaseComponent::GetFunctionalityName() 00065 { 00066 return m_FuncName; 00067 } 00068 00069 /*************** GET PARENT ***************/ 00070 QObject* QmitkBaseComponent::GetParent() 00071 { 00072 return m_Parent; 00073 } 00074 00075 /*************** GET CONTENT CONTAINER ***************/ 00076 QGroupBox* QmitkBaseComponent::GetContentContainer() 00077 { 00078 return (QGroupBox*) NULL; 00079 } 00080 00081 /************ GET MAIN CHECK BOX CONTAINER ************/ 00082 QGroupBox* QmitkBaseComponent::GetMainCheckBoxContainer() 00083 { 00084 return (QGroupBox*) NULL; 00085 } 00086 00087 /*********** SET CONTENT CONTAINER VISIBLE ************/ 00088 void QmitkBaseComponent::SetContentContainerVisibility(bool) 00089 { 00090 } 00091 00092 /*************** ACTIVATED ***************/ 00093 void QmitkBaseComponent::Activated() 00094 { 00095 m_Activated = true; 00096 } 00097 00098 /*************** DEACTIVATED ***************/ 00099 void QmitkBaseComponent::Deactivated() 00100 { 00101 m_Activated = false; 00102 } 00103 00104 /*************** IS ACTIVATED ***************/ 00105 bool QmitkBaseComponent::IsActivated() 00106 { 00107 return m_Activated; 00108 } 00109 00110 /*************** IS AVAILABLE ***************/ 00111 bool QmitkBaseComponent::IsAvailable() 00112 { 00113 return m_Available; 00114 } 00115 00116 /*************** SET AVAILABLE ***************/ 00117 void QmitkBaseComponent::SetAvailability(bool available) 00118 { 00119 this->m_Available = available; 00120 } 00121 00122 /*************** ADD COMPONENT LISTENER ***************/ 00123 void QmitkBaseComponent::AddComponentListener(QmitkBaseComponent* component) 00124 { 00125 if(component!=NULL) 00126 { 00127 m_AddedChildList.push_back(component); 00128 } 00129 } 00130 00131 /************* REMOVE COMPONENT LISTENER **************/ 00132 void QmitkBaseComponent::RemoveComponentListener(QmitkBaseComponent* component) 00133 { 00134 if(component!=NULL) 00135 { 00136 std::vector<QmitkBaseComponent*>::iterator it = m_AddedChildList.begin(); 00137 while (it != m_AddedChildList.end()) 00138 { 00139 if(*it == component) 00140 { 00141 m_AddedChildList.erase(it); 00142 break; 00143 } 00144 ++it; 00145 } 00146 } 00147 }