ATLAS Offline Software
SoCooperativeSelection.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef SOCOOPERATIVESELECTION_H
6 #define SOCOOPERATIVESELECTION_H
7 
8 #include <Inventor/C/errors/debugerror.h>
9 #include <Inventor/nodes/SoSelection.h>
10 #include <Inventor/nodes/SoGroup.h>
11 #include <Inventor/fields/SoSFNode.h>
12 
13 // Class: SoCooperativeSelection.
14 // Author: Thomas.Kittelmann@cern.ch
15 // Initial version: October 2007
16 //
17 // "Cooperative" extension of SoSelection which does NOT mark events
18 // as handled when the picked point wasn't actually on any of its
19 // children (but it still deselects if appropriate).
20 //
21 // Furthermore, it ignores events if it is not the
22 // SoSelection/SoCooperativeSelection node furthest down on the path (thus
23 // selection behaviour can be easily changed for a given subgraph by
24 // the insertion of a new selection node)
25 
28 
29 class SoCooperativeSelection : public SoSelection {
30 
32 
33 public:
34  static void initClass();
36  SoCooperativeSelection(const int nChildren);
37 
38  static void ensureInitClass();//Use this instead of initClass() (multiple invocations are harmless).
39 
40  enum ActivePolicy {
42  };
43 
44  //INERT: The node simply behaves as an SoSeparator, allowing
45  // SoCooperativeSelection nodes further up the tree to handle the event.
46  //ACTIVE: Active (default). SoCooperativeSelection Nodes further up in the
47  // tree will never handle the event.
48 
49  SoSFEnum activePolicy;
50 
53 
54 protected:
55  virtual ~SoCooperativeSelection();
56  virtual void handleEvent(SoHandleEventAction * action);
57 
58 private:
59  //The implementation of this method is copied verbatim from the base
60  //class (since it is private rather than protected there).
61  SoPath *getSelectionPath( SoHandleEventAction *action,
62  SbBool &ignorepick, SbBool &haltaction );
63 
64  //Helper method:
66 
67  SoCallbackList *m_clickoutsideCBList;
68 
69  //Common code for both constructors:
70  void init();
71 };
72 
73 #endif
SoCooperativeSelectionClickOutsideCB
void SoCooperativeSelectionClickOutsideCB(void *data, SoCooperativeSelection *sel)
Definition: SoCooperativeSelection.h:27
SoCooperativeSelection::removeClickOutsideCallback
void removeClickOutsideCallback(SoCooperativeSelectionClickOutsideCB *f, void *userData=0)
Definition: SoCooperativeSelection.cxx:91
SoCooperativeSelection::INERT
@ INERT
Definition: SoCooperativeSelection.h:41
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
SoCooperativeSelection::m_clickoutsideCBList
SoCallbackList * m_clickoutsideCBList
Definition: SoCooperativeSelection.h:67
SoCooperativeSelection::addClickOutsideCallback
void addClickOutsideCallback(SoCooperativeSelectionClickOutsideCB *f, void *userData=0)
Definition: SoCooperativeSelection.cxx:85
SoCooperativeSelection::~SoCooperativeSelection
virtual ~SoCooperativeSelection()
Definition: SoCooperativeSelection.cxx:64
SoCooperativeSelection::SoCooperativeSelection
SoCooperativeSelection()
Definition: SoCooperativeSelection.cxx:35
SoCooperativeSelection::activePolicy
SoSFEnum activePolicy
Definition: SoCooperativeSelection.h:49
SoCooperativeSelection::handleEvent
virtual void handleEvent(SoHandleEventAction *action)
Definition: SoCooperativeSelection.cxx:97
SoCooperativeSelection::getSelectionPath
SoPath * getSelectionPath(SoHandleEventAction *action, SbBool &ignorepick, SbBool &haltaction)
Definition: SoCooperativeSelection.cxx:174
SoCooperativeSelection::SO_NODE_HEADER
SO_NODE_HEADER(SoCooperativeSelection)
SoCooperativeSelection::initClass
static void initClass()
Definition: SoCooperativeSelection.cxx:20
sel
sel
Definition: SUSYToolsTester.cxx:92
SoCooperativeSelection::init
void init()
Definition: SoCooperativeSelection.cxx:49
SoCooperativeSelection::ensureInitClass
static void ensureInitClass()
Definition: SoCooperativeSelection.cxx:26
SoCooperativeSelection::ACTIVE
@ ACTIVE
Definition: SoCooperativeSelection.h:41
SoCooperativeSelection::getLastActiveSoSelectionFromPath
SoCooperativeSelection * getLastActiveSoSelectionFromPath(SoPath *) const
Definition: SoCooperativeSelection.cxx:72
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77
SoCooperativeSelection::ActivePolicy
ActivePolicy
Definition: SoCooperativeSelection.h:40
SoCooperativeSelection
Definition: SoCooperativeSelection.h:29