CFx SDK Documentation  2023 SP0
DbXrefGraph.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 
26 
27 #ifndef _ODDBXREFGRAPH_H_INCLUDED_
28 #define _ODDBXREFGRAPH_H_INCLUDED_
29 
30 #include "TD_PackPush.h"
31 
32 #include "DbGraph.h"
33 #include "DbObjectId.h"
34 #include "OdString.h"
35 
40 namespace OdDb
41 {
43  {
44  kXrfNotAnXref = 0, // Not an Xref.
45  kXrfResolved = 1, // Resolved.
46  kXrfUnloaded = 2, // Unloaded.
47  kXrfUnreferenced = 3, // Unreferenced.
48  kXrfFileNotFound = 4, // File Not Found.
49  kXrfUnresolved = 5 // Unresolved.
50  };
51 }
52 
53 class OdDbXrefGraphNode;
58 
75 {
76 protected:
78 public:
79 
81 
82  virtual ~OdDbXrefGraphNode();
83 
87  OdString name() const { return m_sName; }
88 
92  OdDbObjectId blockId() const { return m_blockId; }
93 
97  OdDbDatabase* database() const { return (OdDbDatabase*)data(); }
98 
104  void setName(
105  const OdString& name) { m_sName = name; }
106 
113  OdDbObjectId blockId) { m_blockId = blockId; }
114 
121  OdDbDatabase* pDb) { setData(pDb); }
122 
127  bool isNested() const { return !isMarkedAs(kFirstLevel); }
128 
146  OdDb::XrefStatus xrefStatus() const { return m_status; }
147 
148 
167  OdDb::XrefStatus xrefStatus) { m_status = xrefStatus; }
168 
169 
170 private:
171  OdString m_sName;
172  OdDbObjectId m_blockId;
173  OdDb::XrefStatus m_status;
174  // OdDbDatabase* uses base class data() member
175 };
176 
177 
195 {
197  OdDbXrefGraph& operator =(const OdDbXrefGraph&);
198 public:
200  virtual ~OdDbXrefGraph();
201 
214  const OdString& name) const;
215 
228  OdDbObjectId blockId) const;
229 
242  const OdDbDatabase* pDb) const;
243 
256  int nodeIndex) const { return(OdDbXrefGraphNode*)node(nodeIndex); }
257 
264  OdDbXrefGraphNode* hostDwg() const { return(OdDbXrefGraphNode*)rootNode(); }
273 
274  // cycle detection
275 
276  // virtual bool findCycles(OdDbGraphNode* pStart = 0);
277 
288  static void getFrom(
289  OdDbDatabase* pDb,
290  OdDbXrefGraph& xrefGraph,
291  bool includeGhosts = false);
292 };
293 #include "TD_PackPop.h"
294 
295 #endif // _ODDBXREFGRAPH_H_INCLUDED_
296 
297 
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbXrefGraphNode > OdDbXrefGraphNodePtr
Definition: DbXrefGraph.h:53
bool isMarkedAs(OdUInt8 flags) const
Definition: DbGraph.h:203
void setData(void *pData)
Definition: DbGraph.h:104
void * data() const
Definition: DbGraph.h:97
OdDbXrefGraphNode * hostDwg() const
Definition: DbXrefGraph.h:264
static void getFrom(OdDbDatabase *pDb, OdDbXrefGraph &xrefGraph, bool includeGhosts=false)
virtual ~OdDbXrefGraph()
OdDbXrefGraphNode * xrefNode(OdDbObjectId blockId) const
OdDbXrefGraphNode * xrefNode(const OdDbDatabase *pDb) const
bool markUnresolvedTrees()
OdDbXrefGraphNode * xrefNode(const OdString &name) const
OdDbXrefGraphNode * xrefNode(int nodeIndex) const
Definition: DbXrefGraph.h:255
OdDb::XrefStatus xrefStatus() const
Definition: DbXrefGraph.h:146
OdDbObjectId blockId() const
Definition: DbXrefGraph.h:92
void setXrefStatus(OdDb::XrefStatus xrefStatus)
Definition: DbXrefGraph.h:166
void setDatabase(OdDbDatabase *pDb)
Definition: DbXrefGraph.h:120
void setName(const OdString &name)
Definition: DbXrefGraph.h:104
OdString name() const
Definition: DbXrefGraph.h:87
bool isNested() const
Definition: DbXrefGraph.h:127
void setBlockId(OdDbObjectId blockId)
Definition: DbXrefGraph.h:112
OdDbDatabase * database() const
Definition: DbXrefGraph.h:97
virtual ~OdDbXrefGraphNode()
ODRX_DECLARE_MEMBERS(OdDbXrefGraphNode)
GLuint const GLchar * name
Definition: gles2_ext.h:265
XrefStatus
Definition: DbXrefGraph.h:43
@ kXrfUnresolved
Definition: DbXrefGraph.h:49
@ kXrfResolved
Definition: DbXrefGraph.h:45
@ kXrfUnreferenced
Definition: DbXrefGraph.h:47
@ kXrfUnloaded
Definition: DbXrefGraph.h:46
@ kXrfFileNotFound
Definition: DbXrefGraph.h:48
@ kXrfNotAnXref
Definition: DbXrefGraph.h:44