TEntity
- The type of entity.public class ModelVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation> extends EntityVisualizer<TEntity>
EntityVisualizer
which creates a model for each entity.
This visualizer uses an instance ModelPrimitive
for each entity. It is required that each ModelPrimitive
have exactly one entity
associated with it. A single instance of ModelPrimitive
cannot be used for
multiple entities nor can multiple ModelPrimitive
instances be used for
a single entity. The primitive's ReferenceFrame
(get
/ set
),
Display
(get
/ set
), DisplayCondition
(get
/ set
),
Color
(get
/ set
), Scale
(get
/ set
),
Tag
(get
/ set
), Orientation
(get
/ set
)
and Position
(get
/ set
) properties will be modified and
should never be set explicitly. All other properties and methods,
such as loading a new model file or adjusting articulations, can be used
normally.
Constructor and Description |
---|
ModelVisualizer(TypeLiteral<TEntity> typeLiteralTEntity)
Initializes a new instance.
|
ModelVisualizer(TypeLiteral<TEntity> typeLiteralTEntity,
EntitySet<TEntity> entities,
ModelCallback<TEntity> callback)
Creates a new instance with the provided
EntitySet and ModelCallback . |
Modifier and Type | Method and Description |
---|---|
protected void |
dispose(boolean disposing)
Releases any resources associated with this instance.
|
ModelCallback<TEntity> |
getCallback()
Gets the
ModelCallback used to retrieve a model for each entity. |
Color |
getColor()
Gets the color.
|
boolean |
getDisplay()
Gets a value indicating whether the entities are displayed.
|
DisplayCondition |
getDisplayCondition()
Gets the
DisplayCondition . |
EntitySet<TEntity> |
getEntities()
Gets the entities being visualized.
|
double |
getScale()
Gets the scale of the models, with 1 being actual size.
|
float |
getTranslucency()
Gets the translucency.
|
Iterable<TEntity> |
pick(PickResult pickResult)
Given a
PickResult , returns the entities that were picked. |
void |
setCallback(ModelCallback<TEntity> value)
Sets the
ModelCallback used to retrieve a model for each entity. |
void |
setColor(Color value)
Sets the color.
|
void |
setDisplay(boolean value)
Sets a value indicating whether the entities are displayed.
|
void |
setDisplayCondition(DisplayCondition value)
Sets the
DisplayCondition . |
void |
setEntities(EntitySet<TEntity> value)
Sets the entities being visualized.
|
void |
setScale(double value)
Sets the scale of the models, with 1 being actual size.
|
void |
setTranslucency(float value)
Sets the translucency.
|
void |
update(Transaction transaction)
Updates the underlying primitives to reflect the latest entity state.
|
dispose, pick, pick
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public ModelVisualizer(TypeLiteral<TEntity> typeLiteralTEntity)
typeLiteralTEntity
- A TypeLiteral object representing the generic type TEntity
.public ModelVisualizer(TypeLiteral<TEntity> typeLiteralTEntity, EntitySet<TEntity> entities, ModelCallback<TEntity> callback)
EntitySet
and ModelCallback
.typeLiteralTEntity
- A TypeLiteral object representing the generic type TEntity
.entities
- The entities to be visualized.callback
- The callback used to determine each entity's model.protected void dispose(boolean disposing)
dispose
in class EntityVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation>
disposing
- true
to release both managed and unmanaged resources;
false
to release only unmanaged resources.public final ModelCallback<TEntity> getCallback()
ModelCallback
used to retrieve a model for each entity.public final void setCallback(ModelCallback<TEntity> value)
ModelCallback
used to retrieve a model for each entity.public final double getScale()
public final void setScale(double value)
public EntitySet<TEntity> getEntities()
getEntities
in class EntityVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation>
public void setEntities(EntitySet<TEntity> value)
setEntities
in class EntityVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation>
@Nonnull public Color getColor()
EntityVisualizer
getColor
in class EntityVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation>
public void setColor(@Nonnull Color value)
EntityVisualizer
setColor
in class EntityVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation>
public float getTranslucency()
getTranslucency
in class EntityVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation>
UnsupportedOperationException
- Thrown if set.public void setTranslucency(float value)
setTranslucency
in class EntityVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation>
UnsupportedOperationException
- Thrown if set.public boolean getDisplay()
getDisplay
in class EntityVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation>
public void setDisplay(boolean value)
setDisplay
in class EntityVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation>
public DisplayCondition getDisplayCondition()
EntityVisualizer
DisplayCondition
.getDisplayCondition
in class EntityVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation>
public void setDisplayCondition(DisplayCondition value)
EntityVisualizer
DisplayCondition
.setDisplayCondition
in class EntityVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation>
public void update(Transaction transaction)
update
in class EntityVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation>
transaction
- The transaction to use.ArgumentNullException
- Thrown if transaction
is null
.PropertyInvalidException
- Thrown if Entities
(get
/ set
) is null
.PropertyInvalidException
- Thrown if Callback
(get
/ set
) is null
.public Iterable<TEntity> pick(PickResult pickResult)
PickResult
, returns the entities that were picked.pick
in class EntityVisualizer<TEntity extends IEntityIdentifier & IEntityPosition & IEntityOrientation>
pickResult
- The result of the Insight3D pick.ArgumentNullException
- Thrown if pickResult
is null
.