Blame view

src/ExternLib/PlotCurves/AMDAPlugin.cc 6.77 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
/* -*- Base: 10 ; Mode: C++ -*- */
/*------------------------------------------------------------------------
9517e2ec   Hacene SI HADJ MOHAND   ok test ok
3
4
5
 **	
                                FOST project
 **
fbe3c2bb   Benjamin Renard   First commit
6
7
--------------------------------------------------------------------------
--------------------------------------------------------------------------
9517e2ec   Hacene SI HADJ MOHAND   ok test ok
8
9
                                FILE LOG
                $Revision: 1.3 $    $Date: 2012-06-15 13:04:42 $
fbe3c2bb   Benjamin Renard   First commit
10
11
--------------------------------------------------------------------------
CREATION
9517e2ec   Hacene SI HADJ MOHAND   ok test ok
12
        V.SAC
fbe3c2bb   Benjamin Renard   First commit
13
14
15
16
17

SUMMARY

DESCRIPTION

9517e2ec   Hacene SI HADJ MOHAND   ok test ok
18
19
20
21
        The main function performs the following actions :
        <ul>
        <li>
        </ul>
fbe3c2bb   Benjamin Renard   First commit
22
23
24

------------------------------------------------------------------------*/

fbe3c2bb   Benjamin Renard   First commit
25
26
/**

9517e2ec   Hacene SI HADJ MOHAND   ok test ok
27
 */
fbe3c2bb   Benjamin Renard   First commit
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//=============================================================================
// 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"
dcb3af16   Elena.Budnik   additional plotCu...
47
#include "Boundaries.hh"
fbe3c2bb   Benjamin Renard   First commit
48
49
50
51
52
53
54
55
56
57

#include <math.h>

using namespace AMDA::Parameters;
using namespace plot;

// Other modules include files
//-----------------------------------------------------------------------------

/**
fbe3c2bb   Benjamin Renard   First commit
58
59
 * @details This procedure return the curve definition of a circle.
 */
9517e2ec   Hacene SI HADJ MOHAND   ok test ok
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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);
    }
fbe3c2bb   Benjamin Renard   First commit
77
78
79
80
81
}
//=============================================================================
// Methods of Class AMDAPlugin
//=============================================================================

fbe3c2bb   Benjamin Renard   First commit
82
83
/**
   Retrieve the Plugin version we're going to expect
9517e2ec   Hacene SI HADJ MOHAND   ok test ok
84
85
86
 */
extern "C" const char* getPluginVersion() {
    return "(Version)";
fbe3c2bb   Benjamin Renard   First commit
87
88
89
90
}

/**
   Tells us to register our functionality to an engine kernel
9517e2ec   Hacene SI HADJ MOHAND   ok test ok
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
 */
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);
fbe3c2bb   Benjamin Renard   First commit
144
}