1 // Author: Kirill Gavrilov
2 // Copyright (c) 2017-2019 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #ifndef _XCAFPrs_DocumentNode_HeaderFile
16 #define _XCAFPrs_DocumentNode_HeaderFile
18 #include <XCAFPrs_Style.hxx>
20 #include <TDF_ChildIterator.hxx>
21 #include <TDF_Label.hxx>
22 #include <TopLoc_Location.hxx>
24 //! Structure defining document node.
25 struct XCAFPrs_DocumentNode
27 TCollection_AsciiString Id; //!< string identifier
28 TDF_Label Label; //!< label in the document
29 TDF_Label RefLabel; //!< reference label in the document
30 XCAFPrs_Style Style; //!< node style
31 TopLoc_Location Location; //!< node global transformation
32 TopLoc_Location LocalTrsf; //!< node transformation relative to parent
33 TDF_ChildIterator ChildIter; //!< child iterator
34 Standard_Boolean IsAssembly; //!< flag indicating that this label is assembly
36 XCAFPrs_DocumentNode() : IsAssembly (Standard_False) {}
38 public: // Methods for hash map
40 //! Return hash code based on node string identifier.
41 static Standard_Integer HashCode (const XCAFPrs_DocumentNode& theNode,
42 const Standard_Integer theN)
44 return ::HashCode (theNode.Id, theN);
47 //! Return TRUE if two document nodes has the same string identifier.
48 static Standard_Boolean IsEqual (const XCAFPrs_DocumentNode& theNode1,
49 const XCAFPrs_DocumentNode& theNode2)
51 return theNode1.Id == theNode2.Id;
56 #endif // _XCAFPrs_DocumentNode_HeaderFile