_boxcreavtkplanewidget.SetRenderer( bbGetInputRenderer() );
_boxcreavtkplanewidget.Process();
bbSetOutputOut( _boxcreavtkplanewidget.GetPlaneSource()->GetOutput() );
+ bbSetOutputCenter( _boxcreavtkplanewidget.GetCenter() );
+ bbSetOutputCenter( _boxcreavtkplanewidget.GetNormal() );
}
//=====
// 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(Resolution,int);
BBTK_DECLARE_INPUT(Renderer,vtkRenderer*);
BBTK_DECLARE_OUTPUT(Out,vtkDataSet*);
+ BBTK_DECLARE_OUTPUT(Center,std::vector<double>);
+ BBTK_DECLARE_OUTPUT(Normal,std::vector<double>);
BBTK_PROCESS(Process);
void Process();
BBTK_NAME("PlaneWidget");
BBTK_AUTHOR("ED at Info-Dev Creatis");
BBTK_DESCRIPTION("No Description.");
+
BBTK_CATEGORY("empty");
+
BBTK_INPUT(PlaneWidget,Active,"Active widget (false default)",bool,"");
BBTK_INPUT(PlaneWidget,In,"Reference Image",vtkImageData*,"");
BBTK_INPUT(PlaneWidget,Resolution,"Resolution (60 default)",int,"");
BBTK_INPUT(PlaneWidget,Renderer,"vtkRenderer",vtkRenderer*,"");
+
BBTK_OUTPUT(PlaneWidget,Out,"Dynamic plane result from vtkPlaneSource",vtkDataSet*,"");
+ BBTK_OUTPUT(PlaneWidget,Center,"Center of the plane",std::vector<double>,"");
+ BBTK_OUTPUT(PlaneWidget,Normal,"Normal of the plane",std::vector<double>,"");
+
BBTK_END_DESCRIBE_BLACK_BOX(PlaneWidget);
+
//=====
// 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)
//=====
return _resolution;
}
+
+
+//------------------------------------------------------------------------
+std::vector<double> creaVtkPlaneWidget::GetCenter()
+{
+ std::vector<double> vecCenter;
+ double point[3];
+ _vPlaneWidget->GetCenter(point);
+ vecCenter.push_back(point[0]);
+ vecCenter.push_back(point[1]);
+ vecCenter.push_back(point[2]);
+ return vecCenter;
+}
+
+//------------------------------------------------------------------------
+std::vector<double> creaVtkPlaneWidget::GetNormal()
+{
+ std::vector<double> vecNormal;
+ double point[3];
+ _vPlaneWidget->GetNormal(point);
+ vecNormal.push_back(point[0]);
+ vecNormal.push_back(point[1]);
+ vecNormal.push_back(point[2]);
+ return vecNormal;
+}
+
+
//------------------------------------------------------------------------
void creaVtkPlaneWidget::Process()
{
-printf("EED creaVtkPlaneWidget::Process Start\n");
if ((GetActive()==true) && (GetRenderer()!=NULL))
{
_vPlaneWidget->SetInput( GetImage() );
_vPlaneWidget->AddObserver( vtkCommand::StartInteractionEvent , creavtkcallbackplanewidget );
_vPlaneWidget->AddObserver( vtkCommand::EnableEvent , creavtkcallbackplanewidget );
}
-printf("EED creaVtkPlaneWidget::Process up\n");
UpdatePlane();
} else {
_vPlaneWidget->Off();
}
-printf("EED creaVtkPlaneWidget::Process End\n");
}
+
+
+
//------------------------------------------------------------------------
void creaVtkPlaneWidget::UpdatePlane()
{
vtkPlaneSource* GetPlaneSource();
void SetResolution(int resolution);
int GetResolution();
+ std::vector<double> GetCenter();
+ std::vector<double> GetNormal();
void Process();
void UpdatePlane();