walberla::gui::BlockDisplayObject Class Reference

Detailed Description

BlockDisplayObject renders one Block as a Cube.

Features: - Picking is enabled - connect to signal clicked()

  • three different materials: hoverMaterial is used on mouseOver, inactiveMaterial is used for not allocated blocks

#include <BlockDisplayObject.h>

+ Inheritance diagram for walberla::gui::BlockDisplayObject:

Classes

struct  Slice
 

Public Member Functions

 BlockDisplayObject (BlockForest *blockForest, const shared_ptr< blockforest::BlockID > &id, QObject *parent=0)
 
virtual ~BlockDisplayObject ()
 
void draw (QGLPainter *painter)
 
shared_ptr< blockforest::BlockIDblockId ()
 
void setShrinkingFactor (qreal factor)
 

Slice Indicators


typedef ISliceChangeListener::SliceID SliceID
 
BlockForestblockForest_
 
shared_ptr< blockforest::BlockIDblockId_
 
QGLSceneNode * mesh_
 
QGLMaterial * blockMaterial_
 
QGLMaterial * inactiveMaterial_
 
QGLMaterial * hoverMaterial_
 
QGLMaterial * activeSliceMaterial_
 
QGLMaterial * inactiveSliceMaterial_
 
int objectId_
 
bool hovering_
 
QMatrix4x4 modelViewMat_
 
QMap< SliceID, Sliceslices
 
static int colorId = 0
 Static counter, incremented for each object, is used as objectId_ -> every cube gets its own objectId_ for picking. More...
 
static int nextSliceId = 0
 
SliceID addSlice (int sliceDim, double position)
 
void removeSlice (SliceID id)
 
void setSliceActive (SliceID id, bool active=true)
 
void hoverChanged ()
 
bool event (QEvent *e)
 

Member Typedef Documentation

◆ SliceID

Constructor & Destructor Documentation

◆ BlockDisplayObject()

walberla::gui::BlockDisplayObject::BlockDisplayObject ( BlockForest blockForest,
const shared_ptr< blockforest::BlockID > &  id,
QObject *  parent = 0 
)
explicit

◆ ~BlockDisplayObject()

walberla::gui::BlockDisplayObject::~BlockDisplayObject ( )
virtual

Member Function Documentation

◆ addSlice()

BlockDisplayObject::SliceID walberla::gui::BlockDisplayObject::addSlice ( int  sliceDim,
double  position 
)

◆ blockId()

shared_ptr<blockforest::BlockID> walberla::gui::BlockDisplayObject::blockId ( )
inline

◆ draw()

void walberla::gui::BlockDisplayObject::draw ( QGLPainter *  painter)

◆ event()

bool walberla::gui::BlockDisplayObject::event ( QEvent *  e)
protected

◆ hoverChanged

void walberla::gui::BlockDisplayObject::hoverChanged ( )
signal

◆ removeSlice()

void walberla::gui::BlockDisplayObject::removeSlice ( SliceID  id)
inline

◆ setShrinkingFactor()

void walberla::gui::BlockDisplayObject::setShrinkingFactor ( qreal  factor)

◆ setSliceActive()

void walberla::gui::BlockDisplayObject::setSliceActive ( SliceID  id,
bool  active = true 
)
inline

Member Data Documentation

◆ activeSliceMaterial_

QGLMaterial* walberla::gui::BlockDisplayObject::activeSliceMaterial_
private

◆ blockForest_

BlockForest* walberla::gui::BlockDisplayObject::blockForest_
private

◆ blockId_

shared_ptr<blockforest::BlockID> walberla::gui::BlockDisplayObject::blockId_
private

◆ blockMaterial_

QGLMaterial* walberla::gui::BlockDisplayObject::blockMaterial_
private

◆ colorId

int walberla::gui::BlockDisplayObject::colorId = 0
staticprivate

Static counter, incremented for each object, is used as objectId_ -> every cube gets its own objectId_ for picking.

◆ hovering_

bool walberla::gui::BlockDisplayObject::hovering_
private

◆ hoverMaterial_

QGLMaterial* walberla::gui::BlockDisplayObject::hoverMaterial_
private

◆ inactiveMaterial_

QGLMaterial* walberla::gui::BlockDisplayObject::inactiveMaterial_
private

◆ inactiveSliceMaterial_

QGLMaterial* walberla::gui::BlockDisplayObject::inactiveSliceMaterial_
private

◆ mesh_

QGLSceneNode* walberla::gui::BlockDisplayObject::mesh_
private

◆ modelViewMat_

QMatrix4x4 walberla::gui::BlockDisplayObject::modelViewMat_
private

◆ nextSliceId

int walberla::gui::BlockDisplayObject::nextSliceId = 0
staticprivate

◆ objectId_

int walberla::gui::BlockDisplayObject::objectId_
private

◆ slices

QMap<SliceID, Slice > walberla::gui::BlockDisplayObject::slices
private

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