Skip to main content

SceneMap

Struct SceneMap 

Source
pub struct SceneMap {
Show 16 fields pub solids: HashMap<String, u32>, pub faces: HashMap<String, FaceRef>, pub edges: HashMap<String, EdgeRef>, pub face_groups: HashMap<String, Vec<String>>, pub edge_groups: HashMap<String, Vec<String>>, pub profiles: HashMap<String, SketchProfile>, pub frames: HashMap<String, Frame>, pub axes: HashMap<String, Axis>, pub paths: HashMap<String, Vec<NurbsCurve>>, pub path_segment_names: HashMap<String, Vec<Option<String>>>, pub path_segment_axes: HashMap<String, Vec<Option<Axis>>>, pub points: HashMap<String, ScenePoint>, pub ports: HashMap<String, PortRecord>, pub components: BTreeMap<String, ComponentRecord>, pub occurrences: BTreeMap<String, ComponentRecord>, pub name_collisions: Vec<String>,
}
Expand description

The live scene-map. Exact-match resolution only (contract rule 1).

Fields§

§solids: HashMap<String, u32>§faces: HashMap<String, FaceRef>§edges: HashMap<String, EdgeRef>§face_groups: HashMap<String, Vec<String>>

CONTAINER name -> the faces it stands for. A profile-swept feature names each of its per-loop caps individually ({cap_base}:L{loopId}_START) and registers the un-keyed {cap_base}_START here as the name of the whole sketch container — every cap the feature made. So the name a model saved before per-loop naming still resolves, and still means the right thing: the one cap on a single-loop sketch, all of them on a multi-loop one.

§edge_groups: HashMap<String, Vec<String>>

CONTAINER name -> the edges it stands for. The derived edge-name convention embeds face names ({faceA}|{faceB}[n]), so keying the caps renamed every cap-adjacent edge too; this holds the container-name spelling of each such edge for the same reason Self::face_groups does.

§profiles: HashMap<String, SketchProfile>

Sketch name -> its extracted profile. Populated by SKETCH features; read by profile-consumers via SceneMap::resolve_profile.

§frames: HashMap<String, Frame>

Plane name -> its frame. Populated by DATUM/PLANE features; read by SKETCH (and PLANE datum-refs) via SceneMap::resolve_frame for headless plane resolution (fully headless).

§axes: HashMap<String, Axis>

Axis name -> its world line. Populated by SKETCH line geometries; read by revolve/sweep via SceneMap::resolve_axis.

§paths: HashMap<String, Vec<NurbsCurve>>

Path name -> its ordered world curve chain (open or closed). Populated by SKETCH features; read by sweep/path_sweep/rib via SceneMap::resolve_path.

§path_segment_names: HashMap<String, Vec<Option<String>>>

Path name -> the SOURCE NAME of each curve in its chain, parallel to the Self::paths entry of the same name. Populated by SKETCH features; read by the SWEEP via SceneMap::resolve_path_segment_names so the faces one path SEGMENT builds carry that segment’s name rather than its position.

§path_segment_axes: HashMap<String, Vec<Option<Axis>>>

Path name -> the SCREW AXIS of each curve in its chain (Some for a helix), parallel to the Self::paths entry of the same name. Populated by HELIX features; read by the SWEEP via SceneMap::resolve_path_segment_axes.

§points: HashMap<String, ScenePoint>

Point name -> its world position + construction flag. Populated by SKETCH features ({sketchId}:P{pid}), splines and helices; read by hole placement via SceneMap::model_points_with_prefix and by name via SceneMap::resolve_point.

§ports: HashMap<String, PortRecord>

Connection-point ADDRESS -> its record. Populated by the ports tail (the document’s declared points), by WAYPOINT features and by ACOMP (a placed part’s points, namespaced and posed); read by SPLINE attachments (SceneMap::resolve_port) and by the wire-harness tail, which builds its sided routing graph from it.

§components: BTreeMap<String, ComponentRecord>

Owning feature id -> component record (assemblies). Populated by ACOMP features via the components side-channel; the whole component API surface (resolve_component / owning_component / the fence predicate) lives in component.rs. Empty in every componentless scene — nothing in the ordinary modeling path reads or writes it.

§occurrences: BTreeMap<String, ComponentRecord>

The occurrences of FLEXIBLE sub-assembly instances (ACOMP1:ACOMP2), registered by the constraint run (assembly::flexible) as bodies the solver moves individually. Not components: the tree and BOM never see them; their solids stay members of the placing instance too.

§name_collisions: Vec<String>

Naming-contract guard (accumulated across SceneMap::apply calls): one message per detected cross-solid name COLLISION — an added solid’s face / edge name that already maps to a DIFFERENT still-resident solid. Two live solids must never share a face/edge name (the SceneMap is a global name → one-solid map). execute_history surfaces any collision introduced by a freshly-run feature as that feature’s error, so the offending operation trips its own tests + shows an error in the app.

Implementations§

Source§

impl SceneMap

Source

pub fn resolve_component(&self, id: &str) -> Option<&ComponentRecord>

Resolve a component record by its owning feature id (exact match). Contract surface for the Wave-2 constraint/selection lanes.

Source

pub fn owning_component(&self, name: &str) -> Option<&ComponentRecord>

The component owning an entity name, if any: the BARE component id itself (a COMPONENT-type selection), or the name’s OUTERMOST namespace prefix (ACOMP3:ACOMP1:X is owned by ACOMP3 at this scene level; ACOMP1 is the nested assembly’s internal structure). Membership is decided against the registered component set, never syntactically — authored names like S1:PROFILE have a first segment that is a sketch id, not a component id.

Source

pub fn is_component_owned(&self, name: &str) -> bool

The feature-fence predicate: does this entity name belong to a component? Cheap (one map probe + one prefix probe); the dispatch fence (enforce_reference_fence) uses it to REJECT component geometry as modeling-feature input.

Source

pub fn iter_components(&self) -> impl Iterator<Item = &ComponentRecord>

Iterate the scene’s components in deterministic (id) order — the structure-tree / BOM projection surface.

Source

pub fn component_solids(&self, id: &str) -> Vec<(String, u32)>

A component’s member solids as (scene name, resident handle), in the record’s member order. A member missing from the solid map (never the case for an intact scene) is skipped.

Source

pub fn occurrence_solids(&self, path: &str) -> Vec<(String, u32)>

The member solids of an occurrence path: a component’s (or a flexible occurrence’s) own record, else every solid named under the path, which is how a placement inside a rigid sub-assembly is reached (ACOMP1:ACOMP2 → ACOMP1:ACOMP2:Pin), in name order.

Source

pub fn component_fixed(&self, id: &str) -> Option<bool>

A component’s grounded flag (None for an unknown id).

Source

pub fn set_component_fixed(&mut self, id: &str, fixed: bool) -> bool

Set a component’s grounded flag. Scene-view state only — the authoritative flag is the owning feature’s isFixed (the Fixed constraint / tree action writes THERE; this keeps the live scene in sync between runs). Returns false for an unknown id.

Source§

impl SceneMap

Source

pub fn resolve_solid(&self, name: &str) -> Option<u32>

Resolve a solid name to its resident handle (exact match).

Source

pub fn resolve_face(&self, name: &str) -> Option<FaceRef>

Resolve a face name to its (handle, face_id) (exact match).

Source

pub fn resolve_face_group(&self, name: &str) -> Vec<FaceRef>

Every face a name stands for: the one exact match, else the members of the container by that name (possibly several). The multi-face resolution the selection-list consumers use — Self::resolve_face is its single-face sibling.

Source

pub fn resolve_edge_group(&self, name: &str) -> Vec<EdgeRef>

Every edge a name stands for — Self::resolve_face_group for edges.

Source

pub fn resolve_edge(&self, name: &str) -> Option<EdgeRef>

Resolve an edge name to its (handle, edge_id) (exact match). Contract surface for edge-selecting fan-out features (fillet/chamfer); no implemented feature consumes it yet.

Source

pub fn resolve_profile(&self, name: &str) -> Option<&SketchProfile>

Resolve a profile reference name to the sketch profile it names. Tries the exact name first, then the name with a trailing :PROFILE stripped — a sketch is selectable both by its group name ({id}) and by its profile face name ({id}:PROFILE); both must resolve to the one profile stored under {id}.

Source

pub fn resolve_frame(&self, name: &str) -> Option<Frame>

Resolve a named plane frame (exact match), for sketch/plane resolution.

Source

pub fn resolve_axis(&self, name: &str) -> Option<Axis>

Resolve a named axis line (exact match), for revolve/sweep.

Source

pub fn resolve_path(&self, name: &str) -> Option<&Vec<NurbsCurve>>

Resolve a named path chain (exact match; also strips a trailing :PROFILE), for sweep/path_sweep/rib trajectories.

Source

pub fn resolve_path_segment_names( &self, name: &str, ) -> Option<&Vec<Option<String>>>

The per-segment SOURCE NAMES of a named path chain, resolved exactly as SceneMap::resolve_path resolves the chain itself (so the two always answer for the same entry). None when the publisher named no segments — the caller then falls back to naming by the reference itself.

Source

pub fn resolve_path_segment_axes( &self, name: &str, ) -> Option<&Vec<Option<Axis>>>

The per-segment SCREW AXES of a named path chain, resolved exactly as SceneMap::resolve_path resolves the chain itself. None when the publisher recorded none — every segment is then an ordinary curve.

Source

pub fn resolve_point(&self, name: &str) -> Option<Vec3>

Resolve a named world point (exact match), for hole/placement centers. Contract surface consumed by the spline/hole placement tests; kept as the documented point-resolution API even where no shipping feature reads it yet (mirrors resolve_edge).

Source

pub fn resolve_port(&self, name: &str) -> Option<&PortRecord>

Resolve a connection point by its address (exact match).

Source

pub fn model_points_with_prefix(&self, prefix: &str) -> Vec<(String, Vec3)>

Every MODEL (non-construction) point whose name starts with prefix, as (name, position) pairs in map order (the caller sorts). The scene-map indexes points by exact name only, so a consumer that wants “all the points of sketch S” prefix-scans S:P — safe because the prefix ends in :P, which another sketch id cannot spell into (S1:P never prefixes S10:P…). Construction points (the sketcher’s ◐ toggle, materialized external references) are skipped: they constrain, they never model.

Trait Implementations§

Source§

impl Clone for SceneMap

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SceneMap

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SceneMap

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more