AMDAPlugin.cc
6.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* -*- Base: 10 ; Mode: C++ -*- */
/*------------------------------------------------------------------------
**
FOST project
**
--------------------------------------------------------------------------
--------------------------------------------------------------------------
FILE LOG
$Revision: 1.3 $ $Date: 2012-06-15 13:04:42 $
--------------------------------------------------------------------------
CREATION
V.SAC
SUMMARY
DESCRIPTION
The main function performs the following actions :
<ul>
<li>
</ul>
------------------------------------------------------------------------*/
/**
*/
//=============================================================================
// Include section
//=============================================================================
// Standard libraries include files
//-----------------------------------------------------------------------------
#include <iostream>
// Include oriented definitions
//-----------------------------------------------------------------------------
// Module Kernel include files
//-----------------------------------------------------------------------------
#include "DicError.hh"
#include "AMDA_exception.hh"
#include "ServicesServer.hh"
#include "PluginManager.hh"
#include "CurveFunctionWriter.hh"
#include "Boundaries.hh"
#include <math.h>
using namespace AMDA::Parameters;
using namespace plot;
// Other modules include files
//-----------------------------------------------------------------------------
/**
* @details This procedure return the curve definition of a circle.
*/
void circle(double precision, CurveFunctionWriter::AttributeList& pAttributeList, CurveFunctionWriter::CurvePointList& curvePointList) {
//radius
double radius = 1.;
CurveFunctionWriter::AttributeList::iterator lradiusIt = pAttributeList.find("radius");
if (lradiusIt != pAttributeList.end())
radius = lradiusIt->second;
for (int i = 0; i < precision; ++i) {
CurveFunctionWriter::CurvePoint point;
double theta = (2. * M_PI) * (double) (((double) i) / precision);
point.x = radius * cos(theta);
point.y = radius * sin(theta);
point.z = radius * cos(theta);
// std::cout << "BRE - " << point.x << " - " << point.y << " - " << point.z << std::endl;
curvePointList.push_back(point);
}
}
//=============================================================================
// Methods of Class AMDAPlugin
//=============================================================================
/**
Retrieve the Plugin version we're going to expect
*/
extern "C" const char* getPluginVersion() {
return "(Version)";
}
/**
Tells us to register our functionality to an engine kernel
*/
extern "C" void registerPlugin(AMDA::Plugins::PluginManager & pm) {
std::string pluginPath = pm.getCurrentPluginPath();
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("bowshock", &bowshock);
ServicesServer::getInstance()->linkProcessWithPlugin("bowshock", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("bowshock_farris", &bowshock_farris);
ServicesServer::getInstance()->linkProcessWithPlugin("bowshock_farris", pluginPath);
// Elena TBD : id in plotCurves.xml acts as function name - to change Request generation procedure
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("mars_bowshock", &bowshock);
ServicesServer::getInstance()->linkProcessWithPlugin("mars_bowshock", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("mars_bowshock_hall", &bowshock);
ServicesServer::getInstance()->linkProcessWithPlugin("mars_bowshock_hall", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("venus_bowshock", &bowshock);
ServicesServer::getInstance()->linkProcessWithPlugin("venus_bowshock", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("mercury_bowshock", &bowshock);
ServicesServer::getInstance()->linkProcessWithPlugin("mercury_bowshock", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("saturn_bowshock_went", &saturn_bowshock_went);
ServicesServer::getInstance()->linkProcessWithPlugin("saturn_bowshock_went", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("jupiter_bowshock_high", &bowshock1);
ServicesServer::getInstance()->linkProcessWithPlugin("jupiter_bowshock_high", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("jupiter_bowshock_low", &bowshock1);
ServicesServer::getInstance()->linkProcessWithPlugin("jupiter_bowshock_low", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("jupiter_magnetopause_high", &bowshock1);
ServicesServer::getInstance()->linkProcessWithPlugin("jupiter_magnetopause_high", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("jupiter_magnetopause_low", &bowshock1);
ServicesServer::getInstance()->linkProcessWithPlugin("jupiter_magnetopause_low", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("venus_magnetopause", &venus_magnetopause);
ServicesServer::getInstance()->linkProcessWithPlugin("venus_magnetopause", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("mars_magnetopause", &mars_magnetopause);
ServicesServer::getInstance()->linkProcessWithPlugin("mars_magnetopause", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("mercury_magnetopause", &mercury_magnetopause);
ServicesServer::getInstance()->linkProcessWithPlugin("mercury_magnetopause", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("saturn_magnetopause", &saturn_magnetopause);
ServicesServer::getInstance()->linkProcessWithPlugin("saturn_magnetopause", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("magnetopause_shue", &magnetopause_shue);
ServicesServer::getInstance()->linkProcessWithPlugin("magnetopause_shue", pluginPath);
ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("circle", &circle);
ServicesServer::getInstance()->linkProcessWithPlugin("circle", pluginPath);
}