1 // Created on: 1997-09-08
2 // Created by: Yves FRICAUD
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _TNaming_Naming_HeaderFile
18 #define _TNaming_Naming_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TNaming_Name.hxx>
24 #include <TDF_Attribute.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <TDF_LabelMap.hxx>
27 #include <Standard_OStream.hxx>
28 #include <TDF_AttributeIndexedMap.hxx>
31 class TNaming_NamedShape;
35 class TDF_RelocationTable;
41 DEFINE_STANDARD_HANDLE(TNaming_Naming, TDF_Attribute)
43 //! This attribute store the topological naming of any
44 //! selected shape, when this shape is not already
45 //! attached to a specific label. This class is also used
46 //! to solve it when the argumentsof the toipological
47 //! naming are modified.
48 class TNaming_Naming : public TDF_Attribute
54 //! following code from TDesignStd
55 //! ==============================
56 Standard_EXPORT static const Standard_GUID& GetID();
58 Standard_EXPORT static Handle(TNaming_Naming) Insert (const TDF_Label& under);
60 //! Creates a Namimg attribute at label <where> to
61 //! identify the shape <Selection>. Geometry is
62 //! Standard_True if we are only interested by the
63 //! underlying geometry (e.g. setting a
64 //! constraint). <Context> is used to find neighbours of
65 //! <S> when required by the naming.
66 //! If KeepOrientation is True the Selection orientation is taken
67 //! into account. BNproblem == True points out that Context sub-shapes
68 //! in DF have orientation differences with Context shape itself.
71 Standard_EXPORT static Handle(TNaming_NamedShape) Name (const TDF_Label& where, const TopoDS_Shape& Selection, const TopoDS_Shape& Context, const Standard_Boolean Geometry = Standard_False, const Standard_Boolean KeepOrientation = Standard_False, const Standard_Boolean BNproblem = Standard_False);
73 Standard_EXPORT TNaming_Naming();
75 Standard_EXPORT Standard_Boolean IsDefined() const;
77 Standard_EXPORT const TNaming_Name& GetName() const;
79 Standard_EXPORT TNaming_Name& ChangeName();
81 //! regenerate only the Name associated to me
82 Standard_EXPORT Standard_Boolean Regenerate (TDF_LabelMap& scope);
84 //! Regenerate recursively the whole name with scope. If
85 //! scope is empty it means that all the labels of the
86 //! framework are valid.
87 Standard_EXPORT Standard_Boolean Solve (TDF_LabelMap& scope);
89 //! Deferred methods from TDF_Attribute
90 //! ===================================
91 Standard_EXPORT virtual const Standard_GUID& ID() const Standard_OVERRIDE;
93 Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
95 Standard_EXPORT void Restore (const Handle(TDF_Attribute)& With) Standard_OVERRIDE;
97 Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
99 Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& aDataSet) const Standard_OVERRIDE;
101 Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
103 Standard_EXPORT virtual void ExtendedDump (Standard_OStream& anOS, const TDF_IDFilter& aFilter, TDF_AttributeIndexedMap& aMap) const Standard_OVERRIDE;
108 DEFINE_STANDARD_RTTIEXT(TNaming_Naming,TDF_Attribute)
129 #endif // _TNaming_Naming_HeaderFile