CFx SDK Documentation  2020SP3
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 
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 
OdDb::kXrfNotAnXref
@ kXrfNotAnXref
Definition: DbXrefGraph.h:44
OdDbXrefGraph::xrefNode
OdDbXrefGraphNode * xrefNode(const OdString &name) const
OdString
Definition: OdString.h:95
OdDbDatabase
Definition: DbDatabase.h:421
OdDbXrefGraph::xrefNode
OdDbXrefGraphNode * xrefNode(int nodeIndex) const
Definition: DbXrefGraph.h:255
name
GLuint const GLchar * name
Definition: gles2_ext.h:265
OdDbXrefGraph::markUnresolvedTrees
bool markUnresolvedTrees()
OdDbGraph::node
OdDbGraphNode * node(int nodeIndex) const
Definition: DbGraph.h:513
OdDbGraphNode::setData
void setData(void *pData)
Definition: DbGraph.h:104
OdDbObjectId
Definition: DbObjectId.h:99
OdDbXrefGraphNode::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdDbXrefGraphNode)
OdDbGraphNode::data
void * data() const
Definition: DbGraph.h:97
OdDbXrefGraphNode::isNested
bool isNested() const
Definition: DbXrefGraph.h:127
OdDbXrefGraph
Definition: DbXrefGraph.h:195
OdDbGraphNode
Definition: DbGraph.h:72
TD_PackPop.h
OdDbXrefGraph::xrefNode
OdDbXrefGraphNode * xrefNode(const OdDbDatabase *pDb) const
OdDbXrefGraph::getFrom
static void getFrom(OdDbDatabase *pDb, OdDbXrefGraph &xrefGraph, bool includeGhosts=false)
OdDb::kXrfUnreferenced
@ kXrfUnreferenced
Definition: DbXrefGraph.h:47
OdDbGraph::rootNode
OdDbGraphNode * rootNode() const
OdDbXrefGraphNodePtr
OdSmartPtr< OdDbXrefGraphNode > OdDbXrefGraphNodePtr
Definition: DbXrefGraph.h:53
OdDbXrefGraphNode::setName
void setName(const OdString &name)
Definition: DbXrefGraph.h:104
OdDbXrefGraphNode::OdDbXrefGraphNode
OdDbXrefGraphNode()
Definition: DbXrefGraph.h:77
OdString.h
OdDb::kXrfUnresolved
@ kXrfUnresolved
Definition: DbXrefGraph.h:49
OdSmartPtr
Definition: SmartPtr.h:58
OdDbXrefGraphNode::setBlockId
void setBlockId(OdDbObjectId blockId)
Definition: DbXrefGraph.h:112
OdDbXrefGraphNode::name
OdString name() const
Definition: DbXrefGraph.h:87
OdDbXrefGraphNode::xrefStatus
OdDb::XrefStatus xrefStatus() const
Definition: DbXrefGraph.h:146
DbObjectId.h
OdDbXrefGraph::~OdDbXrefGraph
virtual ~OdDbXrefGraph()
OdDbXrefGraphNode::setDatabase
void setDatabase(OdDbDatabase *pDb)
Definition: DbXrefGraph.h:120
OdDbXrefGraphNode::~OdDbXrefGraphNode
virtual ~OdDbXrefGraphNode()
DbGraph.h
TD_PackPush.h
OdDbXrefGraph::OdDbXrefGraph
OdDbXrefGraph()
Definition: DbXrefGraph.h:199
OdDbXrefGraph::xrefNode
OdDbXrefGraphNode * xrefNode(OdDbObjectId blockId) const
OdDbXrefGraphNode
Definition: DbXrefGraph.h:75
OdDbXrefGraphNode::database
OdDbDatabase * database() const
Definition: DbXrefGraph.h:97
OdDb
Definition: Db2dPolyline.h:50
OdDbXrefGraph::hostDwg
OdDbXrefGraphNode * hostDwg() const
Definition: DbXrefGraph.h:264
OdDbXrefGraphNode::blockId
OdDbObjectId blockId() const
Definition: DbXrefGraph.h:92
TOOLKIT_EXPORT
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdDbXrefGraphNode::setXrefStatus
void setXrefStatus(OdDb::XrefStatus xrefStatus)
Definition: DbXrefGraph.h:166
OdDbGraphNode::isMarkedAs
bool isMarkedAs(OdUInt8 flags) const
Definition: DbGraph.h:203
OdDb::kXrfUnloaded
@ kXrfUnloaded
Definition: DbXrefGraph.h:46
OdDb::kXrfResolved
@ kXrfResolved
Definition: DbXrefGraph.h:45
OdDb::XrefStatus
XrefStatus
Definition: DbXrefGraph.h:43
OdDbGraph
Definition: DbGraph.h:502
OdDb::kXrfFileNotFound
@ kXrfFileNotFound
Definition: DbXrefGraph.h:48