pytecplot 1.5.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. pytecplot-1.5.2.dist-info/LICENSE.html +77 -0
  2. pytecplot-1.5.2.dist-info/METADATA +508 -0
  3. pytecplot-1.5.2.dist-info/RECORD +97 -0
  4. pytecplot-1.5.2.dist-info/WHEEL +5 -0
  5. pytecplot-1.5.2.dist-info/top_level.txt +1 -0
  6. tecplot/__init__.py +94 -0
  7. tecplot/annotation/__init__.py +7 -0
  8. tecplot/annotation/annotation.py +223 -0
  9. tecplot/annotation/geometry.py +369 -0
  10. tecplot/annotation/georeference.py +33 -0
  11. tecplot/annotation/image.py +185 -0
  12. tecplot/annotation/iter.py +105 -0
  13. tecplot/annotation/polyline.py +381 -0
  14. tecplot/annotation/text.py +744 -0
  15. tecplot/constant.py +401 -0
  16. tecplot/data/__init__.py +34 -0
  17. tecplot/data/array.py +645 -0
  18. tecplot/data/create.py +1 -0
  19. tecplot/data/dataset.py +1809 -0
  20. tecplot/data/extract.py +544 -0
  21. tecplot/data/face_neighbors.py +494 -0
  22. tecplot/data/facemap.py +814 -0
  23. tecplot/data/load.py +2075 -0
  24. tecplot/data/nodemap.py +577 -0
  25. tecplot/data/operate.py +928 -0
  26. tecplot/data/query.py +334 -0
  27. tecplot/data/save.py +343 -0
  28. tecplot/data/variable.py +280 -0
  29. tecplot/data/zone.py +841 -0
  30. tecplot/exception.py +201 -0
  31. tecplot/export/__init__.py +13 -0
  32. tecplot/export/animation.py +521 -0
  33. tecplot/export/export_setup.py +318 -0
  34. tecplot/export/image.py +577 -0
  35. tecplot/export/print_setup.py +218 -0
  36. tecplot/export/time_animation.py +607 -0
  37. tecplot/extension/__init__.py +14 -0
  38. tecplot/extension/ipython.py +68 -0
  39. tecplot/layout/__init__.py +20 -0
  40. tecplot/layout/frame.py +1285 -0
  41. tecplot/layout/layout.py +488 -0
  42. tecplot/layout/page.py +541 -0
  43. tecplot/legend/__init__.py +4 -0
  44. tecplot/legend/contour_legend.py +516 -0
  45. tecplot/legend/legend.py +141 -0
  46. tecplot/legend/line_legend.py +66 -0
  47. tecplot/legend/rgb_coloring_legend.py +291 -0
  48. tecplot/legend/scatter_legend.py +136 -0
  49. tecplot/macro.py +339 -0
  50. tecplot/plot/__init__.py +62 -0
  51. tecplot/plot/axes.py +881 -0
  52. tecplot/plot/axis.py +1350 -0
  53. tecplot/plot/blanking.py +584 -0
  54. tecplot/plot/contour.py +1302 -0
  55. tecplot/plot/effects.py +162 -0
  56. tecplot/plot/fieldmap.py +2159 -0
  57. tecplot/plot/grid.py +758 -0
  58. tecplot/plot/isosurface.py +1167 -0
  59. tecplot/plot/labels.py +338 -0
  60. tecplot/plot/linemap.py +1905 -0
  61. tecplot/plot/linking.py +489 -0
  62. tecplot/plot/plot.py +1791 -0
  63. tecplot/plot/rgb_coloring.py +281 -0
  64. tecplot/plot/scatter.py +396 -0
  65. tecplot/plot/slice.py +1544 -0
  66. tecplot/plot/streamtrace.py +1949 -0
  67. tecplot/plot/symbol.py +567 -0
  68. tecplot/plot/ticks.py +666 -0
  69. tecplot/plot/title.py +380 -0
  70. tecplot/plot/vector.py +679 -0
  71. tecplot/plot/view.py +868 -0
  72. tecplot/session/__init__.py +112 -0
  73. tecplot/session/aux_data.py +276 -0
  74. tecplot/session/config.py +92 -0
  75. tecplot/session/session.py +425 -0
  76. tecplot/session/state_changed.py +225 -0
  77. tecplot/session/style.py +504 -0
  78. tecplot/tecutil/__init__.py +16 -0
  79. tecplot/tecutil/arglist.py +230 -0
  80. tecplot/tecutil/captured_output.py +177 -0
  81. tecplot/tecutil/constant.py +1312 -0
  82. tecplot/tecutil/index_set.py +118 -0
  83. tecplot/tecutil/lock.py +36 -0
  84. tecplot/tecutil/message_pb2.py +39 -0
  85. tecplot/tecutil/preamble.py +54 -0
  86. tecplot/tecutil/stringlist.py +114 -0
  87. tecplot/tecutil/sv.py +1662 -0
  88. tecplot/tecutil/tecutil.py +12402 -0
  89. tecplot/tecutil/tecutil_client.py +627 -0
  90. tecplot/tecutil/tecutil_connector.py +937 -0
  91. tecplot/tecutil/tecutil_rpc.py +6845 -0
  92. tecplot/tecutil/util.py +332 -0
  93. tecplot/text/__init__.py +3 -0
  94. tecplot/text/font.py +224 -0
  95. tecplot/text/label_format.py +374 -0
  96. tecplot/text/textbox.py +106 -0
  97. tecplot/version.py +41 -0
@@ -0,0 +1,744 @@
1
+ import collections
2
+
3
+ from ..tecutil import _tecutil
4
+ from .. import constant, tecutil
5
+ from ..exception import TecplotSystemError
6
+
7
+
8
+ @tecutil.lock_attributes
9
+ class TextFont(object):
10
+ """Typeface and font settings for a `Text` object."""
11
+ def __init__(self, text):
12
+ self.text = text
13
+ self.uid = self.text.uid
14
+ self.frame = self.text.frame
15
+
16
+ @property
17
+ def typeface(self):
18
+ """`str`: The font family used by the `Text` object.
19
+
20
+ For consistency across various platforms, |Tecplot 360| guarantees that
21
+ the following standard typeface names are available:
22
+
23
+ * "Helvetica"
24
+ * "Times"
25
+ * "Courier"
26
+ * "Greek"
27
+ * "Math"
28
+ * "User Defined"
29
+
30
+ Other typefaces may or may not be available depending on the TrueType
31
+ fonts available. If the typeface or style is not available, a suitable
32
+ replacement will be selected. This example shows how to set the
33
+ typeface of a `Text` object to 'Times'::
34
+
35
+ >>> text = frame.add_text('abc')
36
+ >>> text.font.typeface = 'Times'
37
+ """
38
+ with self.frame.activated():
39
+ return _tecutil.TextGetTypefaceFamily(self.uid)
40
+
41
+ @typeface.setter
42
+ @tecutil.lock()
43
+ def typeface(self, value):
44
+ with self.frame.activated():
45
+ _tecutil.TextSetTypeface(self.uid, str(value), self.bold,
46
+ self.italic)
47
+
48
+ @property
49
+ def bold(self):
50
+ """`bool`: Use bold typeface in the `Text` object.
51
+
52
+ Example showing how to set the bold property of a `Text` object::
53
+
54
+ >>> text = frame.add_text('abc')
55
+ >>> text.font.bold = True
56
+ """
57
+ with self.frame.activated():
58
+ return _tecutil.TextGetTypefaceIsBold(self.uid)
59
+
60
+ @bold.setter
61
+ @tecutil.lock()
62
+ def bold(self, value):
63
+ with self.frame.activated():
64
+ _tecutil.TextSetTypeface(self.uid, self.typeface, bool(value),
65
+ self.italic)
66
+
67
+ @property
68
+ def italic(self):
69
+ """`bool`: Use italic typeface of the `Text` object.
70
+
71
+ Example showing how to set the italic property of a `Text` object::
72
+
73
+ >>> text = frame.add_text('abc')
74
+ >>> text.font.italic = True
75
+ """
76
+ with self.frame.activated():
77
+ return _tecutil.TextGetTypefaceIsItalic(self.uid)
78
+
79
+ @italic.setter
80
+ @tecutil.lock()
81
+ def italic(self, value):
82
+ with self.frame.activated():
83
+ _tecutil.TextSetTypeface(self.uid, self.typeface, self.bold,
84
+ bool(value))
85
+
86
+ @property
87
+ def size(self):
88
+ """`int`: The text size in the currently defined text size units.
89
+
90
+ Example showing how to set the text size of a `Text` object::
91
+
92
+ >>> text = frame.add_text('abc')
93
+ >>> text.font.size_units = tecplot.constant.Units.Point
94
+ >>> text.font.size = 14
95
+ """
96
+ with self.frame.activated():
97
+ return _tecutil.TextGetHeight(self.uid)
98
+
99
+ @size.setter
100
+ @tecutil.lock()
101
+ def size(self, value):
102
+ with self.frame.activated():
103
+ _tecutil.TextSetHeight(self.uid, float(value))
104
+
105
+ @property
106
+ def size_units(self):
107
+ """`Units`: Units of the text character height.
108
+
109
+ `Units` may be one of the following:
110
+
111
+ * `Units.Point`: Specify character height in points.
112
+ * `Units.Frame`: Specify character height as a percentage of frame
113
+ height
114
+ * `Units.Grid`: Specify character height in grid units.
115
+
116
+ (default = `Units.Point`)
117
+
118
+ .. note::
119
+ * One point is 1/72nd of an inch.
120
+ * `Units.Grid` is available only if position_coordinate_system is
121
+ `CoordSys.Grid`
122
+ * The position coordinate system will be changed to `CoordSys.Grid`
123
+ if size units is set to `Units.Grid`
124
+
125
+ Example showing how to set the units of the character height for a
126
+ `Text` object::
127
+
128
+ >>> from tecplot.constant import CoordSys
129
+ >>> text = frame.add_text("abc")
130
+ >>> text.position_coordinate_system = CoordSys.Grid
131
+ >>> text.font.size_units = Units.Point
132
+ """
133
+ with self.frame.activated():
134
+ return constant.Units(_tecutil.TextGetSizeUnits(self.uid))
135
+
136
+ @size_units.setter
137
+ @tecutil.lock()
138
+ def size_units(self, value):
139
+ with self.frame.activated():
140
+ size = self.size
141
+ size_units = constant.Units(value)
142
+ if size_units == constant.Units.Grid:
143
+ # if units == grid, then coord-sys must be grid
144
+ coord_sys = constant.CoordSys.Grid
145
+ else:
146
+ coord_sys = self.text.position_coordinate_system
147
+ _tecutil.TextSetCoordSysAndUnits(self.uid, coord_sys.value,
148
+ size_units.value)
149
+ self.size = size
150
+
151
+
152
+ @tecutil.lock_attributes
153
+ class TextBox(object):
154
+ """The box surrounding a `Text` object."""
155
+ def __init__(self, text):
156
+ self.text = text
157
+ self.uid = self.text.uid
158
+ self.frame = self.text.frame
159
+
160
+ @property
161
+ def line_thickness(self):
162
+ """`float`: Border line thickness.
163
+
164
+ Must be greater than 0, default: ``0.1``. Example showing how to set
165
+ the line thickness of the `text box <annotation.TextBox>`::
166
+
167
+ >>> text = frame.add_text("abc")
168
+ >>> text.box.line_thickness = 0.5
169
+ """
170
+ with self.frame.activated():
171
+ return _tecutil.TextBoxGetLineThickness(self.uid)
172
+
173
+ @line_thickness.setter
174
+ @tecutil.lock()
175
+ def line_thickness(self, value):
176
+ with self.frame.activated():
177
+ _tecutil.TextBoxSetLineThickness(self.uid, float(value))
178
+
179
+ @property
180
+ def margin(self):
181
+ """`float`: Margin between the text and the surrounding border.
182
+
183
+ Specify the margin as a percentage of the text character height. Margin
184
+ must be greater than or equal to 0.0, and may be greater than 100.
185
+ (default = 20.0)
186
+
187
+ Example showing how to set the margin of the `text box <TextBox>` for a
188
+ `Text` object::
189
+
190
+ >>> text = frame.add_text("abc")
191
+ >>> text.box.type = tecplot.constant.TextBox.Filled
192
+ >>> text.box.margin = 0.5
193
+ """
194
+ with self.frame.activated():
195
+ return _tecutil.TextBoxGetMargin(self.uid)
196
+
197
+ @margin.setter
198
+ @tecutil.lock()
199
+ def margin(self, margin):
200
+ with self.frame.activated():
201
+ _tecutil.TextBoxSetMargin(self.uid, float(margin))
202
+
203
+ @property
204
+ def fill_color(self):
205
+ """`Color`: Background fill color of the text box.
206
+
207
+ Example showing how to set the fill color of the `text box <TextBox>`
208
+ for a `Text` object::
209
+
210
+ >>> text = frame.add_text("abc")
211
+ >>> text.box.type = TextBox.Filled
212
+ >>> text.box.fill_color = tecplot.constant.Color.Blue
213
+ """
214
+ return constant.Color(_tecutil.TextBoxGetFillColor(self.uid))
215
+
216
+ @fill_color.setter
217
+ @tecutil.lock()
218
+ def fill_color(self, color):
219
+ with self.frame.activated():
220
+ _tecutil.TextBoxSetFillColor(self.uid, constant.Color(color).value)
221
+
222
+ @property
223
+ def color(self):
224
+ """`Color`: Border line color of the text box.
225
+
226
+ Default: `Color.Black`. Example showing how to set the outline color of
227
+ the `text box <TextBox>` for a `Text` object::
228
+
229
+ >>> from tecplot.constant import Color, TextBox
230
+ >>> text = frame.add_text("abc")
231
+ >>> text.box.type = TextBox.Filled
232
+ >>> text.box.color = Color.Blue
233
+ """
234
+ return constant.Color(_tecutil.TextBoxGetColor(self.uid))
235
+
236
+ @color.setter
237
+ @tecutil.lock()
238
+ def color(self, color):
239
+ with self.frame.activated():
240
+ _tecutil.TextBoxSetColor(self.uid, constant.Color(color).value)
241
+
242
+ _Pos = collections.namedtuple('TextBoxPos', 'x1 y1 x2 y2 x3 y3 x4 y4')
243
+
244
+ @property
245
+ def corner_locations(self):
246
+ """`tuple`: Position of the four corners of the `text box <TextBox>`.
247
+
248
+ **Note:** This property is read-only.
249
+
250
+ The tuple consists of 8 `floats <float>`:
251
+
252
+ * x1: X-Coordinate for bottom left corner
253
+ * y1: Y-Coordinate for bottom left corner
254
+ * x2: X-Coordinate for bottom right corner
255
+ * y2: Y-Coordinate for bottom right corner
256
+ * x3: X-Coordinate for upper right corner
257
+ * y3: Y-Coordinate for upper right corner
258
+ * x4: X-Coordinate for upper left corner
259
+ * y4: Y-Coordinate for upper left corner
260
+
261
+ There is no default, position will vary with text box properties.
262
+ Example showing how to query position of the `text box <TextBox>` for a
263
+ `Text` object. The values ``x1, ..., y4``` contain the corners
264
+ of the text box::
265
+
266
+ >>> text = frame.add_text("abc")
267
+ >>> text.box.type = tecplot.constant.TextBox.Filled
268
+ >>> x1,y1,x2,y2,x3,y3,x4,y4 = text.box.corner_locations
269
+ """
270
+ with self.frame.activated():
271
+ return TextBox._Pos(*_tecutil.TextBoxGetPosition(self.uid))
272
+
273
+ @property
274
+ def position(self):
275
+ tecutil.api_moved('TextBox.position', 'TextBox.corner_locations',
276
+ '0.13', '2018 R2')
277
+
278
+ @property
279
+ def type(self):
280
+ """`constant.TextBox`: Style of the text box fill area and border.
281
+
282
+ The text box type can be set to the following:
283
+
284
+ * None\_ - (default) No box is drawn around the text.
285
+ * Filled - A filled box around the text which is opaque. if you
286
+ place it over another |Tecplot 360| object, the underlying
287
+ object cannot be seen.
288
+ * Hollow - A plain box around the text.
289
+
290
+ Example showing how to set the type of the text box for a `TextBox`
291
+ object::
292
+
293
+ >>> text = frame.add_text("abc")
294
+ >>> text.box.type = tecplot.constant.TextBox.Filled
295
+ """
296
+ return constant.TextBox(_tecutil.TextBoxGetType(self.uid))
297
+
298
+ @type.setter
299
+ @tecutil.lock()
300
+ def type(self, value):
301
+ _tecutil.TextBoxSetType(self.uid, constant.TextBox(value).value)
302
+
303
+
304
+ @tecutil.lock_attributes
305
+ class Text(object):
306
+ """Text annotation."""
307
+ def __init__(self, uid, frame):
308
+ self.uid = uid
309
+ self.frame = frame
310
+
311
+ def __str__(self):
312
+ """String representation of the text.
313
+
314
+ Example::
315
+
316
+ >>> print(frame.add_text('Orange'))
317
+ Orange
318
+ """
319
+ return self.text_string
320
+
321
+ def __eq__(self, other):
322
+ """Checks for `Text` equality in the |Tecplot Engine|.
323
+
324
+ Returns:
325
+ `bool`: `True` if the unique ID numbers are the same for both
326
+ `Text objects <Text>`.
327
+
328
+ This example shows how the literal strings that the `Text` objects hold
329
+ are equal, but the `Text` objects themselves are different::
330
+
331
+ >>> text1 = frame.add_text('Orange')
332
+ >>> text2 = frame.add_text('Orange')
333
+ >>> text1.text_string == text2.text_string
334
+ True
335
+ >>> text1 == text2
336
+ False
337
+ """
338
+ return self.uid == other.uid
339
+
340
+ def __ne__(self, other):
341
+ """Checks for `Text` inequality in the |Tecplot Engine|.
342
+
343
+ Returns:
344
+ `bool`: `True` if the unique ID numbers are not the same for both
345
+ `Text objects <Text>`
346
+
347
+ This example shows how the literal strings that the `Text` objects hold
348
+ are equal, but the `Text` objects themselves are different::
349
+
350
+ >>> text1 = frame.add_text('Orange')
351
+ >>> text2 = frame.add_text('Orange')
352
+ >>> text1.text_string != text2.text_string
353
+ False
354
+ >>> text1 != text2
355
+ True
356
+ """
357
+ return self.uid != other.uid
358
+
359
+ @property
360
+ def type(self):
361
+ r"""`TextType`: Normal or LaTeX text type setting.
362
+
363
+ Possible values are `TextType.Regular` or `TextType.LaTeX`::
364
+
365
+ >>> text = frame.add_text(r'\alpha')
366
+ >>> text.type = TextType.LaTeX
367
+ """
368
+ return _tecutil.TextGetType(self.uid)
369
+
370
+ @type.setter
371
+ @tecutil.lock()
372
+ def type(self, value):
373
+ _tecutil.TextSetType(self.uid, constant.TextType(value).value)
374
+
375
+ @property
376
+ def box(self):
377
+ """`annotation.TextBox`: The frame and area around this `Text` object.
378
+
379
+ The text box is a rectangular frame drawn around the text. Note that in
380
+ order to show the text box, you must set TextBox.type to a value other
381
+ than `constant.TextBox.None_`.
382
+
383
+ Example showing how to enable the text box for a `Text` object::
384
+
385
+ >>> text = frame.add_text("abc")
386
+ >>> text.box.type = tecplot.constant.TextBox.Filled
387
+ """
388
+ return TextBox(self)
389
+
390
+ @property
391
+ def text_box(self):
392
+ tecutil.api_moved('Text.text_box', 'Text.box', '0.13', '2018 R2')
393
+
394
+ @property
395
+ def font(self):
396
+ """`TextFont`: Typeface properties for a `Text` object.
397
+
398
+ Example usage::
399
+
400
+ >>> text = frame.add_text('abc')
401
+ >>> text.font.typeface = 'Times'
402
+ """
403
+ return TextFont(self)
404
+
405
+ @property
406
+ def anchor(self):
407
+ """`TextAnchor`: Anchor location of this `Text` object.
408
+
409
+ Specify the anchor point, or fixed point, for the text object.
410
+ As the text object grows or shrinks, the anchor location is fixed,
411
+ while the rest of the box adjusts to accommodate the new size.
412
+ (default = `TextAnchor.Left`)
413
+
414
+ There are nine possible anchor position points, corresponding to the
415
+ left, right, and center positions on the headline, midline,
416
+ and baseline of the text box.
417
+
418
+ Example showing how to set the anchor of a `Text` object::
419
+
420
+ >>> text = frame.add_text('abc')
421
+ >>> text.anchor = tecplot.constant.TextAnchor.Center
422
+
423
+ .. seealso:: `Text.position`
424
+ """
425
+ with self.frame.activated():
426
+ return _tecutil.TextGetAnchor(self.uid)
427
+
428
+ @anchor.setter
429
+ @tecutil.lock()
430
+ def anchor(self, value):
431
+ with self.frame.activated():
432
+ _tecutil.TextSetAnchor(self.uid, constant.TextAnchor(value).value)
433
+
434
+ @property
435
+ def angle(self):
436
+ """`float` (degrees counter-clockwise): Angle of the text box in degrees.
437
+
438
+ The text angle is the orientation of the text relative to the axis.
439
+ The angle is measured in degrees counter-clockwise from horizontal.
440
+ Horizontal text is at zero degrees; vertical text is at 90 degrees.
441
+
442
+ Example showing how to set the angle of a `Text` object::
443
+
444
+ >>> text = frame.add_text('abc')
445
+ >>> text.angle = 45
446
+ """
447
+ with self.frame.activated():
448
+ return _tecutil.TextGetAngle(self.uid)
449
+
450
+ @angle.setter
451
+ @tecutil.lock()
452
+ def angle(self, value):
453
+ with self.frame.activated():
454
+ _tecutil.TextSetAngle(self.uid, float(value))
455
+
456
+ @property
457
+ def position_coordinate_system(self):
458
+ """`CoordSys`: Position coordinate system of the `Text` object.
459
+
460
+ The text object may be positioned using either the grid coordinate
461
+ system or the frame coordinate system and must be one of
462
+ `CoordSys.Frame` or `CoordSys.Grid`
463
+
464
+ If the position_coordinate_system is `CoordSys.Frame`, then the
465
+ size_units property must be `Units.Frame` or `Units.Point`.
466
+
467
+ The text object's position and text height are adjusted so that it
468
+ remains identical to its visual appearance in the original
469
+ coordinate and unit system.
470
+
471
+ If the size units are `Units.Grid` and the position coordinate system
472
+ is changed to `CoordSys.Frame`, then the size units will be changed
473
+ to `Units.Frame`. (default = CoordSys.Frame)
474
+
475
+ Example showing how to set the position coordinate system
476
+ for a `Text` object::
477
+
478
+ >>> from tecplot.constant import CoordSys
479
+ >>> text = frame.add_text("abc")
480
+ >>> text.position_coordinate_system = CoordSys.Grid
481
+
482
+ Example showing side effect if size units are `CoordSys.Grid` and
483
+ the coordinate system is changed to `CoordSys.Frame`::
484
+
485
+ >>> from tecplot.constant import CoordSys, Units
486
+ >>> text = frame.add_text("abc")
487
+ >>> text.font.size_units = Units.Grid
488
+ >>> text.position_coordinate_system = CoordSys.Frame
489
+ >>> text.position_coordinate_system
490
+ CoordSys.Frame
491
+ >>> text.font.size_units
492
+ Units.Frame
493
+ """
494
+ with self.frame.activated():
495
+ result = _tecutil.TextGetPositionCoordSys(self.uid)
496
+ return constant.CoordSys(result)
497
+
498
+ @position_coordinate_system.setter
499
+ @tecutil.lock()
500
+ def position_coordinate_system(self, value):
501
+ with self.frame.activated():
502
+ coord_sys = constant.CoordSys(value)
503
+ size_units = self.font.size_units
504
+ if (
505
+ coord_sys == constant.CoordSys.Frame and
506
+ size_units == constant.Units.Grid
507
+ ):
508
+ # if coord-sys is frame, then units can not be grid
509
+ size_units = constant.Units.Frame
510
+ _tecutil.TextSetCoordSysAndUnits(self.uid, coord_sys.value,
511
+ size_units.value)
512
+
513
+ @property
514
+ def line_spacing(self):
515
+ """`float` (default = 1.0): Spacing between lines in the text box.
516
+
517
+ Line spacing is dependent on the height of the text and the size unit
518
+ system in which it is drawn. This example shows how to set the line
519
+ spacing of a `Text` object::
520
+
521
+ >>> text = frame.add_text('abc')
522
+ >>> text.line_spacing = 4
523
+ """
524
+ with self.frame.activated():
525
+ return _tecutil.TextGetLineSpacing(self.uid)
526
+
527
+ @line_spacing.setter
528
+ @tecutil.lock()
529
+ def line_spacing(self, line_spacing):
530
+ with self.frame.activated():
531
+ _tecutil.TextSetLineSpacing(self.uid, float(line_spacing))
532
+
533
+ @property
534
+ def text_string(self):
535
+ """`str`: The text to be displayed in a text box.
536
+
537
+ You can embed Greek, Math, and User-defined characters into
538
+ English-font strings by enclosing them with text formatting tags,
539
+ together with the keyboard characters.
540
+
541
+ The text formatting tags and their effects are as follows. Format tags
542
+ are not case sensitive and may be either upper or lower case:
543
+
544
+ * <b>...</b> - Boldface
545
+ * <i>...</i> - Italic
546
+ * <verbatim>...</verbatim> - Verbatim
547
+ * <sub>...</sub> - Subscripts
548
+ * <sup>...</sup> - Superscripts
549
+ * <greek>...</greek> - Greek font.
550
+ * <math>...</math> - Math font.
551
+ * <userdef>...</userdef> - User-defined font.
552
+ * <helvetica>...</helvetica> - Helvetica font.
553
+ * <times>...</times> - Times font.
554
+ * <courier>...</courier> - Courier font.
555
+
556
+ Not all fonts have Bold and/or Italic variants. For fonts that do not
557
+ have these styles, the <b> and/or <i> tags may have no effect.
558
+
559
+ Embedding and escaping special characters work only in English-font
560
+ text; they have no effect in text created in Greek, Math, or
561
+ User-defined character sets.
562
+
563
+ You can produce subscripts or superscripts by enclosing any characters
564
+ with <sub>...</sub> or <sup>...</sup>, respectively. |Tecplot 360| has
565
+ only one level of superscripts and subscripts. Expressions requiring
566
+ additional levels must be created by hand using multiple text objects.
567
+ If you alternate subscripts and superscripts, |Tecplot 360| positions
568
+ the superscript directly above the subscript. To produce consecutive
569
+ superscripts, enclose all superscript characters in a single pair of
570
+ tags.
571
+
572
+ To insert a tag into text literally, precede the first angle bracket
573
+ with a backslash ("\"). To insert a backslash in the text, just type
574
+ two backslashes ("\\"). This example shows how to set the text string
575
+ of a `Text` object::
576
+
577
+ >>> text = frame.add_text('abc')
578
+ >>> text.text_string
579
+ 'abc'
580
+ >>> text.text_string ='def'
581
+ >>> text.text_string
582
+ 'def'
583
+ """
584
+ with self.frame.activated():
585
+ success, text_string = _tecutil.TextGetString(self.uid)
586
+ if not success:
587
+ raise TecplotSystemError()
588
+ return text_string
589
+
590
+ @text_string.setter
591
+ @tecutil.lock()
592
+ def text_string(self, value):
593
+ with self.frame.activated():
594
+ _tecutil.TextSetString(self.uid, str(value))
595
+
596
+ @property
597
+ @tecutil.lock()
598
+ def position(self):
599
+ r"""`tuple`: Anchor position of the `Text`.
600
+
601
+ This is the position of the `Text` on the `Frame <layout.Frame>` and will be
602
+ :math:`(x,y)` or :math:`(\theta,r)` depending on the plot type
603
+ (Cartesian or polar). This example shows how to set the anchor position
604
+ of a `Text` object::
605
+
606
+ >>> text = frame.add_text("abc")
607
+ >>> text.position = (1.0, 2.0)
608
+
609
+ .. seealso:: `Text.anchor`
610
+ """
611
+ with self.frame.activated():
612
+ pos = _tecutil.TextGetAnchorPos(self.uid)
613
+ if self.position_coordinate_system == constant.CoordSys.Grid3D:
614
+ return tecutil.XYZ(*pos)
615
+ else:
616
+ return tecutil.XY(*pos[:2])
617
+
618
+ @position.setter
619
+ @tecutil.lock()
620
+ def position(self, values):
621
+ pos = tecutil.XYZ(*[float(x) for x in values])
622
+ with self.frame.activated():
623
+ _tecutil.TextSetAnchorPos(self.uid, pos.x or 0., pos.y or 0.,
624
+ pos.z or 0.)
625
+
626
+ @property
627
+ def anchor_position(self):
628
+ tecutil.api_moved('Text.anchor_position', 'Text.position',
629
+ '0.13', '2018 R2')
630
+
631
+ @anchor_position.setter
632
+ def anchor_position(self, values):
633
+ tecutil.api_moved('Text.anchor_position', 'Text.position',
634
+ '0.13', '2018 R2')
635
+
636
+ @property
637
+ def scope(self):
638
+ """`Scope`: The `Scope` (local or global) of the `Text`.
639
+
640
+ `Annotations <Annotation>` with local scope are displayed only in the
641
+ `frame <layout.Frame>` in which they are created. If the `annotation
642
+ <Annotation>` is defined as having `global <Scope.Global>` scope, it
643
+ will appear in all "like" `frames <layout.Frame>`. That is, those frames using
644
+ the same data set as the one in which the `annotation <Annotation>` was
645
+ created. (default: `Scope.Local`)
646
+
647
+ Example showing how to set the scope of a `Text` object::
648
+
649
+ >>> text = frame.add_text("abc")
650
+ >>> text.scope = tecplot.constant.Scope.Global
651
+ """
652
+ return constant.Scope(_tecutil.TextGetScope(self.uid))
653
+
654
+ @scope.setter
655
+ @tecutil.lock()
656
+ def scope(self, scope):
657
+ _tecutil.TextSetScope(self.uid, constant.Scope(scope).value)
658
+
659
+ @property
660
+ def attached_map_index(self):
661
+ """`Index` or `None`: Index of the attached fieldmap or linemap.
662
+
663
+ Example showing how to set the attached object `Index` of a `Text`
664
+ object::
665
+
666
+ >>> text = frame.add_text("abc")
667
+ >>> text.attached_map_index = 1
668
+ """
669
+ with self.frame.activated():
670
+ if _tecutil.TextIsAttached(self.uid):
671
+ return tecutil.Index(_tecutil.TextGetZoneOrMap(self.uid) - 1)
672
+
673
+ @attached_map_index.setter
674
+ @tecutil.lock()
675
+ def attached_map_index(self, value):
676
+ with self.frame.activated():
677
+ if value is None:
678
+ _tecutil.TextSetAttached(self.uid, False)
679
+ else:
680
+ _tecutil.TextSetAttached(self.uid, True)
681
+ _tecutil.TextSetZoneOrMap(self.uid, tecutil.Index(value) + 1)
682
+
683
+ @property
684
+ def zone_or_map(self):
685
+ tecutil.api_moved('Text.zone_or_map', 'Text.attached_map_index',
686
+ '0.13', '2018 R2')
687
+
688
+ @zone_or_map.setter
689
+ def zone_or_map(self, value):
690
+ tecutil.api_moved('Text.zone_or_map', 'Text.attached_map_index',
691
+ '0.13', '2018 R2')
692
+
693
+ @property
694
+ def color(self):
695
+ """`Color`: `Color` of the `Text` object.
696
+
697
+ Default: `Color.Black`. Example showing how to set the `Color` of a
698
+ `Text` object::
699
+
700
+ >>> text = frame.add_text("abc")
701
+ >>> text.color = tecplot.constant.Color.Blue
702
+ """
703
+ return constant.Color(_tecutil.TextGetColor(self.uid))
704
+
705
+ @color.setter
706
+ @tecutil.lock()
707
+ def color(self, color):
708
+ with self.frame.activated():
709
+ _tecutil.TextSetColor(self.uid, constant.Color(color).value)
710
+
711
+ @property
712
+ def clipping(self):
713
+ """`Clipping`: `Clipping` properties of the `Text`
714
+
715
+ Clipping refers to displaying only that portion of an object that falls
716
+ within a specified clipping region of the plot. If you have specified
717
+ your text position in the Frame coordinate system, the `Text`
718
+ will be clipped to the frame. Default: `Clipping.ClipToViewport`.
719
+
720
+ If you have specified the Grid coordinate system, you can choose to
721
+ clip your `Text` to the frame or the viewport. The size of the
722
+ viewport depends on the plot type as follows:
723
+
724
+ * 3D Cartesian - The viewport is the same as the frame, so viewport
725
+ clipping is the same as frame clipping.
726
+ * 2D Cartesian/XY Line - The viewport is defined by the extents of
727
+ the X and Y axes.
728
+ * Polar Line/Sketch - By default, the viewport is the same as the
729
+ frame.
730
+
731
+ Example showing how to set the clipping of a `Text`::
732
+
733
+ >>> text = frame.add_text('abc')
734
+ >>> text.clipping = tecplot.constant.Clipping.ClipToFrame
735
+ """
736
+ with self.frame.activated():
737
+ return constant.Clipping(_tecutil.TextGetClipping(self.uid))
738
+
739
+ @clipping.setter
740
+ @tecutil.lock()
741
+ def clipping(self, clipping):
742
+ with self.frame.activated():
743
+ _tecutil.TextSetClipping(self.uid,
744
+ constant.Clipping(clipping).value)