Click or drag to resize
Ab4d.SharpEngine logo

OverlayPanelBase Class

Base class for panels that render a separate scene as an overlay over a parent SceneView.
Inheritance Hierarchy

Namespace: Ab4d.SharpEngine.OverlayPanels
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 5.0.1075+bc537c8d217949260b11f66ee86aefa6456ac517
Syntax
C#
public abstract class OverlayPanelBase : ComponentBase, 
	IDisposable

The OverlayPanelBase type exposes the following members.

Constructors
 NameDescription
Protected methodOverlayPanelBase Initializes a new overlay panel.
Top
Properties
 NameDescription
Public propertyAlignment Gets the alignment of the panel relative to the parent SceneView.
Public propertyBackgroundColor Gets the background color of the panel. A transparent color (default) means that rendering should preserve the parent SceneView color behind the panel.
Public propertyHeight Gets height of the panel.
Protected propertyoverlayScene Gets the scene that contains objects rendered by this overlay panel.
Protected propertyoverlaySceneView Gets the SceneView that renders objects defined in overlayScene.
Public propertyParentSceneView Gets the parent SceneView that displays this overlay panel.
Public propertyPosition Gets the position offset. Note that the actual position is also determined from Alignment.
Protected propertysubscribedCamera 
Public propertyWidth Gets the width of the panel.
Top
Methods
 NameDescription
Public methodDispose Disposes the resources
Protected methodDispose(Boolean) Releases unmanaged and managed resources (when disposing is true). This method may be called only from the CheckAndDispose(Boolean) method and must not be called manually by the user.
(Overrides ComponentBaseDispose(Boolean))
Public methodGetPanelViewport Gets the position and size of this overlay panel in the parentSceneView.
Public methodGetPanelViewport(Boolean, Boolean) Gets the position and size of this overlay panel in the parentSceneView.
Protected methodGetSceneViewSize 
Protected methodNotifyOverlayPanelChanged Sets OverlayPanelChanged dirty flag in the ParentSceneView. This will request another frame rendering with another recording of command buffers.
Protected methodNotifyOverlayPanelUpdated Sets OverlayPanelUpdated dirty flag in the ParentSceneView. This will request another frame rendering without another recording of command buffers.
Protected methodNotifySizeOrPositionChanged Sets OverlayPanelChanged dirty flag in the ParentSceneView and also update the size in the next render pass.
Protected methodOnCameraChanged 
Protected methodOnCreateCamera OnCreateCamera method can be overridden in a derived class to create a custom camera. This method by default creates a TargetPositionCamera with Heading and Attitude set to 0 and Distance and ViewWidth to 100.
Protected methodOnCreateLights OnCreateLights method can be overridden to provide custom lights in the scene. If the method is called, then a 30% ambient light is set.
Protected methodOnCreateScene OnCreateScene method can be overriden in the derived class to create the 3D objects that are rendered by this overlay panel. To use async method the derived class can also override OnCreateSceneAsync(Scene) method.
Protected methodOnCreateSceneAsync OnCreateSceneAsync method can be overriden in the derived class to create the 3D objects that are rendered by this overlay panel. To use async method the derived class can also override OnCreateSceneAsync(Scene) method.
Protected methodOnInitializeDeviceResources Initializes resources with the specified GpuDevice. This method can be overriden and is called from InitializeDeviceResources(VulkanDevice) method.
Protected methodSetAlignment Sets the Alignment value.
Protected methodSetBackgroundColor Sets the BackgroundColor value.
Protected methodSetHeight Sets the Height value.
Protected methodSetPosition Sets the Position value.
Protected methodSetWidth Sets the Width value.
Protected methodSubscribeCameraChanged 
Protected methodUnsubscribeCameraChanged 
Public methodUpdate 
Public methodUpdate(SceneDirtyFlags, SceneViewDirtyFlags) Updates common panel state. Derived classes can override this method to update scene objects or the overlay camera.
Top
Fields
 NameDescription
Protected fieldAdjustSizeByDpiScale 
Protected fieldIsUsingSprites 
Protected fieldoverlayCamera Gets the camera used to render overlayScene. The value is available after initialization.
Protected fieldoverlayTargetPositionCamera Gets the camera that shows the objects in this overlay panel and is cased to a TargetPositionCamera. If the camera is not TargetPositionCamera then this field is null.
Top
Remarks

Base class for panels that render a separate scene as an overlay over a parent SceneView.

The objects that are defined in the OverlayPanelBase's Scene can be shown in parentSceneView in two different ways:

Rendered by using RenderOverlayPanels after 3D objects in parentSceneView are rendered. This is the default and the fastest option because the rendering process does not need to wait until object in overlay panel are rendered.

When OverlayPanelBase is created by setting isUsingSprites to true, then the 3D objects in this OverlayPanelBase are rendered to a separate GpuImage and then shown in the parentSceneView as a sprite. This requires waiting until the rendering of the overlay panel is finished before the sprite can be drawn.

The derived class should call OnCreateScene(Scene) or OnCreateSceneAsync(Scene) to define the 3D objects that are rendered by this overlay panel.

See Also