155 } |
155 } |
156 } |
156 } |
157 |
157 |
158 QString LDCircularPrimitive::objectListText() const |
158 QString LDCircularPrimitive::objectListText() const |
159 { |
159 { |
|
160 QString prefix; |
|
161 |
|
162 if (m_divisions == HighResolution) |
|
163 prefix = "Hi-Res"; |
|
164 else if (m_divisions == LowResolution) |
|
165 prefix = "Lo-Res"; |
|
166 else if (m_divisions != MediumResolution) |
|
167 prefix = format("%1-resolution", m_divisions); |
|
168 |
160 QString result = format( |
169 QString result = format( |
161 "%1 %2 %3, (", |
170 "%1 %2 %3 %4, (", |
|
171 prefix, |
162 PrimitiveModel::typeName(m_type), |
172 PrimitiveModel::typeName(m_type), |
163 m_segments / m_divisions, |
173 m_segments / m_divisions, |
164 position().toString(true) |
174 position().toString(true) |
165 ); |
175 ).simplified(); |
166 |
176 |
167 for (int i = 0; i < 9; ++i) |
177 for (int i = 0; i < 9; ++i) |
168 result += format("%1%2", transformationMatrix().value(i), (i != 8) ? " " : ""); |
178 result += format("%1%2", transformationMatrix().value(i), (i != 8) ? " " : ""); |
169 |
179 |
170 result += ')'; |
180 result += ')'; |
191 } |
201 } |
192 |
202 |
193 return 0; |
203 return 0; |
194 } |
204 } |
195 |
205 |
196 QString LDCircularPrimitive::typeName() const |
206 QString LDCircularPrimitive::iconName() const |
197 { |
207 { |
198 return "circular-primitive"; |
208 switch (m_type) |
|
209 { |
|
210 case PrimitiveModel::Ring: |
|
211 case PrimitiveModel::Cone: |
|
212 break; |
|
213 |
|
214 case PrimitiveModel::Cylinder: |
|
215 return "cylinder"; |
|
216 |
|
217 case PrimitiveModel::Disc: |
|
218 return "disc"; |
|
219 |
|
220 case PrimitiveModel::DiscNegative: |
|
221 return "disc-negative"; |
|
222 |
|
223 case PrimitiveModel::Circle: |
|
224 return "circle"; |
|
225 } |
|
226 |
|
227 return ""; |
199 } |
228 } |
200 |
229 |
201 void LDCircularPrimitive::serialize(class Serializer& serializer) |
230 void LDCircularPrimitive::serialize(class Serializer& serializer) |
202 { |
231 { |
203 LDMatrixObject::serialize(serializer); |
232 LDMatrixObject::serialize(serializer); |