public final class SolidPrimitive extends Primitive implements IDisposable
TriangleMeshPrimitive
or PolylinePrimitive
can be used for reduced overhead.| Constructor and Description | 
|---|
SolidPrimitive()
Initializes a default solid primitive. 
 | 
SolidPrimitive(SetHint setHint)
Initializes a solid primitive with the specified  
setHint. | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
dispose(boolean disposing)  | 
protected void | 
finalize()
Called by the garbage collector on an object when garbage collection
 determines that there are no more references to the object. 
 | 
boolean | 
getAffectedByLighting()
Gets whether the primitive is affected by lighting. 
 | 
Color | 
getBackLineColor()
Gets the back line's color. 
 | 
float | 
getBackLineTranslucency()
Gets the back line's translucency. 
 | 
float | 
getBackLineWidth()
Gets the back line's width, in pixels. 
 | 
boolean | 
getDisplayFill()
Gets whether the solid's fill is displayed. 
 | 
boolean | 
getDisplayOutline()
Gets whether the solid's outline is displayed. 
 | 
boolean | 
getDisplaySilhouette()
Gets whether the solid's silhouette is displayed. 
 | 
static float | 
getMaximumSilhouetteWidthSupported()
Gets the maximum silhouette width, in pixels, supported by the video card. 
 | 
static float | 
getMinimumSilhouetteWidthSupported()
Gets the minimum silhouette width, in pixels, supported by the video card. 
 | 
OutlineAppearance | 
getOutlineAppearance()
Gets the outline's appearance. 
 | 
Color | 
getOutlineColor()
Gets the outline's color. 
 | 
float | 
getOutlineTranslucency()
Gets the outline's translucency. 
 | 
float | 
getOutlineWidth()
Gets the outline's width, in pixels. 
 | 
Cartesian | 
getPosition()
Gets the solid's position. 
 | 
UnitQuaternion | 
getRotation()
Gets the rotation applied to the solid before rendering. 
 | 
Cartesian | 
getScale()
Gets a non-uniform scale that is applied to the solid to increase or
decrease its rendered size. 
 | 
SetHint | 
getSetHint()
Gets the primitive's  
SetHint. | 
Color | 
getSilhouetteColor()
Gets the silhouette's color. 
 | 
float | 
getSilhouetteTranslucency()
Gets the silhouette's translucency. 
 | 
float | 
getSilhouetteWidth()
Gets the silhouette' width, in pixels. 
 | 
void | 
set(Iterable<Cartesian> positions,
   Iterable<Cartesian> normals,
   Iterable<Integer> indices,
   Iterable<Integer> outlineIndices,
   WindingOrder windingOrder,
   BoundingSphere boundingSphere,
   boolean closed)
Defines the solid using the specified parameters. 
 | 
void | 
set(SolidTriangulatorResult solidTriangulatorResult)
Defines the solid using the specified  
solidTriangulatorResult. | 
void | 
setAffectedByLighting(boolean value)
Sets whether the primitive is affected by lighting. 
 | 
void | 
setBackLineColor(Color value)
Sets the back line's color. 
 | 
void | 
setBackLineTranslucency(float value)
Sets the back line's translucency. 
 | 
void | 
setBackLineWidth(float value)
Sets the back line's width, in pixels. 
 | 
void | 
setDisplayFill(boolean value)
Sets whether the solid's fill is displayed. 
 | 
void | 
setDisplayOutline(boolean value)
Sets whether the solid's outline is displayed. 
 | 
void | 
setDisplaySilhouette(boolean value)
Sets whether the solid's silhouette is displayed. 
 | 
void | 
setOutlineAppearance(OutlineAppearance value)
Sets the outline's appearance. 
 | 
void | 
setOutlineColor(Color value)
Sets the outline's color. 
 | 
void | 
setOutlineTranslucency(float value)
Sets the outline's translucency. 
 | 
void | 
setOutlineWidth(float value)
Sets the outline's width, in pixels. 
 | 
void | 
setPosition(Cartesian value)
Sets the solid's position. 
 | 
void | 
setRotation(UnitQuaternion value)
Sets the rotation applied to the solid before rendering. 
 | 
void | 
setScale(Cartesian value)
Sets a non-uniform scale that is applied to the solid to increase or
decrease its rendered size. 
 | 
void | 
setSilhouetteColor(Color value)
Sets the silhouette's color. 
 | 
void | 
setSilhouetteTranslucency(float value)
Sets the silhouette's translucency. 
 | 
void | 
setSilhouetteWidth(float value)
Sets the silhouette' width, in pixels. 
 | 
void | 
setTranslucency(float value)
Sets the primitive's translucency. 
 | 
dispose, getAutomaticallyComputeBoundingSphere, getBoundingSphere, getColor, getDisplay, getDisplayCondition, getReferenceFrame, getTag, getTranslucency, setAutomaticallyComputeBoundingSphere, setBoundingSphere, setColor, setDisplay, setDisplayCondition, setReferenceFrame, setTagclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, disposepublic SolidPrimitive()
SetHint of Frequent.
    
See SolidPrimitive.SolidPrimitive(agi.foundation.graphics.SetHint)
for a full discussion.
public SolidPrimitive(SetHint setHint)
setHint.
    
After constructing the primitive, call
Set
to provide it with a
SolidTriangulatorResult.
The primitive's properties are initialized to the following values:
agi.foundation.graphics.primitive.AutomaticallyComputeBoundingSphere:  trueagi.foundation.graphics.primitive.BoundingSphere:  BoundingSphere.MaximumRadiusBoundingSphere (get)agi.foundation.graphics.primitive.Color:  Purpleagi.foundation.graphics.primitive.Display:  trueagi.foundation.graphics.primitive.DisplayCondition:  nullagi.foundation.graphics.primitive.ReferenceFrame:  The earth's agi.foundation.celestial.earthcentralbody.FixedFramePosition: Cartesian.ZeroRotation: (1, 0, 0, 0)Scale: (1, 1, 1)Translucency:  0.7fAffectedByLighting:  trueDisplayFill:  trueDisplaySilhouette:  falseSilhouetteColor:  WhiteSilhouetteTranslucency:  0SilhouetteWidth:  2MaximumSilhouetteWidthSupported:  Video card dependentMinimumSilhouetteWidthSupported:  Video card dependentDisplayOutline:  trueOutlineColor:  PurpleOutlineTranslucency:  0OutlineWidth:  1OutlineAppearance:  agi.foundation.graphics.OutlineAppearance#FrontAndBackLinesBackLineColor:  PurpleBackLineTranslucency:  0.5fBackLineWidth:  1SetHint:  setHint
    
        Once the primitive is constructed, it must be added to
        Primitives (get) before it will be rendered.
      
setHint - The expected usage for Set methods.
        See the Set Hint topic for more information on
        selecting an appropriate value.UnsupportedCaseException - setHint must be
        agi.foundation.graphics.SetHint#Infrequent or
        agi.foundation.graphics.SetHint#Frequent.
        agi.foundation.graphics.SetHint#Partial is not
        supported by this primitive.protected void finalize()
                 throws Throwable
java.lang.Objectfinalize method to dispose of
 system resources or to perform other cleanup.
 
 The general contract of finalize is that it is invoked
 if and when the Java™ virtual
 machine has determined that there is no longer any
 means by which this object can be accessed by any thread that has
 not yet died, except as a result of an action taken by the
 finalization of some other object or class which is ready to be
 finalized. The finalize method may take any action, including
 making this object available again to other threads; the usual purpose
 of finalize, however, is to perform cleanup actions before
 the object is irrevocably discarded. For example, the finalize method
 for an object that represents an input/output connection might perform
 explicit I/O transactions to break the connection before the object is
 permanently discarded.
 
 The finalize method of class Object performs no
 special action; it simply returns normally. Subclasses of
 Object may override this definition.
 
 The Java programming language does not guarantee which thread will
 invoke the finalize method for any given object. It is
 guaranteed, however, that the thread that invokes finalize will not
 be holding any user-visible synchronization locks when finalize is
 invoked. If an uncaught exception is thrown by the finalize method,
 the exception is ignored and finalization of that object terminates.
 
 After the finalize method has been invoked for an object, no
 further action is taken until the Java virtual machine has again
 determined that there is no longer any means by which this object can
 be accessed by any thread that has not yet died, including possible
 actions by other objects or classes which are ready to be finalized,
 at which point the object may be discarded.
 
 The finalize method is never invoked more than once by a Java
 virtual machine for any given object.
 
 Any exception thrown by the finalize method causes
 the finalization of this object to be halted, but is otherwise
 ignored.
finalize in class ObjectThrowable - the Exception raised by this methodWeakReference, 
PhantomReferencepublic final boolean getAffectedByLighting()
    
If lighting makes one side of the solid too dark, set this to false
for the solid to have uniform color.  When this is false, it is
recommonded that DisplayOutline be true, so the shape
of the solid is still decipherable.
public final void setAffectedByLighting(boolean value)
    
If lighting makes one side of the solid too dark, set this to false
for the solid to have uniform color.  When this is false, it is
recommonded that DisplayOutline be true, so the shape
of the solid is still decipherable.
public final boolean getDisplayFill()
public final void setDisplayFill(boolean value)
public final boolean getDisplaySilhouette()
    
The silhouette is the outline of the solid from the camera's point of view.
It is a useful visual cue to differentiate the solid from the background.
The silhouette is rendered using SilhouetteColor,
SilhouetteTranslucency, and SilhouetteWidth.
SilhouetteColor, 
SilhouetteTranslucency, 
SilhouetteWidth, 
TranslucentPrimitivesSortOrder (get), 
TranslucentPrimitivesSortOrder (get)public final void setDisplaySilhouette(boolean value)
    
The silhouette is the outline of the solid from the camera's point of view.
It is a useful visual cue to differentiate the solid from the background.
The silhouette is rendered using SilhouetteColor,
SilhouetteTranslucency, and SilhouetteWidth.
SilhouetteColor, 
SilhouetteTranslucency, 
SilhouetteWidth, 
TranslucentPrimitivesSortOrder (get), 
TranslucentPrimitivesSortOrder (get)public final Color getSilhouetteColor()
DisplaySilhouette, 
SilhouetteTranslucency, 
SilhouetteWidthpublic final void setSilhouetteColor(Color value)
DisplaySilhouette, 
SilhouetteTranslucency, 
SilhouetteWidthpublic final float getSilhouetteTranslucency()
0 and 1, where 0 is opaque and 1 is transparent.ArgumentOutOfRangeException - The translucency must be between 0 and 1.DisplaySilhouette, 
SilhouetteColor, 
SilhouetteWidthpublic final void setSilhouetteTranslucency(float value)
0 and 1, where 0 is opaque and 1 is transparent.ArgumentOutOfRangeException - The translucency must be between 0 and 1.DisplaySilhouette, 
SilhouetteColor, 
SilhouetteWidthpublic final float getSilhouetteWidth()
The width is defined in pixels so even if the camera moves very close or very far from the solid, the width of the silhouette on the screen does not change.
ArgumentOutOfRangeException - Width is less than 0.InsufficientVideoCardException - Width is outside of the range supported by the video card.  To verify
a width is supported, check MinimumSilhouetteWidthSupported
and MaximumSilhouetteWidthSupported.  Regardless of
MinimumSilhouetteWidthSupported, a width of 0 is
always allowed and effectively hides the silhouette.DisplaySilhouette, 
SilhouetteColor, 
SilhouetteTranslucency, 
MinimumSilhouetteWidthSupported, 
MaximumSilhouetteWidthSupportedpublic final void setSilhouetteWidth(float value)
The width is defined in pixels so even if the camera moves very close or very far from the solid, the width of the silhouette on the screen does not change.
ArgumentOutOfRangeException - Width is less than 0.InsufficientVideoCardException - Width is outside of the range supported by the video card.  To verify
a width is supported, check MinimumSilhouetteWidthSupported
and MaximumSilhouetteWidthSupported.  Regardless of
MinimumSilhouetteWidthSupported, a width of 0 is
always allowed and effectively hides the silhouette.DisplaySilhouette, 
SilhouetteColor, 
SilhouetteTranslucency, 
MinimumSilhouetteWidthSupported, 
MaximumSilhouetteWidthSupportedpublic static final float getMinimumSilhouetteWidthSupported()
SilhouetteWidthpublic static final float getMaximumSilhouetteWidthSupported()
SilhouetteWidthpublic final boolean getDisplayOutline()
OutlineColor, 
OutlineTranslucency, 
OutlineWidth, 
OutlineAppearancepublic final void setDisplayOutline(boolean value)
OutlineColor, 
OutlineTranslucency, 
OutlineWidth, 
OutlineAppearancepublic final Color getOutlineColor()
DisplayOutline, 
OutlineTranslucency, 
OutlineWidth, 
OutlineAppearancepublic final void setOutlineColor(Color value)
DisplayOutline, 
OutlineTranslucency, 
OutlineWidth, 
OutlineAppearancepublic final float getOutlineTranslucency()
0 and 1, where 0 is opaque and 1 is transparent.ArgumentOutOfRangeException - The translucency must be between 0 and 1.DisplayOutline, 
OutlineColor, 
OutlineWidth, 
OutlineAppearancepublic final void setOutlineTranslucency(float value)
0 and 1, where 0 is opaque and 1 is transparent.ArgumentOutOfRangeException - The translucency must be between 0 and 1.DisplayOutline, 
OutlineColor, 
OutlineWidth, 
OutlineAppearancepublic final float getOutlineWidth()
The width is defined in pixels so even if the camera moves very close or very far from a solid, the width of the outline on the screen does not change.
ArgumentOutOfRangeException - Width is less than 0.InsufficientVideoCardException - Width is outside of the range supported by the video card.  To verify
a width is supported, check PolylinePrimitive.MinimumWidthSupported (get)
and PolylinePrimitive.MaximumWidthSupported (get).  Regardless of
PolylinePrimitive.MinimumWidthSupported (get), a width of 0 is
always allowed and effectively hides the outline.DisplayOutline, 
OutlineColor, 
OutlineTranslucency, 
OutlineAppearance, 
PolylinePrimitive.MinimumWidthSupported (get), 
PolylinePrimitive.MaximumWidthSupported (get)public final void setOutlineWidth(float value)
The width is defined in pixels so even if the camera moves very close or very far from a solid, the width of the outline on the screen does not change.
ArgumentOutOfRangeException - Width is less than 0.InsufficientVideoCardException - Width is outside of the range supported by the video card.  To verify
a width is supported, check PolylinePrimitive.MinimumWidthSupported (get)
and PolylinePrimitive.MaximumWidthSupported (get).  Regardless of
PolylinePrimitive.MinimumWidthSupported (get), a width of 0 is
always allowed and effectively hides the outline.DisplayOutline, 
OutlineColor, 
OutlineTranslucency, 
OutlineAppearance, 
PolylinePrimitive.MinimumWidthSupported (get), 
PolylinePrimitive.MaximumWidthSupported (get)public final OutlineAppearance getOutlineAppearance()
    
Changing OutlineAppearance can result in this solid primitive hiding translucent
primitives behind it.  To avoid this, set the solid's owner's
PrimitivesSortOrder to
PrimitivesSortOrderBackToFront.
DisplayOutline, 
OutlineColor, 
OutlineTranslucency, 
OutlineWidth, 
TranslucentPrimitivesSortOrder (get), 
TranslucentPrimitivesSortOrder (get)public final void setOutlineAppearance(OutlineAppearance value)
    
Changing OutlineAppearance can result in this solid primitive hiding translucent
primitives behind it.  To avoid this, set the solid's owner's
PrimitivesSortOrder to
PrimitivesSortOrderBackToFront.
DisplayOutline, 
OutlineColor, 
OutlineTranslucency, 
OutlineWidth, 
TranslucentPrimitivesSortOrder (get), 
TranslucentPrimitivesSortOrder (get)public final Color getBackLineColor()
    
This is only used when OutlineAppearance
is agi.foundation.graphics.OutlineAppearance#StylizeBackLines.
OutlineAppearance, 
BackLineTranslucency, 
BackLineWidthpublic final void setBackLineColor(Color value)
    
This is only used when OutlineAppearance
is agi.foundation.graphics.OutlineAppearance#StylizeBackLines.
OutlineAppearance, 
BackLineTranslucency, 
BackLineWidthpublic final float getBackLineTranslucency()
0 and 1, where 0 is opaque and 1 is transparent.
    
This is only used when OutlineAppearance
is agi.foundation.graphics.OutlineAppearance#StylizeBackLines.
ArgumentOutOfRangeException - The translucency must be between 0 and 1.OutlineAppearance, 
BackLineColor, 
BackLineWidthpublic final void setBackLineTranslucency(float value)
0 and 1, where 0 is opaque and 1 is transparent.
    
This is only used when OutlineAppearance
is agi.foundation.graphics.OutlineAppearance#StylizeBackLines.
ArgumentOutOfRangeException - The translucency must be between 0 and 1.OutlineAppearance, 
BackLineColor, 
BackLineWidthpublic final Cartesian getPosition()
ReferenceFrame.
    
If the solid's
agi.foundation.graphics.primitive.AutomaticallyComputeBoundingSphere
property is true when setting the solid's position, the Center of the solid's
agi.foundation.graphics.primitive.BoundingSphere
is set to the new position.  Otherwise, it is the caller's
responsibility to update the solid's
agi.foundation.graphics.primitive.BoundingSphere
to a sphere that encompasses the solid.
ReferenceFrame, 
agi.foundation.graphics.primitive.AutomaticallyComputeBoundingSpherepublic final void setPosition(Cartesian value)
ReferenceFrame.
    
If the solid's
agi.foundation.graphics.primitive.AutomaticallyComputeBoundingSphere
property is true when setting the solid's position, the Center of the solid's
agi.foundation.graphics.primitive.BoundingSphere
is set to the new position.  Otherwise, it is the caller's
responsibility to update the solid's
agi.foundation.graphics.primitive.BoundingSphere
to a sphere that encompasses the solid.
ReferenceFrame, 
agi.foundation.graphics.primitive.AutomaticallyComputeBoundingSpherepublic final UnitQuaternion getRotation()
public final void setRotation(UnitQuaternion value)
public final Cartesian getScale()
    
A Scale of (1, 1, 1) renders the solid using its actual size.
Values greater than 1 for a component increase the size of the rendered
solid in the corresponding direction in the primitive's
agi.foundation.graphics.primitive.ReferenceFrame.  Values
less than 1 decrease the size.
    
If the solid's
agi.foundation.graphics.primitive.AutomaticallyComputeBoundingSphere
property is true when setting Scale, the Radius of the solid's
agi.foundation.graphics.primitive.BoundingSphere
is set to fit around the scaled solid.  Otherwise, it is the caller's
responsibility to update the solid's
agi.foundation.graphics.primitive.BoundingSphere
to a sphere that encompasses the scaled solid.
public final void setScale(Cartesian value)
    
A Scale of (1, 1, 1) renders the solid using its actual size.
Values greater than 1 for a component increase the size of the rendered
solid in the corresponding direction in the primitive's
agi.foundation.graphics.primitive.ReferenceFrame.  Values
less than 1 decrease the size.
    
If the solid's
agi.foundation.graphics.primitive.AutomaticallyComputeBoundingSphere
property is true when setting Scale, the Radius of the solid's
agi.foundation.graphics.primitive.BoundingSphere
is set to fit around the scaled solid.  Otherwise, it is the caller's
responsibility to update the solid's
agi.foundation.graphics.primitive.BoundingSphere
to a sphere that encompasses the scaled solid.
public final float getBackLineWidth()
    
This is only used when OutlineAppearance
is agi.foundation.graphics.OutlineAppearance#StylizeBackLines.
The width is defined in pixels so even if the camera moves very close or very far from a solid, the width of the outline on the screen does not change.
ArgumentOutOfRangeException - Width is less than 0.InsufficientVideoCardException - Width is outside of the range supported by the video card.  To verify
a width is supported, check PolylinePrimitive.MinimumWidthSupported (get)
and PolylinePrimitive.MaximumWidthSupported (get).  Regardless of
PolylinePrimitive.MinimumWidthSupported (get), a width of 0 is
always allowed and effectively hides the back line.OutlineAppearance, 
BackLineColor, 
BackLineTranslucency, 
PolylinePrimitive.MinimumWidthSupported (get), 
PolylinePrimitive.MaximumWidthSupported (get)public final void setBackLineWidth(float value)
    
This is only used when OutlineAppearance
is agi.foundation.graphics.OutlineAppearance#StylizeBackLines.
The width is defined in pixels so even if the camera moves very close or very far from a solid, the width of the outline on the screen does not change.
ArgumentOutOfRangeException - Width is less than 0.InsufficientVideoCardException - Width is outside of the range supported by the video card.  To verify
a width is supported, check PolylinePrimitive.MinimumWidthSupported (get)
and PolylinePrimitive.MaximumWidthSupported (get).  Regardless of
PolylinePrimitive.MinimumWidthSupported (get), a width of 0 is
always allowed and effectively hides the back line.OutlineAppearance, 
BackLineColor, 
BackLineTranslucency, 
PolylinePrimitive.MinimumWidthSupported (get), 
PolylinePrimitive.MaximumWidthSupported (get)public final SetHint getSetHint()
SetHint.
        See the Set Hint topic for more information on
        selecting an appropriate value to construct the primitive with.public void setTranslucency(float value)
PrimitiveTranslucency is between 0 and 1,
where 0 is opaque and 1 is transparent.setTranslucency in class Primitivepublic final void set(SolidTriangulatorResult solidTriangulatorResult)
solidTriangulatorResult.
The solid is rendered in the primitive's agi.foundation.graphics.primitive.ReferenceFrame.
    
        If this method is called frequently, it is recommended to construct the primitive with
        agi.foundation.graphics.SetHint#Frequent,
        which is the default.  If this method will be called only once or infrequently, construct the primitive with
        agi.foundation.graphics.SetHint#Infrequent.
        See the Set Hint topic for more information.
      
    
        If the primitive's
        AutomaticallyComputeBoundingSphere (get)
        property is true, the primitive's
        BoundingSphere (get)
        is computed based on the input.
        Otherwise, it is the caller's responsibility to update the primitive's
        BoundingSphere (get)
        to a sphere that encompasses the input.
      
solidTriangulatorResult - The triangulator used to define the solid.ArgumentNullException - solidTriangulatorResult is null.CouldNotCreateVideoCardResourceException - Could not allocate video memory for the solid.public final void set(Iterable<Cartesian> positions, Iterable<Cartesian> normals, Iterable<Integer> indices, Iterable<Integer> outlineIndices, WindingOrder windingOrder, BoundingSphere boundingSphere, boolean closed)
agi.foundation.graphics.primitive.ReferenceFrame.
    
        If this method is called frequently, it is recommended to construct the primitive with
        agi.foundation.graphics.SetHint#Frequent,
        which is the default.  If this method will be called only once or infrequently, construct the primitive with
        agi.foundation.graphics.SetHint#Infrequent.
        See the Set Hint topic for more information.
      
    
        If the primitive's
        AutomaticallyComputeBoundingSphere (get)
        property is true, the primitive's
        BoundingSphere (get)
        is computed based on the input.
        Otherwise, it is the caller's responsibility to update the primitive's
        BoundingSphere (get)
        to a sphere that encompasses the input.
      
positions - The positions of the solid.normals - The normals of the mesh.indices - The indices into positions and normals.outlineIndices - The indices into positions that define an outline of the solid.windingOrder - The orientation of front-facing triangles.boundingSphere - The bounding sphere that encompasses the solid.closed - Indicates if the solid is closed.  For example, a box with six faces is closed.  If one face is removed, the box is open.