--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/All/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/UnitLayerPaint.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:TRUE
+COMPLEXBOXNAME:UnitLayerPaint
+PACKAGENAME:creaMaracasVisu
+COMPLEXOUTPUTS:1
+COMPLEX_PORT
+OutWidget
+105.768851:-158.547510:-900.000000
+FIN_COMPLEX_PORT
+COMPLEXINPUTS:5
+COMPLEX_PORT
+InputImage
+-86.663553:91.493751:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+wxVtkBaseView_01
+-16.800689:91.353745:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+wxVtkBaseView_02
+59.831313:91.913768:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+wxVtkBaseView_03
+105.100769:84.227173:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+TitleModule
+124.916277:84.893462:-900.000000
+FIN_COMPLEX_PORT
+BOXES:16
+BOX
+creaMaracasVisu:ViewerNV:Box09
+ISEXEC:FALSE
+33.629033:-1.576918:-900.000000
+94.269033:-11.576918:-900.000000
+PORT
+nTypeView:"0"
+FIN_BOX
+BOX
+creaMaracasVisu:ManualPaint:Box11
+ISEXEC:FALSE
+-22.062493:7.255105:-900.000000
+23.512507:-2.744895:-900.000000
+PORT
+WinTitle:"Paint"
+FIN_BOX
+BOX
+wx:LayoutLine:Box13
+ISEXEC:FALSE
+-92.239645:-52.736806:-900.000000
+-34.679645:-62.736806:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+BOX
+wx:LayoutTab:Box15
+ISEXEC:FALSE
+-115.371591:-25.436420:-900.000000
+-57.811591:-35.436420:-900.000000
+FIN_BOX
+BOX
+wx:LayoutTab:Box16
+ISEXEC:FALSE
+-30.536965:-32.299285:-900.000000
+27.023035:-42.299285:-900.000000
+FIN_BOX
+BOX
+wx:LayoutLine:Box17
+ISEXEC:FALSE
+-115.258808:-7.150446:-900.000000
+-57.698808:-17.150446:-900.000000
+PORT
+WinTitle:"Color"
+FIN_BOX
+BOX
+wx:LayoutLine:Box18
+ISEXEC:FALSE
+-34.328234:-13.564862:-900.000000
+23.231766:-23.564862:-900.000000
+PORT
+WinTitle:"Paint"
+FIN_BOX
+BOX
+wx:LayoutSplit:Box19
+ISEXEC:FALSE
+69.201144:-118.185923:-900.000000
+114.776144:-128.185923:-900.000000
+PORT
+Proportion:"30"
+FIN_BOX
+BOX
+toolsbbtk:SaveMHD-Button:Box20
+ISEXEC:FALSE
+49.474783:-54.794924:-900.000000
+95.049783:-64.794924:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ColorLayerImageView:Box21
+ISEXEC:FALSE
+-121.366653:10.167202:-900.000000
+-50.191653:0.167202:-900.000000
+PORT
+WinTitle:"Color"
+PORT
+lstBaseColor:"1 0 0 1 1 0 0 0 1"
+PORT
+lstGreyLevelBoundaries:"500 1500 2500 5000"
+FIN_BOX
+BOX
+vtk:vtkImageDataPointerRelay:Box23
+ISEXEC:FALSE
+-95.762984:51.256292:-900.000000
+-24.587984:41.256292:-900.000000
+FIN_BOX
+BOX
+wx:LayoutTab:Box24
+ISEXEC:FALSE
+-4.772832:-89.823842:-900.000000
+52.787168:-99.823842:-900.000000
+PORT
+WinWidth:"0"
+FIN_BOX
+BOX
+toolsbbtk:ImageVtkPropertiesWidget:Box25
+ISEXEC:FALSE
+-28.977992:-53.163115:-900.000000
+42.197008:-63.163115:-900.000000
+FIN_BOX
+BOX
+std:MagicBox:Box26
+ISEXEC:FALSE
+-14.647540:63.299675:-900.000000
+30.927460:53.299675:-900.000000
+FIN_BOX
+BOX
+std:MagicBox:Box27
+ISEXEC:FALSE
+44.893581:65.273236:-900.000000
+90.468581:55.273236:-900.000000
+FIN_BOX
+BOX
+std:MagicBox:Box28
+ISEXEC:FALSE
+99.534930:66.249067:-900.000000
+145.109930:56.249067:-900.000000
+FIN_BOX
+CONNECTIONS:28
+CONNECTION
+Box15:Widget:Box13:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box16:Widget:Box13:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box17:Widget:Box15:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box11:Widget:Box18:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box18:Widget:Box16:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box21:Widget:Box17:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box23:Out:Box21:In
+NumberOfControlPoints:0
+CONNECTION
+Box23:Out:Box20:In
+NumberOfControlPoints:0
+CONNECTION
+Box23:Out:Box11:In
+NumberOfControlPoints:0
+CONNECTION
+Box23:Out:Box09:In
+NumberOfControlPoints:0
+CONNECTION
+InputImage:InputImage:Box23:In
+NumberOfControlPoints:0
+CONNECTION
+Box13:Widget:Box24:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box23:Out:Box25:in
+NumberOfControlPoints:0
+CONNECTION
+wxVtkBaseView_01:wxVtkBaseView_01:Box26:In
+NumberOfControlPoints:0
+CONNECTION
+Box26:Out:Box21:WxVtkBaseView
+NumberOfControlPoints:0
+CONNECTION
+wxVtkBaseView_02:wxVtkBaseView_02:Box27:In
+NumberOfControlPoints:0
+CONNECTION
+wxVtkBaseView_03:wxVtkBaseView_03:Box28:In
+NumberOfControlPoints:0
+CONNECTION
+Box19:Widget:OutWidget:OutWidget
+NumberOfControlPoints:0
+CONNECTION
+Box26:Out:Box11:WxVtkBaseView1
+NumberOfControlPoints:0
+CONNECTION
+Box27:Out:Box21:WxVtkBaseView1
+NumberOfControlPoints:0
+CONNECTION
+Box27:Out:Box11:WxVtkBaseView2
+NumberOfControlPoints:0
+CONNECTION
+Box28:Out:Box21:WxVtkBaseView2
+NumberOfControlPoints:0
+CONNECTION
+Box28:Out:Box11:WxVtkBaseView3
+NumberOfControlPoints:0
+CONNECTION
+TitleModule:TitleModule:Box19:WinTitle
+NumberOfControlPoints:0
+CONNECTION
+Box20:Widget:Box24:Widget3
+NumberOfControlPoints:0
+CONNECTION
+Box25:widget:Box24:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box24:Widget:Box19:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box09:Widget:Box19:Widget1
+NumberOfControlPoints:0
+APP_END
--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - /home/davila/Creatis/All/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/UnitLayerPaint.bbs
+# ----------------------------------
+
+include std
+include itkvtk
+include creaMaracasVisu
+include wx
+include toolsbbtk
+include vtk
+include std
+
+define UnitLayerPaint creaMaracasVisu
+
+author "Author ??"
+description "Description ??"
+
+category "<VOID>"
+
+new ViewerNV Box09
+ set Box09.nTypeView "0"
+
+new ManualPaint Box11
+ set Box11.WinTitle "Paint"
+
+new LayoutLine Box13
+ set Box13.Orientation "H"
+
+new LayoutTab Box15
+
+new LayoutTab Box16
+
+new LayoutLine Box17
+ set Box17.WinTitle "Color"
+
+new LayoutLine Box18
+ set Box18.WinTitle "Paint"
+
+new LayoutSplit Box19
+ set Box19.Proportion "30"
+
+new SaveMHD-Button Box20
+
+new ColorLayerImageView Box21
+ set Box21.WinTitle "Color"
+ set Box21.lstBaseColor "1 0 0 1 1 0 0 0 1"
+ set Box21.lstGreyLevelBoundaries "500 1500 2500 5000"
+
+new vtkImageDataPointerRelay Box23
+
+new LayoutTab Box24
+ set Box24.WinWidth "0"
+
+new ImageVtkPropertiesWidget Box25
+
+new MagicBox Box26
+
+new MagicBox Box27
+
+new MagicBox Box28
+
+
+connect Box15.Widget Box13.Widget1
+connect Box16.Widget Box13.Widget2
+connect Box17.Widget Box15.Widget1
+connect Box11.Widget Box18.Widget1
+connect Box18.Widget Box16.Widget1
+connect Box21.Widget Box17.Widget1
+connect Box23.Out Box21.In
+connect Box23.Out Box20.In
+connect Box23.Out Box11.In
+connect Box23.Out Box09.In
+connect Box13.Widget Box24.Widget1
+connect Box23.Out Box25.in
+connect Box26.Out Box21.WxVtkBaseView
+connect Box26.Out Box11.WxVtkBaseView1
+connect Box27.Out Box21.WxVtkBaseView1
+connect Box27.Out Box11.WxVtkBaseView2
+connect Box28.Out Box21.WxVtkBaseView2
+connect Box28.Out Box11.WxVtkBaseView3
+connect Box20.Widget Box24.Widget3
+connect Box25.widget Box24.Widget2
+connect Box24.Widget Box19.Widget2
+connect Box09.Widget Box19.Widget1
+
+# Complex input ports
+input InputImage Box23.In " "
+input wxVtkBaseView_01 Box26.In " "
+input wxVtkBaseView_02 Box27.In " "
+input wxVtkBaseView_03 Box28.In " "
+input TitleModule Box19.WinTitle " "
+
+# Complex output ports
+output OutWidget Box19.Widget " "
+
+
+endefine
//=====
void ColorLayerImageView::Process()
{
+printf("ColorLayerImageView::Process start\n");
+
ColorLayerImageViewPanel *clivp = (ColorLayerImageViewPanel*)bbGetOutputWidget();
clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 0 , bbGetInputWxVtkBaseView() );
// }
// ((wxStaticText*)bbGetOutputWidget())->SetLabel( bbtk::std2wx( msg ) );
+printf("ColorLayerImageView::Process end\n");
+
}
//=====
// Don't edit this file. This file is generated from xml description..
//=====
void ManualPaint::Process()
{
+printf("ManualPaint::Process start\n");
+
/*
std::string msg;
mpModel->SetImage( bbGetInputIn() );
wxManualPaintPanel *mpPanel = (wxManualPaintPanel*)bbGetOutputWidget();
+printf("ManualPaint::Process 1\n");
mpPanel->SetManualPaintModel(mpModel);
+printf("ManualPaint::Process 2 %p\n", mpPanel);
if (bbGetInputWxVtkBaseView1()!=NULL)
{
ManualPaintControler *mpControler = new ManualPaintControler();
mpControler->SetManualPaintModel(mpModel);
+printf("ManualPaint::Process 3\n");
mpControler->SetManualPaintPanel(mpPanel);
+printf("ManualPaint::Process 4\n");
mpControler->SetWxVtk2DBaseView( (wxVtk2DBaseView*)bbGetInputWxVtkBaseView1() );
+printf("ManualPaint::Process 5 %p \n",bbGetInputWxVtkBaseView1() );
mpControler->Config();
+printf("ManualPaint::Process 6\n");
}
if (bbGetInputWxVtkBaseView2()!=NULL)
{
+printf("ManualPaint::Process 7\n");
ManualPaintControler *mpControler = new ManualPaintControler();
+printf("ManualPaint::Process 7.1\n");
mpControler->SetManualPaintModel(mpModel);
+printf("ManualPaint::Process 7.2\n");
mpControler->SetManualPaintPanel(mpPanel);
+printf("ManualPaint::Process 7.3\n");
mpControler->SetWxVtk2DBaseView( (wxVtk2DBaseView*)bbGetInputWxVtkBaseView2() );
+printf("ManualPaint::Process 7.4 %p\n", bbGetInputWxVtkBaseView2() );
mpControler->Config();
+printf("ManualPaint::Process 8\n");
}
if (bbGetInputWxVtkBaseView3()!=NULL)
{
+printf("ManualPaint::Process 9\n");
ManualPaintControler *mpControler = new ManualPaintControler();
mpControler->SetManualPaintModel(mpModel);
mpControler->SetManualPaintPanel(mpPanel);
mpControler->SetWxVtk2DBaseView( (wxVtk2DBaseView*)bbGetInputWxVtkBaseView3() );
mpControler->Config();
+printf("ManualPaint::Process 10\n");
}
if (bbGetInputWxVtkBaseView4()!=NULL)
{
+printf("ManualPaint::Process 11\n");
ManualPaintControler *mpControler = new ManualPaintControler();
mpControler->SetManualPaintModel(mpModel);
mpControler->SetManualPaintPanel(mpPanel);
mpControler->SetWxVtk2DBaseView( (wxVtk2DBaseView*)bbGetInputWxVtkBaseView4() );
mpControler->Config();
+printf("ManualPaint::Process 12\n");
}
+printf("ManualPaint::Process 13\n");
}
+printf("ManualPaint::Process end\n");
}
//=====
{
firsttime=true;
bbSetInputIn(NULL);
+ bbSetInputWxVtkBaseView1(NULL);
+ bbSetInputWxVtkBaseView2(NULL);
+ bbSetInputWxVtkBaseView3(NULL);
+ bbSetInputWxVtkBaseView4(NULL);
}
//=====
// Don't edit this file. This file is generated from xml description..
{
// CM
// Grey level extrema retrieved from the image grey level extrema.
- GetImage()->GetScalarRange(_range);
+
+
+printf("ERROR: EED ColorLayerImageView::ConfigLookupTable ------_range----------------\n");
+ _range[0]=0;
+ _range[1]=4000;
+// GetImage()->GetScalarRange(_range);
+
// ------------------ Setting Default Values
ColorLayerImageBasevtkInteractor::ColorLayerImageBasevtkInteractor(LayerImageBase* layerImageBase)
{
_state=false;
+ _stateKey=false;
_layerImageBase=layerImageBase;
-
+
}
//---------------------------------------------------------------------------------------------
{
}
+//---------------------------------------------------------------------------------------------
+bool ColorLayerImageBasevtkInteractor::OnChar()
+{
+ return true;
+}
+
//---------------------------------------------------------------------------------------------
bool ColorLayerImageBasevtkInteractor::OnMouseMove() // vitual
{
- printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove \n");
+ printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove start \n");
+
+ vtkRenderWindowInteractor *interactor = _vtkInteractorStyleBaseView->GetInteractor();
+
+ // For example in ManualPaint Action
+ // This is not working, because the order of insertion events mecanism (_vtkInteractorStyleBaseView)
+ // Layer first Paint after.
+ // the only way to make it works is to take the axes an paint. this force a first SetParent_refresh_waiting()
+// if ( this->_vtkInteractorStyleBaseView->GetParent_refresh_waiting() == true )
+
+ if ( interactor->GetControlKey()==1 ) // EED This if for ManaulPaint Interaction compatibility
+ {
+ printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove need Refresh \n" );
+ _layerImageBase->onThreshold();
+ _layerImageBase->GetvtkImageReslice()->Modified();
+ }
+ else {
+ printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove NOT need Refresh \n" );
+ }
+
if (_state==true)
{
-
wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*) _vtkInteractorStyleBaseView->GetWxVtk2DBaseView();
wxVTKRenderWindowInteractor *wxVTKiren = wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor();
int px, py;
_layerImageBase->onThreshold();
// _layerImageBase->Refresh();
-
this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
if (_vtkInteractorStyleBaseView->GetRefresh_waiting()==true)
return true;
}
-
+//---------------------------------------------------------------------------------------------
bool ColorLayerImageBasevtkInteractor::OnRightButtonDown() // virtual
{
printf("EED ColorLayerImageBasevtkInteractor::OnRightButtonDown \n");
return true;
}
+//---------------------------------------------------------------------------------------------
bool ColorLayerImageBasevtkInteractor::OnRightButtonUp() // virtual
{
printf("EED ColorLayerImageBasevtkInteractor::OnRightButtonUp \n");
ColorLayerImageBasevtkInteractor(LayerImageBase* layerImageBase);
virtual ~ColorLayerImageBasevtkInteractor();
- virtual bool OnMouseMove();
- virtual bool OnRightButtonDown();
- virtual bool OnRightButtonUp();
+ virtual bool OnChar();
+ virtual bool OnMouseMove();
+ virtual bool OnRightButtonDown();
+ virtual bool OnRightButtonUp();
private:
bool _state;
+ bool _stateKey;
LayerImageBase* _layerImageBase;
protected:
double xx, yy, zz, rr = size * size;
+printf("EED BrushFilter::Run() %d %d\n", _RangeMin, _RangeMax);
+
for (i = minX; i <= maxX; i++) {
xx = _px - i;
xx = xx * xx;
// if ((i>=_minX) && (i<=_maxX) && (j>=_minY) && (j<=_maxY) && (k>=_minZ) && (k<=_maxZ))
// {
- float scalarComponent = _image->GetScalarComponentAsFloat(i,
- j, k, 0);
- if ((this->GetRangeMin() <= scalarComponent)
- && (scalarComponent <= this->GetRangeMax())) {
- zz = _pz - k;
- zz = zz * zz;
- if (_brushform == 0) {
+ float scalarComponent = _image->GetScalarComponentAsFloat(i,j, k, 0);
+ if ((_RangeMin <= scalarComponent)
+ && (scalarComponent <= _RangeMax )) {
+ if (_brushform == 0)
+ {
this->_IMManager->AddModifiedPixel(i, j, k); //DFCH
- _image->SetScalarComponentFromFloat(i, j, k, 0,
- value);
- } else if (_brushform == 1) {
+ _image->SetScalarComponentFromFloat(i, j, k, 0,value);
+ } // _brushform 0
+ if (_brushform == 1)
+ {
+ zz = _pz - k;
+ zz = zz * zz;
if ((xx + yy + zz) <= rr) {
this->_IMManager->AddModifiedPixel(i, j, k); //DFCH
- _image->SetScalarComponentFromFloat(i, j, k, 0,
- value);
+ _image->SetScalarComponentFromFloat(i, j, k, 0,value);
}
- } // _brushform
+ } // _brushform 1
} // GetRangeMin && GetRangeMax
// } //if _minX _maxX _minY _maxY _minZ _maxZ
//---------------------------------------------------------------------------
int BrushFilter::GetRangeMin() {
- return (_RangeMin);
+ return _RangeMin;
}
//---------------------------------------------------------------------------
int BrushFilter::GetRangeMax() {
- return (_RangeMax);
+ return _RangeMax;
}
#include "ManualPaintModel.h"
ManualPaintModel::ManualPaintModel() {
- _tool = 0; // 0 pencil , 1 fill
- _brushfilter = new BrushFilter();
- _fillfilter = new FillFilter();
- _imageUndoRedo = new ImageUndoRedo();
+ _active = true;
+ _tool = 0; // 0 pencil , 1 fill
+ _brushfilter = new BrushFilter();
+ _fillfilter = new FillFilter();
+ _imageUndoRedo = new ImageUndoRedo();
}
//---------------------------------------------------------------------------
-ManualPaintModel::~ManualPaintModel() {
+ManualPaintModel::~ManualPaintModel()
+{
delete _brushfilter;
delete _fillfilter;
}
+
+//---------------------------------------------------------------------------
+void ManualPaintModel::SetActive( bool active )
+{
+ _active = active;
+}
+
//---------------------------------------------------------------------------
-void ManualPaintModel::PaintImage(int px, int py, int pz) {
- if (_tool == 0) {
+void ManualPaintModel::PaintImage(int px, int py, int pz)
+{
+printf("EED ManualPaintModel::PaintImage\n");
+ if (_active==true)
+ {
+
+ if (_tool == 0)
+ {
_brushfilter->SetPoint(px, py, pz);
_brushfilter->Run();
- }
- if (_tool == 1) {
+ } // _tool 2
+
+ if (_tool == 1)
+ {
_fillfilter->SetPoint(px, py, pz);
_fillfilter->Run();
- }
+ } // _tool 1
+ } // _active
}
//---------------------------------------------------------------------------
ManualPaintModel();
virtual ~ManualPaintModel();
+ void SetActive(bool active);
void SetTool(int tool);
void Set2D3D(int dim2D3D);
void SetImage(vtkImageData *image);
private:
int _tool;
+ bool _active;
BrushFilter *_brushfilter;
FillFilter *_fillfilter;
ImageUndoRedo *_imageUndoRedo;
}
}
+//---------------------------------------------------------------------------
void ManualPaintPanel::GetScalarRange( double * range )
{
if (_manualPaintModel!=NULL)
}
}
+//---------------------------------------------------------------------------
+void ManualPaintPanel::SetActive( bool active )
+{
+ if (_manualPaintModel!=NULL)
+ {
+ _manualPaintModel->SetActive( active );
+ } else {
+ printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n");
+ }
+}
+
ManualPaintPanel();
virtual ~ManualPaintPanel();
+ void SetActive( bool active );
void SetManualPaintModel(ManualPaintModel* manualPaintModel);
void SetBrushSize( int brushsize );
void SetGrayLevel( double graylevel );
//---------------------------------------------------------------------------
bool vtkInteractorManualPaint::OnChar() {
- vtkRenderWindowInteractor *interactor =
- _vtkInteractorStyleBaseView->GetInteractor();
-
+ vtkRenderWindowInteractor *interactor = _vtkInteractorStyleBaseView->GetInteractor();
if (interactor->GetKeyCode() == 97) {
_stateKey = !_stateKey;
}
}
//---------------------------------------------------------------------------
-bool vtkInteractorManualPaint::OnMouseMove() {
+bool vtkInteractorManualPaint::OnMouseMove()
+{
+printf("EED vtkInteractorManualPaint::OnMouseMove \n");
if ((_state == true) || (_stateKey == true)) {
wxVtk2DBaseView *wxvtk2Dbaseview =
(wxVtk2DBaseView*) _vtkInteractorStyleBaseView->GetWxVtk2DBaseView();
// wxvtk2Dbaseview->TransFromCoordScreenToWorld(X, Y, Z,true, typeView);
wxvtk2Dbaseview->TransFromCoordScreenToWorld(X, Y, Z, true);
+printf("EED vtkInteractorManualPaint::OnMouseMove A %d %d %d\n", (int) X, (int) Y, (int) Z);
_manualPaintControler->PaintImage((int) X, (int) Y, (int) Z);
this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
//giving some blank spaces
sizer->Add( new wxStaticText( this, -1, _T(" ") ) );
+ this->ConfigureActiveCBButton( );
this->ConfigureBrushToolRadioButton( );
this->Configure2D3DRadioButton( );
this->ConfigureBrushFormRadioButton( );
//Buttons
wxStaticText *editButtonsText = new wxStaticText( this, -1,
_T("Edit Buttons") );
- sizer->Add( editButtonsText );
this->_buttonsSizer = new wxFlexGridSizer( 4 );
this->_buttonsSizer->Add( _btnUndo, 1, wxGROW );
this->_buttonsSizer->Add( _btnRedo, 1, wxGROW );
wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
this->_FillSizer->Add( sizerDistance );
+ sizer->Add( _activeCB );
+ sizer->Add( editButtonsText );
sizer->Add( _buttonsSizer );
sizer->Add( _gConfigSizer );
sizer->Add( _brushSizer );
}
//--------------------------------------------------------------------------
+void wxManualPaintPanel::ConfigureActiveCBButton( )
+{
+ _activeCB = new wxCheckBox (this, -1, _T("Active") );
+ _activeCB->SetValue(true);
+ SetActive( _activeCB->GetValue() );
+}
+
//Panel Config
+//--------------------------------------------------------------------------
void wxManualPaintPanel::ConfigureBrushToolRadioButton( )
{
wxString lstBrushForm[ 2 ];
wxDefaultPosition, wxSize( 270, 45 ), 2, lstBrushForm, 2,
wxRA_SPECIFY_COLS );
}
+
//--------------------------------------------------------------------------
void wxManualPaintPanel::Configure2D3DRadioButton( )
{
_mBarSlices->SetStart( min );
_mBarSlices->SetEnd( max );
_mBarSlices->Update( );
+
+ SetRangeMin( min );
+ SetRangeMax( max );
+
//DFCH -- End BarSlices
}
//--------------------------------------------------------------------------
void wxManualPaintPanel::ConfigureGrayLevelSld( )
{
_txtGrayLevel = new wxStaticText( this, -1,
- wxString( _T(" Gray Level ") ) );
+ wxString( _T(" Gray Level ") ) );
_sldGrayLevel = new wxSlider( this, -1, 0, 0, 255, wxDefaultPosition,
- wxDefaultSize, wxSL_LABELS );
+ wxDefaultSize, wxSL_LABELS );
_sldGrayLevel->SetMinSize( wxSize( 200, -1 ) );
_sldGrayLevel->SetMaxSize( wxSize( 200, -1 ) );
_graylevelCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
- wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 0 );
+ wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 0 );
}
//--------------------------------------------------------------------------
void wxManualPaintPanel::ConfigureBrushSizeSld( )
{
_txtBrushSize = new wxStaticText( this, -1,
- wxString( _T(" Brush size ") ) );
+ wxString( _T(" Brush size ") ) );
_sldBrushSize = new wxSlider( this, -1, 1, 1, 50, wxDefaultPosition,
- wxDefaultSize, wxSL_LABELS );
+ wxDefaultSize, wxSL_LABELS );
_BrushSizeCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
- wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 0 );
+ wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 0 );
_sldBrushSize->SetMinSize( wxSize( 200, -1 ) );
_sldBrushSize->SetMaxSize( wxSize( 200, -1 ) );
}
void wxManualPaintPanel::ConfigureDistanceFillSld( )
{
_txtDistanceFill = new wxStaticText( this, -1,
- wxString( _T(" Distance fill ") ) );
+ wxString( _T(" Distance fill ") ) );
_sldDistanceFill = new wxSlider( this, -1, 50, 1, 500, wxDefaultPosition,
- wxDefaultSize, wxSL_LABELS );
+ wxDefaultSize, wxSL_LABELS );
_sldDistanceFill->SetMinSize( wxSize( 200, -1 ) );
_sldDistanceFill->SetMaxSize( wxSize( 200, -1 ) );
_distancefillCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
- wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 500, 50 );
+ wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 500, 50 );
_txtDistanceFill->Disable( );
_sldDistanceFill->Disable( );
_distancefillCtrl->Disable( );
*/
void wxManualPaintPanel::ConnectComponents( ) //DFCH
{
- this->Connect(
- _sldBrushSize->GetId( ),
+ this->Connect(_sldBrushSize->GetId( ),
wxEVT_SCROLL_THUMBRELEASE,
(wxObjectEventFunction) (void(wxPanel::*)(
- wxScrollEvent& )) (&wxManualPaintPanel::OnBrushSize) );this ->Connect (_sldGrayLevel->GetId(),
- wxEVT_SCROLL_THUMBRELEASE,
- (wxObjectEventFunction) (void(wxPanel::*)(
- wxScrollEvent&)) &wxManualPaintPanel::OnSldGrayLevel);
- this->Connect
- (
- _graylevelCtrl->GetId(),
+ wxScrollEvent& )) (&wxManualPaintPanel::OnBrushSize) );this ->Connect (_sldGrayLevel->GetId(),
+ wxEVT_SCROLL_THUMBRELEASE,
+ (wxObjectEventFunction) (void(wxPanel::*)( wxScrollEvent&)) &wxManualPaintPanel::OnSldGrayLevel);
+
+ this->Connect( _graylevelCtrl->GetId(),
wxEVT_COMMAND_TEXT_UPDATED,
(wxObjectEventFunction) (void(wxPanel::*)(
wxCommandEvent&)) &wxManualPaintPanel::OnCtrTxtGrayLevel);
wxEVT_COMMAND_TEXT_UPDATED,
(wxObjectEventFunction) (void(wxPanel::*)(
wxCommandEvent&)) &wxManualPaintPanel::OnCtrBrushSize);
+ this->Connect
+ (
+ _activeCB->GetId(),
+ wxEVT_COMMAND_CHECKBOX_CLICKED,
+ (wxObjectEventFunction) (void (wxPanel::*)(wxCommandEvent&))&wxManualPaintPanel::OnActive);
}
+
+ //-------------------------------------------------------------------------
+ void wxManualPaintPanel::OnActive(wxCommandEvent& event)
+ {
+ printf("EED wxManualPaintPanel::OnActive \n");
+ SetActive( _activeCB->GetValue() );
+ }
+
+
//---------------------------------------------------------------------------
void wxManualPaintPanel::OnBrushSize( wxScrollEvent& event )
{
wxManualPaintPanel( wxWindow * parent );
virtual ~wxManualPaintPanel( );
//Panel Config
+ void ConfigureActiveCBButton();
void ConfigureBrushToolRadioButton( );
void Configure2D3DRadioButton( );
void ConfigureBrushFormRadioButton( );
void ConfigureEditButtons( );
//Events
void ConnectComponents( ); //DFCH
+ void OnActive(wxCommandEvent& event);
void OnBrushSize( wxScrollEvent& event );
void OnSldGrayLevel( wxScrollEvent& event );
void OnCtrTxtGrayLevel( wxCommandEvent &event );
void onMovedBar( wxCommandEvent& event );
private:
- wxStaticText *_txtBrushSize;
- wxSlider *_sldBrushSize;
- wxSpinCtrl *_BrushSizeCtrl;
+ wxCheckBox *_activeCB;
+ wxStaticText *_txtBrushSize;
+ wxSlider *_sldBrushSize;
+ wxSpinCtrl *_BrushSizeCtrl;
- wxStaticText *_txtGrayLevel;
- wxSlider *_sldGrayLevel;
- wxSpinCtrl *_graylevelCtrl;
- wxRadioBox *_rbBrushForm;
- wxRadioBox *_rb2D3D;
- wxRadioBox *_rbBrushTool;
+ wxStaticText *_txtGrayLevel;
+ wxSlider *_sldGrayLevel;
+ wxSpinCtrl *_graylevelCtrl;
+ wxRadioBox *_rbBrushForm;
+ wxRadioBox *_rb2D3D;
+ wxRadioBox *_rbBrushTool;
- wxStaticText *_txtToleranceFill;
- wxSlider *_sldToleranceFill;
- wxSpinCtrl *_tolerancefillCtrl;
+ wxStaticText *_txtToleranceFill;
+ wxSlider *_sldToleranceFill;
+ wxSpinCtrl *_tolerancefillCtrl;
- wxStaticText *_txtDistanceFill;
- wxSlider *_sldDistanceFill;
- wxSpinCtrl *_distancefillCtrl;
+ wxStaticText *_txtDistanceFill;
+ wxSlider *_sldDistanceFill;
+ wxSpinCtrl *_distancefillCtrl;
- mBarRange * _mBarSlices; //DFCH
- wxButton *_btnCopy; //DFCH
- wxButton *_btnUndo; //DFCH
- wxButton *_btnRedo; //DFCH
+ mBarRange *_mBarSlices; //DFCH
+ wxButton *_btnCopy; //DFCH
+ wxButton *_btnUndo; //DFCH
+ wxButton *_btnRedo; //DFCH
wxFlexGridSizer *_buttonsSizer; //DFCH
wxFlexGridSizer *_FillSizer; //DFCH
removed = true;
} else {
iter++;
- }
+ }
}
}
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView::CallLstInteractorStyleMaracas(int type)
{
+
+printf("EED vtkInteractorStyleBaseView::CallLstInteractorStyleMaracas Start --------\n");
InteractorStyleMaracas *intStyMar;
int i,size=_lstInteractorStyleMaracas.size();
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView::EvaluateToRefresh()
{
-
+printf("EED vtkInteractorStyleBaseView::EvaluateToRefresh start 1\n");
if ( _blockRefresh==false )
{
if ( (_refresh_waiting==true) && (_parent_refresh_waiting==false))
{
+printf("EED vtkInteractorStyleBaseView::EvaluateToRefresh start 2\n");
_refresh_waiting = false;
this->_wxvtkbaseview->Refresh();
}
if (_parent_refresh_waiting==true)
{
+printf("EED vtkInteractorStyleBaseView::EvaluateToRefresh start 3\n");
_parent_refresh_waiting = false;
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
//CPR 13/01/2010