Struct geo_aid::script::unroll::CompileContext
source · pub struct CompileContext {
pub variables: HashMap<String, AnyExpr>,
pub flags: FlagSet,
pub entities: Vec<Entity>,
pub rules: Vec<UnrolledRule>,
pub figure: PreFigure,
}
Expand description
The context of compilation process.
Fields§
§variables: HashMap<String, AnyExpr>
Variables
flags: FlagSet
Flags
entities: Vec<Entity>
Entities (primitives).
rules: Vec<UnrolledRule>
Unrolled rules
figure: PreFigure
Pre-compiled figure
Implementations§
source§impl CompileContext
impl CompileContext
pub fn new() -> Self
sourcepub fn get_entity(&self, i: usize) -> &Entity
pub fn get_entity(&self, i: usize) -> &Entity
Gets the entity of the given index.
sourcepub fn get_entity_mut(&mut self, i: usize) -> &mut Entity
pub fn get_entity_mut(&mut self, i: usize) -> &mut Entity
Gets the entity of the given index.
pub fn add_scalar(&mut self) -> usize
pub fn add_point(&mut self) -> usize
sourcepub fn get_point_by_index(&self, index: usize) -> Expr<UnrolledPoint>
pub fn get_point_by_index(&self, index: usize) -> Expr<UnrolledPoint>
Panics
Panics if given an invalid entity.
pub fn get_point_entity_mut( &mut self, expr: &Expr<UnrolledPoint> ) -> Option<&mut Point>
pub fn get_point_entity(&self, expr: &Expr<UnrolledPoint>) -> Option<&Point>
pub fn add_circle(&mut self) -> usize
sourcepub fn get_circle_by_index(&self, index: usize) -> Expr<UnrolledCircle>
pub fn get_circle_by_index(&self, index: usize) -> Expr<UnrolledCircle>
Panics
Panics if given an invalid expression.
sourcepub fn get_line_by_index(&self, index: usize) -> Expr<UnrolledLine>
pub fn get_line_by_index(&self, index: usize) -> Expr<UnrolledLine>
Panics
Panics if given an invalid expression.
source§impl CompileContext
impl CompileContext
Everything related to circles.
pub fn point_on_circle( &mut self, lhs: &Expr<UnrolledPoint>, rhs: &Expr<UnrolledCircle> )
pub fn point_on_line( &mut self, lhs: &Expr<UnrolledPoint>, rhs: &Expr<UnrolledLine> )
Trait Implementations§
source§impl Debug for CompileContext
impl Debug for CompileContext
Auto Trait Implementations§
impl !RefUnwindSafe for CompileContext
impl !Send for CompileContext
impl !Sync for CompileContext
impl Unpin for CompileContext
impl !UnwindSafe for CompileContext
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
Mutably borrows from an owned value. Read more