00001 /*========================================================================= 00002 Program: bbtk 00003 Module: $RCSfile: GComplexBoxPortModel.cxx,v $ 00004 Language: C++ 00005 Date: $Date: 2010/06/22 09:17:27 $ 00006 Version: $Revision: 1.3 $ 00007 =========================================================================*/ 00008 00009 /* --------------------------------------------------------------------- 00010 00011 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) 00012 * Authors : 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 #include "GComplexBoxPortModel.h" 00038 00039 namespace bbtk 00040 { 00041 //========================================================================= 00042 00043 GComplexBoxPortModel::GComplexBoxPortModel() 00044 { 00045 } 00046 00047 //========================================================================= 00048 00049 GComplexBoxPortModel::~GComplexBoxPortModel() 00050 { 00051 } 00052 00053 //========================================================================= 00054 00055 void GComplexBoxPortModel::setInicPoint(double& x, double& y, double& z) 00056 { 00057 GObjectModel::setInicPoint(x,y,z); 00058 00059 double xFin=x+COMPLEXPORT_WIDTH,yFin=y-COMPLEXPORT_HEIGHT; 00060 setFinalPoint(xFin,yFin,z); 00061 } 00062 00063 //========================================================================= 00064 00065 std::string GComplexBoxPortModel::getStatusText() 00066 { 00067 std::string temp = ""; 00068 temp+=_bbtkName; 00069 00070 return temp; 00071 } 00072 00073 //========================================================================= 00074 00075 void GComplexBoxPortModel::save(std::string &content) 00076 { 00077 content+="COMPLEX_PORT\n"; 00078 // Box info 00079 content+=_bbtkName; 00080 content+="\n"; 00081 00082 //Box Position 00083 char buffer [50]; 00084 sprintf (buffer, "%f", _xInic); 00085 content+=buffer; 00086 content+=":"; 00087 sprintf (buffer, "%f", _yInic); 00088 content+=buffer; 00089 content+=":"; 00090 sprintf (buffer, "%f", _zInic); 00091 content+=buffer; 00092 content+="\n"; 00093 00094 content+="FIN_COMPLEX_PORT\n"; 00095 00096 } 00097 00098 //========================================================================= 00099 00100 int GComplexBoxPortModel::getComplexPortType() 00101 { 00102 return _complexPortType; 00103 } 00104 00105 //========================================================================= 00106 00107 void GComplexBoxPortModel::setComplexPortType(int pType) 00108 { 00109 _complexPortType=pType; 00110 } 00111 00112 //========================================================================= 00113 00114 } // EO namespace bbtk 00115 00116 // EOF 00117