001/** 002 * 003 */ 004package plugins.tutorial.vtk; 005 006import icy.painter.Overlay; 007import icy.plugin.abstract_.PluginActionable; 008import icy.sequence.Sequence; 009 010/** 011 * This plugin shows how to render different VTK objects type through the Painter. 012 * 013 * @author Stephane 014 */ 015public class VtkPainterExamples extends PluginActionable 016{ 017 private static int index = 0; 018 019 @Override 020 public void run() 021 { 022 final Sequence sequence = getActiveSequence(); 023 024 if (sequence != null) 025 { 026 final Overlay overlay; 027 028 switch (index % 7) 029 { 030 default: 031 overlay = new VtkAnimatedEarthPainter(); 032 break; 033 case 1: 034 overlay = new VtkText3DPainter(); 035 break; 036 case 2: 037 overlay = new VtkComplexeSplinePainter(); 038 break; 039 case 3: 040 overlay = new VtkCubePainter(); 041 break; 042 case 4: 043 overlay = new VtkLabelPainter(); 044 break; 045 case 5: 046 overlay = new VtkSpherePainter(); 047 break; 048 case 6: 049 overlay = new VtkText2DPainter(); 050 break; 051 } 052 053 // add the created VTK overlay to the sequence 054 sequence.addOverlay(overlay); 055 056 index++; 057 } 058 } 059}