nps = _manContModel->GetNumberOfPointsSpline();
//delta=( double ) ( np ) / ( double ) ( nps-1 ); //JSTG 25-02-08
-//printf ("EED manualViewContour::RefreshContour>> %d %d \n", np,nps);
if ( _pts!=NULL )
{
// EED 27 sep 2006
// _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
{
result=true;
}
-
+
return result;
}
SetIfViewControlPoints( false );
}
// ----------------------------------------------------------------------------
-void manualViewBaseContour :: AddControlPoints()
+void manualViewBaseContour::AddControlPoints()
{
vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
SetIfViewControlPoints( true );
}
// ----------------------------------------------------------------------------
-void manualViewBaseContour :: UpdateViewPoints()
+void manualViewBaseContour::UpdateViewPoints()
{
int id, size = _lstViewPoints.size();
for( id=0; id<size; id++)
_bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
SetState(7);
}
- }
- else
- {
+ }else{
SetPosibleToMove( true );
GetManualViewBaseContour()->SetSelected( GetManualViewBaseContour()->GetPosibleSelected() );
- }
+ } // IsEditable
+
if ( GetState() == 0 && GetManualViewBaseContour()->GetPosibleSelected() )
{
SetMoving( true );
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);
- SetState(5);
- }
+
+ if( IsEditable() )
+ { // move control point
+ if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ){
+ bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+ SetState(5);
+ }
+ } // IsEditable
+
+ // Move contour
if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true)) {
GetManualViewBaseContour()->InitMove(x,y,z);
SetState(6);
}
-
+ // if the firs time create 4 control points and move one point
int size=GetManualViewBaseContour()->GetNumberOfPoints();
if (GetState()==0) {
if (size==0){
// this->_vtkInteractorStyleBaseView->
+
GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
// ----------------------------------------------------------------------------
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);
- SetState(5);
- }
+
+ if( IsEditable() )
+ { // move control point
+ if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ){
+ bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+ SetState(5);
+ }
+ }// IsEditable
+
+ // move contour
if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true)) {
GetManualViewBaseContour()->InitMove(x,y,z);
SetState(6);
}
+
+ // firstime create 2 control points and move one control point
int size=GetManualViewBaseContour()->GetNumberOfPoints();
if (GetState()==0) {
if (size==0){
void manualCircleControler::MouseMove(int x, int y) // virtual
{
int z=GetZ();
-
// this->_vtkInteractorStyleBaseView->
GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
if (GetState()==5){
SetPoint( bakIdPoint , x , y ,z);
-/*
- if (bakIdPoint==0)
- {
- SetPointX( 1 , x );
- SetPointY( 3 , y );
- }
- if (bakIdPoint==1)
- {
- SetPointX( 0 , x );
- SetPointY( 2 , y );
- }
-
- if (bakIdPoint==2)
- {
- SetPointX( 3 , x );
- SetPointY( 1 , y );
- }
- if (bakIdPoint==3)
- {
- SetPointX( 2 , x );
- SetPointY( 0 , y );
- }
-*/
}
if (GetState()==6){
GetManualViewBaseContour()->MoveContour(x,y,z);
// ----------------------------------------------------------------------------
void manualLineControler::MouseClickLeft(int x, int y){
int z = GetZ();
- if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ){
- bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
- SetState(5);
- }
+
+ if( IsEditable() )
+ { // move control point
+ if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ){
+ bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+ SetState(5);
+ }
+ } //IsEditable
+
+ // move contour
if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true)) {
GetManualViewBaseContour()->InitMove(x,y,z);
SetState(6);
}
+ // fist time create 2 control points and move a control point
int size=GetManualViewBaseContour()->GetNumberOfPoints();
if (GetState()==0) {
if (size==0){
virtual manualViewCircle * Clone();
void CopyAttributesTo( manualViewCircle *cloneObject );
-// void RefreshContour();
-// virtual bool ifTouchContour(int x,int y, int z);
virtual void InitMove(int x, int y, int z);
virtual void MoveContour(int x, int y, int z);
void GetMinMax(double &minX,double &minY, double &maxX, double &maxY);
private:
double _dp0[3];
double _dp1[3];
-// double _dp2[3];
-// double _dp3[3];
};
virtual manualViewLine * Clone();
void CopyAttributesTo( manualViewLine *cloneObject );
-// void RefreshContour();
-// virtual bool ifTouchContour(int x,int y, int z);
virtual void InitMove(int x, int y, int z);
virtual void MoveContour(int x, int y, int z);
private:
double _dp0[3];
double _dp1[3];
-// double _dp2[3];
-// double _dp3[3];
};
// ----------------------------------------------------------------------------
-class creaMaracasVisu_EXPORT manualRoiControler: public manualContourBaseControler
+class creaMaracasVisu_EXPORT manualRoiControler: public manualContourControler
{
public:
manualRoiControler();