Out
-106.333698:-24.000230:-900.000000
FIN_COMPLEX_PORT
-COMPLEXINPUTS:7
+COMPLEXINPUTS:8
COMPLEX_PORT
In
12.336925:94.999712:-900.000000
BoxExecute
-19.682203:95.133203:-900.000000
FIN_COMPLEX_PORT
-BOXES:3
+COMPLEX_PORT
+active
+52.180776:96.404365:-900.000000
+FIN_COMPLEX_PORT
+BOXES:4
BOX
vtk:MarchingCubes:mc
ISEXEC:FALSE
PORT
BoxProcessMode:"reactive"
FIN_BOX
-CONNECTIONS:10
+BOX
+std:MagicBox:Box04
+ISEXEC:FALSE
+46.365909:66.717942:-900.000000
+91.940909:56.717942:-900.000000
+FIN_BOX
+CONNECTIONS:13
CONNECTION
mc:Out:polydatatoactor:In
NumberOfControlPoints:0
CONNECTION
Box03:BoxChange:polydatatoactor:BoxExecute
NumberOfControlPoints:0
+CONNECTION
+active:active:Box04:In
+NumberOfControlPoints:0
+CONNECTION
+Box04:Out:mc:Active
+NumberOfControlPoints:0
+CONNECTION
+Box04:Out:polydatatoactor:Active
+NumberOfControlPoints:0
APP_END
new std:MultipleInputs Box03
set Box03.BoxProcessMode "reactive"
+new std:MagicBox Box04
+
connect mc.Out polydatatoactor.In
connect Box03.BoxChange polydatatoactor.BoxExecute
+connect Box04.Out mc.Active
+connect Box04.Out polydatatoactor.Active
# Complex input ports
input In mc.In " "
input Renderer polydatatoactor.Renderer " "
input Transform polydatatoactor.Transform " "
input BoxExecute Box03.In1 " "
+input active Box04.In " "
# Complex output ports
output Out polydatatoactor.Out " "
void MarchingCubes::Process()
{
- bbGetVtkObject()->SetValue(0, bbGetInputValue() );
- if(bbGetInputComputeNormalsOn())
- bbGetVtkObject()->ComputeNormalsOn();
- else
- bbGetVtkObject()->ComputeNormalsOff();
-
- if(bbGetInputComputeScalarsOn())
- bbGetVtkObject()->ComputeScalarsOn();
- else
- bbGetVtkObject()->ComputeScalarsOff();
- bbGetVtkObject()->Update();
+ if (bbGetInputActive()==true)
+ {
+ bbGetVtkObject()->SetValue(0, bbGetInputValue() );
+
+ if(bbGetInputComputeNormalsOn())
+ {
+ bbGetVtkObject()->ComputeNormalsOn();
+ }else {
+ bbGetVtkObject()->ComputeNormalsOff();
+ }
+
+ if(bbGetInputComputeScalarsOn())
+ {
+ bbGetVtkObject()->ComputeScalarsOn();
+ }else{
+ bbGetVtkObject()->ComputeScalarsOff();
+ }
+
+ bbGetVtkObject()->Update();
+ }
}
//-----------------------------------------------------------------
void MarchingCubes::bbUserSetDefaultValues()
{
BBTK_VTK_SET_DEFAULT_VALUES();
+ bbSetInputActive(true);
bbSetInputValue(400);
bbSetInputComputeNormalsOn(true);
bbSetInputComputeScalarsOn(true);
bbtk::AtomicBlackBox,
vtkMarchingCubes);
+ BBTK_DECLARE_INPUT(Active,bool);
BBTK_DECLARE_VTK_INPUT(In,vtkImageData *);
BBTK_DECLARE_INPUT(Value,double);
BBTK_DECLARE_INPUT(ComputeNormalsOn,bool);
BBTK_DESCRIPTION("Extracts an iso-surface of an image using the marching cubes algorithm (bbfication of vtkMarchingCubes)");
BBTK_CATEGORY("image;mesh");
+ BBTK_INPUT(MarchingCubes,Active,"Active true/false (default true)",bool,"");
BBTK_INPUT(MarchingCubes,In,"Image",vtkImageData*,"");
BBTK_INPUT(MarchingCubes,Value,"Value of the iso-surface",double,"");
BBTK_INPUT(MarchingCubes,ComputeNormalsOn,"Set the computation of normals",bool,"");
//=====
void MeasureLength::Process()
{
- std::cout << "RaC MeasureLength::Process START"<< std::endl;
-
_points = bbGetInputPoints();
_image = bbGetInputImageData();
-
double sumLength = 0 ;
double sumLengthVoxels = 0 ;
if(_image != NULL && _points->GetNumberOfPoints()>1)
} // for
} // if
-
bbSetOutputLength( sqrt(sumLength) );
bbSetOutputLengthVoxels( sqrt(sumLengthVoxels) );
-
- std::cout << "RaC MeasureLength::Process END"<< std::endl;
}
//=====
// 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)
<process><PRE>
bbGetVtkObject()->SetFileName(bbGetInputIn().c_str());
+printf("EED MetaImageReader::Process %s\n", bbGetInputIn().c_str() );
bbGetVtkObject()->Update();
</PRE></process>
//=====
void PointsXYZtoVTKPoints::Process()
{
-
-//std::cout << "RaC PointsXYZtoVTKPoints::Process START"<< std::endl;
std::vector<int> lstPointsX = bbGetInputLstPointsX();
std::vector<int> lstPointsY = bbGetInputLstPointsY();
std::vector<int> lstPointsZ = bbGetInputLstPointsZ();
-
-
if(_points==NULL)
{
_points=vtkPoints::New();
point[0]=0;
point[1]=0;
point[2]=0;
-
for (int i =0; i < lstPointsX.size(); ++i)
{
point[0]=lstPointsX[i];
_points->InsertPoint(i,point);
}
bbSetOutputPoints(_points);
-
-std::cout << "RaC PointsXYZtoVTKPoints::Process END"<< std::endl;
-
}
//=====
// 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)
void PolyDataToActor::bbUserSetDefaultValues()
{
- firsttime=true;
+ actorAdded=false;
std::vector<double> colour;
colour.push_back(1.0);
colour.push_back(1.0);
colour.push_back(0.5);
bbSetInputColour(colour);
+ bbSetInputActive(true);
bbSetInputIn(NULL);
bbSetInputRenderer(NULL);
bbSetInputTransform(NULL);
//---------------------------------------------------------------------
- void PolyDataToActor::DoProcess()
- {
- polydatamapper->SetInput( bbGetInputIn() );
-
- vtkactor->GetProperty()->SetRepresentation( bbGetInputRepresentation() );
- vtkactor->GetProperty()->SetLineWidth( bbGetInputLineWidth() );
-
- vtkactor->GetProperty()->SetColor( bbGetInputColour()[0],
- bbGetInputColour()[1],
- bbGetInputColour()[2] );
-
- vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() );
-
- if ( bbGetInputTransform()!=NULL )
- {
- vtkactor->SetUserTransform( bbGetInputTransform() );
- }
-
- bbSetOutputOut( vtkactor );
-
- // Interface Update
- if ((firsttime==true) && (bbGetInputRenderer()!=NULL ))
- {
- firsttime=false;
- bbGetInputRenderer()->AddActor( vtkactor );
- } // firsttime
-
- if (bbGetInputScalarVisibility()==true )
- {
- polydatamapper->ScalarVisibilityOn();
- } else {
- polydatamapper->ScalarVisibilityOff();
- } // ScalarVisibility
+ void PolyDataToActor::DoProcess()
+ {
-
- }
+ if (bbGetInputActive()==true)
+ {
+ polydatamapper->SetInput( bbGetInputIn() );
+ vtkactor->GetProperty()->SetRepresentation( bbGetInputRepresentation() );
+ vtkactor->GetProperty()->SetLineWidth( bbGetInputLineWidth() );
+
+ vtkactor->GetProperty()->SetColor( bbGetInputColour()[0],
+ bbGetInputColour()[1],
+ bbGetInputColour()[2] );
+
+ vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() );
+
+ if ( bbGetInputTransform()!=NULL )
+ {
+ vtkactor->SetUserTransform( bbGetInputTransform() );
+ }
+
+ bbSetOutputOut( vtkactor );
+
+ // Interface Update
+ if ((actorAdded==false) && (bbGetInputRenderer()!=NULL ))
+ {
+ actorAdded=true;
+ bbGetInputRenderer()->AddActor( vtkactor );
+ } // actorAdded
+
+ if (bbGetInputScalarVisibility()==true )
+ {
+ polydatamapper->ScalarVisibilityOn();
+ } else {
+ polydatamapper->ScalarVisibilityOff();
+ } // ScalarVisibility
+ } else {
+ // Interface Update
+ if ((actorAdded==true) && (bbGetInputRenderer()!=NULL ))
+ {
+ actorAdded=false;
+ bbGetInputRenderer()->RemoveActor( vtkactor );
+ } // actorAdded
+ } // Active
+ }
:
public bbtk::AtomicBlackBox
{
- bool firsttime;
+ bool actorAdded;
vtkPolyDataMapper *polydatamapper;
vtkActor *vtkactor;
BBTK_BLACK_BOX_INTERFACE(PolyDataToActor,bbtk::AtomicBlackBox);
+ BBTK_DECLARE_INPUT(Active,bool);
BBTK_DECLARE_INPUT(In,vtkPolyData *);
BBTK_DECLARE_INPUT(Opacity,double);
BBTK_DECLARE_INPUT(Colour,std::vector<double>);
BBTK_CATEGORY("3D object creator");
BBTK_INPUT(PolyDataToActor,In,"Input image",vtkPolyData*,"");
+ BBTK_INPUT(PolyDataToActor,Active,"Active true/false (default true)",bool,"");
BBTK_INPUT(PolyDataToActor,Opacity,"Opacity",double,"");
BBTK_INPUT(PolyDataToActor,Colour,"r g b",vectorcolour,"colour");
BBTK_INPUT(PolyDataToActor,Renderer,"3D scene in which to insert the surface",vtkRenderer*,"");
COMPLEXOUTPUTS:3
COMPLEX_PORT
Out
-63.993992:-275.375244:-900.000000
+58.302298:-288.767464:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Widget
vtkRenderer
350.000000:100.000000:-900.000000
FIN_COMPLEX_PORT
-BOXES:9
+BOXES:10
BOX
wx:LayoutLine:controls
ISEXEC:FALSE
170.465036:-148.550905:-900.000000
216.040036:-158.550905:-900.000000
FIN_BOX
-CONNECTIONS:28
+BOX
+wx:CheckBox:Box10
+ISEXEC:FALSE
+134.946534:-6.270599:-900.000000
+180.521534:-16.270599:-900.000000
+PORT
+In:"false"
+PORT
+ReactiveOnKeystroke:"true"
+PORT
+Title:"Active"
+FIN_BOX
+CONNECTIONS:31
CONNECTION
isovalue:Out:Asurface:Isovalue
NumberOfControlPoints:0
opacity:BoxChange:refresh:In2
NumberOfControlPoints:0
CONNECTION
-colour:Widget:controls:Widget3
-NumberOfControlPoints:0
-CONNECTION
-isovalue:Widget:controls:Widget1
-NumberOfControlPoints:0
-CONNECTION
-opacity:Widget:controls:Widget2
-NumberOfControlPoints:0
-CONNECTION
Box09:Out:Asurface:Renderer
NumberOfControlPoints:0
CONNECTION
CONNECTION
colour:BoxChange:refresh:In3
NumberOfControlPoints:0
+CONNECTION
+Box10:BoxChange:refresh:In5
+NumberOfControlPoints:0
+CONNECTION
+Box10:Out:Asurface:active
+NumberOfControlPoints:0
+CONNECTION
+colour:Widget:controls:Widget4
+NumberOfControlPoints:0
+CONNECTION
+opacity:Widget:controls:Widget3
+NumberOfControlPoints:0
+CONNECTION
+isovalue:Widget:controls:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box10:Widget:controls:Widget1
+NumberOfControlPoints:0
APP_END
new std:MagicBox Box09
+new wx:CheckBox Box10
+ set Box10.In "false"
+ set Box10.ReactiveOnKeystroke "true"
+ set Box10.Title "Active"
+
connect isovalue.Out Asurface.Isovalue
connect opacity.Out Adiv.In1
connect colour.Out Asurface.Colour
connect isovalue.BoxChange refresh.In1
connect opacity.BoxChange refresh.In2
-connect colour.Widget controls.Widget3
-connect isovalue.Widget controls.Widget1
-connect opacity.Widget controls.Widget2
connect Box09.Out Asurface.Renderer
connect Box09.Out Box08.Renderer
connect opacity.BoxChange refresh.BoxExecute
connect refresh.BoxChange Box08.BoxExecute
connect refresh.BoxChange Adiv.BoxExecute
connect colour.BoxChange refresh.In3
+connect Box10.BoxChange refresh.In5
+connect Box10.Out Asurface.active
+connect colour.Widget controls.Widget4
+connect opacity.Widget controls.Widget3
+connect isovalue.Widget controls.Widget2
+connect Box10.Widget controls.Widget1
# Complex input ports
input Title controls.WinTitle " "