Class CompareToDataModule
Compares data chosen in the simulation view to conditions and allows conforming the conditions to match.
Namespace: Unity.MARS.Authoring
Syntax
public class CompareToDataModule : IModuleDependency<DataVisualsModule>, IModuleDependency<QueryPipelinesModule>
Properties
IsComparing
Get whether the module is currently comparing data
Declaration
public bool IsComparing { get; }
Property Value
Type | Description |
---|---|
Boolean |
ProxyToCompare
The proxy that is being compared to data currently
Declaration
public Proxy ProxyToCompare { get; }
Property Value
Type | Description |
---|---|
Proxy |
Methods
GetComparisonData(Int32)
Get the current data to be used for comparison.
Declaration
public TraitDataSnapshot GetComparisonData(int selectionIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionIndex | The index into the current selection if there is multiple objects selected. Defaults to 0 |
Returns
Type | Description |
---|---|
TraitDataSnapshot | The selected or hovered data |
GetConditionRatings(List<KeyValuePair<String, Single>>)
Get the condition rating results as a list of key value pairs. Each pair is a condition name and float rating from 0 to 1
Declaration
public void GetConditionRatings(List<KeyValuePair<string, float>> conditionRatingsResult)
Parameters
Type | Name | Description |
---|---|---|
List<KeyValuePair<String, Single>> | conditionRatingsResult | The list that will be cleared and populated with the results |
IncludeAll()
For each condition on the proxy set via SetProxyToModify, try to include the current comparison data. Only enabled conditions that implement ICreateFromData will be modified.
Declaration
public void IncludeAll()
OnDataSelectionChanged(List<Proxy>)
Change the data proxy that is being compared against the main proxy. The current match data for each proxy will be captured. Selected data will be used for comparison if there is no data being hovered.
Declaration
public void OnDataSelectionChanged(List<Proxy> proxies)
Parameters
Type | Name | Description |
---|---|---|
List<Proxy> | proxies | A list of all the data proxies that are currently selected |
OnHoverChange(Proxy)
Start or change the data that is currently being hovered to compare against the main proxy.
Declaration
public void OnHoverChange(Proxy proxy)
Parameters
Type | Name | Description |
---|---|---|
Proxy | proxy | A proxy that is matched to the data to compare |
OnHoverEnd()
End the current hover. After calling this, the comparison data will use the data set via OnDataSelectionChanged
Declaration
public void OnHoverEnd()
OptimizeAll()
For each condition on the proxy set via SetProxyToModify, try to optimize for the current comparison data. Only enabled conditions that implement ICreateFromData will be modified.
Declaration
public void OptimizeAll()
SetProxyToCompare(Proxy)
Sets the proxy whose conditions will be compared against data. The proxy must be active and running. The proxy that will be modified via Include or Optimize actions must be set separately via SetProxyToModify
Declaration
public void SetProxyToCompare(Proxy proxy)
Parameters
Type | Name | Description |
---|---|---|
Proxy | proxy | An active running proxy whose conditions will be compared to data |
SetProxyToModify(Proxy)
Sets the proxy that will be modified when compare actions "Include" and "Optimize" This can be different from the proxy set via SetProxyToCompare. For example, when simulating the proxy to compare is the active copy, but the proxy to modify is the original scene version.
Declaration
public void SetProxyToModify(Proxy proxy)
Parameters
Type | Name | Description |
---|---|---|
Proxy | proxy | The proxy whose conditions will be modified. |
StartComparing()
Start comparing and request data visuals to show the rating for the conditions on the proxy set via SetProxyToCompare
Declaration
public void StartComparing()
StopComparing()
Stop comparing and clear any data visuals showing a rating.
Declaration
public void StopComparing()
Events
CompareDataChanged
Called when the data being compared has changed
Declaration
public event Action CompareDataChanged
Event Type
Type | Description |
---|---|
Action |