File indexing completed on 2025-01-18 10:02:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _AIS_MediaPlayer_HeaderFile
0016 #define _AIS_MediaPlayer_HeaderFile
0017
0018 #include <AIS_InteractiveObject.hxx>
0019 #include <Graphic3d_MediaTextureSet.hxx>
0020
0021 class Media_PlayerContext;
0022
0023
0024 class AIS_MediaPlayer : public AIS_InteractiveObject
0025 {
0026 DEFINE_STANDARD_RTTIEXT(AIS_MediaPlayer, AIS_InteractiveObject)
0027 public:
0028
0029
0030 Standard_EXPORT AIS_MediaPlayer();
0031
0032
0033 Standard_EXPORT virtual ~AIS_MediaPlayer();
0034
0035
0036 void SetCallback (Graphic3d_MediaTextureSet::CallbackOnUpdate_t theCallbackFunction, void* theCallbackUserPtr)
0037 {
0038 myFramePair->SetCallback (theCallbackFunction, theCallbackUserPtr);
0039 }
0040
0041
0042 Standard_EXPORT void OpenInput (const TCollection_AsciiString& thePath,
0043 Standard_Boolean theToWait);
0044
0045
0046 Standard_EXPORT bool PresentFrame (const Graphic3d_Vec2i& theLeftCorner,
0047 const Graphic3d_Vec2i& theMaxSize);
0048
0049
0050 const Handle(Media_PlayerContext)& PlayerContext() const { return myFramePair->PlayerContext(); }
0051
0052
0053 Standard_EXPORT void PlayPause();
0054
0055
0056 void SetClosePlayer()
0057 {
0058 myToClosePlayer = true;
0059 myFramePair->Notify();
0060 }
0061
0062
0063 double Duration() const { return myFramePair->Duration(); }
0064
0065
0066 protected:
0067
0068
0069 virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; }
0070
0071
0072 Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0073 const Handle(Prs3d_Presentation)& thePrs,
0074 const Standard_Integer theMode) Standard_OVERRIDE;
0075
0076
0077 Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
0078 const Standard_Integer theMode) Standard_OVERRIDE;
0079
0080 protected:
0081
0082
0083 Standard_EXPORT bool updateSize (const Graphic3d_Vec2i& theLeftCorner,
0084 const Graphic3d_Vec2i& theMaxSize);
0085
0086 protected:
0087
0088 Handle(Graphic3d_MediaTextureSet) myFramePair;
0089 Handle(Graphic3d_AspectFillArea3d) myFrameAspect;
0090 Graphic3d_Vec2i myFrameBottomLeft;
0091 Graphic3d_Vec2i myFrameSize;
0092 bool myToClosePlayer;
0093
0094 };
0095
0096 #endif