Example 416: 3D Scatter with complex annotations AxisDirection MajorMinorRadii

Pe3do3D Scientific Objectadvanced

3D Scatter with complex annotations AxisDirection MajorMinorRadii

Preview

ProEssentials Pe3do 3D Scientific Object - 3D Scatter with complex annotations AxisDirection MajorMinorRadii
Click to enlarge

Source Code

Form6.cs
1//! Double Click to start and stop Auto Rotation. //
2//! Click and drag scroll bar thumb tabs to quickly rotate. //
3//! Right button click to show popup menu. //
4
5// Non-Surface chart, set PolyMode //
6Pe3do1.PePlot.PolyMode = PolyMode.Scatter;
7
8// Set the amount of data //
9Pe3do1.PeData.Subsets = 10;
10Pe3do1.PeData.Points = 100;
11
12Pe3do1.PeData.X[9, 99] = 0.0F; // tip to pre allocate memory if not using FastCopyFrom
13Pe3do1.PeData.Y[9, 99] = 0.0F; // set last point first
14Pe3do1.PeData.Z[9, 99] = 0.0F; // but it's not critical
15
16// Pass data, First two subsets //
17int s, p;
18for (s = 0; s <= 1; s++)
19{
20 for (p = 0; p <= 99; p++)
21 {
22 Pe3do1.PeData.X[s, p] = (float)(10.0F * Math.Cos(p * 0.24));
23 if (s == 0)
24 Pe3do1.PeData.Y[s, p] = (float)((30.0F * Math.Cos(p * 0.22)) + (10.0F * Math.Sin((s * 0.1) * 0.94)));
25 else
26 Pe3do1.PeData.Y[s, p] = (float)((30.0F * Math.Cos(p * 0.1)) + (10.0F * Math.Cos((s * 0.25) * 0.6)));
27 Pe3do1.PeData.Z[s, p] = (float)(10.0F * (Math.Sin(p * 0.08)));
28 }
29}
30
31float f2, f;
32for (s = 2; s <= 3; s++)
33{
34 for (p = 0; p <= 99; p++)
35 {
36 f2 = (float)(15.0F * Math.Cos(p * 0.14));
37 f2 = f2 + 50;
38 Pe3do1.PeData.X[s, p] = f2;
39 if (s == 2)
40 {
41 f = (float)((15.0 * Math.Cos(p * 0.2)) + (30.0F * Math.Sin((s * 0.1) * 0.74)));
42 Pe3do1.PeData.Y[s, p] = 30.0F + f;
43 }
44 else
45 {
46 f = (float)((15.0F * Math.Cos(p * 0.1)) + (30.0F * Math.Cos((s * 0.25) * 0.74)));
47 Pe3do1.PeData.Y[s, p] = -30.0F + f;
48 }
49 f = (float)(15.0F * (Math.Sin(p * 0.16)));
50 Pe3do1.PeData.Z[s, p] = f + 50.0F;
51 }
52}
53
54// Pass more data, Third two subsets //
55for (s = 4; s <= 5; s++)
56{
57 for (p = 0; p <= 99; p++)
58 {
59 f2 = (float)(10.0F * Math.Cos(p * 0.07));
60 f2 = f2 - 50;
61 Pe3do1.PeData.X[s, p] = f2;
62 if (s == 4)
63 {
64 f = (float)((10.0F * Math.Cos(p * 0.08)) + (20.0 * Math.Sin((s * 0.07) * 0.64)));
65 Pe3do1.PeData.Y[s, p] = f + 50;
66 }
67 else
68 {
69 f = (float)((10.0F * Math.Cos(p * 0.2)) + (20.0F * Math.Cos((s * 0.15) * 1.94)));
70 Pe3do1.PeData.Y[s, p] = f + 40.0F;
71 }
72 f = (float)(10.0F * (Math.Sin(p * 0.09)));
73 Pe3do1.PeData.Z[s, p] = f + 50.0F;
74 }
75}
76
77// Pass more data, Fourth two subsets //
78for (s = 6; s <= 7; s++)
79{
80 for (p = 0; p <= 99; p++)
81 {
82 f2 = (float)(14.0F * Math.Cos(p * 0.12));
83 f2 = f2 - 50;
84 Pe3do1.PeData.X[s, p] = f2;
85 if (s == 6)
86 {
87 f = (float)((14.0F * Math.Cos(p * 0.3)) + (20.0F * Math.Sin((s * 0.08) * 1.74)));
88 Pe3do1.PeData.Y[s, p] = f - 30.0F;
89 }
90 else
91 {
92 f = (float)((14.0F * Math.Cos(p * 0.2)) + (20.0F * Math.Cos((s * 0.75) * 0.77)));
93 Pe3do1.PeData.Y[s, p] = f - 30.0F;
94 }
95 f = (float)(12.0F * (Math.Sin(p * 0.36)));
96 Pe3do1.PeData.Z[s, p] = f - 50.0F;
97 }
98}
99
100// Pass more data, Fifth two subsets //
101for (s = 8; s <= 9; s++)
102{
103 for (p = 0; p <= 99; p++)
104 {
105 f2 = (float)(12.0F * Math.Cos(p * 0.14));
106 f2 = f2 + 50.0F;
107 Pe3do1.PeData.X[s, p] = f2;
108 if (s == 8)
109 {
110 f = (float)((12.0F * Math.Cos(p * 0.1)) + (20.0F * Math.Sin((s * 0.02) * 3.74)));
111 Pe3do1.PeData.Y[s, p] = f + 40.0F;
112 }
113 else
114 {
115 f = (float)((12.0F * Math.Cos(p * 0.2)) + (20.0F * Math.Cos((s * 0.05) * 5.74)));
116 Pe3do1.PeData.Y[s, p] = f + 50.0F;
117 }
118 f = (float)(12.0F * (Math.Sin(p * 0.16)));
119 Pe3do1.PeData.Z[s, p] = f - 50.0F;
120 }
121}
122
123// Manually scaling Plus setting GridAspect helps knowing ratios when determine annotation radius values below //
124
125Pe3do1.PeGrid.Configure.ManualScaleControlX = ManualScaleControl.MinMax;
126Pe3do1.PeGrid.Configure.ManualMinX = -80;
127Pe3do1.PeGrid.Configure.ManualMaxX = 80;
128
129Pe3do1.PeGrid.Configure.ManualScaleControlZ = ManualScaleControl.MinMax;
130Pe3do1.PeGrid.Configure.ManualMinZ = -80;
131Pe3do1.PeGrid.Configure.ManualMaxZ = 80;
132
133Pe3do1.PeGrid.Configure.ManualScaleControlY = ManualScaleControl.MinMax;
134Pe3do1.PeGrid.Configure.ManualMinY = -80;
135Pe3do1.PeGrid.Configure.ManualMaxY = 80;
136
137Pe3do1.PeGrid.Option.GridAspectY = 1.0F;
138Pe3do1.PeGrid.Option.GridAspectX = 1.0F;
139Pe3do1.PeGrid.Option.GridAspectZ = 1.0F;
140
141Pe3do1.PeFont.FontSize = FontSize.Large;
142Pe3do1.PeFont.Fixed = true;
143
144Pe3do1.PeString.MainTitle = "3D Scatter plus Complex Annotations";
145Pe3do1.PeString.SubTitle = "Annotations via Axis Direction vector and Major Minor Radii";
146Pe3do1.PeString.MultiSubTitles[0] = "|MouseMove draws ellipse perpendicular to data|";
147
148Pe3do1.PeConfigure.RenderEngine = RenderEngine.Direct3D;
149Pe3do1.PeColor.BitmapGradientMode = false;
150Pe3do1.PeColor.QuickStyle = QuickStyle.DarkNoBorder;
151
152Pe3do1.PeColor.GraphForeground = Color.White;
153Pe3do1.PeColor.XZBackColor = Color.FromArgb(255, 85, 85, 85);
154Pe3do1.PeColor.YBackColor = Color.FromArgb(255, 85, 85, 85);
155
156// Set Zoom Limits on MouseWheel Zooming
157Pe3do1.PePlot.Option.DxZoomMax = 4.0F;
158Pe3do1.PePlot.Option.DxZoomMin = -3.0F;
159Pe3do1.PePlot.Option.DxViewportPanFactor = 1.25F; // Make Shift and Drag more responsive
160Pe3do1.PeUserInterface.Scrollbar.MouseWheelZoomFactor = 3.5F; // Set MouseWheel Zoom more responsive
161
162// Enable smooth rotating and zooming //
163Pe3do1.PeUserInterface.Scrollbar.ScrollSmoothness = 5;
164Pe3do1.PeUserInterface.Scrollbar.MouseWheelZoomSmoothness = 5;
165Pe3do1.PeUserInterface.Scrollbar.PinchZoomSmoothness = 2;
166
167// Do not auto fit to shape of window //
168Pe3do1.PePlot.Option.DxFitControlShape = false;
169
170// Set camera position //
171Pe3do1.PeUserInterface.Scrollbar.ViewingHeight = 28;
172Pe3do1.PeUserInterface.Scrollbar.DegreeOfRotation = 307;
173Pe3do1.PePlot.Option.DxZoom = 1.05F;
174
175// Enable button dragging //
176Pe3do1.PeUserInterface.Scrollbar.MouseDraggingX = true;
177Pe3do1.PeUserInterface.Scrollbar.MouseDraggingY = true;
178
179Pe3do1.PeUserInterface.Menu.AnnotationControl = true; // v9.5
180Pe3do1.PeUserInterface.Menu.ShowAnnotationText = MenuControl.Show;
181Pe3do1.PeUserInterface.Menu.AnnotationTextFixedSize = MenuControl.Show;
182
183// To best render Translucent annotations and data
184// Note Lines As Tubes is currently not supported in OIT due to OIT not supporting GeometricShaders
185Pe3do1.PeColor.DxTransparencyMode = TransparencyMode.OIT;
186Pe3do1.PePlot.LinesOrTubes = LinesOrTubes.AllLines;
187
188// Note, this example uses GraphAnnotationType.AxisDirection to define a vector pointing in direction of object and/or face of object //
189// Optionally, one can use GraphAnnotationType.AxisAngles to define x = AngleRotationHorizontal, and y = AngleRotationVertical
190// And Optionally direct low level vectors GraphAnnotationType.MajorDirection and GraphAnnotationType.MinorDirection
191// If MajorDirection MinorDirection are defined, they take presedence, Else AxisDirection takes presedence, then AxisAngles.
192
193int aCnt = 0;
194
195// Drawing an Arrow //
196Pe3do1.PeAnnotation.Graph.X[aCnt] = 10;
197Pe3do1.PeAnnotation.Graph.Y[aCnt] = -70F;
198Pe3do1.PeAnnotation.Graph.Z[aCnt] = -50F;
199Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.ThinSolidLine;
200Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
201Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(255, 0, 255, 0);
202aCnt++;
203Pe3do1.PeAnnotation.Graph.X[aCnt] = 10;
204Pe3do1.PeAnnotation.Graph.Y[aCnt] = 50F;
205Pe3do1.PeAnnotation.Graph.Z[aCnt] = -50F;
206Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.ArrowLarge;
207Pe3do1.PeAnnotation.Graph.Text[aCnt] = "Cone along Y Axis";
208Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(255, 0, 255, 0);
209aCnt++;
210
211// If needed define a ThinSolid line in outer space to trigger complex annotations sphere/cylinders to render as WireFrame
212//Pe3do1.PeAnnotation.Graph.X[aCnt] = 200000000.0F;
213//Pe3do1.PeAnnotation.Graph.Z[aCnt] = 200000000.0F;
214//Pe3do1.PeAnnotation.Graph.Y[aCnt] = 200000000.0F;
215//Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.ThinSolidLine;
216//Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
217//Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(255, 255, 0, 0);
218//aCnt++;
219
220// If needed, define a SquareSolid in outer space to trigger complex annotations sphere/cylinders to render as Solid
221Pe3do1.PeAnnotation.Graph.X[aCnt] = 200000000.0F;
222Pe3do1.PeAnnotation.Graph.Y[aCnt] = 200000000.0F;
223Pe3do1.PeAnnotation.Graph.Z[aCnt] = 200000000.0F;
224Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.SquareSolid;
225Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
226Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(0, 0, 0, 0);
227aCnt++;
228
229// Example of drawing Cylinder //
230
231// Define the direction the cylinder spans //
232Pe3do1.PeAnnotation.Graph.X[aCnt] = 0;
233Pe3do1.PeAnnotation.Graph.Y[aCnt] = 1;
234Pe3do1.PeAnnotation.Graph.Z[aCnt] = 0;
235Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
236Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.AxisDirection;
237aCnt++;
238
239// Defines radius size for start of cylinder, z is ignored //
240Pe3do1.PeAnnotation.Graph.X[aCnt] = 5;
241Pe3do1.PeAnnotation.Graph.Y[aCnt] = 5;
242Pe3do1.PeAnnotation.Graph.Z[aCnt] = 1;
243Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
244Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.MajorMinorRadii;
245aCnt++;
246
247// Defines location of start of cylinder
248Pe3do1.PeAnnotation.Graph.X[aCnt] = 10.0F;
249Pe3do1.PeAnnotation.Graph.Y[aCnt] = -70.0F;
250Pe3do1.PeAnnotation.Graph.Z[aCnt] = -50.0F;
251Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)GraphAnnotationType.CylinderStart;
252Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
253Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(55, 0, 255, 0);
254aCnt++;
255
256// Defines radius size of end of cylinder, since different radius, we're create a cone
257Pe3do1.PeAnnotation.Graph.X[aCnt] = 20;
258Pe3do1.PeAnnotation.Graph.Y[aCnt] = 20;
259Pe3do1.PeAnnotation.Graph.Z[aCnt] = 1;
260Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
261Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.MajorMinorRadii;
262aCnt++;
263
264// Completes the Cylinder //
265Pe3do1.PeAnnotation.Graph.HotSpot[aCnt] = true;
266Pe3do1.PeAnnotation.Graph.X[aCnt] = 10.0F;
267Pe3do1.PeAnnotation.Graph.Y[aCnt] = 50.0F;
268Pe3do1.PeAnnotation.Graph.Z[aCnt] = -50.0F;
269Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)GraphAnnotationType.Cylinder;
270Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
271Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(55, 0, 255, 0);
272aCnt++;
273
274// Draw a 2D ellipse to form bottom of cone / cylinder
275// The state of AxisDirection is already defined so no need to set the AxisDirection
276
277// Define the radius of the ellipse
278// Major is perpendicular to axis direction (vertical), so x and z are major minor
279Pe3do1.PeAnnotation.Graph.X[aCnt] = 5.0F; // X and Z Data are same units and same GridAspect, so 5 and 5 creates circle
280Pe3do1.PeAnnotation.Graph.Y[aCnt] = 5.0F;
281Pe3do1.PeAnnotation.Graph.Z[aCnt] = 0;
282Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
283Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.MajorMinorRadii;
284aCnt++;
285
286// Complete the Ellipse, providing location in 3D space
287Pe3do1.PeAnnotation.Graph.HotSpot[aCnt] = true;
288Pe3do1.PeAnnotation.Graph.X[aCnt] = 10.0F;
289Pe3do1.PeAnnotation.Graph.Y[aCnt] = -70.0F;
290Pe3do1.PeAnnotation.Graph.Z[aCnt] = -50.0F;
291Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.EllipseFill;
292Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
293Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(255, 255, 255, 0);
294aCnt++;
295
296// Example of drawing 2D Ellipse with different AxisDirection
297
298// Define the direction of the face of the ellipse //
299Pe3do1.PeAnnotation.Graph.X[aCnt] = 1.0F;
300Pe3do1.PeAnnotation.Graph.Y[aCnt] = 0.0F;
301Pe3do1.PeAnnotation.Graph.Z[aCnt] = 0.0F;
302Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
303Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.AxisDirection;
304aCnt++;
305
306// Define the radius of the ellipse
307Pe3do1.PeAnnotation.Graph.X[aCnt] = 10.0F;
308Pe3do1.PeAnnotation.Graph.Y[aCnt] = 10.0;
309Pe3do1.PeAnnotation.Graph.Z[aCnt] = 0;
310Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
311Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.MajorMinorRadii;
312aCnt++;
313
314// Complete the Ellipse, providing location in 3D space
315Pe3do1.PeAnnotation.Graph.HotSpot[aCnt] = true;
316Pe3do1.PeAnnotation.Graph.X[aCnt] = -50.0F;
317Pe3do1.PeAnnotation.Graph.Y[aCnt] = -50.0F;
318Pe3do1.PeAnnotation.Graph.Z[aCnt] = 50.0F;
319Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.EllipseFill;
320Pe3do1.PeAnnotation.Graph.Text[aCnt] = "2D Ellipse";
321Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(255, 255, 255, 0);
322aCnt++;
323
324// Drawing an Arrow traveling though center of Ellipse //
325Pe3do1.PeAnnotation.Graph.X[aCnt] = -40;
326Pe3do1.PeAnnotation.Graph.Y[aCnt] = -50F;
327Pe3do1.PeAnnotation.Graph.Z[aCnt] = 50F;
328Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.ThinSolidLine;
329Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
330Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(255, 0, 255, 0);
331aCnt++;
332
333Pe3do1.PeAnnotation.Graph.X[aCnt] = -60;
334Pe3do1.PeAnnotation.Graph.Y[aCnt] = -50F;
335Pe3do1.PeAnnotation.Graph.Z[aCnt] = 50F;
336Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.ArrowMedium;
337Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
338Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(255, 0, 255, 0);
339aCnt++;
340
341// Drawing a Sphere, because the last annotation was a thin line, the sphere will render as a wireframe
342Pe3do1.PeAnnotation.Graph.X[aCnt] = 25F;
343Pe3do1.PeAnnotation.Graph.Y[aCnt] = 25F;
344Pe3do1.PeAnnotation.Graph.Z[aCnt] = 0;
345Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
346Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.MajorMinorRadii;
347aCnt++;
348
349Pe3do1.PeAnnotation.Graph.X[aCnt] = 50.0F;
350Pe3do1.PeAnnotation.Graph.Y[aCnt] = -20.0F;
351Pe3do1.PeAnnotation.Graph.Z[aCnt] = -15.0F;
352Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)GraphAnnotationType.Sphere;
353Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
354Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(255, 155, 255, 0);
355aCnt++;
356
357// Define an SquareSolid in outer space to trigger complex annotations to render as Solid
358Pe3do1.PeAnnotation.Graph.X[aCnt] = 200000000.0F;
359Pe3do1.PeAnnotation.Graph.Z[aCnt] = 200000000.0F;
360Pe3do1.PeAnnotation.Graph.Y[aCnt] = 200000000.0F;
361Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.SquareSolid;
362Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
363Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(0, 0, 0, 0);
364aCnt++;
365
366// Drawing a Sphere, this time Solid, Translucent, and slightly larger than previous sphere
367Pe3do1.PeAnnotation.Graph.X[aCnt] = 27.0F;
368Pe3do1.PeAnnotation.Graph.Y[aCnt] = 27.0F;
369Pe3do1.PeAnnotation.Graph.Z[aCnt] = 0;
370Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
371Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.MajorMinorRadii;
372aCnt++;
373
374Pe3do1.PeAnnotation.Graph.X[aCnt] = 50.0F;
375Pe3do1.PeAnnotation.Graph.Y[aCnt] = -20.0F;
376Pe3do1.PeAnnotation.Graph.Z[aCnt] = -15.0F;
377Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)GraphAnnotationType.Sphere;
378Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
379Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(45, 155, 255, 0);
380aCnt++;
381
382// Example of drawing Box //
383
384// Define the direction the box spans //
385Pe3do1.PeAnnotation.Graph.X[aCnt] = 1; // along x axis
386Pe3do1.PeAnnotation.Graph.Y[aCnt] = 0; // .05 to skew the ends of box
387Pe3do1.PeAnnotation.Graph.Z[aCnt] = 0;
388Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
389Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.AxisDirection;
390aCnt++;
391
392// Defines radius size for start of Box, z is ignored // major is perpendicular to axis direction, thus y and z are major minor
393Pe3do1.PeAnnotation.Graph.X[aCnt] = 15;
394Pe3do1.PeAnnotation.Graph.Y[aCnt] = 15;
395Pe3do1.PeAnnotation.Graph.Z[aCnt] = 0;
396Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
397Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.MajorMinorRadii;
398aCnt++;
399
400// Defines location of start of Box
401Pe3do1.PeAnnotation.Graph.X[aCnt] = -70.0F;
402Pe3do1.PeAnnotation.Graph.Y[aCnt] = 10.0F;
403Pe3do1.PeAnnotation.Graph.Z[aCnt] = 0.0F;
404Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)GraphAnnotationType.BoxStart;
405Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
406aCnt++;
407
408// Complete the Box
409Pe3do1.PeAnnotation.Graph.HotSpot[aCnt] = true;
410Pe3do1.PeAnnotation.Graph.X[aCnt] = -40.0F;
411Pe3do1.PeAnnotation.Graph.Y[aCnt] = 10.0F;
412Pe3do1.PeAnnotation.Graph.Z[aCnt] = 0.0F;
413Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)GraphAnnotationType.Box;
414Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
415Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(155, 0, 255, 200);
416aCnt++;
417
418// Drawing an Arrow traveling though center of Box //
419Pe3do1.PeAnnotation.Graph.X[aCnt] = -40;
420Pe3do1.PeAnnotation.Graph.Y[aCnt] = 10F;
421Pe3do1.PeAnnotation.Graph.Z[aCnt] = 0F;
422Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.ThinSolidLine;
423Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
424Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(255, 0, 255, 0);
425aCnt++;
426
427Pe3do1.PeAnnotation.Graph.X[aCnt] = -70;
428Pe3do1.PeAnnotation.Graph.Y[aCnt] = 10F;
429Pe3do1.PeAnnotation.Graph.Z[aCnt] = 0F;
430Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.ArrowMedium;
431Pe3do1.PeAnnotation.Graph.Text[aCnt] = "Box along X Axis";
432Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(255, 0, 255, 0);
433aCnt++;
434
435// Drawing another Cylinder, now in z direction //
436
437// Define a SquareSolid in outer space to trigger complex annotations to render as Solid, as we last drew a line/arrow
438Pe3do1.PeAnnotation.Graph.X[aCnt] = 200000000.0F;
439Pe3do1.PeAnnotation.Graph.Z[aCnt] = 200000000.0F;
440Pe3do1.PeAnnotation.Graph.Y[aCnt] = 200000000.0F;
441Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.SquareSolid;
442Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
443Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(0, 0, 0, 0);
444aCnt++;
445
446// Define the direction the cylinder spans //
447Pe3do1.PeAnnotation.Graph.X[aCnt] = 0;
448Pe3do1.PeAnnotation.Graph.Y[aCnt] = 0;
449Pe3do1.PeAnnotation.Graph.Z[aCnt] = 1; // along z axis
450Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
451Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.AxisDirection;
452aCnt++;
453
454// Defines radius size for start of cylinder, z is ignored //
455Pe3do1.PeAnnotation.Graph.Y[aCnt] = 10;
456Pe3do1.PeAnnotation.Graph.X[aCnt] = 10;
457Pe3do1.PeAnnotation.Graph.Z[aCnt] = 1;
458Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
459Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.MajorMinorRadii;
460aCnt++;
461
462// Defines location of start of cylinder
463Pe3do1.PeAnnotation.Graph.X[aCnt] = -55F;
464Pe3do1.PeAnnotation.Graph.Y[aCnt] = 10.0F;
465Pe3do1.PeAnnotation.Graph.Z[aCnt] = 15.0F;
466Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)GraphAnnotationType.CylinderStart;
467Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
468Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(55, 0, 255, 0);
469aCnt++;
470
471// Completes the Cylinder //
472Pe3do1.PeAnnotation.Graph.HotSpot[aCnt] = true;
473Pe3do1.PeAnnotation.Graph.X[aCnt] = -55F;
474Pe3do1.PeAnnotation.Graph.Y[aCnt] = 10.0F;
475Pe3do1.PeAnnotation.Graph.Z[aCnt] = 35.0F;
476Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)GraphAnnotationType.Cylinder;
477Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
478Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(55, 0, 255, 0);
479aCnt++;
480
481// Drawing an Arrow traveling though center of z aligned cylinder //
482Pe3do1.PeAnnotation.Graph.X[aCnt] = -55;
483Pe3do1.PeAnnotation.Graph.Y[aCnt] = 10F;
484Pe3do1.PeAnnotation.Graph.Z[aCnt] = 15F;
485Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.ThinSolidLine;
486Pe3do1.PeAnnotation.Graph.Text[aCnt] = "";
487Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(255, 0, 255, 0);
488aCnt++;
489
490Pe3do1.PeAnnotation.Graph.X[aCnt] = -55;
491Pe3do1.PeAnnotation.Graph.Y[aCnt] = 10F;
492Pe3do1.PeAnnotation.Graph.Z[aCnt] = 35F;
493Pe3do1.PeAnnotation.Graph.Type[aCnt] = (int)Gigasoft.ProEssentials.Enums.GraphAnnotationType.ArrowMedium;
494Pe3do1.PeAnnotation.Graph.Text[aCnt] = "Cylinder along Z Axis";
495Pe3do1.PeAnnotation.Graph.Color[aCnt] = Color.FromArgb(255, 0, 255, 0);
496aCnt++;
497
498Pe3do1.PeAnnotation.Show = true;
499Pe3do1.PeAnnotation.Graph.Show = true;
500Pe3do1.PeAnnotation.Graph.LeftJustificationOutside = true;
501Pe3do1.PeFont.GraphAnnotationTextSize = 86;
502Pe3do1.PeUserInterface.HotSpot.GraphAnnotation = true;
503
504Pe3do1.PePlot.Option.DegreePrompting = true;
505Pe3do1.PeUserInterface.Menu.ShowAnnotations = MenuControl.Show;
506Pe3do1.PeUserInterface.Menu.AnnotationControl = true;
507
508// Set subset labels and titles //
509Pe3do1.PeString.SubsetLabels[0] = "Data 1";
510Pe3do1.PeString.SubsetLabels[1] = "Data 2";
511Pe3do1.PeString.SubsetLabels[2] = "Data 3";
512Pe3do1.PeString.SubsetLabels[3] = "Data 4";
513Pe3do1.PeString.SubsetLabels[4] = "Data 5";
514Pe3do1.PeString.SubsetLabels[5] = "Data 6";
515Pe3do1.PeString.SubsetLabels[6] = "Data 7";
516Pe3do1.PeString.SubsetLabels[7] = "Data 8";
517Pe3do1.PeString.SubsetLabels[8] = "Data 9";
518Pe3do1.PeString.SubsetLabels[9] = "Data 10";
519
520Pe3do1.PeColor.SubsetColors[0] = Color.FromArgb(255, 198, 198, 0);
521Pe3do1.PeColor.SubsetColors[1] = Color.FromArgb(255, 0, 198, 198);
522Pe3do1.PeColor.SubsetColors[2] = Color.FromArgb(255, 0, 198, 0);
523Pe3do1.PeColor.SubsetColors[3] = Color.FromArgb(255, 80, 80, 220);
524Pe3do1.PeColor.SubsetColors[4] = Color.FromArgb(255, 0, 0, 198);
525Pe3do1.PeColor.SubsetColors[5] = Color.FromArgb(255, 192, 192, 192);
526Pe3do1.PeColor.SubsetColors[6] = Color.FromArgb(255, 198, 77, 198);
527Pe3do1.PeColor.SubsetColors[7] = Color.FromArgb(255, 200, 198, 150);
528Pe3do1.PeColor.SubsetColors[8] = Color.FromArgb(255, 200, 200, 140);
529Pe3do1.PeColor.SubsetColors[9] = Color.FromArgb(255, 150, 0, 198);
530
531Pe3do1.PePlot.SubsetPointTypes[0] = PointType.DotSolid;
532Pe3do1.PePlot.SubsetPointTypes[1] = PointType.DotSolid;
533Pe3do1.PePlot.SubsetPointTypes[2] = PointType.DotSolid;
534Pe3do1.PePlot.SubsetPointTypes[3] = PointType.DotSolid;
535Pe3do1.PePlot.SubsetPointTypes[4] = PointType.DotSolid;
536Pe3do1.PePlot.SubsetPointTypes[5] = PointType.DotSolid;
537Pe3do1.PePlot.SubsetPointTypes[6] = PointType.DotSolid;
538Pe3do1.PePlot.SubsetPointTypes[7] = PointType.DotSolid;
539Pe3do1.PePlot.SubsetPointTypes[8] = PointType.DotSolid;
540Pe3do1.PePlot.SubsetPointTypes[9] = PointType.DotSolid;
541
542Pe3do1.PePlot.SubsetLineTypes[0] = LineType.MediumThinSolid;
543Pe3do1.PePlot.SubsetLineTypes[1] = LineType.MediumThinSolid;
544Pe3do1.PePlot.SubsetLineTypes[2] = LineType.MediumThinSolid;
545Pe3do1.PePlot.SubsetLineTypes[3] = LineType.MediumThinSolid;
546Pe3do1.PePlot.SubsetLineTypes[4] = LineType.MediumThinSolid;
547Pe3do1.PePlot.SubsetLineTypes[5] = LineType.MediumThinSolid;
548Pe3do1.PePlot.SubsetLineTypes[6] = LineType.MediumThinSolid;
549Pe3do1.PePlot.SubsetLineTypes[7] = LineType.MediumThinSolid;
550Pe3do1.PePlot.SubsetLineTypes[8] = LineType.MediumThinSolid;
551Pe3do1.PePlot.SubsetLineTypes[9] = LineType.MediumThinSolid;
552
553// Set Plotting methods //
554Pe3do1.PePlot.Method = 0; // Points
555Pe3do1.PePlot.PointSize = PointSize.Small;
556
557// Set legend location //
558Pe3do1.PeLegend.Location = LegendLocation.Right;
559Pe3do1.PeLegend.Show = true;
560Pe3do1.PeUserInterface.Menu.LegendLocation = MenuControl.Show;
561
562// Prepare images in memory //
563Pe3do1.PeConfigure.CacheBmp = true;
564Pe3do1.PeConfigure.PrepareImages = true;
565Pe3do1.PeUserInterface.Allow.FocalRect = false;
566
567Pe3do1.PeConfigure.TextShadows = TextShadows.BoldText;
568Pe3do1.PeFont.Label.Bold = true;
569Pe3do1.PeColor.GraphForeground = Color.FromArgb(255, 229, 229, 229);
570
571// Set various export defaults //
572Pe3do1.PeSpecial.DpiX = 600;
573Pe3do1.PeSpecial.DpiY = 600;
574
575// default export setting //
576Pe3do1.PeUserInterface.Dialog.ExportSizeDef = ExportSizeDef.NoSizeOrPixel;
577Pe3do1.PeUserInterface.Dialog.ExportTypeDef = ExportTypeDef.Png;
578Pe3do1.PeUserInterface.Dialog.ExportDestDef = ExportDestDef.Clipboard;
579Pe3do1.PeUserInterface.Dialog.ExportUnitXDef = "1280";
580Pe3do1.PeUserInterface.Dialog.ExportUnitYDef = "768";
581Pe3do1.PeUserInterface.Dialog.ExportImageDpi = 300;
582Pe3do1.PeUserInterface.Dialog.AllowEmfExport = false;
583Pe3do1.PeUserInterface.Dialog.AllowWmfExport = false;
584
585Pe3do1.PeConfigure.AntiAliasGraphics = false; // for non 3dx
586Pe3do1.PeConfigure.AntiAliasText = true;
587
588Pe3do1.PeUserInterface.Menu.Rotation = MenuControl.Hide;
589Pe3do1.PeUserInterface.Menu.DataShadow = MenuControl.Show;
590Pe3do1.PeUserInterface.Cursor.PromptTracking = true;
591Pe3do1.PeUserInterface.Cursor.PromptStyle = CursorPromptStyle.XYZValues;
592
593Pe3do1.PePlot.Option.LightStrength = .65F;
594Pe3do1.PeUserInterface.Cursor.HighlightColor = Color.FromArgb(255, 255, 0, 0);
595
596Pe3do1.PeConfigure.RenderEngine = RenderEngine.Direct3D;
597
598Pe3do1.PeFunction.Force3dxVerticeRebuild = true;
599Pe3do1.PeFunction.Force3dxAnnotVerticeRebuild = true;
600
601Pe3do1.PeFunction.ReinitializeResetImage();
602Pe3do1.Invalidate();
603Pe3do1.Refresh();
Tip: Uses property syntax like Pego1.PeData.Y[s, p]Click underlined properties to view documentation