BBTK_BLACK_BOX_IMPLEMENTATION(CutModule,bbtk::WxBlackBox);
void CutModule::Process()
{
-
vtkImageData* img = bbGetInputIn();
vtkRenderWindowInteractor* interactor = bbGetInputInteractor();
vtkRenderer* render = bbGetInputRenderer();
std::string path = crea::System::GetDllAppPath("bbcreaMaracasVisu.dll");
_mainpanel = CutModelMainPanel::getInstance(parent, path);
+ _mainpanel->SetType(0);
bbSetOutputWidget( _mainpanel);
Process();
{
std::string path = crea::System::GetDllAppPath("bbcreaMaracasVisu.dll");
- _mainpanel = CutModel2MainPanel::getInstance(parent, path);
+ _mainpanel = CutModelMainPanel::getInstance(parent, path);
+ _mainpanel->SetType(1);
bbSetOutputWidget( _mainpanel);
Process();
#define __bbcreaMaracasVisuCutModule_h_INCLUDED__
#include "bbcreaMaracasVisu_EXPORT.h"
#include "bbtkWxBlackBox.h"
-#include "CutModel2MainPanel.h"
+#include "CutModelMainPanel.h"
namespace bbcreaMaracasVisu
{
void CreateWidget(wxWindow*);
private:
- CutModel2MainPanel* _mainpanel;
+ CutModelMainPanel* _mainpanel;
vtkImageData* _currentimage;
};
//-------------------------------------------------------------
void bbwxMaracas_N_ViewersWidget::OnRefreshView(wxCommandEvent & event)
{
-
+ printf("CPR: bbwxMaracas_N_ViewersWidget::OnRefreshView -> actualiza X, Y y Z\n");
mbbViewerNV->point.clear();
mbbViewerNV->point.push_back( (int)GetX() );
Program: wxMaracas
Module: $RCSfile: CutModelMainPanel.cxx,v $
Language: C++
- Date: $Date: 2009/11/25 16:35:36 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2009/12/08 13:42:48 $
+ Version: $Revision: 1.5 $
Copyright: (c) 2002, 2003
License:
: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize){
cutmanager=NULL;
-
+
initialize(path);
}
}
void CutModelMainPanel::ExecuteAll(){
- for(int i = 0; i < viewpanels.size();i++){
+ for(int i = 0; i < viewpanels.size(); i++){
viewpanels[i]->ExecuteCut();
}
void CutModelMainPanel::LoadCutModelData(std::string filename){
cutmanager->LoadCutModelData(filename);
}
+
+void CutModelMainPanel::SetType(int type){
+ _type = type;
+}
+
+int CutModelMainPanel::GetType(){
+ return _type;
+}
+
/**
**
**/
-
ToolBarCutModel::ToolBarCutModel(wxWindow * parent)
: wxToolBar(parent, -1, wxDefaultPosition, wxDefaultSize)
{
Program: wxMaracas
Module: $RCSfile: CutModelMainPanel.h,v $
Language: C++
- Date: $Date: 2009/09/08 08:14:25 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2009/12/08 13:42:48 $
+ Version: $Revision: 1.4 $
Copyright: (c) 2002, 2003
License:
void ShowStatistics(int id);
+ void SetType(int type);
+
+ int GetType();
+
private:
CutModelView* getModelView(int id)throw( CutModelException);
int _panelid;
+
+ int _type;
};
Program: wxMaracas
Module: $RCSfile: CutModel2Manager.cxx,v $
Language: C++
- Date: $Date: 2009/11/23 13:00:30 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2009/12/08 13:42:39 $
+ Version: $Revision: 1.4 $
Copyright: (c) 2002, 2003
License:
CutModel2Manager::CutModel2Manager(std::string path){
_path = path;
_img = NULL;
- _copyimg = NULL;
+ _img2 = NULL;
_interactor = NULL;
_render = NULL;
_currentaction=0;
std::string files = _path;
files+="/infounrd_0_fig_0.info";
remove(files.c_str());
+ _vectordata.clear();
+ _img = NULL;
+ _img2 = NULL;
+ _interactor = NULL;
+ _render = NULL;
}
void CutModel2Manager::setImageData(vtkImageData* img){
_img = img;
- if(_copyimg!=NULL){
- _copyimg->Delete();
+ if(_img2!=NULL){
+ _img2->Delete();
}
- _copyimg = vtkImageData::New();
- _copyimg->SetExtent(_img->GetExtent());
- _copyimg->SetSpacing(_img->GetSpacing());
- _copyimg->AllocateScalars();
+ _img2 = vtkImageData::New();
+ _img2->SetExtent(_img->GetExtent());
+ _img2->SetSpacing(_img->GetSpacing());
+ _img2->AllocateScalars();
- _copyimg->DeepCopy(_img);
+ _img2->DeepCopy(_img);
}
void CutModel2Manager::onAddCutModel2(int id, vtkCommand* observer) throw( CutModelException){
checkInvariant();
-
- CutModelData* data = new CutModelData(id,_interactor, observer, _copyimg);
+ CutModelData* data = new CutModelData(id,_interactor, observer, _img2);
_vectordata.push_back(data);
_render->AddActor(data->getActor());
if(_img==NULL){
throw CutModelException("The image is not set");
}
- if(_copyimg==NULL){
+ if(_img2==NULL){
throw CutModelException("The copyimage is not set");
}
if(_interactor==NULL){
double* CutModel2Manager::getImageRange()throw( CutModelException){
checkInvariant();
- return _copyimg->GetScalarRange();
+ return _img2->GetScalarRange();
}
void CutModel2Manager::changeOpacity(int id,int opacity)throw( CutModelException){
vtkImageData* CutModel2Manager::GetResultImage(){
checkInvariant();
- return _copyimg;
+ return _img2;
}
void CutModel2Manager::RefreshActor(int id){
currentmodel->setCurrentShape(currentundo->getCurrentShape());
- currentmodel->ExecuteUnCut(currentundo->getIsInside(), _copyimg, _img);
+ currentmodel->ExecuteUnCut(currentundo->getIsInside(), _img2, _img);
}
//Every thing ok
//Redo the cut
vtkTransform* transform = currentundo->getTransformFromMatrixFile();
currentmodel = getCutModelData(currentundo->getId());
- currentmodel->setTransform(transform, _copyimg);
+ currentmodel->setTransform(transform, _img2);
currentmodel->setCurrentShape(currentundo->getCurrentShape());
- currentmodel->ExecuteCut(currentundo->getRange(), currentundo->getIsInside(), _copyimg);
+ currentmodel->ExecuteCut(currentundo->getRange(), currentundo->getIsInside(), _img2);
}
_currentaction++;
Program: wxMaracas
Module: $RCSfile: CutModel2Manager.h,v $
Language: C++
- Date: $Date: 2009/11/23 13:00:31 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2009/12/08 13:42:39 $
+ Version: $Revision: 1.4 $
Copyright: (c) 2002, 2003
License:
void checkInvariant() throw( CutModelException);
std::string _path;
vtkImageData* _img;
- vtkImageData* _copyimg;
+ vtkImageData* _img2;
vtkRenderer* _render;
vtkRenderWindowInteractor* _interactor;
Program: wxMaracas
Module: $RCSfile: CutModelManager.cxx,v $
Language: C++
- Date: $Date: 2009/11/25 16:35:37 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2009/12/08 13:42:39 $
+ Version: $Revision: 1.5 $
Copyright: (c) 2002, 2003
License:
=========================================================================*/
#include "CutModelManager.h"
+#include "CutModelMainPanel.h"
/**
** Start of the manager class
CutModelManager::CutModelManager(std::string path){
_path = path;
_img = NULL;
- _copyimg = NULL;
+ _img2 = NULL;
_interactor = NULL;
_render = NULL;
_currentaction=0;
+
}
CutModelManager::~CutModelManager(){
std::string files = _path;
remove(files.c_str());
_vectordata.clear();
_img = NULL;
- _copyimg = NULL;
+ _img2 = NULL;
_interactor = NULL;
_render = NULL;
}
void CutModelManager::setImageData(vtkImageData* img){
- _img = img;
- if(_copyimg!=NULL){
- _copyimg->Delete();
+ int type = CutModelMainPanel::getInstance()->GetType();
+ if( type == 0)
+ {
+ _img = img;
+
+ if(_img2!=NULL){
+ _img2->Delete();
+ }
+ _img2 = vtkImageData::New();
+ _img2->SetExtent(_img->GetExtent());
+ _img2->SetSpacing(_img->GetSpacing());
+ _img2->AllocateScalars();
+
+ _img2->DeepCopy(_img);
}
- _copyimg = vtkImageData::New();
- _copyimg->SetExtent(_img->GetExtent());
- _copyimg->SetSpacing(_img->GetSpacing());
- _copyimg->AllocateScalars();
+ else
+ {
+ _img2 = img;
- _copyimg->DeepCopy(_img);
+ if(_img!=NULL){
+ _img->Delete();
+ }
+ _img = vtkImageData::New();
+ _img->SetExtent(_img2->GetExtent());
+ _img->SetSpacing(_img2->GetSpacing());
+ _img->AllocateScalars();
+ _img->DeepCopy(_img2);
+ }
}
void CutModelManager::setInteractor(vtkRenderWindowInteractor* interactor){
void CutModelManager::onAddCutModel(int id, vtkCommand* observer) throw( CutModelException){
checkInvariant();
+
CutModelData* data = new CutModelData(id,_interactor, observer, _img);
_vectordata.push_back(data);
if(_img==NULL){
throw CutModelException("The image is not set");
}
- if(_copyimg==NULL){
+ if(_img2==NULL){
throw CutModelException("The image is not set");
}
if(_interactor==NULL){
checkInvariant();
CutModelData* current = getCutModelData(id);
- current->ExecuteCut(range, isinside,_copyimg);
+ current->ExecuteCut(range, isinside,_img2);
/*
vtkImageData* CutModelManager::GetResultImage(){
checkInvariant();
- return _copyimg;
+ return _img2;
}
void CutModelManager::RefreshActor(int id){
currentmodel = getCutModelData(currentundo->getId());
- currentmodel->setTransform(transform, _copyimg);
+ currentmodel->setTransform(transform, _img2);
currentmodel->setCurrentShape(currentundo->getCurrentShape());
- currentmodel->ExecuteUnCut(currentundo->getIsInside(), _img, _copyimg);
+ currentmodel->ExecuteUnCut(currentundo->getIsInside(), _img, _img2);
}
//Every thing ok
//Redo the cut
vtkTransform* transform = currentundo->getTransformFromMatrixFile();
currentmodel = getCutModelData(currentundo->getId());
- currentmodel->setTransform(transform, _copyimg);
+ currentmodel->setTransform(transform, _img2);
currentmodel->setCurrentShape(currentundo->getCurrentShape());
- currentmodel->ExecuteCut(currentundo->getRange(), currentundo->getIsInside(), _copyimg);
+ currentmodel->ExecuteCut(currentundo->getRange(), currentundo->getIsInside(), _img2);
}
_currentaction++;
Program: wxMaracas
Module: $RCSfile: CutModelManager.h,v $
Language: C++
- Date: $Date: 2009/09/08 08:14:27 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2009/12/08 13:42:39 $
+ Version: $Revision: 1.4 $
Copyright: (c) 2002, 2003
License:
int Undo()throw( CutModelException);
int Redo()throw( CutModelException);
+
private:
int _currentaction;
void checkInvariant() throw( CutModelException);
std::string _path;
vtkImageData* _img;
- vtkImageData* _copyimg;
+ vtkImageData* _img2;
vtkRenderer* _render;
vtkRenderWindowInteractor* _interactor;
: wxFrame(parent, -1, title)
{
panelcut = new wxPanel(this, -1);
+ panelcut->SetSize(800, 700);
viewer = new wxMaracas_N_ViewersWidget(panelcut, img, type);
- sizer = new wxFlexGridSizer(2);
+ sizer = new wxFlexGridSizer(2, 1);
- sizer->Add(viewer, wxALL|wxEXPAND, 1);
+ sizer->Add(viewer, wxGROW, 1);
panelcut->SetSizer( sizer, true );
panelcut->SetAutoLayout( true );
//viewer->SetSize(wxSizer(wxALL|wxEXPAND));
panel->SetSize(400, 200);
- sizer->Add(panel, wxALL|wxEXPAND);
+ sizer->Add(panel, wxGROW);
panelcut->SetSizer( sizer, true );
panelcut->SetAutoLayout( true );
}
#include "wxMaracasRenderTabbedPanel.h"
-#include "HistogramDialogComboBox.h"
+#include "HistogramDialogComboBox.h"
#include "wxMaracasMultipleVolumeRendererPanel.h"
#include "wxMaracasSurfaceRenderingPanel.h"
#include "wxMaracasSurfaceRenderingProp3DMHD.h"
#include "wxMaracasMultipleVolumeRendererManagerData.h"
#include "wxMaracasDialog_NViewers.h"
+#include "wxVtkMPR3DViewCntrlPanel.h"
#include <wx/colordlg.h>
#include <wx/button.h>
-
+#include <vtkProp3D.h>
#include <OpenImage.xpm>
+
#include "Color.xpm"
#include "creaSystem.h"
-#include <vtkProp3D.h>
-#include "wxVtkMPR3DViewCntrlPanel.h"
+
+
/**
** Class constructor
**/
void wxMaracasRenderTabbedPanel::addMPROptions()
{
- int x = 0,y = 0,z = 0;
- int ext[6];
- ext[0] = 0;
- ext[1] = 0;
- ext[2] = 0;
- ext[3] = 0;
- ext[4] = 0;
- ext[5] = 0;
-
- double org[3],spc[3];
- org[0] = 0;
- org[1] = 0;
- org[2] = 0;
- spc[0] = 0;
- spc[1] = 0;
- spc[2] = 0;
-
+ //Panel Construction
vtkMPRBaseData* mvtkmprbasedata = new vtkMPRBaseData();
marImageData* marimagedata = new marImageData( getVolImage() );
mvtkmprbasedata ->SetMarImageData(marimagedata);
panelControl->SetSize(400,350);
panelControl->Layout();
+ //Configure MPR
+ int x = 0,y = 0,z = 0;
+ int ext[6];
+ ext[0] = 0;
+ ext[1] = 0;
+ ext[2] = 0;
+ ext[3] = 0;
+ ext[4] = 0;
+ ext[5] = 0;
+
+ double org[3],spc[3];
+ org[0] = 0;
+ org[1] = 0;
+ org[2] = 0;
+ spc[0] = 0;
+ spc[1] = 0;
+ spc[2] = 0;
+
if (mvtkmprbasedata!=NULL)
{
mvtkmprbasedata->Configure();
}
if (baseView!=NULL)
+ {
baseView ->Configure();
+ }
if (vtkmpr3Ddataviewer !=NULL)
{
diag->ShowModal();
delete diag;
}
-
}
/**
vtkImageData* img = getVolImage();
std::vector<int> type;
type.push_back(5);
- type.push_back(0);
type.push_back(1);
- type.push_back(3);
+ type.push_back(2);
+ type.push_back(0);
wxMaracasDialog_NViewers* dialog1 = new wxMaracasDialog_NViewers(this, img, &type, wxString(_T("Cut Module") ));
dialog1->SetSize(800, 700);
std::string path = crea::System::GetDllAppPath("bbcreaMaracasVisu.dll");
- cutter = CutModel2MainPanel::getInstance(dialog1->getinternalPanel(), path);
+ cutter = CutModelMainPanel::getInstance(dialog1->getinternalPanel(), path);
cutter->setRenderer( dialog1->getViewer()->GetwxVtkBaseView(1)->GetRenderer() );
cutter->setInteractor( dialog1->getViewer()->GetwxVtkBaseView(1)->GetWxVTKRenderWindowInteractor() );
cutter->setImageData(getVolImage());
#include <wx/notebook.h>
#include "wxMaracasRenderImageManagementPanel.h"
-#include "CutModel2MainPanel.h"
+#include "CutModelMainPanel.h"
#include "wxMaracasMultipleVolumeRendererManager.h"
#include "wxMaracasSurfaceRenderingManager.h"
#include "wxVtkBaseView.h"
wxCheckBox* checkboxSB;
wxCheckBox* checkboxSC;
wxCheckBox* checkboxViewer;
- //wxBitmapButton* _viewimage;
-
+ wxPanel* controlPanelMPR3D;
wxNotebook* wxtabs;
wxString volname;
wxVtk3DBaseView* baseView;
wxVtkMPR3DView* mwxvtkmpr3Dview;
vtkMPR3DDataViewer* vtkmpr3Ddataviewer;
- wxPanel* controlPanelMPR3D;
bool first;
int _id;
- CutModel2MainPanel* cutter;
+ CutModelMainPanel* cutter;
wxMaracasRenderImageManagementPanel* dialog;
wxMaracasMultipleVolumeRendererManager* volmanager;
wxMaracasSurfaceRenderingManager* surrendmanager1;
wxMaracasSurfaceRenderingManager* surrendmanager3;
};
-#endif /*wxMaracasMultipleVolumeRendererPanel_H_*/
-
+#endif /*wxMaracasMultipleVolumeRendererPanel_H_*/
\ No newline at end of file
getTabbedPanel(volid)->deleteVolume(volid);
}
-/**
-** Adds or removes a volume rendering actor
-**/
-void wxMaracasRendererView::addRemoveActorVol(int id, bool addremove)
-{
- //wxtabs->addRemoveActorV(id, addremove);
-}
-
-/**
-** Adds or removes a surface rendering actor
-**/
-void wxMaracasRendererView::addRemoveSurf1Actor(int id, bool addremove)
-{
- //wxtabs->addRemoveActorSA(id, addremove);
-}
-
-/**
-** Adds or removes a surface rendering actor
-**/
-void wxMaracasRendererView::addRemoveSurf2Actor(int id, bool addremove)
-{
- //wxtabs->addRemoveActorSB(id, addremove);
-}
-
-/**
-** Adds or removes a surface rendering actor
-**/
-void wxMaracasRendererView::addRemoveSurf3Actor(int id, bool addremove)
-{
- //wxtabs->addRemoveActorSC(id, addremove);
-}
-
/**
** Gets opened file names
**/
#include "wxMaracasRenderTabbedPanel.h"
#include "wxMaracasMultipleVolumeRendererManager.h"
#include "wxMaracasSurfaceRenderingManager.h"
-//#include "wxMaracasMultipleVolumeRendererPanel.h"
-//#include "wxMaracasSurfaceRenderingProp3DMHD.h"
class creaMaracasVisu_EXPORT wxMaracasRendererView : public wxPanel
{
void addPanels(wxMaracasRenderTabbedPanel* wxtabs, vtkImageData* img, std::string pathfile, std::string filename);
void deleteVolume(int volid);
- void addRemoveActorVol(int id, bool remove);
- void addRemoveSurf1Actor(int id, bool addremove);
- void addRemoveSurf2Actor(int id, bool addremove);
- void addRemoveSurf3Actor(int id, bool addremove);
-
std::vector<std::string> getFiles();
private: