0029384: Visualization, TKOpenGl - basic integration with OpenVR
[occt.git] / src / Aspect / Aspect_XRAction.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_XRAction_HeaderFile
15 #define _Aspect_XRAction_HeaderFile
16
17 #include <Aspect_XRActionType.hxx>
18 #include <NCollection_IndexedDataMap.hxx>
19 #include <Standard_Transient.hxx>
20 #include <Standard_Type.hxx>
21 #include <TCollection_AsciiString.hxx>
22
23 //! XR action definition.
24 class Aspect_XRAction : public Standard_Transient
25 {
26   DEFINE_STANDARD_RTTIEXT(Aspect_XRAction, Standard_Transient)
27 public:
28
29   //! Return action id.
30   const TCollection_AsciiString& Id() const { return myId; }
31
32   //! Return action type.
33   Aspect_XRActionType Type() const { return myType; }
34
35   //! Return TRUE if action is defined.
36   bool IsValid() const { return myRawHandle != 0; }
37
38   //! Return action handle.
39   uint64_t RawHandle() const { return myRawHandle; }
40
41   //! Set action handle.
42   void SetRawHandle (uint64_t theHande) { myRawHandle = theHande; }
43
44   //! Main constructor.
45   Aspect_XRAction (const TCollection_AsciiString& theId,
46                    const Aspect_XRActionType theType)
47   : myId (theId), myRawHandle (0), myType (theType) {}
48
49 protected:
50   TCollection_AsciiString myId;        //!< action id
51   uint64_t                myRawHandle; //!< action handle
52   Aspect_XRActionType     myType;      //!< action type
53 };
54
55 //! Map of actions with action Id as a key.
56 typedef NCollection_IndexedDataMap<TCollection_AsciiString, Handle(Aspect_XRAction), TCollection_AsciiString> Aspect_XRActionMap;
57
58 #endif // _Aspect_XRAction_HeaderFile