Class TLspOpenFlightPainter
- All Implemented Interfaces:
ILspPaintGroupsChangeListener,ILspPainter
- Since:
- 2012.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.luciad.view.lightspeed.layer.paintgroup.ILspPaintGroupsChangeListener
ILspPaintGroupsChangeListener.Callback -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyChangeListener(PropertyChangeListener aPropertyChangeListener) Adds aPropertyChangeListenerto the list of listeners that must be notified when any of the properties of thisILspPainterchanges.voidaddTextureSearchPath(String aPath) Adds a directory to the list of paths to be searched for texture files.voidcommitChanges(Object aEventId) Called when the changes for a specified event should be committed.Returns the minimum required OpenGL profile that a view must support in order to be compatible with this painter.getStyler(TLspPaintState aPaintState) Always returns null because styling is not relevant.booleanReturns true if the mesh painter creates meshes asynchronously; false otherwise.paintObjects(ILcdGLDrawable aGLDrawable, List<TLspPaintGroup> aPaintGroups, TLspPaintPass aPass, TLspContext aContext) Paints the specified groups of objects into a view.voidprepareChanges(List<TLspPaintGroupsChangedEvent> aEvents, Object aEventId, ILspPaintGroupsChangeListener.Callback aCallback) Called when the paint groups will change.<T> booleanquery(List<TLspPaintGroup> aPaintGroups, ALspPaintQuery<T> aQuery, TLspPaintRepresentationState aPaintRepresentationState, TLspContext aContext) Retrieves a set of domain objects and data based on the parameters given by the query.voidregisterLayer(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation) Registers a layer with this painter.voidremovePropertyChangeListener(PropertyChangeListener aPropertyChangeListener) Removes aPropertyChangeListenerfrom the list of listeners.voidsetAsynchronousMeshCreation(boolean aAsynchronousMeshCreation) Sets whether or not this painter should create meshes asynchronously.voidunregisterLayer(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation) Unregisters a layer from this painter.
-
Constructor Details
-
TLspOpenFlightPainter
public TLspOpenFlightPainter()Creates a new OpenFlight painter.
-
-
Method Details
-
addTextureSearchPath
Adds a directory to the list of paths to be searched for texture files.- Parameters:
aPath- the name of a directory containing texture images
-
getRequiredOpenGLProfile
Description copied from interface:ILspPainterReturns the minimum required OpenGL profile that a view must support in order to be compatible with this painter.- Specified by:
getRequiredOpenGLProfilein interfaceILspPainter- Returns:
- a
TLspGLProfile
-
registerLayer
public void registerLayer(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation) Description copied from interface:ILspPainterRegisters a layer with this painter. This notifies the painter that it is going to be used in combination with the given layer, for the given paint representation. This allows it to implement setup code if necessary, or to keep track of all layers on which it is set. Layers registered with this method must be unregistered when the layer stops using this painter, usingILspPainter.unregisterLayer(ILspInteractivePaintableLayer, com.luciad.view.lightspeed.layer.TLspPaintRepresentation).- Specified by:
registerLayerin interfaceILspPainter- Parameters:
aLayer- A layer with which this painter will be used.aPaintRepresentation- The paint representation for which this painter will be used.
-
unregisterLayer
public void unregisterLayer(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation) Description copied from interface:ILspPainterUnregisters a layer from this painter. This notifies the painter that it will no longer be used in combination with the given layer, for the given paint representation. This allows it to implement cleanup code if necessary. Layers unregistered with this method must have been registered before calling this method with the methodILspPainter.registerLayer(ILspInteractivePaintableLayer, com.luciad.view.lightspeed.layer.TLspPaintRepresentation).- Specified by:
unregisterLayerin interfaceILspPainter- Parameters:
aLayer- A layer that needs to be unregisteredaPaintRepresentation- The paint representation for which this painter was used with aLayer
-
addPropertyChangeListener
Description copied from interface:ILspPainterAdds aPropertyChangeListenerto the list of listeners that must be notified when any of the properties of thisILspPainterchanges.- Specified by:
addPropertyChangeListenerin interfaceILspPainter- Parameters:
aPropertyChangeListener- the listener that from now on will be notified of all changes to properties of this painter
-
removePropertyChangeListener
Description copied from interface:ILspPainterRemoves aPropertyChangeListenerfrom the list of listeners. This listener will no longer be notified of any changes to the properties of thisILspPainter- Specified by:
removePropertyChangeListenerin interfaceILspPainter- Parameters:
aPropertyChangeListener- the listener that no longer will be notified of any changes to properties of this painter
-
prepareChanges
public void prepareChanges(List<TLspPaintGroupsChangedEvent> aEvents, Object aEventId, ILspPaintGroupsChangeListener.Callback aCallback) Description copied from interface:ILspPaintGroupsChangeListenerCalled when the paint groups will change. The listener should prepare the necessary changes for the events but not commit them yet. TheILspPaintGroupsChangeListener.Callback.changesReady(java.lang.Object)method must be invoked when the listener is ready to commit the changes. IfaEventIdisnullthen the changes may be committed immediately. In this case there will be no call toILspPaintGroupsChangeListener.commitChanges(Object).Note that it is not mandatory to do this two-phased commit cycle. You may commit or apply the changes immediately, but you still must invoke the callback.
- Specified by:
prepareChangesin interfaceILspPaintGroupsChangeListener- Parameters:
aEvents- the changesaEventId- the event id ornullaCallback- the callback ornull
-
commitChanges
Description copied from interface:ILspPaintGroupsChangeListenerCalled when the changes for a specified event should be committed.- Specified by:
commitChangesin interfaceILspPaintGroupsChangeListener- Parameters:
aEventId- the event id
-
paintObjects
public TLspPaintProgress paintObjects(ILcdGLDrawable aGLDrawable, List<TLspPaintGroup> aPaintGroups, TLspPaintPass aPass, TLspContext aContext) Description copied from interface:ILspPainterPaints the specified groups of objects into a view. The objects are partitioned into
TLspPaintGroups, which are created by the layer which invoked this painter. Painters are advised to also implementILspPaintGroupsChangeListener, which allows them to keep track of changes to the supplied list of paint groups. This way, the painter can exploit temporal coherence and perform its work in the most optimal way.This method returns a
TLspPaintProgresswhich describes the completeness of the paint operation. If the painter scheduled one or more tasks to be executed asynchronously, it may return from itspaintObjects()method before having rendered all the objects it was given. In this case, the returned progress object can describe the amount of work that has been done and the work that is still remaining.- Specified by:
paintObjectsin interfaceILspPainter- Parameters:
aGLDrawable- theILcdGLDrawablein which the objects are to be paintedaPaintGroups- the objects to be paintedaPass- the current paint passaContext- provides context information to the painter- Returns:
- a
TLspPaintProgressobject describing the completeness of the paint operation
-
getStyler
Always returns null because styling is not relevant.- Specified by:
getStylerin interfaceILspPainter- Parameters:
aPaintState- the paint state for which a styler is requested- Returns:
- the styler used by this object, or null.
-
query
public <T> boolean query(List<TLspPaintGroup> aPaintGroups, ALspPaintQuery<T> aQuery, TLspPaintRepresentationState aPaintRepresentationState, TLspContext aContext) Description copied from interface:ILspPainterRetrieves a set of domain objects and data based on the parameters given by the query.- Specified by:
queryin interfaceILspPainter- Parameters:
aPaintGroups- the paint groupsaQuery- the queryaPaintRepresentationState- the paint representation state for which the query should be performedaContext- the context- Returns:
trueif the query completed,falseif it was aborted.
-
isAsynchronousMeshCreation
public boolean isAsynchronousMeshCreation()Returns true if the mesh painter creates meshes asynchronously; false otherwise.- Returns:
- true if the mesh painter creates meshes asynchronously; false otherwise.
-
setAsynchronousMeshCreation
public void setAsynchronousMeshCreation(boolean aAsynchronousMeshCreation) Sets whether or not this painter should create meshes asynchronously.- Parameters:
aAsynchronousMeshCreation- if true, this mesh painter will create meshes asynchronously on the task executor of the view.- See Also:
-