//=========================================================================
+ std::string GObjectModel::getBBTKType()
+ {
+ return _bbtkType;
+ }
+
+ //=========================================================================
+
+ void GObjectModel::setBBTKType(std::string obtype)
+ {
+ _bbtkType = obtype;
+ }
+
+ //=========================================================================
+
+ std::string GObjectModel::getBBTKName()
+ {
+ return _bbtkName;
+ }
+
+ //=========================================================================
+
+ void GObjectModel::setBBTKName(std::string obname)
+ {
+ _bbtkName = obname;
+ }
+
+ //=========================================================================
+
} // EO namespace bbtk
// EOF
int getGObjectType();
void setGObjectType(int obtype);
+
+ std::string getBBTKType();
+ void setBBTKType(std::string obtype);
+ std::string getBBTKName();
+ void setBBTKName(std::string obname);
private:
int _state;
int _gObjectType;
+ std::string _bbtkType;
+ std::string _bbtkName;
+
//Protected methods
};
const int CREATING_CONTOUR=106;
// Object dimensions
- const double BOX_HEIGHT=0.1;
+ const double BOX_HEIGHT=0.15;
const double BOX_WIDTH=1.0;
const double PORT_HEIGHT=0.04;
const double PORT_WIDTH=0.04;
getRenderer()->AddActor(_pointVtkActor);
-
+ // Create a vector text
+ vtkVectorText* vecText = vtkVectorText::New();
+ vecText->SetText("vtkVectorText");
+
+ vtkPolyDataMapper* txtMapper = vtkPolyDataMapper::New();
+ txtMapper->SetInputConnection( vecText->GetOutputPort());
+ vtkActor* txtActor = vtkActor::New();
+ txtActor->SetMapper(txtMapper);
+ //getRenderer()->AddActor(txtActor);
// ******* TO ERASE *******
/////////////////////
_baseView->TransCoordScreenToWorld(xx,yy,zz);
model->setInicPoint(xx,yy,zz);
+ int cantObjects = _objects.size();
+ cantObjects++;
+ std::stringstream stream;
+ stream << "Object " << cantObjects;
+ std::string arraystring = stream.str();
+
+ model->setBBTKName(arraystring);
+ model->setBBTKType(boxName);
+
model->addObserver(view);
model->addObserver(this);
if(command==INIT_CREATION_CONTOUR)
{
- std::cout<<"wxVtkSceneManager::update size:"<<_objects.size()<<std::endl;
for(int i = 0; i<_objects.size();i++)
{
- std::cout<<"wxVtkSceneManager::update type:"<<_objects[i]->getGObjectType()<<std::endl;
if(_objects[i]->getGObjectType() == GBLACKBOX)
{
GPortModel* startInputPort=((GBlackBoxModel*)_objects[i])->getStartInputPort();
- std::cout<<"wxVtkSceneManager::update "<<startInputPort<<std::endl;
createGConnector(startInputPort);
}
#include <vtkRenderer.h>
#include <vtkInteractorStyleImage.h>
+#include <vtkVectorText.h>
+#include <vtkLinearExtrusionFilter.h>
+
//Includes std
#include <iostream>
#include <map>
{
_objectActor->GetProperty()->SetLineWidth(1);
_objectActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
+ _nameActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
+ _typeActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
}
else if(_model->getState()==HIGHLIGHTED)
{
_objectActor->GetProperty()->SetLineWidth(2);
_objectActor->GetProperty()->SetColor(BOXCONTOUR_HIGHLIGHTED_R,BOXCONTOUR_HIGHLIGHTED_G,BOXCONTOUR_HIGHLIGHTED_B);
+ _nameActor->GetProperty()->SetColor(BOXCONTOUR_HIGHLIGHTED_R,BOXCONTOUR_HIGHLIGHTED_G,BOXCONTOUR_HIGHLIGHTED_B);
+ _typeActor->GetProperty()->SetColor(BOXCONTOUR_HIGHLIGHTED_R,BOXCONTOUR_HIGHLIGHTED_G,BOXCONTOUR_HIGHLIGHTED_B);
}
else if(_model->getState()==DRAG)
{
_objectActor->GetProperty()->SetLineWidth(1.2);
_objectActor->GetProperty()->SetColor(BOXCONTOUR_DRAG_R,BOXCONTOUR_DRAG_G,BOXCONTOUR_DRAG_B);
+ _nameActor->GetProperty()->SetColor(BOXCONTOUR_DRAG_R,BOXCONTOUR_DRAG_G,BOXCONTOUR_DRAG_B);
+ _typeActor->GetProperty()->SetColor(BOXCONTOUR_DRAG_R,BOXCONTOUR_DRAG_G,BOXCONTOUR_DRAG_B);
}
else if(_model->getState()==SELECTED)
{
_objectActor->GetProperty()->SetLineWidth(2);
_objectActor->GetProperty()->SetColor(BOXCONTOUR_SELECTED_R,BOXCONTOUR_SELECTED_G,BOXCONTOUR_SELECTED_B);
+ _nameActor->GetProperty()->SetColor(BOXCONTOUR_SELECTED_R,BOXCONTOUR_SELECTED_G,BOXCONTOUR_SELECTED_B);
+ _typeActor->GetProperty()->SetColor(BOXCONTOUR_SELECTED_R,BOXCONTOUR_SELECTED_G,BOXCONTOUR_SELECTED_B);
}
double xInic, yInic,zInic,xFin, yFin,zFin;
_pts->SetPoint(2, xFin, yFin, 0 );
_pts->SetPoint(3, xFin, yInic, 0 );
+ //-----------
+
+ updatePositionTextActors(xInic, yInic,zInic);
+
+ //-----------
+
_baseView->GetRenWin()->Render();
}
void vtkGBlackBoxView::createVtkObjects() //virtual
{
+
+ //------------
_pts = vtkPoints::New();
vtkCellArray *lines = vtkCellArray::New();
vtkPolyData *_pd = vtkPolyData::New();
_objectActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
+ //------------
+
+ _vectorNameText = vtkVectorText::New();
+ std::string temp = _model->getBBTKName();
+ _vectorNameText->SetText(temp.c_str());
+
+ vtkPolyDataMapper* txtMapper = vtkPolyDataMapper::New();
+ txtMapper->SetInputConnection( _vectorNameText->GetOutputPort());
+ _nameActor = vtkActor::New();
+ _nameActor->SetMapper(txtMapper);
+
+ //------------
+
+ _vectorTypeText = vtkVectorText::New();
+ temp = _model->getBBTKType();
+ _vectorTypeText->SetText(temp.c_str());
+
+ txtMapper = vtkPolyDataMapper::New();
+ txtMapper->SetInputConnection( _vectorTypeText->GetOutputPort());
+ _typeActor = vtkActor::New();
+ _typeActor->SetMapper(txtMapper);
+
+ //------------
+
+ updatePositionTextActors( xInic, yInic, zInic);
+ _nameActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
+ _typeActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
+
+ }
+
+ //=========================================================================
+
+ void vtkGBlackBoxView::addVtkActors()//virtual
+ {
+ _baseView->GetRenderer()->AddActor(_nameActor);
+ _baseView->GetRenderer()->AddActor(_typeActor);
+
+ vtkGObjectView::addVtkActors();
}
//=========================================================================
+ void vtkGBlackBoxView::updatePositionTextActors(double xInic, double yInic, double zInic)
+ {
+ _nameActor->SetPosition(xInic+0.04,yInic-0.05,zInic);
+ _nameActor->SetScale(0.03,0.02,1);
+
+ _typeActor->SetPosition(xInic+0.04,yInic-0.1,zInic);
+ _typeActor->SetScale(0.03,0.02,1);
+ }
+
} // EO namespace bbtk
#include "vtkPolyDataMapper.h"
#include "vtkActor.h"
-
+#include "vtkVectorText.h"
#include "vtkRenderer.h"
#include "vtkCellArray.h"
//Private Attributes
vtkPoints *_pts;
+ vtkActor* _nameActor;
+ vtkActor* _typeActor;
+ vtkVectorText* _vectorNameText;
+ vtkVectorText* _vectorTypeText;
//Private Methods
+ void updatePositionTextActors(double xInic, double yInic, double zInic);
protected:
//Protected Attributes
//Protected Methods
+ virtual void addVtkActors();
virtual void createVtkObjects();
virtual void update(int command);
};
initTabPanelsManager();
initPackageBrowser();
initHelpHTMLBrowser();
+ initPropertiesPanel();
CreateStatusBar();
_frameAUIMgr->Update();
//================================================================
+ void wxGUIEditorGraphicBBS::initPropertiesPanel()
+ {
+ _propertiesPanel = new wxPropertiesPanel(this);
+ _frameAUIMgr->AddPane(_propertiesPanel,wxAuiPaneInfo().Right().MinSize(200,200).CloseButton(false).Floatable(false));
+ }
+
+ //================================================================
+
void wxGUIEditorGraphicBBS::DoRegeneratePackageDoc( const std::string& pack )
{
std::string mess("Regenerating doc for package '");
//Includes same project
#include "wxTabPanelsManager.h"
+#include "wxPropertiesPanel.h"
#include "wxart_new.xpm"
//Includes creaMaracasVisu
#include <wx/bitmap.h>
#include <wx/menu.h>
#include <wx/dnd.h>
+#include <wx/grid.h>
//Includes std
void initTabPanelsManager();
void initPackageBrowser();
void initHelpHTMLBrowser();
+ void initPropertiesPanel();
void RegenerateAll();
void DoRegeneratePackageDoc(const std::string& pack);
wxAuiNotebook *_notebook;
WxGUIPackageBrowser2 *_pkgBrowser;
WxGUIHtmlBrowser *_helpHtmlBrowser;
+ wxPropertiesPanel *_propertiesPanel;
std::string _dataDir;
--- /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::wxPropertiesPanel .
+*/
+
+
+#include "wxPropertiesPanel.h"
+
+
+namespace bbtk
+{
+ //=========================================================================
+ wxPropertiesPanel::wxPropertiesPanel()
+ {
+ _grid=NULL;
+ }
+
+ //=========================================================================
+ wxPropertiesPanel::wxPropertiesPanel(wxWindow *parent):wxPanel(parent)
+ {
+ _grid = new wxGrid(this,wxID_ANY);
+ _grid->CreateGrid(15,2);
+ _grid->SetColLabelSize(0);
+ _grid->SetRowLabelSize(0);
+
+ wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+ sizer->Add(_grid,0,wxEXPAND|wxALL,0);
+ SetSizer(sizer);
+ }
+
+ //=========================================================================
+ wxPropertiesPanel::~wxPropertiesPanel()
+ {
+
+ }
+ //=========================================================================
+
+} // 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::wxPropertiesPanel : abstract black-box interface.
+*/
+
+/**
+* \class bbtk::wxPropertiesPanel
+* \brief
+*/
+
+#ifndef __wxPropertiesPanel_h__
+#define __wxPropertiesPanel_h__
+
+//Includes same project
+
+//Includes wxWidgets
+#include <wx/panel.h>
+#include <wx/aui/aui.h>
+#include <wx/dnd.h>
+#include <wx/grid.h>
+
+//Includes creaMaracasVisu
+
+//Includes std
+#include <iostream>
+
+
+
+
+namespace bbtk
+{
+
+ class wxPropertiesPanel : public wxPanel
+ {
+ public:
+ wxPropertiesPanel();
+ wxPropertiesPanel(wxWindow *parent);
+ ~wxPropertiesPanel();
+
+ private:
+ wxGrid *_grid;
+
+ protected:
+
+ };
+
+
+}
+// namespace bbtk
+#endif
+