1 // Copyright (c) 2020 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _Aspect_XRAction_HeaderFile
15 #define _Aspect_XRAction_HeaderFile
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>
23 //! XR action definition.
24 class Aspect_XRAction : public Standard_Transient
26 DEFINE_STANDARD_RTTIEXT(Aspect_XRAction, Standard_Transient)
30 const TCollection_AsciiString& Id() const { return myId; }
32 //! Return action type.
33 Aspect_XRActionType Type() const { return myType; }
35 //! Return TRUE if action is defined.
36 bool IsValid() const { return myRawHandle != 0; }
38 //! Return action handle.
39 uint64_t RawHandle() const { return myRawHandle; }
41 //! Set action handle.
42 void SetRawHandle (uint64_t theHande) { myRawHandle = theHande; }
45 Aspect_XRAction (const TCollection_AsciiString& theId,
46 const Aspect_XRActionType theType)
47 : myId (theId), myRawHandle (0), myType (theType) {}
50 TCollection_AsciiString myId; //!< action id
51 uint64_t myRawHandle; //!< action handle
52 Aspect_XRActionType myType; //!< action type
55 //! Map of actions with action Id as a key.
56 typedef NCollection_IndexedDataMap<TCollection_AsciiString, Handle(Aspect_XRAction), TCollection_AsciiString> Aspect_XRActionMap;
58 #endif // _Aspect_XRAction_HeaderFile