Demonstrates how to generate and save an image of a model.
Overview
In this example we create a View::ImageWriter object which allows us to generate and save an image of ModelData::Model .
Implementation
The main function will have the following structure:
cerr << "Failed to read the file " << aSource << endl;
return 1;
}
Provides MTK data model.
Definition Model.hxx:40
Reads STEP and native format.
Definition ModelReader.hxx:33
Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.
Definition LicenseManager_LicenseError.hxx:30
aWriterParameters.SetImageWidth (750);
aWriterParameters.SetImageHeight (500);
aWriterParameters.SetViewIsFitAll (true);
aWriterParameters.SetViewBackground (aBackground);
aWriter.SetParameters (aWriterParameters);
Defines color background style.
Definition BackgroundStyle.hxx:45
Defines an RGBA color.
Definition Color.hxx:32
Writes an image file with graphical content of a model.
Definition ImageWriter.hxx:41
Defines parameters of the ImageWriter.
Definition ImageWriterParameters.hxx:34
- Generate an image of a model and save it into a file:
if (!aWriter.WriteFile (aModel, aDest)) {
cerr << "Failed to write the image file " << aDest << endl;
return 1;
}
Files