SimpleDrawLine.cpp   SimpleDrawLine.cpp 
skipping to change at line 26 skipping to change at line 26
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "SimpleDrawLine.hpp" #include "SimpleDrawLine.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "renderer/StelRenderer.hpp" #include "StelPainter.hpp"
#include "renderer/StelCircleArcRenderer.hpp"
#include <QDebug> #include <QDebug>
/************************************************************************* /*************************************************************************
This method is the one called automatically by the StelModuleMgr just This method is the one called automatically by the StelModuleMgr just
after loading the dynamic library after loading the dynamic library
*************************************************************************/ *************************************************************************/
StelModule* SimpleDrawLineStelPluginInterface::getStelModule() const StelModule* SimpleDrawLineStelPluginInterface::getStelModule() const
{ {
return new SimpleDrawLine(); return new SimpleDrawLine();
skipping to change at line 51 skipping to change at line 50
{ {
StelPluginInfo info; StelPluginInfo info;
info.id = "SimpleDrawLine"; info.id = "SimpleDrawLine";
info.displayedName = "Simple draw line test plugin"; info.displayedName = "Simple draw line test plugin";
info.authors = "Stellarium team"; info.authors = "Stellarium team";
info.contact = "www.stellarium.org"; info.contact = "www.stellarium.org";
info.description = "An minimal plugin example for drawing lines."; info.description = "An minimal plugin example for drawing lines.";
return info; return info;
} }
Q_EXPORT_PLUGIN2(SimpleDrawLine, SimpleDrawLineStelPluginInterface)
/************************************************************************* /*************************************************************************
Constructor Constructor
*************************************************************************/ *************************************************************************/
SimpleDrawLine::SimpleDrawLine() SimpleDrawLine::SimpleDrawLine()
{ {
setObjectName("SimpleDrawLine"); setObjectName("SimpleDrawLine");
font.setPixelSize(25); font.setPixelSize(25);
} }
/************************************************************************* /*************************************************************************
skipping to change at line 90 skipping to change at line 87
Init our module Init our module
*************************************************************************/ *************************************************************************/
void SimpleDrawLine::init() void SimpleDrawLine::init()
{ {
qDebug() << "init called for SimpleDrawLine"; qDebug() << "init called for SimpleDrawLine";
} }
/************************************************************************* /*************************************************************************
Draw our module. This should draw line in the main window Draw our module. This should draw line in the main window
*************************************************************************/ *************************************************************************/
void SimpleDrawLine::draw(StelCore* core, StelRenderer* renderer) void SimpleDrawLine::draw(StelCore* core)
{ {
const StelProjectorP prj = core->getProjection(StelCore::FrameAltAz) ; const StelProjectorP prj = core->getProjection(StelCore::FrameAltAz) ;
StelPainter painter(prj);
Vec3d startPoint, endPoint; Vec3d startPoint, endPoint;
double lon1, lat1, lon2, lat2; double lon1, lat1, lon2, lat2;
lon1 = StelUtils::getDecAngle("10d"); lon1 = StelUtils::getDecAngle("10d");
lat1 = StelUtils::getDecAngle("-5d"); lat1 = StelUtils::getDecAngle("-5d");
lon2 = StelUtils::getDecAngle("73d"); lon2 = StelUtils::getDecAngle("73d");
lat2 = StelUtils::getDecAngle("80d"); lat2 = StelUtils::getDecAngle("80d");
StelUtils::spheToRect(lon1,lat1,startPoint); StelUtils::spheToRect(lon1,lat1,startPoint);
StelUtils::spheToRect(lon2,lat2,endPoint); StelUtils::spheToRect(lon2,lat2,endPoint);
renderer->setGlobalColor(1.f, 0.5f, 0.5f, 1.f); painter.setColor(1.f, 0.5f, 0.5f, 1.f);
StelCircleArcRenderer circleArcRenderer = StelCircleArcRenderer(rend painter.drawGreatCircleArc(startPoint, endPoint);
erer, prj);
circleArcRenderer.drawGreatCircleArc(startPoint, endPoint);
} }
 End of changes. 5 change blocks. 
9 lines changed or deleted 5 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/