# Package IGD.PlannerManager

Contains services that connect the commercial session state with purely graphical services and apis of ig.gfx packages.

## Services

### PlannerManager

Provides methods to insert and delete articles inside an ig.gfx.core api and provides hooks to add application behaviour inside the different loading and removal stages.

By executing subscribe, the planner manager subscribes to the session and automatically manages articles. The suscription can be removed at any time by calling unsubscribe.

#### Options

**parallelUpdates**

Execute updates for different articles in parallel whenever possible.

**loadMode**

Specify which kind of geometries should be loaded and in which order.

-   ELoadGeometryPreviews.PreviewOnly -> only load preview geometries (or default when none are available)
-   ELoadGeometryPreviews.Default -> ignore preview geometries
-   ELoadGeometryPreviews.Staged -> load preview geometries first and replace them with default geometries later

#### Methods

**getLoadingStatus**

Retrieves the current loading state for the complete scene. This can be:

-   idle -> nothing is loading
-   loadingFull -> all loading articles are transitioning from preview geomtries to real ones
-   loading -> all other loading combinations

**getSceneStatus**

Retrieves the current state of the complete scene. This can be:

-   preview -> some articles have preview geometries
-   normal -> no article has preview geometries

#### Hooks

The listeners of these hooks will be executed serially and can return a promise, which will be awaited before proceding to the next.

**prepareForUpdate**

Emitted right before an article will be updated

**manipulateAfterUpdate**

A gfx representation for an article has been loaded and its time for any modifications to the scene.

**articleUpdate**

An article has been completly updated. Executes right after manipulateAfterUpdate.

**articleRemoved**

An article has been removed from the scene.

**sceneUpdateStart**

All queued articles will be updated soon.

**sceneUpdateDone**

All queued articles have been updated and nothing is updating right now.

### SceneAnimationManager

Provides methods to manage the animation state of the whole scene and also provides events which can be used to execute application behaviour on animation changes.

It also hooks itself into planner manager hooks and changes the animation states on geometric updates.
This behaviour can be customized by setting the pauseAnimationsForUpdates option. By default animations will be canceled on geometric updates and articles will be returned to their standard position. By setting pauseAnimationsForUpdates to true, animations will instead be paused on an update cycle start and resumed on its end (this might lead to inconsistent frames in the middle, so use with caution).

## History

### 2.7.0

-   SceneAnimationManager: added animateabilityChange event
-   SceneAnimationManager: added getActiveOrNextAnimationDirection
-   SceneAnimationManager: added getStatus

### 2.6.0

-   ScenePostprocessingManager: use State.postprocessingOptions.globalEnable
-   added SceneUpdatePostprocessingManager
-   Measurement: updated Mesh ignoring
-   Manager: added hasPendingUpdates
-   SceneAnimationManager: removed internal usage of base animation manager
-   SceneAnimationManager: implemented better continuing of animations and application of scene animation progress
-   fixed animation position changes
-   fixed afterAnimationProgressChange not being unsubscribed
-   added tracking of update reasons to prevent endless animation position update triggers
-   changed sourcePlacement to also count as placement for new articles
-   added basic support for animation progress updates
-   added tests for single article hook execution
-   added article inserter tests
-   fixed sets being added to setqueue on remove
-   fixed multi article points being applied multiple times
-   fixed articleUpdateDone status

### 2.6.0-alpha.4

-   Measurement: updated Mesh ignoring
-   Manager: added hasPendingUpdates

### 2.6.0-alpha.3

-   SceneAnimationManager: removed internal usage of base animation manager
-   SceneAnimationManager: implemented better continuing of animations and application of scene animation progress

### 2.6.0-alpha.2

-   fixed animation position changes

### 2.6.0-alpha.1

-   fixed afterAnimationProgressChange not being unsubscribed
-   added tracking of update reasons to prevent endless animation position update triggers

### 2.6.0-alpha.0

-   changed sourcePlacement to also count as placement for new articles
-   added basic support for animation progress updates
-   added more article inserter tests
-   added tests for single article hook execution
-   added article inserter tests
-   removed shitty manager test
-   refactored article insertion
-   fixed sets being added to setqueue on remove
-   fixed multi article points being applied multiple times
-   fixed articleUpdateDone status

### 2.5.3

-   fixed multi article points being applied multiple times

### 2.5.2

### 2.5.1

-   added ignoring of measurement objects for postprocessing

### 2.5.0

-   added neighbor action execution on article removal
-   added bottom and top neighbor to rule evaluation configuration
-   fixed multi article data resolving
-   added evaluation of neighbor actions on scene update
-   fixed resolving of multi article configuration
-   updated depthShadowPlane ignored meshes usage
-   added special look at handling for orthographic cameras

### 2.4.4

-   added neighbor action execution on article removal

### 2.4.3

-   added bottom and top neighbor to rule evaluation configuration
-   fixed multi article data resolving

### 2.4.2

-   updated depthShadowPlane ignored meshes usage

### 2.4.1

-   LabeledAxis: fixed labels not being rotated around center
-   LabeledAxis: fixed xz label y position
-   LabeledAxisMeasurementView: added saving of group size

### 2.4.0

-   fixed typo in GfxRepresentationHashes
-   Measurement: added MeasurementManager, types and LabeledAxis view
-   HolePuncher: fixed plane segment to plane conversion
-   GhostModeManager: added clearing of gfxId before article deletion

### 2.4.0-alpha.1

-   MeasurementManager: fixed duplicate measurement on visibility change
-   MeasurementManager: added missing render in setTargetVisibility
-   MeasurementManager: added removeFromScene

### 2.4.0-alpha.0

-   Measurement: added MeasurementManager, types and LabeledAxis view
-   HolePuncher: fixed plane segment to plane conversion
-   fixed action evaluation
-   GhostModeManager: added clearing of gfxId before article deletion

### 2.3.1

-   fixed action evaluation

### 2.3.0

-   added Room modules

### 2.3.0-alpha.1

-   RoomContainer: added redraw after 3D changes
-   changed article insertion to prefer absolute source placements over existing local placements

### 2.3.0-alpha.0

-   added Room modules

### 2.2.1

-   changed article insertion to prefer absolute source placements over existing local placements

### 2.2.0

-   fixed resetting of animations on geometric update
-   added esnext building

### 2.2.0-alpha.0

-   fixed resetting of animations on geometric update
-   added esnext building

### 2.1.0

-   PlannerManager: added error handling for sceneUpdateDone
-   PlannerManager: fixed articles sometimes not being deleted
-   PlannerManager: added synchronizing of scene position to set updates
-   GhostModeManager: added applySnapToConfiguration option
-   PlannerManager: added disableHashOptimzations option
-   PlannerManager: changed preview load determination to use api function
-   PlannerManager: updated usage of material cache
-   PlannerManager: removed material update handling
-   PlannerManager: added support for pbrHash
-   PlannerManager: changed updating of existing articles to only occur when articles already exist
-   PlannerManager: added generatePreUpdateSnapshot option
-   PlannerManager: added emitting of ItemGfxRemoved notification
-   PlannerManager: changed article deletion to only occur as part of and at the start of the scene update
-   PlannerManager: added scheduleSceneUpdate option
-   PlannerManager: added createSceneSnapshot method
-   PlannerManager: added prepareForRemove hook
-   APIUtil: fixed commercially unknown articles being returned as result of associates functions
-   PlannerManager: added overwriting of article placement execution
-   PlannerManager: added scheduling of article insertion in session scheduler

### 2.1.0-alpha.9

-   Manager: fixed articles sometimes not being deleted

### 2.1.0-alpha.8

-   added synchronizing of scene position to set updates
-   GhostModeManager: added applySnapToConfiguration option

### 2.1.0-alpha.7

-   optimized should load as preview condition

### 2.1.0-alpha.6

-   added disableHashOptimzations option
-   changed preview load determination to use api function
-   updated usage of material cache

### 2.1.0-alpha.5

-   removed material update handling

### 2.1.0-alpha.4

-   Manager: added support for pbrHash

### 2.1.0-alpha.3

-   Manager: changed updating of existing articles to only occur when articles already exist
-   Manager: added generatePreUpdateSnapshot option
-   Manager: added emitting of ItemGfxRemoved notification

### 2.1.0-alpha.2

-   Manager: changed article deletion to only occur as part of and at the start of the scene update
-   Manager: added scheduleSceneUpdate option
-   Manager: added createSceneSnapshot
-   Manager: added prepareForRemove hook

### 2.1.0-alpha.1

-   APIUtil: fixed commercially unknown articles being returned as result of associates functions

### 2.1.0-alpha.0

-   added overwriting of article placement execution
-   added scheduling of article insertion in session scheduler

### 2.0.1

-   changed gfx representation retrieval to use session method instead of operator

### 2.0.0

-   changed article gfx id application to occur after gfx insert
-   rewrite applyPlacement() to use SetTransformation() -> reduces cache invalidation calls by 75%
-   fixed article placement being cleared from local storage save in ig.online
-   added error logging for hook emitting inside insertSingleArticle
-   disabled special updateSet logic
-   fixed set placement not working correctly when new articles are being added to already existing articles
-   added a comment to set article placement updates
-   moved hash application into insertSingleArticle. added skipping of empty igxcs
-   added compatibility with 2.x gfx version
-   changed updateSceneFromQueue error handling to always emit sceneUpdateDone and continue execution
-   updated attach point code
-   updated ig.gfx dependencies
-   changes for igx 3.0
-   added unsubscribing of beforeSave hook in subscribe
-   added some checks for article existance
-   fixed loading of material updates for non root items
-   added synchronizing of placements before save
-   added temporary placement synchronize before article update
-   reenabled parallel updates by default
-   disabled gfxRepresentation updates and removals support
-   AnimationManager: fixed position being set to the same value

### 2.0.0-alpha.12

-   changed article gfx id application to occur after gfx insert

### 2.0.0-alpha.11

-   rewrite applyPlacement() to use SetTransformation() -> reduces cache invalidation calls by 75%
-   updated dependencies

### 2.0.0-alpha.10

-   fixed article placement being cleared from local storage save in ig.online
-   added error logging for hook emitting inside insertSingleArticle

### 2.0.0-alpha.9

-   disabled special updateSet logic
-   fixed set placement not working correctly when new articles are being added to already existing articles
-   added a comment to set article placement updates

### 2.0.0-alpha.8

-   moved hash application into insertSingleArticle. added skipping of empty igxcs
-   added comments

### 2.0.0-alpha.7

-   added compatibility with 2.x gfx version

### 2.0.0-alpha.6

-   changed updateSceneFromQueue error handling to always emit sceneUpdateDone and continue execution
-   updated attach point code
-   updated ig.gfx dependencies
-   changes for igx 3.0

### 2.0.0-alpha.5

-   added unsubscribing of beforeSave hook in subscribe

### 2.0.0-alpha.4

-   added some checks for article existance
-   fixed loading of material updates for non root items

### 2.0.0-alpha.3

-   added synchronizing of placements before save
-   added temporary placement synchronize before article update

### 2.0.0-alpha.0

-   reenabled parallel updates
-   disabled gfxRepresentation updates and removals support
-   AnimationManager: fixed position being set to the same value

### 1.7.1

-   fixed ghost mode placement

### 1.7.0

-   reenabled parallel updates
-   fixed root article placement error
-   integrated new AnimationManager
-   added updateType to after article update hooks
-   fixed articles argument for scene hooks

### 1.7.0-alpha.1

-   fixed root article placement error

### 1.7.0-alpha.0

-   integrated new AnimationManager
-   added updateType to after article update hooks
-   fixed articles argument for scene hooks

### 1.6.1

-   added getSceneStatus

### 1.6.0

-   updated dependencies
-   fixed sceneUpdateStart hook not being awaited
-   fixed dispatcher placement not being prioritized over initial placement
-   cleanup
-   fixed superRoot not being created in case of placement on gfxRepresentation
-   added skipping of preview updates when all resources are available
-   fixed initial article placement being overriden
-   fixed set root article rotation not being applied
-   added getLoadingStatus
-   integrated staged loading
-   cleaned up gfxRepresentation and igxb article rotation

### 1.6.0-alpha.2

-   fixed sceneUpdateStart hook not being awaited
-   fixed dispatcher placement not being prioritized over initial placement
-   cleanup
-   fixed superRoot not being created in case of placement on gfxRepresentation

### 1.6.0-alpha.1

-   added skipping of preview updates when all resources are available

### 1.6.0-alpha.0

-   fixed initial article placement being overriden
-   fixed set root article rotation not being applied
-   added getLoadingStatus
-   integrated staged loading
-   cleaned up gfxRepresentation and igxb article rotation

### 1.5.0

-   updated dependencies
-   changed expand material paths to use static material cache method

### 1.4.5

-   updated version logs

### 1.4.4

-   Revert "[PlannerManager] changed applyPlacement to call api methods only as much as neccessary" -> api.SetTransformation and api.SetRotation expect different rotation units

### 1.4.3

-   optimized placement api calls
-   added error handling for setting of gfx id in Dispatcher in load method

### 1.4.2

-   added articleRemoved hook

### 1.4.1

-   Insertion: add multiArticle configuration in setUserData

### 1.4.0

-   updated ig.gfx dependencies to next minor

### 1.3.0

-   added basic GhostModeManager
-   fixed neighbors being deleted because of invalid connections after update
-   changed neighbor action execution to occur inside the scene update after all articles have been updated or loaded
-   added hiding of niche containers
-   added support for hashes
-   added support for automatic managing of article lifecycles:
-   added subscribe and unsubscribe to plannermanager
-   articles will be automatically loaded, updated and deleted
-   added loadAllArticles
-   added onSceneUpdateStart and onSceneUpdateEnd options
-   added MultiArticleExecutor
-   changed SceneSnapShot.getNewConnectionInfo return types to be clearer

### 1.2.8

-   changed manipulateAfterUpdate to be scheduled

### 1.2.7

-   fixed xcr article rotation issue

### 1.2.0

-   removed xcr specific code
-   upped min productdata version to 2.13
