2003-01-26 19:04:46 -07:00
|
|
|
// deepskyobj.h
|
|
|
|
//
|
|
|
|
// Copyright (C) 2003, Chris Laurel <claurel@shatters.net>
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
#ifndef _CELENGINE_DEEPSKYOBJ_H_
|
|
|
|
#define _CELENGINE_DEEPSKYOBJ_H_
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <iostream>
|
|
|
|
#include <celmath/vecmath.h>
|
|
|
|
#include <celmath/quaternion.h>
|
2005-07-12 11:37:00 -06:00
|
|
|
#include <celengine/glcontext.h>
|
2003-01-26 19:04:46 -07:00
|
|
|
#include <celengine/parser.h>
|
|
|
|
|
|
|
|
|
2005-02-10 23:09:37 -07:00
|
|
|
class Nebula;
|
|
|
|
class Galaxy;
|
|
|
|
class OpenCluster;
|
|
|
|
|
2003-01-26 19:04:46 -07:00
|
|
|
class DeepSkyObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DeepSkyObject();
|
|
|
|
virtual ~DeepSkyObject();
|
|
|
|
|
|
|
|
std::string getName() const;
|
|
|
|
void setName(const std::string&);
|
|
|
|
|
|
|
|
Point3d getPosition() const;
|
|
|
|
void setPosition(Point3d);
|
|
|
|
|
|
|
|
Quatf getOrientation() const;
|
|
|
|
void setOrientation(Quatf);
|
|
|
|
|
|
|
|
float getRadius() const;
|
|
|
|
void setRadius(float);
|
|
|
|
|
2005-07-12 11:37:00 -06:00
|
|
|
float getAbsoluteMagnitude() const;
|
|
|
|
void setAbsoluteMagnitude(float);
|
|
|
|
|
2003-02-20 01:34:19 -07:00
|
|
|
std::string getInfoURL() const;
|
|
|
|
void setInfoURL(const std::string&);
|
|
|
|
|
2003-03-24 01:55:54 -07:00
|
|
|
virtual bool load(AssociativeArray*, const std::string& resPath);
|
2003-01-26 19:04:46 -07:00
|
|
|
|
2005-07-12 11:37:00 -06:00
|
|
|
virtual void render(const GLContext& context,
|
|
|
|
const Vec3f& offset,
|
2003-01-26 19:04:46 -07:00
|
|
|
const Quatf& viewerOrientation,
|
|
|
|
float brightness,
|
|
|
|
float pixelSize) = 0;
|
|
|
|
|
2005-02-10 23:09:37 -07:00
|
|
|
virtual unsigned int getRenderMask() { return 0; };
|
|
|
|
virtual unsigned int getLabelMask() { return 0; };
|
|
|
|
|
2003-01-26 19:04:46 -07:00
|
|
|
private:
|
|
|
|
std::string name;
|
|
|
|
Point3d position;
|
|
|
|
Quatf orientation;
|
|
|
|
float radius;
|
2005-07-12 11:37:00 -06:00
|
|
|
float absMag;
|
2003-02-20 01:34:19 -07:00
|
|
|
std::string* infoURL;
|
2003-01-26 19:04:46 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::vector<DeepSkyObject*> DeepSkyCatalog;
|
2003-03-24 01:55:54 -07:00
|
|
|
int LoadDeepSkyObjects(DeepSkyCatalog&, std::istream& in,
|
|
|
|
const std::string& path);
|
2003-01-26 19:04:46 -07:00
|
|
|
|
|
|
|
|
|
|
|
#endif // _CELENGINE_DEEPSKYOBJ_H_
|