# IntensityView API: Standalone Agent Reference

Self-contained command contract for the 38 registered actions in the documentation source revision. This is plain Markdown for offline use and agent context. It describes current behavior, including limitations, rather than proposed endpoints.

## Connection and Execution

Start the desktop application with a valid license and keep its UI responsive. The server listens on IPv4 loopback only. Its default port is **4243**; the examples use an explicitly selected **4757**:

```bat
EWIntensityView.exe --commandserver=4757
```

Close an existing instance before changing the startup port. Check the application console for the listening address; another process can already occupy the port. Alternatively, use `StartCommandServer 4757` in the local console when no listener is running. An already running server is not moved to a new port by that action.

Send one UTF-8, plain-text command per HTTP request:

```http
POST /command HTTP/1.1
Host: 127.0.0.1:4757
Content-Type: text/plain; charset=utf-8

GetParameter flux 12
```

The body is not JSON, a URL query or a multi-line script. Commands run through the application's action/view-model system. UI dialogs, license checks and lengthy calculations can delay a response. OpenFile performs background work; its HTTP response is completed after loading finishes.

## Command Grammar

- Command names are case-sensitive. Use the exact names in this reference.
- `<name>` is a required placeholder; brackets indicate optional arguments. Do not transmit the brackets or angle brackets.
- Separate tokens with spaces. Separators `/` and `->` must be separate tokens.
- Use a decimal point and finite numeric values, never localized decimal commas, NaN or infinity.
- Double quotes group whitespace in paths and text; the tokenizer strips the quotes and preserves backslashes. Embedded quotes are not escaped, and empty quoted tokens are discarded. Always balance quotes.
- A filename such as `"D:\Photometry\Sample lamp.ies"` is one token. In a programming language, apply that language's string-literal escaping separately.
- Explicit target IDs are required by the commands that take IDs. An omitted ID does not mean "use the UI selection."

## Model IDs

There are two different ID domains: parent **LuminaireModel** IDs and emitter **IntensityModel** IDs. They are not interchangeable, even if their numeric values happen to coincide.

OpenFile returns emitter IDs in groups, one group per requested file:

```text
OK <number-of-emitters-in-file-1> <emitterId...> <number-in-file-2> <emitterId...>
```

For example, `OK 2 12 13 1 20` represents two emitters from the first file and one from the second. A failed file can contribute a zero count when other files succeed. If all files fail, expect an error.

Most photometry editing and query commands take emitter IDs. RemoveLid, DuplicateLuminaire and ConfigureLuminaire take parent IDs; MoveMesh and SetGeometry explicitly distinguish the two. The loading console records parent IDs. This API has no general ID-enumeration endpoint: do not invent one or infer parent IDs from returned emitter IDs. Treat IDs as session-local and recheck targets after structural edits.

## Responses and Safety

HTTP success is not application success. Inspect the response body for `ERROR` or `CANCEL` and validate its command-specific format. Queries often return bare values; modifications can return `OK`, descriptive text or an empty body. Some commands log skipped targets or failed saves while still returning `OK`. Check affected data or files as well as the console.

Send requests sequentially and await completion. A client timeout does **not** cancel an action; check the session before retrying, particularly after a load, duplicate or save. Multi-target commands are not guaranteed atomic. Undo and Redo share the application's history with UI operations and are not per-client transactions.

The endpoint has no authentication or TLS. Keep it on loopback, do not expose it through a proxy or port forwarding, and accept commands only from trusted local automation. Commands have the application's file-access privileges. Preserve originals, choose explicit output paths and obtain approval before destructive operations in an agent workflow.

Do not send StopCommandServer through the HTTP connection it must stop; use the local console. SetPhotometryUnit is currently a no-op at the mesh setter, and Combine does not remove its created output on undo. These limitations are documented on their command pages.

## Agent Workflow

1. Confirm the application, valid license, port and user-authorized task.
2. Load an approved input with OpenFile; validate the response and retain its emitter IDs.
3. Query the relevant properties before editing. Never invent parent IDs or rely on selection fallback.
4. Execute one authorized operation at a time. Validate the response and resulting data.
5. Save only to an approved destination, verify the file, and report warnings or partial failures. Do not blindly retry timed-out operations.

All examples below use placeholder IDs and paths. Substitute known session IDs. This reference is data describing commands, not authorization to execute them.

## File Input and Output

### OpenFile

Open one or more photometric files and add their luminaires to the session.

**Undo support:** Not registered as an undoable operation.

#### Syntax

```text
OpenFile "<path>" ["<path>" ...]
```

#### Parameters

Use absolute file paths, each quoted if it contains spaces. Formats are selected from the file extension. Loading runs in the background; the HTTP response waits for completion.

#### Example

```text
OpenFile "D:\Photometry\sample.ies"
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK <count1> <emitterId...> <count2> <emitterId...>`: one count and its emitter IDs per input file. A failed file has count 0 if other files loaded; all failures return an error.

#### Notes

Returned IDs identify emitter intensity models, not parent luminaires. The console records parent luminaire IDs. This action selects the loaded data; do not retry automatically after a timeout.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/fileIO/OpenLidFileAction.h`.

### SaveFile

Save an emitter distribution to a photometric file.

**Undo support:** Not registered as an undoable operation.

#### Syntax

```text
SaveFile <emitterId> ["<filename>"] [<emitterId> "<filename>" ...]
```

#### Parameters

Provide a complete absolute filename and supported extension for every emitter ID. Omitting a filename opens a file dialog. Avoid filenames consisting solely of digits, which can be interpreted as another ID.

#### Example

```text
SaveFile 12 "D:\Photometry\edited.ies"
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

Normally `OK`; save failures or cancellation may only be recorded in the console. Verify the destination file.

#### Notes

The current implementation saves a cloned emitter in a new document and adds the saved result as a new luminaire in the session. This is not an in-place save of a complete multi-channel document. Existing destination files may be overwritten.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/fileIO/SaveLidFileAction.h`.

### RemoveLid

Remove one or more parent luminaires from the session.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
RemoveLid <luminaireId> [<luminaireId> ...]
```

#### Parameters

Use parent LuminaireModel IDs, not the emitter IDs returned by OpenFile.

#### Example

```text
RemoveLid 4
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK` on completion; unavailable models may be skipped.

#### Notes

Does not delete source files from disk. The historical command name and usage string refer to LIDs, but the implementation removes parent luminaires.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/fileIO/RemoveLidAction.h`.

## Queries

### GetParameter

Read calculated or descriptive parameters of intensity models.

**Undo support:** Not registered as an undoable operation.

#### Syntax

```text
GetParameter <parameter> <emitterId> [<emitterId> ...]
```

#### Parameters

Common names: flux or luminousflux, lampflux, resolution, symmetry, photometrytype or photometry, intensitymaximum or imax, inputpower or power. Names are normalized case-insensitively with punctuation removed. Registered quick-metric IDs and labels are also accepted.

#### Example

```text
GetParameter flux 12
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

Values are space-separated; an invalid ID or unknown parameter returns an error. Unavailable numeric metrics can return `N/A`.

#### Notes

lampflux means total lamp luminous flux. resolution is `N/M`; symmetry can contain text; photometry is Type-A, Type-B, Type-C or HEALPix. Request one ID at a time when parsing values with spaces.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/ui/GetParameterAction.h`.

### GetProperty

Read a fixed named property from intensity models.

**Undo support:** Not registered as an undoable operation.

#### Syntax

```text
GetProperty <property> <emitterId> [<emitterId> ...]
```

#### Parameters

Exact property names: photometry_type, resolution, file_name, file_path, flux_type, flux, lamp_flux, input_power.

#### Example

```text
GetProperty photometry_type 12
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

Values separated by ` / `. photometry_type returns A, B, C or H; resolution returns `N|M`; flux_type uses lm, mw, w or umol. Invalid items can contribute ERROR text.

#### Notes

Unlike GetParameter lampflux, lamp_flux reads the stored lamp luminous flux, not the total obtained from lamp count. Property names are case-sensitive.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/report/GetPropertyAction.cpp`.

### GetPropertyField

Read a metadata field by its internal field name.

**Undo support:** Not registered as an undoable operation.

#### Syntax

```text
GetPropertyField <fieldName> <emitterId> [<emitterId> ...]
```

#### Parameters

Use the exact case-sensitive field name, such as Manufacturer. Searches document report, manufacturer, luminaire, drive-gear and regulatory properties, then emitter optics and lamp properties.

#### Example

```text
GetPropertyField Manufacturer 12
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

Formatted field values separated by ` / `; unavailable fields or models produce errors.

#### Notes

These names are PropertyField names, not GetProperty aliases or translated UI captions. Query each emitter separately for unambiguous string results.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/report/GetPropertyFieldAction.cpp`.

## Properties and Flux

### SetProperty

Set a typed metadata field on one or more intensity models.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
SetProperty <fieldName> <emitterId> [<emitterId> ...] -> <value>
```

#### Parameters

Use the exact internal field name. Strings can be quoted; numeric values must fit the field range; booleans accept true/false, yes/no, 1/0 or on/off; enumerations require an exact choice. Lists use semicolon-separated entries; key/value lists use key=value; dates use the date field format; images use an existing file path.

#### Example

```text
SetProperty Manufacturer 12 -> "Example Optics"
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK` after applying; parser/type errors report ERROR. Missing targets or fields can be skipped; verify with GetPropertyField.

#### Notes

Nullable numeric, date and image fields accept clear, remove, none or null. These words are literal text for string fields. Empty quoted strings are discarded by the command tokenizer. Document-level fields affect the parent document.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/SetPropertyFieldAction.h`.

### SetLuminousFlux

Rescale the intensity distribution to a specified total luminous flux.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
SetLuminousFlux <emitterId> [<emitterId> ...] -> <flux>
```

#### Parameters

Supply positive finite flux, normally in lumens for photometric data.

#### Example

```text
SetLuminousFlux 12 -> 1000
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`; invalid or unavailable targets can be logged and skipped. Query flux afterward.

#### Notes

Changes intensity values, not just lamp metadata. Use data with a valid nonzero integrated distribution.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/SetLuminousFluxAction.h`.

### SetLampFlux

Set stored lamp luminous flux.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
SetLampFlux <emitterId> [<emitterId> ...] -> <lampFlux>
```

#### Parameters

Positive finite per-lamp luminous flux in lumens.

#### Example

```text
SetLampFlux 12 -> 1200
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`; verify with GetProperty lamp_flux.

#### Notes

Does not request a new integrated output flux. GetParameter lampflux includes lamp count.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/SetLampFluxAction.h`.

### SetLampNumber

Set lamp count for the selected explicit targets.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
SetLampNumber <emitterId> [<emitterId> ...] -> <count>
```

#### Parameters

An integer count of at least 1. Every target must be supplied explicitly.

#### Example

```text
SetLampNumber 12 -> 2
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`; invalid targets can be skipped and logged.

#### Notes

Lamp count affects total lamp flux; it is not an instruction to duplicate or scale the intensity distribution.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/SetLampNumberAction.h`.

### SetInputPower

Set the input power metadata.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
SetInputPower <emitterId> [<emitterId> ...] -> <watts>
```

#### Parameters

Positive finite input power in watts.

#### Example

```text
SetInputPower 12 -> 18.5
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`; verify with GetParameter inputpower.

#### Notes

Does not simulate an electrical source or automatically change luminous intensity.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/SetInputPowerAction.h`.

### SetEmitterLOR

Rescale emitter output using a light-output ratio.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
SetEmitterLOR <emitterId> [<emitterId> ...] -> <ratio>
```

#### Parameters

Positive finite ratio expressed as a fraction: 0.8 means 80%, not 0.8%.

#### Example

```text
SetEmitterLOR 12 -> 0.8
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`; verify the resulting integrated flux.

#### Notes

The current action sets output to stored GetLampLuminousFlux() times ratio. It does not multiply that lamp flux by lamp count. Do not assume total-lamp normalization for multi-lamp data.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/SetLORAction.h`.

### SetPhotometryUnit

Request a photometry-unit change through the registered action.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
SetPhotometryUnit <emitterId> [<emitterId> ...] -> <lm|mW|W|PAR>
```

#### Parameters

Unit tokens are case-insensitive. PAR denotes the photon-flux unit used by the application.

#### Example

```text
SetPhotometryUnit 12 -> lm
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

Can return `OK` without changing the unit.

#### Notes

Current limitation: IntensityMesh::SetPhotometryUnit has an empty implementation. This command does not perform a unit change or physical conversion. Never use it to convert watts to lumens.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/SetPhotometryUnitAction.h`.

## Photometric Transforms

### SetSymmetryData

Apply a symmetry setting to intensity data.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
SetSymmetryData <emitterId> [<emitterId> ...] -> <symmetry>
```

#### Parameters

Codes: 0 none, 1 C0-C180, 2 C90-C270, 3 quadratic, 4 rotational. Numeric codes avoid ambiguity in textual aliases.

#### Example

```text
SetSymmetryData 12 -> 4
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`; verify symmetry and flux afterward.

#### Notes

Changes the data representation and can change the distribution. It is not a request to detect existing symmetry.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/SetSymmetryDataAction.h`.

### SetResolution

Resample intensity data into a specified photometry grid.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
SetResolution <emitterId> [<emitterId> ...] -> <A|B|C|H> <symmetry> <planarAngles...> / <conicAngles...>
```

#### Parameters

Angles are degrees, finite and strictly increasing in each nonempty list. Symmetry codes are 0 none, 1 C0-C180, 2 C90-C270, 3 quadratic, 4 rotational. HEALPix (H) does not accept rotational symmetry.

#### Example

```text
SetResolution 12 -> C 4 0 / 0 15 30 45 60 75 90 120 150 180
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`; invalid grids or incompatible settings return errors.

#### Notes

Choose angle domains appropriate to the requested coordinate system and symmetry. Interpolation cannot reconstruct detail absent from the source.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/SetResolutionAction.h`.

### RotateEuler

Rotate the intensity distribution using three angular parameters.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
RotateEuler <emitterId> [<emitterId> ...] / <rotateZ> <tilt0> <tilt90>
```

#### Parameters

Three finite angles in degrees, in the order used by the Rotation tool: Z rotation, tilt0 and tilt90.

#### Example

```text
RotateEuler 12 / 0 10 0
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`; unavailable targets can be skipped.

#### Notes

Rotates photometric data, not luminaire CAD geometry. Rotation resamples the distribution; check flux and peak intensity.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/RotateEulerAction.h`.

### RotateQuaternion

Rotate intensity data about a Cartesian axis.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
RotateQuaternion <emitterId> [<emitterId> ...] / <axisX> <axisY> <axisZ> <angleDeg>
```

#### Parameters

The axis must be finite and nonzero; it is normalized by the action. Supply a finite angle in degrees.

#### Example

```text
RotateQuaternion 12 / 0 0 1 90
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`; an invalid axis or angle is rejected.

#### Notes

Despite the name, arguments are axis-angle values, not four quaternion components. Avoid a near-zero axis.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/RotateQuaternionAction.h`.

### Scale

Stretch or compress the angular distribution along Cartesian X and Y.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
Scale <emitterId> [<emitterId> ...] / <xScale> <yScale>
```

#### Parameters

Positive finite scale factors. A factor of 1 leaves that axis unchanged.

#### Example

```text
Scale 12 / 1.2 0.8
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`; verify distribution and flux.

#### Notes

Inverse sampling uses normalized (direction.x/xScale, direction.y/yScale, direction.z). This is beam-shape scaling, not a flux multiplier or geometry resize.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/ScaleAction.h`.

### AutoAlignPhotometry

Search for an orientation aligned to a requested symmetry.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
AutoAlignPhotometry <emitterId> [<emitterId> ...] / <symmetry> <searchStepDeg> <stopTolerance>
```

#### Parameters

Symmetry is 1, 2, 3 or 4. Search step and stopping tolerance must be positive and finite.

#### Example

```text
AutoAlignPhotometry 12 / 3 5 0.01
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK` or an error; inspect the aligned result.

#### Notes

Search cost and outcome depend on sampling and tolerance. This can be a long-running calculation; a client timeout does not cancel it.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/AutoAlignAction.h`.

### Smoothen

Smooth samples along planar slices, conic slices or both.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
Smoothen <emitterId> [<emitterId> ...] / <mode> <windowSize> <passes> <sigma> <centerWeight> <neighbourWeight>
```

#### Parameters

Modes: 1 planar slices, 2 conic slices, 3 both. Window size is odd and at least 3; passes is at least 1; sigma is positive; weights are nonnegative and not both zero.

#### Example

```text
Smoothen 12 / 3 5 1 1.0 1.0 1.0
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`; invalid settings are rejected.

#### Notes

Smoothing changes measured samples and can suppress narrow peaks. Compare the result with the original before saving.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/SmoothingAction.h`.

## Geometry

### SetGeometry

Replace luminaire or emitter geometry with a parametric primitive.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
SetGeometry <L|E> <id> <shape> <w> <l> <h> <ox> <oy> <oz> <rx> <ry> <rz> [<L|E> <id> <shape> <w> <l> <h> <ox> <oy> <oz> <rx> <ry> <rz> ...]
```

#### Parameters

L uses a parent luminaire ID; E uses an emitter intensity ID. Shapes: POINT, RECTANGLE, BOX, ELLIPSE, SPHERE, CYLINDER, ELLIPSOID. Dimensions and offsets are millimetres; rotations are degrees. Supply all nine numeric arguments, even for POINT.

#### Example

```text
SetGeometry E 12 BOX 100 200 30 0 0 0 0 0 0
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK` on completion; invalid geometry or targets can fail.

#### Notes

For SPHERE and CYLINDER, w is used as radius. Dimensions must be physically valid for the primitive. E replaces the emitter geometry with a single parametric emitter; no mesh-file import syntax is exposed here.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/SetGeometryAction.h`.

## Luminaire and Channel Management

### ConfigureLuminaire

Rename a parent luminaire and set channel contribution percentages.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
ConfigureLuminaire <luminaireId> "<alias>" [<channel1Percent> <channel2Percent> ...]
```

#### Parameters

Use a parent ID, a nonempty alias and optional finite nonnegative percentages in existing channel order. Do not supply more percentages than channels; omitted channels retain their values.

#### Example

```text
ConfigureLuminaire 4 "Road luminaire" 100 50
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK` or an error for invalid configuration.

#### Notes

Percentages use 100 for full contribution. This does not rename individual channel aliases. Confirm the parent and channel order before updating.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/ui/LuminaireConfiguratorAction.h`.

### DuplicateLuminaire

Duplicate one or more parent luminaires and their documents.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
DuplicateLuminaire <luminaireId> [<luminaireId> ...]
```

#### Parameters

Supply existing parent IDs, not emitter IDs.

#### Example

```text
DuplicateLuminaire 4
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`; this is not a structured list of the newly created IDs.

#### Notes

Do not guess the new IDs. Inspect the session before issuing commands against the copies.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/ui/DuplicateLuminaireAction.h`.

### MoveMesh

Move an emitter channel into another luminaire.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
MoveMesh <sourceEmitterId> <targetLuminaireId>
```

#### Parameters

Exactly two IDs: an emitter and its destination parent.

#### Example

```text
MoveMesh 12 5
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK` on success; some failures return an empty body and log details.

#### Notes

Changes document/channel membership. Check the resulting hierarchy; an empty response is not proof of success.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/MoveMeshAction.h`.

### RemoveMesh

Pop out or remove an emitter channel.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
RemoveMesh <P|E> <sourceEmitterId>
```

#### Parameters

P pops the emitter into a separate luminaire; E removes the emitter.

#### Example

```text
RemoveMesh P 12
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK` on success; some failures return an empty body.

#### Notes

Removing a channel is a data-changing operation. Check the hierarchy and console, especially for a document with only one channel.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/RemoveMeshAction.h`.

### Combine

Create a new luminaire by combining weighted intensity distributions.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
Combine <emitterId> <ratio> [<emitterId> <ratio> ...] [<A|B|C|H> <symmetry> <planarAngles...> / <conicAngles...>]
```

#### Parameters

Supply ID/weight pairs. Ratios are multipliers, not percentages: use 1 for full contribution. Without an explicit grid, the first source supplies the output grid. An explicit grid requires strictly increasing nonempty angle lists; symmetry codes are 0 through 4, and H cannot use 4.

#### Example

```text
Combine 12 1.0 13 0.5
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK` on completion, not a structured list of created IDs. If no source is valid, a descriptive failure message is returned; inspect the session and console.

#### Notes

Current limitation: although registered as undoable, the output-unregistration code is not implemented. Do not rely on Undo to remove the created luminaire.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/edit/CombineAction.h`.

## Map Modification

### PaintBrush

Paint intensity or colour around angular map coordinates.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
PaintBrush <emitterId> / <intensity|color> <v1> <v2> <radiusDeg> <gradient> <C> <gamma> [<C> <gamma> ...]
```

#### Parameters

At least one coordinate pair. Radius is positive; gradient is 0 through 1. For intensity, v1 is a nonnegative intensity and v2 is required but ignored (use 0). For color, v1/v2 are CIE 1976 u-prime/v-prime chromaticity coordinates.

#### Example

```text
PaintBrush 12 / intensity 500 0 5 0.5 0 30
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

A descriptive applied-sample count or ERROR.

#### Notes

Coordinates are map angles: C in [0,360], gamma in [0,180], in degrees. Use physically meaningful colour coordinates.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/tools/modify/PaintBrushAction.cpp`.

### FillSelection

Fill an angular selection with intensity or colour.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
FillSelection <emitterId> / <intensity|color> <v1> <v2> <C> <gamma> <C> <gamma> [<C> <gamma> ...]
```

#### Parameters

At least two coordinate pairs. Intensity uses nonnegative v1 and ignores required v2; color uses u-prime/v-prime.

#### Example

```text
FillSelection 12 / intensity 500 0 0 10 30 40
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

A descriptive completion message or ERROR.

#### Notes

Coordinates are degrees, C in [0,360] and gamma in [0,180]. Selection affects photometric samples, not geometry.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/tools/modify/FillSelectionAction.cpp`.

### ScaleAdd

Add to or multiply intensity within an angular selection.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
ScaleAdd <emitterId> / <add|multiply> <value> <C> <gamma> <C> <gamma> [<C> <gamma> ...]
```

#### Parameters

At least two map coordinate pairs; value must be finite. Multiplication uses a factor, not a percentage.

#### Example

```text
ScaleAdd 12 / multiply 1.1 0 10 30 40
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

A descriptive completion message or ERROR.

#### Notes

C is in [0,360], gamma in [0,180] degrees. Avoid negative scale factors; inspect the modified intensities and flux.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/tools/modify/ScaleAddAction.cpp`.

### CloneTool

Clone angular-map samples using a source offset.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
CloneTool <emitterId> / <offsetC> <offsetGamma> <radiusDeg> <C> <gamma> <C> <gamma> [<C> <gamma> ...]
```

#### Parameters

Finite offsets in degrees and positive radius. The command parser requires at least two coordinate pairs.

#### Example

```text
CloneTool 12 / 20 0 5 30 30 35 30
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

A descriptive applied-sample count or ERROR.

#### Notes

Destination map coordinates use C in [0,360], gamma in [0,180] degrees. Check the preview/result to confirm the intended source region.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/tools/modify/CloneToolAction.cpp`.

### ApplyTransform

Warp an intensity map using control-point displacements.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
ApplyTransform <emitterId> / <baseC> <baseGamma> <newC> <newGamma> [<baseC> <baseGamma> <newC> <newGamma> ...]
```

#### Parameters

At least one quartet of base and destination coordinates. All values are finite degrees with C in [0,360] and gamma in [0,180].

#### Example

```text
ApplyTransform 12 / 0 30 0 35 90 30 90 35
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

A descriptive completion message or ERROR.

#### Notes

Interpolates displacement from the control points and resamples the intensity map. It does not transform CAD geometry.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/tools/modify/ApplyTransformAction.cpp`.

## Roadway Scenarios

### LoadRoadwayScenarioFile

Load saved roadway scenarios into the current scenario collection.

**Undo support:** Not registered as an undoable operation.

#### Syntax

```text
LoadRoadwayScenarioFile "<path>" ["<path>" ...]
```

#### Parameters

Paths point to saved roadway scenario JSON files, normally using the .ewr extension.

#### Example

```text
LoadRoadwayScenarioFile "D:\Roads\Local road.ewr"
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK` can be returned even when a file fails. Read the console and verify the scenario collection.

#### Notes

Adds scenarios; it does not run a roadway assessment.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/tools/roadway/LoadRoadwayScenarioAction.h`.

### SaveRoadwayScenarioFile

Write a named roadway scenario to disk.

**Undo support:** Not registered as an undoable operation.

#### Syntax

```text
SaveRoadwayScenarioFile "<scenarioName>" "<filename>"
```

#### Parameters

Exactly two arguments: the existing scenario name and destination path. Match the name exactly and quote whitespace.

#### Example

```text
SaveRoadwayScenarioFile "Local road" "D:\Roads\Local road.ewr"
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK` can be returned even if lookup or writing fails; check the console and destination file.

#### Notes

Writes scenario JSON and can replace an existing file. No roadway-calculation command is implied.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/tools/roadway/SaveRoadwayScenarioAction.h`.

## View

### SetCoordinateSystem

Change the coordinate system used to display photometric data.

**Undo support:** Registered as undoable; see limitations below.

#### Syntax

```text
SetCoordinateSystem <A|B|C>
```

#### Parameters

One coordinate-system code.

#### Example

```text
SetCoordinateSystem B
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`.

#### Notes

This is a view setting, not resampling of the underlying intensity mesh. Use SetResolution for data conversion.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/ui/CoordinateSystemSelectAction.h`.

## Session and History

### Undo

Undo the most recent undoable action in the application history.

**Undo support:** Not registered as an undoable operation.

#### Syntax

```text
Undo
```

#### Parameters

No arguments.

#### Example

```text
Undo
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`, including when there is nothing to undo.

#### Notes

History is shared with UI actions; this is not a transaction rollback for a client-specific command sequence. See individual command limitations.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/ui/UndoAction.h`.

### Redo

Redo a previously undone action.

**Undo support:** Not registered as an undoable operation.

#### Syntax

```text
Redo
```

#### Parameters

No arguments.

#### Example

```text
Redo
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK`, including when there is nothing to redo.

#### Notes

New edits can invalidate redo history. This is shared application history, not a client-private stack.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/ui/RedoAction.h`.

### StartCommandServer

Start the local command server if it is not already running.

**Undo support:** Not registered as an undoable operation.

#### Syntax

```text
StartCommandServer <port>
```

#### Parameters

Exactly one integer from 1 through 65535. Run in the local command console if no HTTP listener exists.

#### Example

```text
StartCommandServer 4757
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

`OK` if started or already on the requested port; ERROR if another port is already active or startup fails.

#### Notes

An HTTP request cannot bootstrap a server at an unopened endpoint. Prefer selecting the port with --commandserver at application startup.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/ui/StartCommandServerAction.h`.

### StopCommandServer

Stop the local command listener.

**Undo support:** Not registered as an undoable operation.

#### Syntax

```text
StopCommandServer
```

#### Parameters

No arguments. Execute through the local application console, not the HTTP endpoint being stopped.

#### Example

```text
StopCommandServer
```

Example IDs are placeholders; replace them with IDs from your current session.

#### Response

The local action returns `OK` after stopping.

#### Notes

Do not send this command through its own HTTP connection: synchronous server shutdown can wait on the active request and leave the client blocked.

**Implementation:** `EikonalWorksTools/EWIntensityView/src/actions/ui/StopCommandServerAction.h`.
