Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:18:11

0001 // Created on: 1997-09-08
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_Naming_HeaderFile
0018 #define _TNaming_Naming_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TNaming_Name.hxx>
0024 #include <TDF_Attribute.hxx>
0025 #include <TDF_Label.hxx>
0026 #include <NCollection_Map.hxx>
0027 #include <Standard_OStream.hxx>
0028 #include <NCollection_IndexedMap.hxx>
0029 
0030 class TDF_Attribute;
0031 class Standard_GUID;
0032 class TDF_Label;
0033 class TNaming_NamedShape;
0034 class TopoDS_Shape;
0035 class TDF_RelocationTable;
0036 class TDF_DataSet;
0037 class TDF_IDFilter;
0038 
0039 //! This attribute store the topological naming of any
0040 //! selected shape, when this shape is not already
0041 //! attached to a specific label. This class is also used
0042 //! to solve it when the arguments of the topological
0043 //! naming are modified.
0044 class TNaming_Naming : public TDF_Attribute
0045 {
0046 
0047 public:
0048   //! following code from TDesignStd
0049   //! ==============================
0050   Standard_EXPORT static const Standard_GUID& GetID();
0051 
0052   Standard_EXPORT static occ::handle<TNaming_Naming> Insert(const TDF_Label& under);
0053 
0054   //! Creates a Naming attribute at label <where> to identify
0055   //! the shape <Selection>. Geometry is true if we
0056   //! are only interested by the underlying geometry (e.g.
0057   //! setting a constraint).
0058   //! <Context> is used to find neighbours of <S> when required
0059   //! by the naming. If KeepOrientation is True the Selection
0060   //! orientation is taken into account.
0061   //! BNproblem == True points out that Context sub-shapes in
0062   //! DF have orientation differences with Context shape itself.
0063 
0064   //! instance method
0065   //! ===============
0066   Standard_EXPORT static occ::handle<TNaming_NamedShape> Name(const TDF_Label&    where,
0067                                                               const TopoDS_Shape& Selection,
0068                                                               const TopoDS_Shape& Context,
0069                                                               const bool          Geometry = false,
0070                                                               const bool KeepOrientation   = false,
0071                                                               const bool BNproblem         = false);
0072 
0073   Standard_EXPORT TNaming_Naming();
0074 
0075   Standard_EXPORT bool IsDefined() const;
0076 
0077   Standard_EXPORT const TNaming_Name& GetName() const;
0078 
0079   Standard_EXPORT TNaming_Name& ChangeName();
0080 
0081   //! regenerate only the Name associated to me
0082   Standard_EXPORT bool Regenerate(NCollection_Map<TDF_Label>& scope);
0083 
0084   //! Regenerate recursively the whole name with scope. If
0085   //! scope is empty it means that all the labels of the
0086   //! framework are valid.
0087   Standard_EXPORT bool Solve(NCollection_Map<TDF_Label>& scope);
0088 
0089   //! Deferred methods from TDF_Attribute
0090   //! ===================================
0091   Standard_EXPORT const Standard_GUID& ID() const override;
0092 
0093   Standard_EXPORT occ::handle<TDF_Attribute> NewEmpty() const override;
0094 
0095   Standard_EXPORT void Restore(const occ::handle<TDF_Attribute>& With) override;
0096 
0097   Standard_EXPORT void Paste(const occ::handle<TDF_Attribute>&       Into,
0098                              const occ::handle<TDF_RelocationTable>& RT) const override;
0099 
0100   Standard_EXPORT void References(const occ::handle<TDF_DataSet>& aDataSet) const override;
0101 
0102   Standard_EXPORT Standard_OStream& Dump(Standard_OStream& anOS) const override;
0103 
0104   Standard_EXPORT void ExtendedDump(
0105     Standard_OStream&                                   anOS,
0106     const TDF_IDFilter&                                 aFilter,
0107     NCollection_IndexedMap<occ::handle<TDF_Attribute>>& aMap) const override;
0108 
0109   //! Dumps the content of me into the stream
0110   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override;
0111 
0112   DEFINE_STANDARD_RTTIEXT(TNaming_Naming, TDF_Attribute)
0113 
0114 private:
0115   TNaming_Name myName;
0116 };
0117 
0118 #endif // _TNaming_Naming_HeaderFile