Rotatable Interface

Hi Jake are Nwoods going to implement Rotation of objects (like Visio) at some stage? if yes is there a timeline?

in the mean time is there a rotation helper that I can implement over my goobjects?

Thanks Thunis

You can rotate GoDrawing objects in GoDiagram.

GoDrawing f = new GoDrawing(GoFigure.Spade);
f.Angle = 30;

And the downloadable sample in this forum entry has a rotatable text object and shows some rotation UI:

(see Need to build a Theater seating diagram)

But, in general, GoDiagram doesn’t have rotatable nodes. And it’s unlikely to ever get them. But the good news is that both GoXam and GoJS do.

is there a compare document between GoXml and Goview incase I want to convert to GoXml?

Not really. there are some discussions here in the forum. GoXam was really designed to fit hand-in-glove with the XAML environment, so it’s really very different than GoDiagram. At the same time, it’s clear that the two were designed by the same company.

And, with templated definitions, data binding, etc, it really is a more powerful environment.

The same is also true for GoJS… all the things we’ve learned in 20 years of doing diagram packages, but made to fit seamlessly with the environment.

thanks for the response Jake due to time constrains I would like to stay on GoDiagram for the time being. The TheaterSeater code work for me except for the resize, I need I bit of guidance on the resize side:
RotateHelper.DoResize(this, this.Angle, view, origRect, newPoint, whichHandle, evttype, min, max);

I added a RotatableText object to the diagram and are trying to resize it, how does the resize handles directions affect the resize of the object. the handles are pointing all in the wrong direction if I rotate the text and try to resize it.

Hi Jake - I implemented the RotationHelper class and it work wonderfull and I am starting to work on the linklines , Question: if I rotate a group with a port the Linkline stay behind until the group is moved, what property or function can I use in the derived Goport class to recalc the link line?

Well, I’ve never done this before, so I’m guessing to some extent here.

I think you need to override GoPort.GetFromLinkPoint and GetToLinkPoint and make them smarter about the rotated position of the port.

Ok - I will deal with he port, how do I get my hand on the GoLink from the GoPort that is being rotated? I want the GoLink to recalculate its position while I rotate the GoObject.

Hi Jake -Ignore the last request I solved it in the following

Public Sub Rotate(RotationPoint As PointF, Angle As Single) Implements IRotatable.Rotate
If Angle = 0 Then Return
Dim init As Boolean = Me.Initializing
Me.Initializing = True 'Suspend layout childen
For Each Child As GoObject In Me
If TypeOf Child Is IGoLink Then Continue For
Dim c As IRotatable = CType(Child, IRotatable)
If c Is Nothing Then Continue For
'If autorotates is false then leave the text in place
Dim turn As Boolean = False
Dim rotatabletext As DGMText = Nothing
If TypeOf Child Is DGMText Then
rotatabletext = CType(Child, DGMText)
End If

If Not rotatabletext Is Nothing Then
turn = rotatabletext.AutoRotates
turn = True
End If

If turn = True Then
c.Rotate(RotationPoint, Angle)
Dim p As PointF = RotationHelper.RotatePoint(Child.Center, RotationPoint, Angle)
Child.Center = p
End If
If TypeOf Child Is DGMPort Then
Dim op As DGMPort = Child
End If

Me.Initializing = init
setAngle(Me.Angle + Angle)
End Sub

And in my GoPort class

Public Sub MoveLinks()
For Each o As IGoLink In Me.DestinationLinks
Dim ol As DGMLink = o
For Each o As IGoLink In Me.SourceLinks

Dim ol As GoLink = o
End Sub

Thanks Thunis

Looks good to me.