Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) DiagramView3D: Issues (Read 9466 times)
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramView3D: Issues
Reply #15 - Jul 30th, 2009 at 1:14pm
Print Post  
You can find updated version on the PM page. Now there is a DiagramView3D.GetProjectionRect(DiagramNode) method you can use to find out the client area coordinates of the node projection. You could use it for hit-testing from the view3d' mouse events, or to custom-draw from the Paint event handler:

Code
Select All
private void diagramView3D_Paint(object sender, PaintEventArgs e)
{
	if (diagram.Nodes.Count > 0)
	{
		DiagramNode node = diagram.Nodes[0];
		Rectangle projRect = diagramView3D.GetProjectionRect(node);
		if (!projRect.IsEmpty)
		{
			e.Graphics.ResetTransform();
			e.Graphics.PageUnit = GraphicsUnit.Pixel;
			e.Graphics.DrawRectangle(Pens.Red, projRect);
		}
	}
}
 



You don't need this method if custom-drawing from a DrawNode event handler; in that case the Graphics object has such transforms applied to it that e.Node.Bounds corresponds to the projection rect inside the 3D view.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint