pub struct Point {
pub position: Vec3,
pub direction: Vec3,
pub area: f32,
pub gravity: f32,
pub eclipse: Etype,
pub flux: f32,
}Expand description
Struct defining a point on the surface of a model grid (e.g. of a star or disc etc.)
A Point has a position, a direction which is the surface normal, an area,
a relative gravity, a vector of phase pairs defining when the point is eclipsed by
another model component, and a flux.
Fields§
§position: Vec3§direction: Vec3§area: f32§gravity: f32§eclipse: Etype§flux: f32Implementations§
Source§impl Point
impl Point
Sourcepub fn new(
position: Vec3,
direction: Vec3,
area: f64,
gravity: f64,
eclipse: Etype,
) -> Self
pub fn new( position: Vec3, direction: Vec3, area: f64, gravity: f64, eclipse: Etype, ) -> Self
Creates a new Point.
Sourcepub fn is_visible(&self, phase: f64) -> bool
pub fn is_visible(&self, phase: f64) -> bool
checks that the given phase is not during one of the phase ranges when the point is eclipsed.
Sourcepub fn is_visible_phase_normed(&self, phase: f64) -> bool
pub fn is_visible_phase_normed(&self, phase: f64) -> bool
This version of is_visible will not correct for phases outside of expected range to speed up large loops. run phase = phase - phase.floor(); outside of loop beforehand
Trait Implementations§
Source§impl<'py> IntoPyObject<'py> for Point
impl<'py> IntoPyObject<'py> for Point
Source§type Output = Bound<'py, <Point as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <Point as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClassImpl for Point
impl PyClassImpl for Point
Source§const MODULE: Option<&str> = ::core::option::Option::None
const MODULE: Option<&str> = ::core::option::Option::None
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = ///
/// Struct defining a point on the surface of a model grid (e.g. of a star or disc etc.)
/// A `Point` has a position, a direction which is the surface normal, an area,
/// a relative gravity, a vector of phase pairs defining when the point is eclipsed by
/// another model component, and a flux.
///
const RAW_DOC: &'static CStr = /// /// Struct defining a point on the surface of a model grid (e.g. of a star or disc etc.) /// A `Point` has a position, a direction which is the surface normal, an area, /// a relative gravity, a vector of phase pairs defining when the point is eclipsed by /// another model component, and a flux. ///
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type Layout = <<Point as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<Point>
type Layout = <<Point as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<Point>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
Source§fn dict_offset() -> Option<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
Source§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
Source§impl PyClassNewTextSignature for Point
impl PyClassNewTextSignature for Point
const TEXT_SIGNATURE: &'static str = "(position, direction, area, gravity, eclipse)"
Source§impl PyMethods<Point> for PyClassImplCollector<Point>
impl PyMethods<Point> for PyClassImplCollector<Point>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for Point
impl PyTypeInfo for Point
Source§const NAME: &str = <Self as ::pyo3::PyClass>::NAME
const NAME: &str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
Source§const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
impl DerefToPyAny for Point
Auto Trait Implementations§
impl Freeze for Point
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnsafeUnpin for Point
impl UnwindSafe for Point
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.