Search
DiagramView3D Class
Remarks See Also
 





Displays graphs in 3D.

Namespace: MindFusion.Diagramming.WinForms
Assembly: MindFusion.Diagramming.WinForms

 Syntax

C#  Copy Code

public class DiagramView3D : DiagramView

Visual Basic  Copy Code

Public Class DiagramView3D
    Inherits DiagramView

 Remarks

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:

  • Mouse drag: Moves the camera across the plane perpendicular to direction of the camera.
  • CTRL+mouse drag: Rotate the camera by changing the pitch and yaw angles.
  • Mouse wheel: Causes moving the camera forwards or backwards.
  • CTRL+mouse wheel: Rolls the camera around the Z-axis.

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:

  • The X axis is horizontal and points to the right.
  • The Y axis is vertical and points upwards.
  • The Z axis specifies depth and its values grow with distance.

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.

 Example

To specify a 3D position of a node, use the LayoutTraits property:

C#  Copy Code

node.LayoutTraits[View3D.Position] = new Point3D(x, y, z);
diagView3D.ResetProjection();

 Inheritance Hierarchy

System.Object
    System.MarshalByRefObject
        System.ComponentModel.Component
            System.Windows.Forms.Control
                MindFusion.Common.WinForms.TouchControl
                    MindFusion.Diagramming.WinForms.DiagramView
                        MindFusion.Diagramming.WinForms.DiagramView3D

 See Also