ATLAS Offline Software
Loading...
Searching...
No Matches
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
29class SoCooperativeSelection : public SoSelection {
30
32
33public:
34 static void initClass();
36 SoCooperativeSelection(const int nChildren);
37
38 static void ensureInitClass();//Use this instead of initClass() (multiple invocations are harmless).
39
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
54protected:
56 virtual void handleEvent(SoHandleEventAction * action);
57
58private:
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
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
void SoCooperativeSelectionClickOutsideCB(void *data, SoCooperativeSelection *sel)
SoPath * getSelectionPath(SoHandleEventAction *action, SbBool &ignorepick, SbBool &haltaction)
void addClickOutsideCallback(SoCooperativeSelectionClickOutsideCB *f, void *userData=0)
SoCallbackList * m_clickoutsideCBList
SoCooperativeSelection * getLastActiveSoSelectionFromPath(SoPath *) const
void removeClickOutsideCallback(SoCooperativeSelectionClickOutsideCB *f, void *userData=0)
virtual void handleEvent(SoHandleEventAction *action)
SO_NODE_HEADER(SoCooperativeSelection)