public class metadata {
static {
try {
System.loadLibrary("CadExCore");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String[] args) {
String aKey = LicenseKey.Value();
if (!LicenseManager.Activate(aKey)) {
System.out.println("Failed to activate CAD Exchanger license.");
System.exit(1);
}
ModelData_Solid aBox = ModelAlgo_TopoPrimitives.CreateBox(5., 5., 5.);
ModelData_BRepRepresentation aBRep = new ModelData_BRepRepresentation(aBox);
ModelData_Shape.Iterator aFaceIt = new ModelData_Shape.Iterator(aBox, ModelData_ShapeType.ModelData_ST_Face);
int r = 10, g = 10, b = 250, a = 255;
while (aFaceIt.HasNext()) {
a -= 30;
ModelData_Shape aFace = aFaceIt.Next();
ModelData_Appearance anApp = new ModelData_Appearance(new ModelData_Color(r, g, b, a));
aBRep.SetAppearance(aFace, anApp);
}
ModelData_Part aPart = new ModelData_Part(aBRep, new Base_UTF16String("ColorBox"));
ModelData_PropertyTable aTable = new ModelData_PropertyTable();
aTable.Add(new Base_UTF16String("Color"), new Base_UTF16String("Different"));
aPart.AddProperties(aTable);
ModelData_Model aModel = new ModelData_Model();
aModel.AddRoot(aPart);
if (!new ModelData_ModelWriter().Write(aModel, new Base_UTF16String("ColorBox.cdx"))) {
System.out.println("Unable to save the model!");
System.exit(1);
}
}
}
Defines classes, types, and global functions related to CAD Exchanger.
Definition: A3DSTestLib.hxx:22