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 _AIS_XRTrackedDevice_HeaderFile
15 #define _AIS_XRTrackedDevice_HeaderFile
17 #include <AIS_InteractiveObject.hxx>
18 #include <Aspect_XRTrackedDeviceRole.hxx>
20 class Graphic3d_ArrayOfTriangles;
23 //! Auxiliary textured mesh presentation of tracked XR device.
24 class AIS_XRTrackedDevice : public AIS_InteractiveObject
26 DEFINE_STANDARD_RTTIEXT(AIS_XRTrackedDevice, AIS_InteractiveObject)
29 Standard_EXPORT AIS_XRTrackedDevice (const Handle(Graphic3d_ArrayOfTriangles)& theTris,
30 const Handle(Image_Texture)& theTexture);
32 //! Empty constructor.
33 Standard_EXPORT AIS_XRTrackedDevice();
35 //! Return device role.
36 Aspect_XRTrackedDeviceRole Role() const { return myRole; }
39 void SetRole (Aspect_XRTrackedDeviceRole theRole) { myRole = theRole; }
41 //! Return laser color.
42 const Quantity_Color& LaserColor() const { return myLaserColor; }
45 Standard_EXPORT void SetLaserColor (const Quantity_Color& theColor);
47 //! Return laser length.
48 Standard_ShortReal LaserLength() const { return myLaserLength; }
51 Standard_EXPORT void SetLaserLength (Standard_ShortReal theLength);
53 //! Return unit scale factor.
54 Standard_ShortReal UnitFactor() const { return myUnitFactor; }
56 //! Set unit scale factor.
57 void SetUnitFactor (Standard_ShortReal theFactor) { myUnitFactor = theFactor; }
61 //! Returns true for 0 mode.
62 virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; }
64 //! Compute presentation.
65 Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
66 const Handle(Prs3d_Presentation)& thePrs,
67 const Standard_Integer theMode) Standard_OVERRIDE;
69 //! Compute selection.
70 Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
71 const Standard_Integer theMode) Standard_OVERRIDE;
73 //! Compute laser ray presentation.
74 Standard_EXPORT void computeLaserRay();
82 Handle(Graphic3d_Group) myRayGroup;
84 Handle(Graphic3d_ArrayOfTriangles) myTris;
85 Quantity_Color myLaserColor;
86 Standard_ShortReal myLaserLength;
87 Standard_ShortReal myUnitFactor;
88 Aspect_XRTrackedDeviceRole myRole;
89 Standard_Boolean myToShowAxes;
92 #endif // _AIS_XRTrackedDevice_HeaderFile