Commit d89cd042 authored by Csaba Kertesz's avatar Csaba Kertesz

Fix the Android build errors

parent 32ffa486
include_directories(
${kstars_SOURCE_DIR}/kstars
${kstars_SOURCE_DIR}/kstars/tools
${kstars_SOURCE_DIR}/kstars/skyobjects
${kstars_SOURCE_DIR}/kstars/skycomponents
......
......@@ -26,6 +26,7 @@
#include "skymapcomposite.h"
#include <QApplication>
#include <QImage>
#if !defined(KSTARS_LITE) && defined(HAVE_WCSLIB)
#include <wcshdr.h>
......
......@@ -29,11 +29,13 @@
#include <fitsio.h>
#include <QRect>
#include <QRectF>
#ifndef KSTARS_LITE
#include "fitshistogram.h"
#include <kxmlguiwindow.h>
#ifdef HAVE_WCSLIB
#include <wcs.h>
#endif
......
......@@ -23,6 +23,7 @@
#include "rootnode.h"
#include "labelsitem.h"
#include "satellite.h"
#include "skylabeler.h"
#include "skynodes/satellitenode.h"
......
......@@ -13,20 +13,22 @@
* (at your option) any later version. *
* *
***************************************************************************/
#include "skyobject.h"
#include "Options.h"
#include <QSGSimpleTextureNode>
#include <QQuickWindow>
#include "deepskynode.h"
#include "nodes/pointnode.h"
#include "deepskyobject.h"
#include "dsosymbolnode.h"
#include "labelnode.h"
#include "Options.h"
#include "skyobject.h"
#include "trixelnode.h"
#include "deepskyobject.h"
#include "nodes/pointnode.h"
#include "../rootnode.h"
#include "../labelsitem.h"
#include "labelnode.h"
#include <QSGSimpleTextureNode>
#include <QQuickWindow>
DeepSkyNode::DeepSkyNode(DeepSkyObject *skyObject, DSOSymbolNode *symbol, LabelsItem::label_t labelType, short trixel)
: m_dso(skyObject), m_objImg(0), m_symbol(symbol), m_trixel(trixel), m_labelType(labelType), m_label(0)
......
......@@ -13,8 +13,9 @@
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef DEEPSKYNODE_H_
#define DEEPSKYNODE_H_
#pragma once
#include "skynode.h"
#include "../labelsitem.h"
......@@ -25,7 +26,8 @@ class LabelNode;
class QSGSimpleTextureNode;
class DSOSymbolNode;
/** @class DeepSkyNode
/**
* @class DeepSkyNode
*
* @short A SkyNode derived class used for displaying DeepSkyObjects.
*
......@@ -42,42 +44,42 @@ class DeepSkyNode : public SkyNode
{
public:
/**
* @short Constructor.
* @param skyObject - DSOs that is represented by this node
* @param symbol - DSOSymbolNode of this DSO
* @param trixel - trixelID, with which this node is indexed
*/
* @short Constructor.
* @param skyObject - DSOs that is represented by this node
* @param symbol - DSOSymbolNode of this DSO
* @param trixel - trixelID, with which this node is indexed
*/
DeepSkyNode(DeepSkyObject *skyObject, DSOSymbolNode *symbol, LabelsItem::label_t labelType, short trixel = -1);
/**
* @short Destructor. Call delete routines of label
*/
* @short Destructor. Call delete routines of label
*/
virtual ~DeepSkyNode();
/**
* @short changePos changes the position of this node and rotate it according to m_angle
* @param pos new position
*/
void changePos(QPointF pos);
* @short changePos changes the position of this node and rotate it according to m_angle
* @param pos new position
*/
virtual void changePos(QPointF pos) override;
/**
* @short Update position and visibility of this node
* @param drawImage - true if image (if exists) should be drawn
* @param drawLabel - true if label should be drawn
* @param pos - new position of the object. If default parameter is passed, the visibility and
* position of node is calculated.
* There is one case when we pass this parameter - in DeepSkyItem::updateDeepSkyNode() when
* we check whether DeepSkyObject is visible or no and instantiate it accordingly. There is no
* need to calculate the position again and we pass it as a parameter.
*/
* @short Update position and visibility of this node
* @param drawImage - true if image (if exists) should be drawn
* @param drawLabel - true if label should be drawn
* @param pos - new position of the object. If default parameter is passed, the visibility and
* position of node is calculated.
* There is one case when we pass this parameter - in DeepSkyItem::updateDeepSkyNode() when
* we check whether DeepSkyObject is visible or no and instantiate it accordingly. There is no
* need to calculate the position again and we pass it as a parameter.
*/
void update(bool drawImage, bool drawLabel, QPointF pos = QPointF(-1, -1));
virtual void hide() override;
/**
* @short sets color of DSO symbol and label
* To not increase the code for symbols we just recreate the symbol painted with desired color
* @param symbolTrixel the TrixelNode to which symbol node should be appended
*/
* @short sets color of DSO symbol and label
* To not increase the code for symbols we just recreate the symbol painted with desired color
* @param symbolTrixel the TrixelNode to which symbol node should be appended
*/
void setColor(QColor color, TrixelNode *symbolTrixel);
DeepSkyObject *dsObject() { return m_dso; }
......@@ -95,5 +97,3 @@ class DeepSkyNode : public SkyNode
float m_angle;
QPointF pos;
};
#endif
......@@ -13,13 +13,14 @@
* (at your option) any later version. *
* *
***************************************************************************/
#include "skyobject.h"
#include "Options.h"
#include <QSGSimpleTextureNode>
#include "guidelabelnode.h"
#include "Options.h"
#include "skymaplite.h"
#include "guidelabelnode.h"
#include "skyobject.h"
#include <QSGSimpleTextureNode>
GuideLabelNode::GuideLabelNode(QString name, LabelsItem::label_t type)
: m_textTexture(new QSGSimpleTextureNode), m_name(name)
......
......@@ -13,11 +13,12 @@
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef GUIDELABELNODE_H_
#define GUIDELABELNODE_H_
#pragma once
#include "skynode.h"
#include "../labelsitem.h"
#include <QSGSimpleRectNode>
class PlanetItemNode;
......@@ -26,7 +27,8 @@ class PointNode;
class QSGSimpleTextureNode;
class SkyLabeler;
/** @class GuideLabelNode
/**
* @class GuideLabelNode
* Currently this class is not used anywhere.
*
*@author Artem Fedoskin
......@@ -39,27 +41,28 @@ class GuideLabelNode : public SkyNode
{
public:
/**
* @short Constructor
* @param skyObject pointer to SkyObject that has to be displayed on SkyMapLite
* @param parentNode pointer to the top parent node, which holds texture cache
* @param spType spectral class of PointNode
* @param size initial size of PointNode
*/
* @short Constructor
* @param skyObject pointer to SkyObject that has to be displayed on SkyMapLite
* @param parentNode pointer to the top parent node, which holds texture cache
* @param spType spectral class of PointNode
* @param size initial size of PointNode
*/
GuideLabelNode(QString name, LabelsItem::label_t type);
/**
* @short changePos changes the position m_point
* @param pos new position
*/
* @short changePos changes the position m_point
* @param pos new position
*/
virtual void changePos(QPointF pos) override;
/**
* @short setLabelPos sets the position of label with the given offset from SkyObject's position and
* makes the label visible if it was hidden
* @param pos position of label
*/
* @short setLabelPos sets the position of label with the given offset from SkyObject's position and
* makes the label visible if it was hidden
* @param pos position of label
*/
void setLabelPos(QPointF pos, float angle);
void update();
virtual void update() override;
inline const QString name() const { return m_name; }
......@@ -79,5 +82,3 @@ class GuideLabelNode : public SkyNode
QPointF m_translatePos;
};
#endif
......@@ -13,6 +13,7 @@
* (at your option) any later version. *
* *
***************************************************************************/
#include "skyobject.h"
#include "Options.h"
......
......@@ -13,8 +13,8 @@
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef LABELNODE_H_
#define LABELNODE_H_
#pragma once
#include "skynode.h"
#include "../labelsitem.h"
......@@ -26,45 +26,46 @@ class QSGSimpleTextureNode;
class SkyLabeler;
class RootNode;
/** @class LabelNode
/**
* @class LabelNode
*
*@short A SkyNode derived class used for displaying labels
*@author Artem Fedoskin
*@version 1.0
* @short A SkyNode derived class used for displaying labels
* @author Artem Fedoskin
* @version 1.0
*/
class LabelNode : public SkyNode
{
public:
/**
* @short Constructor. Use name of skyObject as a text
* @param skyObject - target object, for which this label is created.
* @param type - type of label (corresponds to type of SkyObject)
*/
* @short Constructor. Use name of skyObject as a text
* @param skyObject - target object, for which this label is created.
* @param type - type of label (corresponds to type of SkyObject)
*/
LabelNode(SkyObject *skyObject, LabelsItem::label_t type);
/**
* @short Constructor. Use string parameter name as a text
* @param skyObject - text of label
* @param type - type of label (corresponds to type of SkyObject)
*/
* @short Constructor. Use string parameter name as a text
* @param skyObject - text of label
* @param type - type of label (corresponds to type of SkyObject)
*/
LabelNode(QString name, LabelsItem::label_t type);
/**
* @short Destructor.
*/
* @short Destructor.
*/
virtual ~LabelNode();
/**
* @short Convenience function to not to repeat the same code in 2 constructors. Set parameters of label
* based on its type
*/
* @short Convenience function to not to repeat the same code in 2 constructors. Set parameters of label
* based on its type
*/
void initialize();
/**
* @short Changes position of the label
* @param pos - new position
*/
* @short Changes position of the label
* @param pos - new position
*/
virtual void changePos(QPointF pos) override;
inline QString name() { return m_name; }
......@@ -72,30 +73,30 @@ class LabelNode : public SkyNode
inline LabelsItem::label_t labelType() { return m_labelType; }
/**
* @short Create texture from label's name
* @param color - color of the label
*/
* @short Create texture from label's name
* @param color - color of the label
*/
void createTexture(QColor color = QColor());
/**
* @return true if the size of text depends on zoom
*/
* @return true if the size of text depends on zoom
*/
inline bool zoomFont() { return m_zoomFont; }
/**
* @short set the position of label with the given offset from SkyObject's position and
* makes the label visible if it was hidden
* @warning Keep mind that to update labels position, you should first set it with setLabelPos()
* and then call update()
* @param pos position of label
*/
* @short set the position of label with the given offset from SkyObject's position and
* makes the label visible if it was hidden
* @warning Keep mind that to update labels position, you should first set it with setLabelPos()
* and then call update()
* @param pos position of label
*/
void setLabelPos(QPointF pos);
/**
* @short Update position of label according to labelPos and recreate texture if label's size
* depends on zoom level
*/
void update();
* @short Update position of label according to labelPos and recreate texture if label's size
* depends on zoom level
*/
virtual void update() override;
QPointF labelPos;
......@@ -110,5 +111,3 @@ class LabelNode : public SkyNode
QString m_schemeColor;
QColor m_color;
};
#endif
......@@ -15,19 +15,21 @@
***************************************************************************/
#include "satellitenode.h"
#include "satellite.h"
#include "nodes/polynode.h"
#include "Options.h"
#include "ksutils.h"
#include "labelnode.h"
#include "linelist.h"
#include "Options.h"
#include "satellite.h"
#include "nodes/pointnode.h"
#include <QSGFlatColorMaterial>
#include "nodes/polynode.h"
#include "../rootnode.h"
#include "../labelsitem.h"
#include "labelnode.h"
#include <QSGFlatColorMaterial>
SatelliteNode::SatelliteNode(Satellite *sat, RootNode *rootNode)
: m_sat(sat), m_rootNode(rootNode), m_lines(0), m_label(0), m_point(0)
: m_sat(sat), m_rootNode(rootNode)
{
}
......
......@@ -13,8 +13,9 @@
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef SATELLITENODE_H_
#define SATELLITENODE_H_
#pragma once
#include "skynode.h"
class PolyNode;
......@@ -23,41 +24,43 @@ class PointNode;
class QSGFlatColorMaterial;
class LabelNode;
/** @class SatelliteNode
/**
* @class SatelliteNode
*
*@short A SkyNode derived class that represents satellite
*@author Artem Fedoskin
*@version 1.0
* @short A SkyNode derived class that represents satellite
* @author Artem Fedoskin
* @version 1.0
*/
class SatelliteNode : public SkyNode
{
public:
/**
* @short Constructor.
* @param sat - satellite that is represented by this node
* @param rootNode - pointer to the top parent node
*/
* @short Constructor.
* @param sat - satellite that is represented by this node
* @param rootNode - pointer to the top parent node
*/
SatelliteNode(Satellite *sat, RootNode *rootNode);
/**
* @short Update position and visibility of satellite.
* We also check user settings (Options::drawSatellitesLikeStars()) and based on that draw satellite
* either like star or with lines
*/
* @short Update position and visibility of satellite.
* We also check user settings (Options::drawSatellitesLikeStars()) and based on that draw satellite
* either like star or with lines
*/
virtual void update() override;
virtual void hide() override;
/**
* @short Initialize m_lines (if not already) to draw satellite with lines
*/
* @short Initialize m_lines (if not already) to draw satellite with lines
*/
void initLines();
/**
* @short Initialize m_point (if not already) to draw satellite as a star
*/
* @short Initialize m_point (if not already) to draw satellite as a star
*/
void initPoint();
void changePos(QPointF pos);
virtual void changePos(QPointF pos) override;
inline Satellite *sat() { return m_sat; }
......@@ -65,15 +68,13 @@ class SatelliteNode : public SkyNode
Satellite *m_sat;
RootNode *m_rootNode;
SkyOpacityNode *m_linesOpacity;
QSGGeometryNode *m_lines;
SkyOpacityNode *m_linesOpacity { nullptr };
QSGGeometryNode *m_lines { nullptr };
LabelNode *m_label;
LabelNode *m_label { nullptr };
QSGFlatColorMaterial *m_material;
QSGGeometry *m_geometry;
QSGFlatColorMaterial *m_material { nullptr };
QSGGeometry *m_geometry { nullptr };
PointNode *m_point;
PointNode *m_point { nullptr };
};
#endif
......@@ -14,9 +14,10 @@
* *
***************************************************************************/
#include "skymaplite.h"
#include "skynode.h"
#include "skymaplite.h"
SkyNode::SkyNode(SkyObject *skyObject)
: m_opacity(new SkyOpacityNode), m_skyObject(skyObject), m_drawLabel(false), m_hideCount(0)
{
......
......@@ -13,19 +13,20 @@
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef SKYNODE_H_
#define SKYNODE_H_
#include <QSGTransformNode>
#pragma once
#include "skymaplite.h"
#include "projections/projector.h"
#include "../skyopacitynode.h"
#include <QSGTransformNode>
class Projector;
class SkyMapLite;
/** @class SkyNode
/**
* @class SkyNode
*
* A QSGTransformNode derived class that has to be subclassed by node containers like PlanetNode and
* PointSourceNode. SkyObject * that is passed as parameter to constructor is used in subclasses
......@@ -41,66 +42,68 @@ class SkyNode : public QSGTransformNode
{
public:
/**
* @brief Constructor
* @param skyObject that is represented on the SkyMapLIte
*/
* @brief Constructor
* @param skyObject that is represented on the SkyMapLIte
*/
SkyNode(SkyObject *skyObject);
SkyNode();
/** @short short function that returns pointer to the current projector
* @return pointer to current projector of SkyMapLite
*/
/**
* @short short function that returns pointer to the current projector
* @return pointer to current projector of SkyMapLite
*/
// All children nodes allocated on heap are deleted when parent is destroyed
/// All children nodes allocated on heap are deleted when parent is destroyed
virtual ~SkyNode() {}
inline const Projector *projector() { return SkyMapLite::Instance()->projector(); }
/** @short short function to access SkyMapLite
* @return pointer to instance of SkyMapLite class
*/
/**
* @short short function to access SkyMapLite
* @return pointer to instance of SkyMapLite class
*/
inline SkyMapLite *map() const { return SkyMapLite::Instance(); }
/**
* @short updates coordinate of the object on SkyMapLite
*/
* @short updates coordinate of the object on SkyMapLite
*/
virtual void update() {}
/**
* @short sets m_drawLabel to true if it is needed to be drawn and calls update()
* @param drawLabel true of label has to be drawn
*/
* @short sets m_drawLabel to true if it is needed to be drawn and calls update()
* @param drawLabel true of label has to be drawn
*/
void update(bool drawLabel);
inline void addChildNode(QSGNode *node) { m_opacity->appendChildNode(node); }
/**
* @short hides all child nodes (sets opacity of m_opacity to 0)
*/
* @short hides all child nodes (sets opacity of m_opacity to 0)
*/
virtual void hide();
/**
* @short shows all child nodes (sets opacity of m_opacity to 1)
*/
* @short shows all child nodes (sets opacity of m_opacity to 1)
*/
virtual void show();
inline int hideCount() { return m_hideCount; }
/**
* @short changes the position of SkyNode on SkyMapLite. Has to be overridden by the classes
* that support moving
* @param pos new position
*/
* @short changes the position of SkyNode on SkyMapLite. Has to be overridden by the classes
* that support moving
* @param pos new position
*/
virtual void changePos(QPointF pos) { Q_UNUSED(pos); }
/**
* @return true if object is visible (m_opacity->opacity() != 0) else returns false
*/
* @return true if object is visible (m_opacity->opacity() != 0) else returns false
*/
inline bool visible() { return m_opacity->visible(); }
/**
* @short returns SkyObject associated with this SkyNode