ModelGLWidget Class Reference

ModelGLWidget is the GLWidget which displays the finished solution. More...

#include <ModelGLWidget.h>

Inherits GLWidget.

Inheritance diagram for ModelGLWidget:

Inheritance graph
[legend]
Collaboration diagram for ModelGLWidget:

Collaboration graph
[legend]
List of all members.

Public Slots

virtual void updateView (int hint)

Signals

void changedHoverPiece (int piece)
void chosenSinglePiece (int choise)

Public Member Functions

 ModelGLWidget (QWidget *parent, CubeDoc *document)
virtual ~ModelGLWidget ()

Static Public Member Functions

static void drawIFSPolygons (GLWidget *that, const MyObject &obj, bool fTargets)
static void drawIFSLines (const MyObject &obj, bool singleChoise)
static void paint (GLWidget *that, CubeDoc *doc, SlvCube *scube, bool fTargets, int singleChoise, int upToStep)
 do the actual painting the scene.

Protected Member Functions

virtual void drawTargets (bool inChoise)
 this is a call back to whoever subclasses this widget and calls DoChoise the default implementation does nothing.
virtual void mousePressEvent (QMouseEvent *event)
virtual void mouseReleaseEvent (QMouseEvent *event)
virtual void myPaintGL ()
virtual void mouseMoveEvent (QMouseEvent *event)

Private Member Functions

void reCalcSlvMinMax ()

Private Attributes

CubeDocm_doc
Texture texture [2]
int m_nSingleChoise
int m_nHoverChoise
int m_nLastHoveChs

Detailed Description

ModelGLWidget is the GLWidget which displays the finished solution.

At any time only one solution can be visible. The user can control the looks of the solution pieces from the options dialog under the display tab While viewing a solution the user can hover the mouse pointer over the solution pieces. This would cause the individual piece to show in the solution sidebar - ModelHelpDlg. The user can also right click a piece and that would cause it to appear on its own, effectively switching roles between the view in the sidebar and the main view. The paint() static method does the actual drawing by calling the SlvPainter of the current selected solution from CubeDoc. It is called by the virtual fucntion drawTarget() which in turn gets called by myPaintGL(), the entrypoint for drawing the actual scene. The SlvPainter of the specific solution selected is the one who eventually draws the actual 3D scene.

See also:
PieceGLWidget SlvPainter


Constructor & Destructor Documentation

ModelGLWidget::ModelGLWidget ( QWidget *  parent,
CubeDoc document 
)

virtual ModelGLWidget::~ModelGLWidget (  )  [inline, virtual]


Member Function Documentation

void ModelGLWidget::drawTargets ( bool  inChoise  )  [protected, virtual]

this is a call back to whoever subclasses this widget and calls DoChoise the default implementation does nothing.

  • inChoise a helper argument for user specified functionality. GLWidget always calls this method with inChoise == true. if the user calls this function on his own he may want to do so with inChoise == false and do slightly differnt things, such us use more color and textures.

Reimplemented from GLWidget.

void ModelGLWidget::mousePressEvent ( QMouseEvent *  event  )  [protected, virtual]

Reimplemented from GLWidget.

void ModelGLWidget::mouseReleaseEvent ( QMouseEvent *  event  )  [protected, virtual]

Reimplemented from GLWidget.

void ModelGLWidget::myPaintGL (  )  [protected, virtual]

Reimplemented from GLWidget.

void ModelGLWidget::mouseMoveEvent ( QMouseEvent *  event  )  [protected, virtual]

Reimplemented from GLWidget.

void ModelGLWidget::updateView ( int  hint  )  [virtual, slot]

Reimplemented from GLWidget.

void ModelGLWidget::changedHoverPiece ( int  piece  )  [signal]

void ModelGLWidget::chosenSinglePiece ( int  choise  )  [signal]

static void ModelGLWidget::drawIFSPolygons ( GLWidget that,
const MyObject obj,
bool  fTargets 
) [static]

static void ModelGLWidget::drawIFSLines ( const MyObject obj,
bool  singleChoise 
) [static]

void ModelGLWidget::paint ( GLWidget that,
CubeDoc doc,
SlvCube scube,
bool  fTargets,
int  singleChoise,
int  upToStep 
) [static]

do the actual painting the scene.

This is a static method because it is used also in PieceGLWidget for drawing.

  • that the GL context in which to draw. (not really needed because we use display lists.)
  • doc the CubeDoc is not a part of the GLWidget so it needs to be sent along to know the shape
  • scube the actual specific solution to draw
  • fTargets are we drawing plain targets or actual fully textured and lit pieces.
  • singleChoise when drawing the whole solution this is -1 otherwise it is the index of the specific piece to draw.
  • upToStep up to what step to draw the solution or -1 for the entire solution. currently, -1 is never used and in the normal situation this would be the count of the tiles in the shape.

void ModelGLWidget::reCalcSlvMinMax (  )  [private]


Member Data Documentation


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