ManualPaintModel *mpModel = new ManualPaintModel();
mpModel->SetImages( bbGetInputIn() , bbGetInputIn2() );
- wxManualPaintPanel *mpPanel = (wxManualPaintPanel*)bbGetOutputWidget();
- mpPanel->SetManualPaintModel(mpModel);
+ wxManualPaintPanel *mpPanel = (wxManualPaintPanel*)bbGetOutputWidget();
if (bbGetInputWxVtkBaseView1()!=NULL)
{
ManualPaintControler *mpControler = new ManualPaintControler();
mpControler->SetManualPaintModel(mpModel);
- mpControler->SetManualPaintPanel(mpPanel);
+// mpControler->SetManualPaintPanel(mpPanel);
mpControler->SetWxVtk2DBaseView( (wxVtk2DBaseView*)bbGetInputWxVtkBaseView1() );
mpControler->Config();
+ mpPanel->SetManualPaintControler(mpControler);
}
if (bbGetInputWxVtkBaseView2()!=NULL)
{
ManualPaintControler *mpControler = new ManualPaintControler();
mpControler->SetManualPaintModel(mpModel);
- mpControler->SetManualPaintPanel(mpPanel);
+// mpControler->SetManualPaintPanel(mpPanel);
mpControler->SetWxVtk2DBaseView( (wxVtk2DBaseView*)bbGetInputWxVtkBaseView2() );
mpControler->Config();
+ mpPanel->SetManualPaintControler(mpControler);
}
if (bbGetInputWxVtkBaseView3()!=NULL)
{
ManualPaintControler *mpControler = new ManualPaintControler();
mpControler->SetManualPaintModel(mpModel);
- mpControler->SetManualPaintPanel(mpPanel);
+// mpControler->SetManualPaintPanel(mpPanel);
mpControler->SetWxVtk2DBaseView( (wxVtk2DBaseView*)bbGetInputWxVtkBaseView3() );
mpControler->Config();
+ mpPanel->SetManualPaintControler(mpControler);
}
if (bbGetInputWxVtkBaseView4()!=NULL)
{
ManualPaintControler *mpControler = new ManualPaintControler();
mpControler->SetManualPaintModel(mpModel);
- mpControler->SetManualPaintPanel(mpPanel);
+// mpControler->SetManualPaintPanel(mpPanel);
mpControler->SetWxVtk2DBaseView( (wxVtk2DBaseView*)bbGetInputWxVtkBaseView4() );
mpControler->Config();
+ mpPanel->SetManualPaintControler(mpControler);
}
} // firsttime
vtkmprbasedata->SetX( bbGetInputPoint()[0] );
vtkmprbasedata->SetY( bbGetInputPoint()[1] );
vtkmprbasedata->SetZ( bbGetInputPoint()[2] );
- wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refres
+ wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
#if wxMAJOR_VERSION <= 2
bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent );
#else
bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessWindowEvent( newevent );
-#endif
-
-
+#endif
} // if bbGetInputPosition
} // bbGetInputwxVtkBaseView
}
#include "image3DDequeUR.h"
#include <iostream>
#include <sstream>
+#include <ctime>
// ----------------------------------------------------------------------------------
Image3DDequeUR::Image3DDequeUR( )
{
-
-
#ifdef _WIN32
this->m_GlobalPath = std::getenv("TEMP");
#endif
#endif // MACOSX
this->m_CurrentURPos = -1;
}
+
// ----------------------------------------------------------------------------------
//virtual
Image3DDequeUR::~Image3DDequeUR( )
{
this->CleanHardDisk( );
}
+
// ----------------------------------------------------------------------------------
//virtual
void Image3DDequeUR::AddImagesToURContainer( VTKImageDataPointerType imgUndo,
//Managing memory
this->ManageMemory( );
}
+
// ----------------------------------------------------------------------------------
//virtual
ImageInfoUR* Image3DDequeUR::Undo( )
} //fi
return ( imgRet );
}
+
// ----------------------------------------------------------------------------------
//virtual
ImageInfoUR* Image3DDequeUR::Redo( )
&& ( this->m_CurrentURPos < imgURDequeSize ) )
{
imgRet = this->m_ImgURDeque[ m_CurrentURPos ];
- } //fi
- else
- {
+ } else {
this->m_CurrentURPos--;
}
return ( imgRet );
}
+
// ----------------------------------------------------------------------------------
//virtual
void Image3DDequeUR::CleanURContainerFromIndex( const int& index )
this->m_ImgURDeque.pop_back( );
} //rof
}
+
// ----------------------------------------------------------------------------------
//virtual
void Image3DDequeUR::ManageMemory( )
{
int imgURDequeSize = this->m_ImgURDeque.size( );
- for( int i = 0; i < imgURDequeSize; i++ )
+ int i;
+ for( i = 0; i < imgURDequeSize; i++ )
{
if( this->m_ImgURDeque[ i ]->GetStatus( ) )
{
- this->m_ImgURDeque[ i ]->RemoveImagesFromMemory(
- this->m_GlobalPath );
- } //fi
- } //rof
+ this->m_ImgURDeque[ i ]->RemoveImagesFromMemory( this->m_GlobalPath );
+ } // if Status
+ } // for i
//Adding CurrentUndoPos to memory
- if( ( this->m_CurrentURPos != -1 )
- && !( this->m_ImgURDeque[ this->m_CurrentURPos ]->GetStatus( ) ) )
+ if( ( this->m_CurrentURPos != -1 ) && !( this->m_ImgURDeque[ this->m_CurrentURPos ]->GetStatus( ) ) )
{
- this->m_ImgURDeque[ this->m_CurrentURPos ]->LoadImagesToMemory(
- this->m_GlobalPath );
+ this->m_ImgURDeque[ this->m_CurrentURPos ]->LoadImagesToMemory( this->m_GlobalPath );
}
int currentRedoPos = this->m_CurrentURPos + 1;
- if( ( currentRedoPos < imgURDequeSize )
- && !( this->m_ImgURDeque[ currentRedoPos ]->GetStatus( ) ) )
+ if( ( currentRedoPos < imgURDequeSize ) && !( this->m_ImgURDeque[ currentRedoPos ]->GetStatus( ) ) )
{
- this->m_ImgURDeque[ currentRedoPos ]->LoadImagesToMemory(
- this->m_GlobalPath );
+ this->m_ImgURDeque[ currentRedoPos ]->LoadImagesToMemory( this->m_GlobalPath );
}
}
+
// ----------------------------------------------------------------------------------
void Image3DDequeUR::SetGlobalPath( const StringType& globalPath )
{
this->m_GlobalPath = globalPath;
}
+
// ----------------------------------------------------------------------------------
void Image3DDequeUR::CleanHardDisk( )
{
this->m_ImgURDeque[ i ]->RemoveImagesFromDisk( this->m_GlobalPath );
}
}
+
// ----------------------------------------------------------------------------------
Image3DDequeUR::StringType Image3DDequeUR::GetGlobalPath( )
{
return ( this->m_GlobalPath );
}
+
// ----------------------------------------------------------------------------------
Image3DDequeUR::StringType Image3DDequeUR::GetImageName( const int & pos )
{
StringType imageName = this->m_IDImages + ss.str( );
return ( imageName );
}
+
// ----------------------------------------------------------------------------------
#ifndef IMAGE3DDEQUEUR_H_
#define IMAGE3DDEQUEUR_H_
+#include <deque>
+
#include "imageDequeUR.h"
-#include <ctime>
+
+
/*! @class Image3DDequeUR image3DDequeUR.h "image3DDequeUR.cxx"
* @brief This class contains the management of the undo/redo deque - Concrete Class
void CleanHardDisk();
// ----------------------------------------------------------------------------------
protected:
- ImageInfoDeque m_ImgURDeque; //!<This is the container of the images for undo and redo.
- int m_CurrentURPos; //!<This is the index where is located the undo and redo state.
- StringType m_GlobalPath; //!<This is the string with the global path.
- StringType m_IDImages; //!<This is the string with the ID of the images (For the filenames).
+ ImageInfoDeque m_ImgURDeque; //!<This is the container of the images for undo and redo.
+ int m_CurrentURPos; //!<This is the index where is located the undo and redo state.
+ StringType m_GlobalPath; //!<This is the string with the global path.
+ StringType m_IDImages; //!<This is the string with the ID of the images (For the filenames).
};
#endif /* IMAGE3DDEQUEUR_H_ */
#include "imageDequeUR.h"
// ----------------------------------------------------------------------------------
-ImageDequeUR::ImageDequeUR() {
-
+ImageDequeUR::ImageDequeUR()
+{
}
-// ----------------------------------------------------------------------------------
-ImageDequeUR::~ImageDequeUR() {
-}
// ----------------------------------------------------------------------------------
-void ImageDequeUR::AddImagesToURContainer(VTKImageDataPointerType imgUndo,
- VTKImageDataPointerType imgRedo, ImageMManager* imMManager) {
+ImageDequeUR::~ImageDequeUR()
+{
}
-// ----------------------------------------------------------------------------------
-void ImageDequeUR::CleanURContainerFromIndex(const int& index) {
+// ----------------------------------------------------------------------------------
+void ImageDequeUR::AddImagesToURContainer( VTKImageDataPointerType imgUndo,
+ VTKImageDataPointerType imgRedo,
+ ImageMManager* imMManager)
+{
}
+
// ----------------------------------------------------------------------------------
-void ImageDequeUR::ManageMemory() {
+void ImageDequeUR::CleanURContainerFromIndex(const int& index)
+{
+}
+// ----------------------------------------------------------------------------------
+void ImageDequeUR::ManageMemory()
+{
}
+
// ----------------------------------------------------------------------------------
-ImageInfoUR* ImageDequeUR::Undo() {
+ImageInfoUR* ImageDequeUR::Undo()
+{
return NULL;
}
+
// ----------------------------------------------------------------------------------
-ImageInfoUR* ImageDequeUR::Redo() {
+ImageInfoUR* ImageDequeUR::Redo()
+{
return NULL;
}
+
// ----------------------------------------------------------------------------------
#ifndef IMAGEDEQUE_H_
#define IMAGEDEQUE_H_
-#include <iostream>
-#include <string>
-#include <deque>
-#include <vtkImageData.h>
-#include <vtkSmartPointer.h>
#include "imageInfoUR.h"
-#include "imageModificationManager.h"
+
+//#include <iostream>
+//#include <string>
+//#include <vtkImageData.h>
+//#include <vtkSmartPointer.h>
+//#include "imageModificationManager.h"
/*! @class ImageDequeUR imageDequeUR.h "imageDequeUR.cxx"
* @brief This class contains the management of the undo/redo - Abstract Class
// ----------------------------------------------------------------------------------
ImageInfoUR::ImageInfoUR()
{
- this->m_OnMemory = false;
- this->m_OnDisk = false;
+ this->m_OnMemory = false;
+ this->m_OnDisk = false;
}
+
// ----------------------------------------------------------------------------------
ImageInfoUR::~ImageInfoUR()
{
}
+
// ----------------------------------------------------------------------------------
void ImageInfoUR::SetImageName(const StringType &imgName)
{
- this->m_ImageName = imgName;
+ this->m_ImageName = imgName;
}
+
// ----------------------------------------------------------------------------------
void ImageInfoUR::SetImageMManager(ImageMManagerType* imMManager)
{
- this->m_ImageMManager = imMManager;
+ this->m_ImageMManager = imMManager;
}
+
// ----------------------------------------------------------------------------------
void ImageInfoUR::SetStatus(const bool& onMemory)
{
- this->m_OnMemory = onMemory;
+ this->m_OnMemory = onMemory;
}
+
// ----------------------------------------------------------------------------------
ImageInfoUR::StringType ImageInfoUR::GetImageName()
{
return (this->m_ImageName);
}
+
// ----------------------------------------------------------------------------------
ImageInfoUR::VTKImageDataPointerType ImageInfoUR::GetUndoImage()
{
return (this->m_UndoImage);
}
+
// ----------------------------------------------------------------------------------
ImageInfoUR::VTKImageDataPointerType ImageInfoUR::GetRedoImage()
{
return (this->m_RedoImage);
}
+
// ----------------------------------------------------------------------------------
ImageInfoUR::ImageMManagerType* ImageInfoUR::GetImageMManager()
{
return (this->m_ImageMManager);
}
+
// ----------------------------------------------------------------------------------
bool ImageInfoUR::GetStatus()
{
return (this->m_OnMemory);
}
+
// ----------------------------------------------------------------------------------
void ImageInfoUR::SetImages(VTKImageDataPointerType imgUndo, VTKImageDataPointerType imgRedo)
{
this->m_RedoImage = imgRedo;
this->SetStatus(true);
}
+
// ----------------------------------------------------------------------------------
void ImageInfoUR::LoadImagesToMemory(const StringType& gPath)
{
+printf("EED ImageInfoUR::LoadImagesToMemory Start\n");
//setting paths
StringType filename = gPath + this->m_ImageName;
StringType undoImagePath = filename + "_Undo.mhd";
//Loading Undo Image
VTKMetaImageReaderPointerType readerUndo = VTKMetaImageReaderPointerType::New();
readerUndo->SetFileName(undoImagePath.c_str());
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // ..
+#else
+ readerUndo->Update();
+#endif
+
this->m_UndoImage = readerUndo->GetOutput();
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
this->m_UndoImage->Update();
#else
- // ..
+ this->m_UndoImage->Modified();
#endif
//Loading Redo Image
VTKMetaImageReaderPointerType readerRedo = VTKMetaImageReaderPointerType::New();
#if VTK_MAJOR_VERSION <= 5
this->m_RedoImage->Update();
#else
- // ...
+ this->m_RedoImage->Modified();
#endif
//Updating status
this->m_OnMemory = true;
+
+printf("EED ImageInfoUR::LoadImagesToMemory End\n");
+
}
+
// ----------------------------------------------------------------------------------
void ImageInfoUR::RemoveImagesFromMemory(const StringType& gPath)
{
this->m_RedoImage = NULL;
this->SetStatus(false);
}
+
// ----------------------------------------------------------------------------------
void ImageInfoUR::SaveImagesOnDisk(const StringType& gPath)
{
printf("EED ImageInfoUR::SaveImagesOnDisk Start \n");
- this->m_OnDisk = true;
- StringType filename = gPath + this->m_ImageName;
- StringType undoImagePath = filename + "_Undo.mhd";
- StringType redoImagePath = filename + "_Redo.mhd";
+ this->m_OnDisk = true;
+ StringType filename = gPath + this->m_ImageName;
+ StringType undoImagePath = filename + "_Undo.mhd";
+ StringType redoImagePath = filename + "_Redo.mhd";
this->SaveImageAsMHD(undoImagePath, this->m_UndoImage);
this->SaveImageAsMHD(redoImagePath, this->m_RedoImage);
printf("EED ImageInfoUR::SaveImagesOnDisk %s \n", undoImagePath.c_str() );
}
+
// ----------------------------------------------------------------------------------
void ImageInfoUR::RemoveImagesFromDisk(const StringType& gPath)
{
- StringType filename = gPath + this->m_ImageName;
+ StringType filename = gPath + this->m_ImageName;
StringType undoImagePathMHD = filename + "_Undo.mhd";
StringType redoImagePathMHD = filename + "_Redo.mhd";
StringType undoImagePathRAW = filename + "_Undo.raw";
remove(undoImagePathRAW.c_str());
remove(redoImagePathRAW.c_str());
}
+
// ----------------------------------------------------------------------------------
void ImageInfoUR::SaveImageAsMHD(const StringType& filename, VTKImageDataPointerType image)
{
// ----------------------------------------------------------------------------------
ImageMManager::ImageMManager(ImageMManager* manager)
{
+printf("EED ImageMManager::ImageMManager Start\n");
this->m_RegionStruct = manager->GetModifiedRegion();
+ this->m_ValidRegion = manager->ValidateRegion();
+
+if (manager->ValidateRegion()==true) printf("EED ImageMManager::ImageMManager manager->ValidateRegion true \n");
+if (manager->ValidateRegion()==false) printf("EED ImageMManager::ImageMManager manager->ValidateRegion false \n");
+printf("EED ImageMManager::ImageMManager End\n");
}
// ----------------------------------------------------------------------------------
ImageMManager::~ImageMManager()
{
}
+
// ----------------------------------------------------------------------------------
void ImageMManager::CleanModifiedRegion()
{
- int min = std::numeric_limits<int>::min();
- int max = std::numeric_limits<int>::max();
- this->m_RegionStruct.minX = max;
- this->m_RegionStruct.maxX = min;
- this->m_RegionStruct.minY = max;
- this->m_RegionStruct.maxY = min;
- this->m_RegionStruct.minZ = max;
- this->m_RegionStruct.maxZ = min;
- this->m_ValidRegion = false;
+ int min = std::numeric_limits<int>::min();
+ int max = std::numeric_limits<int>::max();
+ this->m_RegionStruct.minX = max;
+ this->m_RegionStruct.maxX = min;
+ this->m_RegionStruct.minY = max;
+ this->m_RegionStruct.maxY = min;
+ this->m_RegionStruct.minZ = max;
+ this->m_RegionStruct.maxZ = min;
+ this->m_ValidRegion = false;
}
+
// ----------------------------------------------------------------------------------
void ImageMManager::CalculateMinMaxRegion(const int& i, const int& j, const int& k)
{
if (i >= 0 && j >= 0 && k >= 0)
{
- if (i <= this->m_RegionStruct.minX)
- {
- this->m_RegionStruct.minX = i;
- } //fi
- if (i > this->m_RegionStruct.maxX)
- {
- this->m_RegionStruct.maxX = i;
- } //esle
- if (j <= this->m_RegionStruct.minY)
- {
- this->m_RegionStruct.minY = j;
- } //fi
- if (j > this->m_RegionStruct.maxY)
- {
- this->m_RegionStruct.maxY = j;
- } //esle
- if (k <= this->m_RegionStruct.minZ)
- {
- this->m_RegionStruct.minZ = k;
- } //fi
- if (k > this->m_RegionStruct.maxZ)
- {
- this->m_RegionStruct.maxZ = k;
- } //esle
+ if (i <= this->m_RegionStruct.minX) { this->m_RegionStruct.minX = i; } //fi
+ if (i > this->m_RegionStruct.maxX) { this->m_RegionStruct.maxX = i; } //esle
+ if (j <= this->m_RegionStruct.minY) { this->m_RegionStruct.minY = j; } //fi
+ if (j > this->m_RegionStruct.maxY) { this->m_RegionStruct.maxY = j; } //esle
+ if (k <= this->m_RegionStruct.minZ) { this->m_RegionStruct.minZ = k; } //fi
+ if (k > this->m_RegionStruct.maxZ) { this->m_RegionStruct.maxZ = k; } //esle
this->m_ValidRegion = true;
}else {
this->m_ValidRegion = false;
} // if i j k
- if (m_ValidRegion ) printf(" ImageMManager::CalculateMinMaxRegion true \n");
- if (!m_ValidRegion ) printf(" ImageMManager::CalculateMinMaxRegion false \n");
+// if (m_ValidRegion ) printf(" ImageMManager::CalculateMinMaxRegion true \n");
+// if (!m_ValidRegion ) printf(" ImageMManager::CalculateMinMaxRegion false \n");
}
// ----------------------------------------------------------------------------------
void ImageMManager::AddModifiedPixel(const int& i, const int& j, const int& k)
{
-printf("EED ImageMManager::AddModifiedPixel \n");
+//printf("EED ImageMManager::AddModifiedPixel \n");
this->CalculateMinMaxRegion(i, j, k);
}
// ----------------------------------------------------------------------------------
* @brief This class contains the modification manager of the undo/redo
* @details This class contains the region and some information about the undo/redo
*/
-class ImageMManager {
+class ImageMManager
+{
public:
// ----------------------------------------------------------------------------------
/*! @fn ImageMManager();
//virtual
void ImageUndoRedo::Undo( )
{
+printf("EED ImageUndoRedo::Undo Start\n");
ImageInfoUR* imageInfo = this->m_ImagesDeque->Undo( );
if( imageInfo != NULL)
{
this->DrawUR( imageInfo, true );
this->UpdateUndoImage( );
- }
+ } //if imageInfo
+printf("EED ImageUndoRedo::Undo End\n");
+
}
// ----------------------------------------------------------------------------------
//virtual
#if VTK_MAJOR_VERSION <= 5
this->m_CurrentImage->Update( );
#else
- // ..
+ this->m_CurrentImage->Modified( );
#endif
this->UpdateUndoImage( );
}
+
// ----------------------------------------------------------------------------------
//virtual
void ImageUndoRedo::SetURImages( ImageMManagerType* imMManager )
std::cerr << "INVALID REGION" << std::endl;
}
}
+
// ----------------------------------------------------------------------------------
void ImageUndoRedo::UpdateUndoImage( )
{
#if VTK_MAJOR_VERSION <= 5
this->m_CurrentImage->Update( );
#else
- // ...
+ this->m_CurrentImage->Modified( );
#endif
this->m_UndoImage = VTKImageDataPointerType::New( );
this->m_UndoImage->DeepCopy( m_CurrentImage );
#if VTK_MAJOR_VERSION <= 5
this->m_UndoImage->Update( );
#else
- // ..
+ this->m_UndoImage->Modified( );
#endif
}
+
// ----------------------------------------------------------------------------------
-ImageUndoRedo::VTKImageDataPointerType ImageUndoRedo::GetImageRegion(
- const RegionSType& region, VTKImageDataPointerType img )
+ImageUndoRedo::VTKImageDataPointerType ImageUndoRedo::GetImageRegion( const RegionSType& region, VTKImageDataPointerType img )
{
+printf("EED ImageUndoRedo::GetImageRegion Start\n");
VTKExtractVOIPointerType extract = VTKExtractVOIPointerType::New( );
- extract->SetVOI( region.minX, region.maxX, region.minY, region.maxY,
- region.minZ, region.maxZ );
+ extract->SetVOI( region.minX, region.maxX, region.minY, region.maxY,region.minZ, region.maxZ );
+
+printf("EED ImageUndoRedo::GetImageRegion region %d %d %d %d %d %d\n", region.minX, region.maxX, region.minY, region.maxY,region.minZ, region.maxZ );
+
extract->SetSampleRate( 1, 1, 1 );
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
extract->SetInput( img );
#else
extract->SetInputData( img );
+ extract->Update();
#endif
VTKImageDataPointerType imgResult = extract->GetOutput( );
#if VTK_MAJOR_VERSION <= 5
imgResult->Update( );
#else
- // ..
+ imgResult->Modified( );
#endif
+printf("EED ImageUndoRedo::GetImageRegion End\n");
return ( imgResult );
}
// ----------------------------------------------------------------------------------
//virtual
void ImageUndoRedo::DrawUR( ImageInfoUR* imageInfo, const bool& undo )
{
+printf("EED ImageUndoRedo::DrawUR Start\n");
VTKImageDataPointerType img;
if( undo )
{
RegionSType region = imageInfo->GetImageMManager( )->GetModifiedRegion( );
if( img != NULL)
{
- int *dim = img->GetDimensions( );
- int sizeXImageIn = dim[ 0 ];
- size_t linesize = sizeXImageIn * sizeof(unsigned short);
+ int *dim = img->GetDimensions( );
+printf("EED ImageUndoRedo::DrawUR dim = %d %d %d\n", dim[0],dim[1],dim[2]);
+ int ext[6]; img->GetExtent( ext );
+printf("EED ImageUndoRedo::DrawUR ext = %d %d %d %d %d %d\n", ext[0],ext[1],ext[2],ext[3],ext[4],ext[5] );
+
+ int sizeXImageIn = dim[ 0 ];
+ size_t linesize = sizeXImageIn * sizeof(unsigned short);
for( int j = region.minY, y = 0; j <= region.maxY; j++, y++ )
{
for( int k = region.minZ, z = 0; k <= region.maxZ; k++, z++ )
{
- void* ptrsrc = img->GetScalarPointer( 0, y, z );
- void* ptrdest = this->m_CurrentImage->GetScalarPointer( region.minX, j, k );
+ void* ptrsrc = img->GetScalarPointer( 0, y, z );
+ void* ptrdest = this->m_CurrentImage->GetScalarPointer( region.minX, j, k );
memcpy( ptrdest, ptrsrc, linesize );
} // for k
} // for j
this->m_CurrentImage->Modified( );
} // if img
this->m_ImagesDeque->ManageMemory( );
+printf("EED ImageUndoRedo::DrawUR End\n");
}
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
protected:
- IDequeType* m_ImagesDeque; //!<The manager of the ImagesDeque.
- VTKImageDataPointerType m_UndoImage; //!< This is the image for undo t(m_CurrentImage - 1).
- VTKImageDataPointerType m_CurrentImage; //!< This is the current image (The modification image).
+ IDequeType *m_ImagesDeque; //!<The manager of the ImagesDeque.
+ VTKImageDataPointerType m_UndoImage; //!< This is the image for undo t(m_CurrentImage - 1).
+ VTKImageDataPointerType m_CurrentImage; //!< This is the current image (The modification image).
};
#include "managerUR.h"
// ----------------------------------------------------------------------------------
-ManagerUR::ManagerUR() {
-
+ManagerUR::ManagerUR()
+{
}
-// ----------------------------------------------------------------------------------
-ManagerUR::~ManagerUR() {
-}
// ----------------------------------------------------------------------------------
-void ManagerUR::SetImage(VTKImageDataPointerType image) {
-
+ManagerUR::~ManagerUR()
+{
}
-// ----------------------------------------------------------------------------------
-void ManagerUR::Undo() {
-}
// ----------------------------------------------------------------------------------
-void ManagerUR::Redo() {
-
+void ManagerUR::SetImage(VTKImageDataPointerType image)
+{
}
+
// ----------------------------------------------------------------------------------
-void ManagerUR::SetURImages(ImageMManagerType* imMManager) {
+void ManagerUR::Undo()
+{
+}
+// ----------------------------------------------------------------------------------
+void ManagerUR::Redo()
+{
}
+
// ----------------------------------------------------------------------------------
-void ManagerUR::DrawUR(ImageInfoUR* imageInfo, const bool& undo) {
+void ManagerUR::SetURImages(ImageMManagerType* imMManager)
+{
+}
+// ----------------------------------------------------------------------------------
+void ManagerUR::DrawUR(ImageInfoUR* imageInfo, const bool& undo)
+{
}
+
// ----------------------------------------------------------------------------------
BrushFilter::BrushFilter()
{
- _brushsize = 1;
+ _brushsize = 5;
_brushform = 0; // 0 rectangle-cube , 1 circle-sphere
_brushtool = 0; // 0 pencil , 1 fill
}
maxZ = _pz + size;
if (_2D3D == 0) //2D
- {
+ {
if (_direction == 0) // YZ
- {
+ {
minX = _px;
maxX = _px;
}
if (_direction == 1) // XZ
- {
+ {
minY = _py;
maxY = _py;
}
if (_direction == 2) // XY
- {
+ {
minZ = _pz;
maxZ = _pz;
}
- }
-
- if (_2D3D == 1) // 3D
- {
- }
-
- if (minX < _minX) {
- minX = _minX;
- }
-
- if (minY < _minY) {
- minY = _minY;
- }
-
- if (minZ < _minZ) {
- minZ = _minZ;
- }
+ } // _2D3D
- if (maxX > _maxX) {
- maxX = _maxX;
- }
+ if (_2D3D == 1) { } // 3D
- if (maxY > _maxY) {
- maxY = _maxY;
- }
+ if (minX < _minX) { minX = _minX; }
+ if (minY < _minY) { minY = _minY; }
- if (maxZ > _maxZ) {
- maxZ = _maxZ;
- }
+ if (minZ < _minZ) { minZ = _minZ; }
+ if (maxX > _maxX) { maxX = _maxX; }
+ if (maxY > _maxY) { maxY = _maxY; }
+ if (maxZ > _maxZ) { maxZ = _maxZ; }
//--
SetGeneralMinMax(minX, maxX, minY, maxY, minZ, maxZ);
FillFilter::FillFilter()
{
- _tolerancefill = 50;
- _distancefill = 500;
+ _tolerancefill = 125;
+ _distancefill = 5;
/*
_limitRecursionFill = 50000;
*/
}
unsigned char * ptrAuxImageFill = (unsigned char *)_auxImageFill->GetScalarPointer();
memset(ptrAuxImageFill, 0, (_maxX+1) * (_maxY+1) * (_maxZ+1) );
-
_maxXback=_maxX;
_maxYback=_maxY;
_maxZback=_maxZ;
if (_auxGrayLevelValidationFill)
{
+
+ this->_IMManager->AddModifiedPixel(lstX[0], lstY[0], lstZ[0]); //DFCH
+
// Modifie image
if (_image2!=NULL)
{
lstX.push_back(lstX[0] ); lstY.push_back(lstY[0] ); lstZ.push_back(lstZ[0]+1); lstivi.push_back( lstivi[0]+_OnePlane);
lstX.push_back(lstX[0] ); lstY.push_back(lstY[0] ); lstZ.push_back(lstZ[0]-1); lstivi.push_back( lstivi[0]-_OnePlane);
} // 2D 3D
-
-
-
-
-
-
-
} // if gray level valid _auxGrayLevelValidationFill
-
} // if point not visited
// Add point to already visited
SETVALUE2_VTK_CREA(1,p_auxImageFill,st_auxImageFill,lstivi[0]);
# knowledge of the CeCILL-B license and that you accept its terms.
# ------------------------------------------------------------------------ */
+#include <wxMPRBaseData.h>
+
#include "ManualPaintControler.h"
#include "vtkInteractorManualPaint.h"
#include "vtkImageActor.h"
//---------------------------------------------------------------------------
-ManualPaintControler::ManualPaintControler() {
- auxZ = 0;
- _wxvtk2Dbaseview = NULL;
+ManualPaintControler::ManualPaintControler()
+{
+ auxZ = 0;
+ _wxvtk2Dbaseview = NULL;
}
//---------------------------------------------------------------------------
-ManualPaintControler::~ManualPaintControler() {
+ManualPaintControler::~ManualPaintControler()
+{
}
//---------------------------------------------------------------------------
-void ManualPaintControler::SetManualPaintModel(
- ManualPaintModel* manualPaintModel) {
- _manualPaintModel = manualPaintModel;
+void ManualPaintControler::SetManualPaintModel( ManualPaintModel* manualPaintModel )
+{
+ _manualPaintModel = manualPaintModel;
}
//---------------------------------------------------------------------------
-void ManualPaintControler::SetManualPaintPanel(
- ManualPaintPanel* manualPaintPanel) {
- _manualPaintPanel = manualPaintPanel;
+ManualPaintModel* ManualPaintControler::GetManualPaintModel( )
+{
+ return _manualPaintModel;
}
//---------------------------------------------------------------------------
-void ManualPaintControler::SetWxVtk2DBaseView(
- wxVtk2DBaseView *wxvtk2Dbaseview) {
- _wxvtk2Dbaseview = wxvtk2Dbaseview;
+//void ManualPaintControler::SetManualPaintPanel( ManualPaintPanel* manualPaintPanel )
+//{
+// _manualPaintPanel = manualPaintPanel;
+//}
+
+//---------------------------------------------------------------------------
+void ManualPaintControler::SetWxVtk2DBaseView( wxVtk2DBaseView *wxvtk2Dbaseview )
+{
+ _wxvtk2Dbaseview = wxvtk2Dbaseview;
}
//---------------------------------------------------------------------------
-void ManualPaintControler::Config() {
- if (_wxvtk2Dbaseview != NULL) {
- vtkInteractorStyleBaseView *isbv =
- (vtkInteractorStyleBaseView*) (_wxvtk2Dbaseview->GetInteractorStyleBaseView());
+void ManualPaintControler::Config()
+{
+ if (_wxvtk2Dbaseview != NULL)
+ {
+ vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*) (_wxvtk2Dbaseview->GetInteractorStyleBaseView());
isbv->AddInteractorStyleMaracas(new vtkInteractorManualPaint(this));
- }
+ } // if _wxvtk2Dbaseview
}
//---------------------------------------------------------------------------
-void ManualPaintControler::PaintImage(int px, int py, int pz) {
+void ManualPaintControler::PaintImage(int px, int py, int pz)
+{
_manualPaintModel->SetDirection(_wxvtk2Dbaseview->GetDirection());
_manualPaintModel->PaintImage(px, py, pz);
-
// The refresh mechanisme is made in the vtkInteractorManualPaint
// RefreshView();
}
{
_manualPaintModel->SetUndoImage();
}
+
+
+
+//---------------------------------------------------------------------------
+void ManualPaintControler::Undo()
+{
+ _manualPaintModel->Undo();
+ Refresh();
+}
+
+void ManualPaintControler::Redo()
+{
+ _manualPaintModel->Redo();
+ Refresh();
+}
+
+
+void ManualPaintControler::Refresh()
+{
+ if (_wxvtk2Dbaseview!=NULL)
+ {
+ vtkMPRBaseData* vtkmprbasedata = (vtkMPRBaseData*) (_wxvtk2Dbaseview->GetVtkBaseData());
+// if (bbGetInputPoint().size()==3)
+// {
+// vtkmprbasedata->SetX( bbGetInputPoint()[0] );
+// vtkmprbasedata->SetY( bbGetInputPoint()[1] );
+// vtkmprbasedata->SetZ( bbGetInputPoint()[2] );
+ wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ _wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent );
+#else
+ _wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessWindowEvent( newevent );
+#endif
+// } // if Position
+ } // _wxvtk2Dbaseview
+}
+
+
#define _MANUAL_PAINT_CONTROLER_H_
#include "ManualPaintModel.h"
-#include "ManualPaintPanel.h"
+//#include "ManualPaintPanel.h"
#include "wxVtk2DBaseView.h"
ManualPaintControler();
virtual ~ManualPaintControler();
- void SetManualPaintModel(ManualPaintModel* manualPaintModel);
- void SetManualPaintPanel(ManualPaintPanel* manualPaintPanel);
- void SetWxVtk2DBaseView(wxVtk2DBaseView *wxvtk2Dbaseview);
- void Config();
- void PaintImage(int px,int py, int pz);
- void SetImageUndo();
+ void SetManualPaintModel(ManualPaintModel* manualPaintModel);
+ ManualPaintModel* GetManualPaintModel();
+// void SetManualPaintPanel(ManualPaintPanel* manualPaintPanel);
+ void SetWxVtk2DBaseView(wxVtk2DBaseView *wxvtk2Dbaseview);
+ void Config();
+ void PaintImage(int px,int py, int pz);
+ void SetImageUndo();
+ void Undo();
+ void Redo();
+ void Refresh();
private:
int auxZ;
ManualPaintModel *_manualPaintModel;
- ManualPaintPanel *_manualPaintPanel;
+// ManualPaintPanel *_manualPaintPanel;
wxVtk2DBaseView *_wxvtk2Dbaseview;
protected:
ManualPaintModel::ManualPaintModel()
{
- _active = true;
- _tool = 0; // 0 pencil , 1 fill
+ _active = true;
+ _tool = 0; // 0 pencil , 1 fill
_brushfilter = new BrushFilter();
_fillfilter = new FillFilter();
_imageUndoRedo = new ImageUndoRedo();
{
if (_active==true)
{
-
if (_tool == 0)
{
_brushfilter->SetPoint(px, py, pz);
_brushfilter->Run();
} // _tool 2
-
if (_tool == 1)
{
_fillfilter->SetPoint(px, py, pz);
//---------------------------------------------------------------------------
void ManualPaintModel::SetUndoImage()
{
- printf("EED ManualPaintModel::SetUndoImage \n");
ImageMManager* imMManager = NULL;
if (_tool == 0)
{
void ManualPaintModel::Undo()
{
- printf("EED ManualPaintModel::Undo \n");
this->_imageUndoRedo->Undo();
}
void Redo(); //DFCH
private:
- int _tool;
- bool _active;
- BrushFilter *_brushfilter;
- FillFilter *_fillfilter;
- ImageUndoRedo *_imageUndoRedo;
+ int _tool;
+ bool _active;
+ BrushFilter *_brushfilter;
+ FillFilter *_fillfilter;
+ ImageUndoRedo *_imageUndoRedo;
protected:
ManualPaintPanel::ManualPaintPanel()
{
- _manualPaintModel=NULL;
+ _manualPaintControler=NULL;
}
//---------------------------------------------------------------------------
}
//---------------------------------------------------------------------------
-void ManualPaintPanel::SetManualPaintModel(ManualPaintModel* manualPaintModel)
+void ManualPaintPanel::SetManualPaintControler(ManualPaintControler* manualPaintControler)
{
- _manualPaintModel = manualPaintModel;
+ _manualPaintControler = manualPaintControler;
}
//---------------------------------------------------------------------------
void ManualPaintPanel::SetBrushSize( int brushsize )
{
- if (_manualPaintModel!=NULL)
+ if (_manualPaintControler!=NULL)
{
- _manualPaintModel->SetBrushSize( brushsize );
+ _manualPaintControler->GetManualPaintModel()->SetBrushSize( brushsize );
} else {
printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n");
}
//---------------------------------------------------------------------------
void ManualPaintPanel::SetRangeMin( int min )
{
- if (_manualPaintModel!=NULL)
+ if (_manualPaintControler!=NULL)
{
- _manualPaintModel->SetRangeMin( min );
+ _manualPaintControler->GetManualPaintModel()->SetRangeMin( min );
} else {
printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n");
}
//---------------------------------------------------------------------------
void ManualPaintPanel::SetRangeMax( int max )
{
- if (_manualPaintModel!=NULL)
+ if (_manualPaintControler!=NULL)
{
- _manualPaintModel->SetRangeMax( max );
+ _manualPaintControler->GetManualPaintModel()->SetRangeMax( max );
} else {
printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n");
}
//---------------------------------------------------------------------------
void ManualPaintPanel::SetGrayLevel( double graylevel )
{
- if (_manualPaintModel!=NULL)
+ if (_manualPaintControler!=NULL)
{
- _manualPaintModel->SetGrayLevel( graylevel );
+ _manualPaintControler->GetManualPaintModel()->SetGrayLevel( graylevel );
} else {
printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n");
}
//---------------------------------------------------------------------------
void ManualPaintPanel::SetTool(int tool)
{
- if (_manualPaintModel!=NULL)
+ if (_manualPaintControler!=NULL)
{
- _manualPaintModel->SetTool( tool );
+ _manualPaintControler->GetManualPaintModel()->SetTool( tool );
} else {
printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n");
}
//---------------------------------------------------------------------------
void ManualPaintPanel::Set2D3D(int dim2D3D)
{
- if (_manualPaintModel!=NULL)
+ if (_manualPaintControler!=NULL)
{
- _manualPaintModel->Set2D3D( dim2D3D );
+ _manualPaintControler->GetManualPaintModel()->Set2D3D( dim2D3D );
} else {
printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n");
}
//---------------------------------------------------------------------------
void ManualPaintPanel::SetBrushForm(int brushform)
{
- if (_manualPaintModel!=NULL)
+ if (_manualPaintControler!=NULL)
{
- _manualPaintModel->SetBrushForm( brushform );
+ _manualPaintControler->GetManualPaintModel()->SetBrushForm( brushform );
} else {
printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n");
}
//---------------------------------------------------------------------------
void ManualPaintPanel::SetToleranceFill(double tolerancefill)
{
- if (_manualPaintModel!=NULL)
+ if (_manualPaintControler!=NULL)
{
- _manualPaintModel->SetToleranceFill( tolerancefill );
+ _manualPaintControler->GetManualPaintModel()->SetToleranceFill( tolerancefill );
} else {
printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n");
}
//---------------------------------------------------------------------------
void ManualPaintPanel::SetDistanceFill(int distancefill)
{
- if (_manualPaintModel!=NULL)
+ if (_manualPaintControler!=NULL)
{
- _manualPaintModel->SetDistanceFill( distancefill );
+ _manualPaintControler->GetManualPaintModel()->SetDistanceFill( distancefill );
} else {
printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n");
}
//---------------------------------------------------------------------------
void ManualPaintPanel::GetScalarRange( double * range )
{
- if (_manualPaintModel!=NULL)
+ if (_manualPaintControler!=NULL)
{
- _manualPaintModel->GetScalarRange( range );
+ _manualPaintControler->GetManualPaintModel()->GetScalarRange( range );
} else {
printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n");
}
//---------------------------------------------------------------------------
void ManualPaintPanel::SetActive( bool active )
{
- if (_manualPaintModel!=NULL)
+ if (_manualPaintControler!=NULL)
{
- _manualPaintModel->SetActive( active );
+ _manualPaintControler->GetManualPaintModel()->SetActive( active );
} else {
printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n");
}
#ifndef _MANUAL_PAINT_PANEL_H_
#define _MANUAL_PAINT_PANEL_H_
-#include "ManualPaintModel.h"
+#include "ManualPaintControler.h"
class ManualPaintPanel {
public:
virtual ~ManualPaintPanel();
void SetActive( bool active );
- void SetManualPaintModel(ManualPaintModel* manualPaintModel);
+ void SetManualPaintControler(ManualPaintControler* manualPaintControler);
void SetBrushSize( int brushsize );
void SetGrayLevel( double graylevel );
void SetTool(int tool);
void GetScalarRange( double * range);
protected:
- ManualPaintModel *_manualPaintModel;
+ ManualPaintControler *_manualPaintControler;
};
printf("EED vtkInteractorManualPaint::OnLeftButtonUp \n");
if((_state == true) || (_stateKey == true))
{
- _manualPaintControler->SetImageUndo();
+// _manualPaintControler->SetImageUndo();
}
_state = false;
return true;
{
if ((_state == true) || (_stateKey == true))
{
- wxVtk2DBaseView *wxvtk2Dbaseview =
- (wxVtk2DBaseView*) _vtkInteractorStyleBaseView->GetWxVtk2DBaseView();
- crea::wxVTKRenderWindowInteractor *wxVTKiren =
- wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor();
+ wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*) _vtkInteractorStyleBaseView->GetWxVtk2DBaseView();
+ crea::wxVTKRenderWindowInteractor *wxVTKiren = wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor();
int px, py;
wxVTKiren->GetEventPosition(px, py);
-
-// int typeView = 1;
double X = (double) px;
double Y = (double) py;
double Z = wxvtk2Dbaseview->GetActualSlice();
-// wxvtk2Dbaseview->TransFromCoordScreenToWorld(X, Y, Z,true, typeView);
wxvtk2Dbaseview->TransFromCoordScreenToWorld(X, Y, Z, true);
-
_manualPaintControler->PaintImage((int) X, (int) Y, (int) Z);
this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
- /*
- wxvtk2Dbaseview->_imageViewer2XYZ->GetVtkImageViewer2()->Modified();
- wxvtk2Dbaseview->_imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor()->Modified();
- wxvtk2Dbaseview->_imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor()->SetDisplayExtent(0, 50+_auxZ, 0, 50,_Z, _Z );
- wxvtk2Dbaseview->Refresh();
- wxvtk2Dbaseview->RefreshView();
- // wxvtk2Dbaseview->SetActualSlice(_Z+_auxZ);
- _auxZ=(_auxZ+1)%2;
- wxvtk2Dbaseview->_imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->Render();
- this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
- */
+ _manualPaintControler->SetImageUndo();
+
} // if _state
return true;
}
: wxPanel( parent, -1 )
{
wxSizer *sizer = new wxFlexGridSizer( 1 );
-
// Widget interface
- wxStaticText *tittleText = new wxStaticText( this, -1,
- _T(" Manual Paint") );
+ wxStaticText *tittleText = new wxStaticText( this, -1,_T(" Manual Paint") );
//Title
sizer->Add( tittleText );
//giving some blank spaces
sizer->Add( new wxStaticText( this, -1, _T(" key A : Enable/Disable ") ) );
-
this->ConfigureActiveCBButton( );
this->ConfigureBrushToolRadioButton( );
this->Configure2D3DRadioButton( );
this->ConfigureDistanceFillSld( );
this->ConfigureTolFillSld( );
this->ConfigureEditButtons( );
-
//Buttons
- wxStaticText *editButtonsText = new wxStaticText( this, -1,
- _T("Edit Buttons") );
- this->_buttonsSizer = new wxFlexGridSizer( 4 );
+ wxStaticText *editButtonsText = new wxStaticText( this, -1,_T("Edit Buttons") );
+ this->_buttonsSizer = new wxFlexGridSizer( 4 );
this->_buttonsSizer->Add( _btnUndo, 1, wxGROW );
this->_buttonsSizer->Add( _btnRedo, 1, wxGROW );
this->_buttonsSizer->Add( _btnCopy, 1, wxGROW );
-
this->_gConfigSizer = new wxFlexGridSizer( 1 );
//BrushTool Radio Button
//giving blank space
//2D/3D Radio Button
this->_gConfigSizer->Add( _rb2D3D, 1, wxGROW );
//RangeBar
- this->_gConfigSizer->Add(
- new wxStaticText( this, -1, _T( "Select Range" ) ), 1, wxGROW );
+ this->_gConfigSizer->Add( new wxStaticText( this, -1, _T( "Select Range" ) ), 1, wxGROW );
this->_gConfigSizer->Add( _mBarSlices, 1, wxGROW );
//GrayLevel Slider
this->_gConfigSizer->Add( _txtGrayLevel );
//giving blank space
this->_brushSizer->Add( new wxStaticText( this, -1, _T(" ") ) );
//end of blank space
- this->_brushSizer->Add(
- new wxStaticText( this, -1, _T("Brush Settings") ) );
+ this->_brushSizer->Add( new wxStaticText( this, -1, _T("Brush Settings") ) );
//BrushSize Slider
this->_brushSizer->Add( _txtBrushSize );
this->_FillSizer->Add( _txtToleranceFill );
wxFlexGridSizer *sizerTolerance = new wxFlexGridSizer( 2 );
sizerTolerance->Add( _sldToleranceFill, 1, wxGROW );
- sizerTolerance->Add( _tolerancefillCtrl, 1,
- wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
+ sizerTolerance->Add( _tolerancefillCtrl, 1, wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
this->_FillSizer->Add( sizerTolerance, 1, wxGROW );
//Distance Fill
this->_FillSizer->Add( _txtDistanceFill );
wxFlexGridSizer *sizerDistance = new wxFlexGridSizer( 2 );
sizerDistance->Add( _sldDistanceFill, 1, wxGROW );
- sizerDistance->Add( _distancefillCtrl, 1,
- wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
+ sizerDistance->Add( _distancefillCtrl, 1, 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 );
sizer->Add( _FillSizer );
-
this->ConnectComponents( ); //DFCH
this->_FillSizer->Show( false );
-
this->SetSizer( sizer );
this->SetAutoLayout( true );
this->Layout( );
-
}
//---------------------------------------------------------------------------
_mBarSlices->SetStart( min );
_mBarSlices->SetEnd( max );
_mBarSlices->Update( );
-
SetRangeMin( min );
SetRangeMax( max );
-
//DFCH -- End BarSlices
}
+
//--------------------------------------------------------------------------
void wxManualPaintPanel::ConfigureGrayLevelSld( )
{
_graylevelCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 0 );
}
+
//--------------------------------------------------------------------------
void wxManualPaintPanel::ConfigureBrushSizeSld( )
{
_txtBrushSize = new wxStaticText( this, -1,
wxString( _T(" Brush size ") ) );
- _sldBrushSize = new wxSlider( this, -1, 1, 1, 50, wxDefaultPosition,
+ _sldBrushSize = new wxSlider( this, -1, 5, 1, 50, wxDefaultPosition,
wxDefaultSize, wxSL_LABELS );
_BrushSizeCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
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 ") ) );
- _sldDistanceFill = new wxSlider( this, -1, 50, 1, 500, wxDefaultPosition,
+ _sldDistanceFill = new wxSlider( this, -1, 5, 1, 500, wxDefaultPosition,
wxDefaultSize, wxSL_LABELS );
_sldDistanceFill->SetMinSize( wxSize( 200, -1 ) );
_sldDistanceFill->SetMaxSize( wxSize( 200, -1 ) );
_sldDistanceFill->Disable( );
_distancefillCtrl->Disable( );
}
+
//--------------------------------------------------------------------------
void wxManualPaintPanel::ConfigureTolFillSld( )
{
- _txtToleranceFill = new wxStaticText( this, -1,
- wxString( _T(" Tolerance fill ") ) );
- _sldToleranceFill = new wxSlider( this, -1, 125, 0, 255, wxDefaultPosition,
- wxDefaultSize, wxSL_LABELS );
+ _txtToleranceFill = new wxStaticText( this, -1,wxString( _T(" Tolerance fill ") ) );
+ _sldToleranceFill = new wxSlider( this, -1, 125, 0, 255, wxDefaultPosition,wxDefaultSize, wxSL_LABELS );
_sldToleranceFill->SetMinSize( wxSize( 200, -1 ) );
_sldToleranceFill->SetMaxSize( wxSize( 200, -1 ) );
- _tolerancefillCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
- wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 50 );
+ _tolerancefillCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 50 );
_txtToleranceFill->Disable( );
_sldToleranceFill->Disable( );
_tolerancefillCtrl->Disable( );
-
}
+
//--------------------------------------------------------------------------
void wxManualPaintPanel::ConfigureEditButtons( )
{
_rbBrushTool->GetId(),
wxEVT_COMMAND_RADIOBOX_SELECTED,
(wxObjectEventFunction) (void(wxPanel::*)(
- wxCommandEvent&)) &wxManualPaintPanel::OnBrushTool);this->Connect
+ wxCommandEvent&)) &wxManualPaintPanel::OnTool);this->Connect
(
_btnCopy->GetId(),
wxEVT_COMMAND_BUTTON_CLICKED,
//-------------------------------------------------------------------------
void wxManualPaintPanel::OnActive(wxCommandEvent& event)
{
- printf("EED wxManualPaintPanel::OnActive \n");
SetActive( _activeCB->GetValue() );
}
}
//---------------------------------------------------------------------------
-void wxManualPaintPanel::OnBrushTool( wxCommandEvent &event )
+void wxManualPaintPanel::OnTool( wxCommandEvent &event )
{
+printf("EED wxManualPaintPanel::OnTool Start\n");
DisableControls( );
SetTool( _rbBrushTool->GetSelection( ) );
if( _rbBrushTool->GetSelection( ) == 1 ) //Fill tool
{
+printf("EED wxManualPaintPanel::OnTool 1\n");
_txtToleranceFill->Enable( );
+printf("EED wxManualPaintPanel::OnTool 2\n");
_sldToleranceFill->Enable( );
+printf("EED wxManualPaintPanel::OnTool 3\n");
_tolerancefillCtrl->Enable( );
+printf("EED wxManualPaintPanel::OnTool 4\n");
_txtDistanceFill->Enable( );
+printf("EED wxManualPaintPanel::OnTool 5\n");
_sldDistanceFill->Enable( );
+printf("EED wxManualPaintPanel::OnTool 6\n");
_distancefillCtrl->Enable( );
+printf("EED wxManualPaintPanel::OnTool 7\n");
_FillSizer->Show( true );
+printf("EED wxManualPaintPanel::OnTool 8\n");
_brushSizer->Show( false );
+printf("EED wxManualPaintPanel::OnTool 9\n");
this->Layout( );
+printf("EED wxManualPaintPanel::OnTool 10\n");
}
}
//---------------------------------------------------------------------------
void wxManualPaintPanel::OnUndo( wxCommandEvent &event )
{
- this->_manualPaintModel->Undo( );
+ this->_manualPaintControler->Undo( );
}
//---------------------------------------------------------------------------
void wxManualPaintPanel::OnRedo( wxCommandEvent &event )
{
- this->_manualPaintModel->Redo( );
+ this->_manualPaintControler->Redo( );
}
//--------------------------------------------------------------------------------------------------------------------------------
void OnCtrTxtGrayLevel( wxCommandEvent &event );
void On2D3D( wxCommandEvent &event );
void OnBrushForm( wxCommandEvent &event );
- void OnBrushTool( wxCommandEvent &event );
+ void OnTool( wxCommandEvent &event );
void OnCopy( wxCommandEvent &event );
void OnUndo( wxCommandEvent &event );
void OnRedo( wxCommandEvent &event );
void onMovedBar( wxCommandEvent& event );
private:
- wxCheckBox *_activeCB;
+ wxCheckBox *_activeCB;
wxStaticText *_txtBrushSize;
- wxSlider *_sldBrushSize;
- wxSpinCtrl *_BrushSizeCtrl;
-
+ wxSlider *_sldBrushSize;
+ wxSpinCtrl *_BrushSizeCtrl;
wxStaticText *_txtGrayLevel;
- wxSlider *_sldGrayLevel;
- wxSpinCtrl *_graylevelCtrl;
- wxRadioBox *_rbBrushForm;
- wxRadioBox *_rb2D3D;
- wxRadioBox *_rbBrushTool;
-
+ wxSlider *_sldGrayLevel;
+ wxSpinCtrl *_graylevelCtrl;
+ wxRadioBox *_rbBrushForm;
+ wxRadioBox *_rb2D3D;
+ wxRadioBox *_rbBrushTool;
wxStaticText *_txtToleranceFill;
- wxSlider *_sldToleranceFill;
- wxSpinCtrl *_tolerancefillCtrl;
-
+ wxSlider *_sldToleranceFill;
+ wxSpinCtrl *_tolerancefillCtrl;
wxStaticText *_txtDistanceFill;
- wxSlider *_sldDistanceFill;
- wxSpinCtrl *_distancefillCtrl;
-
- mBarRange *_mBarSlices; //DFCH
- wxButton *_btnCopy; //DFCH
- wxButton *_btnUndo; //DFCH
- wxButton *_btnRedo; //DFCH
-
+ wxSlider *_sldDistanceFill;
+ wxSpinCtrl *_distancefillCtrl;
+ mBarRange *_mBarSlices; //DFCH
+ wxButton *_btnCopy; //DFCH
+ wxButton *_btnUndo; //DFCH
+ wxButton *_btnRedo; //DFCH
wxFlexGridSizer *_buttonsSizer; //DFCH
wxFlexGridSizer *_FillSizer; //DFCH
wxFlexGridSizer *_gConfigSizer; //DFCH