0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation...
[occt.git] / src / TNaming / TNaming_Naming.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _TNaming_Naming_HeaderFile
18 #define _TNaming_Naming_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
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>
29 class Standard_GUID;
30 class TDF_Label;
31 class TNaming_NamedShape;
32 class TopoDS_Shape;
33 class TNaming_Name;
34 class TDF_Attribute;
35 class TDF_RelocationTable;
36 class TDF_DataSet;
37 class TDF_IDFilter;
38
39
40 class TNaming_Naming;
41 DEFINE_STANDARD_HANDLE(TNaming_Naming, TDF_Attribute)
42
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
49 {
50
51 public:
52
53   
54   //! following code from TDesignStd
55   //! ==============================
56   Standard_EXPORT static const Standard_GUID& GetID();
57   
58   Standard_EXPORT static Handle(TNaming_Naming) Insert (const TDF_Label& under);
59   
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.
69   //! instance method
70   //! ===============
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);
72   
73   Standard_EXPORT TNaming_Naming();
74   
75   Standard_EXPORT Standard_Boolean IsDefined() const;
76   
77   Standard_EXPORT const TNaming_Name& GetName() const;
78   
79   Standard_EXPORT TNaming_Name& ChangeName();
80   
81   //! regenerate only the Name associated to me
82   Standard_EXPORT Standard_Boolean Regenerate (TDF_LabelMap& scope);
83   
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);
88   
89   //! Deferred methods from TDF_Attribute
90   //! ===================================
91   Standard_EXPORT virtual const Standard_GUID& ID() const Standard_OVERRIDE;
92   
93   Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
94   
95   Standard_EXPORT void Restore (const Handle(TDF_Attribute)& With) Standard_OVERRIDE;
96   
97   Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
98   
99   Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& aDataSet) const Standard_OVERRIDE;
100   
101   Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
102   
103   Standard_EXPORT virtual void ExtendedDump (Standard_OStream& anOS, const TDF_IDFilter& aFilter, TDF_AttributeIndexedMap& aMap) const Standard_OVERRIDE;
104
105
106
107
108   DEFINE_STANDARD_RTTIEXT(TNaming_Naming,TDF_Attribute)
109
110 protected:
111
112
113
114
115 private:
116
117
118   TNaming_Name myName;
119
120
121 };
122
123
124
125
126
127
128
129 #endif // _TNaming_Naming_HeaderFile