Displays graphs in 3D.
Namespace: MindFusion.Diagramming.WinForms
Assembly: MindFusion.Diagramming.WinForms
C# Copy Code |
---|
public class DiagramView3D : DiagramView |
Visual Basic Copy Code |
---|
Public Class DiagramView3D |
Assign the Diagram that should be displayed in this view to the Diagram property.
The CameraPosition property specifies the position of the camera in 3D space. To specify the camera's pitch, roll and yaw angles, set the CameraRotation property. PointCameraTo lets you direct the camera to a specified point. The ViewerDistance property specifies the distance of the viewer from the camera.
After changing the camera position or direction, or after changing the location of graph nodes, call the ResetProjection method. It calculates the new projection coordinates of nodes and updates the view.
The following mouse and keyboard actions allow moving the camera around the 3D scene:
Set the EnableOrbitingCamera property to true to enable using the CTRL key to move the camera in an orbit around a node.
DiagramView3D uses the following coordinate system:
Look at the SpringLayout solution in the Samples folder that demonstrates how to apply a 3D SpringLayout algorithm and display a 3D view of the diagram.
DiagramView3D can also be used to edit graphs in 3D. Set the Behavior property to a value different than DoNothing to allow users select and modify existing items or draw new ones. New items are drawing in a plane in front of the camera, orthogonal to the camera direction. The distance from the camera to this plane can be specified through the CreationPlaneDistance property.
To specify a 3D position of a node, use the LayoutTraits property:
C# Copy Code |
---|
node.LayoutTraits[View3D.Position] = new Point3D(x, y, z); |
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
MindFusion.Common.WinForms.TouchControl
MindFusion.Diagramming.WinForms.DiagramView
MindFusion.Diagramming.WinForms.DiagramView3D