pub struct AddPart;Expand description
Places the part the program in another file builds, named by the
step’s id: its elements are then the part’s, behind that name (see
MateEntity).
The part goes where the program’s state <id>.pose puts it, and the
step adds its mates. It solves nothing: where every placed part is, so
that every mate of the program holds, is the program’s state, which the
editor solves for (see crate::mechanism). So every step sees each
placed part where it ends up, however late the mates that put it there
are.
Mates that cannot hold do not fail the step — the parts are left as near to holding them as they get, as a sketch whose constraints conflict is — and the step’s editor says which.
The parts placed in the part placed are this program’s to move too:
their poses are its state, behind the step’s id, which the part placed
is run with — starting where its own program has them — and their mates
come up with its constraints, to hold them here as they held them there
(see [geop_core_program::instance]).
A Mate::fixed_here among its mates, given no entity, holds the part this
step places.
Trait Implementations§
impl Copy for AddPart
Source§impl<'de> Deserialize<'de> for AddPart
impl<'de> Deserialize<'de> for AddPart
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Editable for AddPart
impl Editable for AddPart
const INFO: OperationInfo = <AddPart as ::geop_core_editor::part_operation::PartOperation>::INFO
Source§type EditingState = FormState<<AddPart as PartOperation>::Session>
type EditingState = FormState<<AddPart as PartOperation>::Session>
Source§fn new_args(context: &Context<'_>) -> Self::Args
fn new_args(context: &Context<'_>) -> Self::Args
Source§fn presentation(
context: &Context<'_>,
args: &Self::Args,
editing: &Self::EditingState,
) -> Form
fn presentation( context: &Context<'_>, args: &Self::Args, editing: &Self::EditingState, ) -> Form
Source§fn process_user_event(
context: &Context<'_>,
args: &Self::Args,
editing: &Self::EditingState,
event: Event,
) -> (Self::Args, Self::EditingState)
fn process_user_event( context: &Context<'_>, args: &Self::Args, editing: &Self::EditingState, event: Event, ) -> (Self::Args, Self::EditingState)
event.Source§impl Operation for AddPart
impl Operation for AddPart
Source§const KIND: &'static str = <AddPart as ::geop_core_editor::part_operation::PartOperation>::KIND
const KIND: &'static str = <AddPart as ::geop_core_editor::part_operation::PartOperation>::KIND
Source§type Args = <AddPart as PartOperation>::Args
type Args = <AddPart as PartOperation>::Args
Source§fn run(ctx: &mut StepContext<'_>, args: &Self::Args) -> __GeopResult<()>
fn run(ctx: &mut StepContext<'_>, args: &Self::Args) -> __GeopResult<()>
ctx (see
StepContext::produce): cheap, since it runs in every run. What
takes work is done in the makes, which run only when what they read
changed.Source§impl PartOperation for AddPart
impl PartOperation for AddPart
Source§fn new_args(context: &Context<'_>) -> AddPartArgs
fn new_args(context: &Context<'_>) -> AddPartArgs
No file yet; the first part placed is fixed, the ones after it are
not — something has to stay put for the others to mate to — until
a joint or a constraint is chosen for it, which then holds it (see
crate::editor).
Source§fn begin_event(session: &mut PartSession)
fn begin_event(session: &mut PartSession)
Pulls released at the event before are let go of.
Source§fn run(ctx: &mut StepContext<'_>, args: &AddPartArgs) -> GeopResult<()>
fn run(ctx: &mut StepContext<'_>, args: &AddPartArgs) -> GeopResult<()>
Places the part, then defines each mate: resolved, and as
constraints on the state; and lets a solve move the part, as far as
its mates let it. A mate that cannot be resolved fails the step,
after the others are defined. The placed part’s own mates come up
with its constraints (see geop_lib_constraints::Constraints::of).
Source§fn form<'a>(
context: &'a Context<'a>,
args: &AddPartArgs,
editing: &PartEditing,
) -> EditForm<'a, AddPartArgs, PartSession>
fn form<'a>( context: &'a Context<'a>, args: &AddPartArgs, editing: &PartEditing, ) -> EditForm<'a, AddPartArgs, PartSession>
The file, where it goes, and its mates: see crate::editor.
Source§fn canvas(
context: &Context<'_>,
edit: Edit<'_, AddPartArgs, PartSession>,
event: &CanvasEvent,
)
fn canvas( context: &Context<'_>, edit: Edit<'_, AddPartArgs, PartSession>, event: &CanvasEvent, )
The part dragged; Delete removes the mate selected, Escape stops
editing it: see crate::editor.
const INFO: OperationInfo
Source§type Args = AddPartArgs
type Args = AddPartArgs
Source§type Session = PartSession
type Session = PartSession
() for most.