00001 // opencluster.cpp 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 #include <algorithm> 00011 #include <stdio.h> 00012 #include "celestia.h" 00013 #include <celmath/mathlib.h> 00014 #include <celutil/util.h> 00015 #include <celutil/debug.h> 00016 #include "astro.h" 00017 #include "opencluster.h" 00018 #include "meshmanager.h" 00019 #include "gl.h" 00020 #include "vecgl.h" 00021 #include "render.h" 00022 00023 using namespace std; 00024 00025 00026 OpenCluster::OpenCluster() 00027 { 00028 } 00029 00030 00031 const char* OpenCluster::getType() const 00032 { 00033 return "Cluster"; 00034 } 00035 00036 00037 void OpenCluster::setType(const std::string& typeStr) 00038 { 00039 } 00040 00041 00042 size_t OpenCluster::getDescription(char* buf, size_t bufLength) const 00043 { 00044 // Should use snprintf, but it's not available on Windows 00045 return sprintf(buf, _("%s"), getType()); 00046 } 00047 00048 00049 bool OpenCluster::load(AssociativeArray* params, const string& resPath) 00050 { 00051 // No parameters specific to open cluster, though a list of member stars 00052 // could be useful. 00053 return DeepSkyObject::load(params, resPath); 00054 } 00055 00056 00057 void OpenCluster::render(const GLContext&, 00058 const Vec3f& offset, 00059 const Quatf& viewerOrientation, 00060 float brightness, 00061 float pixelSize) 00062 { 00063 // Nothing to do right now; open clusters are only visible as their 00064 // constituent stars and a label when labels are turned on. A good idea 00065 // would be to add an 'sky chart' mode, in which clusters are rendered as 00066 // circles. 00067 } 00068 00069 00070 unsigned int OpenCluster::getRenderMask() const 00071 { 00072 return Renderer::ShowOpenClusters; 00073 } 00074 00075 00076 unsigned int OpenCluster::getLabelMask() const 00077 { 00078 return Renderer::OpenClusterLabels; 00079 }
1.4.1