hay que crear una imagen2 temporal y luego bajar la imagen
3. Verificar el mecanismo de undo con ByLstPoints
4. Verificar el mecanismo de undo con ByImagePoints
-*/
+*/
+
+ printf("EED ManualPaint_Model::Process Start \n");
if (bbGetInputActive()==true)
{
if (bbGetInputImage()!=NULL)
bbSetOutputOut( NULL );
}
bbSetOutputManualpaintmodel( manualpaintmodel );
+
+ printf("EED ManualPaint_Model::Process End \n");
+
}
//=====
// 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)
--- /dev/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)
+//=====
+#include "bbcreaMaracasVisuManualPaint_Model_paint.h"
+#include "bbcreaMaracasVisuPackage.h"
+namespace bbcreaMaracasVisu
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ManualPaint_Model_paint)
+BBTK_BLACK_BOX_IMPLEMENTATION(ManualPaint_Model_paint,bbtk::AtomicBlackBox);
+//=====
+// 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 ManualPaint_Model_paint::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;
+
+ printf("EED ManualPaint_Model_paint::Process Start \n");
+ if (bbGetInputActive()==true)
+ {
+ ManualPaintModel *manualpaintmodel=bbGetInputManualPaintModel();
+ if ((bbGetInputPoint().size()==3) && (manualpaintmodel!=NULL) )
+ {
+ manualpaintmodel->PaintImage( bbGetInputPoint()[0] , bbGetInputPoint()[1] , bbGetInputPoint()[2] );
+ manualpaintmodel->SetUndoImage();
+ manualpaintmodel->Copy_GeneralAuxFill_to_Results();
+ } // if Points
+ } // if Active
+ printf("EED ManualPaint_Model_paint::Process End\n");
+
+}
+//=====
+// 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 ManualPaint_Model_paint::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputActive(true);
+ bbSetInputManualPaintModel(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 ManualPaint_Model_paint::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// 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 ManualPaint_Model_paint::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaMaracasVisu
+
+
--- /dev/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)
+//=====
+#ifndef __bbcreaMaracasVisuManualPaint_Model_paint_h_INCLUDED__
+#define __bbcreaMaracasVisuManualPaint_Model_paint_h_INCLUDED__
+
+#include "bbcreaMaracasVisu_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include <ManualPaintModel.h>
+
+namespace bbcreaMaracasVisu
+{
+
+class bbcreaMaracasVisu_EXPORT ManualPaint_Model_paint
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(ManualPaint_Model_paint,bbtk::AtomicBlackBox);
+//=====
+// 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)
+//=====
+ BBTK_DECLARE_INPUT(Active,bool);
+ BBTK_DECLARE_INPUT(ManualPaintModel,ManualPaintModel*);
+ BBTK_DECLARE_INPUT(Point,std::vector<int>);
+ // BBTK_DECLARE_OUTPUT(Out,double);
+ BBTK_PROCESS(Process);
+ void Process();
+//=====
+// 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)
+//=====
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ManualPaint_Model_paint,bbtk::AtomicBlackBox);
+ BBTK_NAME("ManualPaint_Model_paint");
+ BBTK_AUTHOR("InfoDev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+ BBTK_INPUT(ManualPaint_Model_paint,Active,"(default true) Active",bool,"");
+ BBTK_INPUT(ManualPaint_Model_paint,ManualPaintModel,"ManualPaintModel",ManualPaintModel*,"");
+ BBTK_INPUT(ManualPaint_Model_paint,Point,"[x,y,z]",std::vector<int>,"");
+//BBTK_OUTPUT(ManualPaint_Model-paint,Out,"First output",double,"");
+BBTK_END_DESCRIBE_BLACK_BOX(ManualPaint_Model_paint);
+//=====
+// 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)
+//=====
+}
+// EO namespace bbcreaMaracasVisu
+
+#endif // __bbcreaMaracasVisuManualPaint_Model_paint_h_INCLUDED__
+
#ifdef _WIN32
this->m_GlobalPath = std::getenv("TEMP");
#endif
+
#ifdef _WIN64
this->m_GlobalPath = std::getenv("TEMP");
#endif
+
#ifdef LINUX
this->m_GlobalPath = "/tmp/";
-#endif // MACOSX
+#endif
+
+#ifdef MACOSX
+ this->m_GlobalPath = "/tmp/";
+#endif
+
this->m_CurrentURPos = -1;
}
//virtual
void Image3DDequeUR::CleanURContainerFromIndex( const int& index )
{
+ printf("EED Image3DDequeUR::CleanURContainerFromIndex Start \n");
int count = 0;
for( unsigned int i = index; i < this->m_ImgURDeque.size( ); i++ )
{
{
this->m_ImgURDeque.pop_back( );
} //rof
+ printf("EED Image3DDequeUR::CleanURContainerFromIndex End \n");
+
}
// ----------------------------------------------------------------------------------
{
if (!this->m_OnDisk)
{
+ printf("EED ImageInfoUR::RemoveImagesFromMemory >>>> %s \n", gPath.c_str() );
this->SaveImagesOnDisk(gPath);
}
this->m_UndoImage = NULL;
// ----------------------------------------------------------------------------------
void ImageMManager::CalculateMinMaxRegion(const int& i, const int& j, const int& k)
{
- if (i >= 0 && j >= 0 && k >= 0)
+ printf("EED ImageMManager::CalculateMinMaxRegion i j k = %d %d %d\n", i, j, k);
+ printf("EED ImageMManager::CalculateMinMaxRegion min = %d %d %d\n", this->m_RegionStruct.minX, this->m_RegionStruct.minY, this->m_RegionStruct.minZ);
+ 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
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("EED ImageMManager::CalculateMinMaxRegion true \n");
+ if (!m_ValidRegion ) printf("EED ImageMManager::CalculateMinMaxRegion false \n");
}
// ----------------------------------------------------------------------------------
void ImageUndoRedo::SetURImages( ImageMManagerType* imMManager )
{
ImageMManagerType* newImageManager = new ImageMManagerType( imMManager );
- if( newImageManager->ValidateRegion( ) )
+ if( newImageManager->ValidateRegion() )
{
- RegionSType region = newImageManager->GetModifiedRegion( );
+ RegionSType region = newImageManager->GetModifiedRegion( );
VTKImageDataPointerType imgUndo = this->GetImageRegion( region,this->m_UndoImage );
VTKImageDataPointerType imgRedo = this->GetImageRegion( region,this->m_CurrentImage );
this->m_ImagesDeque->AddImagesToURContainer( imgUndo, imgRedo,newImageManager );
{
int *dim = img->GetDimensions( );
int sizeXImageIn = dim[ 0 ];
- size_t linesize = sizeXImageIn * sizeof(unsigned short);
+//EED size_t linesize = sizeXImageIn * sizeof(unsigned short);
+
+ size_t linesize = sizeXImageIn * img->GetScalarSize();
for( int j = region.minY, y = 0; j <= region.maxY; j++, y++ )
{
for( int k = region.minZ, z = 0; k <= region.maxZ; k++, z++ )