00001 // deepskyobj.h 00002 // 00003 // Copyright (C) 2003, Chris Laurel <claurel@shatters.net> 00004 // 00005 // This program is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU General Public License 00007 // as published by the Free Software Foundation; either version 2 00008 // of the License, or (at your option) any later version. 00009 00010 #ifndef _CELENGINE_DEEPSKYOBJ_H_ 00011 #define _CELENGINE_DEEPSKYOBJ_H_ 00012 00013 #include <vector> 00014 #include <string> 00015 #include <iostream> 00016 #include <celutil/basictypes.h> 00017 #include <celmath/vecmath.h> 00018 #include <celmath/quaternion.h> 00019 #include <celengine/glcontext.h> 00020 #include <celengine/parser.h> 00021 00022 extern const float DSO_DEFAULT_ABS_MAGNITUDE; 00023 00024 class Nebula; 00025 class Galaxy; 00026 class OpenCluster; 00027 00028 class DeepSkyObject 00029 { 00030 public: 00031 DeepSkyObject(); 00032 virtual ~DeepSkyObject(); 00033 00034 inline uint32 getCatalogNumber() const 00035 { 00036 return catalogNumber; 00037 } 00038 void setCatalogNumber(uint32); 00039 00040 Point3d getPosition() const; 00041 void setPosition(const Point3d&); 00042 00043 virtual const char* getType() const = 0; 00044 virtual void setType(const std::string&) = 0; 00045 virtual size_t getDescription(char* buf, size_t bufLength) const; 00046 00047 Quatf getOrientation() const; 00048 void setOrientation(const Quatf&); 00049 00050 float getRadius() const; 00051 void setRadius(float); 00052 00053 float getAbsoluteMagnitude() const; 00054 void setAbsoluteMagnitude(float); 00055 00056 std::string getInfoURL() const; 00057 void setInfoURL(const std::string&); 00058 00059 virtual bool load(AssociativeArray*, const std::string& resPath); 00060 00061 virtual void render(const GLContext& context, 00062 const Vec3f& offset, 00063 const Quatf& viewerOrientation, 00064 float brightness, 00065 float pixelSize) = 0; 00066 00067 virtual unsigned int getRenderMask() const { return 0; } 00068 virtual unsigned int getLabelMask() const { return 0; } 00069 00070 enum 00071 { 00072 InvalidCatalogNumber = 0xffffffff 00073 }; 00074 00075 private: 00076 uint32 catalogNumber; 00077 Point3d position; 00078 Quatf orientation; 00079 float radius; 00080 float absMag; 00081 std::string* infoURL; 00082 }; 00083 00084 typedef std::vector<DeepSkyObject*> DeepSkyCatalog; 00085 int LoadDeepSkyObjects(DeepSkyCatalog&, std::istream& in, 00086 const std::string& path); 00087 00088 00089 #endif // _CELENGINE_DEEPSKYOBJ_H_
1.4.1