Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/AIS_XRTrackedDevice.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (c) 2020 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _AIS_XRTrackedDevice_HeaderFile
0015 #define _AIS_XRTrackedDevice_HeaderFile
0016 
0017 #include <AIS_InteractiveObject.hxx>
0018 #include <Aspect_XRTrackedDeviceRole.hxx>
0019 
0020 class Graphic3d_ArrayOfTriangles;
0021 class Image_Texture;
0022 
0023 //! Auxiliary textured mesh presentation of tracked XR device.
0024 class AIS_XRTrackedDevice : public AIS_InteractiveObject
0025 {
0026   DEFINE_STANDARD_RTTIEXT(AIS_XRTrackedDevice, AIS_InteractiveObject)
0027 public:
0028   //! Main constructor.
0029   Standard_EXPORT AIS_XRTrackedDevice(const Handle(Graphic3d_ArrayOfTriangles)& theTris,
0030                                       const Handle(Image_Texture)&              theTexture);
0031 
0032   //! Empty constructor.
0033   Standard_EXPORT AIS_XRTrackedDevice();
0034 
0035   //! Return device role.
0036   Aspect_XRTrackedDeviceRole Role() const { return myRole; }
0037 
0038   //! Set device role.
0039   void SetRole(Aspect_XRTrackedDeviceRole theRole) { myRole = theRole; }
0040 
0041   //! Return laser color.
0042   const Quantity_Color& LaserColor() const { return myLaserColor; }
0043 
0044   //! Set laser color.
0045   Standard_EXPORT void SetLaserColor(const Quantity_Color& theColor);
0046 
0047   //! Return laser length.
0048   Standard_ShortReal LaserLength() const { return myLaserLength; }
0049 
0050   //! Set laser length.
0051   Standard_EXPORT void SetLaserLength(Standard_ShortReal theLength);
0052 
0053   //! Return unit scale factor.
0054   Standard_ShortReal UnitFactor() const { return myUnitFactor; }
0055 
0056   //! Set unit scale factor.
0057   void SetUnitFactor(Standard_ShortReal theFactor) { myUnitFactor = theFactor; }
0058 
0059 protected:
0060   //! Returns true for 0 mode.
0061   virtual Standard_Boolean AcceptDisplayMode(const Standard_Integer theMode) const Standard_OVERRIDE
0062   {
0063     return theMode == 0;
0064   }
0065 
0066   //! Compute presentation.
0067   Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0068                                        const Handle(Prs3d_Presentation)&         thePrs,
0069                                        const Standard_Integer theMode) Standard_OVERRIDE;
0070 
0071   //! Compute selection.
0072   Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& theSel,
0073                                                 const Standard_Integer theMode) Standard_OVERRIDE;
0074 
0075   //! Compute laser ray presentation.
0076   Standard_EXPORT void computeLaserRay();
0077 
0078 private:
0079   //! Texture holder.
0080   class XRTexture;
0081 
0082 private:
0083   Handle(Graphic3d_Group) myRayGroup;
0084 
0085   Handle(Graphic3d_ArrayOfTriangles) myTris;
0086   Quantity_Color                     myLaserColor;
0087   Standard_ShortReal                 myLaserLength;
0088   Standard_ShortReal                 myUnitFactor;
0089   Aspect_XRTrackedDeviceRole         myRole;
0090   Standard_Boolean                   myToShowAxes;
0091 };
0092 
0093 #endif // _AIS_XRTrackedDevice_HeaderFile