#include <cadex/LicenseManager_Activate.h>
#include <cadex/ModelAlgo_BoundingBox.hxx>
#include <cadex/ModelAlgo_TopoPrimitives.hxx>
#include <cadex/ModelAlgo_ValidationProperty.hxx>
#include <cadex/ModelAlgo_ValidationPropertyData.hxx>
#include <cadex/ModelData_Box.hxx>
#include <cadex/ModelData_BRepRepresentation.hxx>
#include <cadex/ModelData_Point.hxx>
#include <cadex/ModelData_Solid.hxx>
#include <iostream>
#include "../../cadex_license.cxx"
using namespace std;
int main()
{
auto aKey = LicenseKey::Value();
if (!CADExLicense_Activate (aKey)) {
cerr << "Failed to activate CAD Exchanger license." << endl;
return 1;
}
ModelData_Solid aCylinder = ModelAlgo_TopoPrimitives::CreateCylinder (5., 10.);
ModelAlgo_ValidationProperty::ComputeValidationProperties (aCylinder, aData);
double aVolume = aData.
Volume();
cout << "Surface area: " << aSurfaceArea << endl;
cout << "Volume: " << aVolume << endl;
cout << "Centroid: (" << aCentroid.X() << ", " << aCentroid.Y() << ", " << aCentroid.Z() << ")" << endl;
cout <<
"Bounding Box: (" << aBBox.
XRange() <<
", " << aBBox.
YRange() <<
", " << aBBox.
ZRange() <<
")" << endl;
return 0;
}
Aggregation of all validation properties that could be computed.
Definition: ModelAlgo_ValidationPropertyData.hxx:36
double SurfaceArea() const
Returns a surface area.
Definition: ModelAlgo_ValidationPropertyData.cxx:76
const ModelData_Point & Centroid() const
Returns a center of mass.
Definition: ModelAlgo_ValidationPropertyData.cxx:88
double Volume() const
Returns a volume.
Definition: ModelAlgo_ValidationPropertyData.cxx:64
Defines precise Boundary Representation of part.
Definition: ModelData_BRepRepresentation.hxx:39
Defines a 3D axis-aligned bounding box.
Definition: ModelData_Box.hxx:31
double ZRange() const
Returns the length of range along Z axis.
Definition: ModelData_Box.hxx:91
double YRange() const
Returns the length of range along Y axis.
Definition: ModelData_Box.hxx:89
double XRange() const
Returns the length of range along X axis.
Definition: ModelData_Box.hxx:87
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