Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:45:47

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 
0061   //! Returns true for 0 mode.
0062   virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; }
0063 
0064   //! Compute presentation.
0065   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0066                                         const Handle(Prs3d_Presentation)& thePrs,
0067                                         const Standard_Integer theMode) Standard_OVERRIDE;
0068 
0069   //! Compute selection.
0070   Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
0071                                                  const Standard_Integer theMode) Standard_OVERRIDE;
0072 
0073   //! Compute laser ray presentation.
0074   Standard_EXPORT void computeLaserRay();
0075 
0076 private:
0077   //! Texture holder.
0078   class XRTexture;
0079 
0080 private:
0081 
0082   Handle(Graphic3d_Group) myRayGroup;
0083 
0084   Handle(Graphic3d_ArrayOfTriangles) myTris;
0085   Quantity_Color             myLaserColor;
0086   Standard_ShortReal         myLaserLength;
0087   Standard_ShortReal         myUnitFactor;
0088   Aspect_XRTrackedDeviceRole myRole;
0089   Standard_Boolean           myToShowAxes;
0090 };
0091 
0092 #endif // _AIS_XRTrackedDevice_HeaderFile