using System;
using System.Runtime.InteropServices;
namespace visualizationmesher
{
{
{
if (myFace == null) {
}
}
{
return myFace;
}
{
myFace = aFirstFace;
}
};
class Program
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern bool SetDllDirectory(string lpPathName);
{
Console.WriteLine(
"Face triangulation contains {0} triangles", aTriangleIndices.
Size());
uint aNumberOfTrianglesToPrint = Math.Min(4, aTriangleIndices.
Size());
for (uint i = 0; i < aNumberOfTrianglesToPrint; ++i) {
int aTriangleIndex = aTriangleIndices.
Element(i);
Console.WriteLine("Triangle index {0} with vertices: ", aTriangleIndex);
for (int aVertexNumber = 0; aVertexNumber < 3; ++aVertexNumber) {
Console.WriteLine(" Vertex index {0} with coords (X: {1}, Y: {2}, Z: {3})", aVertexIndex,
aPoint.X(), aPoint.Y(), aPoint.Z());
}
}
}
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;
}
FirstFaceGetter aVisitor = new FirstFaceGetter();
PrintFaceToPolyAssociation(aFace, aBRepToPolyAssociations);
{
Console.WriteLine("Unable to save the model");
return 1;
}
return 0;
}
}
}
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
const ModelData_BRepToPolyAssociations & BRepToPolyAssociations() const
Returns ModelData_BRepToPolyAssociations object which contain associations between shapes and meshes.
Definition: ModelAlgo_BRepMesher.cxx:625
void Compute(const ModelData_Model &theModel, bool theEnforceAddition=false) const
Computes polygonal representations for all parts in the model.
Definition: ModelAlgo_BRepMesher.cxx:462
Defines parameters used by the B-Rep mesher.
Definition: ModelAlgo_BRepMesherParameters.hxx:33
void SetAngularDeflection(double theValue)
Sets angular deflection.
Definition: ModelAlgo_BRepMesherParameters.cxx:285
void SetSaveBRepToPolyAssociations(bool theValue)
Sets whether associations between ModelData_Shapes and meshes should be generated.
Definition: ModelAlgo_BRepMesherParameters.cxx:480
void SetChordalDeflection(double theValue)
Sets chordal deflection.
Definition: ModelAlgo_BRepMesherParameters.cxx:191
Defines precise Boundary Representation of part.
Definition: ModelData_BRepRepresentation.hxx:39
const ModelData_BodyList & Get() const
Returns an associated topological object.
Definition: ModelData_BRepRepresentation.cxx:626
Contains connecting information between B-Rep and Poly representation.
Definition: ModelData_BRepToPolyAssociations.hxx:42
ModelData_MeshPatch Get(const ModelData_Vertex &theVertex) const
Returns the result of meshing the given vertex.
Definition: ModelData_BRepToPolyAssociations.cxx:209
Defines a root topological shape that can be owned by B-Rep representation.
Definition: ModelData_Body.hxx:28
Defines a list of bodies.
Definition: ModelData_BodyList.hxx:31
Defines a topological face.
Definition: ModelData_Face.hxx:32
static const ModelData_Face & Cast(const ModelData_Shape &theShape)
Cast operator.
Definition: ModelData_Face.cxx:282
Defines an array of indices.
Definition: ModelData_IndexArray.hxx:15
IndexType Element(size_t theIndex) const
Returns the requested index.
Definition: ModelData_IndexArray.cxx:48
size_t Size() const
Returns the size of array.
Definition: ModelData_IndexArray.cxx:41
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
IndexType CoordinateIndex(IndexType theFace, IndexType theVertexSlot) const
Returns a coordinate index for a vertex in a face.
Definition: ModelData_IndexedTriangleSet.cxx:218
Represents piece of ModelData_PolyVertexSet using set of indices.
Definition: ModelData_MeshPatch.hxx:36
const ModelData_IndexArray & Indices() const
Returns IndexArray representing this patch.
Definition: ModelData_MeshPatch.cxx:70
const ModelData_PolyVertexSet & PVS() const
Returns full mesh (ModelData_PolyVertexSet).
Definition: ModelData_MeshPatch.cxx:65
Provides CAD Exchanger data model.
Definition: ModelData_Model.hxx:43
void Accept(ElementVisitor &theVisitor) const
Accepts a visitor.
Definition: ModelData_Model.cxx:833
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:171
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:134
Defines a leaf node in the scene graph hiearchy.
Definition: ModelData_Part.hxx:35
ModelData_BRepRepresentation BRepRepresentation() const
Definition: ModelData_Part.cxx:360
Defines a 3D point.
Definition: ModelData_Point.hxx:295
Iterates over subshapes in a shape.
Definition: ModelData_Shape.hxx:41
Base class of topological shapes.
Definition: ModelData_Shape.hxx:37
Defines classes, types, and global functions related to CAD Exchanger.
Definition: A3DSTestLib.hxx:22
ModelData_ShapeType
Defines shape type.
Definition: ModelData_ShapeType.hxx:25