Started using QGraphicsView in canvases instead of QGLWidget.

This commit is contained in:
Tats
2014-10-31 17:04:28 -04:00
parent e8870db92a
commit cbfe3981c0
6 changed files with 420 additions and 390 deletions
+24 -24
View File
@@ -40,29 +40,29 @@ MShape* SourceGLCanvas::getShapeFromMappingId(uid mappingId)
return mapping->getInputShape().get();
}
}
//
void SourceGLCanvas::doDraw(QPainter* painter)
{
if (getMainWindow()->hasCurrentMapping())
{
uint mappingId = getMainWindow()->getCurrentMappingId();
const Mapper::ptr& mapper = getMainWindow()->getMapperByMappingId(mappingId);
painter->save();
mapper->drawInput(painter);
painter->restore();
if (displayControls())
{
painter->save();
if (hasActiveVertex()) {
QList<int> selectedVertices;
selectedVertices.append(getActiveVertexIndex());
mapper->drawInputControls(painter, &selectedVertices);
}
else
mapper->drawInputControls(painter);
painter->restore();
}
}
}
//void SourceGLCanvas::doDraw(QPainter* painter)
//{
// if (getMainWindow()->hasCurrentMapping())
// {
// uint mappingId = getMainWindow()->getCurrentMappingId();
// const Mapper::ptr& mapper = getMainWindow()->getMapperByMappingId(mappingId);
// painter->save();
// mapper->drawInput(painter);
// painter->restore();
// if (displayControls())
// {
// painter->save();
// if (hasActiveVertex()) {
// QList<int> selectedVertices;
// selectedVertices.append(getActiveVertexIndex());
// mapper->drawInputControls(painter, &selectedVertices);
// }
// else
// mapper->drawInputControls(painter);
// painter->restore();
// }
// }
//}