#include <cadex/LicenseManager_Activate.h>
#include <cadex/ModelAlgo_TopoPrimitives.hxx>
#include <cadex/ModelData_Axis2Placement.hxx>
#include <cadex/ModelData_BRepRepresentation.hxx>
#include <cadex/ModelData_Direction.hxx>
#include <cadex/ModelData_ModelWriter.hxx>
#include <cadex/ModelData_Part.hxx>
#include <cadex/ModelData_Solid.hxx>
#include <iostream>
#include "../../cadex_license.cxx"
static void AttachPrimitiveToModel (const char* theName,
{
}
double Dx,
double Dy,
double Dz,
{
ModelData_Solid aBox = ModelAlgo_TopoPrimitives::CreateBox (thePosition, Dx, Dy, Dz);
AttachPrimitiveToModel ("Box", aBox, theModel);
}
double theRadius,
{
ModelData_Solid aSphere = ModelAlgo_TopoPrimitives::CreateSphere (thePosition, theRadius);
AttachPrimitiveToModel ("Sphere", aSphere, theModel);
}
double theRadius,
double theHeight,
{
ModelData_Solid aCylinder = ModelAlgo_TopoPrimitives::CreateCylinder (anAxis, theRadius, theHeight);
AttachPrimitiveToModel ("Cylinder", aCylinder, theModel);
}
double theRadius1,
double theRadius2,
double theHeight,
{
ModelData_Solid aCone = ModelAlgo_TopoPrimitives::CreateCone (anAxis, theRadius1, theRadius2, theHeight);
AttachPrimitiveToModel ("Cone", aCone, theModel);
}
double theMinRadius,
double theMaxRadius,
{
ModelData_Solid aTorus = ModelAlgo_TopoPrimitives::CreateTorus (anAxis, theMaxRadius, theMinRadius);
AttachPrimitiveToModel ("Torus", aTorus, theModel);
}
int main()
{
auto aKey = LicenseKey::Value();
if (!CADExLicense_Activate (aKey)) {
cerr << "Failed to activate CAD Exchanger license." << endl;
return 1;
}
8., 8., 8.,
aModel);
4.,
aModel);
4., 8.,
aModel);
3., 5., 7.,
aModel);
2., 3.,
aModel);
if (!aWriter.
Write (aModel,
"Primitives.xml")) {
cout << "Unable to save the model!" << endl;
return 1;
}
return 0;
}