git-svn-id: svn://db.shs.com.ru/libs@65 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -108,7 +108,7 @@ void QGLView::addObject(QWidget * o, Qt::WindowFlags f) {
|
||||
|
||||
|
||||
void QGLView::addObject(GLObjectBase * o) {
|
||||
o->view_ = this;
|
||||
o->setView(this);
|
||||
objects_.addChild(o);
|
||||
collectLights();
|
||||
if (is_init) {
|
||||
@@ -119,6 +119,12 @@ void QGLView::addObject(GLObjectBase * o) {
|
||||
}
|
||||
|
||||
|
||||
void QGLView::selectObject(GLObjectBase * o) {
|
||||
emit selectionChanged(o, sel_obj);
|
||||
sel_obj = o;
|
||||
}
|
||||
|
||||
|
||||
void QGLView::drawBackground(QPainter * painter, const QRectF & rect) {
|
||||
static bool f = true;
|
||||
painter_ = painter;
|
||||
@@ -472,7 +478,7 @@ void QGLView::collectGraphicItems(QList<QGraphicsItem * > & list, QGraphicsItem
|
||||
|
||||
|
||||
void QGLView::collectObjectLights(GLObjectBase * o) {
|
||||
if (o->type_ == GLObjectBase::Light) lights_ << globject_cast<Light * >(o);
|
||||
if (o->type_ == GLObjectBase::glLight) lights_ << globject_cast<Light * >(o);
|
||||
foreach (GLObjectBase * i, o->children())
|
||||
collectObjectLights(i);
|
||||
}
|
||||
@@ -530,10 +536,8 @@ void QGLView::mouseReleaseEvent(QMouseEvent * e) {
|
||||
selecting_ = false;
|
||||
if (mouseThis_ && mouseSelect_ && e->button() == Qt::LeftButton) {
|
||||
if ((lastPos - downPos).manhattanLength() < 8) {
|
||||
if (sel_obj != hov_obj) {
|
||||
emit selectionChanged(hov_obj, sel_obj);
|
||||
sel_obj = hov_obj;
|
||||
}
|
||||
if (sel_obj != hov_obj)
|
||||
selectObject(hov_obj);
|
||||
}
|
||||
}
|
||||
emit glMouseReleaseEvent(e);
|
||||
|
||||
Reference in New Issue
Block a user