0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / Aspect / Aspect_XRActionSet.hxx
1 // Copyright (c) 2020 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _Aspect_XRActionSet_HeaderFile
15 #define _Aspect_XRActionSet_HeaderFile
16
17 #include <Aspect_XRAction.hxx>
18
19 //! XR action set.
20 class Aspect_XRActionSet : public Standard_Transient
21 {
22   DEFINE_STANDARD_RTTIEXT(Aspect_XRActionSet, Standard_Transient)
23 public:
24
25   //! Return action id.
26   const TCollection_AsciiString& Id() const { return myId; }
27
28   //! Return action handle.
29   uint64_t RawHandle() const { return myRawHandle; }
30
31   //! Set action handle.
32   void SetRawHandle (uint64_t theHande) { myRawHandle = theHande; }
33
34   //! Add action.
35   void AddAction (const Handle(Aspect_XRAction)& theAction)
36   {
37     myActions.Add (theAction->Id(), theAction);
38   }
39
40   //! Return map of actions.
41   const Aspect_XRActionMap& Actions() const { return myActions; }
42
43   //! Main constructor.
44   Aspect_XRActionSet (const TCollection_AsciiString& theId)
45   : myId (theId), myRawHandle (0) {}
46
47 protected:
48   TCollection_AsciiString myId;        //!< action set id
49   uint64_t                myRawHandle; //!< action set handle
50   Aspect_XRActionMap      myActions;   //!< map of actions
51 };
52
53 typedef NCollection_IndexedDataMap<TCollection_AsciiString, Handle(Aspect_XRActionSet), TCollection_AsciiString> Aspect_XRActionSetMap;
54
55 #endif // _Aspect_XRActionSet_HeaderFile