36 lines
1.5 KiB
VB.net
36 lines
1.5 KiB
VB.net
Imports EgtUILib.EgtInterface
|
|
|
|
Public Class RotateVM
|
|
Public Sub Conferma(RotateView As RotateV)
|
|
Map.refSceneButtonV.RemoveRotateUC(RotateView)
|
|
DirectCast(DirectCast(Map.refSceneButtonV.DataContext, SceneButtonVM).GetButton("Rotate"), _ToggleButton).IsChecked = False
|
|
End Sub
|
|
|
|
Public Sub Annulla(RotateView As RotateV)
|
|
Map.refSceneButtonV.RemoveRotateUC(RotateView)
|
|
DirectCast(DirectCast(Map.refSceneButtonV.DataContext, SceneButtonVM).GetButton("Rotate"), _ToggleButton).IsChecked = False
|
|
End Sub
|
|
|
|
Public Sub AngText_Changed()
|
|
If Not DirectCast(DirectCast(Map.refSceneButtonV.DataContext, SceneButtonVM).GetButton("Rotate"), _ToggleButton).IsChecked Then Return
|
|
Dim nId As Integer = Map.refSceneHostV.m_nIdPart
|
|
If nId = GDB_ID.NULL Then Return
|
|
Dim sAng As String = Map.refSceneButtonV.m_RotateUC.RotInputData.Text
|
|
If String.IsNullOrEmpty(sAng) Then Return
|
|
If Not IsNumeric(sAng) Then Return
|
|
Dim dAng As Double = CDbl(sAng)
|
|
If Map.refSceneHostV.m_dAngRot <> 0 Then
|
|
ResetRotation(False, False)
|
|
End If
|
|
Dim PartSolidIdSel = SolidManagerM.GetPartSolid(nId)
|
|
Dim vtDir As Vector3d
|
|
Dim ptStart As Point3d
|
|
If PartSolidIdSel.nIdLineAxisRotate = GDB_ID.NULL Then Return
|
|
EgtStartPoint(PartSolidIdSel.nIdLineAxisRotate, GDB_ID.ROOT, ptStart)
|
|
EgtStartVector(PartSolidIdSel.nIdLineAxisRotate, GDB_ID.ROOT, vtDir)
|
|
SolidManagerM.Rotate(nId, ptStart, vtDir, dAng)
|
|
|
|
Map.refSceneHostV.m_dAngRot = dAng
|
|
End Sub
|
|
End Class
|