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... | |
| MaterialObject * | CopyMaterial (Variant &val) |
| Copies a material. More... | |
| MaterialObject * | CopyMaterialByObject (MaterialObject *original) |
| Copies a material from the MaterialObject. More... | |
| MaterialObject * | CreateCustomMaterial (String &name, String &libPath=String()) |
| Creates a custom material. More... | |
| void | CreateNewFolder (String &name, String &libPath) |
| Creates a material folder. More... | |
| MaterialObject * | CreateUserMagnet (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... | |
| MaterialObject * | GetCustomMaterial (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... | |
| MaterialObject * | GetMaterial (Variant &val) |
| Returns a material. More... | |
| Material * | GetUserMaterial (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:
Member Function Documentation
| void MaterialLibrary::AddBookmark | ( | Variant & | val | ) |
Adds a materials to a bookmark.
- Parameters
-
val Name or index of the material
| MaterialObject * MaterialLibrary::CopyMaterial | ( | Variant & | val | ) |
| MaterialObject * MaterialLibrary::CopyMaterialByObject | ( | MaterialObject * | original | ) |
Copies a material from the MaterialObject.
- Parameters
-
original MaterialObject object
- Returns
- MaterialObject object
| MaterialObject * MaterialLibrary::CreateCustomMaterial | ( | String & | name, |
| String & | libPath = String() |
||
| ) |
Creates a custom material.
- Parameters
-
name Material name libPath Path in the [Custom Materials] folder (can be abbreviated)
- Returns
- MaterialObject object
| void MaterialLibrary::CreateNewFolder | ( | String & | name, |
| String & | libPath | ||
| ) |
Creates a material folder.
- Parameters
-
name Folder path libPath Folder 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
-
name Material name jcfpath JCF file path libPath Path 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
-
val Name or index of the material libPath Path in the [Custom Materials] folder (can be abbreviated)
| void MaterialLibrary::DeleteCustomMaterialByObject | ( | MaterialObject * | object | ) |
Deletes a custom material by specifying the MaterialObject object.
- Parameters
-
object MaterialObject object
| void MaterialLibrary::DeleteFolder | ( | String & | libPath | ) |
Deletes the specified folder.
- Parameters
-
libPath Folder 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
-
filename File path
| void MaterialLibrary::ExportFolderMaterialXML | ( | String & | filename, |
| String & | libPath | ||
| ) |
Exports all custom material data in the specified folder to an XML file.
- Parameters
-
filename File path libPath Path 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
-
filename File path val Material name
| MaterialObject * MaterialLibrary::GetCustomMaterial | ( | Variant & | val, |
| String & | libPath = String() |
||
| ) |
Returns a custom material.
- Parameters
-
val Name or index of the material libPath Path 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
-
folderIndex Folder index libPath Folder 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
-
folderIndex Folder index libPath Folder path (in the [Custom Materials] folder or in the [User Magnetization] folder, can be abbreviated)
- Returns
- Folder path
| MaterialObject * MaterialLibrary::GetMaterial | ( | Variant & | val | ) |
| Material * MaterialLibrary::GetUserMaterial | ( | Variant & | val | ) |
Returns a property of custom material by specifing the name.
- Parameters
-
val Name
- Returns
- Material object
| void MaterialLibrary::ImportMaterial | ( | String & | filename | ) |
Imports materials created in JMAG-Studio and other programs.
- Parameters
-
filename File 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
-
filename File path
| bool MaterialLibrary::IsSingleton | ( | ) |
Since this is an internal function, it is not officially supported.
| 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
-
val Name or index of the material libPath Destination folder path
| int MaterialLibrary::NumCustomMaterials | ( | String & | libPath = String() | ) |
Returns the number of custom materials.
- Parameters
-
libPath Path 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
-
libPath Folder 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
-
val Name or index of the material
| void MaterialLibrary::RenameFolder | ( | String & | oldPath, |
| String & | newName | ||
| ) |
Renames the specified folder.
- Parameters
-
oldPath Folder path newName New folder name