pub struct SceneMap {Show 18 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>,
pub solid_aliases: HashMap<String, String>,
pub weld_prepared: HashMap<String, Vec<Preparation>>,
}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.
solid_aliases: HashMap<String, String>Legacy solid name -> the canonical resident name it stands for
(FeatureResult::solid_aliases). A resident solid of the legacy
name itself always wins; an alias whose canonical solid is consumed
(removed and not re-added by the same result) is dropped.
weld_prepared: HashMap<String, Vec<Preparation>>Solid name -> the welds that prepared it, in order, each with the
handle the name held before that weld (Vec = a chain: a part body
two welds prepared one after the other). A groove weld in an assembly
cuts its joint preparation into a COMPONENT MEMBER as an assembly-level
result: the prepared body replaces the member under its name in this
scene only, while the component (its record, its cache entry, every
other instance and the part document) keeps the unprepared body, the
chain’s first prior. Posing a member poses both bodies; a weld
withdrawn for a rebuild after the solve puts the name back on its
prior, so the re-cut never cuts twice. Written as each feature’s
result is applied to the map.
Implementations§
Source§impl SceneMap
impl SceneMap
Sourcepub fn resolve_component(&self, id: &str) -> Option<&ComponentRecord>
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.
Sourcepub fn owning_component(&self, name: &str) -> Option<&ComponentRecord>
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.
Sourcepub fn is_component_owned(&self, name: &str) -> bool
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.
Sourcepub fn iter_components(&self) -> impl Iterator<Item = &ComponentRecord>
pub fn iter_components(&self) -> impl Iterator<Item = &ComponentRecord>
Iterate the scene’s components in deterministic (id) order — the structure-tree / BOM projection surface.
Sourcepub fn component_solids(&self, id: &str) -> Vec<(String, u32)>
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.
Sourcepub fn occurrence_solids(&self, path: &str) -> Vec<(String, u32)>
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.
Sourcepub fn component_fixed(&self, id: &str) -> Option<bool>
pub fn component_fixed(&self, id: &str) -> Option<bool>
A component’s grounded flag (None for an unknown id).
Sourcepub fn set_component_fixed(&mut self, id: &str, fixed: bool) -> bool
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
impl SceneMap
Sourcepub fn context_member(&self, name: &str) -> Option<&Preparation>
pub fn context_member(&self, name: &str) -> Option<&Preparation>
The weld that prepared a component member in context and the
component’s own (unprepared) handle; None for any other name.
Sourcepub fn resolve_solid(&self, name: &str) -> Option<u32>
pub fn resolve_solid(&self, name: &str) -> Option<u32>
Resolve a solid name to its resident handle (exact match, then a
legacy alias of a resident solid — Self::solid_aliases).
Sourcepub fn resolve_face(&self, name: &str) -> Option<FaceRef>
pub fn resolve_face(&self, name: &str) -> Option<FaceRef>
Resolve a face name to its (handle, face_id) (exact match).
Sourcepub fn resolve_face_group(&self, name: &str) -> Vec<FaceRef>
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.
Sourcepub fn resolve_edge_group(&self, name: &str) -> Vec<EdgeRef>
pub fn resolve_edge_group(&self, name: &str) -> Vec<EdgeRef>
Every edge a name stands for — Self::resolve_face_group for edges.
Sourcepub fn resolve_edge(&self, name: &str) -> Option<EdgeRef>
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.
Sourcepub fn resolve_profile(&self, name: &str) -> Option<&SketchProfile>
pub fn resolve_profile(&self, name: &str) -> Option<&SketchProfile>
Resolve a profile reference name to the sketch profile it names, by THE
sketch-name rule (sketch_alias_lookup): {id}, {id}:PROFILE and the
display-sheet pick {id}:FACE all resolve to the one profile stored
under {id}.
Sourcepub fn resolve_profile_named<'a>(
&'a self,
name: &str,
) -> Option<(&'a str, &'a SketchProfile)>
pub fn resolve_profile_named<'a>( &'a self, name: &str, ) -> Option<(&'a str, &'a SketchProfile)>
Self::resolve_profile with the CANONICAL name the profile is stored
under — what a consumer names caps by and consumes. One call, so the
resolution and the canonical name can never disagree.
Sourcepub fn resolve_frame(&self, name: &str) -> Option<Frame>
pub fn resolve_frame(&self, name: &str) -> Option<Frame>
Resolve a named plane frame (exact match), for sketch/plane resolution.
Sourcepub fn resolve_axis(&self, name: &str) -> Option<Axis>
pub fn resolve_axis(&self, name: &str) -> Option<Axis>
Resolve a named axis line (exact match), for revolve/sweep.
Sourcepub fn resolve_path(&self, name: &str) -> Option<&Vec<NurbsCurve>>
pub fn resolve_path(&self, name: &str) -> Option<&Vec<NurbsCurve>>
Resolve a named path chain by THE sketch-name rule (sketch_alias_lookup),
for sweep/path_sweep/rib trajectories.
Sourcepub fn resolve_path_segment_names(
&self,
name: &str,
) -> Option<&Vec<Option<String>>>
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.
Sourcepub fn resolve_path_segment_axes(
&self,
name: &str,
) -> Option<&Vec<Option<Axis>>>
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.
Sourcepub fn resolve_point(&self, name: &str) -> Option<Vec3>
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).
Sourcepub fn resolve_port(&self, name: &str) -> Option<&PortRecord>
pub fn resolve_port(&self, name: &str) -> Option<&PortRecord>
Resolve a connection point by its address (exact match).
Sourcepub fn model_points_with_prefix(&self, prefix: &str) -> Vec<(String, Vec3)>
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.