Custom Visualizer not works

It is a simple visualizer test code, it compiles well, But it does not work as I expected, show the shape I draw with PDI; So did I miss something, such a switch to turn on/off
Here are the codes: