/
ExecuteNoParameters.cxx.in
72 lines (71 loc) · 2.32 KB
/
ExecuteNoParameters.cxx.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
$(if no_return_image then OUT=[[void]] else OUT=[[Image]] end) ${name}::Execute ( $(include ImageParameters.in)$(include InputParameters.in) )
{
$(if true then
local inputName = "image1"
if not (number_of_inputs > 0) and (#inputs > 0) then
inputName = inputs[1].name:sub(1,1):lower() .. inputs[1].name:sub(2,-1)
end
OUT=[[
const PixelIDValueEnum type = ]]..inputName..[[.GetPixelID();
const unsigned int dimension = ]]..inputName..[[.GetDimension();
]]
for inum=2,number_of_inputs do
OUT= OUT .. [[
CheckImageMatchingDimension( ]] .. inputName .. [[, image]] .. inum .. [[, "image]] .. inum .. [[" );
]]
OUT= OUT .. [[
CheckImageMatchingPixelType( ]] .. inputName .. [[, image]] .. inum .. [[, "image]] .. inum .. [[" );
]]
end
if inputs then
for inum=2,#inputs do
if inputs[inum].type == "Image" and (not inputs[inum].optional or not no_optional) then
local currentInputName = inputs[inum].name:sub(1,1):lower()..inputs[inum].name:sub(2,-1)
OUT=OUT..[[
CheckImageMatchingDimension( ]] .. inputName .. [[, ]] .. currentInputName .. [[, "]] .. currentInputName .. [[" );
]]
if not inputs[inum].no_size_check then
OUT=OUT..[[
CheckImageMatchingSize( ]] .. inputName .. [[, ]] .. currentInputName .. [[, "]] .. currentInputName .. [[" );
]]
end
end
end
end
end)
return this->m_MemberFactory->GetMemberFunction( type, dimension )( $(for inum=1,number_of_inputs do
if inum>1 then
OUT=OUT .. ', '
end
OUT= OUT .. 'image' .. inum
end
if inputs then
for inum=1,#inputs do
if number_of_inputs>0 or inum>1 then
OUT = OUT .. ", "
end
if inputs[inum].optional and no_optional then
OUT=OUT.."nullptr"
else
OUT=OUT.."&"..inputs[inum].name:sub(1,1):lower() .. inputs[inum].name:sub(2,-1)
end
end
end) );
}
$(if in_place then
OUT=OUT..[[
$(include ExecuteRValueReferenceNoParameters.cxx.in)]]
end)$(if inputs then
local has_optional_inputs = false
for i =1,#inputs do
if inputs[i].optional then
has_optional_inputs=inputs[i].optional
end
end
if has_optional_inputs and not no_optional then
no_optional=1
-- we recusively include this same template file but with the no_optional variable defined
OUT=[[
$(include ExecuteNoParameters.cxx.in)]]
end
end)$(if inputs then no_optional=nil end)