TDataStd_TreeNode

hello
I have a Document where i save TopoDs_Shape.
Each label of my document correspond with a Shape.
I want to display the contain of the document.
I have read documentation and it 's impossible to erase a label so I have attached TreeNode attribute to each label
Now I would like to explore the document not on every labels but only label who have TreeNode attributes.
So my first question is how to connect a treeNode attribute to others.
Second question: How can i explore my document on label who have TreeNode attributes (with TDataStd_ChildNodeIterator????)
Thanks for your help.
jerome

fhchina's picture

>hello
>I have a Document where i save TopoDs_Shape.
>Each label of my document correspond with a Shape.
>I want to display the contain of the document.
>I have read documentation and it 's impossible to erase a label so I have attached TreeNode attribute to each label
>Now I would like to explore the document not on every labels but only label who have TreeNode attributes.
>So my first question is how to connect a treeNode attribute to others.

Since TDataStd_TreeNode is just a derived class of TDF_Attribute, so you call Label() to get the attached TDF_Label, and by this label to access other attached attributes.

>Second question: How can i explore my document on label who have TreeNode attributes (with TDataStd_ChildNodeIterator????)

You should store the Root TDataStd_TreeNode of your model, and then use TDataStd_TreeNode::HasNext()/Next() pair to iterate them. You can iterate them BFS or DFS.

>Thanks for your help.
>jerome

Rajendra's picture

Hi fhchina,
I am unable to initialize the TDataStd_TreeNode. I have done tree display using TDataStd_ChildNodeIterator using MFC tree control view. I would like to use TDataStd_TreeNode to make editable tree.
i am trying to initialize TDataStd_TreeNode to be root node as of myOcafDoc->Main()//Label.
If i have initilize it how could i go over other labels. After setting the label in TDataStd_TreeNode, i am unable to use label further more.
Will you please guide me on proper using of TDataStd_TreeNode?