#include "TEveSecondarySelectable.h"
#include "TEveElement.h"
#include "TGLSelectRecord.h"
ClassImp(TEveSecondarySelectable);
TEveSecondarySelectable::TEveSecondarySelectable() :
fAlwaysSecSelect(kFALSE)
{
}
void TEveSecondarySelectable::ProcessGLSelection(TGLSelectRecord& rec)
{
if (rec.GetHighlight())
ProcessGLSelectionInternal(rec, fHighlightedSet);
else
ProcessGLSelectionInternal(rec, fSelectedSet);
}
void TEveSecondarySelectable::ProcessGLSelectionInternal(TGLSelectRecord& rec,
SelectionSet_t& sset)
{
Int_t id = (rec.GetN() > 1) ? (Int_t) rec.GetItem(1) : -1;
if (sset.empty())
{
if (id >= 0)
{
sset.insert(id);
rec.SetSecSelResult(TGLSelectRecord::kEnteringSelection);
}
}
else
{
if (id >= 0)
{
if (rec.GetMultiple())
{
if (sset.find(id) == sset.end())
{
sset.insert(id);
rec.SetSecSelResult(TGLSelectRecord::kModifyingInternalSelection);
}
else
{
sset.erase(id);
if (sset.empty())
rec.SetSecSelResult(TGLSelectRecord::kLeavingSelection);
else
rec.SetSecSelResult(TGLSelectRecord::kModifyingInternalSelection);
}
}
else
{
if (sset.size() != 1 || sset.find(id) == sset.end())
{
sset.clear();
sset.insert(id);
rec.SetSecSelResult(TGLSelectRecord::kModifyingInternalSelection);
}
}
}
else
{
if (!rec.GetMultiple())
{
sset.clear();
rec.SetSecSelResult(TGLSelectRecord::kLeavingSelection);
}
}
}
if (rec.GetSecSelResult() != TGLSelectRecord::kNone)
{
dynamic_cast<TEveElement*>(this)->StampColorSelection();
}
}
TEveSecondarySelectable.cxx:1 TEveSecondarySelectable.cxx:2 TEveSecondarySelectable.cxx:3 TEveSecondarySelectable.cxx:4 TEveSecondarySelectable.cxx:5 TEveSecondarySelectable.cxx:6 TEveSecondarySelectable.cxx:7 TEveSecondarySelectable.cxx:8 TEveSecondarySelectable.cxx:9 TEveSecondarySelectable.cxx:10 TEveSecondarySelectable.cxx:11 TEveSecondarySelectable.cxx:12 TEveSecondarySelectable.cxx:13 TEveSecondarySelectable.cxx:14 TEveSecondarySelectable.cxx:15 TEveSecondarySelectable.cxx:16 TEveSecondarySelectable.cxx:17 TEveSecondarySelectable.cxx:18 TEveSecondarySelectable.cxx:19 TEveSecondarySelectable.cxx:20 TEveSecondarySelectable.cxx:21 TEveSecondarySelectable.cxx:22 TEveSecondarySelectable.cxx:23 TEveSecondarySelectable.cxx:24 TEveSecondarySelectable.cxx:25 TEveSecondarySelectable.cxx:26 TEveSecondarySelectable.cxx:27 TEveSecondarySelectable.cxx:28 TEveSecondarySelectable.cxx:29 TEveSecondarySelectable.cxx:30 TEveSecondarySelectable.cxx:31 TEveSecondarySelectable.cxx:32 TEveSecondarySelectable.cxx:33 TEveSecondarySelectable.cxx:34 TEveSecondarySelectable.cxx:35 TEveSecondarySelectable.cxx:36 TEveSecondarySelectable.cxx:37 TEveSecondarySelectable.cxx:38 TEveSecondarySelectable.cxx:39 TEveSecondarySelectable.cxx:40 TEveSecondarySelectable.cxx:41 TEveSecondarySelectable.cxx:42 TEveSecondarySelectable.cxx:43 TEveSecondarySelectable.cxx:44 TEveSecondarySelectable.cxx:45 TEveSecondarySelectable.cxx:46 TEveSecondarySelectable.cxx:47 TEveSecondarySelectable.cxx:48 TEveSecondarySelectable.cxx:49 TEveSecondarySelectable.cxx:50 TEveSecondarySelectable.cxx:51 TEveSecondarySelectable.cxx:52 TEveSecondarySelectable.cxx:53 TEveSecondarySelectable.cxx:54 TEveSecondarySelectable.cxx:55 TEveSecondarySelectable.cxx:56 TEveSecondarySelectable.cxx:57 TEveSecondarySelectable.cxx:58 TEveSecondarySelectable.cxx:59 TEveSecondarySelectable.cxx:60 TEveSecondarySelectable.cxx:61 TEveSecondarySelectable.cxx:62 TEveSecondarySelectable.cxx:63 TEveSecondarySelectable.cxx:64 TEveSecondarySelectable.cxx:65 TEveSecondarySelectable.cxx:66 TEveSecondarySelectable.cxx:67 TEveSecondarySelectable.cxx:68 TEveSecondarySelectable.cxx:69 TEveSecondarySelectable.cxx:70 TEveSecondarySelectable.cxx:71 TEveSecondarySelectable.cxx:72 TEveSecondarySelectable.cxx:73 TEveSecondarySelectable.cxx:74 TEveSecondarySelectable.cxx:75 TEveSecondarySelectable.cxx:76 TEveSecondarySelectable.cxx:77 TEveSecondarySelectable.cxx:78 TEveSecondarySelectable.cxx:79 TEveSecondarySelectable.cxx:80 TEveSecondarySelectable.cxx:81 TEveSecondarySelectable.cxx:82 TEveSecondarySelectable.cxx:83 TEveSecondarySelectable.cxx:84 TEveSecondarySelectable.cxx:85 TEveSecondarySelectable.cxx:86 TEveSecondarySelectable.cxx:87 TEveSecondarySelectable.cxx:88 TEveSecondarySelectable.cxx:89 TEveSecondarySelectable.cxx:90 TEveSecondarySelectable.cxx:91 TEveSecondarySelectable.cxx:92 TEveSecondarySelectable.cxx:93 TEveSecondarySelectable.cxx:94 TEveSecondarySelectable.cxx:95 TEveSecondarySelectable.cxx:96 TEveSecondarySelectable.cxx:97 TEveSecondarySelectable.cxx:98 TEveSecondarySelectable.cxx:99 TEveSecondarySelectable.cxx:100 TEveSecondarySelectable.cxx:101 TEveSecondarySelectable.cxx:102 TEveSecondarySelectable.cxx:103 TEveSecondarySelectable.cxx:104 TEveSecondarySelectable.cxx:105 TEveSecondarySelectable.cxx:106 TEveSecondarySelectable.cxx:107 TEveSecondarySelectable.cxx:108 TEveSecondarySelectable.cxx:109 TEveSecondarySelectable.cxx:110 TEveSecondarySelectable.cxx:111 TEveSecondarySelectable.cxx:112 TEveSecondarySelectable.cxx:113 TEveSecondarySelectable.cxx:114