Here the variable ```cam``` is used to check whether camera parameters are manually set. It's more appropriate to call  ```bool pcl::visualization::PCLVisualizer::cameraParamsSet () const```, for camera parameters are manually set when ```PCLVisualizer``` automatically restore camera parameters("-cam" is not valid here).