Class DataImpression
Main class for Data Impressions (layers) in an ABR visualization. Every Data Impression is a GameObject in the scene.
Inheritance
Namespace: IVLab.ABREngine
Assembly: IVLab.ABREngine.Runtime.dll
Syntax
public abstract class DataImpression : MonoBehaviour, IHasDataset, IHasKeyData, ICoordSpaceConverter
Constructors
| Improve this Doc View SourceDataImpression()
Main class for Data Impressions (layers) in an ABR visualization. Every Data Impression is a GameObject in the scene.
Declaration
protected DataImpression()
Properties
| Improve this Doc View SourceBoundsInDataSpace
Returns the spatial bounding box of the data in the original coordinate system of the data. Data Space coordinates are typically based upon real world units, like meters.
Declaration
public Bounds BoundsInDataSpace { get; }
Property Value
Type | Description |
---|---|
Bounds |
BoundsInWorldSpace
Returns the spatial bounding box of the data in Unity's world space.
Declaration
public Bounds BoundsInWorldSpace { get; }
Property Value
Type | Description |
---|---|
Bounds |
DataToWorldMatrix
Transformation matrix from data space to world space.
Declaration
public Matrix4x4 DataToWorldMatrix { get; }
Property Value
Type | Description |
---|---|
Matrix4x4 |
ImpressionMaterials
Slot to load the material into at runtime
Declaration
protected virtual Material[] ImpressionMaterials { get; set; }
Property Value
Type | Description |
---|---|
Material[] |
InputIndexer
Used for getting/setting ABRInputs on this DataImpression
Declaration
public ABRInputIndexerModule InputIndexer { get; set; }
Property Value
Type | Description |
---|---|
ABRInputIndexerModule |
KeyDataRenderInfo
Cache of current KeyData rendering information
Declaration
protected virtual IKeyDataRenderInfo KeyDataRenderInfo { get; set; }
Property Value
Type | Description |
---|---|
IKeyDataRenderInfo |
MatPropBlock
Storage for the rendering data to be sent to the shader
Declaration
protected virtual MaterialPropertyBlock MatPropBlock { get; set; }
Property Value
Type | Description |
---|---|
MaterialPropertyBlock |
MaterialNames
Name of the material to use to render this DataImpression
Declaration
protected virtual string[] MaterialNames { get; }
Property Value
Type | Description |
---|---|
string[] |
RenderHints
Any hints to provide the rendering engine, such as if the impression should be hidden
Declaration
public RenderHints RenderHints { get; set; }
Property Value
Type | Description |
---|---|
RenderHints |
RenderInfo
Cache of current rendering information
Declaration
public virtual IDataImpressionRenderInfo RenderInfo { get; set; }
Property Value
Type | Description |
---|---|
IDataImpressionRenderInfo |
SaveToState
Save this DataImpression to state. Sometimes, it's desireable to
create data impressions that only exist in the Unity Editor and
DON'T get saved to state. By default, this is false
. For data
impressions created in ABRStateParser, it is true
.
Declaration
public bool SaveToState { get; set; }
Property Value
Type | Description |
---|---|
bool |
Tags
A list of tags that this data impression has - solely used for external purposes (the engine does nothing with them)
Declaration
public List<string> Tags { get; set; }
Property Value
Type | Description |
---|---|
List<string> |
Uuid
Unique identifier for this Data Impression
Assigned on object creation
Declaration
public Guid Uuid { get; set; }
Property Value
Type | Description |
---|---|
Guid |
WorldToDataMatrix
Transformation matrix from world space to data space.
Declaration
public Matrix4x4 WorldToDataMatrix { get; }
Property Value
Type | Description |
---|---|
Matrix4x4 |
Methods
| Improve this Doc View SourceCleanup()
When this data impression is done being used, clean up after itself if necessary. This method may need access to the GameObject the data impression is applied to.
Declaration
public virtual void Cleanup()
Clone()
Create and return a copy of this data impression (with a new UUID)
Declaration
public DataImpression Clone()
Returns
Type | Description |
---|---|
DataImpression |
CloneStyle()
Create a copy of this data impression, but only its "style" inputs.
Declaration
public DataImpression CloneStyle()
Returns
Type | Description |
---|---|
DataImpression |
CloneStyleLinked()
Clone a data impression's style and link
Declaration
public DataImpression CloneStyleLinked()
Returns
Type | Description |
---|---|
DataImpression |
ComputeGeometry()
RENDERING STEP 1. Populate rendering information (Geometry) for the DataImpression. This is triggered by the DataImpressionGroup when an Geometry happens. This step is generally expensive.
Declaration
public abstract void ComputeGeometry()
ContainsDataSpacePoint(Vector3)
Returns true if the point in data coordinates lies within the volume. Data coordinates are typically defined in real-world units, like meters.
Declaration
public bool ContainsDataSpacePoint(Vector3 dataSpacePoint)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | dataSpacePoint |
Returns
Type | Description |
---|---|
bool |
ContainsWorldSpacePoint(Vector3)
Returns true if the point in Unity World coordinates lies within the bounds of the data.
Declaration
public bool ContainsWorldSpacePoint(Vector3 worldSpacePoint)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | worldSpacePoint |
Returns
Type | Description |
---|---|
bool |
CopyFrom(DataImpression)
Update this data impression's fields from an existing data impression.
Declaration
public void CopyFrom(DataImpression other)
Parameters
Type | Name | Description |
---|---|---|
DataImpression | other |
CopyStyleFrom(DataImpression)
Update the style of this data impression from another data impression's style
Declaration
public void CopyStyleFrom(DataImpression other)
Parameters
Type | Name | Description |
---|---|---|
DataImpression | other |
Create<T>(string, Guid, bool)
Construct a data impession with a given UUID and name.
Warning
This method will be called from ABRStateParser and MUST have the given arguments. If you override this method, bad things might happen.
Declaration
public static T Create<T>(string name, Guid uuid = default, bool saveToState = false) where T : DataImpression
Parameters
Type | Name | Description |
---|---|---|
string | name | Non-unique, human-readable identifier for this data impression |
Guid | uuid | Unique identifier for this data impression. If left empty, will create a new UUID. |
bool | saveToState | Should this data impression be saved when SaveState<T>(string) is called? |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
DataSpacePointToWorldSpace(Vector3)
Converts a point in the original data coordinate space, which is typically defined in real-world units, like meters, to its current position in Unity's World coordinate system, which might include a scale or translation or other transformation based on how the visualization is designed.
Declaration
public Vector3 DataSpacePointToWorldSpace(Vector3 dataSpacePoint)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | dataSpacePoint |
Returns
Type | Description |
---|---|
Vector3 |
DataSpaceVectorToWorldSpace(Vector3)
Converts a Vector in the original data coordinate space, which is typically defined in real-world units, like meters, to its current position in Unity's World coordinate system, which might include a scale or translation or other transformation based on how the visualization is designed.
Declaration
public Vector3 DataSpaceVectorToWorldSpace(Vector3 dataSpaceVector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | dataSpaceVector |
Returns
Type | Description |
---|---|
Vector3 |
GetDataImpressionGroup()
Get the group that this DataImpression is a part of.
Declaration
public DataImpressionGroup GetDataImpressionGroup()
Returns
Type | Description |
---|---|
DataImpressionGroup |
GetDataset()
By default, there's no dataset. DataImpressions should only have one dataset, and it's up to them individually to enforce that they correctly implement this.
Declaration
public abstract Dataset GetDataset()
Returns
Type | Description |
---|---|
Dataset |
GetKeyData()
By default, there's no data. DataImpressions should only have one KeyData, and it's up to them individually to enforce that they correctly implement this.
Declaration
public abstract KeyData GetKeyData()
Returns
Type | Description |
---|---|
KeyData |
GetKeyDataTopology()
By default, there's no data. DataImpressions should only have one KeyData, and it's up to them individually to enforce that they correctly implement this.
Declaration
public abstract DataTopology GetKeyDataTopology()
Returns
Type | Description |
---|---|
DataTopology |
HasTag(string)
Check if the DataImpression has a particular tag
Declaration
public bool HasTag(string tag)
Parameters
Type | Name | Description |
---|---|---|
string | tag | The tag |
Returns
Type | Description |
---|---|
bool | Returns true if the data impression's tag list contains the specified tag |
LinkStyleFrom(DataImpression)
Copy the style from another data impression and link their styles so this data impression updates all its style dependencies when it is changed
Declaration
public void LinkStyleFrom(DataImpression other)
Parameters
Type | Name | Description |
---|---|---|
DataImpression | other |
SetKeyData(KeyData)
By default, there's no data. DataImpressions should only have one KeyData, and it's up to them individually to enforce that they correctly implement this.
Declaration
public abstract void SetKeyData(KeyData kd)
Parameters
Type | Name | Description |
---|---|---|
KeyData | kd |
SetupGameObject()
RENDERING STEP 2. Take geometric rendering information computed in ComputeGeometry() and sets up proper game object(s) and components for this Data Impression. Transfers geometry into Unity format (e.g. a Mesh). No geometric computations should happen in this method, and it should generally be lightweight.
Declaration
public abstract void SetupGameObject()
UpdateStyleDependencies()
Update all the style dependencies for this data impression - ensure they have the same styling and render hints.
Declaration
public void UpdateStyleDependencies()
UpdateStyling()
RENDERING STEP 3. Update the "styling" of an impression by sending each styling parameter to the shader. Occasionally will need to set per-vertex items like transforms. This method should generally be lightweight.
Declaration
public abstract void UpdateStyling()
UpdateVisibility()
RENDERING STEP 4. Update the visibility of an impression (hidden or shown)
Declaration
public abstract void UpdateVisibility()
WorldSpacePointToDataSpace(Vector3)
Converts a point in Unity world coordinates to a point within the original data coordinate space. The data coordinate space is typically defined in real-world units, like cm or meters. Those coordinates are often scaled or repositioned within Unity World space as we zoom into the data or place multiple datasets side-by-side or do other visualization tasks.
Declaration
public Vector3 WorldSpacePointToDataSpace(Vector3 worldSpacePoint)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | worldSpacePoint |
Returns
Type | Description |
---|---|
Vector3 |
WorldSpaceVectorToDataSpace(Vector3)
Converts a vector in Unity world coordinates to a vector within the original data coordinate space. The data coordinate space is typically defined in real-world units, like cm or meters. Those coordinates are often scaled or repositioned within Unity World space as we zoom into the data or place multiple datasets side-by-side or do other visualization tasks.
Declaration
public Vector3 WorldSpaceVectorToDataSpace(Vector3 worldSpaceVector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | worldSpaceVector |
Returns
Type | Description |
---|---|
Vector3 |