}
//=========================================================================
- void GBlackBoxModel::updateBlackBox(BlackBoxDescriptor::Pointer descriptor)//virtual
+ void GBlackBoxModel::addInputPort(GPortModel *inputport)
{
- _desc=descriptor;
- std::cout<<"RaC Box author:"<<_desc->GetAuthor()<<std::endl;
+ _inputs.push_back(inputport);
}
//=========================================================================
+
+ void GBlackBoxModel::addOutputPort(GPortModel *outputport)
+ {
+ _outputs.push_back(outputport);
+ }
+
+ //=========================================================================
+
} // EO namespace bbtk
// EOF
namespace bbtk
{
+ class GPortModel;
+
class GBlackBoxModel : public GObjectModel
{
~GBlackBoxModel();
//Public methods
- virtual void updateBlackBox(BlackBoxDescriptor::Pointer descriptor);
+ void addInputPort(GPortModel *inputport);
+ void addOutputPort(GPortModel *outputport);
+
private:
//Attributes
- BlackBoxDescriptor::Pointer _desc;
-
+ std::vector<GPortModel*> _inputs;
+ std::vector<GPortModel*> _outputs;
+
//Private Methods
protected:
//=========================================================================
+ void GObjectModel::setGObjectType(int gObjectType)
+ {
+ _gObjectType = gObjectType;
+ }
+
+ //=========================================================================
+
+ int GObjectModel::getGObjectType()
+ {
+ return _gObjectType;
+ }
+
+ //=========================================================================
+
bool GObjectModel::isPointInside(double x,double y, double z)//virtual
{
if(x>=_xInic && x<=_xFin && y<=_yInic && y>=_yFin)
}
//=========================================================================
+
+
+ //=========================================================================
+
} // EO namespace bbtk
// EOF
//Includes same project
#include "GlobalConstants.h"
+#include "Observable.h"
//Includes creaMaracasVisu
namespace bbtk
{
- class GObjectModel
+ class GObjectModel //: public Observable
{
public:
void setFinalPoint(double& x, double& y, double& z);
void setState(int state);
int getState();
+
virtual bool isPointInside(double x,double y, double z);
virtual void updateBlackBox(BlackBoxDescriptor::Pointer descriptor);
+ int getGObjectType();
+ void setGObjectType(int obtype);
+
private:
//Private Attributes
double _zFin;
int _state;
+ int _gObjectType;
//Protected methods
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+* This software is governed by the CeCILL-B license under French law and
+* abiding by the rules of distribution of free software. You can use,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+/**
+* \file
+* \brief Class bbtk::GPortModel
+*/
+
+
+#include "GPortModel.h"
+
+namespace bbtk
+{
+
+
+ //=========================================================================
+ GPortModel::GPortModel()
+ {
+ _parentBox = NULL;
+ }
+
+ //=========================================================================
+ GPortModel::~GPortModel()
+ {
+ }
+ //=========================================================================
+
+ void GPortModel::registerInBox(GBlackBoxModel *blackBox)
+ {
+ _parentBox = blackBox;
+ }
+
+ //=========================================================================
+} // EO namespace bbtk
+
+// EOF
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+* This software is governed by the CeCILL-B license under French law and
+* abiding by the rules of distribution of free software. You can use,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+
+
+/**
+* \file
+* \brief Class bbtk::GPortModel : abstract black-box interface.
+*/
+
+/**
+* \class bbtk::GPortModel
+* \brief
+*/
+
+#ifndef __GPortModel_h__
+#define __GPortModel_h__
+
+//Includes same project
+#include "GlobalConstants.h"
+#include "GObjectModel.h"
+
+//Includes creaMaracasVisu
+
+//Includes std
+#include <iostream>
+
+
+namespace bbtk
+{
+
+ class GBlackBoxModel;
+
+ class GPortModel : public GObjectModel
+ {
+
+ public:
+
+ //Constructors
+ GPortModel();
+ ~GPortModel();
+
+ //Public methods
+ void registerInBox(GBlackBoxModel *blackBox);
+ private:
+
+ //Attributes
+
+ GBlackBoxModel *_parentBox;
+
+ //Private Methods
+
+ protected:
+ //Protected methods
+
+ };
+
+
+}
+// namespace bbtk
+#endif
+
const int GBLACKBOX = 1;
const int GCONNECTOR = 2;
const int GPORT = 3;
+ const int GINPUTPORT = 4;
+ const int GOUTPUTPORT = 5;
// Object states
static const int NOTHING_HAPPENS = 101;
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+* This software is governed by the CeCILL-B license under French law and
+* abiding by the rules of distribution of free software. You can use,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+/**
+* \file
+* \brief Class bbtk::Observable
+*/
+
+
+#include "Observable.h"
+
+namespace bbtk
+{
+
+
+ //=========================================================================
+ Observable::Observable()
+ {
+ _changed=false;
+ }
+
+ //=========================================================================
+ Observable::~Observable()
+ {
+ }
+ //=========================================================================
+
+ bool Observable::hasChanged()
+ {
+ return _changed;
+ }
+
+ //=========================================================================
+
+ void Observable::notifyObservers()
+ {
+ int i;
+ for(i=0;i<_observers.size();i++)
+ {
+ _observers[i]->update();
+ }
+ _changed=false;
+ }
+
+ //=========================================================================
+
+ void Observable::setChanged()
+ {
+ _changed=true;
+ }
+
+ //=========================================================================
+
+} // EO namespace bbtk
+
+// EOF
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+* This software is governed by the CeCILL-B license under French law and
+* abiding by the rules of distribution of free software. You can use,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+
+
+/**
+* \file
+* \brief Class bbtk::Observable : abstract black-box interface.
+*/
+
+/**
+* \class bbtk::Observable
+* \brief
+*/
+
+#ifndef __Observable_h__
+#define __Observable_h__
+
+//Includes same project
+
+#include "Observer.h"
+
+//Includes std
+#include <iostream>
+#include <vector>
+
+namespace bbtk
+{
+
+ class Observable
+ {
+
+ public:
+
+ //Constructors
+ Observable();
+ ~Observable();
+
+ //Public methods
+ void addObserver(Observer *observer);
+
+ bool hasChanged();
+
+ void notifyObservers();
+
+ void setChanged();
+
+ private:
+
+ //Private Attributes
+ bool _changed;
+
+ std::vector<Observer*> _observers;
+
+ //Private Methods
+
+ protected:
+
+ //Protected Attributes
+
+ //Protected methods
+
+ };
+
+
+}
+// namespace bbtk
+#endif
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+* This software is governed by the CeCILL-B license under French law and
+* abiding by the rules of distribution of free software. You can use,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+/**
+* \file
+* \brief Class bbtk::Observer
+*/
+
+
+#include "Observer.h"
+
+namespace bbtk
+{
+
+
+ //=========================================================================
+ Observer::Observer()
+ {
+ }
+
+ //=========================================================================
+ Observer::~Observer()
+ {
+ }
+ //=========================================================================
+
+ void Observer::update() //virtual
+ {
+ //virtual
+ }
+
+ //=========================================================================
+
+} // EO namespace bbtk
+
+// EOF
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+* This software is governed by the CeCILL-B license under French law and
+* abiding by the rules of distribution of free software. You can use,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+
+
+/**
+* \file
+* \brief Class bbtk::Observer : abstract black-box interface.
+*/
+
+/**
+* \class bbtk::Observer
+* \brief
+*/
+
+#ifndef __Observer_h__
+#define __Observer_h__
+
+//Includes std
+#include <iostream>
+
+namespace bbtk
+{
+
+ class Observer
+ {
+
+ public:
+
+ //Constructors
+ Observer();
+ ~Observer();
+
+ //Public methods
+ void update();
+
+
+ private:
+
+ //Private Attributes
+
+ //Private Methods
+
+ protected:
+
+ //Protected Attributes
+
+ //Protected methods
+
+ };
+
+
+}
+// namespace bbtk
+#endif
+
int type = GBLACKBOX;
//Create the MVC Objects
- GObjectModel *model = GObjectsMVCFactory::getInstance()->createGObjectModel(type);
+ GBlackBoxModel *model = (GBlackBoxModel*)GObjectsMVCFactory::getInstance()->createGObjectModel(type);
vtkGObjectView *view = GObjectsMVCFactory::getInstance()->createGObjectView(type);
GObjectController* controller = GObjectsMVCFactory::getInstance()->createGObjectController(type);
double zz = 0;
_baseView->TransCoordScreenToWorld(xx,yy,zz);
model->setInicPoint(xx,yy,zz);
- model->updateBlackBox(descriptor);
+ //model->addObserver(view);
+
+ //Iterate and create the input ports
+ std::map<std::string, BlackBoxInputDescriptor*> descriptorMap = descriptor->GetInputDescriptorMap();
+ std::map<std::string, BlackBoxInputDescriptor*>::iterator it;
+
+ //ERASE
+ cantTemp=0;
+
+ for(it = descriptorMap.begin(); it != descriptorMap.end(); ++it)
+ {
+ BlackBoxInputDescriptor *desc = it->second;
+ createGInputPort(desc,model);
+
+ //ERASE
+ cantTemp+=2;
+ }
//Associates the view with the correspondent renderer and the model.
//=========================================================================
+ void wxVtkSceneManager::createGInputPort(BlackBoxInputDescriptor *desc,GBlackBoxModel *blackBox)
+ {
+ int type = GPORT;
+
+ //Create the MVC Objects
+ GPortModel *model = (GPortModel*)GObjectsMVCFactory::getInstance()->createGObjectModel(type);
+ vtkGObjectView *view = GObjectsMVCFactory::getInstance()->createGObjectView(type);
+ GObjectController* controller = GObjectsMVCFactory::getInstance()->createGObjectController(type);
+
+ model->registerInBox(blackBox);
+ blackBox->addInputPort(model);
+
+
+ //Prepares the initial model
+ double xx = 0;
+ double yy = 0;
+ double zz = 0;
+ blackBox->getInicPoint(xx,yy,zz);
+
+ xx++;
+ yy+=cantTemp;
+ model->setInicPoint(xx,yy,zz);
+
+ //Associates the view with the correspondent renderer and the model.
+ //(NOTE: Refresh is only made by the view)
+ view->setModel(model);
+ view->setBaseView(_baseView);
+ view->initVtkObjects();
+
+ //Associates the controller with the correspondent model and view
+ controller->setModelAndView(model,view);
+ }
+
+ //=========================================================================
+
+ void wxVtkSceneManager::createGOutputPort(BlackBoxOutputDescriptor *desc,GBlackBoxModel *blackBox)
+ {
+ int type = GPORT;
+
+ //Create the MVC Objects
+ GPortModel *model = (GPortModel*)GObjectsMVCFactory::getInstance()->createGObjectModel(type);
+ vtkGObjectView *view = GObjectsMVCFactory::getInstance()->createGObjectView(type);
+ GObjectController* controller = GObjectsMVCFactory::getInstance()->createGObjectController(type);
+
+ model->registerInBox(blackBox);
+ blackBox->addOutputPort(model);
+ }
+
+ //=========================================================================
+
void wxVtkSceneManager::registerController(InteractorStyleMaracas *param)
{
vtkInteractorStyleBaseView* baseViewControlManager = (vtkInteractorStyleBaseView*)_baseView->GetInteractorStyleBaseView();
//Includes same project
#include "GObjectsMVCFactory.h"
+//Includes bbtk
+#include <bbtkBlackBoxInputDescriptor.h>
+#include <bbtkBlackBoxDescriptor.h>
+
//Includes creaMaracasVisu
#include <wxVtk3DBaseView.h>
#include <InteractorStyleMaracas.h>
//Includes std
#include <iostream>
+#include <map>
+
namespace bbtk
{
void configureBaseView();
void createGBlackBox(int x, int y,std::string packageName, std::string boxName);
+ void createGInputPort(BlackBoxInputDescriptor *desc,GBlackBoxModel *blackBox);
+ void createGOutputPort(BlackBoxOutputDescriptor *desc,GBlackBoxModel *blackBox);
void registerController(InteractorStyleMaracas *param);
vtkRenderWindow* getRenderWindow();
wxVtk3DBaseView *_baseView;
void refreshRenderWindow();
+
+ //ERASE
+ int cantTemp;
protected:
};
}
}
- _view->refresh();
+ _view->update();
}
return true;
}
{
view = new vtkGBlackBoxView();
}
+ else if(type == GPORT)
+ {
+ view = new vtkGPortView();
+ }
return view;
}
{
controller = new GBlackBoxController();
}
+ else if(type == GPORT)
+ {
+ controller = new GPortController();
+ }
return controller;
}
{
model = new GBlackBoxModel();
}
+ else if(type == GPORT)
+ {
+ model = new GPortModel();
+ }
return model;
}
#include "GObjectController.h"
#include "GObjectModel.h"
#include "vtkGObjectView.h"
+
#include "GBlackBoxController.h"
#include "vtkGBlackBoxView.h"
#include "GBlackBoxModel.h"
+#include "GPortController.h"
+#include "vtkGPortView.h"
+#include "GPortModel.h"
+
+
//Includes creaMaracasVisu
//Includes std
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+* This software is governed by the CeCILL-B license under French law and
+* abiding by the rules of distribution of free software. You can use,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+/**
+* \file
+* \brief Class bbtk::GPortController
+*/
+
+
+#include "GPortController.h"
+
+namespace bbtk
+{
+
+
+ //=========================================================================
+ GPortController::GPortController()
+ {
+
+ }
+
+ //=========================================================================
+ GPortController::~GPortController()
+ {
+ }
+ //=========================================================================
+
+
+ //=========================================================================
+
+} // EO namespace bbtk
+
+// EOF
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+* This software is governed by the CeCILL-B license under French law and
+* abiding by the rules of distribution of free software. You can use,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+
+
+/**
+* \file
+* \brief Class bbtk::GPortController :
+*/
+
+/**
+* \class bbtk::GPortController
+* \brief
+*/
+
+#ifndef __GPortController_h__
+#define __GPortController_h__
+
+//Includes same project
+#include "GlobalConstants.h"
+#include "GObjectController.h"
+
+//Includes creaMaracasVisu
+
+//Includes std
+#include <iostream>
+
+
+namespace bbtk
+{
+
+ class GPortController : public GObjectController
+ {
+
+ public:
+
+ //Constructors
+ GPortController();
+ ~GPortController();
+
+ //Public methods
+
+
+ private:
+
+ //Attributes
+
+ //Private Methods
+
+ protected:
+
+ };
+
+
+}
+// namespace bbtk
+#endif
+
}
//=========================================================================
- void vtkGBlackBoxView::refresh()
+ void vtkGBlackBoxView::update()
{
//paint();
if(_model->getState()==HIGHLIGHTED)
//Protected Methods
virtual void createVtkObjects();
- virtual void refresh();
+ virtual void update();
};
}
//=========================================================================
- void vtkGObjectView::refresh()
+ void vtkGObjectView::update()
{
if(_model->getState()==NOTHING_HAPPENS)
{
//Includes same project
#include "GlobalConstants.h"
#include "GObjectModel.h"
+#include "Observer.h"
//Includes creaMaracasVisu
#include <wxVtkBaseView.h>
namespace bbtk
{
- class vtkGObjectView
+ class vtkGObjectView //: public Observer
{
public:
bool isPointInside(int X,int Y);
- virtual void refresh();
+ virtual void update();
private:
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+* This software is governed by the CeCILL-B license under French law and
+* abiding by the rules of distribution of free software. You can use,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+/**
+* \file
+* \brief Class bbtk::vtkGPortView
+*/
+
+
+#include "vtkGPortView.h"
+
+namespace bbtk
+{
+
+
+ //=========================================================================
+ vtkGPortView::vtkGPortView()
+ {
+ }
+
+ //=========================================================================
+ vtkGPortView::~vtkGPortView()
+ {
+ }
+
+ //=========================================================================
+ void vtkGPortView::update()
+ {
+ //paint();
+ if(_model->getState()==HIGHLIGHTED)
+ {
+ _objectActor->GetProperty()->SetColor(0.0,0.2,0.5);
+ }
+ else
+ {
+ _objectActor->GetProperty()->SetColor(0.3,0.2,0.2);
+ }
+ _baseView->GetRenderer()->Render();
+ }
+
+ //=========================================================================
+
+ void vtkGPortView::createVtkObjects() //virtual
+ {
+ vtkPoints *_pts = vtkPoints::New();
+ vtkCellArray *lines = vtkCellArray::New();
+ vtkPolyData *_pd = vtkPolyData::New();
+ vtkPolyDataMapper* _bboxMapper=vtkPolyDataMapper::New();
+ _objectActor=vtkActor::New();
+
+ _pts->SetNumberOfPoints(4);
+
+ double xInic, yInic,zInic,xFin, yFin,zFin;
+ _model->getInicPoint(xInic,yInic,zInic);
+ _model->getFinalPoint(xFin, yFin,zFin);
+ cout<<"RaC ----------"<<endl;
+ cout<<"RaC vtkGPortView::createVtkObjects() inic:"<<xInic<<" "<<yInic<<" "<<zInic<<endl;
+ cout<<"RaC vtkGPortView::createVtkObjects() fin:"<<xFin<<" "<<yFin<<" "<<zFin<<endl;
+
+ _pts->SetPoint(0, xInic, yInic, 0 );
+ _pts->SetPoint(1, xInic, yFin, 0 );
+ _pts->SetPoint(2, xFin, yFin, 0 );
+ _pts->SetPoint(3, xFin, yInic, 0 );
+
+ lines->InsertNextCell(5);
+ lines->InsertCellPoint(0);
+ lines->InsertCellPoint(1);
+ lines->InsertCellPoint(2);
+ lines->InsertCellPoint(3);
+ lines->InsertCellPoint(0);
+
+ _pd->SetPoints( _pts );
+ _pd->SetLines( lines );
+
+ _bboxMapper->SetInput(_pd);
+ _objectActor->SetMapper(_bboxMapper);
+
+ _objectActor->GetProperty()->SetColor(0.8,0.0,0.0);
+
+ }
+
+ //=========================================================================
+
+
+} // EO namespace bbtk
+
+// EOF
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+* This software is governed by the CeCILL-B license under French law and
+* abiding by the rules of distribution of free software. You can use,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+
+
+/**
+* \file
+* \brief Class bbtk::vtkGPortView : abstract black-box interface.
+*/
+
+/**
+* \class bbtk::vtkGPortView
+* \brief
+*/
+
+#ifndef __vtkGPortView_h__
+#define __vtkGPortView_h__
+
+//Includes same project
+#include "GlobalConstants.h"
+#include "vtkGObjectView.h"
+
+//Includes creaMaracasVisu
+
+//Includes vtk
+
+#include "vtkPolyDataMapper.h"
+#include "vtkActor.h"
+
+#include "vtkRenderer.h"
+#include "vtkCellArray.h"
+
+
+//Includes std
+#include <iostream>
+
+
+namespace bbtk
+{
+
+ class vtkGPortView : public vtkGObjectView
+ {
+
+ public:
+
+ //Constructors
+ vtkGPortView();
+ ~vtkGPortView();
+
+ //Public methods
+
+ private:
+
+ //Private Attributes
+
+ //Private Methods
+
+ protected:
+
+ //Protected Attributes
+
+ //Protected Methods
+ virtual void createVtkObjects();
+ virtual void update();
+ };
+
+
+}
+// namespace bbtk
+#endif
+