}
//-------------------------------------------------------------------
-void vtkBaseData::SetZ(double z)
+void vtkBaseData::SetZ(double z, bool withObserver) // default withObserver=true
{
//int maxZ;
// int dim[3];
int ext[6];
double *origin;
vtkImageData* img = _marImageData->GetImageData();
- if(img!=NULL){
+ if(img!=NULL)
+ {
/*img->GetWholeExtent(ext);
maxZ=ext[5]-ext[4]+1;
if (z>=maxZ)
z = ext[4] + origin[2];
}
_z=z;
-// _observable->InvokeEvent(3);
- }
+ if (withObserver==true)
+ {
+ _observable->InvokeEvent(3);
+ } // if withObserver
+ } // if img
}
//-------------------------------------------------------------------
/**
** Calculates the value of the slider and the layer in the image that is spouse to show
**/
-void vtkMPRBaseData::SetX(double x)
+void vtkMPRBaseData::SetX(double x, bool withObserver) // default withObserver=true
{
//int dim[3];
int ext[6];
double *origin;
vtkImageData *img = _marImageData->GetImageData();
- if(img!=NULL){
+ if(img!=NULL)
+ {
/*img->GetDimensions(dim);
if (x<0)
{
x=ext[1] + origin[0];
}
_x=x;
-// _observable->InvokeEvent(1);
- }
+ if (withObserver==true)
+ {
+ _observable->InvokeEvent(1);
+ } // if withObserver
+ } // if img
}
//-------------------------------------------------------------------
/**
** Calculates the value of the slider and the layer in the image that is spouse to show
**/
-void vtkMPRBaseData::SetY(double y)
+void vtkMPRBaseData::SetY(double y, bool withObserver) // default withObserver=true
{
//int dim[3];
int ext[6];
double* origin;
vtkImageData* img = _marImageData->GetImageData();
- if(img!=NULL){
+ if(img!=NULL)
+ {
/*img->GetDimensions(dim);
if (y<0)
{
y=ext[3] + origin[1];
}
_y=y;
-// _observable->InvokeEvent(2);
- }
+ if (withObserver==true)
+ {
+ _observable->InvokeEvent(2);
+ } // if withObserver
+ }// if img
}
//-------------------------------------------------------------------
int GetMaxPositionZ( );
double GetX();
double GetY();
- void SetX(double x);
- void SetY(double y);
+ void SetX(double x, bool withObserver=true);
+ void SetY(double y, bool withObserver=true);
void GetDimensionExtention(int *x1,int *x2,int *y1,int *y2,int *z1,int *z2);
vtkTransform* GetTransformOrientation();
void SetNormal(double nx, double ny, double nz);