item->SetColors(greyvect,redvect,greenvect,bluevect);
item->SetTransferFunction(greyvecttransfunct,value);
- for(int i = 0; i < greyvecttransfunct.size();i++){
+ /*for(int i = 0; i < greyvecttransfunct.size();i++){
std::cout<<"HistogramDialogComboBox::OnLoadComboBoxData("<<greyvecttransfunct[i]<<std::endl;
std::cout<<value[i]<<std::endl;
}
std::cout<<redvect[i]<<std::endl;
std::cout<<greenvect[i]<<std::endl;
std::cout<<bluevect[i]<<std::endl;
- }
+ }*/
itembitmaps.push_back(item);
Program: wxMaracas
Module: $RCSfile: wxMaracasMultipleVolumeRendererManager.cxx,v $
Language: C++
- Date: $Date: 2009/11/09 19:14:56 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2009/11/17 10:22:26 $
+ Version: $Revision: 1.7 $
Copyright: (c) 2002, 2003
License:
/**
** Adds a prop3D to the manager and returns the identifier
**/
-int wxMaracasMultipleVolumeRendererManager::addVolume(vtkImageData* vol, std::string dataname) throw(char*){
+int wxMaracasMultipleVolumeRendererManager::addVolume(int idTP, vtkImageData* vol, std::string dataname) throw(char*){
checkInvariant();
image = vol;
if(vol != NULL){
wxMaracasMultipleVolumeRendererManagerData* data = new wxMaracasMultipleVolumeRendererManagerData(vol, dataname);
prop3Dvect.push_back(data);
_renderer->AddActor(data->getProp3D());
- data->setId(_idCount);
- _idCount++;
+ if(idTP == -1)
+ {
+ data->setId(_idCount);
+ _idCount++;
+ }
+ else
+ {
+ data->setId(idTP);
+ }
+ printf("wxMaracasMultipleVolumeRendererManager::addVolume->idVolumeRenderer: %i", data->getId());
return data->getId();
}else{
throw "Check mhd imagefile file or input";
Program: wxMaracas
Module: $RCSfile: wxMaracasMultipleVolumeRendererManager.h,v $
Language: C++
- Date: $Date: 2009/11/09 19:14:56 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2009/11/17 10:22:59 $
+ Version: $Revision: 1.6 $
Copyright: (c) 2002, 2003
License:
/**
** Adds a volume
**/
- int addVolume(vtkImageData* img, std::string dataname) throw (char*);
+ int addVolume(int idTP, vtkImageData* img, std::string dataname) throw (char*);
/**
** loads a prop3D from a nSTL file
Program: wxMaracas
Module: $RCSfile: wxMaracasMultipleVolumeRendererView.cxx,v $
Language: C++
- Date: $Date: 2009/11/09 19:14:56 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2009/11/17 10:23:35 $
+ Version: $Revision: 1.7 $
Copyright: (c) 2002, 2003
License:
void wxMaracasMultipleVolumeRendererView::addVolume(vtkImageData* img, std::string dataname){
try{
- int id = volmanager->addVolume(img,dataname);
+ int id = volmanager->addVolume(-1, img,dataname);
if(id!=-1){
wxMaracasMultipleVolumeRendererPanel* controlpan = new wxMaracasMultipleVolumeRendererPanel(this, id,img, false);
addVolumeViewPanel(controlpan, dataname);
sizersliders->Add(sliderRotateZ,wxSizerFlags().Expand().Center());
wxStaticText* sx = new wxStaticText(this, -1, wxString(_T(" Scale X ")));
- sliderScaleX = new wxSlider(this, -1, 0, -100, 100, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
+ sliderScaleX = new wxSlider(this, -1, 100, 1, 200, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
sliderScaleX->SetLineSize(1);
Connect(sliderScaleX->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Scale);
sizersliders->Add(sx, wxFIXED_MINSIZE);
sizersliders->Add(sliderScaleX,wxSizerFlags().Expand().Center());
wxStaticText* sy = new wxStaticText(this, -1, wxString(_T(" Scale Y ")));
- sliderScaleY = new wxSlider(this, -1, 0, -100, 100, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
+ sliderScaleY = new wxSlider(this, -1, 100, 1, 200, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
sliderScaleY->SetLineSize(1);
Connect(sliderScaleY->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Scale);
sizersliders->Add(sy, wxFIXED_MINSIZE);
sizersliders->Add(sliderScaleY,wxSizerFlags().Expand().Center());
wxStaticText* sz = new wxStaticText(this, -1, wxString(_T(" Scale Z ")));
- sliderScaleZ = new wxSlider(this, -1, 0, -100, 100, wxDefaultPosition, this->GetSize(), wxSL_LABELS);
+ sliderScaleZ = new wxSlider(this, -1, 100, 1, 200, wxDefaultPosition, this->GetSize(), wxSL_LABELS);
sliderScaleZ->SetLineSize(1);
Connect(sliderScaleZ->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Scale);
sizersliders->Add(sz, wxFIXED_MINSIZE);
**/
void wxMaracasRenderImageManagementPanel::Translate(wxCommandEvent& event)
{
- printf("wxMaracasRenderImageManagementPanel::Translate translateX = %d \n", sliderTranslateX->GetValue());
- printf("wxMaracasRenderImageManagementPanel::Translate translatey = %d \n", sliderTranslateY->GetValue());
- printf("wxMaracasRenderImageManagementPanel::Translate translatez = %d \n", sliderTranslateZ->GetValue());
+ //printf("wxMaracasRenderImageManagementPanel::Translate translateX = %d \n", sliderTranslateX->GetValue());
+ //printf("wxMaracasRenderImageManagementPanel::Translate translatey = %d \n", sliderTranslateY->GetValue());
+ //printf("wxMaracasRenderImageManagementPanel::Translate translatez = %d \n", sliderTranslateZ->GetValue());
try{
wxtrasform->Translate(sliderTranslateX->GetValue(), sliderTranslateY->GetValue(), sliderTranslateZ->GetValue());
}
**/
void wxMaracasRenderImageManagementPanel::Rotate(wxCommandEvent& event)
{
- printf("wxMaracasRenderImageManagementPanel::Rotate rotateX = %d \n", sliderRotateX->GetValue());
- printf("wxMaracasRenderImageManagementPanel::Rotate rotateY = %d \n", sliderRotateY->GetValue());
- printf("wxMaracasRenderImageManagementPanel::Rotate rotateZ = %d \n", sliderRotateZ->GetValue());
+ //printf("wxMaracasRenderImageManagementPanel::Rotate rotateX = %d \n", sliderRotateX->GetValue());
+ //printf("wxMaracasRenderImageManagementPanel::Rotate rotateY = %d \n", sliderRotateY->GetValue());
+ //printf("wxMaracasRenderImageManagementPanel::Rotate rotateZ = %d \n", sliderRotateZ->GetValue());
try{
wxtrasform->Rotate( sliderRotateX->GetValue(), sliderRotateY->GetValue(), sliderRotateZ->GetValue() );
**/
void wxMaracasRenderImageManagementPanel::Scale(wxCommandEvent& event)
{
- printf("wxMaracasRenderImageManagementPanel::Rotate rotateX = %d \n", sliderScaleX->GetValue());
- printf("wxMaracasRenderImageManagementPanel::Rotate rotateY = %d \n", sliderRotateY->GetValue());
- printf("wxMaracasRenderImageManagementPanel::Rotate rotateZ = %d \n", sliderRotateZ->GetValue());
+ //printf("wxMaracasRenderImageManagementPanel::Rotate rotateX = %d \n", sliderScaleX->GetValue());
+ //printf("wxMaracasRenderImageManagementPanel::Rotate rotateY = %d \n", sliderRotateY->GetValue());
+ //printf("wxMaracasRenderImageManagementPanel::Rotate rotateZ = %d \n", sliderRotateZ->GetValue());
try{
- wxtrasform->Scale( sliderScaleX->GetValue(), sliderScaleY->GetValue(), sliderScaleZ->GetValue() );
+ wxtrasform->Scale( sliderScaleX->GetValue(), sliderScaleY->GetValue(), sliderScaleZ->GetValue());
}
catch(char* str){
std::cout << "Exception : " << str << '\n';
-
#include "wxMaracasRenderImageTransformation.h"
/**
**/
void wxMaracasRenderImageTransformation::Scale(int x, int y, int z)
{
+ float resultX = x/100.0;
+ float resultY = y/100.0;
+ float resultZ = z/100.0;
+
+ //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleX = %d \n",x);
+ //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleY = %d \n", y);
+ //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleZ = %d \n", z);
+
+ //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleX = %f \n", resultX);
+ //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleY = %f \n", resultY);
+ //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleZ = %f \n", resultZ);
+
transformV->Identity();
transformS1->Identity();
transformS2->Identity();
transformS3->Identity();
- transformV->Scale( x, y, z );
- transformS1->Scale( x, y, z );
- transformS2->Scale( x, y, z );
- transformS3->Scale( x, y, z );
+ transformV->Scale( (x/100.0), (y/100.0), (z/100.0) );
+ transformS1->Scale( (x/100.0), (y/100.0), (z/100.0) );
+ transformS2->Scale( (x/100.0), (y/100.0), (z/100.0) );
+ transformS3->Scale( (x/100.0), (y/100.0), (z/100.0) );
Refresh();
}
+/**
+** Updates each Matrix
+**/
void wxMaracasRenderImageTransformation::Refresh()throw(char*)
{
transformV->Update();
transformS3->Update();
vol->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
- vol->getRenderer()->Render();
+ //vol->getRenderer()->Render();
surface1->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
- surface1->getRenderer()->Render();
+ //surface1->getRenderer()->Render();
surface2->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
- surface2->getRenderer()->Render();
+ //surface2->getRenderer()->Render();
surface3->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
surface3->getRenderer()->Render();
}
-
/**
** Class constructor
**/
-wxMaracasRenderTabbedPanel::wxMaracasRenderTabbedPanel(wxWindow* parent)
+wxMaracasRenderTabbedPanel::wxMaracasRenderTabbedPanel(wxWindow* parent, int id)
: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize)
{
- //_propid = propid;
+ _id = id;
volmanager = new wxMaracasMultipleVolumeRendererManager();
surrendmanager1 = new wxMaracasSurfaceRenderingManager();
surrendmanager2 = new wxMaracasSurfaceRenderingManager();
//wxMaracasRenderTabbedPanel::getInstance()->addRemoveActorSA(_propid, false);
//wxMaracasRenderTabbedPanel::getInstance()->addRemoveActorSB(_propid, false);
//wxMaracasRenderTabbedPanel::getInstance()->addRemoveActorSC(_propid, false);
- this->deleteVolume(_propidV);
+ this->deleteVolume(_id);
delete wxtabs;
}
{
try
{
- _propidV = volmanager->addVolume(img, dataname);
+ int _propidV = volmanager->addVolume(_id, img, dataname);
if(_propidV!=-1)
{
wxMaracasMultipleVolumeRendererPanel* controlpanV = new wxMaracasMultipleVolumeRendererPanel(wxtabs, _propidV, img, true);
{
try
{
- _propidSA = surrendmanager1->addPropMHD(img, dataname);
+ int _propidSA = surrendmanager1->addPropMHD(_id, img, dataname);
if(_propidSA!=-1)
{
{
try
{
- _propidSB = surrendmanager2->addPropMHD(img, dataname);
+ int _propidSB = surrendmanager2->addPropMHD(_id, img, dataname);
if(_propidSB!=-1)
{
wxMaracasSurfaceRenderingPanel* controlpanSB = new wxMaracasSurfaceRenderingProp3DMHD(wxtabs, _propidSB, true, 2);
{
try
{
- _propidSC = surrendmanager3->addPropMHD(img, dataname);
+ int _propidSC = surrendmanager3->addPropMHD(_id, img, dataname);
if(_propidSC!=-1)
{
void wxMaracasRenderTabbedPanel::onCheckBoxSAChange(wxCommandEvent& event)
{
try{
- surrendmanager1->addRemoveActor(this->getPropIdSA(), checkboxSA->GetValue());
+ surrendmanager1->addRemoveActor(this->getPropIdV(), checkboxSA->GetValue());
}
catch(char* str){
std::cout << "Exception : " << str << '\n';
void wxMaracasRenderTabbedPanel::onCheckBoxSBChange(wxCommandEvent& event)
{
try{
- surrendmanager2->addRemoveActor(this->getPropIdSB(), checkboxSB->GetValue());
+ surrendmanager2->addRemoveActor(this->getPropIdV(), checkboxSB->GetValue());
}
catch(char* str){
std::cout << "Exception : " << str << '\n';
void wxMaracasRenderTabbedPanel::onCheckBoxSCChange(wxCommandEvent& event)
{
try{
- surrendmanager3->addRemoveActor(this->getPropIdSC(), checkboxSC->GetValue());
+ surrendmanager3->addRemoveActor(this->getPropIdV(), checkboxSC->GetValue());
}
catch(char* str){
std::cout << "Exception : " << str << '\n';
**/
int wxMaracasRenderTabbedPanel::getPropIdV()
{
- return _propidV;
+ return _id;
}
/**
**/
int wxMaracasRenderTabbedPanel::getPropIdSA()
{
- return _propidSA;
+ return -1;
}
/**
**/
int wxMaracasRenderTabbedPanel::getPropIdSB()
{
- return _propidSB;
+ return -1;
}
/**
**/
int wxMaracasRenderTabbedPanel::getPropIdSC()
{
- return _propidSC;
-}
-
+ return -1;
+}
\ No newline at end of file
{
public:
- wxMaracasRenderTabbedPanel(wxWindow* parent);
+ wxMaracasRenderTabbedPanel(wxWindow* parent, int id);
~wxMaracasRenderTabbedPanel();
void createControls(vtkImageData* inImg, std::string pathfile, std::string filename);
wxNotebook* wxtabs;
wxMaracasRenderImageManagementPanel* dialog;
- int _propidV;
- int _propidSA;
- int _propidSB;
- int _propidSC;
-
bool first;
wxMaracasMultipleVolumeRendererManager* volmanager;
wxMaracasSurfaceRenderingManager* surrendmanager1;
wxMaracasSurfaceRenderingManager* surrendmanager2;
wxMaracasSurfaceRenderingManager* surrendmanager3;
+
+ int _id;
};
#endif /*wxMaracasMultipleVolumeRendererPanel_H_*/
wxauimanager = new wxAuiManager(this);
+ _idCount = 0;
_path = path;
std::string iconsdir = path;
{
std::string sPath = std::string(pathfile.mb_str());
std::string sFileName = std::string(filename.mb_str());
+ printf("wxMaracasRendererView::onLoadImageFile->Opening file... \n");
addVolumes(NULL, sPath, sFileName);
}
}
**/
void wxMaracasRendererView::addVolumes(vtkImageData* img, std::string pathfile, std::string filename)
{
- wxMaracasRenderTabbedPanel* wxtabs = new wxMaracasRenderTabbedPanel(this);
+ wxMaracasRenderTabbedPanel* wxtabs = new wxMaracasRenderTabbedPanel(this, _idCount);
wxtabs->setRenderer(_renderer);
tabsVector.push_back(wxtabs);
addPanels(wxtabs, img, pathfile, filename);
+
+ _idCount++;
}
/**
** Deletes current volume
wxBitmap bitmap0(OpenImage_xpm);
this->AddTool(1, wxString(_T("test")),bitmap0, NULL, wxITEM_NORMAL, wxString(_T("Open File")));
- /*iconfil+= "/Open.png";
- wxBitmap* bitmap2 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG);
- this->AddTool(2, wxString(_T("test")),*bitmap2); */
-
- /*iconfil = iconsdir;
- iconfil+= "/Open.png";
- wxBitmap* bitmap30 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG);
- this->AddTool(30, wxString(_T("test")),*bitmap30);*/
-
this->Realize();
_evthand = new ToolBarEventHandlerRenderer();
vtkRenderer* _renderer;
std::string _path;
+
+ int _idCount;
};
class ToolBarEventHandlerRenderer : public wxEvtHandler
Program: wxMaracas
Module: $RCSfile: wxMaracasSurfaceRendering.cxx,v $
Language: C++
- Date: $Date: 2009/11/13 11:47:41 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2009/11/17 10:24:23 $
+ Version: $Revision: 1.7 $
Copyright: (c) 2002, 2003
License:
void wxMaracasSurfaceRendering::addPropMHD(vtkImageData* imgdata, std::string dataname){
try{
- int id = surrendmanager->addPropMHD(imgdata,dataname);
+ int id = surrendmanager->addPropMHD(-1, imgdata,dataname);
if(id!=-1){
wxMaracasSurfaceRenderingPanel* controlpan = new wxMaracasSurfaceRenderingProp3DMHD(this, id, false, -1);
void wxMaracasSurfaceRendering::addProp3D(vtkProp3D* prop3D, std::string dataname){
try{
- int id = surrendmanager->addProp3D(prop3D,dataname);
+ int id = surrendmanager->addProp3D(-1, prop3D,dataname);
if(id!=-1){
wxMaracasSurfaceRenderingPanel* controlpan = new wxMaracasSurfaceRenderingProp3D(this, id, false, -1);
addSurfaceRenderingPanel(controlpan, dataname);
Program: wxMaracas
Module: $RCSfile: wxMaracasSurfaceRenderingManager.cxx,v $
Language: C++
- Date: $Date: 2009/11/13 11:47:41 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2009/11/17 10:24:35 $
+ Version: $Revision: 1.6 $
Copyright: (c) 2002, 2003
License:
/**
** Adds a prop3D to the manager and returns the identifier
**/
-int wxMaracasSurfaceRenderingManager::addProp3D(vtkProp3D* prop3D, std::string dataname) throw(char*){
+int wxMaracasSurfaceRenderingManager::addProp3D(int idTP, vtkProp3D* prop3D, std::string dataname) throw(char*){
checkInvariant();
if(prop3D != NULL){
wxMaracasSurfaceRenderingManagerData* data = new wxMaracasSurfaceRenderingManagerData(prop3D, dataname, _interactor);
prop3Dvect.push_back(data);
_renderer->AddActor(data->getProp3D());
- data->setId(_idCount);
- _idCount++;
+ if(idTP == -1)
+ {
+ data->setId(_idCount);
+ _idCount++;
+ }
+ else
+ {
+ data->setId(idTP);
+ }
return data->getId();
}else{
throw "Check vtkProp3D file or input";
}
return -1;
}
-int wxMaracasSurfaceRenderingManager::addPropMHD(vtkImageData* imagedata, std::string dataname) throw(char*){
+int wxMaracasSurfaceRenderingManager::addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) throw(char*){
checkInvariant();
if(imagedata != NULL){
image = imagedata;
wxMaracasSurfaceRenderingManagerData* data = new wxMaracasSurfaceRenderingManagerDataMhd(imagedata, dataname, _interactor);
prop3Dvect.push_back(data);
_renderer->AddActor(data->getProp3D());
- data->setId(_idCount);
- _idCount++;
+ if(idTP == -1)
+ {
+ data->setId(_idCount);
+ _idCount++;
+ }
+ else
+ {
+ data->setId(idTP);
+ }
+ printf("wxMaracasSurfaceRenderingManager::addPropMHD->idSurfaceRender: %i\n", data->getId());
return data->getId();
}else{
throw "Check ImageData file or input";
}
return -1;
-
}
/**
** adds or removes an actor depending of the bool value
Program: wxMaracas
Module: $RCSfile: wxMaracasSurfaceRenderingManager.h,v $
Language: C++
- Date: $Date: 2009/11/13 11:47:41 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2009/11/17 10:23:24 $
+ Version: $Revision: 1.4 $
Copyright: (c) 2002, 2003
License:
/**
** Adds a prop3D to the manager and returns the identifier
**/
- int addProp3D(vtkProp3D* prop3D, std::string dataname) throw (char*);
+ int addProp3D(int idTP, vtkProp3D* prop3D, std::string dataname) throw (char*);
/**
** Adds a prop3D to the manager and returns the identifier
**/
- int addPropMHD(vtkImageData* imagedata, std::string dataname) throw(char*);
+ int addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) throw(char*);
/**
** Changes the opacity in a prop3D
**/