Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-15 08:30:43

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_LabelMap.hxx>
0026 #include <Standard_OStream.hxx>
0027 #include <TDF_AttributeIndexedMap.hxx>
0028 class Standard_GUID;
0029 class TDF_Label;
0030 class TNaming_NamedShape;
0031 class TopoDS_Shape;
0032 class TDF_RelocationTable;
0033 class TDF_DataSet;
0034 class TDF_IDFilter;
0035 
0036 class TNaming_Naming;
0037 DEFINE_STANDARD_HANDLE(TNaming_Naming, TDF_Attribute)
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 argumentsof the  toipological
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 Handle(TNaming_Naming) Insert(const TDF_Label& under);
0053 
0054   //! Creates  a   Namimg  attribute  at  label <where>   to
0055   //! identify  the   shape   <Selection>.    Geometry is
0056   //! Standard_True  if   we  are  only  interested  by  the
0057   //! underlying   geometry     (e.g.     setting   a
0058   //! constraint). <Context> is  used to find neighbours  of
0059   //! <S> when required by the naming.
0060   //! If KeepOrientation is True the Selection orientation is taken
0061   //! into  account. BNproblem == True points out that Context sub-shapes
0062   //! in  DF have orientation differences with Context shape itself.
0063   //! instance method
0064   //! ===============
0065   Standard_EXPORT static Handle(TNaming_NamedShape) Name(
0066     const TDF_Label&       where,
0067     const TopoDS_Shape&    Selection,
0068     const TopoDS_Shape&    Context,
0069     const Standard_Boolean Geometry        = Standard_False,
0070     const Standard_Boolean KeepOrientation = Standard_False,
0071     const Standard_Boolean BNproblem       = Standard_False);
0072 
0073   Standard_EXPORT TNaming_Naming();
0074 
0075   Standard_EXPORT Standard_Boolean 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 Standard_Boolean Regenerate(TDF_LabelMap& 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 Standard_Boolean Solve(TDF_LabelMap& scope);
0088 
0089   //! Deferred methods from TDF_Attribute
0090   //! ===================================
0091   Standard_EXPORT virtual const Standard_GUID& ID() const Standard_OVERRIDE;
0092 
0093   Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
0094 
0095   Standard_EXPORT void Restore(const Handle(TDF_Attribute)& With) Standard_OVERRIDE;
0096 
0097   Standard_EXPORT void Paste(const Handle(TDF_Attribute)&       Into,
0098                              const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
0099 
0100   Standard_EXPORT virtual void References(const Handle(TDF_DataSet)& aDataSet) const
0101     Standard_OVERRIDE;
0102 
0103   Standard_EXPORT virtual Standard_OStream& Dump(Standard_OStream& anOS) const Standard_OVERRIDE;
0104 
0105   Standard_EXPORT virtual void ExtendedDump(Standard_OStream&        anOS,
0106                                             const TDF_IDFilter&      aFilter,
0107                                             TDF_AttributeIndexedMap& aMap) const Standard_OVERRIDE;
0108 
0109   //! Dumps the content of me into the stream
0110   Standard_EXPORT void DumpJson(Standard_OStream& theOStream,
0111                                 Standard_Integer  theDepth = -1) const Standard_OVERRIDE;
0112 
0113   DEFINE_STANDARD_RTTIEXT(TNaming_Naming, TDF_Attribute)
0114 
0115 protected:
0116 private:
0117   TNaming_Name myName;
0118 };
0119 
0120 #endif // _TNaming_Naming_HeaderFile