LabelMgr.cpp   LabelMgr.cpp 
skipping to change at line 398 skipping to change at line 398
} }
void LabelMgr::init() void LabelMgr::init()
{ {
} }
void LabelMgr::draw(StelCore* core) void LabelMgr::draw(StelCore* core)
{ {
StelPainter sPainter(core->getProjection(StelCore::FrameJ2000)); StelPainter sPainter(core->getProjection(StelCore::FrameJ2000));
foreach(StelLabel* l, allLabels) foreach(StelLabel* l, allLabels)
if (l!=NULL) if (l!=Q_NULLPTR)
l->draw(core, sPainter); l->draw(core, sPainter);
} }
int LabelMgr::labelObject(const QString& text, int LabelMgr::labelObject(const QString& text,
const QString& objectName, const QString& objectName,
bool visible, bool visible,
float fontSize, float fontSize,
const QString& fontColor, const QString& fontColor,
const QString& side, const QString& side,
double labelDistance, double labelDistance,
skipping to change at line 421 skipping to change at line 421
QFont font; QFont font;
font.setPixelSize(fontSize); font.setPixelSize(fontSize);
StelObjectP obj = GETSTELMODULE(StelObjectMgr)->searchByName(objectN ame); StelObjectP obj = GETSTELMODULE(StelObjectMgr)->searchByName(objectN ame);
if (!obj) if (!obj)
{ {
qWarning() << "LabelMgr::labelObject object not found: " << objectName; qWarning() << "LabelMgr::labelObject object not found: " << objectName;
return -1; return -1;
} }
StelLabel* l = new SkyLabel(text, obj, font, StelUtils::htmlColorToV ec3f(fontColor), side, labelDistance, SkyLabel::stringToStyle(style)); StelLabel* l = new SkyLabel(text, obj, font, StelUtils::htmlColorToV ec3f(fontColor), side, labelDistance, SkyLabel::stringToStyle(style));
if (l==NULL) if (l==Q_NULLPTR)
return -1; return -1;
if (visible) if (visible)
l->setFlagShow(true); l->setFlagShow(true);
allLabels.append(l); allLabels.append(l);
return allLabels.size()-1; return allLabels.size()-1;
} }
int LabelMgr::labelHorizon(const QString& text, int LabelMgr::labelHorizon(const QString& text,
float az, float az,
float alt, float alt,
bool visible, bool visible,
float fontSize, float fontSize,
const QString& fontColor) const QString& fontColor)
{ {
QFont font; QFont font;
font.setPixelSize(fontSize); font.setPixelSize(fontSize);
HorizonLabel* l = new HorizonLabel(text, az, alt, font, StelUtils::h tmlColorToVec3f(fontColor)); HorizonLabel* l = new HorizonLabel(text, az, alt, font, StelUtils::h tmlColorToVec3f(fontColor));
if (l==NULL) if (l==Q_NULLPTR)
return -1; return -1;
if (visible) if (visible)
l->setFlagShow(true); l->setFlagShow(true);
allLabels.append(l); allLabels.append(l);
return allLabels.size()-1; return allLabels.size()-1;
} }
int LabelMgr::labelScreen(const QString& text, int LabelMgr::labelScreen(const QString& text,
int x, int x,
int y, int y,
bool visible, bool visible,
float fontSize, float fontSize,
const QString& fontColor) const QString& fontColor)
{ {
QFont font; QFont font;
font.setPixelSize(fontSize); font.setPixelSize(fontSize);
ScreenLabel* l = new ScreenLabel(text, x, y, font, StelUtils::htmlCo lorToVec3f(fontColor)); ScreenLabel* l = new ScreenLabel(text, x, y, font, StelUtils::htmlCo lorToVec3f(fontColor));
if (l==NULL) if (l==Q_NULLPTR)
return -1; return -1;
if (visible) if (visible)
l->setFlagShow(true); l->setFlagShow(true);
allLabels.append(l); allLabels.append(l);
return allLabels.size()-1; return allLabels.size()-1;
} }
bool LabelMgr::getLabelShow(int id) bool LabelMgr::getLabelShow(int id)
{ {
if (allLabels.at(id)!=NULL) if (allLabels.at(id)!=Q_NULLPTR)
return allLabels.at(id)->getFlagShow(); return allLabels.at(id)->getFlagShow();
else else
return false; return false;
} }
void LabelMgr::setLabelShow(int id, bool show) void LabelMgr::setLabelShow(int id, bool show)
{ {
if (allLabels.at(id)!=NULL) if (allLabels.at(id)!=Q_NULLPTR)
allLabels.at(id)->setFlagShow(show); allLabels.at(id)->setFlagShow(show);
} }
void LabelMgr::setLabelText(int id, const QString& newText) void LabelMgr::setLabelText(int id, const QString& newText)
{ {
if (allLabels.at(id)!=NULL) if (allLabels.at(id)!=Q_NULLPTR)
allLabels.at(id)->setText(newText); allLabels.at(id)->setText(newText);
} }
bool LabelMgr::deleteLabel(int id) bool LabelMgr::deleteLabel(int id)
{ {
if (id<0) if (id<0)
return false; return false;
if (allLabels.at(id)!=NULL) if (allLabels.at(id)!=Q_NULLPTR)
{ {
delete allLabels.at(id); delete allLabels.at(id);
allLabels[id] = NULL; allLabels[id] = Q_NULLPTR;
return true; return true;
} }
else else
return false; return false;
} }
void LabelMgr::update(double deltaTime) void LabelMgr::update(double deltaTime)
{ {
foreach(StelLabel* l, allLabels) foreach(StelLabel* l, allLabels)
if (l!=NULL) if (l!=Q_NULLPTR)
l->update(deltaTime); l->update(deltaTime);
} }
double LabelMgr::getCallOrder(StelModuleActionName actionName) const double LabelMgr::getCallOrder(StelModuleActionName actionName) const
{ {
if (actionName==StelModule::ActionDraw) if (actionName==StelModule::ActionDraw)
return StelApp::getInstance().getModuleMgr().getModule("Land scapeMgr")->getCallOrder(actionName)+11; return StelApp::getInstance().getModuleMgr().getModule("Land scapeMgr")->getCallOrder(actionName)+11;
return 0; return 0;
} }
int LabelMgr::deleteAllLabels(void) int LabelMgr::deleteAllLabels(void)
{ {
int count=0; int count=0;
foreach(StelLabel* l, allLabels) foreach(StelLabel* l, allLabels)
{ {
if (l!=NULL) if (l!=Q_NULLPTR)
{ {
delete l; delete l;
l=NULL; l=Q_NULLPTR;
count++; count++;
} }
} }
allLabels.clear(); allLabels.clear();
return count; return count;
} }
 End of changes. 12 change blocks. 
12 lines changed or deleted 12 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/