SLProject 4.0.000
SLSceneView Class Reference

SceneView class represents a dynamic real time 3D view onto the scene. More...

#include <SLSceneView.h>

Inheritance diagram for SLSceneView:
[legend]

Public Member Functions

 SLSceneView (SLScene *s, int dpi, SLInputManager &inputManager)
 SLSceneView default constructor. More...
 
 ~SLSceneView () override
 
void init (SLstring name, SLint screenWidth, SLint screenHeight, void *onWndUpdateCallback, void *onSelectNodeMeshCallback, SLUiInterface *gui, const string &configPath)
 
void unInit ()
 
void onInitialize ()
 
SLbool onPaint ()
 
void onResize (SLint width, SLint height)
 
virtual void onStartup ()
 
virtual void preDraw ()
 
virtual void postDraw ()
 
virtual void postSceneLoad ()
 
virtual SLbool onMouseDown (SLMouseButton button, SLint scrX, SLint scrY, SLKey mod)
 
virtual SLbool onMouseUp (SLMouseButton button, SLint scrX, SLint scrY, SLKey mod)
 
virtual SLbool onMouseMove (SLint x, SLint y)
 
virtual SLbool onMouseWheelPos (SLint wheelPos, SLKey mod)
 
virtual SLbool onMouseWheel (SLint delta, SLKey mod)
 
virtual SLbool onTouch2Down (SLint scrX1, SLint scrY1, SLint scrX2, SLint scrY2)
 
virtual SLbool onTouch2Move (SLint scrX1, SLint scrY1, SLint scrX2, SLint scrY2)
 
virtual SLbool onTouch2Up (SLint scrX1, SLint scrY1, SLint scrX2, SLint scrY2)
 
virtual SLbool onDoubleClick (SLMouseButton button, SLint x, SLint y, SLKey mod)
 
virtual SLbool onKeyPress (SLKey key, SLKey mod)
 
virtual SLbool onKeyRelease (SLKey key, SLKey mod)
 
virtual SLbool onCharInput (SLuint c)
 
SLbool draw3DGL (SLfloat elapsedTimeSec)
 Draws the 3D scene with OpenGL. More...
 
void draw3DGLAll ()
 
void draw3DGLNodes (SLVNode &nodes, SLbool alphaBlended, SLbool depthSorted)
 
void draw3DGLLines (SLVNode &nodes)
 
void draw3DGLLinesOverlay (SLVNode &nodes)
 
void draw2DGL ()
 
void draw2DGLNodes ()
 
SLbool draw3DRT ()
 
SLbool draw3DPT ()
 
SLbool draw3DCT ()
 
void initSceneViewCamera (const SLVec3f &dir=-SLVec3f::AXISZ, SLProjType proj=P_monoPerspective)
 
void switchToSceneViewCamera ()
 
void switchToNextCameraInScene ()
 Sets the active camera to the next in the scene. More...
 
SLbool isSceneViewCameraActive ()
 
SLstring windowTitle ()
 
void printStats ()
 
void startRaytracing (SLint maxDepth)
 
void startPathtracing (SLint maxDepth, SLint samples)
 
void setViewportFromRatio (const SLVec2i &vpRatio, SLViewportAlign vpAlignment, SLbool vpSameAsVideo)
 Sets the viewport ratio and the viewport rectangle. More...
 
void saveFrameBufferAsImage (SLstring pathFilename, cv::Size targetSize=cv::Size(-1, -1))
 Saves after n wait frames the front frame buffer as a PNG image. More...
 
void camera (SLCamera *camera)
 
void scene (SLScene *scene)
 
void scrW (SLint scrW)
 
void scrH (SLint scrH)
 
void doWaitOnIdle (SLbool doWI)
 
void doMultiSampling (SLbool doMS)
 
void doDepthTest (SLbool doDT)
 
void doFrustumCulling (SLbool doFC)
 
void doAlphaSorting (SLbool doAS)
 
void renderType (SLRenderType rt)
 
void viewportSameAsVideo (bool sameAsVideo)
 
void screenCaptureIsRequested (bool doScreenCap)
 
SLScenes ()
 
SLCameracamera ()
 
SLCamerasceneViewCamera ()
 
SLint scrW () const
 
SLint scrH () const
 
SLint scrWdiv2 () const
 
SLint scrHdiv2 () const
 
SLfloat scrWdivH () const
 
SLint dpi () const
 
SLRecti viewportRect () const
 
SLVec2i viewportRatio () const
 
SLfloat viewportWdivH () const
 
SLint viewportW () const
 
SLint viewportH () const
 
SLViewportAlign viewportAlign () const
 
SLbool viewportSameAsVideo () const
 
SLUiInterfacegui ()
 
SLbool doFrustumCulling () const
 
SLbool doAlphaSorting () const
 
SLbool doMultiSampling () const
 
SLbool doDepthTest () const
 
SLbool doWaitOnIdle () const
 
SLVNodenodesOpaque3D ()
 
SLVNodenodesBlended3D ()
 
SLVNodenodesOpaque2D ()
 
SLVNodenodesBlended2D ()
 
SLVNodenodesOverdrawn ()
 
SLRaytracerraytracer ()
 
SLPathtracerpathtracer ()
 
SLRenderType renderType () const
 
SLGLOculusFBoculusFB ()
 
SLDrawBitsdrawBits ()
 
SLbool drawBit (SLuint bit)
 
AvgFloatshadowMapTimeMS ()
 
AvgFloatcullTimesMS ()
 
AvgFloatdraw2DTimesMS ()
 
AvgFloatdraw3DTimesMS ()
 
SLNodeStatsstats2D ()
 
SLNodeStatsstats3D ()
 
SLbool screenCaptureIsRequested ()
 
std::unordered_set< SLMaterial * > & visibleMaterials2D ()
 
std::unordered_set< SLMaterial * > & visibleMaterials3D ()
 
- Public Member Functions inherited from SLObject
 SLObject (const SLstring &Name="", const SLstring &url="")
 
virtual ~SLObject ()
 
void name (const SLstring &Name)
 
void url (const SLstring &url)
 
const SLstringname () const
 
const SLstringurl () const
 

Public Attributes

cbOnWndUpdate onWndUpdate
 C-Callback for app for intermediate window repaint. More...
 
cbOnSelectNodeMesh onSelectedNodeMesh
 C-Callback for app on node selection. More...
 

Protected Attributes

SLScene_s
 Pointer to the scene observed by this scene view. More...
 
SLCamera_camera
 Pointer to the _active camera. More...
 
SLCamera _sceneViewCamera
 Default camera for this SceneView (default cam not in scenegraph) More...
 
SLUiInterface_gui = nullptr
 ImGui instance. More...
 
SLNodeStats _stats2D
 Statistic numbers for 2D nodes. More...
 
SLNodeStats _stats3D
 Statistic numbers for 3D nodes. More...
 
SLbool _gotPainted
 flag if this sceneview got painted More...
 
SLRenderType _renderType
 rendering type (GL,RT,PT) More...
 
SLbool _doDepthTest
 Flag if depth test is turned on. More...
 
SLbool _doMultiSampling
 Flag if multisampling is on. More...
 
SLbool _doFrustumCulling
 Flag if view frustum culling is on. More...
 
SLbool _doAlphaSorting
 Flag if alpha sorting in blending is on. More...
 
SLbool _doWaitOnIdle
 Flag for Event waiting. More...
 
SLbool _isFirstFrame
 Flag if it is the first frame rendering. More...
 
SLDrawBits _drawBits
 Sceneview level drawing flags. More...
 
SLfloat _shadowMapTimeMS
 time for drawing the shadow maps in ms More...
 
SLfloat _cullTimeMS
 time for culling in ms More...
 
SLfloat _draw3DTimeMS
 time for 3D drawing in ms More...
 
SLfloat _draw2DTimeMS
 time for 2D drawing in ms More...
 
SLbool _mouseDownL
 Flag if left mouse button is pressed. More...
 
SLbool _mouseDownR
 Flag if right mouse button is pressed. More...
 
SLbool _mouseDownM
 Flag if middle mouse button is pressed. More...
 
SLKey _mouseMod
 mouse modifier key on key down More...
 
SLint _touchDowns
 finger touch down count More...
 
SLVec2i _touch [3]
 up to 3 finger touch coordinates More...
 
SLGLVertexArrayExt _vaoTouch
 Buffer for touch pos. rendering. More...
 
SLGLVertexArrayExt _vaoCursor
 Virtual cursor for stereo rendering. More...
 
SLint _scrW
 Screen width in pixels. More...
 
SLint _scrH
 Screen height in pixels. More...
 
SLint _scrWdiv2
 Screen half width in pixels. More...
 
SLint _scrHdiv2
 Screen half height in pixels. More...
 
SLfloat _scrWdivH
 Screen side aspect ratio. More...
 
int _dpi
 dots per inch of screen More...
 
SLVec2i _viewportRatio
 ratio of viewport More...
 
SLViewportAlign _viewportAlign
 alignment of viewport More...
 
SLRecti _viewportRect
 rectangle of viewport More...
 
SLbool _viewportSameAsVideo
 Adapt viewport aspect to the input video. More...
 
SLbool _screenCaptureIsRequested
 Flag if screen capture is requested. More...
 
SLint _screenCaptureWaitFrames
 Frames to delay the screen capture. More...
 
SLGLOculusFB _oculusFB
 Oculus framebuffer. More...
 
std::unordered_set< SLMaterial * > _visibleMaterials3D
 visible materials 3D per frame More...
 
std::unordered_set< SLMaterial * > _visibleMaterials2D
 visible materials 2D per frame More...
 
SLVNode _nodesOpaque2D
 Vector of visible opaque nodes not in _visibleMaterials2D rendered in 2D. More...
 
SLVNode _nodesBlended2D
 Vector of visible blended nodes not in _visibleMaterials2D rendered in 2D. More...
 
SLVNode _nodesOpaque3D
 Vector of visible opaque nodes not in _visibleMaterials3D rendered in 3D. More...
 
SLVNode _nodesBlended3D
 Vector of visible blended nodes not in _visibleMaterials3D rendered in 3D. More...
 
SLVNode _nodesOverdrawn
 Vector of helper nodes drawn over all others. More...
 
SLRaytracer _raytracer
 Whitted style raytracer. More...
 
SLbool _stopRT
 Flag to stop the RT. More...
 
SLPathtracer _pathtracer
 Pathtracer. More...
 
SLbool _stopPT
 Flag to stop the PT. More...
 
SLInputManager_inputManager
 
AvgFloat _shadowMapTimesMS
 Averaged time for drawing the shadow maps in ms. More...
 
AvgFloat _cullTimesMS
 Averaged time for culling in ms. More...
 
AvgFloat _draw3DTimesMS
 Averaged time for 3D drawing in ms. More...
 
AvgFloat _draw2DTimesMS
 Averaged time for 2D drawing in ms. More...
 
- Protected Attributes inherited from SLObject
SLstring _name
 name of an object More...
 
SLstring _url
 uniform resource locator More...
 

Friends

class SLNode
 
class SLRaytracer
 
class SLOptixRaytracer
 
class SLPathtracer
 

Detailed Description

SceneView class represents a dynamic real time 3D view onto the scene.

The SLSceneView class has a pointer to an active camera that is used to generate the 3D view into a window of the clients GUI system. OpenGL ES3.0 or newer is used the default renderer for framebuffer rendering. Alternatively the sceneview can be rendered with a software ray tracing or path tracing renderer. All mouse, touch, keyboard, resize and paint events of the GUI system are handled in this class by the appropriate event handler methods. If your app need special event handling you can subclass this class and override the virtual function. If the scene contains itself no camera node the sceneview provides its own camera object.

Constructor & Destructor Documentation

◆ SLSceneView()

SLSceneView::SLSceneView ( SLScene s,
int  dpi,
SLInputManager inputManager 
)

SLSceneView default constructor.

The default constructor adds the this pointer to the sceneView vector in SLScene. If an in between element in the vector is zero (from previous sceneviews) it will be replaced. The sceneviews _index is the index in the sceneview vector. It never changes throughout the life of a sceneview.

◆ ~SLSceneView()

SLSceneView::~SLSceneView ( )
override

Member Function Documentation

◆ camera() [1/2]

SLCamera * SLSceneView::camera ( )
inline

◆ camera() [2/2]

void SLSceneView::camera ( SLCamera camera)
inline

◆ cullTimesMS()

AvgFloat & SLSceneView::cullTimesMS ( )
inline

◆ doAlphaSorting() [1/2]

SLbool SLSceneView::doAlphaSorting ( ) const
inline

◆ doAlphaSorting() [2/2]

void SLSceneView::doAlphaSorting ( SLbool  doAS)
inline

◆ doDepthTest() [1/2]

SLbool SLSceneView::doDepthTest ( ) const
inline

◆ doDepthTest() [2/2]

void SLSceneView::doDepthTest ( SLbool  doDT)
inline

◆ doFrustumCulling() [1/2]

SLbool SLSceneView::doFrustumCulling ( ) const
inline

◆ doFrustumCulling() [2/2]

void SLSceneView::doFrustumCulling ( SLbool  doFC)
inline

◆ doMultiSampling() [1/2]

SLbool SLSceneView::doMultiSampling ( ) const
inline

◆ doMultiSampling() [2/2]

void SLSceneView::doMultiSampling ( SLbool  doMS)
inline

◆ doWaitOnIdle() [1/2]

SLbool SLSceneView::doWaitOnIdle ( ) const
inline

◆ doWaitOnIdle() [2/2]

void SLSceneView::doWaitOnIdle ( SLbool  doWI)
inline

◆ dpi()

SLint SLSceneView::dpi ( ) const
inline

◆ draw2DGL()

void SLSceneView::draw2DGL ( )

SLSceneView::draw2DGL draws all 2D stuff in ortho projection. So far no update is done to the 2D scenegraph.

◆ draw2DGLNodes()

void SLSceneView::draw2DGLNodes ( )

SLSceneView::draw2DGLNodes draws 2D nodes from root2D in orthographic projection

◆ draw2DTimesMS()

AvgFloat & SLSceneView::draw2DTimesMS ( )
inline

◆ draw3DCT()

SLbool SLSceneView::draw3DCT ( )

◆ draw3DGL()

SLbool SLSceneView::draw3DGL ( SLfloat  elapsedTimeMS)

Draws the 3D scene with OpenGL.

This is the main routine for updating and drawing the 3D scene for one frame. The following steps are processed:

  1. Render shadow maps: Renders all shadow maps for lights in SLLight::renderShadowMap
  2. Updates the camera: If the active camera has an animation it gets updated first in SLCamera::camUpdate
  3. Clear all buffers: The color and depth buffer are cleared in this step. If the projection is the Oculus stereo projection also the framebuffer target is bound.
  4. Set viewport: Depending on the projection we set the camera projection and the view for the center or left eye.
  5. Render background: If no skybox is used the background is rendered. This can be the camera image if the camera is turned on.
  6. Set projection and view: Sets the camera projection matrix
  7. Frustum culling: During the cull traversal all materials that are seen in the view frustum get collected in _visibleMaterials. All nodes with their meshes get collected in SLMaterial::_nodesVisible3D. These materials and nodes get drawn in draw3DGLAll.
  8. Draw skybox: The skybox is draw as first object with frozen depth buffer. The skybox is always around the active camera.
  9. Draw all visible nodes: By calling the SLSceneView::draw3DGL all visible nodes of all visible materials get drawn sorted by material and transparency. If a stereo projection is set, the scene gets drawn a second time for the right eye.
  10. Draw right eye for stereo projections

◆ draw3DGLAll()

void SLSceneView::draw3DGLAll ( )

SLSceneView::draw3DGLAll renders by material sorted to avoid expensive material switches on the GPU. During the cull traversal all materials that are seen in the view frustum get collected in _visibleMaterials. All nodes with their meshes get collected in SLMaterial::_nodesVisible3D.
The 3D rendering has then the following steps: 1) Draw nodes with meshes with opaque materials and all helper lines sorted by material
2) Draw remaining opaque nodes (SLCameras, needs redesign)
3) Draw nodes with meshes with blended materials sorted by material and sorted back to front
4) Draw remaining blended nodes (SLText, needs redesign)
5) Draw helpers in overlay mode (not depth buffered)
6) Draw visualization lines of animation curves

◆ draw3DGLLines()

void SLSceneView::draw3DGLLines ( SLVNode nodes)

SLSceneView::draw3DGLLines draws the AABB from the passed node vector directly with their world coordinates after the view transform. The lines must be drawn without blending. Colors: Red : AABB of nodes with meshes Pink : AABB of nodes without meshes (only child nodes) Yellow: AABB of selected node

◆ draw3DGLLinesOverlay()

void SLSceneView::draw3DGLLinesOverlay ( SLVNode nodes)

SLSceneView::draw3DGLLinesOverlay draws the nodes axis and skeleton joints as overlay

◆ draw3DGLNodes()

void SLSceneView::draw3DGLNodes ( SLVNode nodes,
SLbool  alphaBlended,
SLbool  depthSorted 
)

SLSceneView::draw3DGLNodes draws the nodes meshes from the passed node vector directly with their world transform after the view transform.

◆ draw3DPT()

SLbool SLSceneView::draw3DPT ( )

SLSceneView::updateAndRT3D starts the raytracing or refreshes the current RT image during rendering. The function returns true if an animation was done prior to the rendering start.

◆ draw3DRT()

SLbool SLSceneView::draw3DRT ( )

SLSceneView::updateAndRT3D starts the raytracing or refreshes the current RT image during rendering. The function returns true if an animation was done prior to the rendering start.

◆ draw3DTimesMS()

AvgFloat & SLSceneView::draw3DTimesMS ( )
inline

◆ drawBit()

SLbool SLSceneView::drawBit ( SLuint  bit)
inline

◆ drawBits()

SLDrawBits * SLSceneView::drawBits ( )
inline

◆ gui()

SLUiInterface * SLSceneView::gui ( )
inline

◆ init()

void SLSceneView::init ( SLstring  name,
SLint  screenWidth,
SLint  screenHeight,
void *  onWndUpdateCallback,
void *  onSelectNodeMeshCallback,
SLUiInterface gui,
const string &  configPath 
)

SLSceneView::init initializes default values for an empty scene

Parameters
nameName of the sceneview
screenWidthWidth of the OpenGL frame buffer.
screenHeightHeight of the OpenGL frame buffer.
onWndUpdateCallbackCallback for ray tracing update
onSelectNodeMeshCallbackCallback on node and mesh selection
guiInterface for the external Gui build function
configPathPath to the config file

◆ initSceneViewCamera()

void SLSceneView::initSceneViewCamera ( const SLVec3f dir = -SLVec3f::AXISZ,
SLProjType  proj = P_monoPerspective 
)

SLSceneView::onInitialize is called by the window system before the first rendering. It applies all scene rendering attributes with the according OpenGL function.

◆ isSceneViewCameraActive()

SLbool SLSceneView::isSceneViewCameraActive ( )
inline

◆ nodesBlended2D()

SLVNode & SLSceneView::nodesBlended2D ( )
inline

◆ nodesBlended3D()

SLVNode & SLSceneView::nodesBlended3D ( )
inline

◆ nodesOpaque2D()

SLVNode & SLSceneView::nodesOpaque2D ( )
inline

◆ nodesOpaque3D()

SLVNode & SLSceneView::nodesOpaque3D ( )
inline

◆ nodesOverdrawn()

SLVNode & SLSceneView::nodesOverdrawn ( )
inline

◆ oculusFB()

SLGLOculusFB * SLSceneView::oculusFB ( )
inline

◆ onCharInput()

SLbool SLSceneView::onCharInput ( SLuint  c)
virtual

SLSceneView::onCharInput get called whenever a new charcter comes in

◆ onDoubleClick()

SLbool SLSceneView::onDoubleClick ( SLMouseButton  button,
SLint  scrX,
SLint  scrY,
SLKey  mod 
)
virtual

SLSceneView::onDoubleClick gets called when a mouse double click or finger double tab occurs.

◆ onInitialize()

void SLSceneView::onInitialize ( )

SLSceneView::onInitialize is called by the window system before the first rendering. It applies all scene rendering attributes with the according OpenGL function.

◆ onKeyPress()

SLbool SLSceneView::onKeyPress ( SLKey  key,
SLKey  mod 
)
virtual

SLSceneView::onKeyPress gets get called whenever a key is pressed. Before passing the command to the eventhandlers the main key commands are handled by forwarding them to onCommand.

◆ onKeyRelease()

SLbool SLSceneView::onKeyRelease ( SLKey  key,
SLKey  mod 
)
virtual

SLSceneView::onKeyRelease get called whenever a key is released.

◆ onMouseDown()

SLbool SLSceneView::onMouseDown ( SLMouseButton  button,
SLint  scrX,
SLint  scrY,
SLKey  mod 
)
virtual

SLSceneView::onMouseDown gets called whenever a mouse button gets pressed and dispatches the event to the currently attached event handler object.

Reimplemented in AppDemoSceneView.

◆ onMouseMove()

SLbool SLSceneView::onMouseMove ( SLint  scrX,
SLint  scrY 
)
virtual

SLSceneView::onMouseMove gets called whenever the mouse is moved.

◆ onMouseUp()

SLbool SLSceneView::onMouseUp ( SLMouseButton  button,
SLint  scrX,
SLint  scrY,
SLKey  mod 
)
virtual

SLSceneView::onMouseUp gets called whenever a mouse button gets released.

◆ onMouseWheel()

SLbool SLSceneView::onMouseWheel ( SLint  delta,
SLKey  mod 
)
virtual

SLSceneView::onMouseWheel gets called whenever the mouse wheel is turned. The parameter delta is positive/negative depending on the wheel direction

◆ onMouseWheelPos()

SLbool SLSceneView::onMouseWheelPos ( SLint  wheelPos,
SLKey  mod 
)
virtual

SLSceneView::onMouseWheel gets called whenever the mouse wheel is turned. The parameter wheelPos is an increasing or decreeing counter number.

◆ onPaint()

SLbool SLSceneView::onPaint ( )

SLSceneView::onPaint is called by window system whenever the window and therefore the scene needs to be painted. Depending on the renderer it calls first SLSceneView::draw3DGL, SLSceneView::draw3DRT or SLSceneView::draw3DPT and then SLSceneView::draw2DGL for all UI in 2D. The method returns true if either the 2D or 3D graph was updated or waitEvents is false.

◆ onResize()

void SLSceneView::onResize ( SLint  width,
SLint  height 
)

SLSceneView::onResize is called by the window system before the first rendering and whenever the window changes its size.

◆ onStartup()

virtual void SLSceneView::onStartup ( )
inlinevirtual

◆ onTouch2Down()

SLbool SLSceneView::onTouch2Down ( SLint  scrX1,
SLint  scrY1,
SLint  scrX2,
SLint  scrY2 
)
virtual

SLSceneView::onTouch2Down gets called whenever two fingers touch a handheld screen.

◆ onTouch2Move()

SLbool SLSceneView::onTouch2Move ( SLint  scrX1,
SLint  scrY1,
SLint  scrX2,
SLint  scrY2 
)
virtual

SLSceneView::onTouch2Move gets called whenever two fingers touch a handheld screen.

◆ onTouch2Up()

SLbool SLSceneView::onTouch2Up ( SLint  scrX1,
SLint  scrY1,
SLint  scrX2,
SLint  scrY2 
)
virtual

SLSceneView::onTouch2Up gets called whenever two fingers lift off a handheld screen.

◆ pathtracer()

SLPathtracer * SLSceneView::pathtracer ( )
inline

◆ postDraw()

virtual void SLSceneView::postDraw ( )
inlinevirtual

◆ postSceneLoad()

virtual void SLSceneView::postSceneLoad ( )
inlinevirtual

◆ preDraw()

virtual void SLSceneView::preDraw ( )
inlinevirtual

◆ printStats()

void SLSceneView::printStats ( )
inline

◆ raytracer()

SLRaytracer * SLSceneView::raytracer ( )
inline

◆ renderType() [1/2]

SLRenderType SLSceneView::renderType ( ) const
inline

◆ renderType() [2/2]

void SLSceneView::renderType ( SLRenderType  rt)
inline

◆ s()

SLScene * SLSceneView::s ( )
inline

◆ saveFrameBufferAsImage()

void SLSceneView::saveFrameBufferAsImage ( SLstring  pathFilename,
cv::Size  targetSize = cv::Size(-1, -1) 
)

Saves after n wait frames the front frame buffer as a PNG image.

◆ scene()

void SLSceneView::scene ( SLScene scene)
inline

◆ sceneViewCamera()

SLCamera * SLSceneView::sceneViewCamera ( )
inline

◆ screenCaptureIsRequested() [1/2]

SLbool SLSceneView::screenCaptureIsRequested ( )
inline

◆ screenCaptureIsRequested() [2/2]

void SLSceneView::screenCaptureIsRequested ( bool  doScreenCap)
inline

◆ scrH() [1/2]

SLint SLSceneView::scrH ( ) const
inline

◆ scrH() [2/2]

void SLSceneView::scrH ( SLint  scrH)
inline

◆ scrHdiv2()

SLint SLSceneView::scrHdiv2 ( ) const
inline

◆ scrW() [1/2]

SLint SLSceneView::scrW ( ) const
inline

◆ scrW() [2/2]

void SLSceneView::scrW ( SLint  scrW)
inline

◆ scrWdiv2()

SLint SLSceneView::scrWdiv2 ( ) const
inline

◆ scrWdivH()

SLfloat SLSceneView::scrWdivH ( ) const
inline

◆ setViewportFromRatio()

void SLSceneView::setViewportFromRatio ( const SLVec2i vpRatio,
SLViewportAlign  vpAlignment,
SLbool  vpSameAsVideo 
)

Sets the viewport ratio and the viewport rectangle.

◆ shadowMapTimeMS()

AvgFloat & SLSceneView::shadowMapTimeMS ( )
inline

◆ startPathtracing()

void SLSceneView::startPathtracing ( SLint  maxDepth,
SLint  samples 
)

Starts the pathtracing

◆ startRaytracing()

void SLSceneView::startRaytracing ( SLint  maxDepth)

Starts the ray tracing & sets the RT menu

◆ stats2D()

SLNodeStats & SLSceneView::stats2D ( )
inline

◆ stats3D()

SLNodeStats & SLSceneView::stats3D ( )
inline

◆ switchToNextCameraInScene()

void SLSceneView::switchToNextCameraInScene ( )

Sets the active camera to the next in the scene.

◆ switchToSceneViewCamera()

void SLSceneView::switchToSceneViewCamera ( )

SLSceneView::switchToSceneViewCamera the general idea for this function is to switch to the editor camera from a scene camera. It could provide functionality to stay at the position of the previous camera, or to be reset to the init position etc..

◆ unInit()

void SLSceneView::unInit ( )

◆ viewportAlign()

SLViewportAlign SLSceneView::viewportAlign ( ) const
inline

◆ viewportH()

SLint SLSceneView::viewportH ( ) const
inline

◆ viewportRatio()

SLVec2i SLSceneView::viewportRatio ( ) const
inline

◆ viewportRect()

SLRecti SLSceneView::viewportRect ( ) const
inline

◆ viewportSameAsVideo() [1/2]

SLbool SLSceneView::viewportSameAsVideo ( ) const
inline

◆ viewportSameAsVideo() [2/2]

void SLSceneView::viewportSameAsVideo ( bool  sameAsVideo)
inline

◆ viewportW()

SLint SLSceneView::viewportW ( ) const
inline

◆ viewportWdivH()

SLfloat SLSceneView::viewportWdivH ( ) const
inline

◆ visibleMaterials2D()

std::unordered_set< SLMaterial * > & SLSceneView::visibleMaterials2D ( )
inline

◆ visibleMaterials3D()

std::unordered_set< SLMaterial * > & SLSceneView::visibleMaterials3D ( )
inline

◆ windowTitle()

SLstring SLSceneView::windowTitle ( )

Returns the window title with name & FPS

Friends And Related Function Documentation

◆ SLNode

friend class SLNode
friend

◆ SLOptixRaytracer

friend class SLOptixRaytracer
friend

◆ SLPathtracer

friend class SLPathtracer
friend

◆ SLRaytracer

friend class SLRaytracer
friend

Member Data Documentation

◆ _camera

SLCamera* SLSceneView::_camera
protected

Pointer to the _active camera.

◆ _cullTimeMS

SLfloat SLSceneView::_cullTimeMS
protected

time for culling in ms

◆ _cullTimesMS

AvgFloat SLSceneView::_cullTimesMS
protected

Averaged time for culling in ms.

◆ _doAlphaSorting

SLbool SLSceneView::_doAlphaSorting
protected

Flag if alpha sorting in blending is on.

◆ _doDepthTest

SLbool SLSceneView::_doDepthTest
protected

Flag if depth test is turned on.

◆ _doFrustumCulling

SLbool SLSceneView::_doFrustumCulling
protected

Flag if view frustum culling is on.

◆ _doMultiSampling

SLbool SLSceneView::_doMultiSampling
protected

Flag if multisampling is on.

◆ _doWaitOnIdle

SLbool SLSceneView::_doWaitOnIdle
protected

Flag for Event waiting.

◆ _dpi

int SLSceneView::_dpi
protected

dots per inch of screen

◆ _draw2DTimeMS

SLfloat SLSceneView::_draw2DTimeMS
protected

time for 2D drawing in ms

◆ _draw2DTimesMS

AvgFloat SLSceneView::_draw2DTimesMS
protected

Averaged time for 2D drawing in ms.

◆ _draw3DTimeMS

SLfloat SLSceneView::_draw3DTimeMS
protected

time for 3D drawing in ms

◆ _draw3DTimesMS

AvgFloat SLSceneView::_draw3DTimesMS
protected

Averaged time for 3D drawing in ms.

◆ _drawBits

SLDrawBits SLSceneView::_drawBits
protected

Sceneview level drawing flags.

◆ _gotPainted

SLbool SLSceneView::_gotPainted
protected

flag if this sceneview got painted

◆ _gui

SLUiInterface* SLSceneView::_gui = nullptr
protected

ImGui instance.

◆ _inputManager

SLInputManager& SLSceneView::_inputManager
protected

◆ _isFirstFrame

SLbool SLSceneView::_isFirstFrame
protected

Flag if it is the first frame rendering.

◆ _mouseDownL

SLbool SLSceneView::_mouseDownL
protected

Flag if left mouse button is pressed.

◆ _mouseDownM

SLbool SLSceneView::_mouseDownM
protected

Flag if middle mouse button is pressed.

◆ _mouseDownR

SLbool SLSceneView::_mouseDownR
protected

Flag if right mouse button is pressed.

◆ _mouseMod

SLKey SLSceneView::_mouseMod
protected

mouse modifier key on key down

◆ _nodesBlended2D

SLVNode SLSceneView::_nodesBlended2D
protected

Vector of visible blended nodes not in _visibleMaterials2D rendered in 2D.

◆ _nodesBlended3D

SLVNode SLSceneView::_nodesBlended3D
protected

Vector of visible blended nodes not in _visibleMaterials3D rendered in 3D.

◆ _nodesOpaque2D

SLVNode SLSceneView::_nodesOpaque2D
protected

Vector of visible opaque nodes not in _visibleMaterials2D rendered in 2D.

◆ _nodesOpaque3D

SLVNode SLSceneView::_nodesOpaque3D
protected

Vector of visible opaque nodes not in _visibleMaterials3D rendered in 3D.

◆ _nodesOverdrawn

SLVNode SLSceneView::_nodesOverdrawn
protected

Vector of helper nodes drawn over all others.

◆ _oculusFB

SLGLOculusFB SLSceneView::_oculusFB
protected

Oculus framebuffer.

◆ _pathtracer

SLPathtracer SLSceneView::_pathtracer
protected

Pathtracer.

◆ _raytracer

SLRaytracer SLSceneView::_raytracer
protected

Whitted style raytracer.

◆ _renderType

SLRenderType SLSceneView::_renderType
protected

rendering type (GL,RT,PT)

◆ _s

SLScene* SLSceneView::_s
protected

Pointer to the scene observed by this scene view.

◆ _sceneViewCamera

SLCamera SLSceneView::_sceneViewCamera
protected

Default camera for this SceneView (default cam not in scenegraph)

◆ _screenCaptureIsRequested

SLbool SLSceneView::_screenCaptureIsRequested
protected

Flag if screen capture is requested.

◆ _screenCaptureWaitFrames

SLint SLSceneView::_screenCaptureWaitFrames
protected

Frames to delay the screen capture.

◆ _scrH

SLint SLSceneView::_scrH
protected

Screen height in pixels.

◆ _scrHdiv2

SLint SLSceneView::_scrHdiv2
protected

Screen half height in pixels.

◆ _scrW

SLint SLSceneView::_scrW
protected

Screen width in pixels.

◆ _scrWdiv2

SLint SLSceneView::_scrWdiv2
protected

Screen half width in pixels.

◆ _scrWdivH

SLfloat SLSceneView::_scrWdivH
protected

Screen side aspect ratio.

◆ _shadowMapTimeMS

SLfloat SLSceneView::_shadowMapTimeMS
protected

time for drawing the shadow maps in ms

◆ _shadowMapTimesMS

AvgFloat SLSceneView::_shadowMapTimesMS
protected

Averaged time for drawing the shadow maps in ms.

◆ _stats2D

SLNodeStats SLSceneView::_stats2D
protected

Statistic numbers for 2D nodes.

◆ _stats3D

SLNodeStats SLSceneView::_stats3D
protected

Statistic numbers for 3D nodes.

◆ _stopPT

SLbool SLSceneView::_stopPT
protected

Flag to stop the PT.

◆ _stopRT

SLbool SLSceneView::_stopRT
protected

Flag to stop the RT.

◆ _touch

SLVec2i SLSceneView::_touch[3]
protected

up to 3 finger touch coordinates

◆ _touchDowns

SLint SLSceneView::_touchDowns
protected

finger touch down count

◆ _vaoCursor

SLGLVertexArrayExt SLSceneView::_vaoCursor
protected

Virtual cursor for stereo rendering.

◆ _vaoTouch

SLGLVertexArrayExt SLSceneView::_vaoTouch
protected

Buffer for touch pos. rendering.

◆ _viewportAlign

SLViewportAlign SLSceneView::_viewportAlign
protected

alignment of viewport

◆ _viewportRatio

SLVec2i SLSceneView::_viewportRatio
protected

ratio of viewport

◆ _viewportRect

SLRecti SLSceneView::_viewportRect
protected

rectangle of viewport

◆ _viewportSameAsVideo

SLbool SLSceneView::_viewportSameAsVideo
protected

Adapt viewport aspect to the input video.

◆ _visibleMaterials2D

std::unordered_set<SLMaterial*> SLSceneView::_visibleMaterials2D
protected

visible materials 2D per frame

◆ _visibleMaterials3D

std::unordered_set<SLMaterial*> SLSceneView::_visibleMaterials3D
protected

visible materials 3D per frame

◆ onSelectedNodeMesh

cbOnSelectNodeMesh SLSceneView::onSelectedNodeMesh

C-Callback for app on node selection.

◆ onWndUpdate

cbOnWndUpdate SLSceneView::onWndUpdate

C-Callback for app for intermediate window repaint.


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