Class DataImpressionGroup
A DataImpressionGroup is a group of data impressions within ABR. DataImpressionGroups can be constrained within a defined bounding box (see ABRDataContainer), and can automatically rescale all of their data to stay within this container. Each time a new KeyData object is loaded into a data impression in this group, the GroupToDataMatrix and GroupBounds are updated.
Namespace: IVLab.ABREngine
Assembly: IVLab.ABREngine.Runtime.dll
Syntax
[AddComponentMenu("ABR/Data Impression Group")]
public class DataImpressionGroup : MonoBehaviour, IHasDataset, ICoordSpaceConverter
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
Fields
| Improve this Doc View SourceGroupBounds
The actual bounds (contained within DataContainer) of the group-scale dataset
Declaration
public Bounds GroupBounds
Field Value
Type | Description |
---|---|
Bounds |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
GroupToDataMatrix
Transformation from the original data space into the room-scale bounds. Multiply by a vector to go from group-space into data-space.
Declaration
public Matrix4x4 GroupToDataMatrix
Field Value
Type | Description |
---|---|
Matrix4x4 |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
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 |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
BoundsInWorldSpace
Get the bounds of this data impression group in Unity world space.
Declaration
public Bounds BoundsInWorldSpace { get; }
Property Value
Type | Description |
---|---|
Bounds |
Remarks
[!INFO] If the data impression group has a transform applied, this returns different bounds than those specified by the GroupBounds.
DataToWorldMatrix
Transforms from data space (Data Impression Group's data space) to world space
Data Space ==(DataToGroupMatrix)=> Group local space ==(transform.localToWorldMatrix)==> World space
Declaration
public Matrix4x4 DataToWorldMatrix { get; }
Property Value
Type | Description |
---|---|
Matrix4x4 |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
Uuid
Unique identifier for this group
Declaration
public Guid Uuid { get; }
Property Value
Type | Description |
---|---|
Guid |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
WorldToDataMatrix
Transforms from world space to data space (the Data Impression Group's dataset space)
World Space ==(transform.worldToLocalMatrix)=> Group local space ==(GroupToDataMatrix)==> Data space
Declaration
public Matrix4x4 WorldToDataMatrix { get; }
Property Value
Type | Description |
---|---|
Matrix4x4 |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
Methods
| Improve this Doc View SourceAddDataImpression(DataImpression, bool)
Add a data impression to this group. All data impressions in the same group NEED to have the same dataset, error will be displayed otherwise.
Declaration
public void AddDataImpression(DataImpression impression, bool allowOverwrite = true)
Parameters
Type | Name | Description |
---|---|---|
DataImpression | impression | |
bool | allowOverwrite |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
Clear()
Remove all data impressions from this DataImpressionGroup
Declaration
public void Clear()
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
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 |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
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 |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
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 |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
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 |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
GetDataImpression(Func<DataImpression, bool>)
Get a data impression matching a particular criteria
Declaration
public DataImpression GetDataImpression(Func<DataImpression, bool> criteria)
Parameters
Type | Name | Description |
---|---|---|
Func<DataImpression, bool> | criteria |
Returns
Type | Description |
---|---|
DataImpression | The data impression, if found, otherwise |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
Examples
This method can be used to access data impressions in a functional manner, for example checking if the impression has a particular colormap assigned.
DataImpressionGroup group;
group.GetDataImpression((di) =>
{
try
{
SimpleSurfaceDataImpression sdi = di as SimpleSurfaceDataImpression;
return sdi.colormap.Uuid == new Guid("5a761a72-8bcb-11ea-9265-005056bae6d8");
}
catch
{
return null;
}
});
|
Improve this Doc
View Source
GetDataImpression(Guid)
Get a data impression by its UUID
Declaration
public DataImpression GetDataImpression(Guid uuid)
Parameters
Type | Name | Description |
---|---|---|
Guid | uuid |
Returns
Type | Description |
---|---|
DataImpression | The data impression, if found, otherwise |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
GetDataImpression<T>()
Get a data impression matching a type
Declaration
public T GetDataImpression<T>() where T : DataImpression
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
GetDataImpression<T>(Func<T, bool>)
Get a data impression matching a type AND a particular criteria
Declaration
public T GetDataImpression<T>(Func<T, bool> criteria) where T : DataImpression
Parameters
Type | Name | Description |
---|---|---|
Func<T, bool> | criteria |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
Examples
This method can be used as a more elegant way to access individual types of data impressions.
DataImpressionGroup group;
group.GetDataImpression<SimpleSurfaceDataImpression>((di) =>
{
// di is already a SimpleSurfaceDataImpression
return sdi.colormap.Uuid == new Guid("5a761a72-8bcb-11ea-9265-005056bae6d8");
});
|
Improve this Doc
View Source
GetDataImpressions()
Return all data impressions inside this data impression group
Declaration
public Dictionary<Guid, DataImpression> GetDataImpressions()
Returns
Type | Description |
---|---|
Dictionary<Guid, DataImpression> |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
GetDataImpressions(Func<DataImpression, bool>)
Return all data impressions that match a particular criteria
Declaration
public List<DataImpression> GetDataImpressions(Func<DataImpression, bool> criteria)
Parameters
Type | Name | Description |
---|---|---|
Func<DataImpression, bool> | criteria |
Returns
Type | Description |
---|---|
List<DataImpression> |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
GetDataImpressionsOfType<T>()
Get all data impressions in this group that match a particular type (e.g. get all SimpleSurfaceDataImpressions).
Declaration
[Obsolete("GetDataImpressionsOfType<T> is obsolete, use GetDataImpressions<T> instead")]
public List<T> GetDataImpressionsOfType<T>() where T : DataImpression
Returns
Type | Description |
---|---|
List<T> |
Type Parameters
Name | Description |
---|---|
T |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
GetDataImpressionsWithTag(string)
Get all data impressions that have a particular tag. Tags can be any string value. They are not used internally to the engine but can be useful for keeping track of data impressions in applications that use ABR.
Declaration
public List<DataImpression> GetDataImpressionsWithTag(string tag)
Parameters
Type | Name | Description |
---|---|---|
string | tag |
Returns
Type | Description |
---|---|
List<DataImpression> |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
GetDataImpressions<T>()
Return all data impressions that have a particular type
Declaration
public List<T> GetDataImpressions<T>() where T : DataImpression
Returns
Type | Description |
---|---|
List<T> |
Type Parameters
Name | Description |
---|---|
T |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
GetDataImpressions<T>(Func<T, bool>)
Return all data impressions that match a particular criteria AND have a particular type
Declaration
public List<T> GetDataImpressions<T>(Func<T, bool> criteria) where T : DataImpression
Parameters
Type | Name | Description |
---|---|---|
Func<T, bool> | criteria |
Returns
Type | Description |
---|---|
List<T> |
Type Parameters
Name | Description |
---|---|
T |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
GetDataset()
Get the dataset that all impressions in this DataImpressionGroup are associated with. All DataImpressionGroups MUST have only one dataset.
Declaration
public Dataset GetDataset()
Returns
Type | Description |
---|---|
Dataset |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
HasDataImpression(Guid)
Return whether or not the data impression with a given UUID is present in this DataImpressionGroup
Declaration
public bool HasDataImpression(Guid uuid)
Parameters
Type | Name | Description |
---|---|---|
Guid | uuid |
Returns
Type | Description |
---|---|
bool |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
HasEncodedGameObject(Guid)
Check to see if a data impression with a particular UUID has a GameObject yet
Declaration
public bool HasEncodedGameObject(Guid uuid)
Parameters
Type | Name | Description |
---|---|---|
Guid | uuid |
Returns
Type | Description |
---|---|
bool |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
RecalculateBounds()
From scratch, recalculate the bounds of this DataImpressionGroup. Start with a zero-size bounding box and expand until it encapsulates all datasets.
Declaration
public bool RecalculateBounds()
Returns
Type | Description |
---|---|
bool | Returns a boolean whether or not the bounds have changed since last recalculation |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
RemoveDataImpression(Guid)
Remove data impression, returning true if this data impression group is empty after the removal of such impression.
Declaration
public bool RemoveDataImpression(Guid uuid)
Parameters
Type | Name | Description |
---|---|---|
Guid | uuid |
Returns
Type | Description |
---|---|
bool |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
RenderImpressions()
Render every data impression inside this data impression group. Three levels of "update" are provided for each data impression (see RenderHints for more information):
- Recompute everything if the data source has changed (geometry, style, visibility)
- Only recompute style if only the style (variables, visassets, etc.) has changed
- Only toggle visibility if only that has changed
Declaration
public void RenderImpressions()
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
TryGetContainerBoundsInGroupSpace(out Bounds)
Get the bounds of the container containing all the data in this DataImpressionGroup
Declaration
public bool TryGetContainerBoundsInGroupSpace(out Bounds container)
Parameters
Type | Name | Description |
---|---|---|
Bounds | container |
Returns
Type | Description |
---|---|
bool |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
TryGetContainerBoundsInWorldSpace(out Bounds)
A DataImpressionGroup is a group of data impressions within ABR. DataImpressionGroups can be constrained within a defined bounding box (see ABRDataContainer), and can automatically rescale all of their data to stay within this container. Each time a new KeyData object is loaded into a data impression in this group, the GroupToDataMatrix and GroupBounds are updated.
Declaration
public bool TryGetContainerBoundsInWorldSpace(out Bounds container)
Parameters
Type | Name | Description |
---|---|---|
Bounds | container |
Returns
Type | Description |
---|---|
bool |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
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 |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.
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 |
Remarks
DataImpressionGroups cannot be constructed directly, you MUST use the a variation of the CreateDataImpressionGroup(string) method.