Public Member Functions | List of all members
MaterialLibrary Class Reference

MaterialLibrary class is used when handling the material database.
The class can be called from Application class.
. More...

Public Member Functions

void AddBookmark (Variant &val)
 Adds a materials to a bookmark. More...
 
MaterialObjectCopyMaterial (Variant &val)
 Copies a material. More...
 
MaterialObjectCopyMaterialByObject (MaterialObject *original)
 Copies a material from the MaterialObject. More...
 
MaterialObjectCreateCustomMaterial (String &name, String &libPath=String())
 Creates a custom material. More...
 
void CreateNewFolder (String &name, String &libPath)
 Creates a material folder. More...
 
MaterialObjectCreateUserMagnet (String &name, String &jcfpath, String &libPath=String())
 Creates a user magnet. More...
 
void DeleteCustomMaterial (Variant &val, String &libPath=String())
 Deletes a custom material by specifying the name or index. More...
 
void DeleteCustomMaterialByObject (MaterialObject *object)
 Deletes a custom material by specifying the MaterialObject object. More...
 
void DeleteFolder (String &libPath)
 Deletes the specified folder. More...
 
void ExportAllMaterialXML (String &filename)
 Exports all custom material data to an XML file. More...
 
void ExportFolderMaterialXML (String &filename, String &libPath)
 Exports all custom material data in the specified folder to an XML file. More...
 
void ExportMaterialXML (String &filename, Variant &val, bool forceConfidential=false)
 Exports the specified custom material data to an XML file. More...
 
MaterialObjectGetCustomMaterial (Variant &val, String &libPath=String())
 Returns a custom material. More...
 
String GetFolderName (int folderIndex, String &libPath=String())
 Returns the name of the specified folder. More...
 
String GetFolderPath (int folderIndex, String &libPath=String())
 Returns the path of the specified folder. More...
 
MaterialObjectGetMaterial (Variant &val)
 Returns a material. More...
 
MaterialGetUserMaterial (Variant &val)
 Returns a property of custom material by specifing the name. More...
 
void ImportMaterial (String &filename)
 Imports materials created in JMAG-Studio and other programs. More...
 
void ImportMaterialXML (String &filename)
 Imports custom material data from XML files. More...
 
void ImportStudioMaterial ()
 Simultaneously imports materials created in JMAG-Studio to JMAG-Designer.
 
bool IsSingleton ()
 Since this is an internal function, it is not officially supported. More...
 
bool IsValid ()
 Returns True if an object is valid. More...
 
void MoveMaterial (Variant &val, String &libPath)
 Moves custom materials or user magnetization materials to another folder. More...
 
int NumCustomMaterials (String &libPath=String())
 Returns the number of custom materials. More...
 
int NumFolders (String &libPath=String())
 Returns the number of folders in the specified folder. More...
 
int NumMaterials ()
 Returns the total number of materials. More...
 
void RemoveBookmark (Variant &val)
 Removes a material from a bookmark. More...
 
void RenameFolder (String &oldPath, String &newName)
 Renames the specified folder. More...
 
void SynchronizeMaterial ()
 Synchronizes custom materials.
 

Detailed Description

MaterialLibrary class is used when handling the material database.
The class can be called from Application class.
.

Example of calling the class object:

app.GetMaterialLibrary()

Member Function Documentation

void MaterialLibrary::AddBookmark ( Variant &  val)

Adds a materials to a bookmark.

Parameters
valName or index of the material
MaterialObject * MaterialLibrary::CopyMaterial ( Variant &  val)

Copies a material.

Parameters
valMaterial name to copy
Returns
MaterialObject object
MaterialObject * MaterialLibrary::CopyMaterialByObject ( MaterialObject original)

Copies a material from the MaterialObject.

Parameters
originalMaterialObject object
Returns
MaterialObject object
MaterialObject * MaterialLibrary::CreateCustomMaterial ( String &  name,
String &  libPath = String() 
)

Creates a custom material.

Parameters
nameMaterial name
libPathPath in the [Custom Materials] folder (can be abbreviated)
Returns
MaterialObject object
void MaterialLibrary::CreateNewFolder ( String &  name,
String &  libPath 
)

Creates a material folder.

Parameters
nameFolder path
libPathFolder path (in the [Custom Materials] folder or in the [User Magnetization] folder)
MaterialObject * MaterialLibrary::CreateUserMagnet ( String &  name,
String &  jcfpath,
String &  libPath = String() 
)

Creates a user magnet.

Parameters
nameMaterial name
jcfpathJCF file path
libPathPath in the [User Magnetization] folder (can be abbreviated)
Returns
MaterialObject object
void MaterialLibrary::DeleteCustomMaterial ( Variant &  val,
String &  libPath = String() 
)

Deletes a custom material by specifying the name or index.

Parameters
valName or index of the material
libPathPath in the [Custom Materials] folder (can be abbreviated)
void MaterialLibrary::DeleteCustomMaterialByObject ( MaterialObject object)

Deletes a custom material by specifying the MaterialObject object.

Parameters
objectMaterialObject object
void MaterialLibrary::DeleteFolder ( String &  libPath)

Deletes the specified folder.

Parameters
libPathFolder path (in the [Custom Materials] folder or in the [User Magnetization] folder)
void MaterialLibrary::ExportAllMaterialXML ( String &  filename)

Exports all custom material data to an XML file.

Parameters
filenameFile path
void MaterialLibrary::ExportFolderMaterialXML ( String &  filename,
String &  libPath 
)

Exports all custom material data in the specified folder to an XML file.

Parameters
filenameFile path
libPathPath in the [Custom Materials] folder
void MaterialLibrary::ExportMaterialXML ( String &  filename,
Variant &  val,
bool  forceConfidential = false 
)

Exports the specified custom material data to an XML file.

Parameters
filenameFile path
valMaterial name
MaterialObject * MaterialLibrary::GetCustomMaterial ( Variant &  val,
String &  libPath = String() 
)

Returns a custom material.

Parameters
valName or index of the material
libPathPath in the [Custom Materials] folder (can be abbreviated)
Returns
MaterialObject object
String MaterialLibrary::GetFolderName ( int  folderIndex,
String &  libPath = String() 
)

Returns the name of the specified folder.

Parameters
folderIndexFolder index
libPathFolder path (in the [Custom Materials] folder or in the [User Magnetization] folder, can be abbreviated)
Returns
Folder name
String MaterialLibrary::GetFolderPath ( int  folderIndex,
String &  libPath = String() 
)

Returns the path of the specified folder.

Parameters
folderIndexFolder index
libPathFolder path (in the [Custom Materials] folder or in the [User Magnetization] folder, can be abbreviated)
Returns
Folder path
MaterialObject * MaterialLibrary::GetMaterial ( Variant &  val)

Returns a material.

Parameters
valName or index of the material
Returns
MaterialObject object
Material * MaterialLibrary::GetUserMaterial ( Variant &  val)

Returns a property of custom material by specifing the name.

Parameters
valName
Returns
Material object
void MaterialLibrary::ImportMaterial ( String &  filename)

Imports materials created in JMAG-Studio and other programs.

Parameters
filenameFile path This function imports the following file types.
HB file (magnetic properties)
HBP file (temperature dependency and irreversible demagnetization properties)
HBS file (stress-dependent magnetic properties)
IRON file (iron loss properties)
IRONS file (stress-dependent iron loss properties)
JCM file (material properties (includes magnetic properties and iron loss properties)
Text file (material properties (includes magnetic properties and iron loss properties)
void MaterialLibrary::ImportMaterialXML ( String &  filename)

Imports custom material data from XML files.

Parameters
filenameFile path
bool MaterialLibrary::IsSingleton ( )

Since this is an internal function, it is not officially supported.

Deprecated:
bool MaterialLibrary::IsValid ( )

Returns True if an object is valid.

Returns
Whether or not the MaterialLibrary objects in the list are valid
void MaterialLibrary::MoveMaterial ( Variant &  val,
String &  libPath 
)

Moves custom materials or user magnetization materials to another folder.

Parameters
valName or index of the material
libPathDestination folder path
int MaterialLibrary::NumCustomMaterials ( String &  libPath = String())

Returns the number of custom materials.

Parameters
libPathPath in the [Custom Materials] folder (can be abbreviated)
Returns
Number of custom materials
int MaterialLibrary::NumFolders ( String &  libPath = String())

Returns the number of folders in the specified folder.

Parameters
libPathFolder path (in the [Custom Materials] folder or in the [User Magnetization] folder, can be abbreviated)
Returns
Number of folders
int MaterialLibrary::NumMaterials ( )

Returns the total number of materials.

Returns
Total number of materials
void MaterialLibrary::RemoveBookmark ( Variant &  val)

Removes a material from a bookmark.

Parameters
valName or index of the material
void MaterialLibrary::RenameFolder ( String &  oldPath,
String &  newName 
)

Renames the specified folder.

Parameters
oldPathFolder path
newNameNew folder name