siderust-cpp 0.8.0
Header-only C++ wrapper for siderust
Loading...
Searching...
No Matches
trackable.hpp File Reference

Abstract base class for all celestial targets. More...

#include "altitude.hpp"
#include "azimuth.hpp"
#include "coordinates.hpp"
#include "time.hpp"
#include <memory>
#include <string>
#include <vector>
Include dependency graph for trackable.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  siderust::Target
 Abstract base for any celestial object that can be tracked from an observer location. More...
 

Namespaces

namespace  siderust
 

Typedefs

using siderust::Trackable = Target
 Backward-compatible alias. Prefer Target in new code.
 

Detailed Description

Abstract base class for all celestial targets.

Target is the unified concept for anything in the sky that can be pointed at from an observer location. Concrete implementations cover:

  • DirectionTarget — fixed spherical direction in any supported frame (ICRS, equatorial, ecliptic). Aliased as ICRSTarget, etc.
  • StarTarget — adapter for Star catalog objects
  • BodyTarget — solar-system bodies (Sun, Moon, planets)
  • *(future)* SatelliteTarget — Earth-orbiting satellites (TLE/SGP4)

Every Target carries a human-readable name(). Use std::unique_ptr<Target> to hold heterogeneous collections.

Example

auto sun = std::make_unique<siderust::BodyTarget>(siderust::Body::Sun);
std::cout << sun->name() << "\n"; // "Sun"
qtty::Degree alt = sun->altitude_at(obs, now);
// Polymorphic usage
std::vector<std::unique_ptr<siderust::Target>> targets;
targets.push_back(std::move(sun));
targets.push_back(std::make_unique<siderust::StarTarget>(VEGA));
for (const auto& t : targets) {
std::cout << t->name() << ": " << t->altitude_at(obs, now) << "\n";
}

Definition in file trackable.hpp.