pub struct SceneMap {Show 15 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 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.
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
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 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 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).
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. 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}.
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 (exact match; also strips a trailing :PROFILE),
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.