using System;
using System.Runtime.InteropServices;
namespace polyrepresentation
{
class Program
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern bool SetDllDirectory(string lpPathName);
static int Main(string[] args)
{
SetDllDirectory("../../../../../../win64/vc14.1/bin");
string aKey = LicenseKey.Value();
if (!LicenseManager.Activate(aKey))
{
Console.WriteLine("Failed to activate CAD Exchanger license.");
return 1;
}
if (args.Length != 1)
{
Console.WriteLine("Usage: " + System.Reflection.Assembly.GetExecutingAssembly().Location
+ " <input_file>, where:");
Console.WriteLine(" <input_file> is a name of the XML file to be read");
return 1;
}
string aSource = args[0];
{
Console.WriteLine("Failed to read the file " + aSource);
return 1;
}
PartPolyVisitor aVisitor = new PartPolyVisitor();
return 0;
}
}
{
{
if (aPolyRep != null)
{
ExplorePoly(aPolyRep);
}
}
{
for (uint i = 0; i < aList.
Size(); ++i)
{
Console.WriteLine("PolyShape " + i + ":");
PrintPVSInfo(aPVS);
}
}
{
{
Console.WriteLine("IndexedTriangleSet type.");
DumpTriangleSet(ITS);
}
{
Console.WriteLine("PolyLineSet type.");
DumpPolyLineSet(PLS);
}
{
Console.WriteLine("PolyPointSet type.");
DumpPolyPointSet(PPS);
}
else
{
Console.WriteLine("Undefined type");
}
}
{
int n = thePS.
NumberOfVertices();
Console.WriteLine("PolyPoint set contains " + n + " vertices");
for (int i = 0; i < n; ++i)
{
Console.WriteLine("Point " + i + ":");
Console.WriteLine(" Node coordinates:");
Console.WriteLine(" (" + aP.X() + ", " + aP.Y() + ", " + aP.Z() + ")");
}
}
{
Console.WriteLine("PolyLine set contains " + n + "PolyLines");
for (int i = 0; i < n; ++i)
{
Console.WriteLine("PolyLine" + i + ":");
Console.WriteLine(" Node coordinates:");
{
Console.WriteLine(" (" + aV.X() + ", " + aV.Y() + ", " + aV.Z() + ")");
}
}
}
{
Console.WriteLine("Triangle set contains " + n + " number of faces");
for (int i = 0; i < n; ++i)
{
Console.WriteLine("Triangle " + i + ":");
for (int j = 0; j < 3; ++j)
{
Console.WriteLine(" Node " + j + ":");
Console.WriteLine(" Coordinates: (" + aV.X() + ", " + aV.Y() + ", " + aV.Z() + ")");
{
Console.WriteLine(" UV Coordinates: (" + aUV.X() + ", " + aUV.Y() + ")");
}
{
Console.WriteLine(" Normal vector: (" + aN.X() + ", " + aN.Y() + ", " + aN.Z() + ")");
}
{
Console.WriteLine(
" Color(RGBA): " + aColor.
R() +
", " + aColor.
G() +
", " + aColor.
B() +
", " + aColor.
A() +
")");
}
}
}
}
}
}
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition: Base_UTF16String.hxx:34
Computes a polygonal representation from a B-Rep one.
Definition: ModelAlgo_BRepMesher.hxx:48
void Compute(const ModelData_Model &theModel, bool theEnforceAddition=false) const
Computes polygonal representations for all parts in the model.
Definition: ModelAlgo_BRepMesher.cxx:478
Defines parameters used by the B-Rep mesher.
Definition: ModelAlgo_BRepMesherParameters.hxx:33
Granularity
Defines target accuracy of the mesh to be generated.
Definition: ModelAlgo_BRepMesherParameters.hxx:35
void SetGranularity(Granularity theVal)
Sets mesh granularity policy.
Definition: ModelAlgo_BRepMesherParameters.cxx:153
IdType TypeId() const
Returns an object type id.
Definition: ModelData_BaseObject.cxx:199
Defines an RGBA color (with alpha channel).
Definition: ModelData_Color.hxx:34
float A() const
Returns alpha-channel.
Definition: ModelData_Color.hxx:76
Defines a polygonal shape consisting of triangles.
Definition: ModelData_IndexedTriangleSet.hxx:35
const CoordType & Coordinate(IndexType theFace, IndexType theVertexSlot) const
Returns a vertex coordinate.
Definition: ModelData_IndexedTriangleSet.cxx:210
bool HasNormals() const
Returns true if the triangle set has explicitly defined normals.
Definition: ModelData_IndexedTriangleSet.cxx:228
bool HasUVCoordinates() const
Returns true if the triangle set has UV coordinates associated with vertices.
Definition: ModelData_IndexedTriangleSet.cxx:289
const NormalType & VertexNormal(IndexType theFace, IndexType theVertexSlot) const
Returns a normal at a vertex in a face.
Definition: ModelData_IndexedTriangleSet.cxx:246
const ModelData_Point2d & UVCoordinate(IndexType theFace, IndexType theVertexSlot) const
Returns a UV coordinate associated with a vertex.
Definition: ModelData_IndexedTriangleSet.cxx:299
const ColorType & VertexColor(IndexType theFace, IndexType theVertexSlot) const
Returns a color at a vertex in a face.
Definition: ModelData_IndexedTriangleSet.cxx:271
IndexType NumberOfFaces() const
Returns a number of faces (triangles).
Definition: ModelData_IndexedTriangleSet.cxx:179
Provides CAD Exchanger data model.
Definition: ModelData_Model.hxx:43
void Accept(ElementVisitor &theVisitor) const
Accepts a visitor.
Definition: ModelData_Model.cxx:882
Reads any format that CAD Exchanger can import.
Definition: ModelData_ModelReader.hxx:33
bool Read(const Base_UTF16String &theFilePath, ModelData_Model &theModel)
Reads the file at the specified path into the specified model.
Definition: ModelData_ModelReader.cxx:182
Defines a leaf node in the scene graph hiearchy.
Definition: ModelData_Part.hxx:35
ModelData_PolyRepresentation PolyRepresentation(ModelData_RepresentationMask theRepresentationMask) const
Definition: ModelData_Part.cxx:371
Defines a 2D point.
Definition: ModelData_Point2d.hxx:193
Defines a 3D point.
Definition: ModelData_Point.hxx:295
Defines a polygonal shape consisting of polylines.
Definition: ModelData_PolyLineSet.hxx:31
const CoordType & Coordinate(IndexType thePolyline, IndexType theVertexSlot) const
Returns a vertex coordinate.
Definition: ModelData_PolyLineSet.cxx:99
IndexType NumberOfPolyLines() const
Returns a number of polylines.
Definition: ModelData_PolyLineSet.cxx:89
IndexType NumberOfVertices(IndexType thePolyline) const
Returns a number of vertices in a polyline.
Definition: ModelData_PolyLineSet.cxx:80
Defines a polygonal shape consisting of individual points.
Definition: ModelData_PolyPointSet.hxx:31
Defines polygonal (faceted or tessellated) representation of part.
Definition: ModelData_PolyRepresentation.hxx:39
const ModelData_PolyShapeList & Get() const
Returns poly shapes comprising the representation.
Definition: ModelData_PolyRepresentation.cxx:408
List of vertex sets contained in polygonal representation.
Definition: ModelData_PolyShapeList.hxx:33
Base class for particular vertex sets - triangle sets, polyline sets, point sets.
Definition: ModelData_PolyVertexSet.hxx:31
const CoordType & Coordinate(IndexType theVertexIndex) const
Returns a vertex coordinate.
Definition: ModelData_PolyVertexSet.cxx:81
Defines classes, types, and global functions related to CAD Exchanger.
Definition: A3DSTestLib.hxx:22
ModelData_RepresentationMask
Defines a mask to filter part representations.
Definition: ModelData_RepresentationMask.hxx:25