~ubuntu-branches/ubuntu/precise/stellarium/precise

« back to all changes in this revision

Viewing changes to src/core/StelObjectMgr.cpp

  • Committer: Andrew Starr-Bochicchio
  • Date: 2010-03-30 00:04:15 UTC
  • mfrom: (7.1.1 stellarium)
  • Revision ID: a.starr.b@gmail.com-20100330000415-0wsxd2ha67125l0f
Tags: 0.10.4-0ubuntu1
New upstream release. (LP: #548963)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Stellarium
3
3
 * Copyright (C) 2007 Fabien Chereau
4
 
 * 
 
4
 *
5
5
 * This program is free software; you can redistribute it and/or
6
6
 * modify it under the terms of the GNU General Public License
7
7
 * as published by the Free Software Foundation; either version 2
8
8
 * of the License, or (at your option) any later version.
9
 
 * 
 
9
 *
10
10
 * This program is distributed in the hope that it will be useful,
11
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
13
 * GNU General Public License for more details.
14
 
 * 
 
14
 *
15
15
 * You should have received a copy of the GNU General Public License
16
16
 * along with this program; if not, write to the Free Software
17
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
55
55
        StelMovementMgr* mvmgr = GETSTELMODULE(StelMovementMgr);
56
56
        if (event->button()==Qt::LeftButton && event->type()==QEvent::MouseButtonRelease && !mvmgr->getHasDragged())
57
57
        {
58
 
#ifdef MACOSX
 
58
#ifdef Q_OS_MAC
59
59
                // CTRL + left clic = right clic for 1 button mouse
60
60
                if (event->modifiers().testFlag(Qt::ControlModifier))
61
61
                {
79
79
        }
80
80
        return;
81
81
}
82
 
        
 
82
 
83
83
/*************************************************************************
84
84
 Add a new StelObject manager into the list of supported modules.
85
85
*************************************************************************/
163
163
        QList<StelObjectP> candidates;
164
164
 
165
165
        const StelProjectorP prj = core->getProjection(StelCore::FrameJ2000);
166
 
        
 
166
 
167
167
        // Field of view for a 30 pixel diameter circle on screen
168
168
        float fov_around = core->getMovementMgr()->getCurrentFov()/qMin(prj->getViewportWidth(), prj->getViewportHeight()) * 30.f;
169
169
 
172
172
        {
173
173
                candidates += (*iteromgr)->searchAround(v, fov_around, core);
174
174
        }
175
 
        
 
175
 
176
176
        // Now select the object minimizing the function y = distance(in pixel) + magnitude
177
177
        Vec3d winpos;
178
178
        prj->project(v, winpos);
215
215
void StelObjectMgr::unSelect(void)
216
216
{
217
217
        lastSelectedObjects.clear();
218
 
        
 
218
 
219
219
        // Send the event to every StelModule
220
220
        foreach (StelModule* iter, StelApp::getInstance().getModuleMgr().getAllModules())
221
221
        {
233
233
                unSelect();
234
234
                return false;
235
235
        }
236
 
        
 
236
 
237
237
        // An object has been found
238
238
        QList<StelObjectP> objs;
239
239
        objs.push_back(obj);
269
269
        }
270
270
        return result;
271
271
}
272
 
        
 
272
 
273
273
 
274
274
/*************************************************************************
275
 
 Find and return the list of at most maxNbItem objects auto-completing 
 
275
 Find and return the list of at most maxNbItem objects auto-completing
276
276
 passed object I18 name
277
277
*************************************************************************/
278
278
QStringList StelObjectMgr::listMatchingObjectsI18n(const QString& objPrefix, unsigned int maxNbItem) const