Repository navigation
Story: Edit compound curves in place #42
Description
Edit compound curves in place
As a developer using spatial-types,
I want to modify the ordered components of a compound curve,
so that compound paths can evolve while retaining their component curve structure.
Context
Parent Epic: #38.
CompoundCurve must expose mutable membership without flattening its curve components or checking geometric continuity.
Depends on #39 for shared public contracts and explicit immutable naming, and on #41 for mutable LineString and CircularString components (#41 depends on #40).
Acceptance Criteria
-
Mutable CompoundCurve is available in every supported layout with the constructor family parameter defaulting to Geometry.
-
Consumers can append, insert, remove and replace curve components and replace the complete ordered component sequence.
-
Components retain their spatial type, ordinates and order rather than being flattened or approximated.
-
Construction and component-mutation methods accept only mutable curve objects of the supported component types. Immutable curve components are rejected without implicit conversion or copying.
-
Technical component typing is enforced without checking geometric continuity, closure or coordinate completeness.
-
Changes to family or declared reference do not recalculate coordinates; instance type and dimension remain fixed.
-
Supplied mutable curve components are retained by reference, without cloning, during construction, append, insertion and replacement; component getters expose those same instances. Changes to a component or its points are visible in every compound curve referencing it.
-
The declared-SRID, spatial-reference and spatial-mode setters each accept a second boolean propagation parameter defaulting to true. When true, the change reaches the compound curve, every contained curve and all of their points recursively, without coordinate recalculation. When false, only the compound curve changes.
-
Propagation modifies the existing shared instances; other owners of those instances observe the change.
-
Component indices start at zero. Insertion at the component count appends; indexed access, replacement and removal require an existing component.
-
Every successful mutation returns the receiver with return type static for chaining.
-
Invalid addressing or technical input failures leave the compound curve and its referenced components unchanged. Mutable CompoundCurve exposes mutation methods and no with… methods.
-
Mutable types implement the applicable MutableInterface and MutableSpatialInterface contracts, expose no with… methods and have no dimension setter.
-
Mutable spatial classes reside directly in their dimension namespace, alongside Geometry and Geography; spatial mode is instance state, not fixed by a family namespace.
-
Declared-SRID/reference and spatial-mode setters update the same instance without recalculating coordinates; the final constructor family parameter defaults to SpatialModelEnum::GEOMETRY.
Constraints
- Apply Story: Preserve immutable types under explicit names and shared contracts #39: concrete immutable classes are final, immutable aggregates reject mutable components without conversion, common interfaces are read-only, and with… methods belong exclusively to immutable variants. Do not add deprecated aliases for renamed classes.
- Coordinate layout and spatial type remain fixed. Geometric validity is delegated to explicit spatial-validator use; do not introduce automatic validation, repair, reprojection or dimension conversion. Changes to declared family or reference preserve coordinates. Preserve the representable states established by Story: Allow partially null point ordinates #36.
- Follow the naming and namespace layout defined by Epic: Support mutable and immutable spatial objects #38. Preserve the distinction between technical representation and normative geometric validity under ISO/IEC 13249-3 and applicable OGC specifications.
Definition of Done
The project's common Definition of Done applies.
-
composer test-localpasses. -
composer qualitypasses. - Tests cover supported mutable curve components, rejection of immutable inputs, incomplete data, order and reference identity, shared components and points, recursive propagation and local-only updates for all three context setters, chainable return identity, and indexed failures without partial mutation.
- Story-specific public API documentation is updated.
Activity