#include <cadex/Base_Exception.hxx>
#include <cadex/Base_LengthUnit.hxx>
#include <cadex/Base_Settings.hxx>
#include <cadex/LicenseManager_Activate.h>
#include <cadex/ModelData_Model.hxx>
#include <cadex/ModelData_ModelReader.hxx>
#include <cadex/OBJ_Writer.hxx>
#include <cadex/OBJ_WriterParameters.hxx>
#include <iostream>
#include "../../cadex_license.cxx"
using namespace std;
int main (int argc, char *argv[])
{
auto aKey = LicenseKey::Value();
if (!CADExLicense_Activate (aKey)) {
cerr << "Failed to activate CAD Exchanger license." << endl;
return 1;
}
if (argc != 3) {
cerr << "Usage: " << argv[0] << " <input_file> <output_file>, where:" << endl;
cerr << " <input_file> is a name of the XML file to open model from" << endl;
cerr << " <output_file> is a name of the OBJ file to be written" << endl;
return 1;
}
const char* aSource = argv[1];
const char* aDest = argv[2];
cerr << "Failed to read the file " << aSource << endl;
return 1;
}
aWriterParams.
LengthUnit() = Base_LengthUnit::Base_LU_Centimeters;
Base_Settings::Default()->SetValue (Base_Settings::UseExceptions, true);
try {
cerr << "Failed to transfer model data to specified format" << endl;
return 1;
}
cerr << "Failed to write the file " << aDest << endl;
return 1;
}
cerr << anEx.
What() << endl;
return 1;
}
return 0;
}
Abstract base class for exceptions thrown from CAD Exchanger.
Definition: Base_Exception.hxx:34
const Base_UTF16String & What() const
Returns a message associated to the exception.
Definition: Base_Exception.cxx:61
bool WriteFile(const Base_UTF16String &theFileName)
Writes contents to a target file.
Definition: Base_Writer.cxx:265
bool Transfer(const ModelData_Model &theModel)
Converts source model into memory representation of the target file.
Definition: Base_Writer.cxx:117
Base_LengthUnit LengthUnit() const
Returns the length unit.
Definition: Base_WriterParameters.cxx:166
Provides CAD Exchanger data model.
Definition: ModelData_Model.hxx:43
Reads any format that CAD Exchanger can import.
Definition: ModelData_ModelReader.hxx:33
Writes Waverfront OBJ files.
Definition: OBJ_Writer.hxx:29
const OBJ_WriterParameters & Parameters() const
Returns parameters.
Definition: OBJ_Writer.cxx:167
Defines parameters of the OBJ writer.
Definition: OBJ_WriterParameters.hxx:27
bool ToGenerateMtlFile() const
Returns true if the write should generates a separate .mtl file.
Definition: OBJ_WriterParameters.cxx:90
Defines classes, types, and global functions related to CAD Exchanger.
Definition: A3DSTestLib.hxx:22