public void LoadMesh(
string fileName
)
fileName
the name of the saved 3D mesh.
A mesh can be split into multiple files. For example, if you saved a mesh with a name "JamesMesh", the saved mesh will be:
To load this mesh select the first file. This is the file without numbers appended to the end of the file name.
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:\LEADTOOLS22\Resources\Images";
}