using System;
using System.Runtime.InteropServices;
namespace layers
{
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;
}
if (!aLayerIt.HasNext())
{
LayersFiller aVisitor = new LayersFiller();
aModel.
AddLayer(aVisitor.SGELayer());
aModel.AddLayer(aVisitor.SubShapesLayer());
}
LayersVisitor aLayerVisitor = new LayersVisitor();
return 0;
}
}
{
public LayerItemVisitor()
{
myPartsNb = 0;
myAssembliesNb = 0;
myInstancesNb = 0;
myShapesNb = 0;
}
public void GetElementsCount()
{
Console.WriteLine("Number of parts: " + myPartsNb);
Console.WriteLine("Number of assemblies: " + myAssembliesNb);
Console.WriteLine("Number of instances: " + myInstancesNb);
Console.WriteLine("Number of shapes: " + myShapesNb);
}
{
{
++myPartsNb;
}
{
++myAssembliesNb;
}
{
++myInstancesNb;
}
}
{
++myShapesNb;
}
private int myPartsNb;
private int myAssembliesNb;
private int myInstancesNb;
private int myShapesNb;
}
{
{
LayerItemVisitor aLayerItemVisitor = new LayerItemVisitor();
theLayer.
Accept(aLayerItemVisitor);
Console.WriteLine(
"Layer " + theLayer.
Name() +
" contains:");
aLayerItemVisitor.GetElementsCount();
}
}
{
public LayersFiller()
{
}
{
return mySGELayer;
}
{
return mySubshapesLayer;
}
{
if (aBRep != null)
{
for (uint i = 0; i < aBodyList.
Size(); ++i)
{
}
}
}
{
mySGELayer.Add(theElement);
return true;
}
}
}
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition: Base_UTF16String.hxx:34
Defines a group of scene graph element.
Definition: ModelData_Assembly.hxx:33
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
void AddToLayer(const ModelData_Shape &theSubshape, const ModelData_Layer &theLayer)
Adds subshape to layer.
Definition: ModelData_BRepRepresentation.cxx:797
IdType TypeId() const
Returns an object type id.
Definition: ModelData_BaseObject.cxx:199
Base_UTF16String Name() const
Definition: ModelData_BaseObject.cxx:218
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
const ModelData_Body & Element(SizeType theIndex) const
Definition: ModelData_BodyList.cxx:177
Defines an occurrence of assembly or part in a scene graph.
Definition: ModelData_Instance.hxx:34
Provides a layer of objects.
Definition: ModelData_Layer.hxx:34
void Accept(ItemVisitor &theVisitor) const
Accepts the element visitor.
Definition: ModelData_Layer.cxx:280
void Add(const ModelData_SceneGraphElement &theElement)
Adds element to the layer.
Definition: ModelData_Layer.cxx:244
Definition: ModelData_Model.hxx:153
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
Defines a leaf node in the scene graph hiearchy.
Definition: ModelData_Part.hxx:35
ModelData_BRepRepresentation BRepRepresentation() const
Definition: ModelData_Part.cxx:360
Base class for part, instance and assembly.
Definition: ModelData_SceneGraphElement.hxx:39
Base class of topological shapes.
Definition: ModelData_Shape.hxx:37
Defines classes, types, and global functions related to CAD Exchanger.
Definition: A3DSTestLib.hxx:22