|
3 | 3 | import org.bimserver.emf.IdEObject; |
4 | 4 | import org.bimserver.ifc.IfcModel; |
5 | 5 | import org.bimserver.models.ifc2x3.*; |
6 | | -import org.bimserver.o3d.BinaryIndexBuffer; |
7 | | -import org.bimserver.o3d.BinaryVertexBuffer; |
8 | | -import org.bimserver.o3d.SetGeometryResult; |
| 6 | +import org.bimserver.serializers.json.data.BinaryIndexBuffer; |
| 7 | +import org.bimserver.serializers.json.data.BinaryVertexBuffer; |
| 8 | +import org.bimserver.serializers.json.data.SetGeometryResult; |
9 | 9 | import org.bimserver.plugins.PluginException; |
10 | 10 | import org.bimserver.plugins.PluginManager; |
11 | 11 | import org.bimserver.plugins.ifcengine.*; |
@@ -58,6 +58,20 @@ public boolean write(OutputStream outputStream) throws SerializerException { |
58 | 58 | return false; |
59 | 59 | } |
60 | 60 | } |
| 61 | + |
| 62 | + private String colorFromClass(Class ifcClass) { |
| 63 | + if (ifcClass == IfcWallStandardCase.class) { |
| 64 | + return "0xFF4400"; |
| 65 | + } else if (ifcClass == IfcDoor.class) { |
| 66 | + return "0xFAFAFA"; |
| 67 | + } else if (ifcClass == IfcWindow.class) { |
| 68 | + return "0xCCFFFF"; |
| 69 | + } else if (ifcClass == IfcOpeningElement.class) { |
| 70 | + return "0x086CA2"; |
| 71 | + } else { |
| 72 | + return "0x000000"; |
| 73 | + } |
| 74 | + } |
61 | 75 |
|
62 | 76 | private void writeGeometry(SetGeometryResult geometry, IfcRoot ifcRoot) { |
63 | 77 |
|
@@ -90,7 +104,7 @@ private void writeGeometry(SetGeometryResult geometry, IfcRoot ifcRoot) { |
90 | 104 | } |
91 | 105 |
|
92 | 106 | out.println(" ],"); |
93 | | - out.println(" 'colors': [ ],"); |
| 107 | + out.println(" 'color': " + colorFromClass(geometry.getIfcClass()) + " ,"); |
94 | 108 | out.println(" 'uvs': [ ],"); |
95 | 109 | out.print(" 'faces': [ "); |
96 | 110 |
|
|
0 commit comments