From 60238e95450685ecb14f7e6d77247fa9e15b7441 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Mon, 19 Aug 2013 15:38:57 +0200 Subject: [PATCH] 2108 Bug Volume Rendering widget options are not stable --- .../volumerenderermanagerdata.cxx | 159 +++++++++++------- .../pPlotter/HistogramDialogComboBox.cxx | 129 ++++++++------ .../pPlotter/HistogramDialogComboBox.h | 12 +- ...wxMaracasMultipleVolumeRendererManager.cxx | 54 ++++-- ...racasMultipleVolumeRendererManagerData.cxx | 2 +- .../wxWindows/widgets/wxVtkMPR2DView.cxx | 20 ++- 6 files changed, 236 insertions(+), 140 deletions(-) diff --git a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx index 97527c1..00d115b 100644 --- a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx +++ b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx @@ -35,12 +35,19 @@ #include -#if VTK_MAJOR_VERSION >= 5 - #if VTK_MINOR_VERSION >= 6 - #include "vtkGPUVolumeRayCastMapper.h" - #endif +// EED This is code for Juan Carlos Prieto TESTES +//#if VTK_MAJOR_VERSION >= 5 +// #if VTK_MINOR_VERSION >= 6 +// #include "vtkGPUVolumeRayCastMapper.h" +// #endif +//#endif + +#if VTK_MAJOR_VERSION >= 6 + #include "vtkSmartVolumeMapper.h" #endif + + using namespace std; VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, bool usegpu){ @@ -71,11 +78,11 @@ void VolumeRendererManagerData::Initialize(vtkImageData* vol, std::string datana _volumeProperty = vtkVolumeProperty::New(); _volumeProperty->SetInterpolationTypeToLinear(); - _volumeProperty->ShadeOn(); + _volumeProperty->ShadeOff(); _volumeProperty->SetAmbient(3); _volumeProperty->SetDiffuse(0.2); _volumeProperty->SetSpecular(0.5); - //_volumeProperty->DisableGradientOpacityOn(); + _volumeProperty->DisableGradientOpacityOn(); _tfun = vtkPiecewiseFunction::New(); _volumeProperty->SetScalarOpacity(_tfun ); _ctfun = vtkColorTransferFunction::New(); @@ -123,37 +130,48 @@ void VolumeRendererManagerData::Initialize(vtkImageData* vol, std::string datana } */ - VolumeMapper = 0; -#if VTK_MAJOR_VERSION >= 5 - #if VTK_MINOR_VERSION >= 6 - cout<<"using volume render GPU"<AutoAdjustSampleDistancesOn(); - VolumeMapper = volumeMappergpu; - #endif + VolumeMapper = NULL; + +// EED This is code for Juan Carlos Prieto TESTES +//#if VTK_MAJOR_VERSION >= 5 +// #if VTK_MINOR_VERSION >= 6 +// cout<<"using volume render GPU"<AutoAdjustSampleDistancesOn(); +// VolumeMapper = volumeMappergpu; +// #endif +//#else +// _compositeFunction = vtkVolumeRayCastCompositeFunction::New(); +// _MIPFunction = vtkVolumeRayCastMIPFunction::New(); +// vtkVolumeRayCastMapper* volumeMapper = vtkVolumeRayCastMapper::New(); +// volumeMapper->SetVolumeRayCastFunction(_compositeFunction); +// volumeMapper->AutoAdjustSampleDistancesOn(); +// VolumeMapper = volumeMapper; +//#endif + +#if VTK_MAJOR_VERSION >= 6 + cout<<"using SmartVolumeRenderingMapper render GPU"<AutoAdjustSampleDistancesOn(); #else - - - _compositeFunction = vtkVolumeRayCastCompositeFunction::New(); - _MIPFunction = vtkVolumeRayCastMIPFunction::New(); - vtkVolumeRayCastMapper* volumeMapper = vtkVolumeRayCastMapper::New(); + _compositeFunction = vtkVolumeRayCastCompositeFunction::New(); + _MIPFunction = vtkVolumeRayCastMIPFunction::New(); + vtkVolumeRayCastMapper* volumeMapper = vtkVolumeRayCastMapper::New(); + VolumeMapper = volumeMapper; volumeMapper->SetVolumeRayCastFunction(_compositeFunction); - volumeMapper->AutoAdjustSampleDistancesOn(); - VolumeMapper = volumeMapper; + volumeMapper->AutoAdjustSampleDistancesOn(); #endif - - - VolumeMapper->SetClippingPlanes( _volumePlanes ); - _newvol->SetMapper(VolumeMapper ); - VolumeMapper->SetInput( _vol ); - VolumeMapper->Update(); - _newvol->Update(); + VolumeMapper->SetClippingPlanes( _volumePlanes ); + _newvol->SetMapper(VolumeMapper ); + VolumeMapper->SetInput( _vol ); + VolumeMapper->Update(); + _newvol->Update(); } VolumeRendererManagerData::~VolumeRendererManagerData() { - _tfun->Delete(); _ctfun->Delete(); _volumePlanes->Delete(); @@ -170,22 +188,26 @@ VolumeRendererManagerData::~VolumeRendererManagerData() if(BoxWidget){ DisableBoundingBox(); } - } -void VolumeRendererManagerData::SetIndependentComponents(bool independent){ - if(independent){ + +void VolumeRendererManagerData::SetIndependentComponents(bool independent) +{ + if(independent) + { _volumeProperty->IndependentComponentsOn(); }else{ _volumeProperty->IndependentComponentsOff(); } } + void VolumeRendererManagerData::EnableBoundingBox(vtkRenderWindowInteractor* interactor) { //EED9Juin2011 if(_volumeMappergpu){ - if(!BoxWidget){ + if(!BoxWidget) + { BoxWidget = vtkBoxWidget::New(); BoxWidget->SetInteractor( interactor ); BoxWidget->SetPlaceFactor(1.01); @@ -219,16 +241,14 @@ void VolumeRendererManagerData::EnableBoundingBox(vtkRenderWindowInteractor* int //EED9Juin2011 } } -void VolumeRendererManagerData::DisableBoundingBox(){ - - if(BoxWidget){ +void VolumeRendererManagerData::DisableBoundingBox() +{ + if(BoxWidget) + { BoxWidget->EnabledOff(); //BoxWidget->Delete(); //BoxWidget = 0; - cout<<"JPRG::VolumeRendererManagerData::DisableBoundingBox"<& greylevelcol _newvol->Update(); } + + /** ** Volume Opacity **/ -void VolumeRendererManagerData::setVolumeOpacity(std::vector greylevel,std::vector value){ - +void VolumeRendererManagerData::setVolumeOpacity(std::vector greylevel,std::vector value) +{ _tfun->RemoveAllPoints(); - for(unsigned int i = 0; i < greylevel.size();i++){ + for(unsigned int i = 0; i < greylevel.size();i++) + { _tfun->AddPoint(greylevel[i], value[i]); //std::cout<<"VolumeRendererManagerData::setVolumeOpacity "<Update(); } + /** ** Volume Opacity **/ @@ -273,6 +297,7 @@ void VolumeRendererManagerData::setVolumeOpacity(std::vector greylevel,d setVolumeOpacity(greylevel, valuevector); } + /** ** Check if the variables are setted correctly **/ @@ -288,50 +313,67 @@ void VolumeRendererManagerData::checkInvariant()throw (char *){ } } + /** ** Check if the variables are setted correctly **/ -void VolumeRendererManagerData::Update(){ +void VolumeRendererManagerData::Update() +{ _newvol->Update(); } + + /** ** get the prop3D **/ -vtkProp3D* VolumeRendererManagerData::getProp3D(){ +vtkProp3D* VolumeRendererManagerData::getProp3D() +{ return this->_newvol; } + /** ** return the id from the daat **/ -int VolumeRendererManagerData::getId(){ +int VolumeRendererManagerData::getId() +{ return _id; } + + /** ** set data id **/ -void VolumeRendererManagerData::setId(int propid){ +void VolumeRendererManagerData::setId(int propid) +{ _id = propid; } + /** ** Get the filanme **/ -std::string VolumeRendererManagerData::getDataname(){ +std::string VolumeRendererManagerData::getDataname() +{ return _dataname; } + + /** ** Set the filanme **/ -void VolumeRendererManagerData::setDataname(std::string dataname){ +void VolumeRendererManagerData::setDataname(std::string dataname) +{ _dataname = dataname; } -void VolumeRendererManagerData::changeCompositeMIPFunction(int function){ + +void VolumeRendererManagerData::changeCompositeMIPFunction(int function) +{ //checkInvariant(); - if(VolumeMapper){ -#if VTK_MAJOR_VERSION >= 5 - #if VTK_MINOR_VERSION >= 6 - if(dynamic_cast(VolumeMapper)){ + if(VolumeMapper!=NULL){ +#if VTK_MAJOR_VERSION >= 6 + if(dynamic_cast(VolumeMapper)) + { vtkVolumeRayCastMapper* volumemapper = dynamic_cast(VolumeMapper); if(function == 0){ volumemapper->SetVolumeRayCastFunction(_compositeFunction); @@ -348,9 +390,8 @@ void VolumeRendererManagerData::changeCompositeMIPFunction(int function){ volumemapper->SetBlendModeToMinimumIntensity(); } } - #endif #else - vtkGPUVolumeRayCastMapper* volumemapper = dynamic_cast(VolumeMapper); + vtkVolumeRayCastMapper* volumemapper = dynamic_cast(VolumeMapper); if(function == 0){ volumemapper->SetBlendModeToComposite(); }else if(function == 1){ @@ -363,7 +404,8 @@ void VolumeRendererManagerData::changeCompositeMIPFunction(int function){ } -void VolumeRendererManagerData::SetLookupTable(vtkLookupTable* lookuptable){ +void VolumeRendererManagerData::SetLookupTable(vtkLookupTable* lookuptable) +{ if(lookuptable){ _ctfun->RemoveAllPoints(); vtkColorTransferFunction* colort = (vtkColorTransferFunction*)lookuptable; @@ -378,7 +420,8 @@ void VolumeRendererManagerData::SetLookupTable(vtkLookupTable* lookuptable){ } -void VolumeRendererManagerData::changeInterpolationType(int type){ +void VolumeRendererManagerData::changeInterpolationType(int type) +{ //checkInvariant(); if(type == 0){ _volumeProperty->SetInterpolationTypeToLinear(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx index 88d8c52..e57059a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx @@ -43,23 +43,17 @@ HistogramDialogComboBox::HistogramDialogComboBox(wxWindow* parent) colorBar_Bitmap = NULL; _bitmapsizer = NULL; + InitCurrentPathColorsFuntion(); this->SetSizer(getBitmapCombo()); _img = NULL; - _currentitem = -1; + _currentitem = -1; _maxgreyvalue = 0; -printf("EED HistogramDialogComboBox\n"); -#ifdef LINUX - std::string currentpath = crea::System::GetExecutablePath(); - currentpath.append("../share/creaMaracasVisu/data/"); -printf("EED JCP OOOOJJJOOO cambiar esto HistogramDialogComboBox::HistogramDialog writting in this directory\n"); - currentpath = "/home/davila/dataHistogram"; +} + - crea::System::createDirectory(currentpath.c_str()); -#endif -} HistogramDialogComboBox::~HistogramDialogComboBox() { @@ -80,6 +74,7 @@ wxSizer* HistogramDialogComboBox::getBitmapCombo() wxBoxSizer* comboeditsizer = new wxBoxSizer(wxHORIZONTAL); _bitmapcombo = getBitmapComboElements(); + BitmapComboItemSelect(0); wxBitmap bitmap1(Edit_xpm); wxBitmapButton* edit = new wxBitmapButton(this, -1, bitmap1,wxDefaultPosition,wxSize(30,30)); @@ -176,39 +171,33 @@ void HistogramDialogComboBox::OnEditBitmapCombo(wxCommandEvent& event) dialog->UpdateCurrentComboElement(); _bitmapsitems = dialog->getComboBoxItems(); - //std::string currentpath = crea::System::GetDllAppPath("bbcreaMaracasVisu"); // JPR - std::string dllLastName; - std::string currentpath; - #ifdef WIN32 - dllLastName = "bbcreaMaracasVisu"; - currentpath = crea::System::GetDllAppPath(dllLastName); - #endif - #ifdef LINUX - currentpath = crea::System::GetExecutablePath(); - currentpath.append("../share/creaMaracasVisu/data/"); - #endif - currentpath.append(FILENAME); - std::vector redvect,greenvect,bluevect; std::vector greyvect; - saveCurrentConfiguration(_bitmapsitems, currentpath); + saveCurrentConfiguration(_bitmapsitems, GetFileNameOfColorsFunction() ); wxBitmapComboBox* tempbitmapcombo = _bitmapcombo; - for(int i = 0; i < _bitmapsitems.size();i++){ + for(int i = 0; i < _bitmapsitems.size();i++) + { delete _bitmapsitems[i]; } _bitmapsitems.clear(); _bitmapcombo = getBitmapComboElements(); - if(_bitmapsizer->Replace(tempbitmapcombo,_bitmapcombo)){ - - tempbitmapcombo->Destroy(); - } + +// EED Eraseme +// if(_bitmapsizer->Replace(tempbitmapcombo,_bitmapcombo)) +// { +// tempbitmapcombo->Destroy(); +// } else { +// printf ("EED ERROR HistogramDialogComboBox::OnEditBitmapCombo. Can't replace bitmapcombo \n"); +// } + this->Layout(); } dialog->Destroy(); } } + void HistogramDialogComboBox::saveCurrentConfiguration(std::vector& itembitmaps,std::string filename) { std::ofstream file; @@ -265,63 +254,92 @@ void HistogramDialogComboBox::saveCurrentConfiguration(std::vector bitmapsitems; - OnLoadComboBoxData(bitmapsitems, currentpath); + OnLoadComboBoxData(bitmapsitems, GetFileNameOfColorsFunction() ); _bitmapsitems = bitmapsitems; wxString* choices; choices = new wxString[bitmapsitems.size()]; for(int i = 0; i < bitmapsitems.size();i++) { - choices[i] = _T(""); + choices[i] = _T("Color Function"); + } + + wxBitmapComboBox* bitmapcombo; +//EED wxBitmapComboBox* bitmapcombo = new wxBitmapComboBox(this, -1, _T(""), wxDefaultPosition, wxDefaultSize, bitmapsitems.size(),choices); + if (_bitmapcombo!=NULL) + { + _bitmapcombo->Clear(); + bitmapcombo=_bitmapcombo; + } else { + bitmapcombo = new wxBitmapComboBox(this, -1, _T("")); } - wxBitmapComboBox* bitmapcombo = new wxBitmapComboBox(this, -1, _T(""), wxDefaultPosition, wxDefaultSize, bitmapsitems.size(),choices); - bitmapcombo->SetSize(65,30); +// wxBitmapComboBox* bitmapcombo = new wxBitmapComboBox(this, -1, _T("")); + bitmapcombo->SetSize(165,30); Connect(bitmapcombo->GetId(), wxEVT_COMMAND_COMBOBOX_SELECTED, (wxObjectEventFunction)&HistogramDialogComboBox::OnBitmapComboItemSelected); for(int i = 0; i < bitmapsitems.size(); i++) { - bitmapcombo->SetItemBitmap(i, bitmapsitems[i]->GetBitmap()); + bitmapcombo->Append(_T("ColorFunction"), bitmapsitems[i]->GetBitmap() ); +// bitmapcombo->SetItemBitmap(i, bitmapsitems[i]->GetBitmap()); } + BitmapComboItemSelect(0); return bitmapcombo; } -void HistogramDialogComboBox::OnBitmapComboItemSelected(wxCommandEvent& event) + +void HistogramDialogComboBox::BitmapComboItemSelect(int value) { + HistogramDialogComboBoxItem* currentconfig; if(_bitmapcombo!=NULL) { - _currentitem = event.GetInt(); + _currentitem = value; + _bitmapcombo->Select(value); if(_bitmapsitems.size()>_currentitem) { - HistogramDialogComboBoxItem* currentconfig = _bitmapsitems[_currentitem]; - _greyvect = currentconfig->getGreyVector(); - _redvect = currentconfig->getRedVector(); - _greenvect = currentconfig->getGreenVector(); - _bluevect= currentconfig->getBlueVector(); - _greyvecttransfer = currentconfig->getGreyVectorTransfer(); - _value = currentconfig->getValueVector(); + currentconfig = _bitmapsitems[_currentitem]; + _greyvect = currentconfig->getGreyVector(); + _redvect = currentconfig->getRedVector(); + _greenvect = currentconfig->getGreenVector(); + _bluevect = currentconfig->getBlueVector(); + _greyvecttransfer = currentconfig->getGreyVectorTransfer(); + _value = currentconfig->getValueVector(); wxCommandEvent newevent(wxEVT_COMMAND_COMBOBOX_SELECTED,this->GetId()); ProcessEvent(newevent); - } - } + } // if size + } // _bitmapcombo +} + + +void HistogramDialogComboBox::OnBitmapComboItemSelected(wxCommandEvent& event) +{ + BitmapComboItemSelect( event.GetInt() ); } void HistogramDialogComboBox::OnLoadComboBoxData(std::vector& itembitmaps, std::string filename) @@ -343,6 +361,7 @@ void HistogramDialogComboBox::OnLoadComboBoxData(std::vector #include "vtkImageData.h" -#ifdef WIN32 -#define FILENAME "/data/colorsfunction.txt" -#else -#define FILENAME "colorsfunction.txt" -#endif - +#define COLORSFUNCTIONFILENAME "colorsfunction.txt" class HistogramDialogComboBox : public wxPanel { @@ -72,6 +67,7 @@ public: void OnEditBitmapCombo(wxCommandEvent& event); void OnBitmapComboItemSelected(wxCommandEvent& event); + void BitmapComboItemSelect(int value); void OnColorLevelChanged(wxCommandEvent& event); void OnWindowLevelChanged(wxCommandEvent& event); @@ -94,6 +90,8 @@ public: double GetWindowLevel(); double GetColorLevel(); + void InitCurrentPathColorsFuntion(); + std::string GetFileNameOfColorsFunction(); private: @@ -107,6 +105,8 @@ private: double _maxgreyvalue; int _currentitem; + std::string _currentpathColorsFuntion; + /* * Represents the color of the backGround. Default color is the parent color. */ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx index f1d5f36..8ab810e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx @@ -41,6 +41,7 @@ =========================================================================*/ #include "wxMaracasMultipleVolumeRendererManager.h" +#include "vtkRenderWindow.h" #include #include /** @@ -73,7 +74,7 @@ vtkRenderer* wxMaracasMultipleVolumeRendererManager::getRenderer(){ void wxMaracasMultipleVolumeRendererManager::Update(int ppid){ wxMaracasMultipleVolumeRendererManagerData* data = this->getViewData(ppid); data->Update(); - _renderer->Render(); + _renderer->GetRenderWindow()->Render(); } /** @@ -106,7 +107,8 @@ int wxMaracasMultipleVolumeRendererManager::addVolume(int idTP, vtkImageData* vo ** adds or removes an actor depending of the bool value **/ -void wxMaracasMultipleVolumeRendererManager::addRemoveActor(int propid, bool addremove) throw(char*){ +void wxMaracasMultipleVolumeRendererManager::addRemoveActor(int propid, bool addremove) throw(char*) +{ checkInvariant(); wxMaracasMultipleVolumeRendererManagerData* data = this->getViewData(propid); @@ -116,19 +118,22 @@ void wxMaracasMultipleVolumeRendererManager::addRemoveActor(int propid, bool add }else{ _renderer->RemoveViewProp(data->getProp3D()); } - _renderer->Render(); + _renderer->GetRenderWindow()->Render(); } } + + /** ** Changes the opacity in a prop3D **/ -void wxMaracasMultipleVolumeRendererManager::setVolumeOpacity(int propid, std::vector greylevel,std::vector value) throw(char*){ +void wxMaracasMultipleVolumeRendererManager::setVolumeOpacity(int propid, std::vector greylevel,std::vector value) throw(char*) +{ checkInvariant(); this->getViewData(propid)->setVolumeOpacity(greylevel, value); - _renderer->Render(); + _renderer->GetRenderWindow()->Render(); } @@ -138,15 +143,18 @@ void wxMaracasMultipleVolumeRendererManager::setVolumeOpacity(int propid, std::v void wxMaracasMultipleVolumeRendererManager::setVolumeColor(int volid, std::vector greylevel, std::vector red, std::vector green, - std::vector blue)throw(char*){ + std::vector blue)throw(char*) +{ checkInvariant(); this->getViewData(volid)->setVolumeColor(greylevel, red, green, blue); - _renderer->Render(); + _renderer->GetRenderWindow()->Render(); } -vtkImageData* wxMaracasMultipleVolumeRendererManager::getImageData(std::string filename){ + +vtkImageData* wxMaracasMultipleVolumeRendererManager::getImageData(std::string filename) +{ if(filename.compare("")!= 0){ vtkMetaImageReader* reader = vtkMetaImageReader::New(); @@ -166,17 +174,23 @@ vtkImageData* wxMaracasMultipleVolumeRendererManager::getImageData(std::string f return NULL; } -vtkImageData* wxMaracasMultipleVolumeRendererManager::getImageData(){ + +vtkImageData* wxMaracasMultipleVolumeRendererManager::getImageData() +{ return image; } -void wxMaracasMultipleVolumeRendererManager::checkInvariant() throw(char*){ + +void wxMaracasMultipleVolumeRendererManager::checkInvariant() throw(char*) +{ if(this->_renderer==NULL){ throw "Renderer not set"; } } -wxMaracasMultipleVolumeRendererManagerData* wxMaracasMultipleVolumeRendererManager::getViewData(int id) throw(char*){ + +wxMaracasMultipleVolumeRendererManagerData* wxMaracasMultipleVolumeRendererManager::getViewData(int id) throw(char*) +{ int i; for(i = 0; i < (int)(prop3Dvect.size());i++){ if(prop3Dvect[i]->getId() == id){ @@ -188,7 +202,9 @@ wxMaracasMultipleVolumeRendererManagerData* wxMaracasMultipleVolumeRendererManag return NULL; } -void wxMaracasMultipleVolumeRendererManager::deleteActor(int propid) throw (char *){ + +void wxMaracasMultipleVolumeRendererManager::deleteActor(int propid) throw (char *) +{ checkInvariant(); this->addRemoveActor(propid, false); @@ -215,14 +231,22 @@ void wxMaracasMultipleVolumeRendererManager::deleteActor(int propid) throw (char } -vtkPiecewiseFunction* wxMaracasMultipleVolumeRendererManager::GetTransferFunction(int volumeid){ + +vtkPiecewiseFunction* wxMaracasMultipleVolumeRendererManager::GetTransferFunction(int volumeid) +{ return getViewData(volumeid)->GetTransferFunction(); } -vtkColorTransferFunction* wxMaracasMultipleVolumeRendererManager::GetColorFunction(int volumeid){ + + +vtkColorTransferFunction* wxMaracasMultipleVolumeRendererManager::GetColorFunction(int volumeid) +{ return getViewData(volumeid)->GetColorFunction(); } -void wxMaracasMultipleVolumeRendererManager::changeCompositeMIPFunction(int id, int function) throw (char *){ + +void wxMaracasMultipleVolumeRendererManager::changeCompositeMIPFunction(int id, int function) throw (char *) +{ getViewData(id)->changeCompositeMIPFunction(function); + Update(id); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx index 89d4dee..d1197c5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx @@ -48,7 +48,7 @@ wxMaracasMultipleVolumeRendererManagerData::wxMaracasMultipleVolumeRendererManag _volumeMapper->AutoAdjustSampleDistancesOn(); _volumeProperty = vtkVolumeProperty::New(); _volumeProperty->SetInterpolationTypeToLinear(); - //_volumeProperty->ShadeOn(); + _volumeProperty->ShadeOn(); _volumeProperty->DisableGradientOpacityOn(); _volumeProperty->SetColor(_ctfun); _volumeProperty->SetScalarOpacity(_tfun ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx index b9bc3ac..b6e50ca 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx @@ -236,7 +236,11 @@ void wxVtkMPR2DView::Refresh() { //wxVtk2DBaseView::Refresh(); int x1 = 0,x2 = 0,y1 = 0,y2 = 0,z1 = 0,z2 = 0; - int x = 0, y = 0, z = 0; + +//EED 02/08/2013 +// int x = 0, y = 0, z = 0; + double x = 0, y = 0, z = 0; + int xx = 0, yy = 0, zz = 0; double *spc = 0; double *origin = 0; @@ -275,10 +279,16 @@ void wxVtkMPR2DView::Refresh() yy = (int)(GetVtkmprbasedata()->GetY()); zz = (int)(GetVtkmprbasedata()->GetZ()); - x = round(xx*spc[0]); - y = round(yy*spc[1]); - z = round(zz*spc[2]); - +//EED 02/08/2013 +// x = round(xx*spc[0]); +// y = round(yy*spc[1]); +// z = round(zz*spc[2]); + + x = xx*spc[0]; + y = yy*spc[1]; + z = zz*spc[2]; + + if ((xx!=_backX) || (yy!=_backY) || (zz!=_backZ)) { if (_direction==0) { // YZ -- 2.45.1