亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mylinecollection.cls

?? vb實現最短路徑Dijkstra算法
?? CLS
字號:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "myLineCollection"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Collection" ,"cLine"
Attribute VB_Ext_KEY = "Member0" ,"cLine"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'  ==========================================
'  Dijkstra's algorithm to find Shortest Path
'  ==========================================
'
' E.W. Dijkstra is a Dutch professor in Computer
' Science, who did a lot of research in graphs.
'
' Dijkstra's algorithm is of use when working with
' directional graphs. It constructs the shortest path
' between a starting-node and a goal-node.
' It is assumed that every link between two nodes
' has a certain cost, and this algorithm finds the
' path between the two given nodes with the lowest cost.
'
' The idea of this VB project was to show the
' work of this algorithm in a visual way.
'
'    Screen-shot: dijkstra.gif
'
'
'    Visit my Homepage:
'    http://www.geocities.com/emu8086/vb/
'
'
'    Last Update: Saturday, July 20, 2002
'
'
'    Copyright 2002 Alexander Popov Emulation Soft.
'               All rights reserved.
'        http://www.geocities.com/emu8086/


Option Explicit

'local variable to hold collection
Private mCol As Collection

'To fire this event, use RaiseEvent with the following syntax:
'RaiseEvent linkError[(arg1, arg2, ... , argn)]
Public Event linkError(sERROR As String)

Public Sub AddCaptionToLine(sFrom As String, sTo As String, sCaption As String)
    Dim xL As cLine
    
    For Each xL In Me
         
        If ((xL.sFrom = sFrom) And (xL.sTo = sTo)) _
         Or ((xL.sTo = sFrom) And (xL.sFrom = sTo)) Then
            xL.sCaption = sCaption
            
            Form1.lblLineCap(xL.theObjectLine.index).Left = xL.theObjectLine.X1 + (xL.theObjectLine.X2 - xL.theObjectLine.X1) / 2 - Form1.lblLineCap(xL.theObjectLine.index).Width / 2
            Form1.lblLineCap(xL.theObjectLine.index).Top = xL.theObjectLine.Y1 + (xL.theObjectLine.Y2 - xL.theObjectLine.Y1) / 2 - Form1.lblLineCap(xL.theObjectLine.index).Height
        End If
        
    Next xL
    
End Sub

Public Function AddLine(sFrom As String, sTo As String, bShowArrow As Boolean, Optional sKey As String) As cLine

    If sFrom = "" Or sTo = "" Then
        RaiseEvent linkError("Cannot make a link!!!!")
        Exit Function
    End If
    

    'create a new object
    Dim objNewMember As cLine
    Set objNewMember = New cLine


    'set the properties passed into the method
    objNewMember.sFrom = sFrom
    objNewMember.sTo = sTo
    objNewMember.bShowArrow = bShowArrow
    ' objNewMember.sCaption = "" ' not intitialized yet.
    If Len(sKey) = 0 Then
        mCol.Add objNewMember
    Else
        mCol.Add objNewMember, sKey
    End If

    ' make connection


    MAX_LINE = MAX_LINE + 1
    Load Form1.ln(MAX_LINE)
    ' one arrow for each line:
    Load Form1.aDot(MAX_LINE)
    Load Form1.arrUp(MAX_LINE)
    Load Form1.arrDown(MAX_LINE)
    ' one caption for each line/arrow:
    Load Form1.lblLineCap(MAX_LINE)
    
    Set objNewMember.theObjectLine = Form1.ln(MAX_LINE)

    Dim iFrom As Integer
    Dim iTo As Integer

    iFrom = Form1.theBlockCollection.getIndexFromTag(sFrom)
    iTo = Form1.theBlockCollection.getIndexFromTag(sTo)
    
    With objNewMember.theObjectLine
        .Visible = True
        .X1 = Form1.shp(iFrom).Left + (Form1.shp(iFrom).Width / 2)
        .Y1 = Form1.shp(iFrom).Top + (Form1.shp(iFrom).Height / 2)
        .X2 = Form1.shp(iTo).Left + (Form1.shp(iTo).Width / 2)
        .Y2 = Form1.shp(iTo).Top + (Form1.shp(iTo).Height / 2)
    End With

    If objNewMember.bShowArrow Then
        Me.showArrow objNewMember.theObjectLine, sTo
    End If
    
    Form1.lblLineCap(MAX_LINE).Caption = ""
    Form1.lblLineCap(MAX_LINE).Left = objNewMember.theObjectLine.X1 + (objNewMember.theObjectLine.X2 - objNewMember.theObjectLine.X1) / 2 - Form1.lblLineCap(MAX_LINE).Width / 2
    Form1.lblLineCap(MAX_LINE).Top = objNewMember.theObjectLine.Y1 + (objNewMember.theObjectLine.Y2 - objNewMember.theObjectLine.Y1) / 2 - Form1.lblLineCap(MAX_LINE).Height
    Form1.lblLineCap(MAX_LINE).Visible = True
    Form1.lblLineCap(MAX_LINE).ZOrder 0
    
    'return the object created
    Set AddLine = objNewMember
    Set objNewMember = Nothing

End Function

Public Property Get Item(vntIndexKey As Variant) As cLine
Attribute Item.VB_UserMemId = 0
    'used when referencing an element in the collection
    'vntIndexKey contains either the Index or Key to the collection,
    'this is why it is declared as a Variant
    'Syntax: Set foo = x.Item(xyz) or Set foo = x.Item(5)
  Set Item = mCol(vntIndexKey)
End Property



Public Property Get Count() As Long
    'used when retrieving the number of elements in the
    'collection. Syntax: Debug.Print x.Count
    Count = mCol.Count
End Property


Public Sub Remove(vntIndexKey As Variant)
    'used when removing an element from the collection
    'vntIndexKey contains either the Index or Key, which is why
    'it is declared as a Variant
    'Syntax: x.Remove(xyz)


    mCol.Remove vntIndexKey
End Sub


Public Property Get NewEnum() As IUnknown
Attribute NewEnum.VB_UserMemId = -4
Attribute NewEnum.VB_MemberFlags = "40"
    'this property allows you to enumerate
    'this collection with the For...Each syntax
    Set NewEnum = mCol.[_NewEnum]
End Property


Private Sub Class_Initialize()
    'creates the collection when this class is created
    Set mCol = New Collection
End Sub


Private Sub Class_Terminate()
    'destroys collection when this class is terminated
    Set mCol = Nothing
End Sub



Public Sub deleteLine(xFrom As Integer, xTo As Integer)

    If xFrom = -1 Or xTo = -1 Then
        RaiseEvent linkError("Cannot delete a line!!!!")
        Exit Sub
    End If

    Dim i As Integer
    
    Dim sNameFrom As String
    Dim sNameTo As String
    
    Dim lineIndex As Integer
    
    sNameFrom = Form1.shp(xFrom).Tag
    sNameTo = Form1.shp(xTo).Tag
    
    For i = Me.Count To 1 Step -1
    
        If ((Me(i).sFrom = sNameFrom) And (Me(i).sTo = sNameTo)) Or _
           ((Me(i).sFrom = sNameTo) And (Me(i).sTo = sNameFrom)) Then
            
            Me(i).theObjectLine.Visible = False
            Me(i).sFrom = ""
            Me(i).sTo = ""
            
            lineIndex = Me(i).theObjectLine.index
            Form1.aDot(lineIndex).Visible = False
            Form1.arrUp(lineIndex).Visible = False
            Form1.arrDown(lineIndex).Visible = False
            Form1.lblLineCap(lineIndex).Visible = False
            
            Me.Remove i    ' actual delete (won't be loaded on next load).
            
        End If

    Next i

End Sub




Public Sub updateLines()

    Dim xL As cLine
    
    Dim iFrom As Integer
    Dim iTo As Integer
    
    Dim lineIndex As Integer

    For Each xL In Me 'Form1.theLineCollection

        With Form1.theBlockCollection
            iFrom = .getIndexFromTag(xL.sFrom)
            iTo = .getIndexFromTag(xL.sTo)
        End With
        
        With xL.theObjectLine
            .X1 = Form1.shp(iFrom).Left + (Form1.shp(iFrom).Width / 2)
            .Y1 = Form1.shp(iFrom).Top + (Form1.shp(iFrom).Height / 2)
            .X2 = Form1.shp(iTo).Left + (Form1.shp(iTo).Width / 2)
            .Y2 = Form1.shp(iTo).Top + (Form1.shp(iTo).Height / 2)
            
            lineIndex = .index
    
            Form1.lblLineCap(lineIndex).Left = .X1 + (.X2 - .X1) / 2 - Form1.lblLineCap(lineIndex).Width / 2
            Form1.lblLineCap(lineIndex).Top = .Y1 + (.Y2 - .Y1) / 2 - Form1.lblLineCap(lineIndex).Height
                        
        End With
        

        If xL.bShowArrow Then
            Me.showArrow xL.theObjectLine, xL.sTo
        End If
        
    Next xL
    
End Sub

Private Function getCollectionIndex_from_objectIndex(lineIndex As Integer) As Integer
    Dim i As Integer
    
    For i = 1 To Me.Count
        If Me(i).theObjectLine.index = lineIndex Then
            getCollectionIndex_from_objectIndex = i
            Exit Function
        End If
    Next i
    
    getCollectionIndex_from_objectIndex = -1 ' not found!
    
End Function

Public Sub showArrow(lineObj As Line, arrowTo As String)

    Dim mSin As Double
    Dim mCos As Double
    Dim pril As Double
    Dim prot As Double
    Dim gip As Double
    
    Dim arINDEX As Integer
    
    arINDEX = lineObj.index
    
    pril = (lineObj.X1 - lineObj.X2)
    prot = (lineObj.Y1 - lineObj.Y2)
    
    gip = Sqr(pril ^ 2 + prot ^ 2)
    
    mSin = prot / gip
    mCos = pril / gip
    
    'Form1.Text1.Text = "sin: " & mSin & " cos:" & mCos
    
    Dim iXRadius As Double
    Dim iYRadius As Double
    Dim iXcor As Double
    Dim iYcor As Double
    iXRadius = Form1.theBlockCollection(arrowTo).shapeWidth / 2 + Form1.aDot(arINDEX).Width / 2
    iYRadius = Form1.theBlockCollection(arrowTo).shapeHeight / 2 + Form1.aDot(arINDEX).Height / 2
     
    ' Debug.Print iXRadius, iYRadius
     
    iXcor = Form1.theBlockCollection(arrowTo).shapeLeft + Form1.theBlockCollection(arrowTo).shapeWidth / 2
    iYcor = Form1.theBlockCollection(arrowTo).shapeTop + Form1.theBlockCollection(arrowTo).shapeHeight / 2
     
    Dim X As Double
    Dim Y As Double
    
    X = mCos * iXRadius + iXcor
    Y = mSin * iYRadius + iYcor
    
    Form1.aDot(arINDEX).Left = X - Form1.aDot(arINDEX).Width / 2
    Form1.aDot(arINDEX).Top = Y - Form1.aDot(arINDEX).Height / 2
       
    
   
   Dim new_mSin1 As Double
   Dim new_mCos1 As Double
   Dim new_mSin2 As Double
   Dim new_mCos2 As Double
   
   Dim arrow_angle As Double
   Dim arrow_len As Double
   
   arrow_angle = 0.2
   arrow_len = 20
   
   If (mSin >= 0) And (mCos >= 0) Then
        new_mSin1 = Sin(Arcsin(mSin) - arrow_angle)
        new_mSin2 = Sin(Arcsin(mSin) + arrow_angle)
        new_mCos1 = Cos(Arccos(mCos) - arrow_angle)
        new_mCos2 = Cos(Arccos(mCos) + arrow_angle)
   ElseIf (mSin <= 0) And (mCos >= 0) Then
        new_mSin1 = Sin(Arcsin(mSin) - arrow_angle)
        new_mSin2 = Sin(Arcsin(mSin) + arrow_angle)
        new_mCos1 = Cos(Arccos(mCos) + arrow_angle)
        new_mCos2 = Cos(Arccos(mCos) - arrow_angle)
   ElseIf (mSin >= 0) And (mCos <= 0) Then
        new_mSin1 = Sin(Arcsin(mSin) + arrow_angle)
        new_mSin2 = Sin(Arcsin(mSin) - arrow_angle)
        new_mCos1 = Cos(Arccos(mCos) - arrow_angle)
        new_mCos2 = Cos(Arccos(mCos) + arrow_angle)
   ElseIf (mSin <= 0) And (mCos <= 0) Then
        new_mSin1 = Sin(Arcsin(mSin) + arrow_angle)
        new_mSin2 = Sin(Arcsin(mSin) - arrow_angle)
        new_mCos1 = Cos(Arccos(mCos) + arrow_angle)
        new_mCos2 = Cos(Arccos(mCos) - arrow_angle)
   End If
   
   
   Form1.arrUp(arINDEX).X1 = Form1.aDot(arINDEX).Left + Form1.aDot(arINDEX).Width / 2
   Form1.arrUp(arINDEX).Y1 = Form1.aDot(arINDEX).Top + Form1.aDot(arINDEX).Height / 2
   Form1.arrDown(arINDEX).X1 = Form1.arrUp(arINDEX).X1
   Form1.arrDown(arINDEX).Y1 = Form1.arrUp(arINDEX).Y1
   
   Form1.arrUp(arINDEX).X2 = (new_mCos1) * (iXRadius + arrow_len) + iXcor
   Form1.arrUp(arINDEX).Y2 = (new_mSin1) * (iYRadius + arrow_len) + iYcor
   Form1.arrDown(arINDEX).X2 = (new_mCos2) * (iXRadius + arrow_len) + iXcor
   Form1.arrDown(arINDEX).Y2 = (new_mSin2) * (iYRadius + arrow_len) + iYcor
    
    
   Form1.arrUp(arINDEX).Visible = True
   Form1.arrUp(arINDEX).ZOrder 0
   Form1.arrDown(arINDEX).Visible = True
   Form1.arrDown(arINDEX).ZOrder 0
   Form1.aDot(arINDEX).Visible = True
   Form1.aDot(arINDEX).ZOrder 0
    
End Sub

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久天堂av综合合色蜜桃网| 精品国产一区二区国模嫣然| 精品在线免费视频| 亚洲精品中文在线影院| 精品国产免费一区二区三区四区| 成人18视频日本| 黄色小说综合网站| 日韩成人免费在线| 一区二区三区欧美日韩| 国产亚洲婷婷免费| 欧美成人a∨高清免费观看| 欧美在线短视频| 99久久久国产精品| 国产高清亚洲一区| 久久国产成人午夜av影院| 午夜国产精品一区| 亚洲精品免费看| 国产精品人人做人人爽人人添| 日韩你懂的在线播放| 欧美日韩精品三区| 欧美亚洲日本国产| 91猫先生在线| 波多野结衣91| 精品制服美女丁香| 老司机精品视频导航| 午夜精品久久一牛影视| 亚洲综合小说图片| 一区二区三区欧美日韩| 亚洲欧美日韩系列| 国产精品毛片高清在线完整版| 精品国产亚洲一区二区三区在线观看| 欧美中文字幕一区二区三区| 成a人片国产精品| 成人性生交大片免费看中文| 国产精品一区二区久久不卡| 国产麻豆午夜三级精品| 狠狠色综合播放一区二区| 久久se精品一区精品二区| 免费精品99久久国产综合精品| 日韩在线卡一卡二| 亚洲电影你懂得| 亚洲成人动漫在线免费观看| 一区二区三区四区精品在线视频| 亚洲男人天堂一区| 自拍视频在线观看一区二区| 亚洲男人天堂av| 亚洲一区二区偷拍精品| 午夜视频在线观看一区二区三区| 天堂va蜜桃一区二区三区漫画版| 午夜精品久久久久久久久| 日本女人一区二区三区| 久久99精品久久久久久动态图 | 日本一区二区久久| 欧美激情一区二区在线| 亚洲欧洲日韩女同| 有码一区二区三区| 亚洲va欧美va天堂v国产综合| 午夜国产精品一区| 国产在线精品不卡| av亚洲精华国产精华| 91麻豆精品在线观看| 欧美美女一区二区| 精品国产电影一区二区| 国产欧美视频在线观看| 亚洲精品第一国产综合野| 午夜婷婷国产麻豆精品| 国产又粗又猛又爽又黄91精品| 国产91清纯白嫩初高中在线观看| 99国产精品99久久久久久| 欧美日韩一区二区欧美激情 | 精品免费一区二区三区| 欧美激情在线一区二区| 一片黄亚洲嫩模| 另类专区欧美蜜桃臀第一页| 国产69精品一区二区亚洲孕妇| 日本高清不卡aⅴ免费网站| 777xxx欧美| 国产精品久久久爽爽爽麻豆色哟哟| 一区二区三区四区av| 另类中文字幕网| 91女厕偷拍女厕偷拍高清| 欧美人牲a欧美精品| 久久精品免费在线观看| 亚洲一区二区三区爽爽爽爽爽| 久久99精品国产麻豆婷婷| 91麻豆swag| 久久亚洲二区三区| 性做久久久久久免费观看欧美| 国产曰批免费观看久久久| 91久久线看在观草草青青| 欧美岛国在线观看| 一区二区三区四区五区视频在线观看| 狠狠色狠狠色合久久伊人| 91福利国产精品| 亚洲国产高清不卡| 日韩av一区二| 在线亚洲+欧美+日本专区| 国产午夜亚洲精品理论片色戒| 午夜精品免费在线观看| 91在线观看免费视频| 欧美sm极限捆绑bd| 亚洲一区二区三区四区中文字幕| 国产成人综合精品三级| 91精品国产福利在线观看| 一级中文字幕一区二区| 成人免费av网站| 亚洲精品一区二区三区精华液| 亚洲一区二区三区视频在线| www.欧美色图| 久久久国产精品不卡| 美女视频黄 久久| 欧美日韩国产区一| 亚洲男人电影天堂| 99久久婷婷国产| 国产欧美一区二区三区沐欲| 久久国产三级精品| 欧美高清视频一二三区| 一区二区欧美国产| 91浏览器在线视频| 椎名由奈av一区二区三区| 国产精品99久久久久久有的能看| 欧美一区二区观看视频| 亚洲一区二区三区四区五区黄 | 欧美伊人久久久久久久久影院 | 亚洲一区二区欧美| 91美女精品福利| 亚洲免费色视频| 91蜜桃在线免费视频| 亚洲男同1069视频| 欧美日韩一卡二卡| 一区二区三区蜜桃网| 91亚洲精品久久久蜜桃网站| 亚洲视频在线一区二区| av网站免费线看精品| 亚洲视频一区二区免费在线观看| 成人福利视频在线| 亚洲日本中文字幕区| 日本高清成人免费播放| 亚洲影院在线观看| 欧美日韩精品久久久| 日韩国产精品久久| 日韩精品最新网址| 国产综合一区二区| 日本一区二区成人| 91片黄在线观看| 亚洲电影欧美电影有声小说| 91精品在线免费观看| 久久精品99久久久| 国产欧美日韩激情| 91在线播放网址| 亚洲福利一二三区| 日韩美女视频一区二区在线观看| 国产一区二区女| 综合欧美一区二区三区| 欧洲生活片亚洲生活在线观看| 性久久久久久久久| 在线不卡一区二区| 精品久久一二三区| 在线观看国产日韩| 一区二区三区自拍| 亚洲一区二区三区在线看| 日韩欧美一区在线| 精品国内二区三区| 欧美精品一区男女天堂| 久久久久久久久久久黄色| 亚洲国产视频一区二区| 丁香婷婷综合激情五月色| 欧美精品丝袜久久久中文字幕| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 午夜久久久久久| 欧美视频第二页| 一区二区三区四区视频精品免费 | 国产精品羞羞答答xxdd| 不卡的av在线| 久久精品日产第一区二区三区高清版| 奇米精品一区二区三区在线观看| 欧美亚洲国产bt| 中文字幕一区日韩精品欧美| 国产福利不卡视频| 欧美国产日产图区| 成人福利在线看| 亚洲欧美电影一区二区| 色诱亚洲精品久久久久久| 亚洲精品欧美专区| 欧美影院一区二区三区| 五月开心婷婷久久| 欧美电影免费观看高清完整版在| 青青草原综合久久大伊人精品| 国产乱妇无码大片在线观看| 不卡的av电影| 中文字幕高清不卡| 国产一区二区视频在线播放| 欧美一区二区免费视频| 亚洲成a人v欧美综合天堂下载| 国产一区二区三区电影在线观看| 色8久久精品久久久久久蜜| 欧美精品视频www在线观看| 国产精品无人区| 首页国产丝袜综合| 白白色 亚洲乱淫|