本文整理汇总了Java中org.bimserver.models.ifc2x3tc1.IfcSpace类的典型用法代码示例。如果您正苦于以下问题:Java IfcSpace类的具体用法?Java IfcSpace怎么用?Java IfcSpace使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IfcSpace类属于org.bimserver.models.ifc2x3tc1包,在下文中一共展示了IfcSpace类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSpace
import org.bimserver.models.ifc2x3tc1.IfcSpace; //导入依赖的package包/类
private void createSpace(RichIfcModel richIfcModel, IfcRepresentationContext representationContext, IfcLocalPlacement storeyPlacement, IfcRelAggregates storeyAggregation, int x, int y) throws IfcModelInterfaceException {
IfcSpace ifcSpace = richIfcModel.create(IfcSpace.class);
ifcSpace.setName("Space " + ((y * 10) + x));
ifcSpace.setCompositionType(IfcElementCompositionEnum.ELEMENT);
ifcSpace.setInteriorOrExteriorSpace(IfcInternalOrExternalEnum.INTERNAL);
IfcLocalPlacement spacePlacement = richIfcModel.create(IfcLocalPlacement.class);
spacePlacement.setPlacementRelTo(storeyPlacement);
spacePlacement.setRelativePlacement(richIfcModel.createBasicPosition(x * 6000, y * 6000, 0));
ifcSpace.setObjectPlacement(spacePlacement);
storeyAggregation.getRelatedObjects().add(ifcSpace);
ifcSpace.setRepresentation(richIfcModel.createRectangularExtrusionProductRepresentation(5000, 5000, 2000));
createFurnishing(richIfcModel, representationContext, y, ifcSpace, spacePlacement);
}
示例2: getIfcBuildingStorey
import org.bimserver.models.ifc2x3tc1.IfcSpace; //导入依赖的package包/类
public static IfcBuildingStorey getIfcBuildingStorey(IfcProduct ifcProduct) {
if (ifcProduct instanceof IfcBuildingStorey) {
return (IfcBuildingStorey) ifcProduct;
}
for (IfcRelDecomposes ifcRelDecomposes : ifcProduct.getDecomposes()) {
IfcObjectDefinition relatingObject = ifcRelDecomposes.getRelatingObject();
if (relatingObject instanceof IfcBuildingStorey) {
return (IfcBuildingStorey)relatingObject;
}
}
if (ifcProduct instanceof IfcElement) {
IfcElement ifcElement = (IfcElement)ifcProduct;
for (IfcRelContainedInSpatialStructure ifcRelContainedInSpatialStructure : ifcElement.getContainedInStructure()) {
IfcSpatialStructureElement relatingStructure = ifcRelContainedInSpatialStructure.getRelatingStructure();
if (relatingStructure instanceof IfcBuildingStorey) {
return (IfcBuildingStorey) relatingStructure;
} else {
if (relatingStructure instanceof IfcSpace) {
return getIfcBuildingStorey(relatingStructure);
}
}
}
}
return null;
}
示例3: createFurnishing
import org.bimserver.models.ifc2x3tc1.IfcSpace; //导入依赖的package包/类
private void createFurnishing(RichIfcModel richIfcModel, IfcRepresentationContext representationContext, int number, IfcSpace ifcSpace, IfcLocalPlacement spacePlacement) throws IfcModelInterfaceException {
IfcFurnishingElement furnishing = richIfcModel.create(IfcFurnishingElement.class);
furnishing.setName("Furnishing " + number);
IfcLocalPlacement furnishingPlacement = richIfcModel.create(IfcLocalPlacement.class);
furnishingPlacement.setPlacementRelTo(spacePlacement);
IfcAxis2Placement3D furnitureAxisPlacement = richIfcModel.create(IfcAxis2Placement3D.class);
furnitureAxisPlacement.setLocation(richIfcModel.createIfcCartesianPoint(500, 500, 2));
furnishingPlacement.setRelativePlacement(furnitureAxisPlacement);
furnishing.setObjectPlacement(furnishingPlacement);
furnishing.setRepresentation(richIfcModel.createRectangularExtrusionProductRepresentation(4000, 4000, 1200));
richIfcModel.addContains(ifcSpace, furnishing);
}
示例4: getIfcProject
import org.bimserver.models.ifc2x3tc1.IfcSpace; //导入依赖的package包/类
public static IfcProject getIfcProject(IfcProduct ifcProduct) {
if (ifcProduct instanceof IfcProject) {
return (IfcProject) ifcProduct;
}
for (IfcRelDecomposes ifcRelDecomposes : ifcProduct.getDecomposes()) {
IfcObjectDefinition relatingObject = ifcRelDecomposes.getRelatingObject();
if (relatingObject instanceof IfcProject) {
return (IfcProject)relatingObject;
} else if (relatingObject instanceof IfcProduct){
return getIfcProject((IfcProduct) relatingObject);
}
}
if (ifcProduct instanceof IfcElement) {
IfcElement ifcElement = (IfcElement)ifcProduct;
for (IfcRelContainedInSpatialStructure ifcRelContainedInSpatialStructure : ifcElement.getContainedInStructure()) {
IfcSpatialStructureElement relatingStructure = ifcRelContainedInSpatialStructure.getRelatingStructure();
if (relatingStructure instanceof IfcProject) {
return (IfcProject) relatingStructure;
} else if (relatingStructure instanceof IfcBuildingStorey) {
return getIfcProject(relatingStructure);
} else {
if (relatingStructure instanceof IfcSpace) {
return getIfcProject(relatingStructure);
}
}
}
}
return null;
}
示例5: getClassifications
import org.bimserver.models.ifc2x3tc1.IfcSpace; //导入依赖的package包/类
public static List<IfcClassificationNotationSelect> getClassifications(IfcSpace ifcSpace, IfcModelInterface model) {
List<IfcClassificationNotationSelect> result = new ArrayList<>();
for (IfcRelAssociatesClassification ifcRelAssociatesClassification : model.getAll(IfcRelAssociatesClassification.class)) {
if (ifcRelAssociatesClassification.getRelatedObjects().contains(ifcSpace)) {
result.add(ifcRelAssociatesClassification.getRelatingClassification());
}
}
return result;
}
示例6: writeMaterialAndGeometry
import org.bimserver.models.ifc2x3tc1.IfcSpace; //导入依赖的package包/类
/**
* Writes the material and geometry for the {@link IfcProduct}.
*
* @param writer
* @param product The {@link IfcProduct} with material and geometry.
* @throws IOException
*/
private void writeMaterialAndGeometry(JsonWriter writer, IfcProduct product) throws IOException {
GeometryInfo geometryInfo = product.getGeometry();
if (geometryInfo != null && geometryInfo.getData() != null) {
GeometryData geometryData = geometryInfo.getData();
ByteBuffer indicesBuffer = ByteBuffer.wrap(geometryData.getIndices());
indicesBuffer.order(ByteOrder.LITTLE_ENDIAN);
ByteBuffer verticesBuffer = ByteBuffer.wrap(geometryData.getVertices());
verticesBuffer.order(ByteOrder.LITTLE_ENDIAN);
ByteBuffer normalsBuffer = ByteBuffer.wrap(geometryData.getNormals());
normalsBuffer.order(ByteOrder.LITTLE_ENDIAN);
int totalNrVertexValues = verticesBuffer.capacity() / 4;
int maxVertexValues = 49167; // Must be divisible by 9!
writer.name("geometry").beginObject();
double[] colorData = getMaterial(product);
if (colorData == null) {
log.info("No material styles found for: " + product.getName());
if (product instanceof IfcSpace) {
colorData = new double[] {0.0, 1.0, 0.0, 0.9};
} else {
colorData = new double[] {1.0, 1.0, 1.0, 1.0};
}
}
writer.name("color").beginArray();
writeDouble(writer, colorData[0]);
writeDouble(writer, colorData[1]);
writeDouble(writer, colorData[2]);
writeDouble(writer, colorData[3]);
writer.endArray();
if (totalNrVertexValues > maxVertexValues) {} else {
writer.name("primitive").value("triangles");
writer.name("positions").beginArray();
for (int i = 0; i < totalNrVertexValues; i++) {
writeDouble(writer, verticesBuffer.getFloat());
}
writer.endArray();
writer.name("normals").beginArray();
for (int i = 0; i < totalNrVertexValues; i++) {
writeDouble(writer, normalsBuffer.getFloat());
}
writer.endArray();
writer.name("triangles").beginArray();
for (int i = 0; i < indicesBuffer.capacity() / 4; i += 3) {
writeInteger(writer, indicesBuffer.getInt());
writeInteger(writer, indicesBuffer.getInt());
writeInteger(writer, indicesBuffer.getInt());
}
writer.endArray();
byte[] geometryTransformation = geometryInfo.getTransformation();
if (geometryTransformation != null) {
ByteBuffer transformation = ByteBuffer.wrap(geometryTransformation);
transformation.order(ByteOrder.LITTLE_ENDIAN);
FloatBuffer floatBuffer = transformation.asFloatBuffer();
float[] matrix = new float[16];
for (int i = 0; i < matrix.length; i++) {
matrix[i] = floatBuffer.get();
}
matrix = Matrix.changeOrientation(matrix);
writer.name("matrix").beginArray();
for (int i = 0; i < matrix.length; i++) {
writeDouble(writer, matrix[i]);
}
writer.endArray();
}
}
writer.endObject();
}
}
示例7: setIfcSpace
import org.bimserver.models.ifc2x3tc1.IfcSpace; //导入依赖的package包/类
private void setIfcSpace(IdEObject idEObject, float scale) {
IfcSpace ifcSpace = (IfcSpace) idEObject;
if (ifcSpace.isSetElevationWithFlooring()) {
ifcSpace.setElevationWithFlooring(ifcSpace.getElevationWithFlooring() * scale);
}
}
示例8: getRelatingSpace
import org.bimserver.models.ifc2x3tc1.IfcSpace; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IfcSpace getRelatingSpace() {
return (IfcSpace) eGet(Ifc2x3tc1Package.Literals.IFC_REL_SPACE_BOUNDARY__RELATING_SPACE, true);
}
示例9: setRelatingSpace
import org.bimserver.models.ifc2x3tc1.IfcSpace; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRelatingSpace(IfcSpace newRelatingSpace) {
eSet(Ifc2x3tc1Package.Literals.IFC_REL_SPACE_BOUNDARY__RELATING_SPACE, newRelatingSpace);
}
示例10: getRelatedSpace
import org.bimserver.models.ifc2x3tc1.IfcSpace; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IfcSpace getRelatedSpace() {
return (IfcSpace) eGet(Ifc2x3tc1Package.Literals.IFC_REL_COVERS_SPACES__RELATED_SPACE, true);
}
示例11: setRelatedSpace
import org.bimserver.models.ifc2x3tc1.IfcSpace; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRelatedSpace(IfcSpace newRelatedSpace) {
eSet(Ifc2x3tc1Package.Literals.IFC_REL_COVERS_SPACES__RELATED_SPACE, newRelatedSpace);
}