Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / utilities / postProcessing / dataConversion / foamToTecplot360 / tecio / examples / squares / squares.cpp
blobe5d9a0f5e2bba0a945ac5f2873d5f3cccc0c0825
1 /* This example creates a group of square geometries, each with a
2 * different fill color */
3 #if defined _MSC_VER
4 #pragma warning (disable: 4996) /* Windows strcpy warning off */
5 #endif
7 /* DOCSTART:tecgeo.txt*/
8 #include "TECIO.h"
9 #include <string.h>
11 int main()
13 INTEGER4 Debug = 1;
14 INTEGER4 VIsDouble = 0;
15 INTEGER4 FileType = 0;
16 INTEGER4 I = 0; /* use to check return values */
19 /* Open the file and write the tecplot datafile
20 * header information
22 I = TECINI112((char*)"Square Geometries",
23 (char*)"X Y P",
24 (char*)"squares.plt",
25 (char*)".",
26 &FileType,
27 &Debug,
28 &VIsDouble);
30 double ZPos = 0.0; /* N/A for squares */
31 double XPos;
32 double YPos;
34 INTEGER4 PosCoordMode = 0; /* use grid coordinates */
36 /* opt not to attach the text to a given zone. When text is
37 * attached to a given zone, it is displayed only when the zone
38 * is displayed.
40 INTEGER4 AttachToZone = 0;
41 INTEGER4 Zone = 1;
43 /* Set the Geometry Style Values */
44 INTEGER4 Color = 0; /* set the outline color to
45 * black
47 INTEGER4 IsFilled = 1;
48 INTEGER4 GeomType = 2; /* set the geometry type to
49 * square
51 INTEGER4 LinePattern = 5; /* set the line pattern to
52 * DashDotDot
54 double PatternLength = .1;
55 double LineThick = .2;
57 /* N/A for square geometries */
58 INTEGER4 NumPts = 100;
59 INTEGER4 ArrowStyle = 1;
60 INTEGER4 ArrowAttach = 0;
61 double ArrowSize = 1;
62 double ArrowAngle = 30;
63 INTEGER4 NumSegments = 15;
64 INTEGER4 NumSegPts = 25;
67 INTEGER4 Scope = 1; /* set the text to "local", i.e.
68 * available in the current frame
69 * only.
71 INTEGER4 Clipping = 1;
73 /* Specify the length of a side of the square. The units used
74 * are those defined with PosCoordMode.
76 float XGeomData = 2.5;
78 float YGeomData = 0; /* N/A for square geometries */
79 float ZGeomData = 0; /* N/A for square geometries */
81 char * MFC = new char[128];
82 strcpy(MFC, "SQUARE");
84 for (INTEGER4 ii = 0; ii <= 7; ii++)
86 INTEGER4 FillColor = ii;
87 XPos = (double) ii;
88 YPos = (double) ii;
90 I = TECGEO112(&XPos,
91 &YPos,
92 &ZPos,
93 &PosCoordMode,
94 &AttachToZone,
95 &Zone,
96 &Color,
97 &FillColor,
98 &IsFilled,
99 &GeomType,
100 &LinePattern,
101 &PatternLength,
102 &LineThick,
103 &NumPts,
104 &ArrowStyle,
105 &ArrowAttach,
106 &ArrowSize,
107 &ArrowAngle,
108 &Scope,
109 &Clipping,
110 &NumSegments,
111 &NumSegPts,
112 &XGeomData,
113 &YGeomData,
114 &ZGeomData,
115 MFC);
118 I = TECEND112();
120 delete MFC;
121 return 0;
124 /* DOCEND */