PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
PlusVersion.cxx
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2 Program: Plus
3 Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4 See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #include "PlusConfigure.h"
8 #include "vtksys/CommandLineArguments.hxx"
9 #include "vtkPlusDeviceFactory.h"
10 
11 int main(int argc, char **argv)
12 {
13  bool printHelp(false);
14  bool printShortVersionInfo=false;
15 
16  vtksys::CommandLineArguments args;
17  args.Initialize( argc, argv );
18  args.AddArgument("--help", vtksys::CommandLineArguments::NO_ARGUMENT, &printHelp, "Print this help.");
19  args.AddArgument( "--short", vtksys::CommandLineArguments::NO_ARGUMENT, &printShortVersionInfo, "Print short version information, without list of supported devices (by default print detailed information)" );
20 
21  if ( !args.Parse() )
22  {
23  std::cerr << "Problem parsing arguments." << std::endl;
24  std::cout << "Help: " << args.GetHelp() << std::endl;
25  exit(EXIT_FAILURE);
26  }
27 
28  if ( printHelp )
29  {
30  std::cout << args.GetHelp() << std::endl;
31  exit(EXIT_SUCCESS);
32  }
33 
34  // don't print |INFO|
35  vtkPlusLogger::Instance()->SetLogLevel(vtkPlusLogger::LOG_LEVEL_ERROR);
36 
37  if (!printShortVersionInfo)
38  {
39  vtkSmartPointer<vtkPlusDeviceFactory> deviceFactory = vtkSmartPointer<vtkPlusDeviceFactory>::New();
40  std::ostringstream supportedDevices;
41  deviceFactory->PrintAvailableDevices(supportedDevices, vtkIndent());
42  std::cout << supportedDevices.str();
43  }
44 
45  return EXIT_SUCCESS;
46 }
int main(int argc, char **argv)
Definition: PlusVersion.cxx:11
static vtkIGSIOLogger * Instance()