Blame view

src/ExternLib/PlotCurves/AMDAPlugin.cc 4.92 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* -*- 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>

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

fbe3c2bb   Benjamin Renard   First commit
25
26
27
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
60
61
62
63
64
65
66
67
 * @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;

fbe3c2bb   Benjamin Renard   First commit
68
69
70
71
	for (int i = 0; i < precision; ++i)
	{
		CurveFunctionWriter::CurvePoint point;

c6a67968   Benjamin Renard   Fix some violatio...
72
		double theta = (2. * M_PI) * (double)(((double)i) / precision);
fbe3c2bb   Benjamin Renard   First commit
73
74
75
76
77
78
79
80
81
82
83
		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
//=============================================================================

fbe3c2bb   Benjamin Renard   First commit
84
85
86
87
88
89
90
91
92
93
94
95
96
/**
   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*/)
{
dcb3af16   Elena.Budnik   additional plotCu...
97
98
99
100
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("bowshock",&bowshock);
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("bowshock_farris",&bowshock_farris);
	// Elena TBD : id in plotCurves.xml acts as function name - to change Request generation procedure
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("mars_bowshock",&bowshock);
cfe48f34   Elena.Budnik   mars bowshoack hall
101
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("mars_bowshock_hall",&bowshock);
adc30892   Elena.Budnik   correct venus bow...
102
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("venus_bowshock",&bowshock);
dcb3af16   Elena.Budnik   additional plotCu...
103
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("mercury_bowshock",&bowshock);
06d878e9   Elena.Budnik   Saturn bowshock Went
104
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("saturn_bowshock_went",&saturn_bowshock_went);
adc30892   Elena.Budnik   correct venus bow...
105
106
107
108
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("jupiter_bowshock_high",&bowshock1);
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("jupiter_bowshock_low",&bowshock1);
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("jupiter_magnetopause_high",&bowshock1);
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("jupiter_magnetopause_low",&bowshock1);
fbe3c2bb   Benjamin Renard   First commit
109
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("venus_magnetopause",&venus_magnetopause);
dcb3af16   Elena.Budnik   additional plotCu...
110
111
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("mars_magnetopause",&mars_magnetopause);
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("mercury_magnetopause",&mercury_magnetopause);
8944ec40   Elena.Budnik   saturn magnetopus...
112
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("saturn_magnetopause",&saturn_magnetopause);
dcb3af16   Elena.Budnik   additional plotCu...
113
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("magnetopause_shue",&magnetopause_shue);
fbe3c2bb   Benjamin Renard   First commit
114
115
	ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("circle",&circle);
}