|
ATLAS Offline Software
|
Go to the documentation of this file.
22 #include <Inventor/nodes/SoSeparator.h>
23 #include <Inventor/SoPath.h>
24 #include <QApplication>
82 static bool shiftIsDown() {
return Qt::ShiftModifier & QApplication::keyboardModifiers(); }
112 if (
m==
SINGLE)
return "SINGLE";
113 else if (
m==
TOGGLE)
return "TOGGLE";
114 else if (
m==
SHIFT)
return "SHIFT";
115 else return "UNKNOWN(ERROR)";
143 if (!simple||!detailed||!handle) {
144 message(
"registerAscObj ERROR: Received null pointer!");
150 if (
it->first==simple||
it->second==handle)
151 message(
"registerAscObj ERROR: Simple separator/handle already registered!");
155 if (
it->first==detailed||
it->second==handle)
156 message(
"registerAscObj ERROR: Detailed separator/handle already registered!");
167 if (!simple||!detailed) {
168 message(
"unregisterAscObj ERROR: Received null pointer!");
174 message(
"unregisterAscObj ERROR: Not previously registered simple sep!");
180 message(
"unregisterAscObj ERROR: Not previously registered detailed sep!");
191 for (
int i = 0;
i <
n; ++
i) {
192 if (
path->getNodeFromTail(
i)->getTypeId()==SoSeparator::getClassTypeId()) {
204 std::map<SoSeparator*,AssociatedObjectHandleBase*>::const_iterator
205 it(ascobjs_simpleToHandle.find(
const_cast<SoSeparator*
>(
s)));
206 if (
it!=ascobjs_simpleToHandle.end())
208 it = ascobjs_detailedToHandle.find(
const_cast<SoSeparator*
>(
s));
209 return it==ascobjs_detailedToHandle.end() ? 0 :
it->second;
216 sel_assocobjs->deselectAll();
218 SoPath *
path =
new SoPath(sel_assocobjs);
221 (isSimpleMode?handle->shapeSimple():handle->shapeDetailed()))) {
222 theclass->message(
"updateSelectionVisuals ERROR: Failed to relocate picked node.");
226 sel_assocobjs->select(
path);
236 pickedHandle =
nullptr;
249 message(
"ERROR: Unknown associated object.");
253 pickedHandle = handle;
278 if (!alreadyselected) {
292 if (!alreadyselected)
296 if (alreadyselected) {
302 message(
"ERROR: Should not happen!");
338 if (handles.isEmpty())
352 if (handles.isEmpty())
356 if (handles.count()>1)
357 message(
"WARNING: ensureSelected called with more than one handle in SINGLE mode. Ignoring all but the first.");
383 messageVerbose(
"Signal received in ascObjDetailLevelChanged slot");
395 SoPath *
path = (*pathlist)[
i++];
400 message(
"Warning: Failed to relocate picked node.");
JetConstituentVector::iterator iterator
void registerAscObj(SoSeparator *simple, SoSeparator *detailed, AssociatedObjectHandleBase *)
bool handleUserSelectedSingleNode(SoCooperativeSelection *, SoNode *, SoPath *, AssociatedObjectHandleBase *&)
path
python interpreter configuration --------------------------------------—
static QString toString(MODE)
SoSeparator * getAscObjAttachSep() const
AssociatedObjectHandleBase * ascObjHandle(const SoPath *)
void messageVerbose(const QString &) const
QList< AssociatedObjectHandleBase * > selAscObjHandles
SoCooperativeSelection * sel_assocobjs_click
Imp & operator=(const Imp &)=delete
TrackCommonFlags::DETAILLEVEL assocObjDetailLevel() const
void ensureSelected(const QList< AssociatedObjectHandleBase * > &)
virtual ~AscObjSelectionManager()
void pretendUserClicked(AssociatedObjectHandleBase *)
std::map< SoSeparator *, AssociatedObjectHandleBase * > ascobjs_simpleToHandle
void ascObjDetailLevelChanged()
void updateSelectionVisuals()
bool printInfoOnSingleSelection() const
AscObjSelectionManager * theclass
Imp(AscObjSelectionManager *tc, SoSeparator *root, IVP13DSystem *sys, TrackSystemController *c)
void unregisterAscObj(SoSeparator *simple, SoSeparator *detailed)
TrackSystemController * controller
void unregisterSelectionNode(SoCooperativeSelection *)
SoSeparator * shapeSimple() const
void message(const QString &) const
static bool shiftIsDown()
AscObjSelectionManager(SoSeparator *eventRoot, IVP13DSystem *, TrackSystemController *)
SoSeparator * shapeDetailed() const
virtual QStringList clicked()=0
std::map< SoSeparator *, AssociatedObjectHandleBase * > ascobjs_detailedToHandle
const QList< AssociatedObjectHandleBase * > & currentSelection() const
void ensureDeselected(const QList< AssociatedObjectHandleBase * > &)
void currentSelectionChanged(const QList< AssociatedObjectHandleBase * > &)
SoCooperativeSelection * sel_assocobjs
static bool changePathTail(SoPath *path, SoNode *commonBranchPoint, SoNode *newtail)
void message(const QString &) const
SoSeparator * eventRoot()