ATLAS Offline Software
Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
IVP13DSystem::Imp Class Reference
Collaboration diagram for IVP13DSystem::Imp:

Static Public Member Functions

static void start_changeselection (void *userdata, SoSelection *sel)
 
static void finished_changeselection (void *userdata, SoSelection *sel)
 
static void made_selection (void *userdata, SoPath *path)
 
static void made_deselection (void *userdata, SoPath *path)
 
static void clickedoutside (void *userdata, SoCooperativeSelection *sel)
 

Public Attributes

std::vector< SoSelectionPathCB * > _callbacks
 
std::set< SoCamera * > staticcameras
 
std::set< SoQtViewer * > viewers
 
QSet< SoCooperativeSelection * > selectionsWithDisabledNotifications
 
std::map< SoCooperativeSelection *, SoPathList > selection2lastpathlist
 
bool clickedoutsideScheduled
 

Static Public Attributes

static std::map< SoCooperativeSelection *, IVP13DSystem * > selection2system
 

Detailed Description

Definition at line 31 of file IVP13DSystem.cxx.

Member Function Documentation

◆ clickedoutside()

void IVP13DSystem::Imp::clickedoutside ( void *  userdata,
SoCooperativeSelection sel 
)
static

Definition at line 65 of file IVP13DSystem.cxx.

66 {
67  if (!selection) {
68  std::cout<<"IVP13DSystem::Imp::clickedoutside Error: Got null selection pointer!"<<std::endl;
69  return;
70  }
71  IVP13DSystem * system = dynamic_cast<IVP13DSystem *>(static_cast<IVP1System * >(userdata));
72  if (!system) {
73  std::cout<<"IVP13DSystem::Imp::clickedoutside Error: Could not find system pointer!"<<std::endl;
74  return;
75  }
76  if (system->m_d->selectionsWithDisabledNotifications.contains(selection))
77  return;
78  if (system->m_d->clickedoutsideScheduled)
79  return;
80  system->m_d->clickedoutsideScheduled = true;
81  QTimer::singleShot(0, system, SLOT(activateClickedOutside()));
82 }

◆ finished_changeselection()

void IVP13DSystem::Imp::finished_changeselection ( void *  userdata,
SoSelection *  sel 
)
static

Definition at line 121 of file IVP13DSystem.cxx.

122 {
124  if (!selection) {
125  std::cout<<"IVP13DSystem::Imp::finished_changeselection Error: Could not find selection pointer!"<<std::endl;
126  return;
127  }
128 
129  IVP13DSystem * system = static_cast<IVP13DSystem *>(userdata);
130  if (!system) {
131  std::cout<<"IVP13DSystem::Imp::finished_changeselection Error: Could not find system pointer!"<<std::endl;
132  return;
133  }
134 
135  selection->touch(); // to redraw
136 
137  if (selection->policy.getValue()==SoSelection::SINGLE)
138  return;
139 
140  //Only take action when selection actually changed between start and finish:
141  if (system->m_d->selection2lastpathlist.find(selection)==system->m_d->selection2lastpathlist.end()) {
142  std::cout<<"IVP13DSystem::Imp::finished_changeselection Error: Could not find last selection path list!"<<std::endl;
143  return;
144  }
145 
146  int nlastselection = system->m_d->selection2lastpathlist[selection].getLength();
147  bool changed = false;
148  if (nlastselection!=selection->getList()->getLength()) {
149  changed = true;
150  } else {
151  for (int i = 0; i < selection->getList()->getLength(); ++i) {
152  if (system->m_d->selection2lastpathlist[selection].get(i)!=selection->getList()->get(i)) {
153  changed = true;
154  break;
155  }
156  }
157  }
158  if (!changed) {
159  system->m_d->selection2lastpathlist.erase(system->m_d->selection2lastpathlist.find(selection));
160  return;
161  }
162 
163  //To avoid having different systems emit itemFromSystemSelected due
164  //to one user interaction, we only emit here if the action resulted
165  //in an increase in the number of selected objects:
166  if (selection->getList()->getLength()>nlastselection) {
167  system->itemFromSystemSelected();//Emit this signal
168  }
169 
170  if (system->m_d->selectionsWithDisabledNotifications.contains(selection))
171  return;
172 
173  QSet<SoNode*> selnodes;
174  QSet<SoPath*> selpaths;
175  int n = selection->getList()->getLength();
176  for (int i = 0; i < n; ++i) {
177  SoPath * path = (*(selection->getList()))[i];
178  if (!path)
179  continue;
180  SoFullPath *fPath = static_cast<SoFullPath *>(path);
181  SoNode * node = fPath->getTail();
182  if (!node)
183  continue;
184  selpaths << fPath;
185  selnodes << node;
186  }
187 
188  system->userChangedSelection(selection,selnodes,selpaths);
189 }

◆ made_deselection()

void IVP13DSystem::Imp::made_deselection ( void *  userdata,
SoPath *  path 
)
static

Definition at line 227 of file IVP13DSystem.cxx.

228 {
229  SoFullPath *fPath = static_cast<SoFullPath *>(path);
230  if (!fPath)
231  return;
232  SoNode *deselectedNode = fPath->getTail();
233  if (!deselectedNode)
234  return;
235 
236  SoCooperativeSelection * selection = static_cast<SoCooperativeSelection*>(userdata);
237  if (!selection) {
238  std::cout<<"IVP13DSystem::Imp::made_deselection Error: Could not find selection pointer!"<<std::endl;
239  return;
240  }
241  if (selection->policy.getValue()!=SoSelection::SINGLE)
242  return;
243 
245  std::cout << "IVP13DSystem::Imp::made_deselection Error: Could not find system pointer!"<<std::endl;
246  return;
247  }
248 
250  if (system->m_d->selectionsWithDisabledNotifications.contains(selection))
251  return;
252 
253  system->userDeselectedSingleNode(selection,deselectedNode,fPath);
254 }

◆ made_selection()

void IVP13DSystem::Imp::made_selection ( void *  userdata,
SoPath *  path 
)
static

Definition at line 192 of file IVP13DSystem.cxx.

193 {
194  SoFullPath *fPath = static_cast<SoFullPath *>(path);
195  if (!fPath)
196  return;
197  SoNode *selectedNode = fPath->getTail();
198  if (!selectedNode)
199  return;
200  SoCooperativeSelection * selection = static_cast<SoCooperativeSelection*>(userdata);
201  if (!selection) {
202  std::cout<<"IVP13DSystem::Imp::made_selection Error: Could not find selection pointer!"<<std::endl;
203  return;
204  }
205  if (selection->policy.getValue()!=SoSelection::SINGLE)
206  return;
207 
209  std::cout << "IVP13DSystem::Imp::made_selection Error: Could not find system pointer!"<<std::endl;
210  return;
211  }
212 
214 
215  system->itemFromSystemSelected();//Emit this signal
216 
217  if (system->m_d->selectionsWithDisabledNotifications.contains(selection))
218  return;
219 
220 
221  system->userSelectedSingleNode(selection,selectedNode,fPath);
222 
223  //redraw takes place in finished_changeselection!
224 }

◆ start_changeselection()

void IVP13DSystem::Imp::start_changeselection ( void *  userdata,
SoSelection *  sel 
)
static

Definition at line 94 of file IVP13DSystem.cxx.

95 {
97  if (!selection) {
98  std::cout<<"IVP13DSystem::Imp::start_changeselection Error: Could not find selection pointer!"<<std::endl;
99  return;
100  }
101 
102  if (selection->policy.getValue()==SoSelection::SINGLE)
103  return;
104 
105  IVP13DSystem * system = static_cast<IVP13DSystem *>(userdata);
106  if (!system) {
107  std::cout<<"IVP13DSystem::Imp::start_changeselection Error: Could not find system pointer!"<<std::endl;
108  return;
109  }
110 
111  if (system->m_d->selectionsWithDisabledNotifications.contains(selection))
112  return;
113 
114  system->m_d->selection2lastpathlist[selection] = *(selection->getList());
115 
116  //redraw and emission of itemFromSystemSelected() take place in finished_changeselection!
117 
118 }

Member Data Documentation

◆ _callbacks

std::vector<SoSelectionPathCB *> IVP13DSystem::Imp::_callbacks

Definition at line 34 of file IVP13DSystem.cxx.

◆ clickedoutsideScheduled

bool IVP13DSystem::Imp::clickedoutsideScheduled

Definition at line 53 of file IVP13DSystem.cxx.

◆ selection2lastpathlist

std::map<SoCooperativeSelection*,SoPathList> IVP13DSystem::Imp::selection2lastpathlist

Definition at line 52 of file IVP13DSystem.cxx.

◆ selection2system

std::map< SoCooperativeSelection *, IVP13DSystem * > IVP13DSystem::Imp::selection2system
static

Definition at line 46 of file IVP13DSystem.cxx.

◆ selectionsWithDisabledNotifications

QSet<SoCooperativeSelection *> IVP13DSystem::Imp::selectionsWithDisabledNotifications

Definition at line 50 of file IVP13DSystem.cxx.

◆ staticcameras

std::set<SoCamera*> IVP13DSystem::Imp::staticcameras

Definition at line 36 of file IVP13DSystem.cxx.

◆ viewers

std::set<SoQtViewer*> IVP13DSystem::Imp::viewers

Definition at line 37 of file IVP13DSystem.cxx.


The documentation for this class was generated from the following file:
IVP13DSystem::userChangedSelection
virtual void userChangedSelection(SoCooperativeSelection *, QSet< SoNode * >, QSet< SoPath * >)
Definition: IVP13DSystem.cxx:61
IVP13DSystem::activateClickedOutside
void activateClickedOutside()
Definition: IVP13DSystem.cxx:85
IVP13DSystem::Imp::selection2system
static std::map< SoCooperativeSelection *, IVP13DSystem * > selection2system
Definition: IVP13DSystem.cxx:46
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
IVP13DSystem::userDeselectedSingleNode
virtual void userDeselectedSingleNode(SoCooperativeSelection *, SoNode *, SoPath *)
Definition: IVP13DSystem.cxx:60
IVP13DSystem::itemFromSystemSelected
void itemFromSystemSelected()
IVP1System
Definition: IVP1System.h:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
sel
sel
Definition: SUSYToolsTester.cxx:97
PyPoolBrowser.node
node
Definition: PyPoolBrowser.py:131
selection
const std::string selection
Definition: fbtTestBasics.cxx:74
IVP13DSystem::Imp::selection2lastpathlist
std::map< SoCooperativeSelection *, SoPathList > selection2lastpathlist
Definition: IVP13DSystem.cxx:52
IVP13DSystem
Definition: IVP13DSystem.h:31
IVP13DSystem::Imp::selectionsWithDisabledNotifications
QSet< SoCooperativeSelection * > selectionsWithDisabledNotifications
Definition: IVP13DSystem.cxx:50
IVP13DSystem::userSelectedSingleNode
virtual void userSelectedSingleNode(SoCooperativeSelection *, SoNode *, SoPath *)
Definition: IVP13DSystem.cxx:59
IVP13DSystem::Imp::clickedoutsideScheduled
bool clickedoutsideScheduled
Definition: IVP13DSystem.cxx:53
IVP13DSystem::m_d
Imp * m_d
Definition: IVP13DSystem.h:116
node
Definition: memory_hooks-stdcmalloc.h:74
SoCooperativeSelection
Definition: SoCooperativeSelection.h:29