//int manualViewCircle::GetType() 3;
//int manualViewStar::GetType() 4;
//int manualViewLine::GetType() 6;
+//int manualViewPoints::GetType() 7;
return 0;
/*vtkRenderer * theRenderer = */ _wxvtkbaseview->GetRenderer(); // JPRx ??
//Adding the spline
AddSplineActor();
-
AddTextActor();
+
//Adding each control point
if( ifControlPoints )
AddControlPoints();
// ----------------------------------------------------------------------------
void manualViewBaseContour::AddTextActor()
{
- _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor );
+ if(_show_text)
+ {
+ _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor );
+ }
}
// ----------------------------------------------------------------------------
void manualViewBaseContour::RemoveTextActor()
{
- _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor );
+ if(_show_text)
+ {
+ _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor );
+ }
}
// ----------------------------------------------------------------------------
void manualViewBaseContour::DeleteVtkObjects()
// ----------------------------------------------------------------------------
void manualViewBaseContour::ConstructVTKObjects()
{
+
+
//JSTG 29-02-08 -----------------------------------------------
//int i , nps = _sizePointsContour;
int i;
int nps = _manContModel->GetNumberOfPointsSpline();
//-------------------------------------------------------------
+
DeleteVtkObjects();
_pts = vtkPoints::New();
_pts->SetNumberOfPoints(nps);
-
for (i=0 ; i<nps ; i++){
_pts->SetPoint(i, 0 , 0 , 0 );
}
// This is for the boundaring inicialisation
//EED 29Mars2009
- _pts->SetPoint(0, 0 , 0 , -1000 );
- _pts->SetPoint(1, 0 , 0 , 1000 );
-// _pts->SetPoint(0, -1000 , -1000 , -1000 );
-// _pts->SetPoint(1, 1000 , 1000 , 1000 );
-
+ //_pts->SetPoint(0, 0 , 0 , -1000 );
+ //_pts->SetPoint(1, 0 , 0 , 1000 );
+ _pts->SetPoint(0, -1000 , -1000 , -1000 );
+ _pts->SetPoint(1, 1000 , 1000 , 1000 );
vtkCellArray *lines = vtkCellArray::New();
lines->InsertNextCell( nps /* +1 */ );
for ( i=0 ; i<nps+1 ; i++ ){
lines->InsertCellPoint(i % nps );
}
-
_pd = vtkPolyData::New();
_pd->SetPoints( _pts );
_pd->SetLines( lines );
_pd->ComputeBounds();
+ InitTextActor();
+}
+
+void manualViewBaseContour::InitTextActor()
+{
// Text
_textActor = vtkTextActor::New();
// _textActor->SetDisplayPosition(200, 200);
tprop->SetFontFamilyToArial();
tprop->SetColor(0, 0, 1);
}
+
// ----------------------------------------------------------------------------
void manualViewBaseContour::CreateNewContour()
{
bool result=false;
SetPosibleSelected(result);
int id = GetIdPoint(x,y,z);
+
if( !GetEditable() && !_selected && id!= -1)
{
result=true;
- SetPosibleSelected(result);
+ _posibleSelected=true;
}
else
{
SetPosibleSelected(result);
}
}
-
-
}
return result;
}
Refresh();
}
// ----------------------------------------------------------------------------
-void manualViewBaseContour::SetModel(manualContourModel *manContModel){
+void manualViewBaseContour::SetModel(manualBaseModel *manContModel){
_manContModel=manContModel;
}
// ----------------------------------------------------------------------------
if (vri==NULL)
{
_wxvtkbaseview->GetRenWin()->Render();
+ printf("EED %p How to optimize manualViewBaseContour::Refresh() \n",this);
}
}
void manualViewBaseContour::SetShowText(bool ok)
{
_show_text = ok;
- if (_show_text==false)
+ if (_show_text==false && _textActor!=NULL)
{
_textActor->SetInput("00");
}