#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"
using namespace std;
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.cdx")) {
cout << "Unable to save the model!" << endl;
return 1;
}
return 0;
}
Defines a right-hand axis placement in 3D.
Definition: ModelData_Axis2Placement.hxx:38
Defines precise Boundary Representation of part.
Definition: ModelData_BRepRepresentation.hxx:39
Provides CAD Exchanger data model.
Definition: ModelData_Model.hxx:43
const ModelData_SceneGraphElement & AddRoot(const ModelData_SceneGraphElement &theElement)
Adds new root element into the scene graph.
Definition: ModelData_Model.cxx:830
Writes any format that CAD Exchanger can export.
Definition: ModelData_ModelWriter.hxx:33
bool Write(const ModelData_Model &theModel, const Base_UTF16String &theFilePath)
Writes the specified model to the file at the specified path.
Definition: ModelData_ModelWriter.cxx:143
Defines a leaf node in the scene graph hiearchy.
Definition: ModelData_Part.hxx:35
Defines a 3D point.
Definition: ModelData_Point.hxx:295
Defines a topological solid.
Definition: ModelData_Solid.hxx:31
Defines classes, types, and global functions related to CAD Exchanger.
Definition: A3DSTestLib.hxx:22