using System;
using System.Runtime.InteropServices;
namespace offscreen
{
class Program
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern bool SetDllDirectory(string lpPathName);
static int Main(string[] args)
{
SetDllDirectory("../../../../../../win64/vc14.1/bin");
string aKey = LicenseKey.Value();
if (!LicenseManager.Activate(aKey))
{
Console.WriteLine("Failed to activate CAD Exchanger license.");
return 1;
}
if (args.Length != 2)
{
Console.WriteLine("Usage: " + System.Reflection.Assembly.GetExecutingAssembly().Location
+ " <input_file> <output_file>, where:");
Console.WriteLine(" <input_file> is a name of the STEP file to be read");
Console.WriteLine(" <output_file> is a name of the PNG file to be written");
return 1;
}
string aSource = args[0];
string aDest = args[1];
{
Console.WriteLine("Failed to open and convert the file " + aSource);
return 1;
}
ModelPrs_SceneNodeFactory aFactory = new ModelPrs_SceneNodeFactory();
aRootNode.SetDisplayMode(ModelPrs_DisplayMode.ModelPrs_DM_ShadedWithBoundaries);
ModelPrs_Scene aScene = new ModelPrs_Scene();
aScene.AddRoot(aRootNode);
ModelPrs_OffscreenViewPort aViewPort = new ModelPrs_OffscreenViewPort();
aViewPort.Resize(800, 600);
ModelPrs_BackgroundStyle aStyle = new ModelPrs_BackgroundStyle(aBackgroundColor);
aViewPort.SetBackgroundStyle(aStyle);
if (!aViewPort.AttachToScene(aScene)) {
Console.WriteLine("Unable to attach viewport to scene");
return 1;
}
aScene.Update();
aScene.Wait();
aViewPort.FitAll();
Console.WriteLine("Failed to write the file " + aDest);
return 1;
}
return 0;
}
}
}
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition: Base_UTF16String.hxx:34
Defines an RGBA color (with alpha channel).
Definition: ModelData_Color.hxx:34
Provides CAD Exchanger data model.
Definition: ModelData_Model.hxx:43
Reads any format that CAD Exchanger can import.
Definition: ModelData_ModelReader.hxx:33
bool Read(const Base_UTF16String &theFilePath, ModelData_Model &theModel)
Reads the file at the specified path into the specified model.
Definition: ModelData_ModelReader.cxx:182
Defines classes, types, and global functions related to CAD Exchanger.
Definition: A3DSTestLib.hxx:22
ModelData_RepresentationMask
Defines a mask to filter part representations.
Definition: ModelData_RepresentationMask.hxx:25
ModelPrs_CameraProjectionType
Defines a camera projection type.
Definition: ModelPrs_CameraProjectionType.hxx:25
ModelPrs_CameraPositionType
Defines a direction where the camera is located.
Definition: ModelPrs_CameraPositionType.hxx:25