Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-19 10:49:44

0001 // Created on: 1998-09-23
0002 // Created by: Denis PASCAL
0003 // Copyright (c) 1998-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 _DDataStd_DrawPresentation_HeaderFile
0018 #define _DDataStd_DrawPresentation_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TDF_Attribute.hxx>
0024 class Draw_Drawable3D;
0025 class TDF_Label;
0026 class Standard_GUID;
0027 class TDF_RelocationTable;
0028 class TDF_AttributeDelta;
0029 
0030 //! draw presentation of a label of a document
0031 class DDataStd_DrawPresentation : public TDF_Attribute
0032 {
0033 
0034 public:
0035   //! api methods on draw presentation
0036   //! ================================
0037   Standard_EXPORT static bool HasPresentation(const TDF_Label& L);
0038 
0039   Standard_EXPORT static bool IsDisplayed(const TDF_Label& L);
0040 
0041   Standard_EXPORT static void Display(const TDF_Label& L);
0042 
0043   Standard_EXPORT static void Erase(const TDF_Label& L);
0044 
0045   //! attribute implementation
0046   //! ========================
0047   Standard_EXPORT static void Update(const TDF_Label& L);
0048 
0049   Standard_EXPORT static const Standard_GUID& GetID();
0050 
0051   Standard_EXPORT DDataStd_DrawPresentation();
0052 
0053   Standard_EXPORT void SetDisplayed(const bool status);
0054 
0055   Standard_EXPORT bool IsDisplayed() const;
0056 
0057   Standard_EXPORT void SetDrawable(const occ::handle<Draw_Drawable3D>& D);
0058 
0059   Standard_EXPORT occ::handle<Draw_Drawable3D> GetDrawable() const;
0060 
0061   Standard_EXPORT const Standard_GUID& ID() const override;
0062 
0063   Standard_EXPORT occ::handle<TDF_Attribute> NewEmpty() const override;
0064 
0065   Standard_EXPORT void Restore(const occ::handle<TDF_Attribute>& with) override;
0066 
0067   //! call backs for viewer updating
0068   //! ==============================
0069   Standard_EXPORT void Paste(const occ::handle<TDF_Attribute>&       into,
0070                              const occ::handle<TDF_RelocationTable>& RT) const override;
0071 
0072   Standard_EXPORT void AfterAddition() override;
0073 
0074   Standard_EXPORT void BeforeRemoval() override;
0075 
0076   Standard_EXPORT void BeforeForget() override;
0077 
0078   Standard_EXPORT void AfterResume() override;
0079 
0080   Standard_EXPORT bool BeforeUndo(const occ::handle<TDF_AttributeDelta>& anAttDelta,
0081                                   const bool                             forceIt = false) override;
0082 
0083   //! update draw viewer according to delta
0084   //! private methods
0085   //! ===============
0086   Standard_EXPORT bool AfterUndo(const occ::handle<TDF_AttributeDelta>& anAttDelta,
0087                                  const bool                             forceIt = false) override;
0088 
0089   DEFINE_STANDARD_RTTIEXT(DDataStd_DrawPresentation, TDF_Attribute)
0090 
0091 private:
0092   Standard_EXPORT void DrawBuild();
0093 
0094   Standard_EXPORT static void DrawDisplay(const TDF_Label&                              L,
0095                                           const occ::handle<DDataStd_DrawPresentation>& P);
0096 
0097   Standard_EXPORT static void DrawErase(const TDF_Label&                              L,
0098                                         const occ::handle<DDataStd_DrawPresentation>& P);
0099 
0100   bool                         isDisplayed;
0101   occ::handle<Draw_Drawable3D> myDrawable;
0102 };
0103 
0104 #endif // _DDataStd_DrawPresentation_HeaderFile