Class MeshLabLauncher
java.lang.Object
org.web3d.x3d.jsail.MeshLabLauncher
Utility class for invoking and launching MeshLab via local operating system to perform a variety of conversion tasks. Note use of static methods.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault MeshLab path default for Linux operating system, possibly unneeded ifmeshlabserveris in path already.static final StringDefault MeshLab path default for macOS operating system, possibly unneeded ifmeshlabserveris in path already.static final StringDefault MeshLab path default for Windows operating system.static final StringMeshLab website URLstatic final Stringmeshlabserver warningstatic final StringUsage:java [-classpath X3DJSAIL.*.jar] org.web3d.x3d.jsail.MeshLabLauncher sourceFile [-convert [resultFile]] [-home | -help | -properties fileName.properties | -MESHLAB_PATH directoryPath] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCheck MeshLab local path and also executable name, reset to operating system defaults if necessary.static booleanconvertModel(String inputFileName, String outputFileName) Use meshLab to convert model from one file to another.static booleanconvertModel(String path, String inputFileName, String outputFileName) Use meshLab to convert model from one file to another.protected static StringexecuteCommand(String command) Launch MeshLab in operating system and run command.static booleanexportModelToFile(X3D modelToExport, String path, String fileName) TODO: Use MeshLab to export geometry to STLstatic booleanexportSTLtoFile(X3D modelToExport, String path, String fileName) TODO: Use MeshLab to export geometry to filestatic StringgetMeshLabAnalytics(X3D modelOfInterest) TODO: Get MeshLab metrics for X3D model of interest.static MetadataSetgetMeshLabAnalyticsX3dMetadataSet(X3D modelOfInterest) TODO: Get MeshLab metrics as MetadataSet object.static StringGet default MeshLab help message (from invocation without command-line parameters).static final StringGet directory path for location ofmeshlabserverprogram.static final StringGet directory path for location ofmeshlabserverprogram:meshlabserver.exeon Windows,meshlabserverotherwise.static StringGet MeshLab version.static StringGet contents of MeshLab trace log file produced during most recent MeshLab operation.static StringGet name of MeshLab trace log file produced during most recent MeshLab operation.static booleanDetermine if MeshLab is locally available.static X3DimportModel(String fileName) Use meshLab to import model to X3D.static X3DimportModel(String path, String fileName) Use meshLab to import model to X3D.TODO: Use meshLab to import STL geometry as X3D modelstatic final voidInitialize this MeshLabLauncher instance to default values.static voidOpen MeshLab pagestatic voidDefault main() method provided for test and debugging purposes, invoking run() method.static voidUtility run() method provided for test and debugging purposes, allowing invocation with a single String (rather than a String[] array).static voidDefault run() method provided for test and debugging purposes, first initializing ConfigurationProperties then reading properties file (if any) and processing arguments.static final voidsetMeshLabPath(String newValue) Set directory path for location ofmeshlabserverprogram.static final voidsetMeshLabServerExecutableName(String newValue) Set meshLabServerExecutableName for alternate name ofmeshlabserverprogram.static voidSet name of MeshLab trace log file produced during most recent MeshLab operation.static booleanReport whether prior command execution was successful.
-
Field Details
-
MESHLAB_URL
-
MESHLABSERVER_ERROR_NOTICE
-
MESHLAB_PATH_DEFAULT_WINDOWS
Default MeshLab path default for Windows operating system. Can also setMESHLAB_PATHenvironment variable in operating system. Warning: local settings vary, configure path if necessary.- See Also:
-
MESHLAB_PATH_DEFAULT_MACOS
Default MeshLab path default for macOS operating system, possibly unneeded ifmeshlabserveris in path already. Warning: local settings vary, configure path if necessary.- See Also:
-
MESHLAB_PATH_DEFAULT_LINUX
Default MeshLab path default for Linux operating system, possibly unneeded ifmeshlabserveris in path already. Warning: local settings vary, configure path if necessary.- See Also:
-
USAGE
Usage:java [-classpath X3DJSAIL.*.jar] org.web3d.x3d.jsail.MeshLabLauncher sourceFile [-convert [resultFile]] [-home | -help | -properties fileName.properties | -MESHLAB_PATH directoryPath]- See Also:
-
-
Constructor Details
-
MeshLabLauncher
public MeshLabLauncher()
-
-
Method Details
-
getMeshLabServerExecutableName
Get directory path for location ofmeshlabserverprogram:meshlabserver.exeon Windows,meshlabserverotherwise.- Returns:
- name of meshlabserver program
- See Also:
-
setMeshLabServerExecutableName
Set meshLabServerExecutableName for alternate name ofmeshlabserverprogram.- Parameters:
newValue- is new value to assign `
-
getMeshLabPath
Get directory path for location ofmeshlabserverprogram.- Returns:
- directory path for location of meshlabserver program
-
setMeshLabPath
Set directory path for location ofmeshlabserverprogram.- Parameters:
newValue- is new value to assign
-
checkMeshLabPath
public static void checkMeshLabPath()Check MeshLab local path and also executable name, reset to operating system defaults if necessary. Executable name:meshlabserver.exeon Windows,meshlabserverotherwise.- See Also:
-
wasPriorCommandSuccessful
public static boolean wasPriorCommandSuccessful()Report whether prior command execution was successful.- Returns:
- whether prior command execution was successful.
[warning]
meshlabservermay popup an exception window while running headless (not very smart) which can cause exception to be lost following timeout. - See Also:
-
executeCommand
Launch MeshLab in operating system and run command. [warning]meshlabservermay popup an exception window while running headless (not very smart) which can cause exception to be lost following timeout.- Parameters:
command- MeshLab invocation- Returns:
- console results
- See Also:
-
convertModel
-
convertModel
Use meshLab to convert model from one file to another.- Parameters:
path- directory path to file of interestinputFileName- for input fileoutputFileName- for output file- Returns:
- whether successful
- See Also:
-
importModel
-
importModel
-
importSTL
-
exportModelToFile
TODO: Use MeshLab to export geometry to STL- Parameters:
modelToExport- X3D model of interestpath- directory path for X3D model of interestfileName- file name for X3D model of interest- Returns:
- plain-text STL file
- See Also:
-
exportSTLtoFile
-
getMeshLabAnalytics
-
getMeshLabAnalyticsX3dMetadataSet
TODO: Get MeshLab metrics as MetadataSet object.- Parameters:
modelOfInterest- X3D model to analyze- Returns:
- MeshLab output
- See Also:
-
getMeshLabVersion
Get MeshLab version. Warning: ensure MESHLAB_HOME or local path is set correctly, especially if more than one version is installed.- Returns:
- MeshLab version.
- See Also:
-
hasMeshLab
public static boolean hasMeshLab()Determine if MeshLab is locally available. Warning: ensure MESHLAB_HOME or local path is set correctly, especially if more than one version is installed.- Returns:
- whether MeshLab is found.
- See Also:
-
getMeshLabHelp
Get default MeshLab help message (from invocation without command-line parameters).- Returns:
- MeshLab help message.
- See Also:
-
getPriorMeshLabTraceLogFilePath
Get name of MeshLab trace log file produced during most recent MeshLab operation.- Returns:
- name of most recent MeshLab trace log file
-
setPriorMeshLabTraceLogFilePath
Set name of MeshLab trace log file produced during most recent MeshLab operation.- Parameters:
value- new path and file name for meshLabTraceLogFilePath
-
getPriorMeshLabTraceLogContents
Get contents of MeshLab trace log file produced during most recent MeshLab operation.- Returns:
- contents of most recent MeshLab trace log file
-
initialize
public static final void initialize()Initialize this MeshLabLauncher instance to default values. -
main
Default main() method provided for test and debugging purposes, invoking run() method.- Parameters:
args- the command line arguments- See Also:
-
run
Utility run() method provided for test and debugging purposes, allowing invocation with a single String (rather than a String[] array). When invoked without parameters then reports results of validate() self-checks to system output.- Parameters:
singleStringArguments- the command line arguments- See Also:
-
run
Default run() method provided for test and debugging purposes, first initializing ConfigurationProperties then reading properties file (if any) and processing arguments. When invoked without parameters then reports results of validate() self-checks to system output.- Parameters:
args- the command line arguments- See Also:
-
launchMeshLabWebPage
public static void launchMeshLabWebPage()Open MeshLab page- See Also:
-