Search in sources :

Example 1 with IfcNormalisedRatioMeasure

use of org.bimserver.models.ifc4.IfcNormalisedRatioMeasure in project BIMserver by opensourceBIM.

the class TestIfc4TwoDimensional 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/tessellation-with-individual-colors.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<IfcColourRgbList> colourRgbLists = model.getAll(IfcColourRgbList.class);
            Assert.assertFalse(colourRgbLists.isEmpty());
            for (IfcColourRgbList colourRgbList : colourRgbLists) {
                Assert.assertEquals(3, colourRgbList.getColourList().size());
                for (ListOfIfcNormalisedRatioMeasure rgbValues : colourRgbList.getColourList()) {
                    Assert.assertEquals(3, rgbValues.getList().size());
                    for (IfcNormalisedRatioMeasure ifcNormalisedRatioMeasure : rgbValues.getList()) {
                        Assert.assertNotNull(ifcNormalisedRatioMeasure);
                    }
                }
            }
        }
        Thread.sleep(500);
    }
}
Also used : Path(java.nio.file.Path) ClientIfcModel(org.bimserver.client.ClientIfcModel) SDeserializerPluginConfiguration(org.bimserver.interfaces.objects.SDeserializerPluginConfiguration) UsernamePasswordAuthenticationInfo(org.bimserver.shared.UsernamePasswordAuthenticationInfo) JsonBimServerClientFactory(org.bimserver.client.json.JsonBimServerClientFactory) SLongCheckinActionState(org.bimserver.interfaces.objects.SLongCheckinActionState) SProject(org.bimserver.interfaces.objects.SProject) ListOfIfcNormalisedRatioMeasure(org.bimserver.models.ifc4.ListOfIfcNormalisedRatioMeasure) IfcNormalisedRatioMeasure(org.bimserver.models.ifc4.IfcNormalisedRatioMeasure) BimServerClient(org.bimserver.client.BimServerClient) ListOfIfcNormalisedRatioMeasure(org.bimserver.models.ifc4.ListOfIfcNormalisedRatioMeasure) IfcColourRgbList(org.bimserver.models.ifc4.IfcColourRgbList) Test(org.junit.Test)

Aggregations

Path (java.nio.file.Path)1 BimServerClient (org.bimserver.client.BimServerClient)1 ClientIfcModel (org.bimserver.client.ClientIfcModel)1 JsonBimServerClientFactory (org.bimserver.client.json.JsonBimServerClientFactory)1 SDeserializerPluginConfiguration (org.bimserver.interfaces.objects.SDeserializerPluginConfiguration)1 SLongCheckinActionState (org.bimserver.interfaces.objects.SLongCheckinActionState)1 SProject (org.bimserver.interfaces.objects.SProject)1 IfcColourRgbList (org.bimserver.models.ifc4.IfcColourRgbList)1 IfcNormalisedRatioMeasure (org.bimserver.models.ifc4.IfcNormalisedRatioMeasure)1 ListOfIfcNormalisedRatioMeasure (org.bimserver.models.ifc4.ListOfIfcNormalisedRatioMeasure)1 UsernamePasswordAuthenticationInfo (org.bimserver.shared.UsernamePasswordAuthenticationInfo)1 Test (org.junit.Test)1