Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

galaxy.h

Go to the documentation of this file.
00001 // galaxy.h
00002 //
00003 // Copyright (C) 2001, 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 _GALAXY_H_
00011 #define _GALAXY_H_
00012 
00013 #include <vector>
00014 #include <string>
00015 #include <iostream>
00016 #include <celmath/vecmath.h>
00017 #include <celmath/quaternion.h>
00018 #include <celengine/deepskyobj.h>
00019 
00020 
00021 
00022 struct Blob
00023 {
00024     Point3f        position;
00025     unsigned int   colorIndex; 
00026     float          brightness;
00027 };  
00028 
00029 struct GalacticForm
00030 {
00031     std::vector<Blob>* blobs;
00032     Vec3f scale;
00033 };
00034 
00035 class Galaxy : public DeepSkyObject
00036 {
00037  public:
00038     Galaxy();
00039 
00040     virtual const char* getType() const;
00041     virtual void setType(const std::string&);
00042     virtual size_t getDescription(char* buf, size_t bufLength) const;
00043 
00044     float getDetail() const;
00045     void setDetail(float);
00046     //    float getBrightness() const;
00047     //    void setBrightness();
00048 
00049     virtual bool load(AssociativeArray*, const std::string&);
00050     virtual void render(const GLContext& context,
00051                         const Vec3f& offset,
00052                         const Quatf& viewerOrientation,
00053                         float brightness,
00054                         float pixelSize);
00055     virtual void renderGalaxyPointSprites(const GLContext& context,
00056                                           const Vec3f& offset,
00057                                           const Quatf& viewerOrientation,
00058                                           float brightness,
00059                                           float pixelSize);
00060     virtual void renderGalaxyEllipsoid(const GLContext& context,
00061                                        const Vec3f& offset,
00062                                        const Quatf& viewerOrientation,
00063                                        float brightness,
00064                                        float pixelSize);
00065 
00066     GalacticForm* getForm() const;
00067 
00068     static void  increaseLightGain();
00069     static void  decreaseLightGain();
00070     static float getLightGain();
00071     static void  setLightGain(float);
00072     static void hsv2rgb( float *r, float *g, float *b, float h, float s, float v );
00073 
00074     virtual unsigned int getRenderMask() const;
00075     virtual unsigned int getLabelMask() const;
00076 
00077  public:
00078     enum GalaxyType {
00079         S0   =  0,
00080         Sa   =  1,
00081         Sb   =  2,
00082         Sc   =  3,
00083         SBa  =  4,
00084         SBb  =  5,
00085         SBc  =  6,
00086         E0   =  7,
00087         E1   =  8,
00088         E2   =  9,
00089         E3   = 10,
00090         E4   = 11, 
00091         E5   = 12,
00092         E6   = 13,
00093         E7   = 14,
00094         Irr  = 15
00095     };
00096         
00097  private:    
00098     float detail;
00099     //    float brightness;
00100     GalaxyType type;
00101     GalacticForm* form;
00102 
00103     static float lightGain;
00104 };
00105 
00106 //std::ostream& operator<<(std::ostream& s, const Galaxy::GalaxyType& sc);
00107 
00108 #endif // _GALAXY_H_

Generated on Sat Jan 14 22:30:27 2006 for Celestia by  doxygen 1.4.1