File indexing completed on 2026-09-19 09:27:01
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 Standard_EXPORT AIS_MediaPlayer();
0030
0031
0032 Standard_EXPORT ~AIS_MediaPlayer() override;
0033
0034
0035 void SetCallback(Graphic3d_MediaTextureSet::CallbackOnUpdate_t theCallbackFunction,
0036 void* theCallbackUserPtr)
0037 {
0038 myFramePair->SetCallback(theCallbackFunction, theCallbackUserPtr);
0039 }
0040
0041
0042 Standard_EXPORT void OpenInput(const TCollection_AsciiString& thePath, bool theToWait);
0043
0044
0045 Standard_EXPORT bool PresentFrame(const NCollection_Vec2<int>& theLeftCorner,
0046 const NCollection_Vec2<int>& theMaxSize);
0047
0048
0049 const occ::handle<Media_PlayerContext>& PlayerContext() const
0050 {
0051 return myFramePair->PlayerContext();
0052 }
0053
0054
0055 Standard_EXPORT void PlayPause();
0056
0057
0058 void SetClosePlayer()
0059 {
0060 myToClosePlayer = true;
0061 myFramePair->Notify();
0062 }
0063
0064
0065 double Duration() const { return myFramePair->Duration(); }
0066
0067
0068 protected:
0069
0070 bool AcceptDisplayMode(const int theMode) const override { return theMode == 0; }
0071
0072
0073 Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
0074 const occ::handle<Prs3d_Presentation>& thePrs,
0075 const int theMode) override;
0076
0077
0078 Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSel,
0079 const int theMode) override;
0080
0081 protected:
0082
0083 Standard_EXPORT bool updateSize(const NCollection_Vec2<int>& theLeftCorner,
0084 const NCollection_Vec2<int>& theMaxSize);
0085
0086 protected:
0087 occ::handle<Graphic3d_MediaTextureSet> myFramePair;
0088 occ::handle<Graphic3d_AspectFillArea3d> myFrameAspect;
0089 NCollection_Vec2<int> myFrameBottomLeft;
0090 NCollection_Vec2<int> myFrameSize;
0091 bool myToClosePlayer;
0092 };
0093
0094 #endif