Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) DiagramView3D: Issues (Read 9473 times)
Aziz ur Rahman
YaBB Newbies
*
Offline



Posts: 43
Joined: Feb 23rd, 2009
DiagramView3D: Issues
Jun 20th, 2009 at 8:35am
Print Post  
I have a simple problem. I am using DiagramView3d and trying to set a particular node and its links to invisible. The node is getting invisible but not the links.

Can you please point out whan i am missing. Below is a sample code. I am using a simple form with a Diagramview3d attached to a Diagram and a button.

[code]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

node = diagram.Factory.CreateShapeNode(0, 0, 10, 10)

node.Shape = Shapes.Ellipse

node.Text = "asasdf"


Dim node2 As ShapeNode = diagram.Factory.CreateShapeNode(50, 10, 10, 10)

node2.Shape = Shapes.Ellipse

node2.Text = "qwer"


Dim node3 As ShapeNode = diagram.Factory.CreateShapeNode(100, 20, 10, 10)

node2.Shape = Shapes.Ellipse

node2.Text = "zxcv"


Dim link12 As DiagramLink = diagram.Factory.CreateDiagramLink(node, node2)

Dim link23 As DiagramLink = diagram.Factory.CreateDiagramLink(node3, node2)

view3D.ResetProjection()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

node.Visible = Not node.Visible

For Each link As DiagramLink In node.IncomingLinks


link.Visible = node.Visible

Next

For Each link As DiagramLink In node.OutgoingLinks


link.Visible = node.Visible

Next

view3D.ResetProjection()
End Sub[/code]
« Last Edit: Jun 20th, 2009 at 3:14pm by Aziz ur Rahman »  

Syed Aziz ur Rahman
Back to top
 
IP Logged
 
Aziz ur Rahman
YaBB Newbies
*
Offline



Posts: 43
Joined: Feb 23rd, 2009
Re: DiagramView3D: Link not gettiing invisible
Reply #1 - Jun 20th, 2009 at 10:06am
Print Post  
One more issue: I am setting the headshape of the link but it is not coming in the view3d.
  

Syed Aziz ur Rahman
Back to top
 
IP Logged
 
Aziz ur Rahman
YaBB Newbies
*
Offline



Posts: 43
Joined: Feb 23rd, 2009
Re: DiagramView3D: Link not gettiing invisible
Reply #2 - Jun 20th, 2009 at 1:48pm
Print Post  
3) Is there any method in View3D like "ZoomToFit" that exist in simple view.

Can we emulate such function? A sample code would be of great help


4) I have the background image property for both view3d and the corresponding diagram but it is not appearing. (It works for diagramview2D).

Can you please help.
« Last Edit: Jun 20th, 2009 at 3:15pm by Aziz ur Rahman »  

Syed Aziz ur Rahman
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramView3D: Issues
Reply #3 - Jun 22nd, 2009 at 5:44am
Print Post  
We are now releasing a version where link.Visible works correctly. We'll try to implement 2)-4) for the next release.

Stoyan
  
Back to top
 
IP Logged
 
Aziz ur Rahman
YaBB Newbies
*
Offline



Posts: 43
Joined: Feb 23rd, 2009
Re: DiagramView3D: Issues
Reply #4 - Jun 22nd, 2009 at 10:32am
Print Post  
5)  A suggestion: Can we have an option to show the axis (x, y, z) in the view. We want to show the user the location of the node in the xyz plane.

Can we do this in the current version some how? any hack?
  

Syed Aziz ur Rahman
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramView3D: Issues
Reply #5 - Jun 22nd, 2009 at 12:06pm
Print Post  
I'll add this to our to-do list for the next release. As a hack, you might create transparent nodes showing 0, X, Y, Z as text, place them somewhere along the axes, and create links 0->X, 0->Y, 0->Z.

Stoyan
  
Back to top
 
IP Logged
 
Aziz ur Rahman
YaBB Newbies
*
Offline



Posts: 43
Joined: Feb 23rd, 2009
Re: DiagramView3D: Issues
Reply #6 - Jun 23rd, 2009 at 11:14am
Print Post  
I have used your idea to create the xyz plane and it is looking good.

Now on a click of a button ,i want to emulate the plane is moving
1) around x axis, y axis, z axis.
2) clock wise and anticlockwise.

I tried to use the cameraRotation property of the view3D but it is not working well. The whole plane just move away and comee back .I was unable to find any help in the documentation as well.

view.CameraRotation = New Point3D(view.CameraRotation .X + 5, view.CameraRotation .Y, view.CameraRotation .Z)

Can u post a example or some sample code.
  

Syed Aziz ur Rahman
Back to top
 
IP Logged
 
Aziz ur Rahman
YaBB Newbies
*
Offline



Posts: 43
Joined: Feb 23rd, 2009
Re: DiagramView3D: Issues
Reply #7 - Jun 23rd, 2009 at 11:55am
Print Post  
I am trying to use simple rotation algebra.

[code]With view.CameraPosition
Dim angleInPie As Double = _CurrentAngle * (Math.PI / 180)
Dim sinOfAngle As Double = Math.Sin(angleInPie)
Dim cosOfAngle As Double = Math.Cos(angleInPie)

Dim nextX As Single = .X * cosOfAngle - .Y * sinOfAngle
Dim nextY As Single = .X * sinOfAngle + .Y * cosOfAngle
Dim nextZ As Single = .Z

view.CameraPosition = New Point3D(nextX, nextY, nextZ)
_CurrentAngle += 1
If _CurrentAngle > 360 Then

_CurrentAngle = 0
End If
End With
[/code]
  

Syed Aziz ur Rahman
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramView3D: Issues
Reply #8 - Jun 23rd, 2009 at 1:25pm
Print Post  
Do you mean you need to rotate the camera around one of the axes?
  
Back to top
 
IP Logged
 
Aziz ur Rahman
YaBB Newbies
*
Offline



Posts: 43
Joined: Feb 23rd, 2009
Re: DiagramView3D: Issues
Reply #9 - Jun 23rd, 2009 at 1:32pm
Print Post  
Ah .. I finally figure out how to use the view.CameraRotatoin property. using the yaw, pitch and roll angles.

Problem is solved.

One other issue.  I have no control on the sprint layout model (I am using the same code provided in model.  I am adding all my nodes at point 0,0 and then start the timer for arrangement.

Right now the layout will move the nodes very far from the origin. I want all the nodes to be around the origin node.

How to do it.?
  

Syed Aziz ur Rahman
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramView3D: Issues
Reply #10 - Jun 23rd, 2009 at 3:18pm
Print Post  
Set the nodes initial positions to be some random points in a cube around the origin. Otherwise SpringLayout disperses the overlapping nodes to disentangle the graph faster, but if using animation it might take some time until they come near to each other again.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Aziz ur Rahman
YaBB Newbies
*
Offline



Posts: 43
Joined: Feb 23rd, 2009
Re: DiagramView3D: Issues
Reply #11 - Jul 18th, 2009 at 2:14pm
Print Post  
I have tried setting up the nodes with three random nos ranges from 1 to 100. The nodes are spreaded reasonably but strangely the sprint layout did not work on them now perfrectly.

It seems that the spring layout algo tried to maintain the current position of the node.

If i add all the nodes at 0,0,0 .. the spring layout will work fine and perform operation perfectly.


There is one other problem.
I have added on node as Point3D( 0,0,0). How do i get the screen coordinates of it in terms of x and y.
I tried pointTo methods and docTo methods but they are really helpful.

Can you please point out some methods. The node is in a diagramView3d which is inside a user Control which is inside the main form.


  

Syed Aziz ur Rahman
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramView3D: Issues
Reply #12 - Jul 20th, 2009 at 10:47am
Print Post  
We have added a PointToClient method that can be used as shown below. You can find the updated version on the PM page.

Code
Select All
Point3D point = new Point3D(50, 20, 10);
ShapeNode node = diagram.Factory.CreateShapeNode(0, 0, 30, 20);
node.LayoutTraits[View3D.Position] = point;
node.Text = "50, 20, 10";
diagramView3D.ResetProjection();

Point clientPoint = diagramView3D.PointToClient(point);
ContextMenu menu = new ContextMenu();
menu.MenuItems.Add(new MenuItem("test"));
menu.Show(diagramView3D, clientPoint);
 



The method returns the pixel coordinates relative to the client area of the view. You can use the WinForms PointToScreen method to get the screen coordinates.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Aziz ur Rahman
YaBB Newbies
*
Offline



Posts: 43
Joined: Feb 23rd, 2009
Re: DiagramView3D: Issues
Reply #13 - Jul 28th, 2009 at 12:35pm
Print Post  
Dear Stoyo,
First thanks for updating the code and providing it in short time.

I required one thing. As you have provided a 2D location of a node which is actually in 3D. Can you provide the bounds of the node.

I have tried node.bounds.size but it is only useful in 2D not in 3D because depending upon the camera position the size of the node increases. So the question is

How can i get the size of the node which is in 3D?

Thanks in Advance.
  

Syed Aziz ur Rahman
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramView3D: Issues
Reply #14 - Jul 29th, 2009 at 8:45am
Print Post  
We'll add some method that returns the projection rect. Should be ready by tomorrow.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint