use of org.bimserver.models.ifc4.IfcSegmentIndexSelect in project BIMserver by opensourceBIM.
the class TestIfc4TwoDimensional3 method test.
@Test
public void test() throws Exception {
try (JsonBimServerClientFactory factory = new JsonBimServerClientFactory("http://localhost:8080")) {
try (BimServerClient client = factory.create(new UsernamePasswordAuthenticationInfo("admin@bimserver.org", "admin"))) {
SProject project = client.getServiceInterface().addProject(RandomStringUtils.randomAlphanumeric(10), "ifc4");
SDeserializerPluginConfiguration deserializer = client.getServiceInterface().getSuggestedDeserializerForExtension("ifc", project.getOid());
Path path = Paths.get("../../TestFiles/TestData/data/ifc4add2tc1/slab-standard-case.ifc");
SLongCheckinActionState actionState = client.checkinSync(project.getOid(), "test", deserializer.getOid(), path, (title, progress) -> System.out.println(title + ": " + progress));
ClientIfcModel model = client.getModel(project, actionState.getRoid(), true, false);
List<IfcIndexedPolyCurve> polyCurves = model.getAll(IfcIndexedPolyCurve.class);
Assert.assertEquals(1, polyCurves.size());
for (IfcIndexedPolyCurve ifcIndexedPolyCurve : polyCurves) {
EList<IfcSegmentIndexSelect> segments = ifcIndexedPolyCurve.getSegments();
Assert.assertEquals(4, segments.size());
for (IfcSegmentIndexSelect ifcSegmentIndexSelect : segments) {
if (ifcSegmentIndexSelect instanceof IfcLineIndex) {
Assert.assertEquals(2, ((IfcLineIndex) ifcSegmentIndexSelect).getWrappedValue().size());
} else if (ifcSegmentIndexSelect instanceof IfcArcIndex) {
Assert.assertEquals(3, ((IfcArcIndex) ifcSegmentIndexSelect).getWrappedValue().size());
}
}
}
}
Thread.sleep(500);
}
}
Aggregations