Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
Visualization::MainView Class Reference
Inheritance diagram for Visualization::MainView:
Visualization::View

Public Member Functions

 MainView (Scene *scene)
 
virtual ~MainView ()
 
qreal scaleFactor () const
 
void setMiniMapSize (int width, int height)
 
void zoom (int scaleLevel)
 
- Public Member Functions inherited from Visualization::View
 View (Scene *scene, View *parent=nullptr)
 
virtual ~View ()
 
Scenescene ()
 
void setHiddenItemCategories (Scene::ItemCategories hidden=Scene::NoItemCategory)
 
QRectF visibleRect ()
 

Static Public Member Functions

static void centerAndZoomViewToFitEntireScene ()
 

Static Public Attributes

static const int MINIMAP_DEFAULT_HEIGHT = 200
 
static const int MINIMAP_DEFAULT_WIDTH = 200
 
static const int PNG_SCREENSHOT_SCALE = 8
 

Protected Member Functions

virtual bool event (QEvent *event) override
 
virtual void keyPressEvent (QKeyEvent *event) override
 
virtual void mouseMoveEvent (QMouseEvent *event) override
 
virtual void mousePressEvent (QMouseEvent *event) override
 
virtual void mouseReleaseEvent (QMouseEvent *event) override
 
virtual void paintEvent (QPaintEvent *event) override
 
virtual void resizeEvent (QResizeEvent *event) override
 
virtual void scrollContentsBy (int dx, int dy) override
 
virtual void wheelEvent (QWheelEvent *event) override
 

Private Member Functions

bool setCursorAndOwnerIgnoreScaleForScreenShot (bool ignore, bool modifyOwner)
 
void updateInfoLabels ()
 
void zoomAccordingToScaleLevel ()
 

Private Attributes

QList< QLabel * > infoLabels_
 Information text displayed in the top left corner. More...
 
bool isPanning_ {}
 
MiniMapminiMap
 
QPoint panStartPos_ {}
 
int scaleLevel_ {}
 
bool showTimers_ {false}
 

Static Private Attributes

static const bool ITEM_STRUCTURE_AWARE_ZOOM_ANCHORING = true
 
static const int SCALING_FACTOR = 2
 

Constructor & Destructor Documentation

◆ MainView()

Visualization::MainView::MainView ( Scene scene)

◆ ~MainView()

Visualization::MainView::~MainView ( )
virtual

Member Function Documentation

◆ centerAndZoomViewToFitEntireScene()

void Visualization::MainView::centerAndZoomViewToFitEntireScene ( )
static

◆ event()

bool Visualization::MainView::event ( QEvent *  event)
overrideprotectedvirtual

◆ keyPressEvent()

void Visualization::MainView::keyPressEvent ( QKeyEvent *  event)
overrideprotectedvirtual

◆ mouseMoveEvent()

void Visualization::MainView::mouseMoveEvent ( QMouseEvent *  event)
overrideprotectedvirtual

◆ mousePressEvent()

void Visualization::MainView::mousePressEvent ( QMouseEvent *  event)
overrideprotectedvirtual

◆ mouseReleaseEvent()

void Visualization::MainView::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotectedvirtual

◆ paintEvent()

void Visualization::MainView::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

Reimplemented from Visualization::View.

◆ resizeEvent()

void Visualization::MainView::resizeEvent ( QResizeEvent *  event)
overrideprotectedvirtual

◆ scaleFactor()

qreal Visualization::MainView::scaleFactor ( ) const

◆ scrollContentsBy()

void Visualization::MainView::scrollContentsBy ( int  dx,
int  dy 
)
overrideprotectedvirtual

◆ setCursorAndOwnerIgnoreScaleForScreenShot()

bool Visualization::MainView::setCursorAndOwnerIgnoreScaleForScreenShot ( bool  ignore,
bool  modifyOwner 
)
private

◆ setMiniMapSize()

void Visualization::MainView::setMiniMapSize ( int  width,
int  height 
)

◆ updateInfoLabels()

void Visualization::MainView::updateInfoLabels ( )
private

◆ wheelEvent()

void Visualization::MainView::wheelEvent ( QWheelEvent *  event)
overrideprotectedvirtual

◆ zoom()

void Visualization::MainView::zoom ( int  scaleLevel)

◆ zoomAccordingToScaleLevel()

void Visualization::MainView::zoomAccordingToScaleLevel ( )
private

Member Data Documentation

◆ infoLabels_

QList<QLabel*> Visualization::MainView::infoLabels_
private

Information text displayed in the top left corner.

◆ isPanning_

bool Visualization::MainView::isPanning_ {}
private

◆ ITEM_STRUCTURE_AWARE_ZOOM_ANCHORING

const bool Visualization::MainView::ITEM_STRUCTURE_AWARE_ZOOM_ANCHORING = true
staticprivate

◆ miniMap

MiniMap* Visualization::MainView::miniMap
private

◆ MINIMAP_DEFAULT_HEIGHT

const int Visualization::MainView::MINIMAP_DEFAULT_HEIGHT = 200
static

◆ MINIMAP_DEFAULT_WIDTH

const int Visualization::MainView::MINIMAP_DEFAULT_WIDTH = 200
static

◆ panStartPos_

QPoint Visualization::MainView::panStartPos_ {}
private

◆ PNG_SCREENSHOT_SCALE

const int Visualization::MainView::PNG_SCREENSHOT_SCALE = 8
static

◆ scaleLevel_

int Visualization::MainView::scaleLevel_ {}
private

◆ SCALING_FACTOR

const int Visualization::MainView::SCALING_FACTOR = 2
staticprivate

◆ showTimers_

bool Visualization::MainView::showTimers_ {false}
private