Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:41

0001 // Created on: 1995-01-25
0002 // Created by: Jean-Louis Frenkel
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _PrsMgr_Presentation_HeaderFile
0018 #define _PrsMgr_Presentation_HeaderFile
0019 
0020 #include <Prs3d_Presentation.hxx>
0021 
0022 class PrsMgr_PresentationManager;
0023 class PrsMgr_PresentableObject;
0024 class Graphic3d_Camera;
0025 class Prs3d_Drawer;
0026 
0027 DEFINE_STANDARD_HANDLE(PrsMgr_Presentation, Graphic3d_Structure)
0028 
0029 class PrsMgr_Presentation : public Graphic3d_Structure
0030 {
0031   DEFINE_STANDARD_RTTIEXT(PrsMgr_Presentation, Graphic3d_Structure)
0032   friend class PrsMgr_PresentationManager;
0033   friend class PrsMgr_PresentableObject;
0034 public:
0035 
0036   //! Destructor
0037   Standard_EXPORT ~PrsMgr_Presentation();
0038 
0039   Standard_DEPRECATED("Dummy to simplify porting - returns self")
0040   Prs3d_Presentation* Presentation() { return this; }
0041 
0042   //! returns the PresentationManager in which the presentation has been created.
0043   const Handle(PrsMgr_PresentationManager)& PresentationManager() const { return myPresentationManager; }
0044 
0045   void SetUpdateStatus (const Standard_Boolean theUpdateStatus) { myMustBeUpdated = theUpdateStatus; }
0046 
0047   Standard_Boolean MustBeUpdated() const { return myMustBeUpdated; }
0048 
0049   //! Return display mode index.
0050   Standard_Integer Mode() const { return myMode; }
0051 
0052   //! Display structure.
0053   Standard_EXPORT virtual void Display() Standard_OVERRIDE;
0054 
0055   //! Remove structure.
0056   Standard_EXPORT virtual void Erase() Standard_OVERRIDE;
0057 
0058   //! Highlight structure.
0059   Standard_EXPORT void Highlight (const Handle(Prs3d_Drawer)& theStyle);
0060 
0061   //! Unhighlight structure.
0062   Standard_EXPORT void Unhighlight();
0063 
0064   //! Return TRUE if structure has been displayed and in no hidden state.
0065   virtual Standard_Boolean IsDisplayed() const Standard_OVERRIDE
0066   {
0067     return base_type::IsDisplayed()
0068         && base_type::IsVisible();
0069   }
0070 
0071   //! removes the whole content of the presentation.
0072   //! Does not remove the other connected presentations.
0073   Standard_EXPORT virtual void Clear (const Standard_Boolean theWithDestruction = Standard_True) Standard_OVERRIDE;
0074 
0075   //! Compute structure using presentation manager.
0076   Standard_EXPORT virtual void Compute() Standard_OVERRIDE;
0077 
0078   //! Dumps the content of me into the stream
0079   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0080 
0081 protected:
0082 
0083   //! Main constructor.
0084   Standard_EXPORT PrsMgr_Presentation (const Handle(PrsMgr_PresentationManager)& thePresentationManager,
0085                                        const Handle(PrsMgr_PresentableObject)& thePresentableObject,
0086                                        const Standard_Integer theMode);
0087 
0088   //! Displays myStructure.
0089   Standard_EXPORT void display (const Standard_Boolean theIsHighlight);
0090 
0091   Standard_EXPORT virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector,
0092                                            Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE;
0093 protected:
0094 
0095   Handle(PrsMgr_PresentationManager) myPresentationManager;
0096   PrsMgr_PresentableObject* myPresentableObject;
0097   Standard_Integer myBeforeHighlightState;
0098   Standard_Integer myMode;
0099   Standard_Boolean myMustBeUpdated;
0100 
0101 };
0102 
0103 #endif // _PrsMgr_Presentation_HeaderFile