#include <cadex/Base_String.hxx>
#include <cadex/LicenseManager_Activate.h>
#include <cadex/ModelData_Color.hxx>
#include <cadex/ModelData_IndexedTriangleSet.hxx>
#include <cadex/ModelData_ModelWriter.hxx>
#include <cadex/ModelData_Point2d.hxx>
#include <cadex/ModelData_PolyLineSet.hxx>
#include <cadex/ModelData_PolyPointSet.hxx>
#include <cadex/ModelData_PolyRepresentation.hxx>
#include <cadex/ModelData_Vector.hxx>
#include <array>
#include <iostream>
#include <vector>
#include "../../cadex_license.cxx"
using namespace std;
{
vector<ModelData_Point> aPoints1, aPoints2;
for (int i = 0; i < 10; ++i) {
}
aPPS.
Add (aPoints1.data(), aPoints1.size());
aPPS.
Add (aPoints2.data(), aPoints2.size());
return aPPS;
}
{
vector<ModelData_Point> aPoints1, aPoints2;
for (int i = 0; i < 10; ++i) {
}
return aPLS;
}
{
array<ModelData_Point, 8> aCoords = {{
}};
array<int, 24> aVerticesIndices = {{
0, 1, 2, 3,
1, 0, 4, 5,
2, 1, 5, 6,
3, 2, 6, 7,
0, 3, 7, 4,
7, 6, 5, 4,
}};
array<int, 6> aCounts = {{4, 4, 4, 4, 4, 4}};
array<ModelData_Vectorf, 6> aNormals = {{
ModelData_Vectorf ( 0.f, 0.f, 1.f),
ModelData_Vectorf ( 0.f, 1.f, 0.f),
ModelData_Vectorf (-1.f, 0.f, 0.f),
ModelData_Vectorf ( 0.f, -1.f, 0.f),
ModelData_Vectorf ( 1.f, 0.f, 0.f),
ModelData_Vectorf ( 0.f, 0.f, -1.f),
}};
array<int, 24> aNormalsIndices = {{
0, 0, 0, 0,
1, 1, 1, 1,
2, 2, 2, 2,
3, 3, 3, 3,
4, 4, 4, 4,
5, 5, 5, 5,
}};
array<ModelData_Color, 6> aColors = {{
}};
array<int, 24> aColorsIndices = {{
0, 0, 0, 0,
1, 1, 1, 1,
2, 2, 2, 2,
3, 3, 3, 3,
4, 4, 4, 4,
5, 5, 5, 5,
}};
anITS.
AddCoordinates (aCoords.data(), aCoords.size(), aVerticesIndices.data(), aCounts.data(), aCounts.size());
anITS.
AddNormals (aNormals.data(), aNormals.size(), aNormalsIndices.data(), aCounts.data(), aCounts.size());
anITS.
AddColors (aColors.data(), aColors.size(), aColorsIndices.data(), aCounts.data(), aCounts.size());
return anITS;
}
int main()
{
auto aKey = LicenseKey::Value();
if (!CADExLicense_Activate (aKey)) {
cerr << "Failed to activate CAD Exchanger license." << endl;
return 1;
}
aWriter.
Write (aModel,
"Poly.cdx");
return 0;
}
Defines an RGBA color (with alpha channel).
Definition: ModelData_Color.hxx:34
Defines a polygonal shape consisting of triangles.
Definition: ModelData_IndexedTriangleSet.hxx:35
void AddCoordinates(const CoordType theVertices[], size_t theVertexNb)
Adds vertex coordinates.
Definition: ModelData_IndexedTriangleSet.cxx:336
void AddNormals(const NormalType theNormals[], size_t theNormalNb, const IndexType theIndices[], size_t theIndexNb)
Adds vertex normals.
Definition: ModelData_IndexedTriangleSet.cxx:364
void AddColors(const ColorType theColors[], size_t theColorNb, const IndexType theIndices[], size_t theIndexNb)
Adds vertex colors.
Definition: ModelData_IndexedTriangleSet.cxx:382
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
void AddRepresentation(const ModelData_Representation &theRepresentation)
Adds a representation.
Definition: ModelData_Part.cxx:341
Defines a 3D point.
Definition: ModelData_Point.hxx:295
Defines a polygonal shape consisting of polylines.
Definition: ModelData_PolyLineSet.hxx:31
void AddPolyLine(const CoordType *theVertices, size_t theSize)
Adds a polyline into the set.
Definition: ModelData_PolyLineSet.cxx:108
Defines a polygonal shape consisting of individual points.
Definition: ModelData_PolyPointSet.hxx:31
void Add(const CoordType *thePoints, size_t theSize)
Adds points into a point set.
Definition: ModelData_PolyPointSet.cxx:80
Defines polygonal (faceted or tessellated) representation of part.
Definition: ModelData_PolyRepresentation.hxx:39
Defines classes, types, and global functions related to CAD Exchanger.
Definition: A3DSTestLib.hxx:22