00001 /*========================================================================= 00002 Program: bbtk 00003 Module: $RCSfile: GBlackBoxModel.h,v $ 00004 Language: C++ 00005 Date: $Date: 2010/06/22 09:17:27 $ 00006 Version: $Revision: 1.16 $ 00007 =========================================================================*/ 00008 00009 /* --------------------------------------------------------------------- 00010 00011 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) 00012 * Authors : Ricardo A Corredor, Eduardo Davila, Laurent Guigues, Jean-Pierre Roux 00013 * 00014 * This software is governed by the CeCILL-B license under French law and 00015 * abiding by the rules of distribution of free software. You can use, 00016 * modify and/ or redistribute the software under the terms of the CeCILL-B 00017 * license as circulated by CEA, CNRS and INRIA at the following URL 00018 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 00019 * or in the file LICENSE.txt. 00020 * 00021 * As a counterpart to the access to the source code and rights to copy, 00022 * modify and redistribute granted by the license, users are provided only 00023 * with a limited warranty and the software's author, the holder of the 00024 * economic rights, and the successive licensors have only limited 00025 * liability. 00026 * 00027 * The fact that you are presently reading this means that you have had 00028 * knowledge of the CeCILL-B license and that you accept its terms. 00029 * ------------------------------------------------------------------------ */ 00030 00031 /**** 00032 * Design and Developpement of BBTK GEditor 00033 * Ricardo A Corredor J <ra.corredor67@uniandes.edu.co> 00034 * RaC - 2010 00035 ****/ 00036 00037 #ifndef __GBlackBoxModel_h__ 00038 #define __GBlackBoxModel_h__ 00039 00040 //Includes same project 00041 #include "GlobalConstants.h" 00042 #include "GBoxModel.h" 00043 00044 //Includes creaMaracasVisu 00045 00046 //Includes std 00047 #include <iostream> 00048 00049 00050 namespace bbtk 00051 { 00052 00053 class GBlackBoxModel : public GBoxModel 00054 { 00055 00056 public: 00057 00058 //Constructors 00059 GBlackBoxModel(); 00060 ~GBlackBoxModel(); 00061 00062 //Public methods 00063 00064 // The black box has an specific package (important to search in the list with the BBTK Interpreter) 00065 std::string getBBTKPackage(); 00066 void setBBTKPackage(std::string obpackage); 00067 00068 // Text in the status bar 00069 virtual std::string getStatusText(); 00070 00071 // Method to write the information of the black box to be saved in the parameter string 00072 virtual void save(std::string &content); 00073 00074 // Is the black box executable or not 00075 bool isExecutable(); 00076 void setExecutable(bool executable); 00077 00078 // Set 'value' to the port in position 'pos' 00079 void setValueToInputPort(int pos,std::string value); 00080 00081 // Set 'value' to the port with name 'name' 00082 void setValueToInput(std::string name,std::string value); 00083 00084 // Get the value of the port in position 'pos' 00085 std::string getValueInputPort(int pos); 00086 00087 // Get the value of the port with name 'name' 00088 std::string getValueInput(std::string name); 00089 00090 // Get id's of the connected inputs 00091 std::vector<int> getConnectedInputs(); 00092 // Get id's of the connected outputs 00093 std::vector<int> getConnectedOutputs(); 00094 00095 private: 00096 00097 //Private Attributes 00098 bool _isExecutable; 00099 00100 //Private Methods 00101 00102 protected: 00103 //Protected Attributes 00104 std::string _bbtkPackage; 00105 00106 //Protected methods 00107 00108 }; 00109 00110 00111 } 00112 // namespace bbtk 00113 #endif 00114