using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace appearance
{
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;
}
AppearancesCollector aCollector = new AppearancesCollector(aModel);
aCollector.PrintAppearancesCount();
return 0;
}
}
{
{
myBRep = theBRep;
myAppSet = theAppSet;
}
{
ExploreShapeAppearances(theShape);
}
{
if (anApp != null)
{
myAppSet.Add(anApp);
}
}
}
{
public RepVisitor(HashSet<ModelData_Appearance> theAppSet)
{
myAppSet = theAppSet;
}
{
SubshapeAppearancesCollector aCollector = new SubshapeAppearancesCollector(theBRep, myAppSet);
}
{
ExplorePVSAppearances(thePolyRep);
}
{
for (uint i = 0; i < aList.
Size(); ++i)
{
if (anApp != null)
{
}
}
}
}
{
public SGEAppearancesCollector(HashSet<ModelData_Appearance> theAppSet)
{
myAppSet = theAppSet;
}
{
ExploreSGEAppearance(thePart);
RepVisitor aVisitor = new RepVisitor(myAppSet);
}
{
ExploreSGEAppearance(theElement);
return true;
}
{
if (anApp != null)
{
}
}
}
class AppearancesCollector
{
{
myModel = theModel;
SGEAppearancesCollector aCollector = new SGEAppearancesCollector(myAppSet);
myModel.Accept(aCollector);
}
public void PrintAppearancesCount()
{
Console.WriteLine("Total model unique Appearances count: " + myAppSet.Count);
}
}
}
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition: Base_UTF16String.hxx:34
Hasher for ModelData_Appearance.
Definition: ModelData_Appearance.hxx:84
Provides an interface to appearance which is a collection of visual styles.
Definition: ModelData_Appearance.hxx:39
void Add(const ModelData_Texture &theTexture)
Adds a texture to the texture set of appearance.
Definition: ModelData_Appearance.cxx:304
Defines precise Boundary Representation of part.
Definition: ModelData_BRepRepresentation.hxx:39
void Accept(SubshapeVisitor &theVisitor) const
Applies the visitor to visit the subshapes.
Definition: ModelData_BRepRepresentation.cxx:993
Provides CAD Exchanger data model.
Definition: ModelData_Model.hxx:43
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
void Accept(RepresentationVisitor &theVisitor) const
Accepts a visitor of the associated representations.
Definition: ModelData_Part.cxx:384
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
Base class for part, instance and assembly.
Definition: ModelData_SceneGraphElement.hxx:39
ModelData_Appearance Appearance() const
Returns the scene graph element's own appearance.
Definition: ModelData_SceneGraphElement.cxx:120
Base class of topological shapes.
Definition: ModelData_Shape.hxx:37
Defines classes, types, and global functions related to CAD Exchanger.
Definition: A3DSTestLib.hxx:22