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. | |
MaterialLibrary class is used when handling the material database.
The class can be called from Application class.
.
Example of calling the class object:
| void MaterialLibrary::AddBookmark | ( | Variant & | val | ) |
Adds a materials to a bookmark.
| val | Name or index of the material |
| MaterialObject * MaterialLibrary::CopyMaterial | ( | Variant & | val | ) |
| MaterialObject * MaterialLibrary::CopyMaterialByObject | ( | MaterialObject * | original | ) |
Copies a material from the MaterialObject.
| original | MaterialObject object |
| MaterialObject * MaterialLibrary::CreateCustomMaterial | ( | String & | name, |
| String & | libPath = String() |
||
| ) |
Creates a custom material.
| name | Material name |
| libPath | Path in the [Custom Materials] folder (can be abbreviated) |
| void MaterialLibrary::CreateNewFolder | ( | String & | name, |
| String & | libPath | ||
| ) |
Creates a material folder.
| 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.
| name | Material name |
| jcfpath | JCF file path |
| libPath | Path in the [User Magnetization] folder (can be abbreviated) |
| void MaterialLibrary::DeleteCustomMaterial | ( | Variant & | val, |
| String & | libPath = String() |
||
| ) |
Deletes a custom material by specifying the name or index.
| 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.
| object | MaterialObject object |
| void MaterialLibrary::DeleteFolder | ( | String & | libPath | ) |
Deletes the specified folder.
| 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.
| filename | File path |
| void MaterialLibrary::ExportFolderMaterialXML | ( | String & | filename, |
| String & | libPath | ||
| ) |
Exports all custom material data in the specified folder to an XML file.
| 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.
| filename | File path |
| val | Material name |
| MaterialObject * MaterialLibrary::GetCustomMaterial | ( | Variant & | val, |
| String & | libPath = String() |
||
| ) |
Returns a custom material.
| val | Name or index of the material |
| libPath | Path in the [Custom Materials] folder (can be abbreviated) |
| String MaterialLibrary::GetFolderName | ( | int | folderIndex, |
| String & | libPath = String() |
||
| ) |
Returns the name of the specified folder.
| folderIndex | Folder index |
| libPath | Folder path (in the [Custom Materials] folder or in the [User Magnetization] folder, can be abbreviated) |
| String MaterialLibrary::GetFolderPath | ( | int | folderIndex, |
| String & | libPath = String() |
||
| ) |
Returns the path of the specified folder.
| folderIndex | Folder index |
| libPath | Folder path (in the [Custom Materials] folder or in the [User Magnetization] folder, can be abbreviated) |
| MaterialObject * MaterialLibrary::GetMaterial | ( | Variant & | val | ) |
| Material * MaterialLibrary::GetUserMaterial | ( | Variant & | val | ) |
Returns a property of custom material by specifing the name.
| val | Name |
| void MaterialLibrary::ImportMaterial | ( | String & | filename | ) |
Imports materials created in JMAG-Studio and other programs.
| 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.
| 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.
| void MaterialLibrary::MoveMaterial | ( | Variant & | val, |
| String & | libPath | ||
| ) |
Moves custom materials or user magnetization materials to another folder.
| val | Name or index of the material |
| libPath | Destination folder path |
| int MaterialLibrary::NumCustomMaterials | ( | String & | libPath = String() | ) |
Returns the number of custom materials.
| libPath | Path in the [Custom Materials] folder (can be abbreviated) |
| int MaterialLibrary::NumFolders | ( | String & | libPath = String() | ) |
Returns the number of folders in the specified folder.
| libPath | Folder path (in the [Custom Materials] folder or in the [User Magnetization] folder, can be abbreviated) |
| int MaterialLibrary::NumMaterials | ( | ) |
Returns the total number of materials.
| void MaterialLibrary::RemoveBookmark | ( | Variant & | val | ) |
Removes a material from a bookmark.
| val | Name or index of the material |
| void MaterialLibrary::RenameFolder | ( | String & | oldPath, |
| String & | newName | ||
| ) |
Renames the specified folder.
| oldPath | Folder path |
| newName | New folder name |