Constellation.hpp   Constellation.hpp 
skipping to change at line 24 skipping to change at line 24
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _CONSTELLATION_HPP_ #ifndef _CONSTELLATION_HPP_
#define _CONSTELLATION_HPP_ #define _CONSTELLATION_HPP_
#include <vector>
#include <QString>
#include <QFont>
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelFader.hpp" #include "StelFader.hpp"
#include "StelProjector.hpp" #include "StelTextureTypes.hpp"
#include "StelSphereGeometry.hpp" #include "StelSphereGeometry.hpp"
#include <vector>
#include <QString>
#include <QFont>
class StarMgr; class StarMgr;
class StelPainter;
//! @class Constellation //! @class Constellation
//! The Constellation class models a grouping of stars in a Sky Culture. //! The Constellation class models a grouping of stars in a Sky Culture.
//! Each Constellation consists of a list of stars identified by their //! Each Constellation consists of a list of stars identified by their
//! Hipparcos catalogue numbers, a name and optionally an abbreviated name, //! Hipparcos catalogue numbers, a name and optionally an abbreviated name,
//! boundary shape and an artistic pictorial representation. //! boundary shape and an artistic pictorial representation.
class Constellation : public StelObject class Constellation : public StelObject
{ {
friend class ConstellationMgr; friend class ConstellationMgr;
private: private:
skipping to change at line 79 skipping to change at line 80
//! @param record string containing the following whitespace //! @param record string containing the following whitespace
//! separated fields: abbreviation - a three character abbreviation //! separated fields: abbreviation - a three character abbreviation
//! for the constellation, a number of lines, and a list of Hipparco s //! for the constellation, a number of lines, and a list of Hipparco s
//! catalogue numbers which, when connected form the lines of the //! catalogue numbers which, when connected form the lines of the
//! constellation. //! constellation.
//! @param starMgr a pointer to the StarManager object. //! @param starMgr a pointer to the StarManager object.
//! @return false if can't parse record, else true. //! @return false if can't parse record, else true.
bool read(const QString& record, StarMgr *starMgr); bool read(const QString& record, StarMgr *starMgr);
//! Draw the constellation name. //! Draw the constellation name
//! void drawName(StelPainter& sPainter) const;
//! @param renderer Renderer to draw with. //! Draw the constellation art
//! @param projector Font to draw the name with. void drawArt(StelPainter& sPainter) const;
void drawName(class StelRenderer* renderer, QFont& font) const; //! Draw the constellation boundary
void drawBoundaryOptim(StelPainter& sPainter) const;
//! Draw the constellation boundary.
//!
//! @param renderer Renderer to draw with.
//! @param projector Projector to project vertices to viewport.
void drawBoundaryOptim(StelRenderer* renderer, StelProjectorP projec
tor) const;
//! Test if a star is part of a Constellation. //! Test if a star is part of a Constellation.
//! This member tests to see if a star is one of those which make up //! This member tests to see if a star is one of those which make up
//! the lines of a Constellation. //! the lines of a Constellation.
//! @return a pointer to the constellation which the star is a part of, //! @return a pointer to the constellation which the star is a part of,
//! or NULL if the star is not part of a constellation //! or NULL if the star is not part of a constellation
const Constellation* isStarIn(const StelObject*) const; const Constellation* isStarIn(const StelObject*) const;
//! Get the brightest star in a Constellation. //! Get the brightest star in a Constellation.
//! Checks all stars which make up the constellation lines, and retu rns //! Checks all stars which make up the constellation lines, and retu rns
//! a pointer to the one with the brightest apparent magnitude. //! a pointer to the one with the brightest apparent magnitude.
//! @return a pointer to the brightest star //! @return a pointer to the brightest star
StelObjectP getBrightestStarInConstellation(void) const; StelObjectP getBrightestStarInConstellation(void) const;
//! Get the translated name for the Constellation. //! Get the translated name for the Constellation.
QString getNameI18n() const {return nameI18;} QString getNameI18n() const {return nameI18;}
//! Get the English name for the Constellation (returns the abbrevia tion). //! Get the English name for the Constellation (returns the abbrevia tion).
QString getEnglishName() const {return abbreviation;} QString getEnglishName() const {return abbreviation;}
//! Get the short name for the Constellation (returns the abbreviati on). //! Get the short name for the Constellation (returns the abbreviati on).
QString getShortName() const {return abbreviation;} QString getShortName() const {return abbreviation;}
//! Generate the vertex buffer to draw constellation art.
//!
//! @param renderer Renderer to create the vertex buffer.
//! @param resolution Resolution of the vertex grid to draw art with
.
void generateArtVertices(class StelRenderer* renderer, const int res
olution);
//! Draw the lines for the Constellation. //! Draw the lines for the Constellation.
//! This method uses the coords of the stars (optimized for use thru //! This method uses the coords of the stars (optimized for use thru
//! the class ConstellationMgr only). //! the class ConstellationMgr only).
void drawOptim(class StelRenderer* renderer, StelProjectorP projecto void drawOptim(StelPainter& sPainter, const StelCore* core, const Sp
r, hericalCap& viewportHalfspace) const;
const StelCore* core, const SphericalCap& viewportHal
fspace) const;
//! Draw the art texture, optimized function to be called thru a con stellation manager only. //! Draw the art texture, optimized function to be called thru a con stellation manager only.
//! void drawArtOptim(StelPainter& sPainter, const SphericalRegion& regi
//! @param renderer Renderer to draw with. on) const;
//! @param projector Projector to project 3D coordinates to the view
port.
//! @param region Spherical region containing viewable area, used
for culling.
void drawArtOptim(class StelRenderer* renderer, StelProjectorP proje
ctor,
const SphericalRegion& region) const;
//! Update fade levels according to time since various events. //! Update fade levels according to time since various events.
void update(int deltaTime); void update(int deltaTime);
//! Turn on and off Constellation line rendering. //! Turn on and off Constellation line rendering.
//! @param b new state for line drawing. //! @param b new state for line drawing.
void setFlagLines(const bool b) {lineFader=b;} void setFlagLines(const bool b) {lineFader=b;}
//! Turn on and off Constellation boundary rendering. //! Turn on and off Constellation boundary rendering.
//! @param b new state for boundary drawing. //! @param b new state for boundary drawing.
void setFlagBoundaries(const bool b) {boundaryFader=b;} void setFlagBoundaries(const bool b) {boundaryFader=b;}
//! Turn on and off Constellation name label rendering. //! Turn on and off Constellation name label rendering.
//! @param b new state for name label drawing. //! @param b new state for name label drawing.
skipping to change at line 174 skipping to change at line 155
//! Abbreviation (of the latin name for western constellations) //! Abbreviation (of the latin name for western constellations)
QString abbreviation; QString abbreviation;
//! Direction vector pointing on constellation name drawing position //! Direction vector pointing on constellation name drawing position
Vec3d XYZname; Vec3d XYZname;
Vec3d XYname; Vec3d XYname;
//! Number of segments in the lines //! Number of segments in the lines
unsigned int numberOfSegments; unsigned int numberOfSegments;
//! List of stars forming the segments //! List of stars forming the segments
StelObjectP* asterism; StelObjectP* asterism;
class StelTextureNew* artTexture; StelTextureSP artTexture;
StelVertexArray artPolygon;
QString artTexturePath;
//! Vertex with a 3D position and a texture coordinate.
struct Vertex
{
Vec3f position;
Vec2f texCoord;
Vertex(const Vec3f& position, const Vec2f texCoord)
: position(position), texCoord(texCoord) {}
VERTEX_ATTRIBUTES(Vec3f Position, Vec2f TexCoord);
};
//! Vertex grid to draw constellation art on.
StelVertexBuffer<Vertex>* artVertices;
//! Index buffer representing triangles of the cells of the grid.
class StelIndexBuffer* artIndices;
SphericalCap boundingCap; SphericalCap boundingCap;
//! Define whether art, lines, names and boundary must be drawn //! Define whether art, lines, names and boundary must be drawn
LinearFader artFader, lineFader, nameFader, boundaryFader; LinearFader artFader, lineFader, nameFader, boundaryFader;
std::vector<std::vector<Vec3f> *> isolatedBoundarySegments; std::vector<std::vector<Vec3f> *> isolatedBoundarySegments;
std::vector<std::vector<Vec3f> *> sharedBoundarySegments; std::vector<std::vector<Vec3f> *> sharedBoundarySegments;
//! Matrix to transform art grid vertices from unnormalized texture
//! positions (pixel indices) to 3D coordinates to draw them at.
Mat4f texCoordTo3D;
//! Currently we only need one color for all constellations, this ma y change at some point //! Currently we only need one color for all constellations, this ma y change at some point
static Vec3f lineColor; static Vec3f lineColor;
static Vec3f labelColor; static Vec3f labelColor;
static Vec3f boundaryColor; static Vec3f boundaryColor;
static bool singleSelected; static bool singleSelected;
}; };
#endif // _CONSTELLATION_HPP_ #endif // _CONSTELLATION_HPP_
 End of changes. 10 change blocks. 
65 lines changed or deleted 18 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/