NDEVR
API Documentation
ViewportFactoryabstract

A service which can generate Viewports based on Camera data. More...

Inheritance diagram for ViewportFactory:
[legend]
Collaboration diagram for ViewportFactory:
[legend]

Public Member Functions

virtual Buffer< DynamicPointer< Camera > > availableCameraStreams () const
 Returns all camera streams that this factory can provide.
virtual bool canCreateView (const DynamicPointer< Camera > &camera, DesignObjectLookup *model_manager, bool ignore_active)=0
 Checks whether this factory can create a view for the given camera.
virtual CameraView * createView (const DynamicPointer< Camera > &camera, DesignObjectLookup *model_manager, QWidget *parent=nullptr)=0
 Creates a CameraView widget for the given camera and model manager.
virtual void resetToDefaults ()
 Resets this factory's settings to their default values.

Static Public Member Functions

static void AddFactory (ViewportFactory *factory)
 Registers a viewport factory for creating camera views.
static Buffer< DynamicPointer< Camera > > AvailableCameraStreams ()
 Returns all available camera streams from all registered factories.
static bool CanCreateView (const DynamicPointer< Camera > &camera, DesignObjectLookup *model_manager)
 Checks whether any registered factory can create a view for the given camera.
static CameraView * CreateView (const DynamicPointer< Camera > &camera, DesignObjectLookup *model_manager, QWidget *parent=nullptr)
 Creates a CameraView using the first registered factory that supports the given camera.
static Buffer< ViewportFactory * > RegisteredFactories ()
 Returns all registered ViewportFactory instances.

Static Protected Attributes

static Buffer< ViewportFactory * > s_camera_factories
 The list of registered viewport factories.

Detailed Description

A service which can generate Viewports based on Camera data.


Definition at line 10 of file ViewportFactory.h.

Member Function Documentation

◆ AddFactory()

void ViewportFactory::AddFactory ( ViewportFactory * factory)
static

Registers a viewport factory for creating camera views.

Parameters
[in]factoryThe factory to register.

◆ AvailableCameraStreams()

Buffer< DynamicPointer< Camera > > ViewportFactory::AvailableCameraStreams ( )
static

Returns all available camera streams from all registered factories.

Returns
A buffer of available camera stream pointers.

◆ availableCameraStreams()

virtual Buffer< DynamicPointer< Camera > > ViewportFactory::availableCameraStreams ( ) const
inlinevirtual

Returns all camera streams that this factory can provide.

Returns
A buffer of available camera stream pointers.

Reimplemented in LocalPhysicalCameraViewFactory, and VulkanPhysicalCameraViewFactory.

Definition at line 33 of file ViewportFactory.h.

◆ CanCreateView()

bool ViewportFactory::CanCreateView ( const DynamicPointer< Camera > & camera,
DesignObjectLookup * model_manager )
static

Checks whether any registered factory can create a view for the given camera.

Parameters
[in]cameraThe camera to check.
[in]model_managerThe design object lookup providing scene data.
Returns
True if at least one factory can create a view.

◆ canCreateView()

virtual bool ViewportFactory::canCreateView ( const DynamicPointer< Camera > & camera,
DesignObjectLookup * model_manager,
bool ignore_active )
pure virtual

Checks whether this factory can create a view for the given camera.

Parameters
[in]cameraThe camera to check.
[in]model_managerThe design object lookup providing scene data.
[in]ignore_activeWhether to ignore whether the camera is currently active.
Returns
True if this factory can create a view for the camera.

Implemented in GLESCameraViewFactory, LocalPhysicalCameraViewFactory, VLCPhysicalCameraViewFactory, VulkanCameraViewFactory, and VulkanPhysicalCameraViewFactory.

◆ CreateView()

CameraView * ViewportFactory::CreateView ( const DynamicPointer< Camera > & camera,
DesignObjectLookup * model_manager,
QWidget * parent = nullptr )
static

Creates a CameraView using the first registered factory that supports the given camera.

Parameters
[in]cameraThe camera to create a view for.
[in]model_managerThe design object lookup providing scene data.
[in]parentThe parent widget for the created view.
Returns
A new CameraView, or nullptr if no factory can handle this camera.

◆ createView()

virtual CameraView * ViewportFactory::createView ( const DynamicPointer< Camera > & camera,
DesignObjectLookup * model_manager,
QWidget * parent = nullptr )
pure virtual

Creates a CameraView widget for the given camera and model manager.

Parameters
[in]cameraThe camera to create a view for.
[in]model_managerThe design object lookup providing scene data.
[in]parentThe parent widget for the created view.
Returns
A new CameraView, or nullptr if the factory cannot handle this camera.

Implemented in GLESCameraViewFactory, LocalPhysicalCameraViewFactory, VLCPhysicalCameraViewFactory, VulkanCameraViewFactory, and VulkanPhysicalCameraViewFactory.

◆ RegisteredFactories()

Buffer< ViewportFactory * > ViewportFactory::RegisteredFactories ( )
static

Returns all registered ViewportFactory instances.

Returns
A buffer of registered factory pointers.

The documentation for this class was generated from the following file: