File: MemberGetSetDeclarations.h.in

package info (click to toggle)
simpleitk 1.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 75,056 kB
  • sloc: cpp: 25,403; python: 3,060; sh: 1,131; ansic: 369; java: 260; cs: 215; makefile: 51; ruby: 47; tcl: 22
file content (126 lines) | stat: -rw-r--r-- 4,062 bytes parent folder | download
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
$(foreach members
$(if enum then
    OUT=OUT..'\
\
      typedef enum {'
    for i = 1,#enum do
        if( i > 1) then
            OUT=OUT..','
        end
        OUT=OUT..enum[i]
    end
    if type then
      OUT=OUT..'} ${type};'
    else
      OUT=OUT..'} ${name}Type;'
    end
end)
$(if (not no_set_method) or (no_set_method == 0) then
      OUT = '\
      /**'
      if briefdescriptionSet and (briefdescriptionSet:len() > 0) then
         OUT=OUT .. '\
       * \\brief ${briefdescriptionSet}'
      end
      if detaileddescriptionSet and (detaileddescriptionSet:len() > 0) then
         OUT=OUT .. '\
       * ${detaileddescriptionSet}'
      end
      OUT= OUT .. '\
       */\
      SITK_RETURN_SELF_TYPE_HEADER Set${name} ('
      if not type and enum then
        OUT=OUT..' ${name}Type'
      elseif dim_vec and (dim_vec == 1) then
        OUT=OUT..' const std::vector<${type}> &'
      elseif point_vec and (point_vec == 1) then
        OUT=OUT..' const std::vector< std::vector<${type}> >&'
      else
        OUT=OUT..' ${type}'
      end
      OUT=OUT..' ${name} ) { this->m_${name} = ${name}; return *this; }'
  if dim_vec and ( set_as_scalar == 1 ) then
    OUT = OUT .. '\
\
      /** Set the values of the ${name} vector all to value */\
      SITK_RETURN_SELF_TYPE_HEADER Set${name}( ${type} value ) { this->m_${name} = std::vector<${type}>(3, value); return *this; }\
'
  end
  if type == "bool" and ( not dim_vec or not dim_vec == 1 ) then
      OUT = OUT .. '\
\
      /** Set the value of ${name} to true or false respectfully. */\
      SITK_RETURN_SELF_TYPE_HEADER ${name}On() { return this->Set${name}(true); }\
      SITK_RETURN_SELF_TYPE_HEADER ${name}Off() { return this->Set${name}(false); }'
  end
end)
$(if (not no_get_method) or (no_get_method == 0) then
       OUT = '\
      /**'
      if briefdescriptionGet and (briefdescriptionGet:len() > 0)  then
         OUT=OUT .. '\
       * \\brief ${briefdescriptionGet}'
      end
      if detaileddescriptionGet and (detaileddescriptionGet:len() > 0) then
         OUT=OUT .. '\
       * ${detaileddescriptionGet}'
      end
      OUT= OUT .. '\
       */\
       '
      if not type and enum then
        OUT=OUT..' ${name}Type'
      elseif dim_vec and (dim_vec == 1) then
        OUT=OUT..' std::vector<${type}>'
      elseif point_vec and (point_vec == 1) then
        OUT=OUT..' std::vector< std::vector<unsigned int> >'
      else
        OUT=OUT..' ${type}'
      end
      OUT=OUT..' Get${name}() const { return this->m_${name}; }'
end)$(if point_vec and (point_vec == 1) then
      OUT=[[

      /** \brief Add ${name} point */
      SITK_RETURN_SELF_TYPE_HEADER Add${name:gsub("s([0-9]?)$","%1")}( const std::vector< ${type} > &point ) { this->m_${name}.push_back(point); return *this;}
      /** \brief Remove all ${name} points */
      SITK_RETURN_SELF_TYPE_HEADER Clear${name}( ) { this->m_${name}.clear(); return *this;}
]]
end))$(when measurements $(foreach measurements

     /**$(if briefdescriptionGet and (briefdescriptionGet:len() > 0) then OUT=[[ \brief ${briefdescriptionGet}]]end)
      *$(if detaileddescriptionGet and (detaileddescriptionGet:len() > 0) then OUT =[[ ${detaileddescriptionGet}]]end)
      *
$(if active then
OUT=[[
      * This is an active measurement. It may be accessed while the
      * filter is being executing in command call-backs and can be
      * accessed after execution.
]]
else
OUT=[[
      * This is a measurement. Its value is updated in the Execute
      * methods, so the value will only be valid after an execution.
]]
end)      */
$(if active then
OUT=[[
     ${type} Get${name}($(if parameters then
for inum=1,#parameters do
  if inum>1 then
    OUT = OUT .. ', '
  end
  OUT = OUT .. parameters[inum].type .. ' ' .. parameters[inum].name
end end)) const { return this->m_pfGet${name}($(if parameters then
for inum=1,#parameters do
  if inum>1 then
    OUT = OUT .. ', '
  end
  OUT = OUT .. parameters[inum].name
end end)); };
]]
else
OUT=[[
     ${type} Get${name}() const { return this->m_${name}; };
]]
end)))