class DMJ_SelectorArbitraryPolygon(DMJ_PolyCurveSelector) {
; Arbitrary polygon curve selector.
public:
import "common.ulb"
func DMJ_SelectorArbitraryPolygon(Generic pparent)
DMJ_PolyCurveSelector.DMJ_PolyCurveSelector(pparent)
m_Anchors[0] = @p_anchor1
m_Anchors[1] = @p_anchor2
m_Anchors[2] = @p_anchor3
m_Anchors[3] = @p_anchor4
m_Anchors[4] = @p_anchor5
m_Anchors[5] = @p_anchor6
m_Anchors[6] = @p_anchor7
m_Anchors[7] = @p_anchor8
m_Anchors[8] = @p_anchor9
m_Anchors[9] = @p_anchor10
m_Anchors[10] = @p_anchor11
m_Anchors[11] = @p_anchor12
m_Anchors[12] = @p_anchor13
m_Anchors[13] = @p_anchor14
m_Anchors[14] = @p_anchor15
m_Anchors[15] = @p_anchor16
m_Anchors[16] = @p_anchor17
m_Anchors[17] = @p_anchor18
m_Anchors[18] = @p_anchor19
m_Anchors[19] = @p_anchor20
endfunc
func SetCurve(DMJ_PolyCurve &pcurve)
pcurve.SetSegmentCount(@p_segmentcount)
int j = 0
int closed = 0
while (j < @p_segmentcount)
if (j == @p_segmentcount-1)
closed = 1
endif
pcurve.SetSegment(-1, 1, closed, m_Anchors[j], 0, 0)
j = j + 1
endwhile
endfunc
func SetHandles(Handles phandles)
DMJ_PolyCurveSelector.SetHandles(phandles)
phandles.SetHandleCount(@p_segmentcount,0,0,0)
int j = 0
while (j < @p_segmentcount)
phandles.SetHandlePoint(-1, 1, j+1, 0, m_Anchors[j], 0)
j = j + 1
endwhile
endfunc
protected:
complex m_Anchors[20]
default:
title = "Arbitrary Polygon"
int param v_dmj_selectorarbitrarypolygon
caption = "Version (DMJ_SelectorArbitraryPolygon)"
default = 100
hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used."
visible = @v_dmj_selectorarbitrarypolygon < 100
endparam
int param p_segmentcount
caption = "Number of sides"
default = 3
min = 3
max = 20
hint = "Sets the number of sides in the polygon."
endparam
complex param p_anchor1
caption = "Point 1"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 1)
hint = "Sets the location of point 1 in the polygon."
endparam
complex param p_anchor2
caption = "Point 2"
default = #center + (1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 2)
hint = "Sets the location of point 2 in the polygon."
endparam
complex param p_anchor3
caption = "Point 3"
default = #center + (1/#magn + flip(-0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 3)
hint = "Sets the location of point 3 in the polygon."
endparam
complex param p_anchor4
caption = "Point 4"
default = #center + (-1/#magn + flip(-0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 4)
hint = "Sets the location of point 4 in the polygon."
endparam
complex param p_anchor5
caption = "Point 5"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 5)
hint = "Sets the location of point 5 in the polygon."
endparam
complex param p_anchor6
caption = "Point 6"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 6)
hint = "Sets the location of point 6 in the polygon."
endparam
complex param p_anchor7
caption = "Point 7"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 7)
hint = "Sets the location of point 7 in the polygon."
endparam
complex param p_anchor8
caption = "Point 8"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 8)
hint = "Sets the location of point 8 in the polygon."
endparam
complex param p_anchor9
caption = "Point 9"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 9)
hint = "Sets the location of point 9 in the polygon."
endparam
complex param p_anchor10
caption = "Point 10"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 10)
hint = "Sets the location of point 10 in the polygon."
endparam
complex param p_anchor11
caption = "Point 11"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 11)
hint = "Sets the location of point 11 in the polygon."
endparam
complex param p_anchor12
caption = "Point 12"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 12)
hint = "Sets the location of point 12 in the polygon."
endparam
complex param p_anchor13
caption = "Point 13"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 13)
hint = "Sets the location of point 13 in the polygon."
endparam
complex param p_anchor14
caption = "Point 14"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 14)
hint = "Sets the location of point 14 in the polygon."
endparam
complex param p_anchor15
caption = "Point 15"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 15)
hint = "Sets the location of point 15 in the polygon."
endparam
complex param p_anchor16
caption = "Point 16"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 16)
hint = "Sets the location of point 16 in the polygon."
endparam
complex param p_anchor17
caption = "Point 17"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 17)
hint = "Sets the location of point 17 in the polygon."
endparam
complex param p_anchor18
caption = "Point 18"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 18)
hint = "Sets the location of point 18 in the polygon."
endparam
complex param p_anchor19
caption = "Point 19"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 19)
hint = "Sets the location of point 19 in the polygon."
endparam
complex param p_anchor20
caption = "Point 20"
default = #center + (-1/#magn + flip(0.5/#magn)) * ((0,1)^(#angle*2/#pi))
visible = (@p_segmentcount >= 20)
hint = "Sets the location of point 20 in the polygon."
endparam
}