Blue Brain BioExplorer
core::BaseWindow Class Reference

#include <BaseWindow.h>

Inheritance diagram for core::BaseWindow:
Collaboration diagram for core::BaseWindow:

Public Member Functions

 BaseWindow (Core &core, FrameBufferMode frameBufferMode=FrameBufferMode::COLOR_I8)
 
virtual ~BaseWindow ()
 
virtual void forceRedraw ()
 
void setTitle (const std::string &title)
 
virtual void mouseButton (int button, bool released, const Vector2i &pos)
 
virtual void motion (const Vector2i &pos)
 
virtual void passiveMotion (const Vector2i &pos)
 
virtual void reshape (const Vector2i &newSize)
 
virtual void idle ()
 
virtual void display ()
 
virtual void activate ()
 
void create (const char *title, size_t width, size_t height)
 
void clearPixels ()
 
void drawPixels (const int *framebuffer)
 
void drawPixels (const Vector3f *framebuffer)
 
virtual void keypress (char key, const Vector2f &where)
 
virtual void specialkey (int key, const Vector2f &where)
 

Static Public Attributes

static Vector2i _defaultInitSize
 

Protected Member Functions

void _setTitle (const char *title)
 
void _setHint (const std::string &message, const uint64_t milliseconds=3000)
 
virtual void _registerKeyboardShortcuts ()
 
void _renderBitmapString (float x, float y, const std::string &text)
 

Protected Attributes

Core_core
 
Vector2i _lastMousePos
 
Vector2i _currMousePos
 
Vector2i _mouse
 
u_int64_t _lastButtonState
 
u_int64_t _currButtonState
 
u_int64_t _currModifiers
 
FrameBufferMode _frameBufferMode
 
int _windowID
 
Vector2ui _windowSize
 
Timer _timer
 
uint64_t _gid
 
bool _displayHelp
 
bool _fullScreen
 
Vector2ui _windowPosition
 
RenderInput _renderInput
 
RenderOutput _renderOutput
 
std::string _hintMessage
 
uint64_t _hintDelay {0}
 
std::chrono::time_point< std::chrono::steady_clock > _chrono
 

Friends

void glut3dReshape (int x, int y)
 
void glut3dDisplay (void)
 
void glut3dKeyboard (unsigned char key, int x, int y)
 
void glut3dSpecial (int key, int x, int y)
 
void glut3dIdle (void)
 
void glut3dMotionFunc (int x, int y)
 
void glut3dMouseFunc (int whichButton, int released, int x, int y)
 
void glut3dPassiveMouseFunc (int x, int y)
 

Detailed Description

Definition at line 51 of file BaseWindow.h.

Constructor & Destructor Documentation

◆ BaseWindow()

core::BaseWindow::BaseWindow ( Core core,
FrameBufferMode  frameBufferMode = FrameBufferMode::COLOR_I8 
)

Definition at line 125 of file BaseWindow.cpp.

◆ ~BaseWindow()

core::BaseWindow::~BaseWindow ( )
virtual

Definition at line 149 of file BaseWindow.cpp.

Member Function Documentation

◆ _registerKeyboardShortcuts()

void core::BaseWindow::_registerKeyboardShortcuts ( )
protectedvirtual

Definition at line 439 of file BaseWindow.cpp.

◆ _renderBitmapString()

void core::BaseWindow::_renderBitmapString ( float  x,
float  y,
const std::string &  text 
)
protected

Definition at line 451 of file BaseWindow.cpp.

◆ _setHint()

void core::BaseWindow::_setHint ( const std::string &  message,
const uint64_t  milliseconds = 3000 
)
protected

Definition at line 514 of file BaseWindow.cpp.

◆ _setTitle()

void core::BaseWindow::_setTitle ( const char *  title)
protected

Definition at line 354 of file BaseWindow.cpp.

◆ activate()

void core::BaseWindow::activate ( )
virtual

activate this window, in the sense that all future glut events get routed to this window instance

Definition at line 236 of file BaseWindow.cpp.

◆ clearPixels()

void core::BaseWindow::clearPixels ( )

clear the frame buffer color and depth bits

Definition at line 336 of file BaseWindow.cpp.

◆ create()

void core::BaseWindow::create ( const char *  title,
size_t  width,
size_t  height 
)

Definition at line 361 of file BaseWindow.cpp.

◆ display()

void core::BaseWindow::display ( )
virtual

display this window. By default this will just clear this window's framebuffer; it's up to the user to override this fct to do something more useful

Reimplemented in core::Viewer.

Definition at line 247 of file BaseWindow.cpp.

◆ drawPixels() [1/2]

void core::BaseWindow::drawPixels ( const int *  framebuffer)

draw uint pixels into the GLUT window (assumes window and buffer dimensions are equal)

Definition at line 342 of file BaseWindow.cpp.

◆ drawPixels() [2/2]

void core::BaseWindow::drawPixels ( const Vector3f framebuffer)

draw float4 pixels into the GLUT window (assumes window and buffer dimensions are equal)

Definition at line 348 of file BaseWindow.cpp.

◆ forceRedraw()

void core::BaseWindow::forceRedraw ( )
virtual

tell GLUT that this window is 'dirty' and needs redrawing

Definition at line 242 of file BaseWindow.cpp.

◆ idle()

void core::BaseWindow::idle ( )
virtual

Definition at line 223 of file BaseWindow.cpp.

◆ keypress()

void core::BaseWindow::keypress ( char  key,
const Vector2f where 
)
virtual

Definition at line 378 of file BaseWindow.cpp.

◆ motion()

void core::BaseWindow::motion ( const Vector2i pos)
virtual

Definition at line 188 of file BaseWindow.cpp.

◆ mouseButton()

void core::BaseWindow::mouseButton ( int  button,
bool  released,
const Vector2i pos 
)
virtual

Definition at line 151 of file BaseWindow.cpp.

◆ passiveMotion()

void core::BaseWindow::passiveMotion ( const Vector2i pos)
virtual

Definition at line 218 of file BaseWindow.cpp.

◆ reshape()

void core::BaseWindow::reshape ( const Vector2i newSize)
virtual

Definition at line 228 of file BaseWindow.cpp.

◆ setTitle()

void core::BaseWindow::setTitle ( const std::string &  title)
inline

set window title

Definition at line 64 of file BaseWindow.h.

◆ specialkey()

void core::BaseWindow::specialkey ( int  key,
const Vector2f where 
)
virtual

Definition at line 409 of file BaseWindow.cpp.

Friends And Related Function Documentation

◆ glut3dDisplay

void glut3dDisplay ( void  )
friend

Definition at line 77 of file BaseWindow.cpp.

◆ glut3dIdle

void glut3dIdle ( void  )
friend

Definition at line 96 of file BaseWindow.cpp.

◆ glut3dKeyboard

void glut3dKeyboard ( unsigned char  key,
int  x,
int  y 
)
friend

Definition at line 85 of file BaseWindow.cpp.

◆ glut3dMotionFunc

void glut3dMotionFunc ( int  x,
int  y 
)
friend

Definition at line 101 of file BaseWindow.cpp.

◆ glut3dMouseFunc

void glut3dMouseFunc ( int  whichButton,
int  released,
int  x,
int  y 
)
friend

Definition at line 107 of file BaseWindow.cpp.

◆ glut3dPassiveMouseFunc

void glut3dPassiveMouseFunc ( int  x,
int  y 
)
friend

Definition at line 113 of file BaseWindow.cpp.

◆ glut3dReshape

void glut3dReshape ( int  x,
int  y 
)
friend

Definition at line 71 of file BaseWindow.cpp.

◆ glut3dSpecial

void glut3dSpecial ( int  key,
int  x,
int  y 
)
friend

Definition at line 90 of file BaseWindow.cpp.

Member Data Documentation

◆ _chrono

std::chrono::time_point<std::chrono::steady_clock> core::BaseWindow::_chrono
protected

Definition at line 143 of file BaseWindow.h.

◆ _core

Core& core::BaseWindow::_core
protected

Definition at line 115 of file BaseWindow.h.

◆ _currButtonState

u_int64_t core::BaseWindow::_currButtonState
protected

Definition at line 122 of file BaseWindow.h.

◆ _currModifiers

u_int64_t core::BaseWindow::_currModifiers
protected

Definition at line 123 of file BaseWindow.h.

◆ _currMousePos

Vector2i core::BaseWindow::_currMousePos
protected

last mouse screen position of mouse before current motion

Definition at line 119 of file BaseWindow.h.

◆ _defaultInitSize

Vector2i core::BaseWindow::_defaultInitSize
static

size we'll create a window at

Definition at line 58 of file BaseWindow.h.

◆ _displayHelp

bool core::BaseWindow::_displayHelp
protected

Definition at line 134 of file BaseWindow.h.

◆ _frameBufferMode

FrameBufferMode core::BaseWindow::_frameBufferMode
protected

Definition at line 125 of file BaseWindow.h.

◆ _fullScreen

bool core::BaseWindow::_fullScreen
protected

Definition at line 135 of file BaseWindow.h.

◆ _gid

uint64_t core::BaseWindow::_gid
protected

Definition at line 132 of file BaseWindow.h.

◆ _hintDelay

uint64_t core::BaseWindow::_hintDelay {0}
protected

Definition at line 142 of file BaseWindow.h.

◆ _hintMessage

std::string core::BaseWindow::_hintMessage
protected

Definition at line 141 of file BaseWindow.h.

◆ _lastButtonState

u_int64_t core::BaseWindow::_lastButtonState
protected

Definition at line 121 of file BaseWindow.h.

◆ _lastMousePos

Vector2i core::BaseWindow::_lastMousePos
protected

Definition at line 117 of file BaseWindow.h.

◆ _mouse

Vector2i core::BaseWindow::_mouse
protected

current screen position of mouse

Definition at line 120 of file BaseWindow.h.

◆ _renderInput

RenderInput core::BaseWindow::_renderInput
protected

Definition at line 138 of file BaseWindow.h.

◆ _renderOutput

RenderOutput core::BaseWindow::_renderOutput
protected

Definition at line 139 of file BaseWindow.h.

◆ _timer

Timer core::BaseWindow::_timer
protected

Definition at line 130 of file BaseWindow.h.

◆ _windowID

int core::BaseWindow::_windowID
protected

Definition at line 127 of file BaseWindow.h.

◆ _windowPosition

Vector2ui core::BaseWindow::_windowPosition
protected

Definition at line 136 of file BaseWindow.h.

◆ _windowSize

Vector2ui core::BaseWindow::_windowSize
protected

Definition at line 128 of file BaseWindow.h.


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