public class MeshActor extends vtkActor {
- public void setMesh(Mesh mesh) {
-
- vtkPolyDataMapper mapper = new vtkPolyDataMapper();
-
+ public static vtkPolyData createPolyData(Mesh mesh) {
vtkPolyData polyData = new vtkPolyData();
polyData.Allocate(mesh.getIndices().size()/3, mesh.getIndices().size()/3);
colors.Delete();
}
-
+ return polyData;
+ }
+
+ public void setMesh(Mesh mesh) {
+
+ vtkPolyDataMapper mapper = new vtkPolyDataMapper();
+ vtkPolyData polyData = createPolyData(mesh);
+
boolean computeNormals = true;
if (computeNormals) {
vtkPolyDataNormals normals = new vtkPolyDataNormals();