LoadMesh Method

Summary
Loads the saved mesh into an empty 3D object.
Syntax
C#
C++/CLI
public void LoadMesh( 
   string fileName 
) 
public: 
void LoadMesh(  
   String^ fileName 
)  

Parameters

fileName
the name of the saved 3D mesh.

Remarks
  • A mesh can be split into multiple files. For example, if you saved a mesh with a name "JamesMesh", the saved mesh will be:

    • JamesMesh.x
    • JamesMesh001.x
    • JamesMesh002.x
    • JamesMesh003.x
    • JamesMesh004.x
    • ...

    To load this mesh select the first file. This is the file without numbers appended to the end of the file name.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.MedicalViewer; 
using Leadtools.Medical3D; 
 
public void Medical3DControlExample() 
{ 
   MainForm1 form = new MainForm1(); 
   form.ShowDialog(); 
} 
 
// MainForm1 will be the owner of the medical viewer control. 
class MainForm1 : Form 
{ 
   private Medical3DControl _medical3DControl; 
 
   public MainForm1() 
   { 
      _medical3DControl = new Medical3DControl(); 
      this.SizeChanged += new EventHandler(MainForm1_SizeChanged); 
      this.FormClosing += new FormClosingEventHandler(MainForm1_FormClosing); 
 
      _medical3DControl.ObjectsContainer.Objects.Add(new Medical3DObject()); 
 
      _medical3DControl.ObjectsContainer.VolumeType = Medical3DVolumeType.SSD; 
 
      _medical3DControl.AddAction(MedicalViewerActionType.Rotate3DObject); 
      _medical3DControl.SetAction(MedicalViewerActionType.Rotate3DObject, MedicalViewerMouseButtons.Left, MedicalViewerActionFlags.Active); 
 
      string fileName = Path.Combine(LEAD_VARS.ImagesDir, @"Images\CT_PelvisMesh.x"); 
 
      if (_medical3DControl.ObjectsContainer.VolumeType == Medical3DVolumeType.SSD) 
         _medical3DControl.ObjectsContainer.Objects[0].SSD.LoadMesh(fileName); 
 
      Controls.Add(_medical3DControl); 
   } 
 
   void MainForm1_FormClosing(object sender, FormClosingEventArgs e) 
   { 
      _medical3DControl.Dispose(); 
   } 
 
 
   void MainForm1_SizeChanged(object sender, EventArgs e) 
   { 
      if (_medical3DControl != null) 
         _medical3DControl.Size = new Size(this.ClientRectangle.Right, this.ClientRectangle.Bottom); 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Medical3D Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.