// * TYPE is the C++ type of the input/output
// (the one provided in the attribute 'type' of the tag 'input')
-//EED 2017-01-01 Migration VTK7
-#if (VTK_MAJOR_VERSION <= 5)
- maskpoints->SetInput( bbGetInputIn() );
-#endif
-#if (VTK_MAJOR_VERSION >= 6)
- maskpoints->SetInputData( bbGetInputIn() );
-#endif
- maskpoints->SetOnRatio( bbGetInputRatio() );
- maskpoints->RandomModeOn();
- maskpoints->SetMaximumNumberOfPoints(5000);
- maskpoints->Update();
- bbSetOutputOut( maskpoints->GetOutput() );
+ if (bbGetInputActive()==true)
+ {
+ //EED 2017-01-01 Migration VTK7
+ #if (VTK_MAJOR_VERSION <= 5)
+ maskpoints->SetInput( bbGetInputIn() );
+ #endif
+ #if (VTK_MAJOR_VERSION >= 6)
+ maskpoints->SetInputData( bbGetInputIn() );
+ #endif
+
+ maskpoints->SetOnRatio( bbGetInputRatio() );
+ maskpoints->RandomModeOff();
+ // maskpoints->RandomModeOn();
+ // maskpoints->SetMaximumNumberOfPoints(5000);
+ maskpoints->Update();
+ bbSetOutputOut( maskpoints->GetOutput() );
+ } // if Active
}
//=====
// 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)
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
+ bbSetInputActive( true );
bbSetInputIn(NULL);
bbSetOutputOut(NULL);
//=====
// 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(Active,bool);
BBTK_DECLARE_INPUT(In,vtkImageData*);
BBTK_DECLARE_INPUT(Ratio,int);
BBTK_DECLARE_OUTPUT(Out,vtkPolyData*);
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(MaskPoint,bbtk::AtomicBlackBox);
-BBTK_NAME("MaskPoint");
-BBTK_AUTHOR("ED at InfoDev Creatis");
-BBTK_DESCRIPTION("vtkMaskPoint. See Vectors/Tensors Examples");
-BBTK_CATEGORY("empty");
+ BBTK_NAME("MaskPoint");
+ BBTK_AUTHOR("ED at InfoDev Creatis");
+ BBTK_DESCRIPTION("vtkMaskPoint. See Vectors/Tensors Examples");
+ BBTK_CATEGORY("empty");
+
+ BBTK_INPUT(MaskPoint,Active,"(default true) true/false",bool,"");
BBTK_INPUT(MaskPoint,In,"vtkImageData",vtkImageData*,"");
BBTK_INPUT(MaskPoint,Ratio,"Ratio",int,"");
+
BBTK_OUTPUT(MaskPoint,Out,"vtkPolyData",vtkPolyData*,"");
+
BBTK_END_DESCRIBE_BLACK_BOX(MaskPoint);
//=====
// 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)
bbGetInputRenderer()->GetRenderWindow()->SetAlphaBitPlanes(1);
+ if (bbGetInputRenderer()==NULL)
+ {
+ printf("EED Warnning! PolyDataToActor::DoProcess missing Renderer.\n");
+ }
+
+
if (bbGetInputActive()==true)
{
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
- int i;
- double spc[3];
- double range[2];
- int ext[6];
+ int i;
+ double spc[3];
+ double range[2];
+ int ext[6];
bbGetInputImage()->GetSpacing(spc);
bbGetInputImage()->GetScalarRange(range);
-
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
bbGetInputImage()->GetWholeExtent(ext);
colorLookupTable->SetTableValue(10,1 ,0.5,0.5,1);
colorLookupTable->SetTableValue(11,0.5,0.5,1 ,1);
- } // type 2
+ } // type 3
+
+ } // firsttime
- }
bbGetInputMesh()->GetPointData()->SetScalars(colors);
colorLookupTableWL->SetLevel( bbGetInputColorLevel() );
colorLookupTableWL->SetWindow( bbGetInputColorWindow() );
}
+
+
+ if (bbGetInputExternalLookupTable()!=NULL)
+ {
+ generalLookupTable = bbGetInputExternalLookupTable();
+ } else {
+ generalLookupTable = colorLookupTable;
+ }
int missingpoints = bbGetInputMesh()->GetNumberOfPoints() - colors->GetDataSize()/colors->GetNumberOfComponents();
for(i = 0; i < missingpoints; i++)
} else {
gl=0;
}
- colorLookupTable->GetColor(gl, dcolor);
+ generalLookupTable->GetColor(gl, dcolor);
colors->SetTuple3(i,255*dcolor[0],255*dcolor[1],255*dcolor[2]);
} // for i
bbGetInputMesh()->Modified();
firsttime = true;
colors = NULL;
colorLookupTable = NULL;
- colorLookupTableWL = NULL;
+ colorLookupTableWL = NULL;
}
//=====
// 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(ColorType,int);
BBTK_DECLARE_INPUT(ColorLevel,double);
BBTK_DECLARE_INPUT(ColorWindow,double);
+ BBTK_DECLARE_INPUT(ExternalLookupTable,vtkScalarsToColors*);
BBTK_DECLARE_INPUT(Transform,vtkLinearTransform*);
// BBTK_DECLARE_OUTPUT(Out,double);
BBTK_PROCESS(Process);
void Process();
- bool firsttime;
+ bool firsttime;
vtkUnsignedCharArray *colors;
- vtkLookupTable *colorLookupTable;
+ vtkScalarsToColors *generalLookupTable;
+ vtkLookupTable *colorLookupTable;
vtkWindowLevelLookupTable *colorLookupTableWL;
//=====
BBTK_CATEGORY("");
BBTK_INPUT(SurfaceTexture,Mesh,"Mesh topology",vtkPolyData*,"");
BBTK_INPUT(SurfaceTexture,Image,"Image Reference",vtkImageData*,"");
- BBTK_INPUT(SurfaceTexture,ColorType,"Color Type (default 0) 0 Colors(JET), 1 ColorWindowLevel",int,"");
+ BBTK_INPUT(SurfaceTexture,ColorType,"Color Type (default 0) 0 Colors(JET-simple), 1 ColorWindowLevel, 2 Random Color, 3 Eleven colors",int,"");
BBTK_INPUT(SurfaceTexture,ColorLevel,"Color Level (default 500)",double,"");
BBTK_INPUT(SurfaceTexture,ColorWindow,"ColorWindow (default 500)",double,"");
+ BBTK_INPUT(SurfaceTexture,ExternalLookupTable,"External vtkScalarsToColors ",vtkScalarsToColors*,"");
BBTK_INPUT(SurfaceTexture,Transform,"vtk Linear Transform (default NULL)",vtkLinearTransform*,"");
// BBTK_OUTPUT(SurfaceTexture,Out,"First output",double,"");
//--------------------------------------------------------------------------
void Slider::CreateWidget(wxWindow* parent)
{
-
int orientation=0;
if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")==true) { orientation=0; }
if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) { orientation=1; }
-
-
// std::cout << "bbGetWxParent = "<<bbGetWxParent()<<std::endl;
SliderWidget *w = new SliderWidget(this,
parent, //bbGetWxParent(),
bbGetInputReactiveOnTrack()
);
// std::cout << "w = "<<w<<std::endl;
- // w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
-
+ // w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
bbSetOutputWidget( w );
}