Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JDetector
JCompass.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "
JGeometry3D/JPosition3D.hh
"
7
#include "
JDetector/JCompass.hh
"
8
#include "
JDetector/JCompassMatrix.hh
"
9
10
#include "
Jeep/JPrint.hh
"
11
#include "
Jeep/JParser.hh
"
12
#include "
Jeep/JMessage.hh
"
13
14
15
/**
16
* \file
17
*
18
* Example compass operations.
19
* \author mdejong
20
*/
21
int
main
(
int
argc,
char
**argv)
22
{
23
using namespace
std;
24
using namespace
JPP;
25
26
JCompass compass;
27
int
debug
;
28
29
try
{
30
31
JParser<>
zap;
32
33
zap[
'C'
] =
make_field
(compass) = JCompass();
34
zap[
'd'
] =
make_field
(
debug
) = 3;
35
36
zap(argc, argv);
37
}
38
catch
(
const
exception &error) {
39
FATAL
(error.what() << endl);
40
}
41
42
43
44
const
JCompassMatrix
R
(compass);
45
46
cout <<
"compass "
<< compass << endl;
47
cout << R << endl;
48
49
JPosition3D pos[] = {
50
JPosition3D(1, 0, 0),
51
JPosition3D(0, 1, 0),
52
JPosition3D(0, 0, 1)
53
};
54
55
for
(
int
i = 0; i !=
sizeof
(pos)/
sizeof
(pos[0]); ++i) {
56
57
cout << showpos <<
FIXED
(8,3) << pos[i] <<
" -> "
;
58
59
pos[i].rotate(R);
60
61
cout << showpos <<
FIXED
(8,3) << pos[i] << endl;
62
}
63
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JCompassMatrix.hh
FIXED
Auxiliary data structure for floating point format specification.
Definition:
JPrint.hh:481
JPosition3D.hh
JPrint.hh
I/O formatting auxiliaries.
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
debug
int debug
debug level
Definition:
JSirene.cc:61
R
then usage $script[distance] fi case set_variable R
Definition:
JDrawLED.sh:40
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
JCompass.hh
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5