/
model_reflection_effect.go
557 lines (495 loc) · 15.3 KB
/
model_reflection_effect.go
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
/*
* --------------------------------------------------------------------------------------------------------------------
* <copyright company="Aspose">
* Copyright (c) 2018 Aspose.Slides for Cloud
* </copyright>
* <summary>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* </summary>
* --------------------------------------------------------------------------------------------------------------------
*/
package asposeslidescloud
import (
"encoding/json"
)
// Represents reflection effect
type IReflectionEffect interface {
// direction
GetDirection() float64
SetDirection(newValue float64)
// fade direction
GetFadeDirection() float64
SetFadeDirection(newValue float64)
// distance
GetDistance() float64
SetDistance(newValue float64)
// blur radius
GetBlurRadius() float64
SetBlurRadius(newValue float64)
// scale horizontal
GetScaleHorizontal() float64
SetScaleHorizontal(newValue float64)
// scale vertical
GetScaleVertical() float64
SetScaleVertical(newValue float64)
// skew horizontal
GetSkewHorizontal() float64
SetSkewHorizontal(newValue float64)
// skew vertical
GetSkewVertical() float64
SetSkewVertical(newValue float64)
// start pos alpha
GetStartPosAlpha() float64
SetStartPosAlpha(newValue float64)
// end pos alpha
GetEndPosAlpha() float64
SetEndPosAlpha(newValue float64)
// start reflection opacity
GetStartReflectionOpacity() float64
SetStartReflectionOpacity(newValue float64)
// end reflection opacity
GetEndReflectionOpacity() float64
SetEndReflectionOpacity(newValue float64)
// rectangle alignment
GetRectangleAlign() string
SetRectangleAlign(newValue string)
// true if the reflection should rotate with the shape when the shape is rotated
GetRotateShadowWithShape() bool
SetRotateShadowWithShape(newValue bool)
}
type ReflectionEffect struct {
// direction
Direction float64 `json:"Direction"`
// fade direction
FadeDirection float64 `json:"FadeDirection"`
// distance
Distance float64 `json:"Distance"`
// blur radius
BlurRadius float64 `json:"BlurRadius"`
// scale horizontal
ScaleHorizontal float64 `json:"ScaleHorizontal"`
// scale vertical
ScaleVertical float64 `json:"ScaleVertical"`
// skew horizontal
SkewHorizontal float64 `json:"SkewHorizontal"`
// skew vertical
SkewVertical float64 `json:"SkewVertical"`
// start pos alpha
StartPosAlpha float64 `json:"StartPosAlpha"`
// end pos alpha
EndPosAlpha float64 `json:"EndPosAlpha"`
// start reflection opacity
StartReflectionOpacity float64 `json:"StartReflectionOpacity"`
// end reflection opacity
EndReflectionOpacity float64 `json:"EndReflectionOpacity"`
// rectangle alignment
RectangleAlign string `json:"RectangleAlign"`
// true if the reflection should rotate with the shape when the shape is rotated
RotateShadowWithShape bool `json:"RotateShadowWithShape"`
}
func NewReflectionEffect() *ReflectionEffect {
instance := new(ReflectionEffect)
instance.RectangleAlign = "TopLeft"
return instance
}
func (this *ReflectionEffect) GetDirection() float64 {
return this.Direction
}
func (this *ReflectionEffect) SetDirection(newValue float64) {
this.Direction = newValue
}
func (this *ReflectionEffect) GetFadeDirection() float64 {
return this.FadeDirection
}
func (this *ReflectionEffect) SetFadeDirection(newValue float64) {
this.FadeDirection = newValue
}
func (this *ReflectionEffect) GetDistance() float64 {
return this.Distance
}
func (this *ReflectionEffect) SetDistance(newValue float64) {
this.Distance = newValue
}
func (this *ReflectionEffect) GetBlurRadius() float64 {
return this.BlurRadius
}
func (this *ReflectionEffect) SetBlurRadius(newValue float64) {
this.BlurRadius = newValue
}
func (this *ReflectionEffect) GetScaleHorizontal() float64 {
return this.ScaleHorizontal
}
func (this *ReflectionEffect) SetScaleHorizontal(newValue float64) {
this.ScaleHorizontal = newValue
}
func (this *ReflectionEffect) GetScaleVertical() float64 {
return this.ScaleVertical
}
func (this *ReflectionEffect) SetScaleVertical(newValue float64) {
this.ScaleVertical = newValue
}
func (this *ReflectionEffect) GetSkewHorizontal() float64 {
return this.SkewHorizontal
}
func (this *ReflectionEffect) SetSkewHorizontal(newValue float64) {
this.SkewHorizontal = newValue
}
func (this *ReflectionEffect) GetSkewVertical() float64 {
return this.SkewVertical
}
func (this *ReflectionEffect) SetSkewVertical(newValue float64) {
this.SkewVertical = newValue
}
func (this *ReflectionEffect) GetStartPosAlpha() float64 {
return this.StartPosAlpha
}
func (this *ReflectionEffect) SetStartPosAlpha(newValue float64) {
this.StartPosAlpha = newValue
}
func (this *ReflectionEffect) GetEndPosAlpha() float64 {
return this.EndPosAlpha
}
func (this *ReflectionEffect) SetEndPosAlpha(newValue float64) {
this.EndPosAlpha = newValue
}
func (this *ReflectionEffect) GetStartReflectionOpacity() float64 {
return this.StartReflectionOpacity
}
func (this *ReflectionEffect) SetStartReflectionOpacity(newValue float64) {
this.StartReflectionOpacity = newValue
}
func (this *ReflectionEffect) GetEndReflectionOpacity() float64 {
return this.EndReflectionOpacity
}
func (this *ReflectionEffect) SetEndReflectionOpacity(newValue float64) {
this.EndReflectionOpacity = newValue
}
func (this *ReflectionEffect) GetRectangleAlign() string {
return this.RectangleAlign
}
func (this *ReflectionEffect) SetRectangleAlign(newValue string) {
this.RectangleAlign = newValue
}
func (this *ReflectionEffect) GetRotateShadowWithShape() bool {
return this.RotateShadowWithShape
}
func (this *ReflectionEffect) SetRotateShadowWithShape(newValue bool) {
this.RotateShadowWithShape = newValue
}
func (this *ReflectionEffect) UnmarshalJSON(b []byte) error {
var objMap map[string]*json.RawMessage
err := json.Unmarshal(b, &objMap)
if err != nil {
return err
}
if valDirection, ok := objMap["direction"]; ok {
if valDirection != nil {
var valueForDirection float64
err = json.Unmarshal(*valDirection, &valueForDirection)
if err != nil {
return err
}
this.Direction = valueForDirection
}
}
if valDirectionCap, ok := objMap["Direction"]; ok {
if valDirectionCap != nil {
var valueForDirection float64
err = json.Unmarshal(*valDirectionCap, &valueForDirection)
if err != nil {
return err
}
this.Direction = valueForDirection
}
}
if valFadeDirection, ok := objMap["fadeDirection"]; ok {
if valFadeDirection != nil {
var valueForFadeDirection float64
err = json.Unmarshal(*valFadeDirection, &valueForFadeDirection)
if err != nil {
return err
}
this.FadeDirection = valueForFadeDirection
}
}
if valFadeDirectionCap, ok := objMap["FadeDirection"]; ok {
if valFadeDirectionCap != nil {
var valueForFadeDirection float64
err = json.Unmarshal(*valFadeDirectionCap, &valueForFadeDirection)
if err != nil {
return err
}
this.FadeDirection = valueForFadeDirection
}
}
if valDistance, ok := objMap["distance"]; ok {
if valDistance != nil {
var valueForDistance float64
err = json.Unmarshal(*valDistance, &valueForDistance)
if err != nil {
return err
}
this.Distance = valueForDistance
}
}
if valDistanceCap, ok := objMap["Distance"]; ok {
if valDistanceCap != nil {
var valueForDistance float64
err = json.Unmarshal(*valDistanceCap, &valueForDistance)
if err != nil {
return err
}
this.Distance = valueForDistance
}
}
if valBlurRadius, ok := objMap["blurRadius"]; ok {
if valBlurRadius != nil {
var valueForBlurRadius float64
err = json.Unmarshal(*valBlurRadius, &valueForBlurRadius)
if err != nil {
return err
}
this.BlurRadius = valueForBlurRadius
}
}
if valBlurRadiusCap, ok := objMap["BlurRadius"]; ok {
if valBlurRadiusCap != nil {
var valueForBlurRadius float64
err = json.Unmarshal(*valBlurRadiusCap, &valueForBlurRadius)
if err != nil {
return err
}
this.BlurRadius = valueForBlurRadius
}
}
if valScaleHorizontal, ok := objMap["scaleHorizontal"]; ok {
if valScaleHorizontal != nil {
var valueForScaleHorizontal float64
err = json.Unmarshal(*valScaleHorizontal, &valueForScaleHorizontal)
if err != nil {
return err
}
this.ScaleHorizontal = valueForScaleHorizontal
}
}
if valScaleHorizontalCap, ok := objMap["ScaleHorizontal"]; ok {
if valScaleHorizontalCap != nil {
var valueForScaleHorizontal float64
err = json.Unmarshal(*valScaleHorizontalCap, &valueForScaleHorizontal)
if err != nil {
return err
}
this.ScaleHorizontal = valueForScaleHorizontal
}
}
if valScaleVertical, ok := objMap["scaleVertical"]; ok {
if valScaleVertical != nil {
var valueForScaleVertical float64
err = json.Unmarshal(*valScaleVertical, &valueForScaleVertical)
if err != nil {
return err
}
this.ScaleVertical = valueForScaleVertical
}
}
if valScaleVerticalCap, ok := objMap["ScaleVertical"]; ok {
if valScaleVerticalCap != nil {
var valueForScaleVertical float64
err = json.Unmarshal(*valScaleVerticalCap, &valueForScaleVertical)
if err != nil {
return err
}
this.ScaleVertical = valueForScaleVertical
}
}
if valSkewHorizontal, ok := objMap["skewHorizontal"]; ok {
if valSkewHorizontal != nil {
var valueForSkewHorizontal float64
err = json.Unmarshal(*valSkewHorizontal, &valueForSkewHorizontal)
if err != nil {
return err
}
this.SkewHorizontal = valueForSkewHorizontal
}
}
if valSkewHorizontalCap, ok := objMap["SkewHorizontal"]; ok {
if valSkewHorizontalCap != nil {
var valueForSkewHorizontal float64
err = json.Unmarshal(*valSkewHorizontalCap, &valueForSkewHorizontal)
if err != nil {
return err
}
this.SkewHorizontal = valueForSkewHorizontal
}
}
if valSkewVertical, ok := objMap["skewVertical"]; ok {
if valSkewVertical != nil {
var valueForSkewVertical float64
err = json.Unmarshal(*valSkewVertical, &valueForSkewVertical)
if err != nil {
return err
}
this.SkewVertical = valueForSkewVertical
}
}
if valSkewVerticalCap, ok := objMap["SkewVertical"]; ok {
if valSkewVerticalCap != nil {
var valueForSkewVertical float64
err = json.Unmarshal(*valSkewVerticalCap, &valueForSkewVertical)
if err != nil {
return err
}
this.SkewVertical = valueForSkewVertical
}
}
if valStartPosAlpha, ok := objMap["startPosAlpha"]; ok {
if valStartPosAlpha != nil {
var valueForStartPosAlpha float64
err = json.Unmarshal(*valStartPosAlpha, &valueForStartPosAlpha)
if err != nil {
return err
}
this.StartPosAlpha = valueForStartPosAlpha
}
}
if valStartPosAlphaCap, ok := objMap["StartPosAlpha"]; ok {
if valStartPosAlphaCap != nil {
var valueForStartPosAlpha float64
err = json.Unmarshal(*valStartPosAlphaCap, &valueForStartPosAlpha)
if err != nil {
return err
}
this.StartPosAlpha = valueForStartPosAlpha
}
}
if valEndPosAlpha, ok := objMap["endPosAlpha"]; ok {
if valEndPosAlpha != nil {
var valueForEndPosAlpha float64
err = json.Unmarshal(*valEndPosAlpha, &valueForEndPosAlpha)
if err != nil {
return err
}
this.EndPosAlpha = valueForEndPosAlpha
}
}
if valEndPosAlphaCap, ok := objMap["EndPosAlpha"]; ok {
if valEndPosAlphaCap != nil {
var valueForEndPosAlpha float64
err = json.Unmarshal(*valEndPosAlphaCap, &valueForEndPosAlpha)
if err != nil {
return err
}
this.EndPosAlpha = valueForEndPosAlpha
}
}
if valStartReflectionOpacity, ok := objMap["startReflectionOpacity"]; ok {
if valStartReflectionOpacity != nil {
var valueForStartReflectionOpacity float64
err = json.Unmarshal(*valStartReflectionOpacity, &valueForStartReflectionOpacity)
if err != nil {
return err
}
this.StartReflectionOpacity = valueForStartReflectionOpacity
}
}
if valStartReflectionOpacityCap, ok := objMap["StartReflectionOpacity"]; ok {
if valStartReflectionOpacityCap != nil {
var valueForStartReflectionOpacity float64
err = json.Unmarshal(*valStartReflectionOpacityCap, &valueForStartReflectionOpacity)
if err != nil {
return err
}
this.StartReflectionOpacity = valueForStartReflectionOpacity
}
}
if valEndReflectionOpacity, ok := objMap["endReflectionOpacity"]; ok {
if valEndReflectionOpacity != nil {
var valueForEndReflectionOpacity float64
err = json.Unmarshal(*valEndReflectionOpacity, &valueForEndReflectionOpacity)
if err != nil {
return err
}
this.EndReflectionOpacity = valueForEndReflectionOpacity
}
}
if valEndReflectionOpacityCap, ok := objMap["EndReflectionOpacity"]; ok {
if valEndReflectionOpacityCap != nil {
var valueForEndReflectionOpacity float64
err = json.Unmarshal(*valEndReflectionOpacityCap, &valueForEndReflectionOpacity)
if err != nil {
return err
}
this.EndReflectionOpacity = valueForEndReflectionOpacity
}
}
this.RectangleAlign = "TopLeft"
if valRectangleAlign, ok := objMap["rectangleAlign"]; ok {
if valRectangleAlign != nil {
var valueForRectangleAlign string
err = json.Unmarshal(*valRectangleAlign, &valueForRectangleAlign)
if err != nil {
var valueForRectangleAlignInt int32
err = json.Unmarshal(*valRectangleAlign, &valueForRectangleAlignInt)
if err != nil {
return err
}
this.RectangleAlign = string(valueForRectangleAlignInt)
} else {
this.RectangleAlign = valueForRectangleAlign
}
}
}
if valRectangleAlignCap, ok := objMap["RectangleAlign"]; ok {
if valRectangleAlignCap != nil {
var valueForRectangleAlign string
err = json.Unmarshal(*valRectangleAlignCap, &valueForRectangleAlign)
if err != nil {
var valueForRectangleAlignInt int32
err = json.Unmarshal(*valRectangleAlignCap, &valueForRectangleAlignInt)
if err != nil {
return err
}
this.RectangleAlign = string(valueForRectangleAlignInt)
} else {
this.RectangleAlign = valueForRectangleAlign
}
}
}
if valRotateShadowWithShape, ok := objMap["rotateShadowWithShape"]; ok {
if valRotateShadowWithShape != nil {
var valueForRotateShadowWithShape bool
err = json.Unmarshal(*valRotateShadowWithShape, &valueForRotateShadowWithShape)
if err != nil {
return err
}
this.RotateShadowWithShape = valueForRotateShadowWithShape
}
}
if valRotateShadowWithShapeCap, ok := objMap["RotateShadowWithShape"]; ok {
if valRotateShadowWithShapeCap != nil {
var valueForRotateShadowWithShape bool
err = json.Unmarshal(*valRotateShadowWithShapeCap, &valueForRotateShadowWithShape)
if err != nil {
return err
}
this.RotateShadowWithShape = valueForRotateShadowWithShape
}
}
return nil
}