Author Topic: What's the GraphNodeCollection?  (Read 2012 times)

0 Members and 1 Guest are viewing this topic.

gswang

  • Newt
  • Posts: 117
What's the GraphNodeCollection?
« on: April 03, 2010, 07:31:13 PM »
GraphNodeCollection and GraphNode are what used...

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: What's the GraphNodeCollection?
« Reply #1 on: April 03, 2010, 08:45:48 PM »
A GraphNode  is a disposable wrapper of the AcDbGraphNode ObjectARX class.

A Node is part of a structure based on a Directed acyclic graph http://en.wikipedia.org/wiki/Directed_acyclic_graph
which is used to record relationships between the nodes.

This is a fairly complicated system and I'm not familiar enough with computer science to explain it fully.
Thankfully the methods and properties don't require a full knowledge of the inner workings.

Graphs are used for Dynamic blocks and xrefs.

The XrefGraph is derived from the Graph Class.
From the ARX docs for XrefGraph Class:
Quote
This .NET class wraps the AcDbXrefGraph ObjectARX class.

XrefGraph is a derived class for representing xrefs, using the XrefGraphNode class to represent one xref database at each node.
An XrefGraph is a representation of the relationship between a host drawing, its xref'ed drawings, and any nested xref drawings. Each database or xref block table record is represented by an XrefGraphNode in the graph. The host drawing is always the rootNode. Each reference (between databases) is represented by an edge in the graph, and can be queried by calling GraphNode.in(idx) for what is referencing this node, and GraphNode.out(idx) for what this node references.

While there can be more than one BlockReference referencing an xref BlockTableRecord, only one corresponding edge is created between each XrefNode.

From the XrefGraphNode Class docs :
Quote
This .NET class wraps the AcDbXrefGraphNode ObjectARX class.

XrefGraph is a derived class for representing an xref. Each XrefGraphNode represents one xref database.

An XrefGraph is a representation of the relationship between a host drawing, its xref'd drawings, and any nested xref drawings. Each database or xref BlockTableRecord is represented by an XrefGraphNode in the graph. The host drawing is always the rootNode. Each reference (between databases) is represented by an edge in the graph, and can be queried by calling GraphNode.in(idx) for what is referencing this node, and GraphNode.out(idx) for what this node references.

While there can be more than one BlockReference referencing an xref BlockTableRecord, only one corresponding edge is created between each XrefNode.

From the GraphNode Class docs :
Unfortunatly this may not help much :(
Quote
This .NET class wraps the AcDbGraphNode ObjectARX class.

This class provides a generic graph node implementation. One other class is also involved in the graph mechanism: Graph.

Detection for circular references is done by internally creating a duplicate set of references in each node, then trimming away all leaf nodes which terminate without circularity. If any nodes remain in the duplicate graph, those nodes exist in a cycle. Graph.FindCycles() is used to set up the internal cycle information and enable several query methods to return information about any cycles found.

Sorry I can't be of more help.
« Last Edit: April 03, 2010, 08:56:33 PM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: What's the GraphNodeCollection?
« Reply #3 on: April 04, 2010, 03:20:30 AM »
Hi,

This can be a graphical representation of the the difference between a graph and a tree of the same linked datas.

A has 3 nodes 'Out'
B has 1 node 'In' and 2 nodes 'Out'
C has 3 nodes 'In'
« Last Edit: April 04, 2010, 04:46:25 AM by gile »
Speaking English as a French Frog

gswang

  • Newt
  • Posts: 117
Re: What's the GraphNodeCollection?
« Reply #4 on: April 04, 2010, 05:07:53 AM »
Thank you everyone! now i have a basic understanding of the Graph. :-P