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

Diff of /trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 14 by william, Sun Aug 1 02:15:12 2010 UTC revision 15 by william, Sun Aug 1 02:44:09 2010 UTC
# Line 88  public: Line 88  public:
88                  // Log Application Startup                  // Log Application Startup
89                  LogApplicationStartup();                  LogApplicationStartup();
90    
91                  propgrid->SelectedObjects = ConvertToManaged();                  this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();
92                    ConvertToManaged();
93                    propgrid->SelectedObject = this->GR2LibPropertyWrapper;
94    
95          }          }
96    
# Line 142  private: Line 144  private:
144                  this->propgrid->Dock = System::Windows::Forms::DockStyle::Fill;                  this->propgrid->Dock = System::Windows::Forms::DockStyle::Fill;
145                  this->propgrid->Location = System::Drawing::Point(0, 24);                  this->propgrid->Location = System::Drawing::Point(0, 24);
146                  this->propgrid->Name = L"propgrid";                  this->propgrid->Name = L"propgrid";
147                  this->propgrid->PropertySort = System::Windows::Forms::PropertySort::Categorized;                  this->propgrid->PropertySort = System::Windows::Forms::PropertySort::NoSort;
148                  this->propgrid->Size = System::Drawing::Size(558, 456);                  this->propgrid->Size = System::Drawing::Size(558, 456);
149                  this->propgrid->TabIndex = 4;                  this->propgrid->TabIndex = 4;
150                  this->propgrid->ToolbarVisible = false;                  this->propgrid->ToolbarVisible = false;
# Line 208  private: Line 210  private:
210          }          }
211  #pragma endregion  #pragma endregion
212  #pragma region MarshalToMananaged  #pragma region MarshalToMananaged
213          ArtToolInfo^ _ArtToolInfo;          //ArtToolInfo^ _ArtToolInfo;
214          ExporterInfo^ _ExporterInfo;          //ExporterInfo^ _ExporterInfo;
215            GR2LibWrapper^ GR2LibPropertyWrapper;
216    
217  #pragma region ManagedNativeParsing  #pragma region ManagedNativeParsing
218          array<Object^>^ ConvertToManaged()          void ConvertToManaged()
219          {          {
                 List<Object^> ret = gcnew List<Object^>();  
   
220                  // Art Tool info                  // Art Tool info
221                  ret.Add(ArtToolInfo_ToManaged(_grn_file->GrannyFileInfo->ArtToolInfo));                  ArtToolInfo_ToManaged(_grn_file->GrannyFileInfo->ArtToolInfo);
222                  // Exporter Info                  // Exporter Info
223                  ret.Add(ExporterInfo_ToManaged(_grn_file->GrannyFileInfo->ExporterInfo));                  ExporterInfo_ToManaged(_grn_file->GrannyFileInfo->ExporterInfo);
                 return ret.ToArray();  
224          }          }
225          void ConvertToNative()          void ConvertToNative()
226          {          {
# Line 232  private: Line 232  private:
232  #pragma endregion  #pragma endregion
233    
234  #pragma region ArtToolInfo_ToManaged  #pragma region ArtToolInfo_ToManaged
235          ArtToolInfo^ ArtToolInfo_ToManaged(granny_art_tool_info* toolinfo)          void ArtToolInfo_ToManaged(granny_art_tool_info* toolinfo)
236          {          {
237                  _ArtToolInfo = gcnew ArtToolInfo();                  //GR2LibPropertyWrapper->ArtToolInfo = gcnew ArtToolInfo();
238                  // Tool Name                  // Tool Name
239                  _ArtToolInfo->FromArtToolName = gcnew String(reinterpret_cast<const char*>(toolinfo->FromArtToolName));                  GR2LibPropertyWrapper->ArtToolInfo->FromArtToolName = gcnew String(reinterpret_cast<const char*>(toolinfo->FromArtToolName));
240    
241                  // Tool Vector                  // Tool Vector
242                  Vector3* Origin = new Vector3(                  Vector3* Origin = new Vector3(
# Line 255  private: Line 255  private:
255                          toolinfo->BackVector[0],                          toolinfo->BackVector[0],
256                          toolinfo->BackVector[1],                          toolinfo->BackVector[1],
257                          toolinfo->BackVector[2]);                          toolinfo->BackVector[2]);
258                  _ArtToolInfo->Vector = gcnew ArtToolInfoVector(*Origin,*Right,*Up,*Back);                  GR2LibPropertyWrapper->ArtToolInfo->Vector = gcnew ArtToolInfoVector(*Origin,*Right,*Up,*Back);
259    
260                  // Tool Version                  // Tool Version
261                  _ArtToolInfo->ToolVersion = gcnew ArtToolInfoVersion(toolinfo->ArtToolMajorRevision,toolinfo->ArtToolMinorRevision);                  GR2LibPropertyWrapper->ArtToolInfo->ToolVersion = gcnew ArtToolInfoVersion(toolinfo->ArtToolMajorRevision,toolinfo->ArtToolMinorRevision);
262                  // Tool Units Per Meter                  // Tool Units Per Meter
263                  _ArtToolInfo->UnitsPerMeter = toolinfo->UnitsPerMeter;                  GR2LibPropertyWrapper->ArtToolInfo->UnitsPerMeter = toolinfo->UnitsPerMeter;
                 return _ArtToolInfo;  
264          }          }
265  #pragma endregion  #pragma endregion
266  #pragma region ExporterInfo_ToManaged  #pragma region ExporterInfo_ToManaged
267          ExporterInfo^ ExporterInfo_ToManaged(granny_exporter_info* toolinfo)          void ExporterInfo_ToManaged(granny_exporter_info* toolinfo)
268          {          {              
269                  _ExporterInfo = gcnew ExporterInfo();                  //GR2LibPropertyWrapper->ExporterInfo = gcnew ExporterInfo();
270                  // Tool Name                  // Tool Name
271                  _ExporterInfo->ExporterName = gcnew String(reinterpret_cast<const char*>(toolinfo->ExporterName));                  GR2LibPropertyWrapper->ExporterInfo->ExporterName = gcnew String(reinterpret_cast<const char*>(toolinfo->ExporterName));
272                  _ExporterInfo->Version = gcnew versiontype(                  GR2LibPropertyWrapper->ExporterInfo->Version = gcnew versiontype(
273                          toolinfo->ExporterMajorRevision,                          toolinfo->ExporterMajorRevision,
274                          toolinfo->ExporterMinorRevision,                          toolinfo->ExporterMinorRevision,
275                          toolinfo->ExporterCustomization,                          toolinfo->ExporterCustomization,
276                          toolinfo->ExporterBuildNumber);                          toolinfo->ExporterBuildNumber);
277                  //_ExporterInfo->ExtendedData = new IntPtr(toolinfo->ExtendedData.Object);                  //_ExporterInfo->ExtendedData = new IntPtr(toolinfo->ExtendedData.Object);
                 return _ExporterInfo;  
278          }          }
279  #pragma endregion  #pragma endregion
280    
# Line 286  private: Line 284  private:
284          void ArtToolInfo_ToNative()          void ArtToolInfo_ToNative()
285          {          {
286    
287                  _grn_file->GrannyFileInfo->ArtToolInfo->FromArtToolName = (char*)Marshal::StringToHGlobalAnsi(_ArtToolInfo->FromArtToolName).ToPointer();                  _grn_file->GrannyFileInfo->ArtToolInfo->FromArtToolName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->ArtToolInfo->FromArtToolName).ToPointer();
288                  _grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMajorRevision = _ArtToolInfo->ToolVersion->Major;                  _grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMajorRevision = GR2LibPropertyWrapper->ArtToolInfo->ToolVersion->Major;
289                  _grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMinorRevision = _ArtToolInfo->ToolVersion->Minor;                  _grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMinorRevision = GR2LibPropertyWrapper->ArtToolInfo->ToolVersion->Minor;
290                  _grn_file->GrannyFileInfo->ArtToolInfo->UnitsPerMeter = _ArtToolInfo->UnitsPerMeter;                  _grn_file->GrannyFileInfo->ArtToolInfo->UnitsPerMeter = GR2LibPropertyWrapper->ArtToolInfo->UnitsPerMeter;
291    
292    
293                  _grn_file->GrannyFileInfo->ArtToolInfo->Origin[0] = _ArtToolInfo->Vector->Origin.x;                  _grn_file->GrannyFileInfo->ArtToolInfo->Origin[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.x;
294                  _grn_file->GrannyFileInfo->ArtToolInfo->Origin[1] = _ArtToolInfo->Vector->Origin.y;                  _grn_file->GrannyFileInfo->ArtToolInfo->Origin[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.y;
295                  _grn_file->GrannyFileInfo->ArtToolInfo->Origin[2] = _ArtToolInfo->Vector->Origin.z;                  _grn_file->GrannyFileInfo->ArtToolInfo->Origin[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.z;
296    
297                  _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[0] = _ArtToolInfo->Vector->Right.x;                  _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.x;
298                  _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[1] = _ArtToolInfo->Vector->Right.y;                  _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.y;
299                  _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[2] = _ArtToolInfo->Vector->Right.z;                  _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.z;
300    
301                  _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[0] = _ArtToolInfo->Vector->Up.x;                  _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.x;
302                  _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[1] = _ArtToolInfo->Vector->Up.y;                  _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.y;
303                  _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[2] = _ArtToolInfo->Vector->Up.z;                  _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.z;
304    
305                  _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[0] = _ArtToolInfo->Vector->Back.x;                  _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.x;
306                  _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[1] = _ArtToolInfo->Vector->Back.y;                  _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.y;
307                  _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[2] = _ArtToolInfo->Vector->Back.z;                  _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.z;
308    
309          }          }
310  #pragma endregion  #pragma endregion
311  #pragma region ExporterInfo_ToNative  #pragma region ExporterInfo_ToNative
312          void ExporterInfo_ToNative()          void ExporterInfo_ToNative()
313          {          {
314                  _grn_file->GrannyFileInfo->ExporterInfo->ExporterName = (char*)Marshal::StringToHGlobalAnsi(_ExporterInfo->ExporterName).ToPointer();                  _grn_file->GrannyFileInfo->ExporterInfo->ExporterName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->ExporterInfo->ExporterName).ToPointer();
315                  _grn_file->GrannyFileInfo->ExporterInfo->ExporterMajorRevision = _ExporterInfo->Version->major;                  _grn_file->GrannyFileInfo->ExporterInfo->ExporterMajorRevision = GR2LibPropertyWrapper->ExporterInfo->Version->major;
316                  _grn_file->GrannyFileInfo->ExporterInfo->ExporterMinorRevision = _ExporterInfo->Version->minor;                  _grn_file->GrannyFileInfo->ExporterInfo->ExporterMinorRevision = GR2LibPropertyWrapper->ExporterInfo->Version->minor;
317                  _grn_file->GrannyFileInfo->ExporterInfo->ExporterCustomization = _ExporterInfo->Version->customization;                  _grn_file->GrannyFileInfo->ExporterInfo->ExporterCustomization = GR2LibPropertyWrapper->ExporterInfo->Version->customization;
318                  _grn_file->GrannyFileInfo->ExporterInfo->ExporterBuildNumber = _ExporterInfo->Version->build;                  _grn_file->GrannyFileInfo->ExporterInfo->ExporterBuildNumber = GR2LibPropertyWrapper->ExporterInfo->Version->build;
319                  //_grn_file->GrannyFileInfo->ExporterInfo->ExtendedData                  //_grn_file->GrannyFileInfo->ExporterInfo->ExtendedData
320          }          }
321  #pragma endregion  #pragma endregion
# Line 344  private: System::Void mnuItemOpen_Click( Line 342  private: System::Void mnuItemOpen_Click(
342                           //_grn_file->_logger->SetLogFileName("c:\\gr2_logs",fn);                           //_grn_file->_logger->SetLogFileName("c:\\gr2_logs",fn);
343                           _grn_file = new grannyfile(fn);                           _grn_file = new grannyfile(fn);
344    
345                            this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();
346                           propgrid->SelectedObjects = ConvertToManaged();                          ConvertToManaged();
347                             propgrid->SelectedObject = this->GR2LibPropertyWrapper;
348                   }                   }
349  private: System::Void gr2lib_rigeditor_frm_FormClosed(System::Object^  sender, System::Windows::Forms::FormClosedEventArgs^  e)  private: System::Void gr2lib_rigeditor_frm_FormClosed(System::Object^  sender, System::Windows::Forms::FormClosedEventArgs^  e)
350                   {                   {

Legend:
Removed from v.14  
changed lines
  Added in v.15

  ViewVC Help
Powered by ViewVC 1.1.22