forked from CelestiaProject/Celestia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopencluster.cpp
More file actions
89 lines (68 loc) · 2.13 KB
/
opencluster.cpp
File metadata and controls
89 lines (68 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// opencluster.cpp
//
// 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.
#include <config.h>
#include "render.h"
#include "astro.h"
#include "opencluster.h"
#include "meshmanager.h"
#include <celmath/mathlib.h>
#include <celutil/debug.h>
#include <celutil/gettext.h>
#include <algorithm>
using namespace Eigen;
using namespace std;
using namespace celmath;
const char* OpenCluster::getType() const
{
return "Open cluster";
}
void OpenCluster::setType(const std::string& /*typeStr*/)
{
}
string OpenCluster::getDescription() const
{
return _("Open cluster");
}
const char* OpenCluster::getObjTypeName() const
{
return "opencluster";
}
bool OpenCluster::pick(const Ray3d& ray,
double& distanceToPicker,
double& cosAngleToBoundCenter) const
{
// The preconditional sphere-ray intersection test is enough for now:
return DeepSkyObject::pick(ray, distanceToPicker, cosAngleToBoundCenter);
}
bool OpenCluster::load(AssociativeArray* params, const fs::path& resPath)
{
// No parameters specific to open cluster, though a list of member stars
// could be useful.
return DeepSkyObject::load(params, resPath);
}
void OpenCluster::render(const Vector3f& /*unused*/,
const Quaternionf& /*unused*/,
float /*unused*/,
float /*unused*/,
const Matrices& /*m*/,
Renderer* /*unused*/)
{
// Nothing to do right now; open clusters are only visible as their
// constituent stars and a label when labels are turned on. A good idea
// would be to add an 'sky chart' mode, in which clusters are rendered as
// circles.
}
uint64_t OpenCluster::getRenderMask() const
{
return Renderer::ShowOpenClusters;
}
unsigned int OpenCluster::getLabelMask() const
{
return Renderer::OpenClusterLabels;
}