// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> void GeometryLayer::mouseOnGeometry(QEvent* event) { if ( event->type() == QEvent::ToolTip ) { QHelpEvent* helpEvent = static_cast<QHelpEvent *>(event); const Geometry* d = geometryAt(helpEvent->pos()); if ( d ) { //! Advise the widget that this element should be highlighted, //! it will deal with this notice the way it wants to... emit highlightElement(d->name()); if ( !d->toolTip().isEmpty() ) QToolTip::showText(helpEvent->globalPos(), d->toolTip()); else QToolTip::showText(helpEvent->globalPos(), d->name()); } else { QToolTip::hideText(); event->ignore(); emit restoreElementsSizes(); } } }
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> void GeometryLayer::geometryClicked(QMouseEvent* event) { const Geometry* d = geometryAt(event->pos()); if ( d ) emit elementClicked(d->name()); }
void UIManipulator::draw(ShaderStack *stack) { if ( isEmpty() ) return; QVector4D testVec = stack->cameraProjectionTop() * stack->coordinateTransformTop() * stack->worldToCameraTop() * stack->modelToWorldTop() * QVector4D(0,0,0,1); stack->counterScalePush(); stack->counterScaleSetTop(testVec.z()); for ( int i = 0; i < geometryCount(); i++ ) { drawGeometry(geometryAt(i).data(), stack); } stack->counterScalePop(); }