#include <vtkVolumeRayCastMapper.h>
-#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){
_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();
}
*/
- VolumeMapper = 0;
-#if VTK_MAJOR_VERSION >= 5
- #if VTK_MINOR_VERSION >= 6
- cout<<"using volume render GPU"<<endl;
- vtkGPUVolumeRayCastMapper * volumeMappergpu = vtkGPUVolumeRayCastMapper::New();
- volumeMappergpu->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"<<endl;
+// vtkGPUVolumeRayCastMapper * volumeMappergpu = vtkGPUVolumeRayCastMapper::New();
+// volumeMappergpu->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"<<endl;
+ vtkSmartVolumeMapper * smartvolumemapper = vtkSmartVolumeMapper::New();
+ VolumeMapper = smartvolumemapper;
+ smartvolumemapper->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();
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);
//EED9Juin2011 }
}
-void VolumeRendererManagerData::DisableBoundingBox(){
-
- if(BoxWidget){
+void VolumeRendererManagerData::DisableBoundingBox()
+{
+ if(BoxWidget)
+ {
BoxWidget->EnabledOff();
//BoxWidget->Delete();
//BoxWidget = 0;
-
cout<<"JPRG::VolumeRendererManagerData::DisableBoundingBox"<<endl;
-
-
}
}
_newvol->Update();
}
+
+
/**
** Volume Opacity
**/
-void VolumeRendererManagerData::setVolumeOpacity(std::vector<double> greylevel,std::vector<double> value){
-
+void VolumeRendererManagerData::setVolumeOpacity(std::vector<double> greylevel,std::vector<double> 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 "<<greylevel[i]<<" "<< value[i]<<std::endl;
- }
+ } // for i
_newvol->Update();
}
+
/**
** Volume Opacity
**/
setVolumeOpacity(greylevel, valuevector);
}
+
/**
** Check if the variables are setted correctly
**/
}
}
+
/**
** 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<vtkVolumeRayCastMapper*>(VolumeMapper)){
+ if(VolumeMapper!=NULL){
+#if VTK_MAJOR_VERSION >= 6
+ if(dynamic_cast<vtkVolumeRayCastMapper*>(VolumeMapper))
+ {
vtkVolumeRayCastMapper* volumemapper = dynamic_cast<vtkVolumeRayCastMapper*>(VolumeMapper);
if(function == 0){
volumemapper->SetVolumeRayCastFunction(_compositeFunction);
volumemapper->SetBlendModeToMinimumIntensity();
}
}
- #endif
#else
- vtkGPUVolumeRayCastMapper* volumemapper = dynamic_cast<vtkGPUVolumeRayCastMapper*>(VolumeMapper);
+ vtkVolumeRayCastMapper* volumemapper = dynamic_cast<vtkVolumeRayCastMapper*>(VolumeMapper);
if(function == 0){
volumemapper->SetBlendModeToComposite();
}else if(function == 1){
}
-void VolumeRendererManagerData::SetLookupTable(vtkLookupTable* lookuptable){
+void VolumeRendererManagerData::SetLookupTable(vtkLookupTable* lookuptable)
+{
if(lookuptable){
_ctfun->RemoveAllPoints();
vtkColorTransferFunction* colort = (vtkColorTransferFunction*)lookuptable;
}
-void VolumeRendererManagerData::changeInterpolationType(int type){
+void VolumeRendererManagerData::changeInterpolationType(int type)
+{
//checkInvariant();
if(type == 0){
_volumeProperty->SetInterpolationTypeToLinear();
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()
{
wxBoxSizer* comboeditsizer = new wxBoxSizer(wxHORIZONTAL);
_bitmapcombo = getBitmapComboElements();
+ BitmapComboItemSelect(0);
wxBitmap bitmap1(Edit_xpm);
wxBitmapButton* edit = new wxBitmapButton(this, -1, bitmap1,wxDefaultPosition,wxSize(30,30));
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<double> redvect,greenvect,bluevect;
std::vector<double> 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<HistogramDialogComboBoxItem*>& itembitmaps,std::string filename)
{
std::ofstream file;
file.close();
}
-wxBitmapComboBox* HistogramDialogComboBox::getBitmapComboElements()
+void HistogramDialogComboBox::InitCurrentPathColorsFuntion()
{
- std::string currentpath = "";
+ _currentpathColorsFuntion = "";
#ifdef WIN32
- currentpath = crea::System::GetDllAppPath("bbcreaMaracasVisu");
+ _currentpathColorsFuntion = crea::System::GetDllAppPath("bbcreaMaracasVisu");
#endif
#ifdef LINUX
- currentpath = crea::System::GetExecutablePath();
- currentpath.append("../share/CreaMaracasVisu/data/");
+ _currentpathColorsFuntion = crea::System::GetExecutablePath();
+ _currentpathColorsFuntion.append("/../share/creaMaracasVisu/data/");
+#endif
+ crea::System::createDirectory(_currentpathColorsFuntion.c_str());
+}
-printf("EED JCP OOOOJJJOOO cambiar esto HistogramDialogComboBox::HistogramDialog writting in this file ******************\n");
- currentpath = "/home/davila/dataHistogram";
-#endif
- currentpath.append(FILENAME);
- std::cout<<"current file name " <<currentpath<<std::endl;
+std::string HistogramDialogComboBox::GetFileNameOfColorsFunction()
+{
+ std::string filename;
+ filename = _currentpathColorsFuntion;
+ filename.append(COLORSFUNCTIONFILENAME);
+ return filename;
+}
+
+wxBitmapComboBox* HistogramDialogComboBox::getBitmapComboElements()
+{
std::vector<HistogramDialogComboBoxItem*> 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<HistogramDialogComboBoxItem*>& itembitmaps, std::string filename)
//std::cout<<filename<<std::endl;
itembitmaps.clear();
+
if(file.is_open())
{
bool add = false;
#include <wx/bmpcbox.h>
#include "vtkImageData.h"
-#ifdef WIN32
-#define FILENAME "/data/colorsfunction.txt"
-#else
-#define FILENAME "colorsfunction.txt"
-#endif
-
+#define COLORSFUNCTIONFILENAME "colorsfunction.txt"
class HistogramDialogComboBox : public wxPanel
{
void OnEditBitmapCombo(wxCommandEvent& event);
void OnBitmapComboItemSelected(wxCommandEvent& event);
+ void BitmapComboItemSelect(int value);
void OnColorLevelChanged(wxCommandEvent& event);
void OnWindowLevelChanged(wxCommandEvent& event);
double GetWindowLevel();
double GetColorLevel();
+ void InitCurrentPathColorsFuntion();
+ std::string GetFileNameOfColorsFunction();
private:
double _maxgreyvalue;
int _currentitem;
+ std::string _currentpathColorsFuntion;
+
/*
* Represents the color of the backGround. Default color is the parent color.
*/
=========================================================================*/
#include "wxMaracasMultipleVolumeRendererManager.h"
+#include "vtkRenderWindow.h"
#include <vtkMetaImageReader.h>
#include <vtkImageCast.h>
/**
void wxMaracasMultipleVolumeRendererManager::Update(int ppid){
wxMaracasMultipleVolumeRendererManagerData* data = this->getViewData(ppid);
data->Update();
- _renderer->Render();
+ _renderer->GetRenderWindow()->Render();
}
/**
** 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);
}else{
_renderer->RemoveViewProp(data->getProp3D());
}
- _renderer->Render();
+ _renderer->GetRenderWindow()->Render();
}
}
+
+
/**
** Changes the opacity in a prop3D
**/
-void wxMaracasMultipleVolumeRendererManager::setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value) throw(char*){
+void wxMaracasMultipleVolumeRendererManager::setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value) throw(char*)
+{
checkInvariant();
this->getViewData(propid)->setVolumeOpacity(greylevel, value);
- _renderer->Render();
+ _renderer->GetRenderWindow()->Render();
}
void wxMaracasMultipleVolumeRendererManager::setVolumeColor(int volid, std::vector<double> greylevel,
std::vector<double> red,
std::vector<double> green,
- std::vector<double> blue)throw(char*){
+ std::vector<double> 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();
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){
return NULL;
}
-void wxMaracasMultipleVolumeRendererManager::deleteActor(int propid) throw (char *){
+
+void wxMaracasMultipleVolumeRendererManager::deleteActor(int propid) throw (char *)
+{
checkInvariant();
this->addRemoveActor(propid, false);
}
-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);
}
_volumeMapper->AutoAdjustSampleDistancesOn();
_volumeProperty = vtkVolumeProperty::New();
_volumeProperty->SetInterpolationTypeToLinear();
- //_volumeProperty->ShadeOn();
+ _volumeProperty->ShadeOn();
_volumeProperty->DisableGradientOpacityOn();
_volumeProperty->SetColor(_ctfun);
_volumeProperty->SetScalarOpacity(_tfun );
{
//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;
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