How to make the three cross sections show different colors like the flowing:

image
this this the axiel.

You can have a look at how this is implemented using in 3D Slicer using VTK classes:

The full source code of slice display of segmentations is available here (all VTK-based): https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Segmentations/MRMLDM/vtkMRMLSegmentationsDisplayableManager2D.cxx

The implementation is not particularly complicated, yet I would still recommend to use 3D Slicer as a platform instead of moving over features one by one into an application that you build from scratch.