abstract class ShapeProcessor extends ModelElementVoidVisitor {
public void Apply(Part thePart) {
String aPartName = thePart.Name().IsEmpty() ? "noname" : thePart.Name().Data();
BodyList aBodyList = thePart.Bodies();
for (int i = 0; i < aBodyList.size(); ++i) {
Body aBody = aBodyList.get(i);
ShapeIterator aShapeIt = new ShapeIterator(aBody);
while (aShapeIt.HasNext()) {
Shape aShape = aShapeIt.Next();
if (aShape.Type() == ShapeType.Solid) {
System.out.format("Part #%d [\"%s\"] - solid #%d has:\n", myPartIndex, aPartName, i);
ProcessSolid(Solid.Cast(aShape));
} else if (aShape.Type() == ShapeType.Shell) {
System.out.format("Part #%d [\"%s\"] - shell #%d has:\n", myPartIndex, aPartName, i);
ProcessShell(Shell.Cast(aShape));
}
}
}
++myPartIndex;
}
public abstract void ProcessSolid(Solid theSolid);
public abstract void ProcessShell(Shell theShell);
private long myPartIndex = 0;
}
abstract class SolidProcessor extends ModelElementVoidVisitor {
public void Apply(Part thePart) {
String aPartName = thePart.Name().IsEmpty() ? "noname" : thePart.Name().Data();
BodyList aBodyList = thePart.Bodies();
for (int i = 0; i < aBodyList.size(); ++i) {
Body aBody = aBodyList.get(i);
ShapeIterator aShapeIt = new ShapeIterator(aBody);
while (aShapeIt.HasNext()) {
Shape aShape = aShapeIt.Next();
if (aShape.Type() == ShapeType.Solid) {
System.out.format("Part #%d [\"%s\"] - solid #%d has:\n", myPartIndex, aPartName, i);
ProcessSolid(Solid.Cast(aShape));
}
}
}
++myPartIndex;
}
public abstract void ProcessSolid(Solid theSolid);
private long myPartIndex = 0;
}
abstract class SolidAndMeshProcessor extends ModelElementVoidVisitor {
public void Apply(Part thePart) {
String aPartName = thePart.Name().IsEmpty() ? "noname" : thePart.Name().ToString();
myShapeIndex = 0;
BodyList aBodyList = thePart.Bodies();
for (Body aBody : aBodyList) {
if (MeshBody.CompareType(aBody)) {
ProcessMeshBody(MeshBody.Cast(aBody), aPartName);
} else if (SolidBody.CompareType(aBody)) {
System.out.format("Part #%d [\"%s\"] - solid #%d has:\n", myPartIndex, aPartName, myShapeIndex);
ProcessSolid(SolidBody.Cast(aBody).Solid(), aPartName);
myShapeIndex++;
}
}
++myPartIndex;
}
public abstract void ProcessSolid(Solid theSolid, String thePartName);
public abstract void ProcessITS(IndexedTriangleSet theITS, String thePartName);
private void ProcessMeshBody(MeshBody theMeshBody, String thePartName) {
MeshShapeList aShapeList = theMeshBody.Shapes();
for (MeshShape aMeshShape : aShapeList) {
if (IndexedTriangleSet.CompareType(aMeshShape)) {
System.out.format("Part #%d [\"%s\"] - ITS #%d has:\n", myPartIndex, thePartName, myShapeIndex);
ProcessITS(IndexedTriangleSet.Cast(aMeshShape), thePartName);
myShapeIndex++;
}
}
}
protected long myPartIndex = 0;
protected long myShapeIndex = 0;
}
Definition ArrayDouble2.cs:12
Defines classes, types, enums, and functions related to topological entities and scene graph elements...
Definition AngleUnit.cs:12
Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.
Definition BaseObject.cs:12