37.45.175.237 писал(а):
в общем все просто создаем массив нужных полигонов с ним потом и работаем.
Add(MainForm,2290438,119,259)
{
Width=557
Height=447
Caption="Пример использования RGN_PointXY"
BorderStyle=3
Position=1
link(onCreate,5203839:doEnum,[])
}
Add(PaintBox,1497773,483,126)
{
Left=10
Top=10
Width=365
Height=400
Color=-16777196
Point(MouseX)
Point(MouseY)
Point(onMouseMove)
link(onMouseMove,9412145:doEnum,[])
}
Add(Img_Polygon,290147,448,301)
{
PointsArray=[]
LineStyle=2
link(onDraw,7397240:doClear,[(520,307)(520,228)(443,228)(443,209)])
link(Bitmap,1497773:Bitmap,[(454,173)(489,173)])
link(PointsArray,4779542:Var2,[])
}
Add(LineBreakEx,1469411,490,203)
{
Caption="x"
Type=3
link(_Data,1497773:MouseX,[])
}
Add(LineBreakEx,6363341,497,182)
{
Caption="y"
Type=3
link(_Data,1497773:MouseY,[])
}
Add(RGN_Script,7578875,315,399)
{
Script=#24:poly(10,10,150,10,75,75)|
link(onCreateRgn,1094907:doEvent2,[(365,405)(365,356)])
}
Add(RGN_PointXY,12240237,588,133)
{
Point(onCheck)
link(X,12131833:getVar,[])
link(Y,11912973:getVar,[])
link(onCheck,13185907:doEvent,[(632,153)(632,139)])
}
Add(Label,3108908,707,168)
{
Left=390
Top=245
Width=153
Height=17
Visible=1
Caption="Невидимый треугольник"
Point(doVisible)
}
Add(LineBreakEx,12131833,595,84)
{
Caption="x"
Type=2
}
Add(LineBreakEx,11912973,602,98)
{
Caption="y"
Type=2
}
Add(InfoTip,1314524,301,392)
{
Info=#9:невидимый|
VAlign=2
Width=57
Height=60
}
Add(IndexToChanel,13185907,644,133)
{
Count=3
Point(Index)
link(onEvent1,10352316:doVisible,[(688,139)(688,104)])
link(onEvent2,1922533:doVisible,[])
link(onEvent3,3108908:doVisible,[(692,153)(692,181)])
link(Index,9412145:Index,[(650,85)(752,85)(752,210)(552,210)])
}
Add(Label,10352316,707,91)
{
Left=390
Top=195
Width=47
Height=17
Visible=1
Caption="Полигон"
Point(doVisible)
}
Add(Label,1922533,707,133)
{
Left=390
Top=220
Width=84
Height=17
Visible=1
Caption="Прямоугольник"
Point(doVisible)
}
Add(StrList,7705679,413,343)
{
}
Add(ArrayEnum,9412145,539,133)
{
link(onItem,12240237:doCheck,[])
link(Array,5000681:Var,[])
}
Add(LineBreak,2612459,427,399)
{
Caption="arr"
Type=1
link(Data,7705679:Array,[])
Primary=[5000681,112,-294]
}
Add(Hub,1094907,378,343)
{
InCount=2
OutCount=1
link(onEvent1,7705679:doAdd,[])
}
Add(StrList,6519141,182,203)
{
@Hint=#27:Координаты вершин полигонов|
Strings=#59:50,50,250,90,300,50,190,200,238,300,360,300,360,375,120,375|27:20,20,120,20,120,220,20,220|
AddHint(-37,-36,174,13,@Hint)
}
Add(FormatStr,9047441,252,343)
{
DataCount=1
Mask="poly(%1)"
Point(FString)
link(onFString,96437:##add,[])
}
Add(ArrayEnum,5203839,182,273)
{
link(onItem,10818080:doEvent1,[])
link(onEndEnum,7578875:doCreateRgn,[(220,286)(220,405)])
link(Array,6519141:Array,[(188,259)(202,259)])
}
Add(MT_String,6180270,364,266)
{
Delimeter=","
link(onResult,588295:doCalc,[])
}
Add(MathParse,588295,413,266)
{
MathStr="%1 + %2 * 65536"
link(onResult,9393252:doAdd,[])
}
Add(ArrayRW,9393252,476,252)
{
link(Array,4779542:Var3,[(482,236)])
}
Add(IntegerArray,7397240,455,189)
{
IntArray=[]
}
Add(GetDataEx,4779542,455,231)
{
link(Data,7397240:Array,[])
}
Add(Hub,10818080,245,273)
{
OutCount=3
link(onEvent1,4832047:doWork1,[(280,279)(280,272)])
link(onEvent2,13943436:doText,[(281,286)(281,307)])
link(onEvent3,9047441:doString,[(271,293)(271,321)(240,321)(240,349)])
}
Add(MultiElement,4832047,301,266)
{
link(onEvent1,6180270:doMT,[(352,272)(352,279)])
}
BEGIN_SDK
Add(EditMulti,15956691,196,196)
{
EventCount=1
WorkCount=1
Width=265
link(doWork1,1804084:doEvent1,[(218,202)(218,244)])
}
Add(MultiStrData,7117229,294,238)
{
Char=","
link(onPart1,8309381:doWork2,[(342,244)(342,209)])
link(onPart2,6706965:doEvent1,[])
}
Add(DoData,13226405,294,287)
{
link(onEventData,9004585:doWork3,[(339,293)(339,327)(270,327)])
link(Data,7117229:RemaindStr,[])
}
Add(Hub,6706965,343,245)
{
link(onEvent1,4688503:doWork2,[])
link(onEvent2,13226405:doData,[(366,258)(366,279)(282,279)(282,293)])
}
Add(HubEx,9004585,266,238)
{
link(onEvent,7117229:doSplit,[])
}
Add(Memory,8422653,392,203)
{
}
Add(StrCatDelim,6492262,392,245)
{
Delimiter=","
link(onStrCatDlm,15956691:onEvent1,[(440,251)(440,202)])
link(Str1,8422653:Value,[])
}
Add(Hub,1804084,231,238)
{
link(onEvent1,9004585:doWork2,[])
link(onEvent2,2512233:doSplit,[(255,251)(255,349)])
}
Add(MultiStrData,2512233,294,343)
{
Char=","
link(onPart1,8309381:doWork3,[(375,349)])
link(onPart2,4688503:doWork3,[(382,356)])
}
Add(HubEx,8309381,371,203)
{
link(onEvent,8422653:doValue,[])
}
Add(HubEx,4688503,378,245)
{
link(onEvent,6492262:doStrCatDlm,[])
}
END_SDK
Add(VisualStrings,13943436,399,301)
{
Width=11
Height=6
Point(doText)
Point(onText)
link(onText,290147:doDraw,[])
}
Add(MultiElementEx,96437,315,343)
{
link(Script,9047441:FString,[(321,331)(296,331)(296,385)(258,385)])
link(onCreateRgn,1094907:doEvent1,[])
}
BEGIN_SDK
Add(EditMultiEx,4308505,200,200)
{
WorkCount=#5:##add|
EventCount=#11:onCreateRgn|
DataCount=#6:Script|
Width=90
Height=74
Point(##add)
link(##add,8261396:doCreateRgn,[(216,206)(216,230)])
}
Add(RGN_Script,8261396,231,224)
{
Script=#0:|0:|
link(onCreateRgn,4308505:onCreateRgn,[(277,230)(277,206)])
link(Script,4308505:Script,[(237,190)(206,190)])
}
END_SDK