Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:22

0001 // Created on: 1997-02-05
0002 // Created by: Yves FRICAUD
0003 // Copyright (c) 1997-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 _TNaming_UsedShapes_HeaderFile
0018 #define _TNaming_UsedShapes_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TNaming_DataMapOfShapePtrRefShape.hxx>
0024 #include <TDF_Attribute.hxx>
0025 #include <Standard_OStream.hxx>
0026 class Standard_GUID;
0027 class TDF_AttributeDelta;
0028 class TDF_DeltaOnAddition;
0029 class TDF_DeltaOnRemoval;
0030 class TDF_RelocationTable;
0031 class TDF_DataSet;
0032 
0033 
0034 class TNaming_UsedShapes;
0035 DEFINE_STANDARD_HANDLE(TNaming_UsedShapes, TDF_Attribute)
0036 
0037 //! Global attribute located under root label to store all
0038 //! the shapes handled by the framework
0039 //! Set of Shapes Used in a Data from TDF
0040 //! Only one instance by Data, it always
0041 //! Stored as Attribute of The Root.
0042 class TNaming_UsedShapes : public TDF_Attribute
0043 {
0044 
0045 public:
0046 
0047   
0048   Standard_EXPORT void Destroy();
0049 ~TNaming_UsedShapes()
0050 {
0051   Destroy();
0052 }
0053   
0054     TNaming_DataMapOfShapePtrRefShape& Map();
0055   
0056   //! Returns the ID of the attribute.
0057     const Standard_GUID& ID() const Standard_OVERRIDE;
0058   
0059   //! Returns the ID: 2a96b614-ec8b-11d0-bee7-080009dc3333.
0060   Standard_EXPORT static const Standard_GUID& GetID();
0061   
0062   //! Copies  the attribute  contents into  a  new other
0063   //! attribute. It is used by Backup().
0064   Standard_EXPORT virtual Handle(TDF_Attribute) BackupCopy() const Standard_OVERRIDE;
0065   
0066   //! Restores the contents from <anAttribute> into this
0067   //! one. It is used when aborting a transaction.
0068   Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& anAttribute) Standard_OVERRIDE;
0069   
0070   //! Clears the table.
0071   Standard_EXPORT virtual void BeforeRemoval() Standard_OVERRIDE;
0072   
0073   //! Something to do after applying <anAttDelta>.
0074   Standard_EXPORT virtual Standard_Boolean AfterUndo (const Handle(TDF_AttributeDelta)& anAttDelta, const Standard_Boolean forceIt = Standard_False) Standard_OVERRIDE;
0075   
0076   //! this method returns a null handle (no delta).
0077   Standard_EXPORT virtual Handle(TDF_DeltaOnAddition) DeltaOnAddition() const Standard_OVERRIDE;
0078   
0079   //! this method returns a null handle (no delta).
0080   Standard_EXPORT virtual Handle(TDF_DeltaOnRemoval) DeltaOnRemoval() const Standard_OVERRIDE;
0081   
0082   //! Returns an new empty attribute from the good end
0083   //! type. It is used by the copy algorithm.
0084   Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
0085   
0086   //! This method is different from the "Copy" one,
0087   //! because it is used when copying an attribute from
0088   //! a source structure into a target structure. This
0089   //! method pastes the current attribute to the label
0090   //! corresponding to the insertor. The pasted
0091   //! attribute may be a brand new one or a new version
0092   //! of the previous one.
0093   Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& intoAttribute, const Handle(TDF_RelocationTable)& aRelocTationable) const Standard_OVERRIDE;
0094   
0095   //! Adds the directly referenced attributes and labels
0096   //! to <aDataSet>. "Directly" means we have only to
0097   //! look at the first level of references.
0098   //!
0099   //! For this, use only the AddLabel() & AddAttribute()
0100   //! from DataSet and do not try to modify information
0101   //! previously stored in <aDataSet>.
0102   Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& aDataSet) const Standard_OVERRIDE;
0103   
0104   //! Dumps the attribute on <aStream>.
0105   Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
0106   
0107   //! Dumps the content of me into the stream
0108   Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0109 
0110 friend class TNaming_Builder;
0111 
0112 
0113   DEFINE_STANDARD_RTTIEXT(TNaming_UsedShapes,TDF_Attribute)
0114 
0115 protected:
0116 
0117 
0118 
0119 
0120 private:
0121 
0122   
0123   Standard_EXPORT TNaming_UsedShapes();
0124 
0125   TNaming_DataMapOfShapePtrRefShape myMap;
0126 
0127 
0128 };
0129 
0130 
0131 #include <TNaming_UsedShapes.lxx>
0132 
0133 
0134 
0135 
0136 
0137 #endif // _TNaming_UsedShapes_HeaderFile