use hifitime::Epoch;
use snafu::prelude::*;
use crate::{
errors::PhysicsError, math::interpolation::InterpolationError, naif::daf::DAFError,
prelude::FrameUid, structure::dataset::DataSetError,
};
mod paths;
mod rotate_to_parent;
mod rotations;
#[derive(Debug, Snafu, PartialEq)]
#[snafu(visibility(pub(crate)))]
#[non_exhaustive]
pub enum OrientationError {
#[snafu(display(
"somehow you've entered code that should not be reachable, please file a bug."
))]
Unreachable,
#[snafu(display("could not {action} because {alias} is not loaded"))]
AliasNotFound { alias: String, action: &'static str },
#[snafu(display(
"Could not rotate from {from} to {to}: no common origin found at epoch {epoch}"
))]
RotationOrigin {
from: FrameUid,
to: FrameUid,
epoch: Epoch,
},
#[snafu(display("no orientation data loaded (must call load_bpc or DataSet::from_bytes)"))]
NoOrientationsLoaded,
#[snafu(display("when {action} caused {source}"))]
BPC {
action: &'static str,
#[snafu(backtrace)]
source: DAFError,
},
#[snafu(display("during an orientation operation: {source}"))]
OrientationPhysics {
#[snafu(backtrace)]
source: PhysicsError,
},
#[snafu(display("during an orientation interpolation {source}"))]
OrientationInterpolation {
#[snafu(backtrace)]
source: InterpolationError,
},
#[snafu(display("during an orientation query {source}"))]
OrientationDataSet {
#[snafu(backtrace)]
source: DataSetError,
},
#[snafu(display("unknown orientation ID associated with `{name}`"))]
OrientationNameToId { name: String },
}