/[Sims3RigEditor]/trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h
ViewVC logotype

Annotation of /trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 20 - (hide annotations) (download)
Sun Aug 1 04:23:29 2010 UTC (9 years, 6 months ago) by william
File MIME type: text/plain
File size: 21188 byte(s)
Rename GrannyWriteFile -> WriteFile

1 william 19 #define SHOW_DEBUG_MENU // if defined, will show the debug menu -> else it will not be shown
2 william 5 #pragma once
3 william 7 //#include "gr2lib_core.h"
4     //#include "gr2lib_core_imports.h"
5     #ifndef GR2LIB_RIGEDITOR_FRM_H
6     #define GR2LIB_RIGEDITOR_FRM_H
7     #include "grannyfile.h"
8 william 12 //#include "guicon.h"
9 william 19 #include "VSDebugOutput.h"
10     #include "GrannyFileWriter.h"
11 william 7 #include <stdio.h>
12     #include <iostream>
13     #include <stdlib.h>
14     #include <assert.h>
15     #include <string>
16     #include <sstream>
17 william 12 #include <vcclr.h>
18 william 7 using namespace std;
19 william 5
20 william 7 using namespace gr2lib::core;
21     using namespace gr2lib::core::coretypes::implementation;
22 william 14 using namespace gr2lib::core::apiversion;
23 william 5 using namespace System;
24     using namespace System::ComponentModel;
25     using namespace System::Collections;
26     using namespace System::Collections::Generic;
27     using namespace System::Windows::Forms;
28     using namespace System::Data;
29     using namespace System::Drawing;
30 william 6 using namespace System::Runtime::InteropServices;
31     //
32     //namespace gr2lib
33     //{
34     // namespace core
35     // {
36     // namespace rigeditor
37     // {
38 william 12 /// <summary>
39     /// Summary for gr2lib_rigeditor_frm
40     ///
41     /// WARNING: If you change the name of this class, you will need to change the
42     /// 'Resource File Name' property for the managed resource compiler tool
43     /// associated with all .resx files this class depends on. Otherwise,
44     /// the designers will not be able to interact properly with localized
45     /// resources associated with this form.
46     /// </summary>
47     public ref class gr2lib_rigeditor_frm : public System::Windows::Forms::Form
48     {
49     private:
50     grannyfile* _grn_file;
51     void LogApplicationStartup()
52     {
53     const char* ApplicationName = "GR2Lib Rig Editor: ";
54 william 5
55 william 12 const char* product_version = (char*)(void*)Marshal::StringToHGlobalAnsi(Application::ProductVersion);
56     const char* version_prefix = "v";
57     const char* startup_string = " {Starting up...}";
58 william 5
59 william 6
60 william 12 int msg_malloc = (strlen(ApplicationName) + strlen(product_version) + strlen(version_prefix) + strlen(startup_string)) + 3;
61 william 5
62 william 12 char* msg = (char*)malloc(msg_malloc);
63     for (int i=0; i<msg_malloc; i++) {
64     msg[i] = 0; // Initialize all elements to zero.
65     }
66 william 5
67 william 12 strcat(msg,ApplicationName);
68     strcat(msg,version_prefix);
69     strcat(msg,product_version);
70     strcat(msg,startup_string);
71     strcat(msg,"\n");
72     _grn_file->_logger->LogMessage(msg);
73     }
74     public:
75     gr2lib_rigeditor_frm(void)
76     {
77     InitializeComponent();
78     _grn_file = new grannyfile();
79     //
80     //TODO: Add the constructor code here
81     //
82     // Log Application Startup
83     LogApplicationStartup();
84     }
85     gr2lib_rigeditor_frm(grannyfile* grn_file)
86     {
87     InitializeComponent();
88     // parse art tool info
89     _grn_file = grn_file;
90    
91     // Log Application Startup
92     LogApplicationStartup();
93    
94 william 15 this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();
95     ConvertToManaged();
96     propgrid->SelectedObject = this->GR2LibPropertyWrapper;
97 william 12
98     }
99    
100     protected:
101     /// <summary>
102     /// Clean up any resources being used.
103     /// </summary>
104     ~gr2lib_rigeditor_frm()
105     {
106     if (components)
107     {
108     delete components;
109     }
110     }
111     private: System::Windows::Forms::PropertyGrid^ propgrid;
112     protected:
113     private: System::Windows::Forms::MenuStrip^ mainmenu;
114     private: System::Windows::Forms::ToolStripMenuItem^ mnuFile;
115     private: System::Windows::Forms::ToolStripMenuItem^ mnuItemExit;
116     private: System::Windows::Forms::ToolStripMenuItem^ mnuItemOpen;
117     private: System::Windows::Forms::ToolStripMenuItem^ mnuItemSave;
118     private: System::Windows::Forms::ToolStripMenuItem^ mnuItemSaveAs;
119 william 19 private: System::Windows::Forms::ToolStripMenuItem^ mnuDebug;
120     private: System::Windows::Forms::ToolStripMenuItem^ mnuDebug_UnitTests;
121     private: System::Windows::Forms::ToolStripMenuItem^ mnuTestArtToolInfoReturnValues;
122 william 12
123 william 19 private: System::Windows::Forms::OpenFileDialog^ RigLoader;
124     private: System::Windows::Forms::ToolStripMenuItem^ mnuTestExporterInfoReturnValues;
125     private: System::Windows::Forms::SaveFileDialog^ RigSaver;
126    
127    
128    
129    
130 william 12 protected:
131    
132     private:
133     /// <summary>
134     /// Required designer variable.
135     /// </summary>
136     System::ComponentModel::Container ^components;
137    
138     #pragma region Windows Form Designer generated code
139     /// <summary>
140     /// Required method for Designer support - do not modify
141     /// the contents of this method with the code editor.
142     /// </summary>
143     void InitializeComponent(void)
144     {
145     this->propgrid = (gcnew System::Windows::Forms::PropertyGrid());
146     this->mainmenu = (gcnew System::Windows::Forms::MenuStrip());
147     this->mnuFile = (gcnew System::Windows::Forms::ToolStripMenuItem());
148     this->mnuItemOpen = (gcnew System::Windows::Forms::ToolStripMenuItem());
149     this->mnuItemSave = (gcnew System::Windows::Forms::ToolStripMenuItem());
150     this->mnuItemSaveAs = (gcnew System::Windows::Forms::ToolStripMenuItem());
151     this->mnuItemExit = (gcnew System::Windows::Forms::ToolStripMenuItem());
152 william 19 this->mnuDebug = (gcnew System::Windows::Forms::ToolStripMenuItem());
153     this->mnuDebug_UnitTests = (gcnew System::Windows::Forms::ToolStripMenuItem());
154     this->mnuTestArtToolInfoReturnValues = (gcnew System::Windows::Forms::ToolStripMenuItem());
155     this->mnuTestExporterInfoReturnValues = (gcnew System::Windows::Forms::ToolStripMenuItem());
156     this->RigLoader = (gcnew System::Windows::Forms::OpenFileDialog());
157     this->RigSaver = (gcnew System::Windows::Forms::SaveFileDialog());
158 william 12 this->mainmenu->SuspendLayout();
159     this->SuspendLayout();
160     //
161     // propgrid
162     //
163     this->propgrid->Dock = System::Windows::Forms::DockStyle::Fill;
164     this->propgrid->Location = System::Drawing::Point(0, 24);
165     this->propgrid->Name = L"propgrid";
166 william 15 this->propgrid->PropertySort = System::Windows::Forms::PropertySort::NoSort;
167 william 12 this->propgrid->Size = System::Drawing::Size(558, 456);
168     this->propgrid->TabIndex = 4;
169     this->propgrid->ToolbarVisible = false;
170     //
171     // mainmenu
172     //
173 william 19 this->mainmenu->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->mnuFile, this->mnuDebug});
174 william 12 this->mainmenu->Location = System::Drawing::Point(0, 0);
175     this->mainmenu->Name = L"mainmenu";
176     this->mainmenu->Size = System::Drawing::Size(558, 24);
177     this->mainmenu->TabIndex = 3;
178     this->mainmenu->Text = L"menuStrip1";
179     //
180     // mnuFile
181     //
182     this->mnuFile->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(4) {this->mnuItemOpen,
183     this->mnuItemSave, this->mnuItemSaveAs, this->mnuItemExit});
184     this->mnuFile->Name = L"mnuFile";
185     this->mnuFile->Size = System::Drawing::Size(37, 20);
186     this->mnuFile->Text = L"&File";
187     //
188     // mnuItemOpen
189     //
190     this->mnuItemOpen->Name = L"mnuItemOpen";
191     this->mnuItemOpen->Size = System::Drawing::Size(114, 22);
192     this->mnuItemOpen->Text = L"&Open";
193     this->mnuItemOpen->Click += gcnew System::EventHandler(this, &gr2lib_rigeditor_frm::mnuItemOpen_Click);
194     //
195     // mnuItemSave
196     //
197     this->mnuItemSave->Name = L"mnuItemSave";
198     this->mnuItemSave->Size = System::Drawing::Size(114, 22);
199     this->mnuItemSave->Text = L"&Save";
200 william 19 this->mnuItemSave->Click += gcnew System::EventHandler(this, &gr2lib_rigeditor_frm::mnuItemSave_Click);
201 william 12 //
202     // mnuItemSaveAs
203     //
204     this->mnuItemSaveAs->Name = L"mnuItemSaveAs";
205     this->mnuItemSaveAs->Size = System::Drawing::Size(114, 22);
206     this->mnuItemSaveAs->Text = L"Save &As";
207 william 19 this->mnuItemSaveAs->Click += gcnew System::EventHandler(this, &gr2lib_rigeditor_frm::mnuItemSaveAs_Click);
208 william 12 //
209     // mnuItemExit
210     //
211     this->mnuItemExit->Name = L"mnuItemExit";
212     this->mnuItemExit->Size = System::Drawing::Size(114, 22);
213     this->mnuItemExit->Text = L"&Exit";
214     this->mnuItemExit->Click += gcnew System::EventHandler(this, &gr2lib_rigeditor_frm::mnuItemExit_Click);
215     //
216 william 19 // mnuDebug
217     //
218     this->mnuDebug->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) {this->mnuDebug_UnitTests});
219     this->mnuDebug->Name = L"mnuDebug";
220     this->mnuDebug->Size = System::Drawing::Size(56, 20);
221     this->mnuDebug->Text = L"&DEBUG";
222     //
223     // mnuDebug_UnitTests
224     //
225     this->mnuDebug_UnitTests->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->mnuTestArtToolInfoReturnValues,
226     this->mnuTestExporterInfoReturnValues});
227     this->mnuDebug_UnitTests->Name = L"mnuDebug_UnitTests";
228     this->mnuDebug_UnitTests->Size = System::Drawing::Size(135, 22);
229     this->mnuDebug_UnitTests->Text = L"&Unit Tests...";
230     //
231     // mnuTestArtToolInfoReturnValues
232     //
233     this->mnuTestArtToolInfoReturnValues->Name = L"mnuTestArtToolInfoReturnValues";
234     this->mnuTestArtToolInfoReturnValues->Size = System::Drawing::Size(238, 22);
235     this->mnuTestArtToolInfoReturnValues->Text = L"Test ArtoolInfo Rerturn values";
236     this->mnuTestArtToolInfoReturnValues->Click += gcnew System::EventHandler(this, &gr2lib_rigeditor_frm::mnuTestArtToolInfoReturnValues_Click);
237     //
238     // mnuTestExporterInfoReturnValues
239     //
240     this->mnuTestExporterInfoReturnValues->Name = L"mnuTestExporterInfoReturnValues";
241     this->mnuTestExporterInfoReturnValues->Size = System::Drawing::Size(238, 22);
242     this->mnuTestExporterInfoReturnValues->Text = L"Test ExporterInfo Return Values";
243     this->mnuTestExporterInfoReturnValues->Click += gcnew System::EventHandler(this, &gr2lib_rigeditor_frm::mnuTestExporterInfoReturnValues_Click);
244     //
245     // RigLoader
246     //
247     this->RigLoader->DefaultExt = L"gr2";
248     this->RigLoader->Filter = L"Granny2 Files|*.gr2;*.grannyrig";
249     this->RigLoader->SupportMultiDottedExtensions = true;
250     this->RigLoader->Title = L"Please choose the Granny2 Rig file to load";
251     //
252     // RigSaver
253     //
254     this->RigSaver->DefaultExt = L"gr2";
255     this->RigSaver->Filter = L"Granny2 Files|*.gr2;*.grannyrig";
256     this->RigSaver->SupportMultiDottedExtensions = true;
257     this->RigSaver->Title = L"Please select the Granny2 Rig to write to or create";
258     //
259 william 12 // gr2lib_rigeditor_frm
260     //
261     this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
262     this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
263     this->ClientSize = System::Drawing::Size(558, 480);
264     this->Controls->Add(this->propgrid);
265     this->Controls->Add(this->mainmenu);
266     this->Name = L"gr2lib_rigeditor_frm";
267     this->Text = L"gr2lib_rigeditor_frm";
268 william 19 this->Load += gcnew System::EventHandler(this, &gr2lib_rigeditor_frm::gr2lib_rigeditor_frm_Load);
269 william 12 this->FormClosed += gcnew System::Windows::Forms::FormClosedEventHandler(this, &gr2lib_rigeditor_frm::gr2lib_rigeditor_frm_FormClosed);
270     this->mainmenu->ResumeLayout(false);
271     this->mainmenu->PerformLayout();
272     this->ResumeLayout(false);
273     this->PerformLayout();
274    
275     }
276     #pragma endregion
277 william 6 #pragma region MarshalToMananaged
278 william 15 //ArtToolInfo^ _ArtToolInfo;
279     //ExporterInfo^ _ExporterInfo;
280     GR2LibWrapper^ GR2LibPropertyWrapper;
281 william 6
282 william 12 #pragma region ManagedNativeParsing
283 william 15 void ConvertToManaged()
284 william 12 {
285     // Art Tool info
286 william 15 ArtToolInfo_ToManaged(_grn_file->GrannyFileInfo->ArtToolInfo);
287 william 14 // Exporter Info
288 william 15 ExporterInfo_ToManaged(_grn_file->GrannyFileInfo->ExporterInfo);
289 william 12 }
290     void ConvertToNative()
291     {
292     // Art Tool info
293     ArtToolInfo_ToNative();
294 william 14 // Exporter Info
295     ExporterInfo_ToNative();
296 william 12 }
297     #pragma endregion
298 william 6
299 william 14 #pragma region ArtToolInfo_ToManaged
300 william 15 void ArtToolInfo_ToManaged(granny_art_tool_info* toolinfo)
301 william 12 {
302 william 15 //GR2LibPropertyWrapper->ArtToolInfo = gcnew ArtToolInfo();
303 william 19 if (toolinfo != NULL)
304     {
305     GR2LibPropertyWrapper->ArtToolInfo->FromArtToolName = gcnew String(reinterpret_cast<const char*>(toolinfo->FromArtToolName));
306 william 6
307 william 19 // Tool Vector
308     Vector3* Origin = new Vector3(
309     toolinfo->Origin[0],
310     toolinfo->Origin[1],
311     toolinfo->Origin[2]);
312     Vector3* Right = new Vector3(
313     toolinfo->RightVector[0],
314     toolinfo->RightVector[1],
315     toolinfo->RightVector[2]);
316     Vector3* Up = new Vector3(
317     toolinfo->UpVector[0],
318     toolinfo->UpVector[1],
319     toolinfo->UpVector[2]);
320     Vector3* Back = new Vector3(
321     toolinfo->BackVector[0],
322     toolinfo->BackVector[1],
323     toolinfo->BackVector[2]);
324     GR2LibPropertyWrapper->ArtToolInfo->Vector = gcnew ArtToolInfoVector(*Origin,*Right,*Up,*Back);
325 william 6
326 william 19 // Tool Version
327     GR2LibPropertyWrapper->ArtToolInfo->ToolVersion = gcnew ArtToolInfoVersion(toolinfo->ArtToolMajorRevision,toolinfo->ArtToolMinorRevision);
328     // Tool Units Per Meter
329     GR2LibPropertyWrapper->ArtToolInfo->UnitsPerMeter = toolinfo->UnitsPerMeter;
330     }
331 william 12 }
332     #pragma endregion
333 william 14 #pragma region ExporterInfo_ToManaged
334 william 15 void ExporterInfo_ToManaged(granny_exporter_info* toolinfo)
335     {
336     //GR2LibPropertyWrapper->ExporterInfo = gcnew ExporterInfo();
337 william 19 if (toolinfo != NULL)
338     {
339     GR2LibPropertyWrapper->ExporterInfo->ExporterName = gcnew String(reinterpret_cast<const char*>(toolinfo->ExporterName));
340     GR2LibPropertyWrapper->ExporterInfo->Version = gcnew versiontype(
341     toolinfo->ExporterMajorRevision,
342     toolinfo->ExporterMinorRevision,
343     toolinfo->ExporterCustomization,
344     toolinfo->ExporterBuildNumber);
345     }
346 william 14 //_ExporterInfo->ExtendedData = new IntPtr(toolinfo->ExtendedData.Object);
347     }
348     #pragma endregion
349 william 6
350 william 12 #pragma region MarshalToNative
351 william 6
352 william 14 #pragma region ArtToolInfo_ToNative
353 william 12 void ArtToolInfo_ToNative()
354     {
355 william 19 if (_grn_file->GrannyFileInfo->ArtToolInfo == NULL)
356     {
357     _grn_file->GrannyFileInfo->ArtToolInfo = new granny_art_tool_info();
358     }
359 william 6
360 william 15 _grn_file->GrannyFileInfo->ArtToolInfo->FromArtToolName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->ArtToolInfo->FromArtToolName).ToPointer();
361     _grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMajorRevision = GR2LibPropertyWrapper->ArtToolInfo->ToolVersion->Major;
362     _grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMinorRevision = GR2LibPropertyWrapper->ArtToolInfo->ToolVersion->Minor;
363     _grn_file->GrannyFileInfo->ArtToolInfo->UnitsPerMeter = GR2LibPropertyWrapper->ArtToolInfo->UnitsPerMeter;
364 william 6
365    
366 william 15 _grn_file->GrannyFileInfo->ArtToolInfo->Origin[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.x;
367     _grn_file->GrannyFileInfo->ArtToolInfo->Origin[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.y;
368     _grn_file->GrannyFileInfo->ArtToolInfo->Origin[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.z;
369 william 12
370 william 15 _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.x;
371     _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.y;
372     _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.z;
373 william 12
374 william 15 _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.x;
375     _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.y;
376     _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.z;
377 william 12
378 william 15 _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.x;
379     _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.y;
380     _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.z;
381 william 12
382     }
383     #pragma endregion
384 william 14 #pragma region ExporterInfo_ToNative
385     void ExporterInfo_ToNative()
386     {
387 william 19 if (_grn_file->GrannyFileInfo->ExporterInfo == NULL)
388     {
389     _grn_file->GrannyFileInfo->ExporterInfo = new granny_exporter_info();
390     }
391 william 15 _grn_file->GrannyFileInfo->ExporterInfo->ExporterName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->ExporterInfo->ExporterName).ToPointer();
392     _grn_file->GrannyFileInfo->ExporterInfo->ExporterMajorRevision = GR2LibPropertyWrapper->ExporterInfo->Version->major;
393     _grn_file->GrannyFileInfo->ExporterInfo->ExporterMinorRevision = GR2LibPropertyWrapper->ExporterInfo->Version->minor;
394     _grn_file->GrannyFileInfo->ExporterInfo->ExporterCustomization = GR2LibPropertyWrapper->ExporterInfo->Version->customization;
395     _grn_file->GrannyFileInfo->ExporterInfo->ExporterBuildNumber = GR2LibPropertyWrapper->ExporterInfo->Version->build;
396 william 14 //_grn_file->GrannyFileInfo->ExporterInfo->ExtendedData
397     }
398 william 12 #pragma endregion
399 william 14 #pragma endregion
400 william 12
401     #pragma endregion
402 william 6 private: System::Void mnuItemExit_Click(System::Object^ sender, System::EventArgs^ e)
403     {
404     ConvertToNative();
405     this->Close();
406     }
407     private: System::Void mnuItemOpen_Click(System::Object^ sender, System::EventArgs^ e)
408     {
409 william 19
410    
411     System::Windows::Forms::DialogResult result = RigLoader->ShowDialog();
412     if (result != System::Windows::Forms::DialogResult::OK) return;
413     const char* fn = (char*)Marshal::StringToHGlobalAnsi(RigLoader->FileName).ToPointer();
414    
415 william 12 _grn_file = new grannyfile();
416     const char* loading_msg = "Loading File: ";
417     int msg_malloc = (strlen(loading_msg) + strlen(fn));
418     char* msg = (char*)malloc(msg_malloc);
419     for (int i=0; i<msg_malloc; i++) { msg[i] = 0; }
420     strcat(msg,loading_msg);
421     strcat(msg,fn);
422     strcat(msg,"\n");
423     _grn_file->_logger->LogMessage(msg);
424     //_grn_file->_logger->SetLogFileName("c:\\gr2_logs",fn);
425     _grn_file = new grannyfile(fn);
426    
427 william 15 this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();
428     ConvertToManaged();
429     propgrid->SelectedObject = this->GR2LibPropertyWrapper;
430 william 6 }
431 william 12 private: System::Void gr2lib_rigeditor_frm_FormClosed(System::Object^ sender, System::Windows::Forms::FormClosedEventArgs^ e)
432     {
433     //TerminateConsoleIO();
434     }
435 william 19 private: System::Void gr2lib_rigeditor_frm_Load(System::Object^ sender, System::EventArgs^ e)
436     {
437     #if defined SHOW_DEBUG_MENU
438     mnuDebug->Visible = true;
439     #else
440     mnuDebug->Visible = false;
441     #endif
442     }
443     private: System::Void mnuTestArtToolInfoReturnValues_Click(System::Object^ sender, System::EventArgs^ e)
444     {
445     // Convert ArtToolInfo To Native, and ouput the values -> to check that they were updated correctly
446     ArtToolInfo_ToNative();
447     VSDebugWriterW VSDebugWriter;
448     VSDebugWriter
449     << "\n\n\tArtToolInfo ->"
450     << "\n\t\tTool Name: "
451     << _grn_file->GrannyFileInfo->ArtToolInfo->FromArtToolName
452     << "\n\t\tTool Version: "
453     << _grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMajorRevision
454     << "." << _grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMinorRevision
455     << "\n\t\tUnits Per Meter: "
456     << _grn_file->GrannyFileInfo->ArtToolInfo->UnitsPerMeter
457     << "\n\t\tOrigin: "
458     << "\n\t\t\tX: "
459     << _grn_file->GrannyFileInfo->ArtToolInfo->Origin[0]
460     << "\n\t\t\tY: "
461     << _grn_file->GrannyFileInfo->ArtToolInfo->Origin[1]
462     << "\n\t\t\tZ: "
463     << _grn_file->GrannyFileInfo->ArtToolInfo->Origin[2]
464     << "\n\t\tRight: "
465     << "\n\t\t\tX: "
466     << _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[0]
467     << "\n\t\t\tY: "
468     << _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[1]
469     << "\n\t\t\tZ: "
470     << _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[2]
471     << "\n\t\tUp: "
472     << "\n\t\t\tX: "
473     << _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[0]
474     << "\n\t\t\tY: "
475     << _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[1]
476     << "\n\t\t\tZ: "
477     << _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[2]
478     << "\n\t\tBack: "
479     << "\n\t\t\tX: "
480     << _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[0]
481     << "\n\t\t\tY: "
482     << _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[1]
483     << "\n\t\t\tZ: "
484     << _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[2]
485     ;
486     }
487     private: System::Void mnuTestExporterInfoReturnValues_Click(System::Object^ sender, System::EventArgs^ e)
488     {
489     // Convert ExporterInfo To Native, and ouput the values -> to check that they were updated correctly
490     ExporterInfo_ToNative();
491     VSDebugWriterW VSDebugWriter;
492     VSDebugWriter
493     << "\n\n\tExporterInfo ->"
494     << "\n\t\tExporter Name: "
495     << _grn_file->GrannyFileInfo->ExporterInfo->ExporterName
496     << "\n\t\tExporter Version: "
497     << _grn_file->GrannyFileInfo->ExporterInfo->ExporterMajorRevision
498     << "." << _grn_file->GrannyFileInfo->ExporterInfo->ExporterMinorRevision
499     << "." << _grn_file->GrannyFileInfo->ExporterInfo->ExporterCustomization
500     << "." << _grn_file->GrannyFileInfo->ExporterInfo->ExporterBuildNumber
501     ;
502     }
503     private: System::Void mnuItemSave_Click(System::Object^ sender, System::EventArgs^ e)
504     {
505     // convert Data to Native
506     ConvertToNative();
507     const char* filename = _grn_file->_GrannyFilename;
508 william 20 GrannyFileWriter::WriteFile(filename,_grn_file->GrannyFileInfo,_grn_file->_logger);
509 william 19 }
510     private: System::Void mnuItemSaveAs_Click(System::Object^ sender, System::EventArgs^ e)
511     {
512     // convert Data to Native
513     ConvertToNative();
514     System::Windows::Forms::DialogResult result = RigSaver->ShowDialog();
515     if (result != System::Windows::Forms::DialogResult::OK) return;
516     const char* filename = (char*)Marshal::StringToHGlobalAnsi(RigSaver->FileName).ToPointer();
517 william 20 GrannyFileWriter::WriteFile(filename,_grn_file->GrannyFileInfo,_grn_file->_logger);
518 william 19 }
519 william 6 };
520     // }
521     // }
522 william 7 //}
523     #endif /* GR2LIB_RIGEDITOR_FRM_H */

  ViewVC Help
Powered by ViewVC 1.1.22