modBarRange = modelBarRange;
mbbtkSliderMinMax = bbParent;
Connect(modBarRange->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxWidgetSliderMinMax::onBarrange );
-// Connect(modBarRange->GetId(),98765,(wxObjectEventFunction) (wxCommandEventFunction) &wxWidgetSliderMinMax::onActualChange_Bar );
+ // Connect(modBarRange->GetId(),98765,(wxObjectEventFunction) (wxCommandEventFunction) &wxWidgetSliderMinMax::onActualChange_Bar );
Connect(modBarRange->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction) &wxWidgetSliderMinMax::onActualChange_Bar );
Connect(modBarRange->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction) &wxWidgetSliderMinMax::onStartChange_Bar );
Connect(modBarRange->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction) &wxWidgetSliderMinMax::onEndChange_Bar );
//wxDefaultSize
mBarRange::mBarRange(wxWindow *parent, int w, int h)
-:wxScrolledWindow(parent,-1,wxDefaultPosition, wxSize(60,60) ,wxTAB_TRAVERSAL)
+//EED-2019-10-25 :wxScrolledWindow(parent,-1,wxDefaultPosition, wxSize(60,60) ,wxTAB_TRAVERSAL)
+ :wxPanel(parent,-1,wxDefaultPosition, wxSize(60,60) ,wxTAB_TRAVERSAL)
{
acceptedClick = true;
_bitmap_bar = NULL;
mBarRange::~mBarRange()
{
+ DeletePendingEvents ();
+ RemoveEventHandler ( GetEventHandler() );
}
//---------------------------------------------------------------------------
if(_orientation)
{
SetWindowStyle(wxNO_FULL_REPAINT_ON_RESIZE);
- _bitmap_bar = new wxBitmap(_w+1280,_h+100);
+ _bitmap_bar = new wxBitmap(_w+1280,_h+100);
//SIL//_bitmap_info = new wxBitmap(_w+100+1280, _h+100);
- }
- //vertical
- else
- {
+ } else {
SetWindowStyle(wxNO_FULL_REPAINT_ON_RESIZE);
- _bitmap_bar = new wxBitmap(_h+deviceStart_y+100,_w+1280);
- _bitmap_info = new wxBitmap(_h+deviceStart_y+100, _w+1280);
+ _bitmap_bar = new wxBitmap(_h+deviceStart_y+100,_w+1280);
+ _bitmap_info = new wxBitmap(_h+deviceStart_y+100, _w+1280);
}
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void mBarRange::SetInRangeProperty(bool in)
{
- _in_rangeProperty=in;
+ _in_rangeProperty = in;
}
//----------------------------------------------------------------------------
//the information about the actual triangle in range or not, true if is between start and end
void mBarRange::Refresh(bool eraseBackground, const wxRect* rect)
{
- wxScrolledWindow::Refresh(false);
+//EED2019-10-25 wxScrolledWindow::Refresh(false);
+ wxPanel::Refresh(false);
}
if (barHeight <=_h)
{
bool in_StartTri = (clickedX>=GetPixelStart()-5+ deviceStart_x) && (clickedX<=GetPixelStart()+5+ deviceStart_x);
- bool in_EndTri = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
- bool in_actualT= withActualDrawed && (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
- bool in_movingBar = (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
+ bool in_EndTri = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
+ bool in_actualT = withActualDrawed && (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
+ bool in_movingBar= (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
if( in_actualT )
_selectionMoveId = 3;
else if( in_movingBar )
_selectionMoveId = 4;
}
- }
- else
- {
+ } else {
if(acceptedClick)
{
//is in start triagle
*/
void mBarRange :: setRepresentedValues ( double minRealValue, double maxRealValue)
{
- _min = minRealValue;
- _max = maxRealValue;
- _start=_min;
- _end=_max;
+ _min = minRealValue;
+ _max = maxRealValue;
+ _start =_min;
+ _end =_max;
}
/*
SetPixelStart(deviceStart_x);
SetPixelEnd(_w+deviceStart_x);
SetPixelActual(deviceStart_x);
- }
- else
- {
+ } else {
SetPixelStart(deviceStart_x);
SetPixelEnd(_h+deviceStart_x);
SetPixelActual(deviceStart_x);
if (getClickedX()<=_h)
{
- bool in_StartTri = (clickedX>=GetPixelStart()-5+ deviceStart_x) && (clickedX<=GetPixelStart()+5+ deviceStart_x);
- bool in_EndTri = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
- bool in_actualT= (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
- bool in_movingBar = (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
+ bool in_StartTri = (clickedX>=GetPixelStart()-5+ deviceStart_x) && (clickedX<=GetPixelStart()+5+ deviceStart_x);
+ bool in_EndTri = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
+ bool in_actualT = (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
+ bool in_movingBar = (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
if(in_StartTri)
_selectionMoveId = 1;
};
-class creaMaracasVisu_EXPORT mBarRange :public wxScrolledWindow{
+class creaMaracasVisu_EXPORT mBarRange :public wxPanel{
+//EED-2019-10-25 class creaMaracasVisu_EXPORT mBarRange :public wxScrolledWindow{
public:
//------------------------------------
//Constructors & Destructors
_vtkText_ColorLevel = NULL;
_vtkText_position = NULL;
_vtkText_pixelIntensity = NULL;
+ _vtkText_plane = NULL;
_marimagedata = NULL;
}
void vtkInfoTextImage::Configure()
{
if(_vtkText_WindowLevel == NULL){
- _vtkText_WindowLevel = Create_Text_Label( 10 , 55 );
- _vtkText_ColorLevel = Create_Text_Label( 10 , 40 );
- _vtkText_position = Create_Text_Label( 10 , 25 );
- _vtkText_pixelIntensity = Create_Text_Label( 10 , 10 );
+ _vtkText_WindowLevel = Create_Text_Label( 10 , 60 );
+ _vtkText_ColorLevel = Create_Text_Label( 10 , 45 );
+ _vtkText_position = Create_Text_Label( 10 , 30 );
+ _vtkText_pixelIntensity = Create_Text_Label( 10 , 15 );
+ _vtkText_plane = Create_Text_Label( 10 , 0 );
}
}
void vtkInfoTextImage::SetMarImageData(marImageData *marimagedata)
{
- _marimagedata=marimagedata;
+ _marimagedata = marimagedata;
}
//-------------------------------------------------------------------
void vtkInfoTextImage::SetWxVtk2DBaseView(wxVtk2DBaseView *wxvtk2Dbaseview)
{
- _wxvtk2Dbaseview=wxvtk2Dbaseview;
+ _wxvtk2Dbaseview = wxvtk2Dbaseview;
}
//-------------------------------------------------------------------
void vtkInfoTextImage::PutColorLevel()
{
double value = _wxvtk2Dbaseview->_imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel()->GetLevel();
+
char zTzxt[20];
char resultText[50];
_vtkText_ColorLevel -> SetInput(resultText);
}
+//-------------------------------------------------------------------
+void vtkInfoTextImage::PutPlane()
+{
+ int plane = _wxvtk2Dbaseview->GetDirection();
+ char zTzxt[20];
+ char resultText[50];
+
+ if (plane==0) { strcpy(resultText,"plane:YZ"); }
+ if (plane==1) { strcpy(resultText,"plane:XZ"); }
+ if (plane==2) { strcpy(resultText,"plane:XY"); }
+
+// itoa (value,zTzxt,10);
+// sprintf(zTzxt,"%d",value);
+
+// strcat(resultText,zTzxt);
+ _vtkText_plane -> SetInput(resultText);
+}
+
//-------------------------------------------------------------------
void vtkInfoTextImage::PutPosition(int xx,int yy, int zz)
strcat(resultText,zTzxt);
strcat(resultText,")");
-
-
-
_vtkText_position -> SetInput(resultText);
}
void PutPosition(int x, int y, int z);
void PutColorLevel();
void PutWindowLevel();
+ void PutPlane();
protected:
vtkTextActor *_vtkText_ColorLevel;
vtkTextActor *_vtkText_position;
vtkTextActor *_vtkText_pixelIntensity;
+ vtkTextActor *_vtkText_plane;
vtkTextActor *Create_Text_Label(int px, int py);
};
GetVtkInfoTextImage()->PutWindowLevel();
GetVtkInfoTextImage()->PutColorLevel();
+ GetVtkInfoTextImage()->PutPlane();
int tempext[6];
((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->GetVtkBaseData()->GetImageData()->GetExtent(tempext);