#include <visp/vpColVector.h>
#include <visp/vpDebug.h>
#include <visp/vpParseArgv.h>
#include <stdlib.h>
#include <stdio.h>
#define GETOPTARGS "h"
void usage(const char *name, const char *badparam);
bool getOptions(int argc, const char **argv);
void usage(const char *name, const char *badparam)
{
fprintf(stdout, "\n\
Test some vpColVector functionalities.\n\
\n\
SYNOPSIS\n\
%s [-h]\n", name);
fprintf(stdout, "\n\
OPTIONS: Default\n\
-h\n\
Print the help.\n");
if (badparam)
fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam);
}
bool getOptions(int argc, const char **argv)
{
const char *optarg_;
int c;
switch (c) {
case 'h': usage(argv[0], NULL); return false; break;
default:
usage(argv[0], optarg_);
return false; break;
}
}
if ((c == 1) || (c == -1)) {
usage(argv[0], NULL);
std::cerr << "ERROR: " << std::endl;
std::cerr << " Bad argument " << optarg_ << std::endl << std::endl;
return false;
}
return true;
}
int
main(int argc, const char ** argv)
{
try {
if (getOptions(argc, argv) == false) {
exit (-1);
}
V = 1.0;
vpTRACE(
"------------------------");
std::cout << V << std::endl;
vpTRACE(
"------------------------");
V.normalize();
vpTRACE(
"------------------------");
std::cout << V << std::endl;
return (0);
}
std::cout << "Catch an exception: " << e << std::endl;
return (1);
}
}