1 /*=========================================================================
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 * This software is governed by the CeCILL-B license under French law and
15 * abiding by the rules of distribution of free software. You can use,
16 * modify and/ or redistribute the software under the terms of the CeCILL-B
17 * license as circulated by CEA, CNRS and INRIA at the following URL
18 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 * or in the file LICENSE.txt.
21 * As a counterpart to the access to the source code and rights to copy,
22 * modify and redistribute granted by the license, users are provided only
23 * with a limited warranty and the software's author, the holder of the
24 * economic rights, and the successive licensors have only limited
27 * The fact that you are presently reading this means that you have had
28 * knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
32 * Design and Developpement of BBTK GEditor
33 * Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
37 #ifndef __GBoxModel_h__
38 #define __GBoxModel_h__
40 //Includes same project
41 #include "GlobalConstants.h"
42 #include "GObjectModel.h"
43 #include "GPortModel.h"
45 //Includes creaMaracasVisu
54 // Mandatory when exists a bidirectional relation: GPortModel includes GBoxModel and viceversa
57 class GBoxModel : public GObjectModel
67 virtual void setInicPoint(double& x, double& y, double& z);
69 void addInputPort(GPortModel *inputport);
70 void addOutputPort(GPortModel *outputport);
72 int getNumInputPorts();
73 int getNumOutputPorts();
75 // Change the position of the box and its ports
76 virtual void move(double xx,double yy,double zz);
78 // Text in the status bar
79 virtual std::string getStatusText();
81 // Method to write the information of the black box to be saved in the parameter string
82 virtual void save(std::string &content);
84 // Returns a vector with inputs or outputs
85 std::vector<GPortModel*> getInputPorts();
86 std::vector<GPortModel*> getOutputPorts();
88 // Get input with the name given by parameter
89 GPortModel* getInputPort(std::string name);
90 GPortModel* getInputPort(int pos);
92 // Get output with the name given by parameter
93 GPortModel* getOutputPort(std::string name);
94 GPortModel* getOutputPort(int pos);
96 // Updates the position and finally the view of inputs and outputs
106 //Protected Attributes
108 std::vector<GPortModel*> _inputs;
109 std::vector<GPortModel*> _outputs;