-#include <vtkActor.h>
+#include <vtkActor.h>
#include <vtkProperty.h>
#include <vtkCellArray.h>
// ----------------------------------------------------------------------------
-manualContourModelCircle * manualContourModelCircle :: Clone() // virtual
+manualContourModelCircle * manualContourModelCircle :: Clone() // virtual
{
manualContourModelCircle * clone = new manualContourModelCircle();
CopyAttributesTo(clone);
}
//----------------------------------------------------------------
-int manualContourModelCircle::GetTypeModel() //virtual
+int manualContourModelCircle::GetTypeModel() //virtual
{
return 3;
}
// ----------------------------------------------------------------------------
-manualContourModelBullEye * manualContourModelBullEye :: Clone() // virtual
+manualContourModelBullEye * manualContourModelBullEye :: Clone() // virtual
{
manualContourModelBullEye * clone = new manualContourModelBullEye();
CopyAttributesTo(clone);
}
//----------------------------------------------------------------
-int manualContourModelBullEye::GetTypeModel() //virtual
+int manualContourModelBullEye::GetTypeModel() //virtual
{
return 4;
}
}
//----------------------------------------------------------------
-void manualContourModelBullEye::GetSector(int id,
+void manualContourModelBullEye::GetSector(int id,
double *radioA,
double *radioB,
double *ang,
//----------------------------------------------------------------
void manualContourModelBullEye::Save(FILE *ff) // virtual
{
- manualContourModel::Save(ff);
+ manualContourModel::Save(ff);
int i,size = GetSizeOfSectorLst();
fprintf(ff,"numberOfSections %d \n",size);
for ( i=0 ; i<size ; i++ )
//----------------------------------------------------------------
void manualContourModelBullEye::Open(FILE *ff) // virtual
{
- manualContourModel::Open(ff);
+ manualContourModel::Open(ff);
ResetSectors();
fscanf(ff,"%s",tmp); // NumberOfSections
fscanf(ff,"%s",tmp); // ##
- numberOfSections = atoi(tmp);
+ numberOfSections = atoi(tmp);
for (i=0;i<numberOfSections;i++)
{
AddSector(0,1,90,0);
// ----------------------------------------------------------------------------
-manualContourModelBullEyeSector * manualContourModelBullEyeSector :: Clone() // virtual
+manualContourModelBullEyeSector * manualContourModelBullEyeSector :: Clone() // virtual
{
manualContourModelBullEyeSector * clone = new manualContourModelBullEyeSector();
CopyAttributesTo(clone);
}
//----------------------------------------------------------------
-int manualContourModelBullEyeSector::GetTypeModel() //virtual
+int manualContourModelBullEyeSector::GetTypeModel() //virtual
{
return 5;
}
}
//----------------------------------------------------------------
-void manualContourModelBullEyeSector::GetSector(
+void manualContourModelBullEyeSector::GetSector(
double *radioA,
double *radioB,
double *ang,
//----------------------------------------------------------------
void manualContourModelBullEyeSector::Save(FILE *ff) // virtual
{
- manualContourModel::Save(ff);
+ manualContourModel::Save(ff);
fprintf(ff,"rA= %f rB= %f ang= %f deltaAng= %f\n", _radioA,_radioB, _ang , _angDelta);
}
fscanf(ff,"%s",tmp); // TypeModel
fscanf(ff,"%s",tmp); // ##
- manualContourModel::Open(ff);
+ manualContourModel::Open(ff);
fscanf(ff,"%s",tmp); // radioA=
fscanf(ff,"%s",tmp); // radioA
- _radioA = atof(tmp);
+ _radioA = atof(tmp);
fscanf(ff,"%s",tmp); // radioB=
fscanf(ff,"%s",tmp); // radioB
- _radioB = atof(tmp);
+ _radioB = atof(tmp);
fscanf(ff,"%s",tmp); // ang=
fscanf(ff,"%s",tmp); // ang
- _ang = atof(tmp);
+ _ang = atof(tmp);
fscanf(ff,"%s",tmp); // deltaAng=
fscanf(ff,"%s",tmp); // deltaAng
- _angDelta = atof(tmp);
+ _angDelta = atof(tmp);
}
// ----------------------------------------------------------------------------
-manualContourModelRoi * manualContourModelRoi :: Clone() // virtual
+manualContourModelRoi * manualContourModelRoi :: Clone() // virtual
{
manualContourModelRoi * clone = new manualContourModelRoi();
CopyAttributesTo(clone);
}
//----------------------------------------------------------------
-int manualContourModelRoi::GetTypeModel() //virtual
+int manualContourModelRoi::GetTypeModel() //virtual
{
return 2;
}
this->SetCloseContour(true);
- _cntSplineX->SetDefaultTension( 0 );
- _cntSplineX->SetDefaultBias( 0 );
- _cntSplineX->SetDefaultContinuity( 0 );
+ _cntSplineX->SetDefaultTension( 0 );
+ _cntSplineX->SetDefaultBias( 0 );
+ _cntSplineX->SetDefaultContinuity( 0 );
- _cntSplineY->SetDefaultTension( 0 );
- _cntSplineY->SetDefaultBias( 0 );
+ _cntSplineY->SetDefaultTension( 0 );
+ _cntSplineY->SetDefaultBias( 0 );
_cntSplineY->SetDefaultContinuity( 0 );
- _cntSplineZ->SetDefaultTension( 0 );
- _cntSplineZ->SetDefaultBias( 0 );
+ _cntSplineZ->SetDefaultTension( 0 );
+ _cntSplineZ->SetDefaultBias( 0 );
_cntSplineZ->SetDefaultContinuity( 0 );
//JSTG 25-02-08 -------------------------------------------------------------------------------------------------
//manualPoint *mp = new manualPoint();
//mp->SetPoint(x,y,z);
//std::vector<manualPoint*>::iterator itNum = _lstPoints.begin() + ibak;
- //_lstPoints.insert(itNum,mp);
+ //_lstPoints.insert(itNum,mp);
InsertPoint_id(ibak,x,y,z);
//----------------------------------------------------------------------------
// type=0 x,y
// type=1 y,z
// type=2 x,z
-int manualContourModel::GetIdPoint(double x, double y, double z, int i_range,int type)
+int manualContourModel::GetIdPoint(double x, double y, double z, int i_range,int type)
{
double range = i_range+1;
if (type==-1)
{
if ((fabs(xx-x)<range) && (fabs(yy-y)<range) && (fabs(zz-z)<range)) {
- dd=sqrt( (xx-x)*(xx-x) + (yy-y)*(yy-y) + (zz-z)*(zz-z) );
+ dd=sqrt( (xx-x)*(xx-x) + (yy-y)*(yy-y) + (zz-z)*(zz-z) );
if (dd<ddmin){
ddmin=dd;
ibak=i;
if (type==0)
{
if ((fabs(yy-y)<range) && (fabs(zz-z)<range)) {
- dd=sqrt( (yy-y)*(yy-y) + (zz-z)*(zz-z) );
+ dd=sqrt( (yy-y)*(yy-y) + (zz-z)*(zz-z) );
if (dd<ddmin){
ddmin=dd;
ibak=i;
if (type==1)
{
if ((fabs(xx-x)<range) && (fabs(zz-z)<range)) {
- dd=sqrt( (xx-x)*(xx-x) + (zz-z)*(zz-z) );
+ dd=sqrt( (xx-x)*(xx-x) + (zz-z)*(zz-z) );
if (dd<ddmin){
ddmin=dd;
ibak=i;
if (type==2)
{
if ((fabs(xx-x)<range) && (fabs(yy-y)<range) ) {
- dd=sqrt( (xx-x)*(xx-x) + (yy-y)*(yy-y) );
+ dd=sqrt( (xx-x)*(xx-x) + (yy-y)*(yy-y) );
if (dd<ddmin){
ddmin=dd;
ibak=i;
_closeContour = closeContour;
if (_closeContour==true)
{
- _cntSplineX->ClosedOn();
+ _cntSplineX->ClosedOn();
_cntSplineY->ClosedOn();
_cntSplineZ->ClosedOn();
} else {
- _cntSplineX->ClosedOff();
+ _cntSplineX->ClosedOff();
_cntSplineY->ClosedOff();
_cntSplineZ->ClosedOff();
}
/*void manualContourModel::GetSplineiPoint(int i, double &x, double &y, double &z)
{
- double delta=(double)(_lstPoints.size()) / (double)(_sizePointsContour);
+ double delta=(double)(_lstPoints.size()) / (double)(_sizePointsContour);
double t = delta*(double)i;
GetSplinePoint(t, x, y, z);
}*/
}
if (_lstPoints.size()>=2)
{
- *x = _cntSplineX->Evaluate(t);
- *y = _cntSplineY->Evaluate(t);
- *z = _cntSplineZ->Evaluate(t);
+ *x = _cntSplineX->Evaluate(t);
+ *y = _cntSplineY->Evaluate(t);
+ *z = _cntSplineZ->Evaluate(t);
}
}
}
if (_lstPoints.size()>=2)
{
- x = _cntSplineX->Evaluate(t);
- y = _cntSplineY->Evaluate(t);
- z = _cntSplineZ->Evaluate(t);
+ x = _cntSplineX->Evaluate(t);
+ y = _cntSplineY->Evaluate(t);
+ z = _cntSplineZ->Evaluate(t);
}
}*/
// ----------------------------------------------------------------------------
if (_lstPoints.size()>2)
{
-// JSTG 25-02-08 ------------------------------------------
+// JSTG 25-02-08 ------------------------------------------
//np = _lstPoints.size( );
- //nps = 200;
+ //nps = 200;
//delta=( double ) ( np ) / ( double ) ( nps );
UpdateSpline();
//GetSplinePoint(0,x1,y1,z1);
x1=x2;
y1=y2;
z1=z2;
- }// for
+ }// for
}
return result;
double x2,y2,z2;
bool okArea=true;
int i, j;
-
+
// This uses Green's theorem:
// A = 1/2 * sum( xiyi+1 - xi+1yi); pO == pN
// A < 0 -> A = |A| (a negative value could raise because points are
int nps = GetNumberOfPointsSpline();
//double delta=( double ) ( np ) / ( double ) ( nps );
UpdateSpline();
- for( i = 0, area = 0.0; i < nps; i++ )
+ for( i = 0, area = 0.0; i < nps; i++ )
{
j = ( i + 1 ) % nps;
//ti = delta * (double)i;
{
okArea=false;
}
- }// for
+ }// for
area /= 2.0;
area = fabs( area );
/*
- for( i = 0, area = 0.0; i < _lstPoints.size(); i++ )
+ for( i = 0, area = 0.0; i < _lstPoints.size(); i++ )
{
j = ( i + 1 ) % _lstPoints.size();
// Area
}
// ----------------------------------------------------------------------------
-// p[x,y,z] : data in
-// rp[x,y,z] : data out result point
+// p[x,y,z] : data in
+// rp[x,y,z] : data out result point
// rn[x,y,z] : data out result normal
void manualContourModel::GetNearestPointAndNormal(double *p, double *rp, double *rn)
if (np>=2)
{
// JSTG 25-02-08 ------------------------------------------
- //nps = 200;
+ //nps = 200;
nps = GetNumberOfPointsSpline();
//delta = ( double ) ( np ) / ( double ) ( nps );
UpdateSpline();
//GetSplinePoint(0,x1,y1,z1);
GetSpline_i_Point(0,&x1,&y1,&z1);
- for( i = 0; i < nps; i++ )
+ for( i = 0; i < nps; i++ )
{
//t = delta * (double)i;
//GetSplinePoint(t,x1,y1,z1);
dy= y1-p[1];
dz= z1-p[2];
dist = sqrt( dx*dx + dy*dy + dz*dz );
- if (dist<distMin)
+ if (dist<distMin)
{
distMin = dist;
//JSTG tback = t;
x2=x1;
y2=y1;
z2=z1;
- }// for
+ }// for
// JSTG 25-02-08 ------------------------------------------
//if (tback==0)
rn[1]=rp[1]-y1;
rn[2]=rp[2]-z1;
}
- }
- else
+ }
+ else
{
rp[0] = 0;
rp[1] = 0;
fscanf(ff,"%s",tmp); // NumberOfControlPoints
fscanf(ff,"%s",tmp); // ##
- numberOfControlPoints = atoi(tmp);
+ numberOfControlPoints = atoi(tmp);
for (i=0;i<numberOfControlPoints;i++)
{
fscanf(ff,"%s",tmp); // X
- x = atof(tmp);
+ x = atof(tmp);
fscanf(ff,"%s",tmp); // Y
- y = atof(tmp);
+ y = atof(tmp);
fscanf(ff,"%s",tmp); // Z
- z = atof(tmp);
+ z = atof(tmp);
AddPoint(x,y,z);
}
}
// ----------------------------------------------------------------------------
-int manualContourModel::GetTypeModel() //virtual
+int manualContourModel::GetTypeModel() //virtual
{
// 0 spline
// 1 spline
{
cloneObject->AddManualPoint( GetManualPoint( i )->Clone() );
}
- cloneObject->SetNumberOfPointsSpline( GetNumberOfPointsSpline () );
+ cloneObject->SetNumberOfPointsSpline( GetNumberOfPointsSpline () );
cloneObject->SetCloseContour( _closeContour );
cloneObject->UpdateSpline();
}
}
// ----------------------------------------------------------------------------
void manualViewPoint::SetPosibleSelected(bool posibleSelected){
- _posibleSelected=posibleSelected;
+ _posibleSelected=posibleSelected;
}
// ----------------------------------------------------------------------------
bool manualViewPoint::GetSelected(){
{
// Call to Fathers object
manualViewBaseContour::CopyAttributesTo(cloneObject);
-
+
cloneObject->SetMesureScale(_mesureScale);
}
_manContModel->UpdateSpline();
np = GetNumberOfPoints( );
- //nps = GetNumberOfPointsSpline();
- nps = _manContModel->GetNumberOfPointsSpline();
+ //nps = GetNumberOfPointsSpline();
+ nps = _manContModel->GetNumberOfPointsSpline();
//delta=( double ) ( np ) / ( double ) ( nps-1 ); //JSTG 25-02-08
//printf ("EED manualViewContour::RefreshContour>> %d %d \n", np,nps);
{
if (np>=2 )
{
- for( i = 0; i < nps; i++ )
+ for( i = 0; i < nps; i++ )
{
-//JSTG 25-02-08 ------------------------------------------------
+//JSTG 25-02-08 ------------------------------------------------
//t = delta * (double)i;
//_manContModel->GetSplinePoint(t,x,y,z);
_manContModel->GetSpline_i_Point(i,&x,&y,&z);
//--------------------------------------------------------------
// EED 27 sep 2006
- // _pts->SetPoint(i, x,y,z );
- _pts->SetPoint(i , x*_spc[0] , y*_spc[1] , z*_spc[2] );
+ // _pts->SetPoint(i, x,y,z );
+ _pts->SetPoint(i , x*_spc[0] , y*_spc[1] , z*_spc[2] );
//if (i%15==0)
//{
// printf ("EED manualViewContour::RefreshContour>> %d : %f %f %f \n", i,x,y,z);
//}
- }// for
- }
- else
+ }// for
+ }
+ else
{
- _pts->SetPoint(0, 0 , 0 , 0);
- _pts->SetPoint(1, 0 , 0 , 0);
+ _pts->SetPoint(0, 0 , 0 , 0);
+ _pts->SetPoint(1, 0 , 0 , 0);
} // if
}
}
unsigned int i, nps,nps_t;
- nps = _sizePointsContour;
- if (this->_manContModel->IfCloseContour()==true)
+ nps = _sizePointsContour;
+ if (this->_manContModel->IfCloseContour()==true)
{
- nps_t = nps;
+ nps_t = nps;
} else {
- nps_t = nps-1;
+ nps_t = nps-1;
}
for( i = 0; i < nps_t; i++ ) {
result=true;
i=nps;
}
- }
+ }
return result;
}
// ----------------------------------------------------------------------------
-void manualViewContour::DeletePoint(int id) // virtual
+void manualViewContour::DeletePoint(int id) // virtual
{
if (_lstViewPoints.size()>2)
{
void manualViewContour::InitMove(int x, int y, int z)
{
_initialConoturModel->DeleteAllPoints();
-
+
manualPoint *mp = NULL;
double XX=x;
double YY=y;
double ZZ=z;
TransfromeCoordViewWorld(XX,YY,ZZ);
-
+
int i, manualPointsSZ = _manContModel->GetSizeLstPoints();
for ( i=0; i<manualPointsSZ; i++ )
{
mp = _manContModel->GetManualPoint( i );
this->_initialConoturModel->AddPoint( mp->GetX() - XX, mp->GetY() - YY, mp->GetZ() );
- }
+ }
}
//-------------------------------------------------------------------
void manualViewContour::MoveContour(int x, int y, int z)
double XX=x;
double YY=y;
double ZZ=z;
-
+
TransfromeCoordViewWorld(XX,YY,ZZ);
int i, manualPointsSZ = _manContModel->GetSizeLstPoints();
mpOrigin = _manContModel->GetManualPoint( i );
mpMoving = _initialConoturModel->GetManualPoint(i);
mpOrigin->SetPoint( mpMoving->GetX()+XX, mpMoving->GetY() + YY, mpMoving->GetZ() );
- }
- UpdateViewPoints();
+ }
+ UpdateViewPoints();
}
void manualViewContour::MoveContour(int horizontalUnits, int verticalUnits )
{
{
mpOrigin = _manContModel->GetManualPoint( i );
mpOrigin->SetPoint( mpOrigin->GetX()+horizontalUnits, mpOrigin->GetY()+verticalUnits, mpOrigin->GetZ() );
- }
- UpdateViewPoints();
+ }
+ UpdateViewPoints();
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
//int nps = GetNumberOfPointsSpline();
int nps = _manContModel->GetNumberOfPointsSpline();
//-------------------------------------------------------
- for( i = 0; i < nps; i++ )
+ for( i = 0; i < nps; i++ )
{
_pts->GetPoint( i, pp );
FilterCordinateXYZ(pp[0],pp[1],pp[2]);
//EED 27 sep 2006
- _pts->SetPoint( i, pp[0] , pp[1] ,pp[2] );
+ _pts->SetPoint( i, pp[0] , pp[1] ,pp[2] );
}
}
zz = zz * _spc[2];
unsigned int i, nps,nps_t;
- nps = _sizePointsContour;
- if (this->_manContModel->IfCloseContour()==true)
+ nps = _sizePointsContour;
+ if (this->_manContModel->IfCloseContour()==true)
{
- nps_t = nps;
+ nps_t = nps;
} else {
- nps_t = nps-1;
+ nps_t = nps-1;
}
FilterCordinateXYZ(xx,yy,zz);
result=true;
i=nps;
}
- }
+ }
return result;
}
// ----------------------------------------------------------------------------
double p[3],pA[3],pB[3];
double pickPoint[ 3 ], cameraPos[ 3 ];
- vtkPointPicker* picker = vtkPointPicker::New( );
+ vtkPointPicker* picker = vtkPointPicker::New( );
vtkRenderer *pRenderer = this->GetWxVtkBaseView()->GetRenderer();
picker->Pick( x, y, 0.0, pRenderer );
pRenderer->GetActiveCamera( )->GetPosition( cameraPos );
UtilVtk3DGeometriSelection utilVtk3Dgeometriselection;
utilVtk3Dgeometriselection.SetDimentions(_w,_h,_d);
- if( utilVtk3Dgeometriselection.FindCubePointsFromPoints( pA, pB, pickPoint, cameraPos ) )
+ if( utilVtk3Dgeometriselection.FindCubePointsFromPoints( pA, pB, pickPoint, cameraPos ) )
{
double dist,distMin=999999999;
int i,size=this->_manContModel->GetSizeLstPoints();
//----------------------------------
_manContModel->UpdateSpline();
- nps = _manContModel->GetNumberOfPointsSpline();
+ nps = _manContModel->GetNumberOfPointsSpline();
if ( _pts!=NULL )
{
- for( i = 0; i < nps; i++ )
+ for( i = 0; i < nps; i++ )
{
_manContModel->GetSpline_i_Point(i,&x,&y,&z);
- _pts->SetPoint(i , x*_spc[0] , y*_spc[1] , z*_spc[2] );
- }// for
+ _pts->SetPoint(i , x*_spc[0] , y*_spc[1] , z*_spc[2] );
+ }// for
}
}
// ----------------------------------------------------------------------------
void manualViewBullEye::RefreshContour() // virtual
-{
+{
// External Rectangle
manualViewRoi::RefreshContour();
// wxvtk2Dbasevie->TransformCoordinate_spacing_ModelToView(XX,YY,ZZ);
//EED 27 sep 2007
- // _pts->SetPoint(i, XX,YY,ZZ );
- _pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] );
+ // _pts->SetPoint(i, XX,YY,ZZ );
+ _pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] );
} // rof
} else {
- _pts->SetPoint(0, 0 , 0 , 0);
- _pts->SetPoint(1, 0 , 0 , 0);
+ _pts->SetPoint(0, 0 , 0 , 0);
+ _pts->SetPoint(1, 0 , 0 , 0);
} // if
}
}
void manualViewRoi::GetMinMax(double &minX,double &minY, double &maxX, double &maxY)
{
double pp[3];
- manualPoint *mp;
+ manualPoint *mp;
unsigned int i;
-
+
minX=99999;
minY=99999;
maxX=-99999;
unsigned int size=(unsigned int) _manContModel->GetSizeLstPoints();
- for( i = 0; i < size; i++ )
+ for( i = 0; i < size; i++ )
{
mp=_manContModel->GetManualPoint(i);
pp[0]=mp->GetX();
pp[1]=mp->GetY();
-
+
// min X
- if (pp[0]<minX)
+ if (pp[0]<minX)
{
minX=pp[0];
}
//min Y
- if (pp[1]<minY)
+ if (pp[1]<minY)
{
minY=pp[1];
}
//max X
- if (pp[0]>maxX)
+ if (pp[0]>maxX)
{
maxX=pp[0];
}
// max Y
- if (pp[1]>maxY)
+ if (pp[1]>maxY)
{
maxY=pp[1];
}
minY=0;
maxY=0;
}
-}
+}
// ----------------------------------------------------------------------------
-bool manualViewRoi::ifTouchContour(int x,int y, int z) // virtual
+bool manualViewRoi::ifTouchContour(int x,int y, int z) // virtual
{
bool result=false;
double px1=99999,py1=99999,px2=-9999,py2=-99999;
// ----------------------------------------------------------------------------
-void manualViewRoi::MoveContour(int x, int y, int z) // virtual
+void manualViewRoi::MoveContour(int x, int y, int z) // virtual
{
manualPoint *mp;
double XX=x;
UpdateViewPoint(0);
UpdateViewPoint(1);
UpdateViewPoint(2);
- UpdateViewPoint(3);
+ UpdateViewPoint(3);
}
// XX = cos(angle)*radio+mpA->GetX();
// YY = sin(angle)*radio+mpA->GetY();
ZZ = mpA->GetZ();
- _pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] );
+ _pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] );
} // rof
} else {
- _pts->SetPoint(0, 0 , 0 , 0);
- _pts->SetPoint(1, 0 , 0 , 0);
+ _pts->SetPoint(0, 0 , 0 , 0);
+ _pts->SetPoint(1, 0 , 0 , 0);
} // if
}
}
minY=0;
maxY=0;
}
-}
+}
/*
// ----------------------------------------------------------------------------
-bool manualViewCircle::ifTouchContour(int x,int y, int z) // virtual
+bool manualViewCircle::ifTouchContour(int x,int y, int z) // virtual
{
bool result=false;
double px1=99999,py1=99999,px2=-9999,py2=-99999;
// ----------------------------------------------------------------------------
-void manualViewCircle::MoveContour(int x, int y, int z) // virtual
+void manualViewCircle::MoveContour(int x, int y, int z) // virtual
{
manualPoint *mp;
double XX=x;
UpdateViewPoint(0);
UpdateViewPoint(1);
// UpdateViewPoint(2);
-// UpdateViewPoint(3);
+// UpdateViewPoint(3);
}
manualViewBaseContour::manualViewBaseContour()
{
- _show_text = true;
+ _show_text = true;
_textActor = NULL;
_manContModel = NULL;
_wxvtkbaseview = NULL;
_coulorEdit_g = 1;
_coulorEdit_b = 0;
- _coulorNormal_r = 1;
+ _coulorNormal_r = 1;
_coulorNormal_g = 0;
_coulorNormal_b = 1;
// ---------------------------------------------------------------------------
void manualViewBaseContour :: RemoveCompleteContourActor()
-{
+{
/*vtkRenderer * theRenderer =*/ _wxvtkbaseview->GetRenderer(); // JPRx ??
//Removing the spline
RemoveSplineActor();
RemoveTextActor();
-
+
//Removing each point
RemoveControlPoints();
RefreshContour();
{
// Fathers object
//XXXX::CopyAttributesTo(cloneObject);
-
+
cloneObject-> SetWxVtkBaseView( this->_wxvtkbaseview );
cloneObject-> SetSelected( this->GetSelected() );
cloneObject-> SetPosibleSelected( this->GetPosibleSelected() );
cloneObject-> SetSpacing( _spc );
cloneObject-> SetColorNormalContour( _coulorNormal_r, _coulorNormal_g, _coulorNormal_b );
cloneObject-> SetColorEditContour( _coulorEdit_r, _coulorEdit_g, _coulorEdit_b );
- cloneObject-> SetColorSelectContour( _coulorSelection_r, _coulorSelection_g, _coulorSelection_b );
+ cloneObject-> SetColorSelectContour( _coulorSelection_r, _coulorSelection_g, _coulorSelection_b );
- int i, size = _lstViewPoints.size();
+ int i, size = _lstViewPoints.size();
for ( i=0; i<size; i++ )
{
cloneObject->AddPoint( );
}
// ----------------------------------------------------------------------------
void manualViewBaseContour :: RemoveControlPoints()
-{
+{
if (_wxvtkbaseview!=NULL){
vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
int i,size=_lstViewPoints.size();
{
vtkActor * pointActor = _lstViewPoints[i]->GetVtkActor();
theRenderer->RemoveActor( pointActor );
- } // for
+ } // for
} // if
- SetIfViewControlPoints( false );
+ SetIfViewControlPoints( false );
}
// ----------------------------------------------------------------------------
void manualViewBaseContour :: AddControlPoints()
{
vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
- SetIfViewControlPoints( true );
+ SetIfViewControlPoints( true );
if( _viewControlPoints )
{
int i,size=_lstViewPoints.size();
{
vtkActor * pointActor = _lstViewPoints[i]->GetVtkActor();
theRenderer->AddActor( pointActor );
- }
+ }
}
}
// ----------------------------------------------------------------------------
{
//JSTG 29-02-08 -----------------------------------------------
//int i , nps = _sizePointsContour;
- int i;
+ int i;
int nps = _manContModel->GetNumberOfPointsSpline();
//-------------------------------------------------------------
DeleteVtkObjects();
for (i=0 ; i<nps ; i++){
_pts->SetPoint(i, 0 , 0 , 0 );
- }
- // This is for the boundaring inicialisation
+ }
+ // This is for the boundaring inicialisation
_pts->SetPoint(0, -1000 , -1000 , -1000 );
_pts->SetPoint(1, 1000 , 1000 , 1000 );
vtkTextProperty *tprop = _textActor->GetTextProperty();
tprop->SetFontSize(14);
tprop->SetFontFamilyToArial();
- tprop->SetColor(0, 0, 1);
+ tprop->SetColor(0, 0, 1);
}
// ----------------------------------------------------------------------------
void manualViewBaseContour::CreateNewContour()
}
// ----------------------------------------------------------------------------
void manualViewBaseContour::UpdateViewPoint(int id) // virtual
-{
+{
manualPoint *mp = _manContModel->GetManualPoint(id);
//EEDx6
Refresh();
}
// ----------------------------------------------------------------------------
-void manualViewBaseContour::DeletePoint(int id) // virtual
-{
+void manualViewBaseContour::DeletePoint(int id) // virtual
+{
int size=_lstViewPoints.size();
if ( (id>=0) && (id<size) ){
manualViewPoint *mvp =_lstViewPoints[id];
// ----------------------------------------------------------------------------
void manualViewBaseContour::SetPosibleSelected(bool posibleSelected)
{
- _posibleSelected=posibleSelected;
+ _posibleSelected=posibleSelected;
}
// ----------------------------------------------------------------------------
bool manualViewBaseContour::GetEditable()
}
//-----------------------------------------------------------------------------
void manualViewBaseContour:: SetIfViewControlPoints(bool ifShow)
-{
- _viewControlPoints = ifShow;
+{
+ _viewControlPoints = ifShow;
}
// ----------------------------------------------------------------------------
bool manualViewBaseContour:: GetIfViewControlPoints()
SetPosibleSelected(result);
}
}
-
+
}
return result;
for (i=0;i<size;i++){
_pts->GetPoint(i,pp);
vx[i]=pp[0];
- }
+ }
return vx;
}
// ----------------------------------------------------------------------------
for (i=0;i<size;i++){
_pts->GetPoint(i,pp);
vy[i]=pp[1];
- }
+ }
return vy;
}
// ----------------------------------------------------------------------------
for (i=0;i<size;i++){
_pts->GetPoint(i,pp);
vz[i]=pp[2];
- }
+ }
return vz;
}
// ----------------------------------------------------------------------------
}
UpdateColorActor();
- if (_show_text==true)
+ if (_show_text==true)
{
RefreshText();
}
//EED 27 sep 2007
// //EEDx6
// wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*)_wxvtkbaseview;
-// wxvtk2Dbaseview->TransformCoordinate_spacing_ModelToView(X,Y,Z);
+// wxvtk2Dbaseview->TransformCoordinate_spacing_ModelToView(X,Y,Z);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
void manualViewBaseContour::MoveContour(int x, int y, int z) // virtual
-{
+{
}
// ----------------------------------------------------------------------------
void manualViewBaseContour::MoveContour(int horizontalUnits, int verticalUnits )// virtual
void manualViewBaseContour::GetMinMax( double &minX,double &minY, double &minZ, double &maxX, double &maxY, double &maxZ )// virtual
{
double pp[3];
- manualPoint *mp;
+ manualPoint *mp;
int i;
int size=_manContModel->GetSizeLstPoints();
minX=99999;
minZ=99999;
maxZ=-99999;
}
- for( i = 0; i < size; i++ )
+ for( i = 0; i < size; i++ )
{
mp=_manContModel->GetManualPoint(i);
pp[0]=mp->GetX();
pp[1]=mp->GetY();
if ( ifFindZ )
pp[2]=mp->GetZ();
-
+
// min X
- if (pp[0]<minX)
+ if (pp[0]<minX)
{
minX=pp[0];
}
//min Y
- if (pp[1]<minY)
+ if (pp[1]<minY)
{
minY=pp[1];
}
//max X
- if (pp[0]>maxX)
+ if (pp[0]>maxX)
{
maxX=pp[0];
}
// max Y
- if (pp[1]>maxY)
+ if (pp[1]>maxY)
{
maxY=pp[1];
}
if ( ifFindZ )
{
// min Z
- if (pp[2]<minZ)
+ if (pp[2]<minZ)
{
minZ=pp[2];
}
// max Z
- if (pp[2]>maxZ)
+ if (pp[2]>maxZ)
{
maxZ=pp[2];
}
- }
+ }
}
if ( size<1 )
{
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-// _type = 0 Sagital
-// _type = 1 Coronal
-// _type = 2 Axial
+// _type = 0 Sagital
+// _type = 1 Coronal
+// _type = 2 Axial
// _type = -1 View 3D
manualContour3VControler::manualContour3VControler(int type)
}
// ----------------------------------------------------------------------------
-manualContour3VControler * manualContour3VControler :: Clone() // virtual
+manualContour3VControler * manualContour3VControler :: Clone() // virtual
{
manualContour3VControler * clone = new manualContour3VControler( this->GetType() );
CopyAttributesTo(clone);
int i,size=this->_lstManualViewBaseContour.size();
for ( i = 0 ; i < size ; i++ )
{
- mvbc = _lstManualViewBaseContour[i];
+ mvbc = _lstManualViewBaseContour[i];
mvbc->AddPoint();
}
// EEDhh
// if (_manViewBaseCont1!=NULL){
-// _manViewBaseCont1->AddPoint();
-// _manViewBaseCont2->AddPoint();
+// _manViewBaseCont1->AddPoint();
+// _manViewBaseCont2->AddPoint();
// _manViewBaseCont3->AddPoint();
// this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
// }
/*int id = */ GetManualContourModel()->AddPoint(xx,yy,zz); // JPRx
- GetManualViewBaseContour()->AddPoint();
+ GetManualViewBaseContour()->AddPoint();
AddPoint_Others();
}
int i,size=this->_lstManualViewBaseContour.size();
for ( i = 0 ; i < size ; i++ )
{
- mvbc = _lstManualViewBaseContour[i];
+ mvbc = _lstManualViewBaseContour[i];
mvbc->InsertPoint(id);
}
/*EEDhh
if (_manViewBaseCont1!=NULL){
- _manViewBaseCont1->InsertPoint(id);
- _manViewBaseCont2->InsertPoint(id);
- _manViewBaseCont3->InsertPoint(id);
+ _manViewBaseCont1->InsertPoint(id);
+ _manViewBaseCont2->InsertPoint(id);
+ _manViewBaseCont3->InsertPoint(id);
this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
}
*/
if (_type==0)
{
xx=_vtkmprbasedata->GetX();
- }
+ }
if (_type==1)
{
id = GetManualContourModel()->InsertPoint(xx,yy,zz);
- GetManualViewBaseContour()->InsertPoint(id);
- InsertPoint_Others(0);
+ GetManualViewBaseContour()->InsertPoint(id);
+ InsertPoint_Others(0);
} else {
- AddPoint(x,y,z);
+ AddPoint(x,y,z);
}
}
}
// EEDhh
/*
-void manualContour3VControler::SetModelView ( manualContourModel *manContModel,
- manualViewBaseContour *manViewBaseCont0,
- manualViewBaseContour *manViewBaseCont1,
+void manualContour3VControler::SetModelView ( manualContourModel *manContModel,
+ manualViewBaseContour *manViewBaseCont0,
+ manualViewBaseContour *manViewBaseCont1,
manualViewBaseContour *manViewBaseCont2,
manualViewBaseContour *manViewBaseCont3)
{
int i,size=this->_lstManualViewBaseContour.size();
for ( i = 0 ; i < size ; i++ )
{
- mvbc = _lstManualViewBaseContour[i];
- mvbc->DeletePoint(id);
+ mvbc = _lstManualViewBaseContour[i];
+ mvbc->DeletePoint(id);
mvbc->Refresh();
}
/*
if (_manViewBaseCont1!=NULL){
- _manViewBaseCont1->DeletePoint(id);
- _manViewBaseCont2->DeletePoint(id);
+ _manViewBaseCont1->DeletePoint(id);
+ _manViewBaseCont2->DeletePoint(id);
_manViewBaseCont3->DeletePoint(id);
-
+
_manViewBaseCont1->Refresh();
_manViewBaseCont2->Refresh();
_manViewBaseCont3->Refresh();
-
+
this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
}
*/
}
// ----------------------------------------------------------------------------
void manualContour3VControler::DeleteActualMousePoint(int x, int y)// virtual
-{
+{
int id=GetManualViewBaseContour()->GetIdPoint ( x , y , GetZ() );
if (id!=-1){
manualContourBaseControler::DeleteActualMousePoint( x , y );
int i,size=this->_lstManualViewBaseContour.size();
for ( i = 0 ; i < size ; i++ )
{
- mvbc = _lstManualViewBaseContour[i];
+ mvbc = _lstManualViewBaseContour[i];
mvbc->SelectAllPossibleSelected(false);
if (id!=-1)
- {
+ {
mvbc->SetPointPosibleSelected(id,true);
}
- mvbc->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() );
+ mvbc->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() );
mvbc->Refresh();
}
-
+
// EEDhh
-/*
+/*
if (_manViewBaseCont1!=NULL){
_manViewBaseCont1->SelectAllPossibleSelected(false);
_manViewBaseCont2->SelectAllPossibleSelected(false);
_manViewBaseCont3->SelectAllPossibleSelected(false);
- if (id!=-1){
+ if (id!=-1){
_manViewBaseCont1->SetPointPosibleSelected(id,true);
_manViewBaseCont2->SetPointPosibleSelected(id,true);
_manViewBaseCont3->SetPointPosibleSelected(id,true);
- }
- _manViewBaseCont1->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() );
- _manViewBaseCont2->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() );
- _manViewBaseCont3->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() );
+ }
+ _manViewBaseCont1->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() );
+ _manViewBaseCont2->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() );
+ _manViewBaseCont3->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() );
_manViewBaseCont1->Refresh();
_manViewBaseCont2->Refresh();
int i,size=this->_lstManualViewBaseContour.size();
for ( i = 0 ; i < size ; i++ )
{
- mvbc = _lstManualViewBaseContour[i];
+ mvbc = _lstManualViewBaseContour[i];
mvbc->Refresh();
}
// EEDhh
int i,size=this->_lstManualViewBaseContour.size();
for ( i = 0 ; i < size ; i++ )
{
- mvbc = _lstManualViewBaseContour[i];
+ mvbc = _lstManualViewBaseContour[i];
mvbc->DeleteContour();
mvbc->CreateNewContour();
}
{
}
// ----------------------------------------------------------------------------
-manualContour3DControler * manualContour3DControler :: Clone() // virtual
+manualContour3DControler * manualContour3DControler :: Clone() // virtual
{
manualContour3DControler * clone = new manualContour3DControler();
CopyAttributesTo(clone);
manualContourControler::MouseClickLeft(x,y);
-}
+}
// ----------------------------------------------------------------------------
bool manualContour3DControler::OnChar()
{
}
// ----------------------------------------------------------------------------
-manualContour3V3DControler * manualContour3V3DControler :: Clone() // virtual
+manualContour3V3DControler * manualContour3V3DControler :: Clone() // virtual
{
manualContour3V3DControler * clone = new manualContour3V3DControler();
CopyAttributesTo(clone);
}
// ----------------------------------------------------------------------------
-void manualContour3V3DControler::ResetContour() // virtual
+void manualContour3V3DControler::ResetContour() // virtual
{
manualContourControler::ResetContour();
_manualcontour3Vcontroler->ResetContour_Others();
// _state = 0 // ..nothing..
// _state = 1 // move with add point
-// _state = 5 // move
+// _state = 5 // move
// _state = 6 // move with insert point
// _state = 7 // move with non selection
manualContourControler::manualContourControler()
{
_easyCreation = true;
-
+
}
// ----------------------------------------------------------------------------
manualContourControler::~manualContourControler()
{
}
// ----------------------------------------------------------------------------
-manualContourControler * manualContourControler :: Clone() // virtual
+manualContourControler * manualContourControler :: Clone() // virtual
{
manualContourControler * clone = new manualContourControler();
CopyAttributesTo(clone);
// ----------------------------------------------------------------------------
void manualContourControler::MouseClickLeft(int x, int y){
-
+
bool ok = false;
int z = GetZ();
int size= GetManualViewBaseContour()->GetNumberOfPoints();
//EED3131
if( IsEditable() )
{
- if ( (_vtkInteractorStyleBaseView!=NULL) && (GetState()==0) && ( (vtkrenderwindowinteractor!=NULL) && (vtkrenderwindowinteractor->GetShiftKey()==1) ) )
- {
+ if ( (_vtkInteractorStyleBaseView!=NULL) && (GetState()==0) && ( (vtkrenderwindowinteractor!=NULL) && (vtkrenderwindowinteractor->GetShiftKey()==1) ) )
+ {
ok=true;
InsertPoint(x,y,z);
size++;
}
// Start to Insert Control Points with ClickLeft (Empty contour)
if ((GetState()==0) && (size==0) && (_easyCreation==true) )
- {
+ {
ok=true;
- SetState(1);
+ SetState(1);
AddPoint(x,y,z);
}
// Continuie to Insert Control Points with ClickLeft (After being empty the contour)
- if ((GetState()==1) && (_easyCreation==true) )
- {
+ if ((GetState()==1) && (_easyCreation==true) )
+ {
ok=true;
AddPoint(x,y,z);
_bakIdPoint=GetNumberOfPointsManualContour() - 1;
}
// Insert Control Points IF Contour si Selected
- if ((GetState()==0) && GetManualViewBaseContour()->GetPosibleSelected() )
- {
+ if ((GetState()==0) && GetManualViewBaseContour()->GetPosibleSelected() )
+ {
ok=true;
InsertPoint(x,y,z);
_bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
if ( (GetState()==0 || GetState()==6) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) )
{
ok=true;
- _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+ _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
SetState(5);
}
// If nothing selected _state=7
if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)==-1 ) )
{
//ok=true;
- _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+ _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
SetState(7);
}
}
{
SetPosibleToMove( true );
GetManualViewBaseContour()->SetSelected( GetManualViewBaseContour()->GetPosibleSelected() );
- }
+ }
if ( GetState() == 0 && GetManualViewBaseContour()->GetPosibleSelected() )
- {
+ {
SetMoving( true );
- ok=true;
+ ok=true;
GetManualViewBaseContour()->InitMove(x,y,z);
SetState(6);
- }
+ }
if (ok==true)
{
GetManualViewBaseContour()->Refresh();
{
int z=GetZ();
GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
- GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
+ GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
if (GetState()==1){ SetPoint( _bakIdPoint , x , y ,z); }
if (GetState()==5){ SetPoint( _bakIdPoint , x , y ,z); }
if ( GetState()==6 && !IsEditable() && GetPosibleToMove() &&IsMoving() )
- {
+ {
GetManualViewBaseContour()->MoveContour(x,y,z);
}
if (GetState()!=7 || GetManualViewBaseContour()->GetPosibleSelected() ){
}
// ----------------------------------------------------------------------------
-void manualContourControler::MouseDLeft( int x, int y)//virtual
+void manualContourControler::MouseDLeft( int x, int y)//virtual
{
- manualContourBaseControler::MouseDLeft( x, y);
+ manualContourBaseControler::MouseDLeft( x, y);
if ( IsEditable() )
{
GetManualViewBaseContour()->AddControlPoints();
GetManualViewBaseContour()->AddTextActor();
GetManualViewBaseContour()->Refresh();
this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
- }
+ }
}
// ----------------------------------------------------------------------------
void manualContourControler::SetEasyCreation(bool easyCreation)
{
}
// ----------------------------------------------------------------------------
-manualContourPerpPlaneControler * manualContourPerpPlaneControler :: Clone() // virtual
+manualContourPerpPlaneControler * manualContourPerpPlaneControler :: Clone() // virtual
{
manualContourPerpPlaneControler * clone = new manualContourPerpPlaneControler();
CopyAttributesTo(clone);
return true;
}
// ----------------------------------------------------------------------------
-bool manualContourPerpPlaneControler::OnMouseMove() // virtual
+bool manualContourPerpPlaneControler::OnMouseMove() // virtual
{
manualContourControler::OnMouseMove();
return _flagMouseMove;
}
// ----------------------------------------------------------------------------
-bool manualContourPerpPlaneControler::OnLeftDClick() // virtual
+bool manualContourPerpPlaneControler::OnLeftDClick() // virtual
{
manualContourControler::OnLeftDClick();
return _flagMouseDClick;
}
// ----------------------------------------------------------------------------
-void manualContourPerpPlaneControler::ResetContour() // virtual
+void manualContourPerpPlaneControler::ResetContour() // virtual
{
manualContourControler::ResetContour();
_manualcontour3Vcontroler->ResetContour_Others();
}
// ----------------------------------------------------------------------------
-void manualContourPerpPlaneControler::MouseDLeft( int x, int y) // virtual
+void manualContourPerpPlaneControler::MouseDLeft( int x, int y) // virtual
{
_flagMouseDClick=true;
manualContourControler::MouseDLeft(x,y);
// _vtkmprbasedata->SetZ( mp->GetZ() );
// ResetOrientationPlane();
// this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
-// }
+// }
}
{
}
// ----------------------------------------------------------------------------
-manualRoiControler * manualRoiControler :: Clone() // virtual
+manualRoiControler * manualRoiControler :: Clone() // virtual
{
manualRoiControler * clone = new manualRoiControler();
CopyAttributesTo(clone);
void manualRoiControler::MouseClickLeft(int x, int y){
int z = GetZ();
if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ){
- bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+ bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
SetState(5);
}
- if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true)) {
+ if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true)) {
GetManualViewBaseContour()->InitMove(x,y,z);
SetState(6);
}
int size=GetManualViewBaseContour()->GetNumberOfPoints();
- if (GetState()==0) {
+ if (GetState()==0) {
if (size==0){
- AddPoint(x,y,z);
- AddPoint(x,y,z);
- AddPoint(x,y,z);
- AddPoint(x,y,z);
+ AddPoint(x,y,z);
+ AddPoint(x,y,z);
+ AddPoint(x,y,z);
+ AddPoint(x,y,z);
} else {
- SetPoint(0,x,y,z);
- SetPoint(1,x,y,z);
- SetPoint(2,x,y,z);
- SetPoint(3,x,y,z);
+ SetPoint(0,x,y,z);
+ SetPoint(1,x,y,z);
+ SetPoint(2,x,y,z);
+ SetPoint(3,x,y,z);
}
- bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+ bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
SetState(5);
}
GetManualViewBaseContour()->Refresh();
GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
- if (GetState()==5){
- SetPoint( bakIdPoint , x , y ,z);
+ if (GetState()==5){
+ SetPoint( bakIdPoint , x , y ,z);
if (bakIdPoint==0)
{
- SetPointX( 1 , x );
- SetPointY( 3 , y );
+ SetPointX( 1 , x );
+ SetPointY( 3 , y );
}
if (bakIdPoint==1)
{
- SetPointX( 0 , x );
- SetPointY( 2 , y );
+ SetPointX( 0 , x );
+ SetPointY( 2 , y );
}
if (bakIdPoint==2)
{
- SetPointX( 3 , x );
- SetPointY( 1 , y );
+ SetPointX( 3 , x );
+ SetPointY( 1 , y );
}
if (bakIdPoint==3)
{
- SetPointX( 2 , x );
- SetPointY( 0 , y );
+ SetPointX( 2 , x );
+ SetPointY( 0 , y );
}
}
- if (GetState()==6){
+ if (GetState()==6){
GetManualViewBaseContour()->MoveContour(x,y,z);
}
GetManualViewBaseContour()->Refresh();
}
// ----------------------------------------------------------------------------
void manualRoiControler::DeleteActualMousePoint(int x, int y) // virtual
-{
+{
}
// ----------------------------------------------------------------------------
void manualRoiControler::InitRoi(int ww, int hh, double porcentage)
GetManualViewBaseContour() ->UpdateViewPoint(3);
SetState(0);
- GetManualViewBaseContour()->Refresh();
-}
+ GetManualViewBaseContour()->Refresh();
+}
// ----------------------------------------------------------------------------
void manualRoiControler::SetRoi(int x1, int y1,int x2, int y2)
{
}
// ----------------------------------------------------------------------------
-manualCircleControler * manualCircleControler :: Clone() // virtual
+manualCircleControler * manualCircleControler :: Clone() // virtual
{
manualCircleControler * clone = new manualCircleControler();
CopyAttributesTo(clone);
void manualCircleControler::MouseClickLeft(int x, int y){
int z = GetZ();
if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ){
- bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+ bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
SetState(5);
}
- if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true)) {
+ if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true)) {
GetManualViewBaseContour()->InitMove(x,y,z);
SetState(6);
}
int size=GetManualViewBaseContour()->GetNumberOfPoints();
- if (GetState()==0) {
+ if (GetState()==0) {
if (size==0){
- AddPoint(x,y,z);
- AddPoint(x,y,z);
-// AddPoint(x,y,z);
-// AddPoint(x,y,z);
+ AddPoint(x,y,z);
+ AddPoint(x,y,z);
+// AddPoint(x,y,z);
+// AddPoint(x,y,z);
} else {
- SetPoint(0,x,y,z);
- SetPoint(1,x,y,z);
-// SetPoint(2,x,y,z);
-// SetPoint(3,x,y,z);
+ SetPoint(0,x,y,z);
+ SetPoint(1,x,y,z);
+// SetPoint(2,x,y,z);
+// SetPoint(3,x,y,z);
}
- bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+ bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
SetState(5);
}
GetManualViewBaseContour()->Refresh();
GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
- if (GetState()==5){
- SetPoint( bakIdPoint , x , y ,z);
+ if (GetState()==5){
+ SetPoint( bakIdPoint , x , y ,z);
/*
if (bakIdPoint==0)
{
- SetPointX( 1 , x );
- SetPointY( 3 , y );
+ SetPointX( 1 , x );
+ SetPointY( 3 , y );
}
if (bakIdPoint==1)
{
- SetPointX( 0 , x );
- SetPointY( 2 , y );
+ SetPointX( 0 , x );
+ SetPointY( 2 , y );
}
if (bakIdPoint==2)
{
- SetPointX( 3 , x );
- SetPointY( 1 , y );
+ SetPointX( 3 , x );
+ SetPointY( 1 , y );
}
if (bakIdPoint==3)
{
- SetPointX( 2 , x );
- SetPointY( 0 , y );
+ SetPointX( 2 , x );
+ SetPointY( 0 , y );
}
*/
}
- if (GetState()==6){
+ if (GetState()==6){
GetManualViewBaseContour()->MoveContour(x,y,z);
}
GetManualViewBaseContour()->Refresh();
// ----------------------------------------------------------------------------
void manualCircleControler::DeleteActualMousePoint(int x, int y) // virtual
-{
+{
}
// ----------------------------------------------------------------------------
// GetManualViewBaseContour() ->UpdateViewPoint(3);
SetState(0);
- GetManualViewBaseContour()->Refresh();
-}
+ GetManualViewBaseContour()->Refresh();
+}
// ----------------------------------------------------------------------------
/*
_state = 0;
_z = -900;
_editable = true;
- _posibleToMove = true;
+ _posibleToMove = true;
_moving = false;
_created = false;
_keyBoardMoving = false;
}
// ----------------------------------------------------------------------------
-manualContourBaseControler * manualContourBaseControler :: Clone() // virtual
+manualContourBaseControler * manualContourBaseControler :: Clone() // virtual
{
manualContourBaseControler * clone = new manualContourBaseControler();
CopyAttributesTo(clone);
int X,Y;
wxVTKRenderWindowInteractor *_wxVTKiren;
_wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
- _wxVTKiren->GetEventPosition(X, Y);
+ _wxVTKiren->GetEventPosition(X, Y);
//int Z = GetZ(); // JPRx
// Delete Point
if ((keyCode==8) || (keyCode==127))
}
GetManualViewBaseContour()->Refresh();
this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
- }
+ }
else
{
- // Magnet
+ // Magnet
if (keyCode==32)
{
Magnet(X,Y);
this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
}
else if( !IsEditable() )
- {
+ {
if ( keyCode == 'L' )
- {
- GetManualViewBaseContour()->MoveContour( -1, 0 );
+ {
+ GetManualViewBaseContour()->MoveContour( -1, 0 );
SetKeyBoardMoving( true );
}
else if ( keyCode == 'R' )
- {
- GetManualViewBaseContour()->MoveContour( 1, 0 );
- SetKeyBoardMoving( true );
+ {
+ GetManualViewBaseContour()->MoveContour( 1, 0 );
+ SetKeyBoardMoving( true );
}
else if ( keyCode == 'U' )
{
- GetManualViewBaseContour()->MoveContour( 0, -1 );
+ GetManualViewBaseContour()->MoveContour( 0, -1 );
SetKeyBoardMoving( true );
}
else if ( keyCode == 'D' )
{
- GetManualViewBaseContour()->MoveContour( 0, 1 );
+ GetManualViewBaseContour()->MoveContour( 0, 1 );
SetKeyBoardMoving( true );
}
else if ( keyCode == 'W' )//Diagonal left down
{
- GetManualViewBaseContour()->MoveContour( -1, 1 );
+ GetManualViewBaseContour()->MoveContour( -1, 1 );
SetKeyBoardMoving( true );
}
else if ( keyCode == 'Q' )//Diagonal left up
{
- GetManualViewBaseContour()->MoveContour( -1, -1 );
+ GetManualViewBaseContour()->MoveContour( -1, -1 );
SetKeyBoardMoving( true );
}
else if( keyCode == 'P' )//Diagonal right up
{
- GetManualViewBaseContour()->MoveContour( 1, -1 );
+ GetManualViewBaseContour()->MoveContour( 1, -1 );
SetKeyBoardMoving( true );
}
else if( keyCode == 'M' )//Diagonal right down
{
- GetManualViewBaseContour()->MoveContour( 1, 1 );
+ GetManualViewBaseContour()->MoveContour( 1, 1 );
SetKeyBoardMoving( true );
}
if( GetKeyBoardMoving() )
{
GetManualViewBaseContour()->Refresh();
- this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
+ this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
}
}
- }
+ }
}
return true;
}
wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X,Y);
-
+
MouseClickLeft(X,Y);
}
return true;
return true;
}
// ----------------------------------------------------------------------------
-bool manualContourBaseControler::OnMiddleButtonDown()
+bool manualContourBaseControler::OnMiddleButtonDown()
{
// SetKeyBoardMoving( false );
if ( _vtkInteractorStyleBaseView!=NULL )
wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X, Y);
-
+
SetCompleteCreation( true );
SetKeyBoardMoving( false );
MouseClickRight(X,Y);
}
// ----------------------------------------------------------------------------
void manualContourBaseControler::MouseClickLeft(int x, int y) // virtual
-{
-
+{
+
}
// ----------------------------------------------------------------------------
void manualContourBaseControler::MouseClickRight(int x, int y)
{
- if (_state==1)
- {
+ if (_state==1)
+ {
_state=0;
}
SetEditable( false );
SetPosibleToMove( false );
- //_state = 0;
+ //_state = 0;
_state=7;
}
// ----------------------------------------------------------------------------
{
if (_state==5){ _state = 0; }
if (_state==6){ _state = 0; }
- if (_state==7){ _state = 0; }
+ if (_state==7){ _state = 0; }
SetMoving( false );
GetManualViewBaseContour()->SelectPosibleContour(x,y,GetZ());
if( GetIfCompleteCreation() && IsEditable() && !GetManualViewBaseContour()->GetPosibleSelected() && (GetManualViewBaseContour()->GetIdPoint(x,y,GetZ())==-1) )
{
SetEditable( false );
- SetPosibleToMove( false );
+ SetPosibleToMove( false );
}
}
// ----------------------------------------------------------------------------
void manualContourBaseControler::MouseDLeft(int x, int y )
{
- if (_state==0)
- {
+ if (_state==0)
+ {
int z=GetZ();
GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
GetManualViewBaseContour()->RemoveControlPoints();
}
GetManualViewBaseContour()->SetSelected( condition );
- }
+ }
_editable = condition;
}
// ----------------------------------------------------------------------------
void manualContourBaseControler::DeleteContour(){
_manViewBaseCont->DeleteContour();
- _manContModel->DeleteAllPoints();
+ _manContModel->DeleteAllPoints();
}
// ----------------------------------------------------------------------------
void manualContourBaseControler::DeleteActualMousePoint(int x, int y)// virtual
-{
+{
if ((_manContModel!=NULL) && (_manViewBaseCont!=NULL) )
{
int id=_manViewBaseCont->GetIdPoint(x,y,GetZ());
if ((id!=-1) && (_manContModel->GetSizeLstPoints()>2) ){
_manContModel->DeletePoint(id);
- _manViewBaseCont->DeletePoint(id);
+ _manViewBaseCont->DeletePoint(id);
}
}
_state = 0;
// ----------------------------------------------------------------------------
void manualContourBaseControler::Magnet(int x, int y)
-{
+{
if( IsEditable())
{
/*int id= */ _manViewBaseCont->GetIdPoint(x,y,GetZ()); // JPRx
double zz = z;
GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz);
/*int id =*/ GetManualContourModel()->AddPoint(xx,yy,zz); // JPRx
- GetManualViewBaseContour()->AddPoint();
+ GetManualViewBaseContour()->AddPoint();
// GetManualViewBaseContour()->UpdateViewPoint(id);
}
}
GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz);
if (GetManualContourModel()->GetSizeLstPoints()>1){
id = GetManualContourModel()->InsertPoint(xx,yy,zz);
- GetManualViewBaseContour()->InsertPoint(id);
+ GetManualViewBaseContour()->InsertPoint(id);
// GetManualViewBaseContour()->UpdateViewPoint(id);
} else {
GetManualContourModel()->AddPoint(xx,yy,zz);
- GetManualViewBaseContour()->AddPoint();
-// AddPoint(x,y,z);
+ GetManualViewBaseContour()->AddPoint();
+// AddPoint(x,y,z);
// GetManualViewBaseContour()->UpdateViewPoint(id);
}
}