foam to Tecplot360 converter
[OpenFOAM-1.6.x.git] / applications / utilities / postProcessing / dataConversion / foamToTecplot360 / tecio / examples / text / text.cpp
blob66df8d723d2c86241987a8969878a4c8add75542
1 /* This example demonstrates adding a text object to a Tecplot
2 * data file.
3 */
4 #if defined _MSC_VER
5 #pragma warning (disable: 4996) /* Windows strcpy warning off */
6 #endif
8 /* DOCSTART:tectxt.txt*/
9 #include "TECIO.h"
10 #include <string.h>
12 int main()
14 /* Open the file & write the datafile header information */
15 INTEGER4 Debug = 1;
16 INTEGER4 VIsDouble = 0;
17 INTEGER4 FileType = 0;
18 INTEGER4 I = 0; /* used to check the return value */
20 I = TECINI112((char*)"Text",
21 (char*)"X Y P",
22 (char*)"text.plt",
23 (char*)".",
24 &FileType,
25 &Debug,
26 &VIsDouble);
28 /* Specify the X, Y and Z position of the anchor point */
29 double XPos = 0.0;
30 double YPos = 1.0;
31 double ZPos = 0.0; /* N/A for 2D text */
33 INTEGER4 PosCoordMode = 0; /* use grid coordinates */
35 /* opt not to attach the text to a given zone. When text is
36 * attached to a given zone, it is displayed only when the zone
37 * is displayed.
39 INTEGER4 AttachToZone = 0;
40 INTEGER4 Zone = 2;
43 /* Specify the font values */
44 INTEGER4 Font = 1; /* Helvetica Bold */
45 INTEGER4 FontHeightUnits = 2; /* in grid coordinates */
46 double FontHeight = 18;
48 /* Set the box style parameters */
49 INTEGER4 BoxType = 1; /* filled box */
50 double BoxMargin = .5; /* margin between the text
51 * and the text box
53 double BoxLineThickness = .1;
54 INTEGER4 BoxColor = 0; /* set the box line color
55 * to black.
57 INTEGER4 BoxFillColor = 1; /* set the box fill color
58 * to red.
61 /* set the font properties */
62 double Angle = 30; /* angle of the text */
63 INTEGER4 Anchor = 1; /* set the anchor point to
64 * the center of the text
65 * box.
67 double LineSpacing = 1.5;
68 INTEGER4 TextColor = 7; /* set the font color to
69 * white
72 INTEGER4 Scope = 1; /* set the text to "local",
73 * i.e. available in the
74 * current frame only.
76 INTEGER4 Clipping = 1;
79 char Text[60];
80 char MFC[24];
81 strcpy(Text, "Sample Text");
82 strcpy(MFC, "My Macro");
84 I = TECTXT112(&XPos,
85 &YPos,
86 &ZPos,
87 &PosCoordMode,
88 &AttachToZone,
89 &Zone,
90 &Font,
91 &FontHeightUnits,
92 &FontHeight,
93 &BoxType,
94 &BoxMargin,
95 &BoxLineThickness,
96 &BoxColor,
97 &BoxFillColor,
98 &Angle,
99 &Anchor,
100 &LineSpacing,
101 &TextColor,
102 &Scope,
103 &Clipping,
104 Text,
105 MFC);
107 I = TECEND112();
109 return 0;
112 /* DOCEND */