MinorPlanet.cpp   MinorPlanet.cpp 
skipping to change at line 37 skipping to change at line 37
#include "StelTexture.hpp" #include "StelTexture.hpp"
#include "StelTextureMgr.hpp" #include "StelTextureMgr.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include <QRegExp> #include <QRegExp>
#include <QDebug> #include <QDebug>
MinorPlanet::MinorPlanet(const QString& englishName, MinorPlanet::MinorPlanet(const QString& englishName,
int flagLighting,
double radius, double radius,
double oblateness, double oblateness,
Vec3f halocolor, Vec3f halocolor,
float albedo, float albedo,
float roughness,
//float outgas_intensity,
//float outgas_falloff,
const QString& atexMapName, const QString& atexMapName,
const QString& aobjModelName,
posFuncType coordFunc, posFuncType coordFunc,
void* auserDataPtr, void* auserDataPtr,
OsculatingFunctType *osculatingFunc, OsculatingFunctType *osculatingFunc,
bool acloseOrbit, bool acloseOrbit,
bool hidden, bool hidden,
const QString &pTypeStr) const QString &pTypeStr)
: Planet (englishName, : Planet (englishName,
flagLighting,
radius, radius,
oblateness, oblateness,
halocolor, halocolor,
albedo, albedo,
roughness,
//0.f, // outgas_intensity,
//0.f, // outgas_falloff,
atexMapName, atexMapName,
"", "",
aobjModelName,
coordFunc, coordFunc,
auserDataPtr, auserDataPtr,
osculatingFunc, osculatingFunc,
acloseOrbit, acloseOrbit,
hidden, hidden,
false, //No atmosphere false, //No atmosphere
true, //Halo true, //Halo
pTypeStr), pTypeStr),
minorPlanetNumber(0), minorPlanetNumber(0),
absoluteMagnitude(0.0f),
slopeParameter(-1.0f), //== mark as uninitialized: used in getVMagni tude() slopeParameter(-1.0f), //== mark as uninitialized: used in getVMagni tude()
semiMajorAxis(0.), semiMajorAxis(0.),
nameIsProvisionalDesignation(false), nameIsProvisionalDesignation(false),
properName(englishName) properName(englishName)
{ {
eclipticPos=Vec3d(0.,0.,0.);
rotLocalToParent = Mat4d::identity();
texMap = StelApp::getInstance().getTextureManager().createTextureThr
ead(StelFileMgr::getInstallationDir()+"/textures/"+texMapName, StelTexture:
:StelTextureParams(true, GL_LINEAR, GL_REPEAT));
//TODO: Fix the name //TODO: Fix the name
// - Detect numeric prefix and set number if any // - Detect numeric prefix and set number if any
// - detect provisional designation // - detect provisional designation
// - create the HTML name // - create the HTML name
//Try to detect number //Try to detect number
//TODO: Move this to the minor planet parse code in the plug-in? //TODO: Move this to the minor planet parse code in the plug-in?
/* /*
QString name = englishName; QString name = englishName;
QRegExp bracketedNumberPrefixPattern("^\\((\\d+)\\)\\s"); QRegExp bracketedNumberPrefixPattern("^\\((\\d+)\\)\\s");
QRegExp freeNumberPrefixPattern("^(\\d+)\\s[A-Za-z]{3,}"); QRegExp freeNumberPrefixPattern("^(\\d+)\\s[A-Za-z]{3,}");
skipping to change at line 133 skipping to change at line 134
MinorPlanet::~MinorPlanet() MinorPlanet::~MinorPlanet()
{ {
//Do nothing for the moment //Do nothing for the moment
} }
void MinorPlanet::setSemiMajorAxis(double value) void MinorPlanet::setSemiMajorAxis(double value)
{ {
semiMajorAxis = value; semiMajorAxis = value;
// GZ: in case we have very many asteroids, this helps improving spe ed usually without sacrificing accuracy: // GZ: in case we have very many asteroids, this helps improving spe ed usually without sacrificing accuracy:
deltaJDE = 2.0*semiMajorAxis*StelCore::JD_SECOND; deltaJDE = 2.0*qMax(semiMajorAxis, 0.1)*StelCore::JD_SECOND;
} }
void MinorPlanet::setMinorPlanetNumber(int number) void MinorPlanet::setMinorPlanetNumber(int number)
{ {
if (minorPlanetNumber) if (minorPlanetNumber)
return; return;
minorPlanetNumber = number; minorPlanetNumber = number;
} }
void MinorPlanet::setAbsoluteMagnitudeAndSlope(double magnitude, double slo pe) void MinorPlanet::setAbsoluteMagnitudeAndSlope(const float magnitude, const float slope)
{ {
if (slope < 0 || slope > 1.0) if (slope < 0 || slope > 1.0)
{ {
qDebug() << "MinorPlanet::setAbsoluteMagnitudeAndSlope(): In valid slope parameter value (must be between 0 and 1)"; qDebug() << "MinorPlanet::setAbsoluteMagnitudeAndSlope(): In valid slope parameter value (must be between 0 and 1)";
return; return;
} }
//TODO: More checks? //TODO: More checks?
//TODO: Make it set-once like the number? //TODO: Make it set-once like the number?
 End of changes. 10 change blocks. 
11 lines changed or deleted 10 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/