Isle
Loading...
Searching...
No Matches
LegoView Class Reference

[AI] Represents a 3D rendering surface holding the main scene group and camera for rendering. More...

#include <legoview1.h>

Inheritance diagram for LegoView:
Collaboration diagram for LegoView:

Public Member Functions

 LegoView ()
 [AI] Constructs an empty LegoView with uninitialized scene and camera. More...
 
 ~LegoView () override
 [AI] Destructor. More...
 
BOOL Create (const CreateStruct &rCreateStruct, Tgl::Renderer *pRenderer)
 [AI] Initialize the LegoView with a scene root and camera using the provided creation parameters and renderer. More...
 
void Destroy () override
 [AI] Release all scene and camera resources, call TglSurface cleanup. More...
 
Tgl::GroupGetScene () const
 [AI] Accessor for the root scene group. More...
 
Tgl::CameraGetCamera () const
 [AI] Accessor for the view's main camera. More...
 
- Public Member Functions inherited from TglSurface
 TglSurface ()
 [AI] Constructs a new TglSurface instance with members initialized to their default state. More...
 
virtual ~TglSurface ()
 [AI] Virtual destructor also triggers Destroy(). More...
 
virtual BOOL Create (const CreateStruct &, Tgl::Renderer *, Tgl::Group *pScene)
 [AI] Creates and initializes the surface, rendering device, and optionally installs scene graph. More...
 
virtual void Destroy ()
 [AI] Destroys all resources (view, device), releasing scene and renderer references. More...
 
virtual double Render ()
 [AI] Renders a single frame and returns the render time for that frame. More...
 
Tgl::RendererGetRenderer () const
 [AI] Gets the active renderer for this surface. More...
 
Tgl::DeviceGetDevice () const
 [AI] Returns the graphics device used by this surface, e.g. More...
 
Tgl::ViewGetView () const
 [AI] Gets the current view/camera for this surface. More...
 
Tgl::GroupGetScene () const
 [AI] Returns the currently attached 3D scene root/group. More...
 
unsigned long GetWidth () const
 [AI] Returns the width (in pixels) of the rendered surface. More...
 
unsigned long GetHeight () const
 [AI] Returns the height (in pixels) of the rendered surface. More...
 
double GetRenderingRate () const
 [AI] Returns the measured rendering rate (frames per second) for the rendering routine. More...
 
double GetFrameRate () const
 [AI] Returns the measured frame rate (frames per second) for the current surface. More...
 
unsigned long GetFrameCount () const
 [AI] Returns the frame count since creation or since last meter reset. More...
 

Protected Member Functions

Tgl::ViewCreateView (Tgl::Renderer *pRenderer, Tgl::Device *pDevice) override
 [AI] Create and return the Tgl::View object for this surface. More...
 
- Protected Member Functions inherited from TglSurface
virtual Tgl::ViewCreateView (Tgl::Renderer *, Tgl::Device *)=0
 [AI] Abstract view creation. More...
 
virtual void DestroyView ()
 [AI] Destroys (deletes) the surface's view/camera, and resets the pointer to null. More...
 

Detailed Description

[AI] Represents a 3D rendering surface holding the main scene group and camera for rendering.

[AI] LegoView encapsulates a TglSurface, containing a Tgl::Group root scene node and an associated Tgl::Camera to define the scene's viewpoint and projection. It provides lifecycle and resource management (create/destroy), and gives access to the scene and camera for further manipulation or extension. [AI]

Definition at line 24 of file legoview1.h.

Constructor & Destructor Documentation

◆ LegoView()

LegoView::LegoView ( )

[AI] Constructs an empty LegoView with uninitialized scene and camera.

Definition at line 30 of file legoview1.cpp.

◆ ~LegoView()

LegoView::~LegoView ( )
override

[AI] Destructor.

Ensures scene and camera are destroyed and released.

Definition at line 38 of file legoview1.cpp.

Member Function Documentation

◆ Create()

BOOL LegoView::Create ( const CreateStruct rCreateStruct,
Tgl::Renderer pRenderer 
)

[AI] Initialize the LegoView with a scene root and camera using the provided creation parameters and renderer.

Parameters
rCreateStruct[AI] Structure describing the view's creation parameters (e.g., resolution, view angle). [AI]
pRenderer[AI] Renderer used to create scene and camera objects and underlying TglSurface resources. [AI]
Returns
TRUE if creation succeeded, FALSE on error (resource allocation failed or bad input). [AI]

Definition at line 45 of file legoview1.cpp.

◆ CreateView()

Tgl::View * LegoView::CreateView ( Tgl::Renderer pRenderer,
Tgl::Device pDevice 
)
overrideprotectedvirtual

[AI] Create and return the Tgl::View object for this surface.

Parameters
pRendererThe rendering system used to instantiate the view. [AI]
pDeviceThe actual output device (window, surface, etc) for rendering. [AI]
Returns
Initialized Tgl::View with camera set, sized to match the surface. [AI]

Implements TglSurface.

Definition at line 86 of file legoview1.cpp.

◆ Destroy()

void LegoView::Destroy ( )
overridevirtual

[AI] Release all scene and camera resources, call TglSurface cleanup.

[AI] This overrides TglSurface::Destroy to ensure scene root and camera are deleted and set to null before calling the parent's cleanup. [AI]

Reimplemented from TglSurface.

Reimplemented in LegoView1.

Definition at line 96 of file legoview1.cpp.

◆ GetCamera()

Tgl::Camera * LegoView::GetCamera ( ) const
inline

[AI] Accessor for the view's main camera.

Returns
Pointer to the camera object used for viewing the scene. [AI]

Definition at line 84 of file legoview1.h.

◆ GetScene()

Tgl::Group * LegoView::GetScene ( ) const
inline

[AI] Accessor for the root scene group.

Returns
Pointer to the root scene group node of the rendered world. [AI]

Definition at line 79 of file legoview1.h.


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