SLProject 4.0.000
AppDemoSceneView Class Reference

#include <AppDemoSceneView.h>

Inheritance diagram for AppDemoSceneView:
[legend]

Public Member Functions

 AppDemoSceneView (SLScene *s, int dpi, SLInputManager &inputManager)
 
SLbool onMouseDown (SLMouseButton button, SLint x, SLint y, SLKey mod) final
 
- Public Member Functions inherited from SLSceneView
 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

SLbool grab = false
 
- Public Attributes inherited from SLSceneView
cbOnWndUpdate onWndUpdate
 C-Callback for app for intermediate window repaint. More...
 
cbOnSelectNodeMesh onSelectedNodeMesh
 C-Callback for app on node selection. More...
 

Additional Inherited Members

- Protected Attributes inherited from SLSceneView
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...
 

Detailed Description

The SLSceneView class is inherited because we override here the default event-handling for onMouseDown.

Constructor & Destructor Documentation

◆ AppDemoSceneView()

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

Member Function Documentation

◆ onMouseDown()

SLbool AppDemoSceneView::onMouseDown ( SLMouseButton  button,
SLint  x,
SLint  y,
SLKey  mod 
)
finalvirtual

This method overrides the same method from the base class SLSceneView. Most events such as all mouse and keyboard events from the OS is forwarded to SLSceneview. SLSceneview implements a default behaviour. If you want a different or additional behaviour for a certain eventhandler you have to sub- class SLSceneView and override the eventhandler. Because all video processing (capturing and calibration) is handled outside of the core SLProject we need to add an additional handling for mouse down withing the calibration routine.

Reimplemented from SLSceneView.

Member Data Documentation

◆ grab

SLbool AppDemoSceneView::grab = false

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