-/*
#include "BrushFilter.h"
//---------------------------------------------------------------------------
-void BrushFilter::FindMinMaxBrush(int &minxX,int &maxX,int &minY,int &maxY,int &minZ,int &maxZ,int &size)
+void BrushFilter::FindMinMaxBrush(int &minX,int &maxX,int &minY,int &maxY,int &minZ,int &maxZ,int &size)
{
size = _brushsize-1;
- minX = _px-size;
+ minX = _px-size;
maxX = _px+size;
minY = _py-size;
maxY = _py+size;
{
if (_direction==0) // YZ
{
- minX=px;
- maxX=px;
+ minX=_px;
+ maxX=_px;
}
if (_direction==1) // XZ
{
- minY=py;
- maxY=py;
+ minY=_py;
+ maxY=_py;
}
if (_direction==2) // XY
{
- minZ=pz;
- maxZ=pz;
+ minZ=_pz;
+ maxZ=_pz;
}
}
int size;
int minX,maxX,minY,maxY,minZ,maxZ;
- FindMinMaxBrush(minxX,maxX,minY,maxY,minZ,maxZ,size);
+ FindMinMaxBrush(minX,maxX,minY,maxY,minZ,maxZ,size);
double xx,yy,zz,rr=size*size;
for (i=minX; i<=maxX; i++)
{
- xx=px-i;
+ xx=_px-i;
xx=xx*xx;
for (j=minY; j<=maxY; j++)
{
- yy=py-j;
+ yy=_py-j;
yy=yy*yy;
for (k=minZ; k<=maxZ; k++)
{
// if ((i>=_minX) && (i<=_maxX) && (j>=_minY) && (j<=_maxY) && (k>=_minZ) && (k<=_maxZ))
// {
- zz=pz-k;
+ zz=_pz-k;
zz=zz*zz;
if (_brushform==0)
{
}
//---------------------------------------------------------------------------
-void BrushFilter::Set(int px,int py, int pz)
+void BrushFilter::SetPoint(int px,int py, int pz)
{
_px=px;
_py=py;
_pz=pz;
}
-*/
+
-/*
-#include "ManualPaintModel.h"
+#include "FillFilter.h"
-ManualPaintModel::ManualPaintModel()
+
+FillFilter::FillFilter()
{
_graylevel = 0.0;
- _brushsize = 1;
- _brushform = 0; // 0 rectangle-box , 1 circle-sphere
_2D3D = 1; // 0 2D , 1 true 3D
- _brushtool = 0; // 0 pencil , 1 fill
_direction = 0; // 1 XZ , 0 YZ , 2 XY
_tolerancefill = 50;
_distancefill = 500;
}
//---------------------------------------------------------------------------
-ManualPaintModel::~ManualPaintModel()
+FillFilter::~FillFilter()
{
if (_auxImageFill!=NULL)
{
}
//---------------------------------------------------------------------------
-void ManualPaintModel::SetImage(vtkImageData *image)
+void FillFilter::SetImage(vtkImageData *image)
{
_image=image;
}
//---------------------------------------------------------------------------
-void ManualPaintModel::PaintImage(int px,int py, int pz)
-{
- if (_brushtool==0)
- {
- BrushTool(px,py,pz);
- }
- if (_brushtool==1)
- {
- FillTool(px,py,pz);
- }
-}
-
-
-//---------------------------------------------------------------------------
-void ManualPaintModel::FillTool(int px,int py, int pz)
+void FillFilter::FillTool(int px,int py, int pz)
{
if ((px>=_minX) && (px<=_maxX) && (py>=_minY) && (py<=_maxY) && (pz>=_minZ) && (pz<=_maxZ))
{
//---------------------------------------------------------------------------
-void ManualPaintModel::FillToolRecursive(int px,int py, int pz)
+void FillFilter::FillToolRecursive(int px,int py, int pz)
{
_countRecursiveFill++;
}
//---------------------------------------------------------------------------
-void ManualPaintModel::SetAuxImageFill(int px,int py, int pz)
+void FillFilter::SetAuxImageFill(int px,int py, int pz)
{
if ((px>=_minX) && (px<=_maxX) && (py>=_minY) && (py<=_maxY) && (pz>=_minZ) && (pz<=_maxZ))
{
}
//---------------------------------------------------------------------------
-void ManualPaintModel::BrushTool(int px,int py, int pz)
+void FillFilter::BrushTool(int px,int py, int pz)
{
if (_image!=NULL)
{
}
-//---------------------------------------------------------------------------
-void ManualPaintModel::SetBrushSize( int brushsize )
-{
- _brushsize = brushsize;
-}
//---------------------------------------------------------------------------
-void ManualPaintModel::SetGrayLevel( double graylevel )
+void FillFilter::SetGrayLevel( double graylevel )
{
_graylevel = graylevel;
}
-//---------------------------------------------------------------------------
-void ManualPaintModel::SetBrushForm( int brushform )
-{
- _brushform = brushform;
-}
-//---------------------------------------------------------------------------
-void ManualPaintModel::SetBrushTool( int brushtool )
-{
- _brushtool = brushtool;
-}
//---------------------------------------------------------------------------
-void ManualPaintModel::Set2D3D( int dim2D3D )
+void FillFilter::Set2D3D( int dim2D3D )
{
_2D3D = dim2D3D;
}
//---------------------------------------------------------------------------
-void ManualPaintModel::SetToleranceFill(double tolerancefill)
+void FillFilter::SetToleranceFill(double tolerancefill)
{
_tolerancefill = tolerancefill;
}
//---------------------------------------------------------------------------
-void ManualPaintModel::SetDistanceFill(int distancefill)
+void FillFilter::SetDistanceFill(int distancefill)
{
_distancefill = distancefill;
}
//---------------------------------------------------------------------------
-void ManualPaintModel::SetDirection(int direction)
+void FillFilter::SetDirection(int direction)
{
_direction = direction;
}
-*/
+