//=====
void ColorLayerImageView2::Process()
{
-
-// THE MAIN PROCESSING METHOD BODY
-// Here we simply set the input 'In' value to the output 'Out'
-// And print out the output value
-// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
-// void bbSet{Input|Output}NAME(const TYPE&)
-// const TYPE& bbGet{Input|Output}NAME() const
-// Where :
-// * NAME is the name of the input/output
-// (the one provided in the attribute 'name' of the tag 'input')
-// * TYPE is the C++ type of the input/output
-// (the one provided in the attribute 'type' of the tag 'input')
- // bbSetOutputOut( bbGetInputIn() );
- // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
-
-
if (bbGetInputActive()==true)
{
if (bbGetInputIn()!=NULL) {
} else {
printf("EED Error!!! ColorLayerImageView::Process (%s) Missing Inputs: WxVtkBaseView , WxVtkBaseView1 , WxVtkBaseView2 \n", bbGetFullName().c_str() );
}// if xxVtkBaseView
-
} // if In
-
} // if Active
-
-
-
}
-//=====
+
+//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
void ColorLayerImageView2::bbUserSetDefaultValues()
bbSetInputColorBarPosition(lstColorBarPosition);
// bbSetOutputWidget(NULL);
}
-//=====
+
+//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
void ColorLayerImageView2::bbUserInitializeProcessing()
{
-
_colorLayerImageViewManager = new ColorLayerImageViewManager();
-
// THE INITIALIZATION METHOD BODY :
// Here does nothing
// but this is where you should allocate the internal/output pointers
-// if any
-
-
+// if any
}
-//=====
+
+//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
void ColorLayerImageView2::bbUserFinalizeProcessing()
{
-
// THE FINALIZATION METHOD BODY :
// Here does nothing
// but this is where you should desallocate the internal/output pointers
// if any
-
-}
}
-// EO namespace bbcreaMaracasVisu
+
+}// EO namespace bbcreaMaracasVisu
} else {
result = LayerImageBase::GetY();
}
-
return result;
}
{
int result=0;
if (_fix_dynamic==false)
- {
+ {
result = _z2;
- }
- else
- {
+ } else {
result = LayerImageBase::GetZ();
- }
-
+ }
return result;
}
*/
#include "LayerImageBase.h"
-
#include "wxMPRBaseData.h"
#include "wxVtk2DBaseView.h"
+#include "vtkPlane2DView.h"
#include "creawxVTKRenderWindowInteractor.h"
+
#include "vtkTextProperty.h"
+#include "vtkPointData.h"
//---------------------------------------------------------------------------------------------
void SetLayerImageBase(LayerImageBase* layerimagebase)
{
- _layerimagebase = layerimagebase;
+ _layerimagebase = layerimagebase;
}
private:
_Yback = -9999;
_Zback = -9999;
_opacity = 1;
- _thresholdTable = NULL;
- _thresholdMapper = NULL;
+
_scalarbarActor = NULL;
_thresholdActor = NULL;
_image = NULL;
_imageBack = NULL;
_baseView = NULL;
+
+ _thresholdTable = NULL;
+ _thresholdMapper = NULL;
+ _3Dslices = NULL;
+ _stPoints = NULL;
+
+ // EED Borrame
+// vtkLookupTable *_thresholdTable = vtkLookupTable::New();
+// vtkImageMapToColors *_thresholdMapper = vtkImageMapToColors::New( );
+// vtkProbeFilter *_3Dslices = vtkProbeFilter::New( ) ;
+// vtkStructuredPoints *_stPoints = vtkStructuredPoints::New( );
+
_imageReslicer = vtkImageReslice::New();
_imageChangeInformation = vtkImageChangeInformation::New();
this->ResetRefresh(); // _Xback=-9999 _Yback=-9999 _Zback=-9999
spcBase[0] = 0;
spcBase[1] = 0;
spcBase[2] = 0;
- spcBase[3] = 0;
- spcBase[4] = 0;
- spcBase[5] = 0;
+// spcBase[3] = 0;
+// spcBase[4] = 0;
+// spcBase[5] = 0;
_image = image;
_dimBase[2] = dim[2];
}
-
-
//------------------------------------------------------------------------------
void LayerImageBase::GetSpcOriginalLayer(double *spc)
{
}
}
+
+
//----------------------------------------------------------------------------
void LayerImageBase::onThreshold()
+{
+ bool ok = false;
+ int directionViewer = 0;
+ double x = GetX();
+ double y = GetY();
+ double z = GetZ();
+ x = x*_spcBase[0];
+ y = y*_spcBase[1];
+ z = z*_spcBase[2];
+ double rotationXactor = 0;
+ double rotationYactor = 0;
+ double rotationZactor = 0;
+ double AxesDirectionCosines[9];
+ double positionActor[3];
+ double AxesOrigin[3];
+
+ if (_baseView!=NULL)
+ {
+ vtkCamera *camera = _baseView->GetRenderer()->GetActiveCamera();
+ if (camera->GetParallelProjection()==1)
+ {
+ wxVtk2DBaseView *wxvtk2dbasevie = (wxVtk2DBaseView *)_baseView;
+ directionViewer = wxvtk2dbasevie->GetDirection();
+ } // ParallelProjection
+
+ if (_image!=_imageBack)
+ {
+ ok = true;
+ _imageBack = _image;
+ }
+
+ if (directionViewer==0)
+ {
+ if (GetX()!=_Xback)
+ {
+ ok = true;
+ _Xback = GetX();
+ AxesDirectionCosines[0] = 0; //
+ AxesDirectionCosines[1] = 0;
+ AxesDirectionCosines[2] = 1;
+ AxesDirectionCosines[3] = 0; //
+ AxesDirectionCosines[4] = 1;
+ AxesDirectionCosines[5] = 0;
+ AxesDirectionCosines[6] = -1; //
+ AxesDirectionCosines[7] = 0;
+ AxesDirectionCosines[8] = 0;
+ AxesOrigin[0] = x;
+ AxesOrigin[1] = 0;
+ AxesOrigin[2] = 0;
+ positionActor[0] = 900-1;
+ positionActor[1] = 0;
+ positionActor[2] = 0;
+ rotationYactor = -90;
+ } // if _Xback
+ }
+
+ if (directionViewer==1)
+ {
+ if (GetY()!=_Yback)
+ {
+ ok = true;
+ _Yback = GetY();
+ AxesDirectionCosines[0] = 1;
+ AxesDirectionCosines[1] = 0;
+ AxesDirectionCosines[2] = 0;
+ AxesDirectionCosines[3] = 0;
+ AxesDirectionCosines[4] = 0;
+ AxesDirectionCosines[5] = 1;
+ AxesDirectionCosines[6] = 0;
+ AxesDirectionCosines[7] = -1;
+ AxesDirectionCosines[8] = 0;
+ AxesOrigin[0] = 0;
+ AxesOrigin[1] = y;
+ AxesOrigin[2] = 0;
+ positionActor[0] = 0;
+ positionActor[1] = -900-1;
+ positionActor[2] = 0;
+ rotationXactor = 90;
+ } // if _Yback
+ }
+
+ if (directionViewer==2)
+ {
+ if (GetZ()!=_Zback)
+ {
+ ok = true;
+ _Zback = GetZ();
+ AxesDirectionCosines[0] = 1;
+ AxesDirectionCosines[1] = 0;
+ AxesDirectionCosines[2] = 0;
+ AxesDirectionCosines[3] = 0;
+ AxesDirectionCosines[4] = 1;
+ AxesDirectionCosines[5] = 0;
+ AxesDirectionCosines[6] = 0;
+ AxesDirectionCosines[7] = 0;
+ AxesDirectionCosines[8] = 1;
+ AxesOrigin[0] = 0;
+ AxesOrigin[1] = 0;
+ AxesOrigin[2] = z;
+ positionActor[0] = 0;
+ positionActor[1] = 0;
+ positionActor[2] = -900+100;
+ } // if _Zback
+ }
+
+ if (directionViewer==3)
+ {
+// EED Borrame
+// if ( (GetX()!=_Xback) || (GetY()!=_Yback) || (GetZ()!=_Zback) )
+// {
+// _Xback = GetX();
+// _Yback = GetY();
+// _Zback = GetZ();
+// ok = true;
+// } // if _Yback
+ ok = true;
+ AxesDirectionCosines[0] = 1;
+ AxesDirectionCosines[1] = 0;
+ AxesDirectionCosines[2] = 0;
+ AxesDirectionCosines[3] = 0;
+ AxesDirectionCosines[4] = 1;
+ AxesDirectionCosines[5] = 0;
+ AxesDirectionCosines[6] = 0;
+ AxesDirectionCosines[7] = 0;
+ AxesDirectionCosines[8] = 1;
+ AxesOrigin[0] = x;
+ AxesOrigin[1] = y;
+ AxesOrigin[2] = z;
+ positionActor[0] = 0;
+ positionActor[1] = 0;
+ positionActor[2] = 900-100;
+ }
+
+ } // if _baseView != NULL
+
+// EED 2025-09-16 Borrame
+// ok=true;
+//
+
+ if ( (_image!=NULL) && (_baseView!=NULL) && (ok==true) )
+ {
+ CleanXYZ(x,y,z);
+ if (!GetActorPresent())
+ {
+ if (_thresholdTable==NULL)
+ {
+ _thresholdTable = vtkLookupTable::New();
+ _thresholdMapper = vtkImageMapToColors::New( );
+ _3Dslices = vtkProbeFilter::New( ) ;
+ _stPoints = vtkStructuredPoints::New( );
+ }
+ /*
+ if (_thresholdTable==NULL)
+ {
+ //Lookup Table
+ _thresholdTable = vtkLookupTable::New();
+ } // _thresholdTable
+
+ if (_thresholdMapper==NULL)
+ {
+ _thresholdMapper = vtkImageMapToColors::New( );
+ }
+*/
+
+ if (_thresholdActor==NULL)
+ {
+ _thresholdActor = vtkImageActor::New( );
+ _scalarbarActor = vtkScalarBarActor::New();
+ UpdateColorBarPosition();
+ _scalarbarActor->SetHeight(0.4); //default 0.8
+ _scalarbarActor->SetWidth(0.10); //default 0.17
+ _thresholdActor->SetOpacity( 1 );
+ _thresholdActor->InterpolateOn();
+
+ _thresholdActor->SetPosition( positionActor );
+ _thresholdActor->RotateX( rotationXactor );
+ _thresholdActor->RotateY( rotationYactor );
+ _thresholdActor->RotateZ( rotationZactor );
+
+/* EED Borrame
+ if (directionViewer==0)
+ {
+ _thresholdActor->SetPosition( 900-1,0,0 );
+ _thresholdActor->RotateY( -90 );
+ }
+ if (directionViewer==1)
+ {
+ _thresholdActor->SetPosition( 0,-900-1, 0 );
+ _thresholdActor->RotateX( 90 );
+ }
+ if (directionViewer==2)
+ {
+ _thresholdActor->SetPosition( 0,0, -900+100 );
+ }
+ if (directionViewer==3)
+ {
+ _thresholdActor->SetPosition( 0,0, 900-100 );
+ }
+*/
+ } // _thresholdActor
+
+ _baseView->GetRenderer()->AddActor( _thresholdActor );
+ _baseView->GetRenderer()->AddActor2D( _scalarbarActor );
+ _actorPresent = true;
+ } // !GetActorPresent()
+
+ ConfigLookupTable(); // virtual method
+
+ vtkImageData *img=NULL;
+ if ( (directionViewer>=0) && (directionViewer<=2) )
+ {
+
+ _imageReslicer->SetInputData( GetImage() );
+ _imageReslicer->SetInformationInput( GetImage() );
+ _imageReslicer->SetResliceAxesDirectionCosines( AxesDirectionCosines );
+ _imageReslicer->SetResliceAxesOrigin( AxesOrigin );
+
+ /*
+ if (directionViewer==0)
+ {
+ _imageReslicer->SetResliceAxesDirectionCosines( 0,0,1, 0,1,0, -1,0,0 );
+ _imageReslicer->SetResliceAxesOrigin(x,0,0);
+ }
+
+ if (directionViewer==1)
+ {
+ _imageReslicer->SetResliceAxesDirectionCosines( 1,0,0 ,0,0,1, 0,-1,0 );
+ _imageReslicer->SetResliceAxesOrigin(0,y,0);
+ }
+
+ if (directionViewer==2)
+ {
+ _imageReslicer->SetResliceAxesDirectionCosines( 1,0,0, 0,1,0 ,0,0,1 );
+ _imageReslicer->SetResliceAxesOrigin(0,0,z);
+ }
+ */
+
+ _imageReslicer->SetOutputDimensionality(2);
+// _imageReslicer->SetInterpolationModeToLinear();
+ _imageReslicer->SetInterpolationModeToNearestNeighbor();
+// _imageReslicer->Modified();
+ _imageReslicer->Update();
+ img = _imageReslicer->GetOutput();
+ }
+
+
+ if (directionViewer==3)
+ {
+ vtkPlane2DView *plane2DView = (vtkPlane2DView*)_baseView;
+ vtkPlaneSource *pSource = plane2DView->GetPlaneSource();
+ int sizeIma = plane2DView->GetImgSize();
+
+ // EED Borrame
+ /*
+ if (_3Dslices==NULL)
+ {
+ _3Dslices = vtkProbeFilter::New( ) ;
+ }
+ if (_stPoints==NULL)
+ {
+ _stPoints = vtkStructuredPoints::New( );
+ }
+ */
+
+ _3Dslices -> SetInputData( (vtkDataSet*)pSource->GetOutput( ) );
+ _3Dslices -> SetSourceData( GetImage() );
+ _3Dslices -> Update( );
+ _stPoints -> GetPointData( )->SetScalars( _3Dslices->GetOutput()->GetPointData()->GetScalars() );
+ _stPoints -> SetDimensions( sizeIma, sizeIma, 1 );
+ vtkInformation* info=_stPoints->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(info, VTK_SHORT, 1);
+ img = _stPoints;
+
+ /*
+ vtkProbeFilter *_3Dslices;
+ _3Dslices -> SetInputData( (vtkDataSet*)pSource->GetOutput( ) );
+ _3Dslices -> SetSourceData( GetImage() );
+ _3Dslices -> Update( );
+ _stPoints -> GetPointData( )->SetScalars( _3Dslices->GetOutput()->GetPointData()->GetScalars() );
+ _stPoints -> SetDimensions( _sizeIma, _sizeIma, 1 );
+ vtkInformation* info=_stPoints->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(info, VTK_SHORT, 1);
+ img = _stPoints;
+ */
+ }
+
+ _thresholdMapper->SetInputData( img );
+ _thresholdMapper->SetLookupTable( _thresholdTable );
+ _thresholdMapper->Update();
+ _thresholdActor->SetInputData( _thresholdMapper->GetOutput() );
+ _thresholdActor->SetOpacity(_opacity*2);
+ _scalarbarActor->SetLookupTable( _thresholdTable );
+// _scalarbarActor->SetLookupTable( _thresholdMapper->GetLookupTable() );
+ _scalarbarActor->SetTitle("Value");
+ _scalarbarActor->SetNumberOfLabels(4);
+ int fontsize = _scalarbarActor->GetLabelTextProperty()->GetFontSize();
+ _scalarbarActor->GetLabelTextProperty()->SetFontSize(fontsize/2);
+// _scalarbarActor->SetTextPad(4); ??
+ } // if _image _baseView ok
+}
+
+/* -------------------Borrame EED---------------------------------------------
+void LayerImageBase::onThreshold()
{
bool ok = false;
int directionViewer = 0;
{
if (GetX()!=_Xback)
{
- _Xback = GetX();
- ok=true;
+ _Xback = GetX();
+ ok = true;
} // if _Yback
}
{
if (GetY()!=_Yback)
{
- _Yback = GetY();
- ok=true;
+ _Yback = GetY();
+ ok = true;
} // if _Yback
}
{
if (GetZ()!=_Zback)
{
- _Zback = GetZ();
- ok=true;
+ _Zback = GetZ();
+ ok = true;
} // if _Yback
}
+
+ if (directionViewer==3)
+ {
+// if ( (GetX()!=_Xback) || (GetY()!=_Yback) || (GetZ()!=_Zback) )
+// {
+// _Xback = GetX();
+// _Yback = GetY();
+// _Zback = GetZ();
+// ok = true;
+// } // if _Yback
+ ok = true;
+ }
+
+printf("EED LayerImageBase::onThreshold directionViewer=%d\n", directionViewer);
+
if (_image!=_imageBack)
{
_imageBack=_image;
{
_thresholdActor->SetPosition( 0,0, -900+100 );
}
+ if (directionViewer==3)
+ {
+ _thresholdActor->SetPosition( 0,0, 900-100 );
+ }
+
} // _thresholdActor
_baseView->GetRenderer()->AddActor( _thresholdActor );
_imageReslicer->SetResliceAxesOrigin(0,0,z);
}
+ if (directionViewer==3)
+ {
+ vtkMPRBaseData *mprbasedata = (vtkMPRBaseData*)_baseView -> GetVtkBaseData();
+ vtkTransform *transform = mprbasedata -> GetTransformOrientation();
+ _imageReslicer->SetResliceTransform( transform );
+ _imageReslicer->SetResliceAxesOrigin(x,y,z);
+ }
+
+
_imageReslicer->SetOutputDimensionality(2);
// _imageReslicer->SetInterpolationModeToLinear();
_imageReslicer->SetInterpolationModeToNearestNeighbor();
// _scalarbarActor->SetTextPad(4); ??
} // if _image _baseView ok
}
+*/
//----------------------------------------------------------------------------
void LayerImageBase::onThresholdChange()
#include <vtkImageData.h>
#include "wxVtkBaseView.h"
#include "vtkScalarBarActor.h"
+#include "vtkPlaneSource.h"
+#include "vtkStructuredPoints.h"
+#include "vtkProbeFilter.h"
#include "InteractorStyleMaracas.h"
#include "vtkImageChangeInformation.h"
vtkScalarBarActor *_scalarbarActor;
virtual void ConfigLookupTable() = 0;
void CleanXYZ(double &x, double &y, double &z);
+ vtkProbeFilter *_3Dslices;
+ vtkStructuredPoints *_stPoints;
+
protected:
double _range[2];
std::vector<int> _colorBarPosition;
};
-
-
#endif // __LayerImageBase_h__
int minTot2;
int maxTot2;
- minVal2=minVal-minTot;
- maxVal2=maxVal-minTot;
- minTot2=minTot-minTot;
- maxTot2=maxTot-minTot;
+ minVal2 = minVal-minTot;
+ maxVal2 = maxVal-minTot;
+ minTot2 = minTot-minTot;
+ maxTot2 = maxTot-minTot;
// thresholdTable->SetTableRange(minVal,maxVal);
//EED You need to do this loop just the first time
//-------------------------------------------------------------------
void vtkBaseData::SetCameraParallelScale(double value)
{
- _cameraparallelScale=value;
+ _cameraparallelScale = value;
}
//-------------------------------------------------------------------
z = _pointMouseZ;
}
+void vtkBaseData::CallObserver(bool withObserver)
+{
+ if (withObserver==true)
+ {
+ _observable->InvokeEvent(4);
+ } // if withObserver
+}
void SetCameraParallelScale(double value);
void SetPointMouse( int x, int y, int z);
void GetPointMouse( int &x, int &y, int &z);
+ void CallObserver(bool withObserver);
+
protected:
marImageData *_marImageData;
double _z;
vtkMPR3DDataViewer::vtkMPR3DDataViewer()
{
- _visiblePosition[0]=false;
- _visiblePosition[1]=false;
- _visiblePosition[2]=false;
- _ctfun = NULL;
- _vtkmprbasedata = NULL;
- _ctfun = NULL;
- _saggitalColors = NULL;
- _saggital = NULL;
- _axialColors = NULL;
- _axial = NULL;
- _coronalColors = NULL;
- _coronal = NULL;
- _mapOutline = NULL;
- _outline = NULL;
- _outlineData = NULL;
+ _visiblePosition[0] = false;
+ _visiblePosition[1] = false;
+ _visiblePosition[2] = false;
+ _ctfun = NULL;
+ _vtkmprbasedata = NULL;
+ _ctfun = NULL;
+ _saggitalColors = NULL;
+ _saggital = NULL;
+ _axialColors = NULL;
+ _axial = NULL;
+ _coronalColors = NULL;
+ _coronal = NULL;
+ _mapOutline = NULL;
+ _outline = NULL;
+ _outlineData = NULL;
}
//-------------------------------------------------------------------
vtkMPR3DDataViewer::~vtkMPR3DDataViewer()
# ------------------------------------------------------------------------ */
#include "vtkPlane2DView.h"
-
#include "vtkCellArray.h"
+#include "vtkPointData.h"
+#include "vtkImageAppend.h"
+#include "vtkImageSlab.h"
+
#include "vtkInteractorStyleBaseView2D.h"
-#include "vtkPointData.h"
-vtkPlane2DView::vtkPlane2DView( wxWindow *parent)
-: wxVtk2DBaseView(parent)
+vtkPlane2DView::vtkPlane2DView( wxWindow *parent) : wxVtk2DBaseView(parent)
{
-
_backX = -99999;
_backY = -99999;
_backZ = -99999;
-
_backOrient[0] = -99999;
_backOrient[1] = -99999;
_backOrient[2] = -99999;
_backOrient[3] = -99999;
-
_active = true;
_mip_visualization = true;
_mip_width = 2;
-
_transform1 = vtkTransform::New();
_transform2 = vtkTransform::New();
_transform1->Identity();
_transform2->Identity();
-
_sizeIma = 200;
-
_pSource = NULL;
_3Dslices = NULL;
_stPoints = NULL;
_change = NULL;
_imageResult = NULL;
-
// line horizontal
_pts = NULL;
_lineActor = NULL;
_lineMapper = NULL;
_pd = NULL;
-
_interactorstyleplane2D = NULL;
}
//-------------------------------------------------------------------
//-------------------------------------------------------------------
void vtkPlane2DView::ResetBack()
{
- _backX=-1;
- _backY=-1;
- _backZ=-1;
- _backOrient[0]=-1;
- _backOrient[1]=-1;
- _backOrient[2]=-1;
- _backOrient[3]=-1;
+ _backX = -1;
+ _backY = -1;
+ _backZ = -1;
+ _backOrient[0] = -1;
+ _backOrient[1] = -1;
+ _backOrient[2] = -1;
+ _backOrient[3] = -1;
}
//-------------------------------------------------------------------
double spc[3];
vtkImageData *imagedata = GetVtkmprbasedata()->GetImageData();
imagedata->GetSpacing(spc);
- x=x*spc[0];
- y=y*spc[1];
- z=z*spc[2];
+ x = x*spc[0];
+ y = y*spc[1];
+ z = z*spc[2];
vtkMPRBaseData *mprbasedata = (vtkMPRBaseData*)this->GetVtkBaseData();
double pB[3];
in[0]=1; in[1]=0; in[2]=0;
transform->TransformPoint(in,_n);
-
in[0]=0; in[1]=dimIma-1; in[2] = 0;
transform->TransformPoint(in,pA);
-
in[0]=0; in[1]=0; in[2]=dimIma-1;
transform->TransformPoint(in,pB);
-
_pSource -> SetPoint1( pA );
_pSource -> SetPoint2( pB );
-
_pSource -> SetOrigin( 0 , 0 , 0 );
_pSource -> SetResolution( sizeIma-1 , sizeIma -1 );
_pSource -> Update();
_pSource -> SetCenter( x, y, z );
_pSource -> SetNormal( _n );
_pSource -> Update( );
-
// EED Borrame
// transform->Delete();
-
}
//-------------------------------------------------------------------
double x = GetVtkmprbasedata()->GetX();
double y = GetVtkmprbasedata()->GetY();
double z = GetVtkmprbasedata()->GetZ();
-
double spc[3];
vtkImageData *imagedata = GetVtkmprbasedata()->GetImageData();
imagedata->GetSpacing(spc);
- x=x*spc[0];
- y=y*spc[1];
- z=z*spc[2];
-
+ x = x*spc[0];
+ y = y*spc[1];
+ z = z*spc[2];
vtkTransform *transform = GetVtkmprbasedata()->GetTransformOrientation();
double orientation[4];
transform->GetOrientationWXYZ(orientation);
-
bool okOrientation=true;
if ((orientation[0]!=_backOrient[0]) || (orientation[1]!=_backOrient[1]) ||
(orientation[2]!=_backOrient[2]) || (orientation[3]!=_backOrient[3]))
{
okOrientation=false;
}
-
bool okPosicion=true;
if ( (x!=_backX) || (y!=_backY) || (z!=_backZ) )
{
okPosicion=false;
}
-
- if ((okPosicion==false) || (okOrientation==false) ) {
- if (_active==true){
-
+ if ((okPosicion==false) || (okOrientation==false) )
+ {
+ if (_active==true)
+ {
bool ok = false;
-
if ( _mip_visualization==true )
{
if (_interactorstyleplane2D!=NULL)
}
}
// ok=true;
-
if (ok==true)
{
Extract_MIP_PlaneVTK();
} // ok
} // active
- _backX=x;
- _backY=y;
- _backZ=z;
- _backOrient[0]=orientation[0];
- _backOrient[1]=orientation[1];
- _backOrient[2]=orientation[2];
- _backOrient[3]=orientation[3];
+ GetVtkmprbasedata()->CallObserver(true); // This is for refresh ColorLayer mechanism
+ _backX = x;
+ _backY = y;
+ _backZ = z;
+ _backOrient[0] = orientation[0];
+ _backOrient[1] = orientation[1];
+ _backOrient[2] = orientation[2];
+ _backOrient[3] = orientation[3];
} //okPosition okOrientation
}
//-------------------------------------------------------------------
void vtkPlane2DView::Extract_One_PlaneVTK()
{
+ printf("EED vtkPlane2DView::Extract_One_PlaneVTK \n");
+
vtkImageData *imagedata = GetVtkmprbasedata()->GetImageData();
SetPSource(_sizeIma);
-
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
_3Dslices -> SetInput( ( vtkDataSet* )_pSource->GetOutput( ) );
_3Dslices -> SetInputData( ( vtkDataSet* )_pSource->GetOutput( ) );
_3Dslices -> SetSourceData( imagedata );
#endif
-
_3Dslices -> Update( );
_stPoints -> GetPointData( )->SetScalars( _3Dslices->GetOutput()->GetPointData()->GetScalars() );
_stPoints -> SetDimensions( _sizeIma, _sizeIma, 1 );
-
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
_stPoints -> SetScalarType( imagedata->GetScalarType() );
// _change -> Update(); //important
_imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _stPoints );
#else
-printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n");
-printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n");
-printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n");
-printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n");
printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n");
vtkInformation* info=_stPoints->GetInformation();
vtkDataObject::SetPointDataActiveScalarInfo(info, VTK_SHORT, 1);
_imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( _stPoints );
-
#endif
-
-
// _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _change->GetOutput() );
// vtkImageActor *imageActor = _imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor();
+
}
//-------------------------------------------------------------------
void vtkPlane2DView::Extract_MIP_PlaneVTK( /*double heightDefinition*/ )
{
+
int mipWidth;
double sp;
int sizeWidth = (_mip_width*2)+1 ;
sizeWidth = tmpSizeWith;
deltaPixel = 4;
}
+
std::vector< vtkProbeFilter* > slicesLST;
+ std::vector< vtkStructuredPoints* > stPointsLST;
+
_pSource->Push( -mipWidth * sp );
_pSource->Update();
+
+
+ vtkImageAppend *appender = vtkImageAppend::New();
+ // Définition de l'axe : 0 = X (horizontal), 1 = Y (vertical), 2 = Z (profondeur)
+ appender->SetAppendAxis(2);
+// vtkImageData* outputImage = appender->GetOutput();
+
for ( iWidth=0 ; iWidth<sizeWidth ; iWidth++ )
{
vtkProbeFilter *slice = vtkProbeFilter::New();
slice -> SetSourceData( imagedata );
#endif
slice -> Update( );
+
+ vtkStructuredPoints *stPoints = vtkStructuredPoints::New();
+ stPoints -> GetPointData( )->SetScalars( slice->GetOutput()->GetPointData()->GetScalars() );
+ stPoints -> SetDimensions( _sizeIma, _sizeIma, 1 );
+ vtkInformation* info=stPoints->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(info, VTK_SHORT, 1);
+
slicesLST.push_back( slice );
+ stPointsLST.push_back( stPoints );
+ appender->AddInputData(stPoints);
+
_pSource->Push( sp );
}
+
+ appender->Update();
+ vtkImageSlab *imageSlab = vtkImageSlab::New();
+ imageSlab->SetInputData( appender->GetOutput() );
+ imageSlab->SetOperationToMax();
+ imageSlab->Update();
+
+ _imageResult = imageSlab->GetOutput();
+
+ printf(">>> \n");
+ printf(">>>EED Warning! vtkPlane2DView::Extract_MIP_PlaneVTK \n");
+ printf(">>> 1) Add mip options in control panel \n");
+ printf(">>> 2) We need to check the sp pSource to the correct mip thicknes \n");
+ printf(">>> 3) We need to check resolution of the pixels in the different mip width \n");
+ printf(">>> \n");
+
+
+
+ /* --- EED Borrame ------------
if (_imageResult ==NULL)
{
_imageResult = vtkImageData::New();
#endif
}
+
unsigned short *pTemp;
- unsigned short *pResult;
- pResult = (unsigned short*)_imageResult->GetScalarPointer( 0 , 0 , 0 );
+ unsigned short *pResult;
+ pResult = (unsigned short*)_imageResult->GetScalarPointer( 0 , 0 , 0 );
int iPixels , sizePixels = _sizeIma*_sizeIma;
- for(iPixels=0 ; iPixels<sizePixels ; iPixels=iPixels+deltaPixel)
+ for( iPixels=0 ; iPixels<sizePixels ; iPixels=iPixels+deltaPixel )
{
- pTemp = (unsigned short*)slicesLST[0]->GetOutput()->GetPointData()->GetScalars()->GetVoidPointer(0);
- pResult = (unsigned short*)_imageResult->GetScalarPointer( 0 , 0 , 0 );
- pResult[iPixels] = pTemp[iPixels];
- for (iWidth=1;iWidth<sizeWidth;iWidth++)
+// pTemp = (unsigned short*)slicesLST[0]->GetOutput()->GetPointData()->GetScalars()->GetVoidPointer(0);
+ pTemp = (unsigned short*)stPointsLST[0]->GetScalarPointer();
+ pResult = (unsigned short*)_imageResult->GetScalarPointer( 0 , 0 , 0 );
+ pResult[iPixels] = pTemp[iPixels];
+ for ( iWidth=1 ; iWidth<sizeWidth ; iWidth++ )
{
- pTemp = (unsigned short*)slicesLST[iWidth]->GetOutput()->GetPointData()->GetScalars()->GetVoidPointer(0);
-
+// pTemp = (unsigned short*)slicesLST[iWidth]->GetOutput()->GetPointData()->GetScalars()->GetVoidPointer(0);
+ pTemp = (unsigned short*)stPointsLST[0]->GetScalarPointer();
if (pResult[iPixels]< pTemp[iPixels])
{
pResult[iPixels] = pTemp[iPixels];
}
- }
+ } // for iWidth
if (deltaPixel!=1)
{
for (itmp=1;itmp<deltaPixel;itmp++)
{
pResult[iPixels+itmp] = pResult[iPixels];
- }
- }
- }
+ } // for
+ } // if deltaPixel!=1
+ } // for iPixels
for (iWidth=0;iWidth<sizeWidth;iWidth++)
{
- slicesLST[iWidth]->Delete();
- }
+ slicesLST[iWidth]->Delete();
+ stPointsLST[iWidth]->Delete();
+ } // for iWidth
_imageResult->Modified();
+ */
+
+
+
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
_imageViewer2XYZ->GetVtkImageViewer2()->SetInput( _imageResult );
#else
- _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( _imageResult );
+ _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( _imageResult );
#endif
}
{
if (ok_ang==false)
{
- _ang =sqrt( vx*vx + vy*vy ) / 1.5;
+ _ang = sqrt( vx*vx + vy*vy ) / 1.5;
}
-
if (ok_v==false){
- _vxb=-vy;
- _vyb=vx;
+ _vxb = -vy;
+ _vyb = vx;
}
_transform2->Identity();
_transform2->RotateWXYZ(_ang,0,_vxb,_vyb);
-
vtkMPRBaseData *mprbasedata = (vtkMPRBaseData*)this->GetVtkBaseData();
vtkTransform *transform = vtkTransform::New();
transform->Identity();
transform->Concatenate(_transform2);
mprbasedata->InitTransformOrientation(transform);
transform->Delete();
-
// Refresh Horizontal Line
_pts->SetPoint( 0 , (_sizeIma/2) - _vxb*2 , (_sizeIma/2) - _vyb*2 , 1 );
_pts->SetPoint( 1 , (_sizeIma/2) + _vxb*2 , (_sizeIma/2) + _vyb*2 , 1 );
//-------------------------------------------------------------------
void vtkPlane2DView::SetActualSlice(int slice) // Virtual
{
- double dir=(double)slice/3.0;
+ double dir = (double)slice/3.0;
GetVtkmprbasedata()->SetXYZ( _cx+(_n[0]*dir) , _cy+(_n[1]*dir) , _cz+(_n[2]*dir) );
}
void vtkPlane2DView::SetMipVisualization(bool ok)
{
- _mip_visualization=ok;
+ _mip_visualization = ok;
}
//---------------------------------------------------------------------------
void vtkPlane2DView::SetMipWidth(int value)
{
- _mip_width=value;
+ _mip_width = value;
}
//---------------------------------------------------------------------------
Z = out[2] + GetVtkmprbasedata()->GetZ() ;
}
+//-------------------------------------------------------------------
+int vtkPlane2DView::GetDirection() // virtual
+{
+ return 3;
+}
+
+//-------------------------------------------------------------------
+vtkPlaneSource* vtkPlane2DView::GetPlaneSource()
+{
+ return _pSource;
+}
void ExtractPlane();
int GetImgSize();
void SetImgSize( int imgSize );
-
void RotationStart();
void RotationDrag(double vx, double vy, bool ok_v, bool ok_ang);
-
virtual int GetActualSlice();
virtual void SetActualSlice(int slice);
-
virtual void Refresh( );
-
vtkMPRBaseData *GetVtkmprbasedata();
vtkInteractorStylePlane2D *GetInteractorstyleplane2D();
-
void SetActive(bool active);
void SetVisibleLine(bool ok);
-
void TransfromCoordViewWorld2(double &X, double &Y, double &Z);
-
int GetMipWidth();
void SetMipWidth(int value);
bool GetMipVisualization();
void SetMipVisualization(bool ok);
-
void ResetBack();
-
+ int GetDirection(); // virtual
+ vtkPlaneSource* GetPlaneSource();
+
private:
bool _active;
int _mip_width;
bool _mip_visualization;
-
double _backX;
double _backY;
double _backZ;
double _backOrient[4];
-
double _ang;
double _vxb;
double _vyb;
double _n[3]; // Normal
-
double _cx;
double _cy;
double _cz;
-
int _sizeIma;
-
vtkImageData * _imageResult;
-
// Horizontal line
vtkPoints *_pts;
vtkActor *_lineActor;
vtkPolyDataMapper *_lineMapper;
vtkPolyData *_pd;
-
vtkProbeFilter *_3Dslices;
vtkPlaneSource *_pSource;
vtkStructuredPoints *_stPoints;
vtkImageChangeInformation *_change;
vtkTransform *_transform1;
- vtkTransform *_transform2;
-
+ vtkTransform *_transform2;
vtkInteractorStylePlane2D *_interactorstyleplane2D;
-
vtkInfoTextImage *_vtkInfoTextImage;
vtkInfoTextImageInteractorPlane2D *_vtkInfoTextImageInteractorPlane2D;
-
void SetPSource(int sizeIma);
void HorizontalLine();
void ResetPlane();
//-------------------------------------------------------------------
vtkMPRBaseData::vtkMPRBaseData()
{
- _x = 0;
- _y = 0;
- _z = 0;
- _x1 = 0;
- _x2 = 0;
- _y1 = 0;
- _y2 = 0;
- _z1 = 0;
- _z2 = 0;
+ _x = 0;
+ _y = 0;
+ _z = 0;
+ _x1 = 0;
+ _x2 = 0;
+ _y1 = 0;
+ _y2 = 0;
+ _z1 = 0;
+ _z2 = 0;
_transformOrientation = NULL;
_marImageData = NULL;
}
{
//EED 03nov2012
vtkBaseData::Configure();
-
vtkImageData* img = _marImageData->GetImageData();
if(img !=NULL)
{
img->GetExtent (_x1,_x2,_y1,_y2,_z1,_z2);
//std::cout<<"vtkMPRBaseData::Configure() _x1= "<<_x1<<" _x2= "<<_x2<<" _y1= "<<_y1<<" _y2= "<<_y2<<" _z1= "<<_z1<<" _z2= "<<_z2<<std::endl;
}
-
if(_transformOrientation==NULL)
{
_transformOrientation=vtkTransform::New();
}
-
_transformOrientation->Identity();
}
//-------------------------------------------------------------------
void vtkMPRBaseData::GetDimensionExtention(int *x1,int *x2,int *y1,int *y2,int *z1,int *z2)
{
- *x1=_x1;
- *x2=_x2;
- *y1=_y1;
- *y2=_y2;
- *z1=_z1;
- *z2=_z2;
+ *x1 = _x1;
+ *x2 = _x2;
+ *y1 = _y1;
+ *y2 = _y2;
+ *z1 = _z1;
+ *z2 = _z2;
}
-
//------------------------------------------------------------------------
int vtkMPRBaseData::GetMaxPositionX( )
{
return _x2;
}
+
//------------------------------------------------------------------------
int vtkMPRBaseData::GetMaxPositionY( )
{
return _y2;
}
+
//------------------------------------------------------------------------
int vtkMPRBaseData::GetMaxPositionZ( )
{
return _z2;
}
+
//-------------------------------------------------------------------
double vtkMPRBaseData::GetX()
{
-
return _x;
}
+
//-------------------------------------------------------------------
double vtkMPRBaseData::GetY()
{
return _y;
}
+
//-------------------------------------------------------------------
/**
** Calculates the value of the slider and the layer in the image that is spouse to show
if (type==3)
{
_widgetMesure_B = new wxWidgetMesure2D_Plane_in_MPR(panel);
- _vtkplane2Dview_B = new vtkPlane2DView( _widgetMesure_B->GetWindow2());
+ _vtkplane2Dview_B = new vtkPlane2DView( _widgetMesure_B->GetWindow2());
_widgetMesure_B->SetVtkPlane2DView( _vtkplane2Dview_B );
_vtkplane2Dview_B->SetImgSize( 200 );
_vtkplane2Dview_B->SetVtkBaseData(vtkmprbasedata);
if (type==5)
{
- wxSplitterWindow *panelMPR3D = new wxSplitterWindow( panel , -1);
- _wxvtk3Dbaseview_MPR3D_B = new wxVtk3DBaseView( panelMPR3D , vtkmprbasedata );
-
- _wxvtkmpr3Dview_B = new wxVtkMPR3DView(_wxvtk3Dbaseview_MPR3D_B);
- vtkMPR3DDataViewer *vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
+ wxSplitterWindow *panelMPR3D = new wxSplitterWindow( panel , -1);
+ _wxvtk3Dbaseview_MPR3D_B = new wxVtk3DBaseView( panelMPR3D , vtkmprbasedata );
+ _wxvtkmpr3Dview_B = new wxVtkMPR3DView(_wxvtk3Dbaseview_MPR3D_B);
+ vtkMPR3DDataViewer *vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
vtkmpr3Ddataviewer->SetVtkMPRBaseData(vtkmprbasedata);
vtkmpr3Ddataviewer->Configure();
_wxvtkmpr3Dview_B->SetVtkMPR3DDataViewer(vtkmpr3Ddataviewer);
- wxWindow *window3D = _wxvtk3Dbaseview_MPR3D_B->GetWxVTKRenderWindowInteractor();
- wxPanel *controlPanel3D = _wxvtkmpr3Dview_B->CreateControlPanel(panelMPR3D, false);
+ wxWindow *window3D = _wxvtk3Dbaseview_MPR3D_B->GetWxVTKRenderWindowInteractor();
+ wxPanel *controlPanel3D = _wxvtkmpr3Dview_B->CreateControlPanel(panelMPR3D, false);
//EEDxx2.4
panelMPR3D -> SetMinimumPaneSize( 5 );
panelMPR3D -> SplitHorizontally( controlPanel3D,window3D,600 );
//RaC Nov2012 Correctly resize internal panels with the window resize event
panelMPR3D->SetSashGravity(0.5);
-
- wxwindow=panelMPR3D;
+ wxwindow = panelMPR3D;
}
if (type==6)
{
wxSplitterWindow *panelClipping3D = new wxSplitterWindow( panel , -1);
- _wxvtk3Dbaseview_Clipping3D_BB = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata );
+ _wxvtk3Dbaseview_Clipping3D_BB = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata );
_wxvtkclipping3Dview_BB = new wxVtkClipping3DView(_wxvtk3Dbaseview_Clipping3D_BB);
vtkClipping3DDataViewer *vtkclipping3Ddataviewer = new vtkClipping3DDataViewer();
_wxvtkclipping3Dview->SetVtkClipping3DDataViewer(vtkclipping3Ddataviewer);
- wxWindow *window3D = _wxvtk3Dbaseview_MPRClipping3D->GetWxVTKRenderWindowInteractor();
+ wxWindow *window3D = _wxvtk3Dbaseview_MPRClipping3D->GetWxVTKRenderWindowInteractor();
wxPanel *panelControl = new wxPanel(panelMPR3D,-1);
wxPanel *controlPanelMPR3D = _wxvtkmpr3Dview->CreateControlPanel(panelControl, false);
wxPanel *controlPanelClipping3D = _wxvtkclipping3Dview->CreateSurfControlPanel(panelControl);
}
//----------------------------------------------------------------------------
-
void wxMPRWidget::OnRefreshView(wxCommandEvent & event)
{
RefreshView();
}
+
//----------------------------------------------------------------------------
void wxMPRWidget::OnDClickLeft(wxCommandEvent & event)
{
_wxsphereview_B -> RefreshPoint();
}
}
+
//----------------------------------------------------------------------------
void wxMPRWidget::RefreshView(bool firsttime){
if (_refreshAPage == 0 )
{
-
if ((_vtkmpr2Dview[0]!=NULL) && (_vtkmpr2Dview[1]!=NULL) && (_vtkmpr2Dview[2]!=NULL) )
{
_vtkmpr2Dview[2] -> Refresh();
}
}
}
-
}
+
//----------------------------------------------------------------------------
-vtkMPRBaseData *wxMPRWidget::GetVtkMPRBaseData(){
+vtkMPRBaseData *wxMPRWidget::GetVtkMPRBaseData()
+{
return _vtkmprbasedata;
}
+
//----------------------------------------------------------------------------
vtkPlane2DView *wxMPRWidget::GetVtkPlane2DView()
{
return _vtkplane2Dview;
}
+
//----------------------------------------------------------------------------
wxVtkMPR3DView *wxMPRWidget::GetWxvtkmpr3Dview_BB()
{
return _wxvtkmpr3Dview_BB;
}
+
//----------------------------------------------------------------------------
wxVtkBaseView *wxMPRWidget::GetWxVtkBaseView(int page, int id)
{
}
return result;
}
+
//----------------------------------------------------------------------------
wxVtkMPR2DView *wxMPRWidget::GetWxvtkMPR2Dview(int direction)
{
return _vtkmpr2Dview[direction];
}
-
-
-//----------------------------------------------------------------------------
-
-
-//----------------------------------------------------------------------------
-//----------------------------------------------------------------------------
-//----------------------------------------------------------------------------
-
-
-
// EOF - wxMPRWidget.cxx
if ( mvtkmpr2Dview_Z !=NULL ) { mvtkmpr2Dview_Z->Configure(); }
if ( mvtkplane2Dview !=NULL ) { mvtkplane2Dview->Configure(); }
if ( mwidgetMesure !=NULL ) { mwidgetMesure->ConfigureA(mvtkplane2Dview); }
- if ( mwidgetMesure !=NULL ) { mwidgetMesure->ConfigureA(mvtkplane2Dview); }
+// if ( mwidgetMesure !=NULL ) { mwidgetMesure->ConfigureA(mvtkplane2Dview); }
if ( mwidgetMesure !=NULL ) { mwidgetMesure->SetActiveLink(true); }
if ( mwxsphereview !=NULL ) { mwxsphereview->Configure(); }
this->SplitHorizontally( new wxPanel(this,-1) , new wxPanel(this,-1), 2 );
this->SetMinimumPaneSize(50);
}
+
//-------------------------------------------------------------------
wxWidgetMesure2D::~wxWidgetMesure2D()
{
}
+
//-------------------------------------------------------------------
wxWindow *wxWidgetMesure2D::CreateWin1a(wxWindow *parent) // virtual
{
wxPanel *panel = new wxPanel(parent,-1);
-
_cb_messuretool = new wxCheckBox(panel,-1,_T("Active messure tool "));
_cb_mt_visible = new wxCheckBox(panel,-1,_T("Visibles "));
_cb_closeContour = new wxCheckBox(panel,-1,_T("Close/Open "));
- _cb_visibleText = new wxCheckBox(panel,-1,_T("Information "));
-
+ _cb_visibleText = new wxCheckBox(panel,-1,_T("Information "));
_cb_mt_visible->SetValue(true);
_cb_closeContour->SetValue(true);
_cb_visibleText->SetValue(true);
-
wxFlexGridSizer *sizer = new wxFlexGridSizer(4);
-
sizer->Add(_cb_messuretool);
sizer->Add(_cb_mt_visible);
sizer->Add(_cb_closeContour);
sizer->Add(_cb_visibleText);
-
panel->SetAutoLayout(true);
panel->SetSizer(sizer);
panel->SetSize(400,30);
panel->Layout();
//EEDxx2.4
// panel->FitInside();
-
- Connect(_cb_messuretool->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxWidgetMesure2D::OnActiveMessureTool );
- Connect(_cb_mt_visible->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxWidgetMesure2D::OnVisibleMessureTool );
- Connect(_cb_closeContour->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxWidgetMesure2D::OnCloseContour );
- Connect(_cb_visibleText->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxWidgetMesure2D::OnVisibleInformation );
-
+ Connect(_cb_messuretool->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxWidgetMesure2D::OnActiveMessureTool );
+ Connect(_cb_mt_visible->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxWidgetMesure2D::OnVisibleMessureTool );
+ Connect(_cb_closeContour->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxWidgetMesure2D::OnCloseContour );
+ Connect(_cb_visibleText->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxWidgetMesure2D::OnVisibleInformation );
return panel;
}
void wxWidgetMesure2D::ConfigureA(wxVtk2DBaseView *wxvtk2Dbaseview) // virtual
{
_wxvtk2Dbaseview = wxvtk2Dbaseview;
-
// Contorno 1
_manContourControl_1 = new manualContourControler();
_mContourModel_1 = new manualContourModel();
_mViewContour_1->SetModel( _mContourModel_1 );
_mViewContour_1->SetWxVtkBaseView( _wxvtk2Dbaseview );
_mViewContour_1->SetRange( 1 );
-
// EED 3 oct 2006
// double spc[3];
// _wxvtk2Dbaseview->GetSpacing( spc );
// _mViewContour_1->SetSpacing( spc );
-
-
-
_manContourControl_1->SetZ( 1000 );
_manContourControl_1->SetModelView( _mContourModel_1 , _mViewContour_1 );
((vtkInteractorStyleBaseView*)_wxvtk2Dbaseview->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _manContourControl_1 );
_manContourControl_1->CreateNewManualContour();
_manContourControl_1->SetActive( false );
_mViewContour_1->RefreshContour();
-
//EED 27 Oct 2007
-
+
// this->ReplaceWindow( this->GetWindow1() , CreateWin1a(this) );
// this->ReplaceWindow( this->GetWindow2() , _wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor() );
// CreateWin1a(this->GetWindow1() );
-
wxBoxSizer *sizerA = new wxBoxSizer(wxHORIZONTAL);
sizerA->Add( CreateWin1a( this->GetWindow1()) ,1, wxGROW );
this->GetWindow1()->SetSizer(sizerA);
- this->SetAutoLayout(true);
- this->Layout();
+// this->SetAutoLayout(true);
+// this->Layout();
- wxBoxSizer *sizerB = new wxBoxSizer(wxHORIZONTAL);
+ wxBoxSizer *sizerB = new wxBoxSizer(wxHORIZONTAL);
sizerB->Add( _wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor() ,1, wxGROW );
this->GetWindow2()->SetSizer(sizerB);
+
this->SetAutoLayout(true);
this->Layout();
-
-
+
// this->SplitHorizontally( CreateWin1a(this) , _wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor() , 2 );
-
-
//EEDxx2.4
// this->FitInside();
}
_mViewContour_1->Refresh();
_wxvtk2Dbaseview->Refresh();
_wxvtk2Dbaseview->RefreshView();
-
}
+
//-------------------------------------------------------------------
void wxWidgetMesure2D::OnVisibleInformation(wxCommandEvent& event)
{
_wxvtk2Dbaseview->Refresh();
_wxvtk2Dbaseview->RefreshView();
}
+
//-------------------------------------------------------------------
manualContourModel* wxWidgetMesure2D::GetManualContourModel()
{