00001 /*========================================================================= 00002 Program: bbtk 00003 Module: $RCSfile: GConnectorModel.h,v $ 00004 Language: C++ 00005 Date: $Date: 2010/06/22 09:17:27 $ 00006 Version: $Revision: 1.6 $ 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 /**** 00033 * Design and Developpement of BBTK GEditor 00034 * Ricardo A Corredor J <ra.corredor67@uniandes.edu.co> 00035 * RaC - 2010 00036 ****/ 00037 00038 #ifndef __GConnectorModel_h__ 00039 #define __GConnectorModel_h__ 00040 00041 //Includes same project 00042 #include "GlobalConstants.h" 00043 #include "GObjectModel.h" 00044 #include "GPortModel.h" 00045 00046 //Includes creaMaracasVisu 00047 #include <manualContourModel.h> 00048 00049 //Includes std 00050 #include <iostream> 00051 00052 00053 namespace bbtk 00054 { 00055 00056 class GConnectorModel : public GObjectModel 00057 { 00058 00059 public: 00060 00061 //Constructors 00062 GConnectorModel(); 00063 ~GConnectorModel(); 00064 00065 //Public methods 00066 00067 // Sets the start port of the connection that will be used in the manualContourModel 00068 void setStartPort(GPortModel* startPort); 00069 00070 // Sets the end port in the BBTKGEditor connector model and also in the contour model 00071 void setEndPort(GPortModel* endPort); 00072 00073 // Assigns the creaMaracasVisu model 00074 void setManualContourModel(manualContourModel* model); 00075 manualContourModel* getManualContourModel(); 00076 00077 GPortModel* getStartPort(); 00078 GPortModel* getEndPort(); 00079 00080 // Refresh the position of the contourModel first and last points with the data of the connector model 00081 void updateStartEndPoints(); 00082 00083 // Set the ports as NO connected 00084 void disconnectConnection(); 00085 00086 virtual void save(std::string &content); 00087 00088 private: 00089 00090 //Private Attributes 00091 00092 GPortModel* _startPort; 00093 GPortModel* _endPort; 00094 00095 manualContourModel* _model; 00096 00097 //Private Methods 00098 00099 protected: 00100 00101 //Protected Attributes 00102 00103 //Protected methods 00104 00105 }; 00106 00107 00108 } 00109 // namespace bbtk 00110 #endif 00111