Isle
Loading...
Searching...
No Matches
TglImpl::ViewImpl Class Reference

[AI] Implementation of Tgl::View backed by Direct3DRMViewport, handles scene rendering, picking, and camera control. More...

#include <impl.h>

Inheritance diagram for TglImpl::ViewImpl:
Collaboration diagram for TglImpl::ViewImpl:

Public Types

typedef IDirect3DRMViewport * ViewDataType
 [AI] Internal pointer to Direct3DRMViewport [AI] More...
 

Public Member Functions

 ViewImpl ()
 [AI] Initializes viewport pointer [AI] More...
 
 ~ViewImpl () override
 [AI] Cleans up viewport on destruction [AI] More...
 
void * ImplementationDataPtr () override
 Returns Direct3DRMViewport implementation pointer [AI]. More...
 
Result Add (const Light *) override
 Adds a light to this view [AI]. More...
 
Result Remove (const Light *) override
 Removes a light from this view [AI]. More...
 
Result SetCamera (const Camera *) override
 Sets the active camera for this view [AI]. More...
 
Result SetProjection (ProjectionType) override
 Sets the camera projection type (perspective/orthographic) [AI]. More...
 
Result SetFrustrum (float frontClippingDistance, float backClippingDistance, float degrees) override
 Sets the view frustum parameters [AI]. More...
 
Result SetBackgroundColor (float r, float g, float b) override
 Sets background color [AI]. More...
 
Result GetBackgroundColor (float *r, float *g, float *b) override
 Gets the background color [AI]. More...
 
Result Clear () override
 Clears the view [AI]. More...
 
Result Render (const Group *) override
 Renders the provided scene/group [AI]. More...
 
Result ForceUpdate (unsigned long x, unsigned long y, unsigned long width, unsigned long height) override
 Forces an update/redraw of specified rectangle [AI]. More...
 
Result TransformWorldToScreen (const float world[3], float screen[4]) override
 Converts a world coordinate to screen space [AI]. More...
 
Result TransformScreenToWorld (const float screen[4], float world[3]) override
 Converts screen coordinates to world space [AI]. More...
 
Result Pick (unsigned long x, unsigned long y, const Group **ppGroupsToPickFrom, int groupsToPickFromCount, const Group **&rppPickedGroups, int &rPickedGroupCount) override
 Picks objects in the view by screen coordinate [AI]. More...
 
const ViewDataTypeImplementationData () const
 Gets internal viewport pointer, const [AI]. More...
 
ViewDataTypeImplementationData ()
 Gets internal viewport pointer, mutable [AI]. More...
 
void SetImplementationData (IDirect3DRMViewport *viewport)
 Sets internal viewport pointer [AI]. More...
 
void Destroy ()
 Frees viewport resources [AI]. More...
 
Result Add (const LightImpl &rLight)
 Adds a light using impl object [AI]. More...
 
Result Remove (const LightImpl &rLight)
 Removes a light using impl object [AI]. More...
 
Result SetCamera (const CameraImpl &rCamera)
 Sets active camera using impl [AI]. More...
 
Result Render (const GroupImpl &rScene)
 Renders a group using impl [AI]. More...
 
Result Pick (unsigned long x, unsigned long y, const GroupImpl **ppGroupsToPickFrom, int groupsToPickFromCount, const Group **&rppPickedGroups, int &rPickedGroupCount)
 Picks group using impl objects [AI]. More...
 
virtual Result Add (const Light *)=0
 [AI] Adds a light to the view for rendering. More...
 
virtual Result Remove (const Light *)=0
 [AI] Removes a light from the view. More...
 
virtual Result SetCamera (const Camera *)=0
 [AI] Sets the camera used by the view. More...
 
virtual Result SetProjection (ProjectionType)=0
 [AI] Sets projection type for the view (e.g., perspective/orthographic). More...
 
virtual Result SetFrustrum (float frontClippingDistance, float backClippingDistance, float degrees)=0
 [AI] Sets front and back clipping planes and view field in degrees. More...
 
virtual Result SetBackgroundColor (float r, float g, float b)=0
 [AI] Sets the background color for the view. More...
 
virtual Result GetBackgroundColor (float *r, float *g, float *b)=0
 [AI] Retrieves the current background color. More...
 
virtual Result Clear ()=0
 [AI] Clears the current contents of the view. More...
 
virtual Result Render (const Group *)=0
 [AI] Renders a group hierarchy to the view. More...
 
virtual Result ForceUpdate (unsigned long x, unsigned long y, unsigned long width, unsigned long height)=0
 [AI] Forces update/redraw of a region in the view. More...
 
virtual Result TransformWorldToScreen (const float world[3], float screen[4])=0
 [AI] Transforms a world-space position to screen coordinates. More...
 
virtual Result TransformScreenToWorld (const float screen[4], float world[3])=0
 [AI] Converts screen coordinate back to world position. More...
 
virtual Result Pick (unsigned long x, unsigned long y, const Group **ppGroupsToPickFrom, int groupsToPickFromCount, const Group **&rppPickedGroups, int &rPickedGroupCount)=0
 [AI] Picks the group under screen coordinates, searching specific group trees. More...
 
- Public Member Functions inherited from Tgl::Object
virtual ~Object ()
 [AI] Destructor; releases resources. More...
 
virtual void * ImplementationDataPtr ()=0
 [AI] Returns a pointer to internal/implementation data, if any. More...
 

Static Public Member Functions

static Result ViewportCreateAppData (IDirect3DRM2 *, IDirect3DRMViewport *, IDirect3DRMFrame2 *)
 Associates user app data with a viewport/frame [AI]. More...
 

Friends

class RendererImpl
 

Detailed Description

[AI] Implementation of Tgl::View backed by Direct3DRMViewport, handles scene rendering, picking, and camera control.

[AI]

Definition at line 449 of file impl.h.

Member Typedef Documentation

◆ ViewDataType

typedef IDirect3DRMViewport* TglImpl::ViewImpl::ViewDataType

[AI] Internal pointer to Direct3DRMViewport [AI]

Definition at line 566 of file impl.h.

Constructor & Destructor Documentation

◆ ViewImpl()

TglImpl::ViewImpl::ViewImpl ( )
inline

[AI] Initializes viewport pointer [AI]

Definition at line 452 of file impl.h.

◆ ~ViewImpl()

TglImpl::ViewImpl::~ViewImpl ( )
inlineoverride

[AI] Cleans up viewport on destruction [AI]

Definition at line 455 of file impl.h.

Member Function Documentation

◆ Add() [1/2]

Result ViewImpl::Add ( const Light pLight)
overridevirtual

Adds a light to this view [AI].

Parameters
LightPointer to Tgl::Light [AI]

Implements Tgl::View.

Definition at line 197 of file view.cpp.

◆ Add() [2/2]

Result ViewImpl::Add ( const LightImpl rLight)
inline

Adds a light using impl object [AI].

Parameters
rLightLightImpl reference [AI]

Definition at line 187 of file view.cpp.

◆ Clear()

Result ViewImpl::Clear ( )
overridevirtual

Clears the view [AI].

Implements Tgl::View.

Definition at line 379 of file view.cpp.

◆ Destroy()

void TglImpl::ViewImpl::Destroy ( )
inline

Frees viewport resources [AI].

Frees Direct3DRMViewport resources [AI].

Definition at line 654 of file impl.h.

◆ ForceUpdate()

Result ViewImpl::ForceUpdate ( unsigned long  x,
unsigned long  y,
unsigned long  width,
unsigned long  height 
)
overridevirtual

Forces an update/redraw of specified rectangle [AI].

Parameters
xX position [AI]
yY position [AI]
widthWidth [AI]
heightHeight [AI]

Implements Tgl::View.

Definition at line 489 of file view.cpp.

◆ GetBackgroundColor()

Result ViewImpl::GetBackgroundColor ( float *  r,
float *  g,
float *  b 
)
overridevirtual

Gets the background color [AI].

Parameters
rRed output [AI]
gGreen output [AI]
bBlue output [AI]

Implements Tgl::View.

Definition at line 364 of file view.cpp.

◆ ImplementationData() [1/2]

ViewDataType & TglImpl::ViewImpl::ImplementationData ( )
inline

Gets internal viewport pointer, mutable [AI].

Definition at line 577 of file impl.h.

◆ ImplementationData() [2/2]

const ViewDataType & TglImpl::ViewImpl::ImplementationData ( ) const
inline

Gets internal viewport pointer, const [AI].

Definition at line 571 of file impl.h.

◆ ImplementationDataPtr()

void * ViewImpl::ImplementationDataPtr ( )
overridevirtual

Returns Direct3DRMViewport implementation pointer [AI].

Implements Tgl::Object.

Definition at line 172 of file view.cpp.

◆ Pick() [1/2]

Result ViewImpl::Pick ( unsigned long  x,
unsigned long  y,
const Group **  ppGroupsToPickFrom,
int  groupsToPickFromCount,
const Group **&  rppPickedGroups,
int &  rPickedGroupCount 
)
overridevirtual

Picks objects in the view by screen coordinate [AI].

Parameters
xScreen X coord [AI]
yScreen Y coord [AI]
ppGroupsToPickFromList of groups to pick from [AI]
groupsToPickFromCountCount of groups to pick from [AI]
rppPickedGroupsReference to list of picked groups [AI]
rPickedGroupCountReference to number of picked groups [AI]

Implements Tgl::View.

Definition at line 521 of file view.cpp.

◆ Pick() [2/2]

Result ViewImpl::Pick ( unsigned long  x,
unsigned long  y,
const GroupImpl **  ppGroupsToPickFrom,
int  groupsToPickFromCount,
const Group **&  rppPickedGroups,
int &  rPickedGroupCount 
)
inline

Picks group using impl objects [AI].

Definition at line 497 of file view.cpp.

◆ Remove() [1/2]

Result ViewImpl::Remove ( const Light pLight)
overridevirtual

Removes a light from this view [AI].

Parameters
LightPointer to Tgl::Light [AI]

Implements Tgl::View.

Definition at line 225 of file view.cpp.

◆ Remove() [2/2]

Result ViewImpl::Remove ( const LightImpl rLight)
inline

Removes a light using impl object [AI].

Parameters
rLightLightImpl reference [AI]

Definition at line 215 of file view.cpp.

◆ Render() [1/2]

Result ViewImpl::Render ( const Group pGroup)
overridevirtual

Renders the provided scene/group [AI].

Parameters
GroupGroup (scene root) [AI]

Implements Tgl::View.

Definition at line 467 of file view.cpp.

◆ Render() [2/2]

Result ViewImpl::Render ( const GroupImpl rScene)
inline

Renders a group using impl [AI].

Parameters
rSceneGroupImpl reference [AI]

Definition at line 457 of file view.cpp.

◆ SetBackgroundColor()

Result ViewImpl::SetBackgroundColor ( float  r,
float  g,
float  b 
)
overridevirtual

Sets background color [AI].

Parameters
rRed [AI]
gGreen [AI]
bBlue [AI]

Implements Tgl::View.

Definition at line 342 of file view.cpp.

◆ SetCamera() [1/2]

Result ViewImpl::SetCamera ( const Camera pCamera)
overridevirtual

Sets the active camera for this view [AI].

Parameters
CameraPointer to Tgl::Camera [AI]

Implements Tgl::View.

Definition at line 265 of file view.cpp.

◆ SetCamera() [2/2]

Result ViewImpl::SetCamera ( const CameraImpl rCamera)
inline

Sets active camera using impl [AI].

Parameters
rCameraCameraImpl reference [AI]

Definition at line 255 of file view.cpp.

◆ SetFrustrum()

Result ViewImpl::SetFrustrum ( float  frontClippingDistance,
float  backClippingDistance,
float  degrees 
)
overridevirtual

Sets the view frustum parameters [AI].

Parameters
frontClippingDistanceNear clipping plane [AI]
backClippingDistanceFar clipping plane [AI]
degreesField of view or orthographic width [AI]

Implements Tgl::View.

Definition at line 313 of file view.cpp.

◆ SetImplementationData()

void TglImpl::ViewImpl::SetImplementationData ( IDirect3DRMViewport *  viewport)
inline

Sets internal viewport pointer [AI].

Parameters
viewportViewport to set [AI]

Definition at line 583 of file impl.h.

◆ SetProjection()

Result ViewImpl::SetProjection ( ProjectionType  type)
overridevirtual

Sets the camera projection type (perspective/orthographic) [AI].

Parameters
typeProjection type [AI]

Implements Tgl::View.

Definition at line 283 of file view.cpp.

◆ TransformScreenToWorld()

Result ViewImpl::TransformScreenToWorld ( const float  screen[4],
float  world[3] 
)
overridevirtual

Converts screen coordinates to world space [AI].

Parameters
screenInput screen coordinates [AI]
worldOutput world coordinates [AI]

Implements Tgl::View.

Definition at line 595 of file view.cpp.

◆ TransformWorldToScreen()

Result ViewImpl::TransformWorldToScreen ( const float  world[3],
float  screen[4] 
)
overridevirtual

Converts a world coordinate to screen space [AI].

Parameters
worldInput world coordinates [AI]
screenOutput screen coordinates [AI]

Implements Tgl::View.

Definition at line 564 of file view.cpp.

◆ ViewportCreateAppData()

Result ViewImpl::ViewportCreateAppData ( IDirect3DRM2 *  pDevice,
IDirect3DRMViewport *  pViewport,
IDirect3DRMFrame2 *  pCamera 
)
static

Associates user app data with a viewport/frame [AI].

Parameters
d3drmDirect3DRM2 pointer [AI]
viewportViewport pointer [AI]
frameAssociated frame [AI]

Definition at line 68 of file view.cpp.

Friends And Related Function Documentation

◆ RendererImpl

friend class RendererImpl
friend

Definition at line 634 of file impl.h.


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