Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1997-07-31
0002 // Created by: Denis PASCAL
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 _TDataStd_Name_HeaderFile
0018 #define _TDataStd_Name_HeaderFile
0019 
0020 #include <TDataStd_GenericExtString.hxx>
0021 #include <Standard_OStream.hxx>
0022 
0023 class TDF_Label;
0024 class TCollection_ExtendedString;
0025 
0026 
0027 class TDataStd_Name;
0028 DEFINE_STANDARD_HANDLE(TDataStd_Name, TDataStd_GenericExtString)
0029 
0030 //! Used to define a name attribute containing a string which specifies the name.
0031 class TDataStd_Name : public TDataStd_GenericExtString
0032 {
0033 
0034 public:
0035   
0036   //! class methods working on the name itself
0037   //! ========================================
0038   //! Returns the GUID for name attributes.
0039   Standard_EXPORT static const Standard_GUID& GetID();
0040   
0041   //! Creates (if does not exist) and sets the name in the name attribute.
0042   //! from any label <L>  search in father  labels (L is not
0043   //! concerned) the first name attribute.if found set it in
0044   //! <father>.
0045   //! class methods working on the name tree
0046   //! ======================================
0047   //! Search in the  whole TDF_Data the Name attribute which
0048   //! fit with <fullPath>. Returns True if found.
0049   //! Search  under <currentLabel>  a  label which fit with
0050   //! <name>. Returns True if  found. Shortcut which  avoids
0051   //! building a ListOfExtendedStrin.
0052   //! Search in the whole TDF_Data the label which fit with name
0053   //! Returns True if found.
0054   //! tools methods to translate path <-> pathlist
0055   //! ===========================================
0056   //! move to draw For Draw test we may provide this tool method which convert a path in a
0057   //! sequence of string to call after the FindLabel methods.
0058   //! Example: if it's given "Assembly:Part_1:Sketch_5" it will return in <pathlist>
0059   //! the list of 3 strings: "Assembly","Part_1","Sketch_5".
0060   //! move to draw from <pathlist> build the string path
0061   //! Name methods
0062   //! ============
0063   Standard_EXPORT static Handle(TDataStd_Name) Set (const TDF_Label& label, const TCollection_ExtendedString& string);
0064 
0065   //! Finds, or creates, a Name attribute with explicit user defined <guid> and sets <string>.
0066   //! The Name attribute  is  returned. 
0067   Standard_EXPORT static Handle(TDataStd_Name) Set (const TDF_Label& label, const Standard_GUID& guid,
0068                                 const TCollection_ExtendedString& string);
0069 
0070   Standard_EXPORT TDataStd_Name();
0071   
0072   //! Sets <S> as name. Raises if <S> is not a valid name.
0073   Standard_EXPORT void Set (const TCollection_ExtendedString& S) Standard_OVERRIDE;
0074   
0075   //! Sets the explicit user defined GUID  to the attribute.
0076   Standard_EXPORT void SetID (const Standard_GUID& guid) Standard_OVERRIDE;
0077 
0078   //! Sets default GUID for the attribute.
0079   Standard_EXPORT void SetID() Standard_OVERRIDE;
0080 
0081   Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
0082   
0083 
0084   DEFINE_DERIVED_ATTRIBUTE(TDataStd_Name, TDataStd_GenericExtString)
0085 
0086 };
0087 
0088 
0089 
0090 
0091 
0092 
0093 
0094 #endif // _TDataStd_Name_HeaderFile