StelFont.hpp   StelRegionObject.hpp 
/* /*
* Stellarium * Copyright (C) 2009 Fabien Chereau
* Copyright (C) 2002 Fabien Chereau
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef _STELFONT_HPP_ #ifndef _STELREGIONOBJECT_HPP_
#define _STELFONT_HPP_ #define _STELREGIONOBJECT_HPP_
#ifdef HAVE_CONFIG_H #include <QSharedPointer>
# include <config.h> #include "StelSphereGeometry.hpp"
#endif
#include <QString>
#include <QChar>
#include "typeface.h"
/* //! Simple abstract class defining basic methods implemented by all objects
* Wrapper class on the TypeFace class used to display fonts in openGL that need
*/ //! to be stored in a StelSphericalIndex.
class StelFont class StelRegionObject
{ {
public: public:
StelFont(float sizeI, const QString& ttfFileName); virtual ~StelRegionObject(void) {;}
~StelFont() {;}
void print(float x, float y, const QString& s, int upsidedown = 1) c
onst
{
typeFace.render(s, Vec2f(x, y), upsidedown==1);
}
void printChar(const QChar c) const
{
typeFace.renderGlyphs(c);
}
void printCharOutlined(const QChar c) const;
float getStrLen(const QString& s) const {return typeFace.width(s);}
float getLineHeight(void) const {return typeFace.lineHeight();}
float getAscent(void) const {return typeFace.ascent();}
float getDescent(void) const {return typeFace.descent();}
float getSize(void) const {return typeFace.pointSize();}
mutable TypeFace typeFace; //! Return the spatial region of the object.
virtual SphericalRegionP getRegion() const=0;
}; };
#endif // _STELFONT_HPP_ //! @typedef StelRegionObjectP
//! Shared pointer on a StelRegionObject with smart pointers
typedef QSharedPointer<StelRegionObject> StelRegionObjectP;
#endif // _STELGRIDOBJECT_HPP_
 End of changes. 7 change blocks. 
37 lines changed or deleted 13 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/