- Fixed a bug regarding IfcUnitAssignment

- Separate IFC parsing library and geometry libraries [#3395025]
- Added example for IfcParse usage without geometry or Open CASCADE functionality
- Cleanup of vcproj Open CASCADE dependencies
- Added function to query parent class type in IfcExpressParser.py
This commit is contained in:
Thomas Krijnen
2011-08-24 12:21:07 +00:00
parent 0b45066736
commit 2561f94acb
36 changed files with 986 additions and 197 deletions
+556
View File
@@ -1557,6 +1557,562 @@ Type::Enum Type::FromString(const std::string& s){
if(s=="IFCZONE" ) { return IfcZone; }
throw;
}
Type::Enum Type::Parent(Enum v){
if (v < 0 || v >= 758) return (Enum) -1;
if(v==Ifc2DCompositeCurve ) { return IfcCompositeCurve; }
if(v==IfcActionRequest ) { return IfcControl; }
if(v==IfcActor ) { return IfcObject; }
if(v==IfcActuatorType ) { return IfcDistributionControlElementType; }
if(v==IfcAirTerminalBoxType ) { return IfcFlowControllerType; }
if(v==IfcAirTerminalType ) { return IfcFlowTerminalType; }
if(v==IfcAirToAirHeatRecoveryType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcAlarmType ) { return IfcDistributionControlElementType; }
if(v==IfcAngularDimension ) { return IfcDimensionCurveDirectedCallout; }
if(v==IfcAnnotation ) { return IfcProduct; }
if(v==IfcAnnotationCurveOccurrence ) { return IfcAnnotationOccurrence; }
if(v==IfcAnnotationFillArea ) { return IfcGeometricRepresentationItem; }
if(v==IfcAnnotationFillAreaOccurrence ) { return IfcAnnotationOccurrence; }
if(v==IfcAnnotationOccurrence ) { return IfcStyledItem; }
if(v==IfcAnnotationSurface ) { return IfcGeometricRepresentationItem; }
if(v==IfcAnnotationSurfaceOccurrence ) { return IfcAnnotationOccurrence; }
if(v==IfcAnnotationSymbolOccurrence ) { return IfcAnnotationOccurrence; }
if(v==IfcAnnotationTextOccurrence ) { return IfcAnnotationOccurrence; }
if(v==IfcArbitraryClosedProfileDef ) { return IfcProfileDef; }
if(v==IfcArbitraryOpenProfileDef ) { return IfcProfileDef; }
if(v==IfcArbitraryProfileDefWithVoids ) { return IfcArbitraryClosedProfileDef; }
if(v==IfcAsset ) { return IfcGroup; }
if(v==IfcAsymmetricIShapeProfileDef ) { return IfcIShapeProfileDef; }
if(v==IfcAxis1Placement ) { return IfcPlacement; }
if(v==IfcAxis2Placement2D ) { return IfcPlacement; }
if(v==IfcAxis2Placement3D ) { return IfcPlacement; }
if(v==IfcBSplineCurve ) { return IfcBoundedCurve; }
if(v==IfcBeam ) { return IfcBuildingElement; }
if(v==IfcBeamType ) { return IfcBuildingElementType; }
if(v==IfcBezierCurve ) { return IfcBSplineCurve; }
if(v==IfcBlobTexture ) { return IfcSurfaceTexture; }
if(v==IfcBlock ) { return IfcCsgPrimitive3D; }
if(v==IfcBoilerType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcBooleanClippingResult ) { return IfcBooleanResult; }
if(v==IfcBooleanResult ) { return IfcGeometricRepresentationItem; }
if(v==IfcBoundaryEdgeCondition ) { return IfcBoundaryCondition; }
if(v==IfcBoundaryFaceCondition ) { return IfcBoundaryCondition; }
if(v==IfcBoundaryNodeCondition ) { return IfcBoundaryCondition; }
if(v==IfcBoundaryNodeConditionWarping ) { return IfcBoundaryNodeCondition; }
if(v==IfcBoundedCurve ) { return IfcCurve; }
if(v==IfcBoundedSurface ) { return IfcSurface; }
if(v==IfcBoundingBox ) { return IfcGeometricRepresentationItem; }
if(v==IfcBoxedHalfSpace ) { return IfcHalfSpaceSolid; }
if(v==IfcBuilding ) { return IfcSpatialStructureElement; }
if(v==IfcBuildingElement ) { return IfcElement; }
if(v==IfcBuildingElementComponent ) { return IfcBuildingElement; }
if(v==IfcBuildingElementPart ) { return IfcBuildingElementComponent; }
if(v==IfcBuildingElementProxy ) { return IfcBuildingElement; }
if(v==IfcBuildingElementProxyType ) { return IfcBuildingElementType; }
if(v==IfcBuildingElementType ) { return IfcElementType; }
if(v==IfcBuildingStorey ) { return IfcSpatialStructureElement; }
if(v==IfcCShapeProfileDef ) { return IfcParameterizedProfileDef; }
if(v==IfcCableCarrierFittingType ) { return IfcFlowFittingType; }
if(v==IfcCableCarrierSegmentType ) { return IfcFlowSegmentType; }
if(v==IfcCableSegmentType ) { return IfcFlowSegmentType; }
if(v==IfcCartesianPoint ) { return IfcPoint; }
if(v==IfcCartesianTransformationOperator ) { return IfcGeometricRepresentationItem; }
if(v==IfcCartesianTransformationOperator2D ) { return IfcCartesianTransformationOperator; }
if(v==IfcCartesianTransformationOperator2DnonUniform) { return IfcCartesianTransformationOperator2D; }
if(v==IfcCartesianTransformationOperator3D ) { return IfcCartesianTransformationOperator; }
if(v==IfcCartesianTransformationOperator3DnonUniform) { return IfcCartesianTransformationOperator3D; }
if(v==IfcCenterLineProfileDef ) { return IfcArbitraryOpenProfileDef; }
if(v==IfcChamferEdgeFeature ) { return IfcEdgeFeature; }
if(v==IfcChillerType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcCircle ) { return IfcConic; }
if(v==IfcCircleHollowProfileDef ) { return IfcCircleProfileDef; }
if(v==IfcCircleProfileDef ) { return IfcParameterizedProfileDef; }
if(v==IfcClassificationReference ) { return IfcExternalReference; }
if(v==IfcClosedShell ) { return IfcConnectedFaceSet; }
if(v==IfcCoilType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcColourRgb ) { return IfcColourSpecification; }
if(v==IfcColumn ) { return IfcBuildingElement; }
if(v==IfcColumnType ) { return IfcBuildingElementType; }
if(v==IfcComplexProperty ) { return IfcProperty; }
if(v==IfcCompositeCurve ) { return IfcBoundedCurve; }
if(v==IfcCompositeCurveSegment ) { return IfcGeometricRepresentationItem; }
if(v==IfcCompositeProfileDef ) { return IfcProfileDef; }
if(v==IfcCompressorType ) { return IfcFlowMovingDeviceType; }
if(v==IfcCondenserType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcCondition ) { return IfcGroup; }
if(v==IfcConditionCriterion ) { return IfcControl; }
if(v==IfcConic ) { return IfcCurve; }
if(v==IfcConnectedFaceSet ) { return IfcTopologicalRepresentationItem; }
if(v==IfcConnectionCurveGeometry ) { return IfcConnectionGeometry; }
if(v==IfcConnectionPointEccentricity ) { return IfcConnectionPointGeometry; }
if(v==IfcConnectionPointGeometry ) { return IfcConnectionGeometry; }
if(v==IfcConnectionPortGeometry ) { return IfcConnectionGeometry; }
if(v==IfcConnectionSurfaceGeometry ) { return IfcConnectionGeometry; }
if(v==IfcConstructionEquipmentResource ) { return IfcConstructionResource; }
if(v==IfcConstructionMaterialResource ) { return IfcConstructionResource; }
if(v==IfcConstructionProductResource ) { return IfcConstructionResource; }
if(v==IfcConstructionResource ) { return IfcResource; }
if(v==IfcContextDependentUnit ) { return IfcNamedUnit; }
if(v==IfcControl ) { return IfcObject; }
if(v==IfcControllerType ) { return IfcDistributionControlElementType; }
if(v==IfcConversionBasedUnit ) { return IfcNamedUnit; }
if(v==IfcCooledBeamType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcCoolingTowerType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcCostItem ) { return IfcControl; }
if(v==IfcCostSchedule ) { return IfcControl; }
if(v==IfcCostValue ) { return IfcAppliedValue; }
if(v==IfcCovering ) { return IfcBuildingElement; }
if(v==IfcCoveringType ) { return IfcBuildingElementType; }
if(v==IfcCraneRailAShapeProfileDef ) { return IfcParameterizedProfileDef; }
if(v==IfcCraneRailFShapeProfileDef ) { return IfcParameterizedProfileDef; }
if(v==IfcCrewResource ) { return IfcConstructionResource; }
if(v==IfcCsgPrimitive3D ) { return IfcGeometricRepresentationItem; }
if(v==IfcCsgSolid ) { return IfcSolidModel; }
if(v==IfcCurtainWall ) { return IfcBuildingElement; }
if(v==IfcCurtainWallType ) { return IfcBuildingElementType; }
if(v==IfcCurve ) { return IfcGeometricRepresentationItem; }
if(v==IfcCurveBoundedPlane ) { return IfcBoundedSurface; }
if(v==IfcCurveStyle ) { return IfcPresentationStyle; }
if(v==IfcDamperType ) { return IfcFlowControllerType; }
if(v==IfcDefinedSymbol ) { return IfcGeometricRepresentationItem; }
if(v==IfcDerivedProfileDef ) { return IfcProfileDef; }
if(v==IfcDiameterDimension ) { return IfcDimensionCurveDirectedCallout; }
if(v==IfcDimensionCalloutRelationship ) { return IfcDraughtingCalloutRelationship; }
if(v==IfcDimensionCurve ) { return IfcAnnotationCurveOccurrence; }
if(v==IfcDimensionCurveDirectedCallout ) { return IfcDraughtingCallout; }
if(v==IfcDimensionCurveTerminator ) { return IfcTerminatorSymbol; }
if(v==IfcDimensionPair ) { return IfcDraughtingCalloutRelationship; }
if(v==IfcDirection ) { return IfcGeometricRepresentationItem; }
if(v==IfcDiscreteAccessory ) { return IfcElementComponent; }
if(v==IfcDiscreteAccessoryType ) { return IfcElementComponentType; }
if(v==IfcDistributionChamberElement ) { return IfcDistributionFlowElement; }
if(v==IfcDistributionChamberElementType ) { return IfcDistributionFlowElementType; }
if(v==IfcDistributionControlElement ) { return IfcDistributionElement; }
if(v==IfcDistributionControlElementType ) { return IfcDistributionElementType; }
if(v==IfcDistributionElement ) { return IfcElement; }
if(v==IfcDistributionElementType ) { return IfcElementType; }
if(v==IfcDistributionFlowElement ) { return IfcDistributionElement; }
if(v==IfcDistributionFlowElementType ) { return IfcDistributionElementType; }
if(v==IfcDistributionPort ) { return IfcPort; }
if(v==IfcDocumentReference ) { return IfcExternalReference; }
if(v==IfcDoor ) { return IfcBuildingElement; }
if(v==IfcDoorLiningProperties ) { return IfcPropertySetDefinition; }
if(v==IfcDoorPanelProperties ) { return IfcPropertySetDefinition; }
if(v==IfcDoorStyle ) { return IfcTypeProduct; }
if(v==IfcDraughtingCallout ) { return IfcGeometricRepresentationItem; }
if(v==IfcDraughtingPreDefinedColour ) { return IfcPreDefinedColour; }
if(v==IfcDraughtingPreDefinedCurveFont ) { return IfcPreDefinedCurveFont; }
if(v==IfcDraughtingPreDefinedTextFont ) { return IfcPreDefinedTextFont; }
if(v==IfcDuctFittingType ) { return IfcFlowFittingType; }
if(v==IfcDuctSegmentType ) { return IfcFlowSegmentType; }
if(v==IfcDuctSilencerType ) { return IfcFlowTreatmentDeviceType; }
if(v==IfcEdge ) { return IfcTopologicalRepresentationItem; }
if(v==IfcEdgeCurve ) { return IfcEdge; }
if(v==IfcEdgeFeature ) { return IfcFeatureElementSubtraction; }
if(v==IfcEdgeLoop ) { return IfcLoop; }
if(v==IfcElectricApplianceType ) { return IfcFlowTerminalType; }
if(v==IfcElectricDistributionPoint ) { return IfcFlowController; }
if(v==IfcElectricFlowStorageDeviceType ) { return IfcFlowStorageDeviceType; }
if(v==IfcElectricGeneratorType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcElectricHeaterType ) { return IfcFlowTerminalType; }
if(v==IfcElectricMotorType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcElectricTimeControlType ) { return IfcFlowControllerType; }
if(v==IfcElectricalBaseProperties ) { return IfcEnergyProperties; }
if(v==IfcElectricalCircuit ) { return IfcSystem; }
if(v==IfcElectricalElement ) { return IfcElement; }
if(v==IfcElement ) { return IfcProduct; }
if(v==IfcElementAssembly ) { return IfcElement; }
if(v==IfcElementComponent ) { return IfcElement; }
if(v==IfcElementComponentType ) { return IfcElementType; }
if(v==IfcElementQuantity ) { return IfcPropertySetDefinition; }
if(v==IfcElementType ) { return IfcTypeProduct; }
if(v==IfcElementarySurface ) { return IfcSurface; }
if(v==IfcEllipse ) { return IfcConic; }
if(v==IfcEllipseProfileDef ) { return IfcParameterizedProfileDef; }
if(v==IfcEnergyConversionDevice ) { return IfcDistributionFlowElement; }
if(v==IfcEnergyConversionDeviceType ) { return IfcDistributionFlowElementType; }
if(v==IfcEnergyProperties ) { return IfcPropertySetDefinition; }
if(v==IfcEnvironmentalImpactValue ) { return IfcAppliedValue; }
if(v==IfcEquipmentElement ) { return IfcElement; }
if(v==IfcEquipmentStandard ) { return IfcControl; }
if(v==IfcEvaporativeCoolerType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcEvaporatorType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcExtendedMaterialProperties ) { return IfcMaterialProperties; }
if(v==IfcExternallyDefinedHatchStyle ) { return IfcExternalReference; }
if(v==IfcExternallyDefinedSurfaceStyle ) { return IfcExternalReference; }
if(v==IfcExternallyDefinedSymbol ) { return IfcExternalReference; }
if(v==IfcExternallyDefinedTextFont ) { return IfcExternalReference; }
if(v==IfcExtrudedAreaSolid ) { return IfcSweptAreaSolid; }
if(v==IfcFace ) { return IfcTopologicalRepresentationItem; }
if(v==IfcFaceBasedSurfaceModel ) { return IfcGeometricRepresentationItem; }
if(v==IfcFaceBound ) { return IfcTopologicalRepresentationItem; }
if(v==IfcFaceOuterBound ) { return IfcFaceBound; }
if(v==IfcFaceSurface ) { return IfcFace; }
if(v==IfcFacetedBrep ) { return IfcManifoldSolidBrep; }
if(v==IfcFacetedBrepWithVoids ) { return IfcManifoldSolidBrep; }
if(v==IfcFailureConnectionCondition ) { return IfcStructuralConnectionCondition; }
if(v==IfcFanType ) { return IfcFlowMovingDeviceType; }
if(v==IfcFastener ) { return IfcElementComponent; }
if(v==IfcFastenerType ) { return IfcElementComponentType; }
if(v==IfcFeatureElement ) { return IfcElement; }
if(v==IfcFeatureElementAddition ) { return IfcFeatureElement; }
if(v==IfcFeatureElementSubtraction ) { return IfcFeatureElement; }
if(v==IfcFillAreaStyle ) { return IfcPresentationStyle; }
if(v==IfcFillAreaStyleHatching ) { return IfcGeometricRepresentationItem; }
if(v==IfcFillAreaStyleTileSymbolWithStyle ) { return IfcGeometricRepresentationItem; }
if(v==IfcFillAreaStyleTiles ) { return IfcGeometricRepresentationItem; }
if(v==IfcFilterType ) { return IfcFlowTreatmentDeviceType; }
if(v==IfcFireSuppressionTerminalType ) { return IfcFlowTerminalType; }
if(v==IfcFlowController ) { return IfcDistributionFlowElement; }
if(v==IfcFlowControllerType ) { return IfcDistributionFlowElementType; }
if(v==IfcFlowFitting ) { return IfcDistributionFlowElement; }
if(v==IfcFlowFittingType ) { return IfcDistributionFlowElementType; }
if(v==IfcFlowInstrumentType ) { return IfcDistributionControlElementType; }
if(v==IfcFlowMeterType ) { return IfcFlowControllerType; }
if(v==IfcFlowMovingDevice ) { return IfcDistributionFlowElement; }
if(v==IfcFlowMovingDeviceType ) { return IfcDistributionFlowElementType; }
if(v==IfcFlowSegment ) { return IfcDistributionFlowElement; }
if(v==IfcFlowSegmentType ) { return IfcDistributionFlowElementType; }
if(v==IfcFlowStorageDevice ) { return IfcDistributionFlowElement; }
if(v==IfcFlowStorageDeviceType ) { return IfcDistributionFlowElementType; }
if(v==IfcFlowTerminal ) { return IfcDistributionFlowElement; }
if(v==IfcFlowTerminalType ) { return IfcDistributionFlowElementType; }
if(v==IfcFlowTreatmentDevice ) { return IfcDistributionFlowElement; }
if(v==IfcFlowTreatmentDeviceType ) { return IfcDistributionFlowElementType; }
if(v==IfcFluidFlowProperties ) { return IfcPropertySetDefinition; }
if(v==IfcFooting ) { return IfcBuildingElement; }
if(v==IfcFuelProperties ) { return IfcMaterialProperties; }
if(v==IfcFurnishingElement ) { return IfcElement; }
if(v==IfcFurnishingElementType ) { return IfcElementType; }
if(v==IfcFurnitureStandard ) { return IfcControl; }
if(v==IfcFurnitureType ) { return IfcFurnishingElementType; }
if(v==IfcGasTerminalType ) { return IfcFlowTerminalType; }
if(v==IfcGeneralMaterialProperties ) { return IfcMaterialProperties; }
if(v==IfcGeneralProfileProperties ) { return IfcProfileProperties; }
if(v==IfcGeometricCurveSet ) { return IfcGeometricSet; }
if(v==IfcGeometricRepresentationContext ) { return IfcRepresentationContext; }
if(v==IfcGeometricRepresentationItem ) { return IfcRepresentationItem; }
if(v==IfcGeometricRepresentationSubContext ) { return IfcGeometricRepresentationContext; }
if(v==IfcGeometricSet ) { return IfcGeometricRepresentationItem; }
if(v==IfcGrid ) { return IfcProduct; }
if(v==IfcGridPlacement ) { return IfcObjectPlacement; }
if(v==IfcGroup ) { return IfcObject; }
if(v==IfcHalfSpaceSolid ) { return IfcGeometricRepresentationItem; }
if(v==IfcHeatExchangerType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcHumidifierType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcHygroscopicMaterialProperties ) { return IfcMaterialProperties; }
if(v==IfcIShapeProfileDef ) { return IfcParameterizedProfileDef; }
if(v==IfcImageTexture ) { return IfcSurfaceTexture; }
if(v==IfcInventory ) { return IfcGroup; }
if(v==IfcIrregularTimeSeries ) { return IfcTimeSeries; }
if(v==IfcJunctionBoxType ) { return IfcFlowFittingType; }
if(v==IfcLShapeProfileDef ) { return IfcParameterizedProfileDef; }
if(v==IfcLaborResource ) { return IfcConstructionResource; }
if(v==IfcLampType ) { return IfcFlowTerminalType; }
if(v==IfcLibraryReference ) { return IfcExternalReference; }
if(v==IfcLightFixtureType ) { return IfcFlowTerminalType; }
if(v==IfcLightSource ) { return IfcGeometricRepresentationItem; }
if(v==IfcLightSourceAmbient ) { return IfcLightSource; }
if(v==IfcLightSourceDirectional ) { return IfcLightSource; }
if(v==IfcLightSourceGoniometric ) { return IfcLightSource; }
if(v==IfcLightSourcePositional ) { return IfcLightSource; }
if(v==IfcLightSourceSpot ) { return IfcLightSourcePositional; }
if(v==IfcLine ) { return IfcCurve; }
if(v==IfcLinearDimension ) { return IfcDimensionCurveDirectedCallout; }
if(v==IfcLocalPlacement ) { return IfcObjectPlacement; }
if(v==IfcLoop ) { return IfcTopologicalRepresentationItem; }
if(v==IfcManifoldSolidBrep ) { return IfcSolidModel; }
if(v==IfcMappedItem ) { return IfcRepresentationItem; }
if(v==IfcMaterialDefinitionRepresentation ) { return IfcProductRepresentation; }
if(v==IfcMechanicalConcreteMaterialProperties ) { return IfcMechanicalMaterialProperties; }
if(v==IfcMechanicalFastener ) { return IfcFastener; }
if(v==IfcMechanicalFastenerType ) { return IfcFastenerType; }
if(v==IfcMechanicalMaterialProperties ) { return IfcMaterialProperties; }
if(v==IfcMechanicalSteelMaterialProperties ) { return IfcMechanicalMaterialProperties; }
if(v==IfcMember ) { return IfcBuildingElement; }
if(v==IfcMemberType ) { return IfcBuildingElementType; }
if(v==IfcMetric ) { return IfcConstraint; }
if(v==IfcMotorConnectionType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcMove ) { return IfcTask; }
if(v==IfcObject ) { return IfcObjectDefinition; }
if(v==IfcObjectDefinition ) { return IfcRoot; }
if(v==IfcObjective ) { return IfcConstraint; }
if(v==IfcOccupant ) { return IfcActor; }
if(v==IfcOffsetCurve2D ) { return IfcCurve; }
if(v==IfcOffsetCurve3D ) { return IfcCurve; }
if(v==IfcOneDirectionRepeatFactor ) { return IfcGeometricRepresentationItem; }
if(v==IfcOpenShell ) { return IfcConnectedFaceSet; }
if(v==IfcOpeningElement ) { return IfcFeatureElementSubtraction; }
if(v==IfcOpticalMaterialProperties ) { return IfcMaterialProperties; }
if(v==IfcOrderAction ) { return IfcTask; }
if(v==IfcOrientedEdge ) { return IfcEdge; }
if(v==IfcOutletType ) { return IfcFlowTerminalType; }
if(v==IfcParameterizedProfileDef ) { return IfcProfileDef; }
if(v==IfcPath ) { return IfcTopologicalRepresentationItem; }
if(v==IfcPerformanceHistory ) { return IfcControl; }
if(v==IfcPermeableCoveringProperties ) { return IfcPropertySetDefinition; }
if(v==IfcPermit ) { return IfcControl; }
if(v==IfcPhysicalComplexQuantity ) { return IfcPhysicalQuantity; }
if(v==IfcPhysicalSimpleQuantity ) { return IfcPhysicalQuantity; }
if(v==IfcPile ) { return IfcBuildingElement; }
if(v==IfcPipeFittingType ) { return IfcFlowFittingType; }
if(v==IfcPipeSegmentType ) { return IfcFlowSegmentType; }
if(v==IfcPixelTexture ) { return IfcSurfaceTexture; }
if(v==IfcPlacement ) { return IfcGeometricRepresentationItem; }
if(v==IfcPlanarBox ) { return IfcPlanarExtent; }
if(v==IfcPlanarExtent ) { return IfcGeometricRepresentationItem; }
if(v==IfcPlane ) { return IfcElementarySurface; }
if(v==IfcPlate ) { return IfcBuildingElement; }
if(v==IfcPlateType ) { return IfcBuildingElementType; }
if(v==IfcPoint ) { return IfcGeometricRepresentationItem; }
if(v==IfcPointOnCurve ) { return IfcPoint; }
if(v==IfcPointOnSurface ) { return IfcPoint; }
if(v==IfcPolyLoop ) { return IfcLoop; }
if(v==IfcPolygonalBoundedHalfSpace ) { return IfcHalfSpaceSolid; }
if(v==IfcPolyline ) { return IfcBoundedCurve; }
if(v==IfcPort ) { return IfcProduct; }
if(v==IfcPostalAddress ) { return IfcAddress; }
if(v==IfcPreDefinedColour ) { return IfcPreDefinedItem; }
if(v==IfcPreDefinedCurveFont ) { return IfcPreDefinedItem; }
if(v==IfcPreDefinedDimensionSymbol ) { return IfcPreDefinedSymbol; }
if(v==IfcPreDefinedPointMarkerSymbol ) { return IfcPreDefinedSymbol; }
if(v==IfcPreDefinedSymbol ) { return IfcPreDefinedItem; }
if(v==IfcPreDefinedTerminatorSymbol ) { return IfcPreDefinedSymbol; }
if(v==IfcPreDefinedTextFont ) { return IfcPreDefinedItem; }
if(v==IfcPresentationLayerWithStyle ) { return IfcPresentationLayerAssignment; }
if(v==IfcProcedure ) { return IfcProcess; }
if(v==IfcProcess ) { return IfcObject; }
if(v==IfcProduct ) { return IfcObject; }
if(v==IfcProductDefinitionShape ) { return IfcProductRepresentation; }
if(v==IfcProductsOfCombustionProperties ) { return IfcMaterialProperties; }
if(v==IfcProject ) { return IfcObject; }
if(v==IfcProjectOrder ) { return IfcControl; }
if(v==IfcProjectOrderRecord ) { return IfcControl; }
if(v==IfcProjectionCurve ) { return IfcAnnotationCurveOccurrence; }
if(v==IfcProjectionElement ) { return IfcFeatureElementAddition; }
if(v==IfcPropertyBoundedValue ) { return IfcSimpleProperty; }
if(v==IfcPropertyDefinition ) { return IfcRoot; }
if(v==IfcPropertyEnumeratedValue ) { return IfcSimpleProperty; }
if(v==IfcPropertyListValue ) { return IfcSimpleProperty; }
if(v==IfcPropertyReferenceValue ) { return IfcSimpleProperty; }
if(v==IfcPropertySet ) { return IfcPropertySetDefinition; }
if(v==IfcPropertySetDefinition ) { return IfcPropertyDefinition; }
if(v==IfcPropertySingleValue ) { return IfcSimpleProperty; }
if(v==IfcPropertyTableValue ) { return IfcSimpleProperty; }
if(v==IfcProtectiveDeviceType ) { return IfcFlowControllerType; }
if(v==IfcProxy ) { return IfcProduct; }
if(v==IfcPumpType ) { return IfcFlowMovingDeviceType; }
if(v==IfcQuantityArea ) { return IfcPhysicalSimpleQuantity; }
if(v==IfcQuantityCount ) { return IfcPhysicalSimpleQuantity; }
if(v==IfcQuantityLength ) { return IfcPhysicalSimpleQuantity; }
if(v==IfcQuantityTime ) { return IfcPhysicalSimpleQuantity; }
if(v==IfcQuantityVolume ) { return IfcPhysicalSimpleQuantity; }
if(v==IfcQuantityWeight ) { return IfcPhysicalSimpleQuantity; }
if(v==IfcRadiusDimension ) { return IfcDimensionCurveDirectedCallout; }
if(v==IfcRailing ) { return IfcBuildingElement; }
if(v==IfcRailingType ) { return IfcBuildingElementType; }
if(v==IfcRamp ) { return IfcBuildingElement; }
if(v==IfcRampFlight ) { return IfcBuildingElement; }
if(v==IfcRampFlightType ) { return IfcBuildingElementType; }
if(v==IfcRationalBezierCurve ) { return IfcBezierCurve; }
if(v==IfcRectangleHollowProfileDef ) { return IfcRectangleProfileDef; }
if(v==IfcRectangleProfileDef ) { return IfcParameterizedProfileDef; }
if(v==IfcRectangularPyramid ) { return IfcCsgPrimitive3D; }
if(v==IfcRectangularTrimmedSurface ) { return IfcBoundedSurface; }
if(v==IfcRegularTimeSeries ) { return IfcTimeSeries; }
if(v==IfcReinforcementDefinitionProperties ) { return IfcPropertySetDefinition; }
if(v==IfcReinforcingBar ) { return IfcReinforcingElement; }
if(v==IfcReinforcingElement ) { return IfcBuildingElementComponent; }
if(v==IfcReinforcingMesh ) { return IfcReinforcingElement; }
if(v==IfcRelAggregates ) { return IfcRelDecomposes; }
if(v==IfcRelAssigns ) { return IfcRelationship; }
if(v==IfcRelAssignsTasks ) { return IfcRelAssignsToControl; }
if(v==IfcRelAssignsToActor ) { return IfcRelAssigns; }
if(v==IfcRelAssignsToControl ) { return IfcRelAssigns; }
if(v==IfcRelAssignsToGroup ) { return IfcRelAssigns; }
if(v==IfcRelAssignsToProcess ) { return IfcRelAssigns; }
if(v==IfcRelAssignsToProduct ) { return IfcRelAssigns; }
if(v==IfcRelAssignsToProjectOrder ) { return IfcRelAssignsToControl; }
if(v==IfcRelAssignsToResource ) { return IfcRelAssigns; }
if(v==IfcRelAssociates ) { return IfcRelationship; }
if(v==IfcRelAssociatesAppliedValue ) { return IfcRelAssociates; }
if(v==IfcRelAssociatesApproval ) { return IfcRelAssociates; }
if(v==IfcRelAssociatesClassification ) { return IfcRelAssociates; }
if(v==IfcRelAssociatesConstraint ) { return IfcRelAssociates; }
if(v==IfcRelAssociatesDocument ) { return IfcRelAssociates; }
if(v==IfcRelAssociatesLibrary ) { return IfcRelAssociates; }
if(v==IfcRelAssociatesMaterial ) { return IfcRelAssociates; }
if(v==IfcRelAssociatesProfileProperties ) { return IfcRelAssociates; }
if(v==IfcRelConnects ) { return IfcRelationship; }
if(v==IfcRelConnectsElements ) { return IfcRelConnects; }
if(v==IfcRelConnectsPathElements ) { return IfcRelConnectsElements; }
if(v==IfcRelConnectsPortToElement ) { return IfcRelConnects; }
if(v==IfcRelConnectsPorts ) { return IfcRelConnects; }
if(v==IfcRelConnectsStructuralActivity ) { return IfcRelConnects; }
if(v==IfcRelConnectsStructuralElement ) { return IfcRelConnects; }
if(v==IfcRelConnectsStructuralMember ) { return IfcRelConnects; }
if(v==IfcRelConnectsWithEccentricity ) { return IfcRelConnectsStructuralMember; }
if(v==IfcRelConnectsWithRealizingElements ) { return IfcRelConnectsElements; }
if(v==IfcRelContainedInSpatialStructure ) { return IfcRelConnects; }
if(v==IfcRelCoversBldgElements ) { return IfcRelConnects; }
if(v==IfcRelCoversSpaces ) { return IfcRelConnects; }
if(v==IfcRelDecomposes ) { return IfcRelationship; }
if(v==IfcRelDefines ) { return IfcRelationship; }
if(v==IfcRelDefinesByProperties ) { return IfcRelDefines; }
if(v==IfcRelDefinesByType ) { return IfcRelDefines; }
if(v==IfcRelFillsElement ) { return IfcRelConnects; }
if(v==IfcRelFlowControlElements ) { return IfcRelConnects; }
if(v==IfcRelInteractionRequirements ) { return IfcRelConnects; }
if(v==IfcRelNests ) { return IfcRelDecomposes; }
if(v==IfcRelOccupiesSpaces ) { return IfcRelAssignsToActor; }
if(v==IfcRelOverridesProperties ) { return IfcRelDefinesByProperties; }
if(v==IfcRelProjectsElement ) { return IfcRelConnects; }
if(v==IfcRelReferencedInSpatialStructure ) { return IfcRelConnects; }
if(v==IfcRelSchedulesCostItems ) { return IfcRelAssignsToControl; }
if(v==IfcRelSequence ) { return IfcRelConnects; }
if(v==IfcRelServicesBuildings ) { return IfcRelConnects; }
if(v==IfcRelSpaceBoundary ) { return IfcRelConnects; }
if(v==IfcRelVoidsElement ) { return IfcRelConnects; }
if(v==IfcRelationship ) { return IfcRoot; }
if(v==IfcResource ) { return IfcObject; }
if(v==IfcRevolvedAreaSolid ) { return IfcSweptAreaSolid; }
if(v==IfcRibPlateProfileProperties ) { return IfcProfileProperties; }
if(v==IfcRightCircularCone ) { return IfcCsgPrimitive3D; }
if(v==IfcRightCircularCylinder ) { return IfcCsgPrimitive3D; }
if(v==IfcRoof ) { return IfcBuildingElement; }
if(v==IfcRoundedEdgeFeature ) { return IfcEdgeFeature; }
if(v==IfcRoundedRectangleProfileDef ) { return IfcRectangleProfileDef; }
if(v==IfcSIUnit ) { return IfcNamedUnit; }
if(v==IfcSanitaryTerminalType ) { return IfcFlowTerminalType; }
if(v==IfcScheduleTimeControl ) { return IfcControl; }
if(v==IfcSectionedSpine ) { return IfcGeometricRepresentationItem; }
if(v==IfcSensorType ) { return IfcDistributionControlElementType; }
if(v==IfcServiceLife ) { return IfcControl; }
if(v==IfcServiceLifeFactor ) { return IfcPropertySetDefinition; }
if(v==IfcShapeModel ) { return IfcRepresentation; }
if(v==IfcShapeRepresentation ) { return IfcShapeModel; }
if(v==IfcShellBasedSurfaceModel ) { return IfcGeometricRepresentationItem; }
if(v==IfcSimpleProperty ) { return IfcProperty; }
if(v==IfcSite ) { return IfcSpatialStructureElement; }
if(v==IfcSlab ) { return IfcBuildingElement; }
if(v==IfcSlabType ) { return IfcBuildingElementType; }
if(v==IfcSlippageConnectionCondition ) { return IfcStructuralConnectionCondition; }
if(v==IfcSolidModel ) { return IfcGeometricRepresentationItem; }
if(v==IfcSoundProperties ) { return IfcPropertySetDefinition; }
if(v==IfcSoundValue ) { return IfcPropertySetDefinition; }
if(v==IfcSpace ) { return IfcSpatialStructureElement; }
if(v==IfcSpaceHeaterType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcSpaceProgram ) { return IfcControl; }
if(v==IfcSpaceThermalLoadProperties ) { return IfcPropertySetDefinition; }
if(v==IfcSpaceType ) { return IfcSpatialStructureElementType; }
if(v==IfcSpatialStructureElement ) { return IfcProduct; }
if(v==IfcSpatialStructureElementType ) { return IfcElementType; }
if(v==IfcSphere ) { return IfcCsgPrimitive3D; }
if(v==IfcStackTerminalType ) { return IfcFlowTerminalType; }
if(v==IfcStair ) { return IfcBuildingElement; }
if(v==IfcStairFlight ) { return IfcBuildingElement; }
if(v==IfcStairFlightType ) { return IfcBuildingElementType; }
if(v==IfcStructuralAction ) { return IfcStructuralActivity; }
if(v==IfcStructuralActivity ) { return IfcProduct; }
if(v==IfcStructuralAnalysisModel ) { return IfcSystem; }
if(v==IfcStructuralConnection ) { return IfcStructuralItem; }
if(v==IfcStructuralCurveConnection ) { return IfcStructuralConnection; }
if(v==IfcStructuralCurveMember ) { return IfcStructuralMember; }
if(v==IfcStructuralCurveMemberVarying ) { return IfcStructuralCurveMember; }
if(v==IfcStructuralItem ) { return IfcProduct; }
if(v==IfcStructuralLinearAction ) { return IfcStructuralAction; }
if(v==IfcStructuralLinearActionVarying ) { return IfcStructuralLinearAction; }
if(v==IfcStructuralLoadGroup ) { return IfcGroup; }
if(v==IfcStructuralLoadLinearForce ) { return IfcStructuralLoadStatic; }
if(v==IfcStructuralLoadPlanarForce ) { return IfcStructuralLoadStatic; }
if(v==IfcStructuralLoadSingleDisplacement ) { return IfcStructuralLoadStatic; }
if(v==IfcStructuralLoadSingleDisplacementDistortion ) { return IfcStructuralLoadSingleDisplacement; }
if(v==IfcStructuralLoadSingleForce ) { return IfcStructuralLoadStatic; }
if(v==IfcStructuralLoadSingleForceWarping ) { return IfcStructuralLoadSingleForce; }
if(v==IfcStructuralLoadStatic ) { return IfcStructuralLoad; }
if(v==IfcStructuralLoadTemperature ) { return IfcStructuralLoadStatic; }
if(v==IfcStructuralMember ) { return IfcStructuralItem; }
if(v==IfcStructuralPlanarAction ) { return IfcStructuralAction; }
if(v==IfcStructuralPlanarActionVarying ) { return IfcStructuralPlanarAction; }
if(v==IfcStructuralPointAction ) { return IfcStructuralAction; }
if(v==IfcStructuralPointConnection ) { return IfcStructuralConnection; }
if(v==IfcStructuralPointReaction ) { return IfcStructuralReaction; }
if(v==IfcStructuralProfileProperties ) { return IfcGeneralProfileProperties; }
if(v==IfcStructuralReaction ) { return IfcStructuralActivity; }
if(v==IfcStructuralResultGroup ) { return IfcGroup; }
if(v==IfcStructuralSteelProfileProperties ) { return IfcStructuralProfileProperties; }
if(v==IfcStructuralSurfaceConnection ) { return IfcStructuralConnection; }
if(v==IfcStructuralSurfaceMember ) { return IfcStructuralMember; }
if(v==IfcStructuralSurfaceMemberVarying ) { return IfcStructuralSurfaceMember; }
if(v==IfcStructuredDimensionCallout ) { return IfcDraughtingCallout; }
if(v==IfcStyleModel ) { return IfcRepresentation; }
if(v==IfcStyledItem ) { return IfcRepresentationItem; }
if(v==IfcStyledRepresentation ) { return IfcStyleModel; }
if(v==IfcSubContractResource ) { return IfcConstructionResource; }
if(v==IfcSubedge ) { return IfcEdge; }
if(v==IfcSurface ) { return IfcGeometricRepresentationItem; }
if(v==IfcSurfaceCurveSweptAreaSolid ) { return IfcSweptAreaSolid; }
if(v==IfcSurfaceOfLinearExtrusion ) { return IfcSweptSurface; }
if(v==IfcSurfaceOfRevolution ) { return IfcSweptSurface; }
if(v==IfcSurfaceStyle ) { return IfcPresentationStyle; }
if(v==IfcSurfaceStyleRendering ) { return IfcSurfaceStyleShading; }
if(v==IfcSweptAreaSolid ) { return IfcSolidModel; }
if(v==IfcSweptDiskSolid ) { return IfcSolidModel; }
if(v==IfcSweptSurface ) { return IfcSurface; }
if(v==IfcSwitchingDeviceType ) { return IfcFlowControllerType; }
if(v==IfcSymbolStyle ) { return IfcPresentationStyle; }
if(v==IfcSystem ) { return IfcGroup; }
if(v==IfcSystemFurnitureElementType ) { return IfcFurnishingElementType; }
if(v==IfcTShapeProfileDef ) { return IfcParameterizedProfileDef; }
if(v==IfcTankType ) { return IfcFlowStorageDeviceType; }
if(v==IfcTask ) { return IfcProcess; }
if(v==IfcTelecomAddress ) { return IfcAddress; }
if(v==IfcTendon ) { return IfcReinforcingElement; }
if(v==IfcTendonAnchor ) { return IfcReinforcingElement; }
if(v==IfcTerminatorSymbol ) { return IfcAnnotationSymbolOccurrence; }
if(v==IfcTextLiteral ) { return IfcGeometricRepresentationItem; }
if(v==IfcTextLiteralWithExtent ) { return IfcTextLiteral; }
if(v==IfcTextStyle ) { return IfcPresentationStyle; }
if(v==IfcTextStyleFontModel ) { return IfcPreDefinedTextFont; }
if(v==IfcTextureCoordinateGenerator ) { return IfcTextureCoordinate; }
if(v==IfcTextureMap ) { return IfcTextureCoordinate; }
if(v==IfcThermalMaterialProperties ) { return IfcMaterialProperties; }
if(v==IfcTimeSeriesSchedule ) { return IfcControl; }
if(v==IfcTopologicalRepresentationItem ) { return IfcRepresentationItem; }
if(v==IfcTopologyRepresentation ) { return IfcShapeModel; }
if(v==IfcTransformerType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcTransportElement ) { return IfcElement; }
if(v==IfcTransportElementType ) { return IfcElementType; }
if(v==IfcTrapeziumProfileDef ) { return IfcParameterizedProfileDef; }
if(v==IfcTrimmedCurve ) { return IfcBoundedCurve; }
if(v==IfcTubeBundleType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcTwoDirectionRepeatFactor ) { return IfcOneDirectionRepeatFactor; }
if(v==IfcTypeObject ) { return IfcObjectDefinition; }
if(v==IfcTypeProduct ) { return IfcTypeObject; }
if(v==IfcUShapeProfileDef ) { return IfcParameterizedProfileDef; }
if(v==IfcUnitaryEquipmentType ) { return IfcEnergyConversionDeviceType; }
if(v==IfcValveType ) { return IfcFlowControllerType; }
if(v==IfcVector ) { return IfcGeometricRepresentationItem; }
if(v==IfcVertex ) { return IfcTopologicalRepresentationItem; }
if(v==IfcVertexLoop ) { return IfcLoop; }
if(v==IfcVertexPoint ) { return IfcVertex; }
if(v==IfcVibrationIsolatorType ) { return IfcDiscreteAccessoryType; }
if(v==IfcVirtualElement ) { return IfcElement; }
if(v==IfcWall ) { return IfcBuildingElement; }
if(v==IfcWallStandardCase ) { return IfcWall; }
if(v==IfcWallType ) { return IfcBuildingElementType; }
if(v==IfcWasteTerminalType ) { return IfcFlowTerminalType; }
if(v==IfcWaterProperties ) { return IfcMaterialProperties; }
if(v==IfcWindow ) { return IfcBuildingElement; }
if(v==IfcWindowLiningProperties ) { return IfcPropertySetDefinition; }
if(v==IfcWindowPanelProperties ) { return IfcPropertySetDefinition; }
if(v==IfcWindowStyle ) { return IfcTypeProduct; }
if(v==IfcWorkControl ) { return IfcControl; }
if(v==IfcWorkPlan ) { return IfcWorkControl; }
if(v==IfcWorkSchedule ) { return IfcWorkControl; }
if(v==IfcZShapeProfileDef ) { return IfcParameterizedProfileDef; }
if(v==IfcZone ) { return IfcGroup; }
return (Enum) -1;
}
std::string IfcActionSourceTypeEnum::ToString(IfcActionSourceTypeEnum v) {
if ( v < 0 || v >= 27 ) throw;
const char* names[] = { "DEAD_LOAD_G","COMPLETION_G1","LIVE_LOAD_Q","SNOW_S","WIND_W","PRESTRESSING_P","SETTLEMENT_U","TEMPERATURE_T","EARTHQUAKE_E","FIRE","IMPULSE","IMPACT","TRANSPORT","ERECTION","PROPPING","SYSTEM_IMPERFECTION","SHRINKAGE","CREEP","LACK_OF_FIT","BUOYANCY","ICE","CURRENT","WAVE","RAIN","BRAKES","USERDEFINED","NOTDEFINED" };
File diff suppressed because one or more lines are too long
-50
View File
@@ -1,50 +0,0 @@
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
#ifndef IFCGEOM_H
#define IFCGEOM_H
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Trsf.hxx>
#include <gp_Trsf2d.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Face.hxx>
#include <Geom_Curve.hxx>
#include <gp_Pln.hxx>
#include "../ifcparse/IfcParse.h"
#include "../ifcparse/IfcUtil.h"
namespace IfcGeom {
bool convert_wire_to_face(const TopoDS_Wire& wire, TopoDS_Face& face);
bool convert_shape(const SHARED_PTR<IfcUtil::IfcBaseClass>& L, TopoDS_Shape& result);
bool convert_wire(const SHARED_PTR<IfcUtil::IfcBaseClass>& L, TopoDS_Wire& result);
bool convert_curve(const SHARED_PTR<IfcUtil::IfcBaseClass>& L, Handle(Geom_Curve)& result);
bool convert_face(const SHARED_PTR<IfcUtil::IfcBaseClass>& L, TopoDS_Face& result);
bool convert_openings(const Ifc2x3::IfcProduct::ptr& L, const Ifc2x3::IfcRelVoidsElement::list& openings, TopoDS_Shape& result, const gp_Trsf& trsf);
bool profile_helper(int numVerts, float* verts, int numFillets, int* filletIndices, float* filletRadii, gp_Trsf2d trsf, TopoDS_Face& face);
namespace Cache {
void Purge();
void PurgeShapeCache();
}
#include "IfcRegisterGeomHeader.h"
}
#endif
-116
View File
@@ -1,116 +0,0 @@
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
/********************************************************************************
* *
* Implementations of the various conversion functions defined in IfcRegister.h *
* *
********************************************************************************/
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Trsf.hxx>
#include <gp_Trsf2d.hxx>
#include <gp_Mat.hxx>
#include <gp_Ax3.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Circ.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <Geom_Line.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <BRepOffsetAPI_Sewing.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Face.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepBuilderAPI_MakeShell.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <BRepPrimAPI_MakeHalfSpace.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#include <ShapeFix_Shape.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
#include <ShapeFix_Solid.hxx>
#include <BRepFilletAPI_MakeFillet2d.hxx>
#include <TopLoc_Location.hxx>
#include "../ifcparse/IfcGeom.h"
bool IfcGeom::convert(const Ifc2x3::IfcCircle::ptr& l, Handle(Geom_Curve)& curve) {
const float r = l->Radius() * Ifc::LengthUnit;
if ( r <= 0.0f ) { return false; }
gp_Trsf trsf;
Ifc2x3::IfcAxis2Placement placement = l->Position();
if (placement->is(Ifc2x3::Type::IfcAxis2Placement3D)) {
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement3D>(placement),trsf);
} else {
gp_Trsf2d trsf2d;
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement2D>(placement),trsf2d);
trsf = trsf2d;
}
gp_Ax2 ax = gp_Ax2().Transformed(trsf);
curve = new Geom_Circle(ax, r);
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcEllipse::ptr& l, Handle(Geom_Curve)& curve) {
float x = l->SemiAxis1() * Ifc::LengthUnit;
float y = l->SemiAxis2() * Ifc::LengthUnit;
if ( x == 0.0f || y == 0.0f || y > x ) { return false; }
gp_Trsf trsf;
Ifc2x3::IfcAxis2Placement placement = l->Position();
if (placement->is(Ifc2x3::Type::IfcAxis2Placement3D)) {
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement3D>(placement),trsf);
} else {
gp_Trsf2d trsf2d;
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement2D>(placement),trsf2d);
trsf = trsf2d;
}
gp_Ax2 ax = gp_Ax2().Transformed(trsf);
curve = new Geom_Ellipse(ax, x, y);
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcLine::ptr& l, Handle(Geom_Curve)& curve) {
gp_Pnt pnt;gp_Vec vec;
IfcGeom::convert(l->Pnt(),pnt);
IfcGeom::convert(l->Dir(),vec);
curve = new Geom_Line(pnt,vec);
return true;
}
-269
View File
@@ -1,269 +0,0 @@
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
/********************************************************************************
* *
* Implementations of the various conversion functions defined in IfcRegister.h *
* *
********************************************************************************/
#include <new>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Trsf.hxx>
#include <gp_Trsf2d.hxx>
#include <gp_Mat.hxx>
#include <gp_Ax3.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Circ.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <Geom_Line.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <BRepOffsetAPI_Sewing.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Face.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepBuilderAPI_MakeShell.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <BRepPrimAPI_MakeHalfSpace.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#include <ShapeFix_Shape.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
#include <ShapeFix_Solid.hxx>
#include <BRepFilletAPI_MakeFillet2d.hxx>
#include <TopLoc_Location.hxx>
#include "../ifcparse/IfcGeom.h"
bool IfcGeom::convert(const Ifc2x3::IfcFace::ptr& l, TopoDS_Face& face) {
Ifc2x3::IfcFaceBound::list bounds = l->Bounds();
Ifc2x3::IfcFaceBound::it it = bounds->begin();
Ifc2x3::IfcLoop::ptr loop = (*it)->Bound();
TopoDS_Wire wire;
if ( ! IfcGeom::convert_wire(loop,wire) ) return false;
BRepBuilderAPI_MakeFace mf (wire);
BRepBuilderAPI_FaceError er = mf.Error();
if ( er == BRepBuilderAPI_NotPlanar ) {
ShapeFix_ShapeTolerance FTol;
FTol.SetTolerance(wire, 0.01, TopAbs_WIRE);
mf.~BRepBuilderAPI_MakeFace();
new (&mf) BRepBuilderAPI_MakeFace(wire);
er = mf.Error();
}
if ( er != BRepBuilderAPI_FaceDone ) return false;
if ( bounds->Size() == 1 ) {
face = mf.Face();
return true;
}
for( ++it; it != bounds->end(); ++ it) {
Ifc2x3::IfcLoop::ptr loop = (*it)->Bound();
TopoDS_Wire wire;
if ( ! IfcGeom::convert_wire(loop,wire) ) return false;
mf.Add(wire);
}
if ( mf.IsDone() ) {
ShapeFix_Shape sfs(mf.Face());
sfs.Perform();
face = TopoDS::Face(sfs.Shape());
return true;
} else {
return false;
}
}
bool IfcGeom::convert(const Ifc2x3::IfcArbitraryClosedProfileDef::ptr& l, TopoDS_Face& face) {
TopoDS_Wire wire;
if ( ! IfcGeom::convert_wire(l->OuterCurve(),wire) ) return false;
return IfcGeom::convert_wire_to_face(wire,face);
}
bool IfcGeom::convert(const Ifc2x3::IfcArbitraryProfileDefWithVoids::ptr& l, TopoDS_Face& face) {
TopoDS_Wire profile;
if ( ! IfcGeom::convert_wire(l->OuterCurve(),profile) ) return false;
BRepBuilderAPI_MakeFace mf(profile);
Ifc2x3::IfcCurve::list voids = l->InnerCurves();
for( Ifc2x3::IfcCurve::it it = voids->begin(); it != voids->end(); ++ it ) {
TopoDS_Wire hole;
if ( IfcGeom::convert_wire(*it,hole) ) {
mf.Add(hole);
}
}
ShapeFix_Shape sfs(mf.Face());
sfs.Perform();
face = TopoDS::Face(sfs.Shape());
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcRectangleProfileDef::ptr& l, TopoDS_Face& face) {
const float x = l->XDim() / 2.0f * Ifc::LengthUnit;
const float y = l->YDim() / 2.0f * Ifc::LengthUnit;
if ( x == 0.0f || y == 0.0f ) {
Ifc::LogMessage("Notice","Skipping zero sized profile:",l->entity);
return false;
}
gp_Trsf2d trsf2d;
IfcGeom::convert(l->Position(),trsf2d);
float coords[8] = {-x,-y,x,-y,x,y,-x,y};
return IfcGeom::profile_helper(4,coords,0,0,0,trsf2d,face);
}
bool IfcGeom::convert(const Ifc2x3::IfcIShapeProfileDef::ptr& l, TopoDS_Face& face) {
const float x = l->OverallWidth() / 2.0f * Ifc::LengthUnit;
const float y = l->OverallDepth() / 2.0f * Ifc::LengthUnit;
const float d1 = l->WebThickness() / 2.0f * Ifc::LengthUnit;
const float d2 = l->FlangeThickness() * Ifc::LengthUnit;
bool doFillet = l->hasFilletRadius();
float f;
if ( doFillet ) {
f = l->FilletRadius() * Ifc::LengthUnit;
}
if ( x == 0.0f || y == 0.0f || d1 == 0.0f || d2 == 0.0f ) {
Ifc::LogMessage("Notice","Skipping zero sized profile:",l->entity);
return false;
}
gp_Trsf2d trsf2d;
IfcGeom::convert(l->Position(),trsf2d);
float coords[24] = {-x,-y,x,-y,x,-y+d2,d1,-y+d2,d1,y-d2,x,y-d2,x,y,-x,y,-x,y-d2,-d1,y-d2,-d1,-y+d2,-x,-y+d2};
int fillets[4] = {3,4,9,10};
float radii[4] = {f,f,f,f};
return IfcGeom::profile_helper(12,coords,doFillet ? 4 : 0,fillets,radii,trsf2d,face);
}
bool IfcGeom::convert(const Ifc2x3::IfcCShapeProfileDef::ptr& l, TopoDS_Face& face) {
const float x = l->Depth() / 2.0f * Ifc::LengthUnit;
const float y = l->Width() / 2.0f * Ifc::LengthUnit;
const float d1 = l->WallThickness() * Ifc::LengthUnit;
const float d2 = l->Girth() * Ifc::LengthUnit;
bool doFillet = l->hasInternalFilletRadius();
float f1,f2;
if ( doFillet ) {
f1 = l->InternalFilletRadius() * Ifc::LengthUnit;
f2 = f1 + d1;
}
if ( x == 0.0f || y == 0.0f || d1 == 0.0f || d2 == 0.0f ) {
Ifc::LogMessage("Notice","Skipping zero sized profile:",l->entity);
return false;
}
gp_Trsf2d trsf2d;
IfcGeom::convert(l->Position(),trsf2d);
float coords[24] = {-x,-y,x,-y,x,-y+d2,x-d1,-y+d2,x-d1,-y+d1,-x+d1,-y+d1,-x+d1,y-d1,x-d1,y-d1,x-d1,y-d2,x,y-d2,x,y,-x,y};
int fillets[8] = {0,1,4,5,6,7,10,11};
float radii[8] = {f2,f2,f1,f1,f1,f1,f2,f2};
return IfcGeom::profile_helper(12,coords,doFillet ? 8 : 0,fillets,radii,trsf2d,face);
}
bool IfcGeom::convert(const Ifc2x3::IfcLShapeProfileDef::ptr& l, TopoDS_Face& face) {
const float y = l->Depth() / 2.0f * Ifc::LengthUnit;
const float x = l->Width() / 2.0f * Ifc::LengthUnit;
const float d = l->Thickness() * Ifc::LengthUnit;
bool doEdgeFillet = l->hasEdgeRadius();
bool doFillet = l->hasFilletRadius();
float f1 = 0.0f;
float f2 = 0.0f;
if (doFillet) {
f1 = l->FilletRadius() * Ifc::LengthUnit;
}
if ( doEdgeFillet) {
f2 = l->EdgeRadius() * Ifc::LengthUnit;
}
if ( x == 0.0f || y == 0.0f || d == 0.0f ) {
Ifc::LogMessage("Notice","Skipping zero sized profile:",l->entity);
return false;
}
gp_Trsf2d trsf2d;
IfcGeom::convert(l->Position(),trsf2d);
float coords[12] = {-x,-y,x,-y,x,-y+d,-x+d,-y+d,-x+d,y,-x,y};
int fillets[3] = {2,3,4};
float radii[3] = {f2,f1,f2};
return IfcGeom::profile_helper(6,coords,doFillet ? 3 : 0,fillets,radii,trsf2d,face);
}
bool IfcGeom::convert(const Ifc2x3::IfcCircleProfileDef::ptr& l, TopoDS_Face& face) {
const float r = l->Radius() * Ifc::LengthUnit;
if ( r == 0.0f ) {
Ifc::LogMessage("Notice","Skipping zero sized profile:",l->entity);
return false;
}
gp_Trsf2d trsf;
IfcGeom::convert(l->Position(),trsf);
BRepBuilderAPI_MakeWire w;
gp_Ax2 ax = gp_Ax2().Transformed(trsf);
Handle(Geom_Circle) circle = new Geom_Circle(ax, r);
TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(circle);
w.Add(edge);
return IfcGeom::convert_wire_to_face(w,face);
}
bool IfcGeom::convert(const Ifc2x3::IfcCircleHollowProfileDef::ptr& l, TopoDS_Face& face) {
const float r = l->Radius() * Ifc::LengthUnit;
const float t = l->WallThickness() * Ifc::LengthUnit;
if ( r == 0.0f || t == 0.0f ) {
Ifc::LogMessage("Notice","Skipping zero sized profile:",l->entity);
return false;
}
gp_Trsf2d trsf;
IfcGeom::convert(l->Position(),trsf);
gp_Ax2 ax = gp_Ax2().Transformed(trsf);
BRepBuilderAPI_MakeWire outer;
Handle(Geom_Circle) outerCircle = new Geom_Circle(ax, r);
outer.Add(BRepBuilderAPI_MakeEdge(outerCircle));
BRepBuilderAPI_MakeFace mf(outer.Wire(), false);
BRepBuilderAPI_MakeWire inner;
Handle(Geom_Circle) innerCirlce = new Geom_Circle(ax, r-t);
inner.Add(BRepBuilderAPI_MakeEdge(innerCirlce));
mf.Add(inner);
ShapeFix_Shape sfs(mf.Face());
sfs.Perform();
face = TopoDS::Face(sfs.Shape());
return true;
}
-142
View File
@@ -1,142 +0,0 @@
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
/********************************************************************************
* *
* Implementations of the various conversion functions defined in IfcGeom.h *
* *
********************************************************************************/
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Trsf.hxx>
#include <gp_Trsf2d.hxx>
#include <gp_Mat.hxx>
#include <gp_Ax3.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Circ.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <Geom_Line.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <BRepOffsetAPI_Sewing.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Face.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepBuilderAPI_MakeShell.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <BRepPrimAPI_MakeHalfSpace.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#include <ShapeFix_Shape.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
#include <ShapeFix_Solid.hxx>
#include <BRepFilletAPI_MakeFillet2d.hxx>
#include <TopLoc_Location.hxx>
#include "../ifcparse/IfcGeom.h"
bool IfcGeom::convert_openings(const Ifc2x3::IfcProduct::ptr& entity,
const Ifc2x3::IfcRelVoidsElement::list& openings, TopoDS_Shape& result, const gp_Trsf& trsf2) {
for ( Ifc2x3::IfcRelVoidsElement::it it = openings->begin(); it != openings->end(); ++ it ) {
Ifc2x3::IfcRelVoidsElement::ptr v = *it;
Ifc2x3::IfcFeatureElementSubtraction::ptr fes = v->RelatedOpeningElement();
if ( fes->is(Ifc2x3::Type::IfcOpeningElement) ) {
gp_Trsf trsf;
IfcGeom::convert(fes->ObjectPlacement(),trsf);
trsf.PreMultiply(trsf2.Inverted());
Ifc2x3::IfcProductRepresentation::ptr prodrep = fes->Representation();
if ( prodrep->is(Ifc2x3::Type::IfcProductDefinitionShape) ) {
Ifc2x3::IfcProductDefinitionShape::ptr pds = reinterpret_pointer_cast<Ifc2x3::IfcProductRepresentation,Ifc2x3::IfcProductDefinitionShape>(prodrep);
Ifc2x3::IfcRepresentation::list reps = pds->Representations();
for ( Ifc2x3::IfcRepresentation::it it2 = reps->begin(); it2 != reps->end(); ++ it2 ) {
TopoDS_Shape s;
IfcGeom::convert_shape(*it2,s);
s.Move(trsf);
result = BRepAlgoAPI_Cut(result,s);
}
}
}
}
return true;
}
bool IfcGeom::convert_wire_to_face(const TopoDS_Wire& wire, TopoDS_Face& face) {
BRepBuilderAPI_MakeFace mf(wire, false);
BRepBuilderAPI_FaceError er = mf.Error();
if ( er == BRepBuilderAPI_NotPlanar ) {
ShapeFix_ShapeTolerance FTol;
FTol.SetTolerance(wire, 0.01, TopAbs_WIRE);
mf = BRepBuilderAPI_MakeFace(wire, false);
er = mf.Error();
}
if ( er != BRepBuilderAPI_FaceDone ) return false;
face = mf.Face();
return true;
}
bool IfcGeom::profile_helper(int numVerts, float* verts, int numFillets, int* filletIndices, float* filletRadii, gp_Trsf2d trsf, TopoDS_Face& face) {
TopoDS_Vertex* vertices = new TopoDS_Vertex[numVerts];
for ( int i = 0; i < numVerts; i ++ ) {
gp_XY xy (verts[2*i],verts[2*i+1]);
trsf.Transforms(xy);
vertices[i] = BRepBuilderAPI_MakeVertex(gp_Pnt(xy.X(),xy.Y(),0.0f));
}
BRepBuilderAPI_MakeWire w;
for ( int i = 0; i < numVerts; i ++ )
w.Add(BRepBuilderAPI_MakeEdge(vertices[i],vertices[(i+1)%numVerts]));
IfcGeom::convert_wire_to_face(w.Wire(),face);
if ( numFillets ) {
BRepFilletAPI_MakeFillet2d fillet (face);
for ( int i = 0; i < numFillets; i ++ ) {
const float radius = filletRadii[i];
if ( radius < 1e-7 ) continue;
fillet.AddFillet(vertices[filletIndices[i]],radius);
}
fillet.Build();
face = TopoDS::Face(fillet.Shape());
}
delete[] vertices;
return true;
}
-211
View File
@@ -1,211 +0,0 @@
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
/********************************************************************************
* *
* Implementations of the various conversion functions defined in IfcRegister.h *
* *
********************************************************************************/
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Trsf.hxx>
#include <gp_Trsf2d.hxx>
#include <gp_Mat.hxx>
#include <gp_Ax3.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Circ.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <Geom_Line.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <BRepOffsetAPI_Sewing.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Face.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepBuilderAPI_MakeShell.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <BRepPrimAPI_MakeHalfSpace.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#include <ShapeFix_Shape.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
#include <ShapeFix_Solid.hxx>
#include <BRepFilletAPI_MakeFillet2d.hxx>
#include <TopLoc_Location.hxx>
#include "../ifcparse/IfcGeom.h"
namespace IfcGeom {
namespace Cache {
#include "IfcRegisterCreateCache.h"
}
}
#define IN_CACHE(T,E,t,e) std::map<int,t>::const_iterator it = Cache::T.find(E->entity->id());\
if ( it != Cache::T.end() ) { e = it->second; return true; }
#define CACHE(T,E,e) Cache::T[E->entity->id()] = e;
bool IfcGeom::convert(const Ifc2x3::IfcCartesianPoint::ptr& l, gp_Pnt& point) {
IN_CACHE(IfcCartesianPoint,l,gp_Pnt,point)
std::vector<float> xyz = l->Coordinates();
point = gp_Pnt(
xyz.size() ? (xyz[0]*Ifc::LengthUnit) : 0.0f,
xyz.size() > 1 ? (xyz[1]*Ifc::LengthUnit) : 0.0f,
xyz.size() > 2 ? (xyz[2]*Ifc::LengthUnit) : 0.0f
);
CACHE(IfcCartesianPoint,l,point)
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcDirection::ptr& l, gp_Dir& dir) {
IN_CACHE(IfcDirection,l,gp_Dir,dir)
std::vector<float> xyz = l->DirectionRatios();
dir = gp_Dir(
xyz.size() ? xyz[0] : 0.0f,
xyz.size() > 1 ? xyz[1] : 0.0f,
xyz.size() > 2 ? xyz[2] : 0.0f
);
CACHE(IfcDirection,l,dir)
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcVector::ptr& l, gp_Vec& v) {
IN_CACHE(IfcVector,l,gp_Vec,v)
gp_Dir d;
IfcGeom::convert(l->Orientation(),d);
v = l->Magnitude() * Ifc::LengthUnit * d;
CACHE(IfcVector,l,v)
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement3D::ptr& l, gp_Trsf& trsf) {
IN_CACHE(IfcAxis2Placement3D,l,gp_Trsf,trsf)
gp_Pnt o;gp_Dir axis = gp_Dir(0,0,1);gp_Dir refDirection;
IfcGeom::convert(l->Location(),o);
bool hasRef = l->hasRefDirection();
if ( l->hasAxis() ) IfcGeom::convert(l->Axis(),axis);
if ( hasRef ) IfcGeom::convert(l->RefDirection(),refDirection);
gp_Ax3 ax3;
if ( hasRef ) ax3 = gp_Ax3(o,axis,refDirection);
else ax3 = gp_Ax3(o,axis);
trsf.SetTransformation(ax3, gp_Ax3(gp_Pnt(),gp_Dir(0,0,1),gp_Dir(1,0,0)));
CACHE(IfcAxis2Placement3D,l,trsf)
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator3D::ptr& l, gp_Trsf& trsf) {
IN_CACHE(IfcCartesianTransformationOperator3D,l,gp_Trsf,trsf)
gp_Pnt origin;
IfcGeom::convert(l->LocalOrigin(),origin);
gp_Dir axis1 (1.,0.,0.);
gp_Dir axis2 (0.,1.,0.);
gp_Dir axis3;
if ( l->hasAxis1() ) IfcGeom::convert(l->Axis1(),axis1);
if ( l->hasAxis2() ) IfcGeom::convert(l->Axis2(),axis2);
if ( l->hasAxis3() ) IfcGeom::convert(l->Axis3(),axis3);
else axis3 = axis1.Crossed(axis2);
const gp_Ax3 ax3 (origin,axis3,axis1);
trsf.SetTransformation(ax3);
if ( l->hasScale() ) trsf.SetScaleFactor(l->Scale());
CACHE(IfcCartesianTransformationOperator3D,l,trsf)
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator2D::ptr& l, gp_Trsf2d& trsf) {
IN_CACHE(IfcCartesianTransformationOperator2D,l,gp_Trsf2d,trsf)
gp_Pnt origin;
IfcGeom::convert(l->LocalOrigin(),origin);
gp_Dir axis1 (1.,0.,0.);
if ( l->hasAxis1() ) IfcGeom::convert(l->Axis1(),axis1);
const gp_Ax2d ax2d (gp_Pnt2d(origin.X(),origin.Y()),gp_Dir2d(axis1.X(),axis1.Y()));
trsf.SetTransformation(ax2d);
if ( l->hasScale() ) trsf.SetScaleFactor(l->Scale());
CACHE(IfcCartesianTransformationOperator2D,l,trsf)
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcPlane::ptr& pln, gp_Pln& plane) {
IN_CACHE(IfcPlane,pln,gp_Pln,plane)
Ifc2x3::IfcAxis2Placement3D::ptr l = pln->Position();
gp_Pnt o;gp_Dir axis = gp_Dir(0,0,1);gp_Dir refDirection;
IfcGeom::convert(l->Location(),o);
bool hasRef = l->hasRefDirection();
if ( l->hasAxis() ) IfcGeom::convert(l->Axis(),axis);
if ( hasRef ) IfcGeom::convert(l->RefDirection(),refDirection);
gp_Ax3 ax3;
if ( hasRef ) ax3 = gp_Ax3(o,axis,refDirection);
else ax3 = gp_Ax3(o,axis);
plane = gp_Pln(ax3);
CACHE(IfcPlane,pln,plane)
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement2D::ptr& l, gp_Trsf2d& trsf) {
IN_CACHE(IfcAxis2Placement2D,l,gp_Trsf2d,trsf)
gp_Pnt P; gp_Dir V (1,0,0);
IfcGeom::convert(l->Location(),P);
if ( l->hasRefDirection() )
IfcGeom::convert(l->RefDirection(),V);
gp_Ax2d axis(gp_Pnt2d(P.X(),P.Y()),gp_Dir2d(V.X(),V.Y()));
trsf.SetTransformation(axis,gp_Ax2d());
CACHE(IfcAxis2Placement2D,l,trsf)
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcObjectPlacement::ptr& l, gp_Trsf& trsf) {
IN_CACHE(IfcObjectPlacement,l,gp_Trsf,trsf)
if ( ! l->is(Ifc2x3::Type::IfcLocalPlacement) ) return false;
Ifc2x3::IfcLocalPlacement::ptr current = reinterpret_pointer_cast<Ifc2x3::IfcObjectPlacement,Ifc2x3::IfcLocalPlacement>(l);
while (1) {
gp_Trsf trsf2;
Ifc2x3::IfcAxis2Placement relplacement = current->RelativePlacement();
if ( relplacement->is(Ifc2x3::Type::IfcAxis2Placement3D) ) {
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement3D>(relplacement),trsf2);
trsf.PreMultiply(trsf2);
}
if ( current->hasPlacementRelTo() ) {
Ifc2x3::IfcObjectPlacement::ptr relto = current->PlacementRelTo();
if ( relto->is(Ifc2x3::Type::IfcLocalPlacement) )
current = reinterpret_pointer_cast<Ifc2x3::IfcObjectPlacement,Ifc2x3::IfcLocalPlacement>(current->PlacementRelTo());
else break;
} else break;
}
CACHE(IfcObjectPlacement,l,trsf)
return true;
}
void IfcGeom::Cache::Purge() {
#include "IfcRegisterCreateCache.h"
IfcGeom::Cache::PurgeShapeCache();
}
-298
View File
@@ -1,298 +0,0 @@
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
#include <map>
#include <gp_Trsf.hxx>
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
#include <BRepTools.hxx>
#include <BRep_Tool.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepMesh.hxx>
#include <Poly_Triangulation.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TShort_Array1OfShortReal.hxx>
#include <Poly_Array1OfTriangle.hxx>
#include <StdFail_NotDone.hxx>
#include "../ifcparse/IfcGeomObjects.h"
#include "../ifcparse/IfcGeom.h"
// Welds vertices that belong to different faces
int IfcGeomObjects::IfcMesh::addvert(gp_Pnt p) {
const float X = (float)p.X();const float Y = (float)p.Y();const float Z = (float)p.Z();
const VertKey key = VertKey(X,std::pair<float,float>(Y,Z));
VertKeyMap::const_iterator it = welds.find(key);
if ( it != welds.end() ) return it->second;
verts.push_back(X);
verts.push_back(Y);
verts.push_back(Z);
int i = (int) welds.size();
welds[key] = i;
return i;
}
IfcGeomObjects::IfcMesh::IfcMesh(int i, TopoDS_Shape s) {
id = i;
// Triangulate the shape
try {
BRepTools::Clean(s);
BRepMesh::Mesh(s,0.001f);
} catch(...) {
Ifc::LogMessage("Error","Failed to triangulate mesh");
return;
}
TopExp_Explorer exp;
// Iterates over the faces of the shape
for ( exp.Init(s,TopAbs_FACE); exp.More(); exp.Next() ) {
TopoDS_Face face = TopoDS::Face(exp.Current());
TopLoc_Location loc;
Handle_Poly_Triangulation tri = BRep_Tool::Triangulation(face,loc);
if ( ! tri.IsNull() ) {
// Keep track of the number of times an edge is used
// Manifold edges (i.e. edges used twice) are deemed invisible
std::map<std::pair<int,int>,int> edgecount;
std::vector<std::pair<int,int> > edges_temp;
const TColgp_Array1OfPnt& nodes = tri->Nodes();
std::map<int,int> dict;
for( int i = 1; i <= nodes.Length(); ++ i ) {
dict[i] = addvert(nodes(i).Transformed(loc));
}
const Poly_Array1OfTriangle& triangles = tri->Triangles();
for( int i = 1; i <= triangles.Length(); ++ i ) {
int n1,n2,n3;
if ( face.Orientation() == TopAbs_REVERSED )
triangles(i).Get(n3,n2,n1);
else triangles(i).Get(n1,n2,n3);
faces.push_back(dict[n1]);
faces.push_back(dict[n2]);
faces.push_back(dict[n3]);
addedge(n1,n2,edgecount,edges_temp);
addedge(n2,n3,edgecount,edges_temp);
addedge(n3,n1,edgecount,edges_temp);
}
for ( std::vector<std::pair<int,int> >::const_iterator it = edges_temp.begin(); it != edges_temp.end(); ++it ) {
edges.push_back(edgecount[*it]==1);
}
}
}
}
IfcGeomObjects::IfcGeomObject::IfcGeomObject( const std::string& n, const std::string& t, gp_Trsf trsf, IfcMesh* m ) {
// Convert the gp_Trsf into a 4x3 Matrix
for( int i = 1; i < 5; ++ i )
for ( int j = 1; j < 4; ++ j )
matrix.push_back((float)trsf.Value(j,i));
name = n;
type = t;
mesh = m;
}
// A container and iterator for IfcShapeRepresentations
Ifc2x3::IfcShapeRepresentation::list shapereps;
Ifc2x3::IfcShapeRepresentation::it outer;
// The triangulated shape is stored globally because it can be used by multiple IfcBuildingElements
IfcGeomObjects::IfcMesh* shape;
// The compound shape is stored globally because multiple IfcShapeRepresentations
// can have IfcBuildingElements with different IfcOpeningElements
TopoDS_Shape shapes;
// The object is fetched beforehand to be positive an entity actually exists
IfcGeomObjects::IfcGeomObject* currentGeomObj;
// A container and iterator for IfcBuildingElements for the current IfcShapeRepresentation referenced by *outer
Ifc2x3::IfcProduct::list entities;
Ifc2x3::IfcProduct::it inner;
bool use_world_coords;
int done;
int total;
// Move the the next IfcShapeRepresentation
void _nextShape() {
if ( shape ) delete shape;
shapes.Nullify();
shape = 0;
entities.reset();
++ outer;
++ done;
}
// Returns the current IfcGeomObject*
IfcGeomObjects::IfcGeomObject* _get() {
while ( true ) {
Ifc2x3::IfcShapeRepresentation::ptr shaperep;
// Have we reached the end of our list of representations?
if ( outer == shapereps->end() ) {
shapereps.reset();
return 0;
}
shaperep = *outer;
// Has the list of IfcProducts for this representation been initialized?
if ( ! entities ) {
if ( shaperep->RepresentationIdentifier() != "Body" ) {
_nextShape();
continue;
}
Ifc2x3::IfcProductRepresentation::list prodreps = shaperep->OfProductRepresentation();
entities = Ifc2x3::IfcProduct::list( new IfcTemplatedEntityList<Ifc2x3::IfcProduct>() );
for ( Ifc2x3::IfcProductRepresentation::it it = prodreps->begin(); it != prodreps->end(); ++it ) {
if ( (*it)->is(Ifc2x3::Type::IfcProductDefinitionShape) ) {
Ifc2x3::IfcProductDefinitionShape::ptr pds = reinterpret_pointer_cast<Ifc2x3::IfcProductRepresentation,Ifc2x3::IfcProductDefinitionShape>(*it);
entities->push(pds->ShapeOfProduct());
}
}
// Does this representation have any IfcProducts?
if ( ! entities->Size() ) {
_nextShape();
continue;
}
inner = entities->begin();
}
// Have we reached the end of our list of IfcProducts?
if ( inner == entities->end() ) {
_nextShape();
continue;
}
// Has the TopoDS_Shape been created for this representation?
if ( shapes.IsNull() ) {
if ( !IfcGeom::convert_shape(shaperep,shapes) ) {
_nextShape();
continue;
}
}
Ifc2x3::IfcProduct::ptr entity = *inner;
const std::string guid = entity->GlobalId();
gp_Trsf trsf;
try {
IfcGeom::convert(entity->ObjectPlacement(),trsf);
} catch (...) {}
// Does the IfcElement have any IfcOpenings?
Ifc2x3::IfcRelVoidsElement::list openings = Ifc2x3::IfcRelVoidsElement::list();
if ( entity->is(Ifc2x3::Type::IfcElement) ) {
Ifc2x3::IfcElement::ptr element = reinterpret_pointer_cast<Ifc2x3::IfcProduct,Ifc2x3::IfcElement>(entity);
openings = element->HasOpenings();
}
// Is the IfcElement a decomposition of an IfcElement with any IfcOpeningElements?
if ( entity->is(Ifc2x3::Type::IfcBuildingElementPart ) ) {
Ifc2x3::IfcBuildingElementPart::ptr part = reinterpret_pointer_cast<Ifc2x3::IfcProduct,Ifc2x3::IfcBuildingElementPart>(entity);
Ifc2x3::IfcRelDecomposes::list decomposes = part->Decomposes();
for ( Ifc2x3::IfcRelDecomposes::it it = decomposes->begin(); it != decomposes->end(); ++ it ) {
Ifc2x3::IfcObjectDefinition::ptr obdef = (*it)->RelatingObject();
if ( obdef->is(Ifc2x3::Type::IfcElement) ) {
Ifc2x3::IfcElement::ptr element = reinterpret_pointer_cast<Ifc2x3::IfcObjectDefinition,Ifc2x3::IfcElement>(obdef);
openings->push(element->HasOpenings());
}
}
}
if ( (openings && openings->Size()) || use_world_coords ) {
if ( shape ) delete shape;
TopoDS_Shape temp_shape (shapes);
try {
if (openings && openings->Size()) IfcGeom::convert_openings(entity,openings,temp_shape,trsf);
} catch( IfcParse::IfcException& e ) {Ifc::LogMessage("Warning",e.what()); }
catch(...) { Ifc::LogMessage("Error","Error processing openings for:",entity->entity); }
if ( use_world_coords ) {
shape = new IfcGeomObjects::IfcMesh(shaperep->entity->id(),temp_shape.Moved(trsf));
trsf = gp_Trsf();
} else {
shape = new IfcGeomObjects::IfcMesh(shaperep->entity->id(),temp_shape);
}
} else if ( ! shape ) {
shape = new IfcGeomObjects::IfcMesh(shaperep->entity->id(),shapes);
}
return new IfcGeomObjects::IfcGeomObject(guid, Ifc2x3::Type::ToString(entity->type()), trsf, shape);
}
}
extern bool IfcGeomObjects::Next() {
if ( entities ) {
++inner;
}
delete currentGeomObj;
currentGeomObj = _get();
if ( ! currentGeomObj ) {
delete shape;
Ifc::Dispose();
IfcGeom::Cache::Purge();
return false;
} else {
return true;
}
}
extern const IfcGeomObjects::IfcGeomObject* IfcGeomObjects::Get() {
return currentGeomObj;
}
extern bool IfcGeomObjects::Init(const char* fn, bool world_coords, std::ostream* log1, std::ostream* log2) {
if ( log1 || log2 ) Ifc::SetOutput(log1,log2);
use_world_coords = world_coords;
if ( !Ifc::Init(fn) ) return false;
shapereps = Ifc::EntitiesByType<Ifc2x3::IfcShapeRepresentation>();
if ( ! shapereps ) return false;
outer = shapereps->begin();
entities.reset();
currentGeomObj = _get();
if ( ! currentGeomObj ) return false;
done = 0;
total = shapereps->Size();
return true;
}
extern bool IfcGeomObjects::Init(std::istream& f, int len, bool world_coords, std::ostream* log1, std::ostream* log2) {
if ( log1 || log2 ) Ifc::SetOutput(log1,log2);
use_world_coords = world_coords;
if ( !Ifc::Init(f, len) ) return false;
shapereps = Ifc::EntitiesByType<Ifc2x3::IfcShapeRepresentation>();
if ( ! shapereps ) return false;
outer = shapereps->begin();
entities.reset();
currentGeomObj = _get();
if ( ! currentGeomObj ) return false;
done = 0;
total = shapereps->Size();
return true;
}
extern int IfcGeomObjects::Progress() {
return 100 * done / total;
}
-108
View File
@@ -1,108 +0,0 @@
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
/********************************************************************************
* *
* Geometrical data in an IFC file consists of shapes (IfcShapeRepresentation) *
* and instances (SUBTYPE OF IfcBuildingElement e.g. IfcWindow). *
* *
* IfcMesh is a class that represents a triangulated IfcShapeRepresentation. *
* IfcMesh.verts is a 1 dimensional vector of float defining the cartesian *
* coordinates of the vertices of the triangulated shape in the format of *
* [x1,y1,z1,..,xn,yn,zn] *
* IfcMesh.faces is a 1 dimensional vector of int containing the indices of *
* the triangles referencing positions in IfcMesh.verts *
* IfcMesh.edges is a 1 dimensional vector of int in {0,1} that dictates *
* the visibility of the edges that span the faces in IfcMesh.faces *
* *
* IfcGeomObject represents the actual IfcBuildingElements. *
* IfcGeomObject.name is the GUID of the element *
* IfcGeomObject.type is the datatype of the element e.g. IfcWindow *
* IfcGeomObject.mesh is a pointer to an IfcMesh *
* IfcGeomObject.matrix is a 4x3 matrix that defines the orientation and *
* translation of the mesh in relation to the world origin *
* *
* Init(char* fn, bool world_coords) parses the IFC file in fn, returns true *
* on succes, world_coords = true will result in all IfcGeomObject.matrix *
* being an identity matrix and IfcMesh.verts containing global positions *
* *
* Get() returns a pointer to the current IfcGeomObject *
* *
* Next() returns true if there is an entity yet available *
* *
* Progress() returns an int in [0..100] that indicates the overall progress *
* *
********************************************************************************/
#ifndef IFCOBJECTS_H
#define IFCOBJECTS_H
#include <map>
#include <vector>
#include <algorithm>
#include <gp_Trsf.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS.hxx>
namespace IfcGeomObjects {
typedef std::vector<int>::const_iterator IntIt;
typedef std::vector<float>::const_iterator FltIt;
typedef std::pair< float,std::pair<float,float> > VertKey;
typedef std::map<VertKey,int> VertKeyMap;
typedef std::pair<int,int> Edge;
class IfcMesh {
public:
int id;
std::vector<float> verts;
std::vector<int> faces;
std::vector<int> edges;
VertKeyMap welds;
IfcMesh(int i, TopoDS_Shape s);
private:
int addvert(gp_Pnt p);
inline void addedge(int n1, int n2, std::map<std::pair<int,int>,int>& edgecount, std::vector<std::pair<int,int> >& edges_temp) {
const Edge e = Edge( (std::min)(n1,n2),(std::max)(n1,n2) );
if ( edgecount.find(e) == edgecount.end() ) edgecount[e] = 1;
else edgecount[e] ++;
edges_temp.push_back(e);
}
};
class IfcGeomObject {
public:
std::string name;
std::string type;
std::vector<float> matrix;
IfcMesh* mesh;
IfcGeomObject( const std::string& n, const std::string& t, gp_Trsf trsf, IfcMesh* m );
};
extern bool Init(const char* fn, bool world_coords = false, std::ostream* log1= 0, std::ostream* log2= 0);
extern bool Init(std::istream& f, int len, bool world_coords = false, std::ostream* log1= 0, std::ostream* log2= 0);
extern const IfcGeomObject* Get();
extern bool Next();
extern int Progress();
}
#endif
-231
View File
@@ -1,231 +0,0 @@
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
/********************************************************************************
* *
* Implementations of the various conversion functions defined in IfcRegister.h *
* *
********************************************************************************/
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Trsf.hxx>
#include <gp_Trsf2d.hxx>
#include <gp_Mat.hxx>
#include <gp_Ax3.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Circ.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <Geom_Line.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <BRepOffsetAPI_Sewing.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Face.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepBuilderAPI_MakeShell.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <BRepPrimAPI_MakeHalfSpace.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#include <ShapeFix_Shape.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
#include <ShapeFix_Solid.hxx>
#include <BRepFilletAPI_MakeFillet2d.hxx>
#include <TopLoc_Location.hxx>
#include "../ifcparse/IfcGeom.h"
bool IfcGeom::convert(const Ifc2x3::IfcExtrudedAreaSolid::ptr& l, TopoDS_Shape& shape) {
TopoDS_Face face;
if ( ! IfcGeom::convert_face(l->SweptArea(),face) ) return false;
const float height = l->Depth() * Ifc::LengthUnit;
gp_Trsf trsf;
IfcGeom::convert(l->Position(),trsf);
gp_Dir dir;
convert(l->ExtrudedDirection(),dir);
shape = BRepPrimAPI_MakePrism(face,height*dir);
shape.Move(trsf);
return ! shape.IsNull();
}
bool IfcGeom::convert(const Ifc2x3::IfcFacetedBrep::ptr& l, TopoDS_Shape& shape) {
return IfcGeom::convert_shape(l->Outer(),shape);
}
bool IfcGeom::convert(const Ifc2x3::IfcFaceBasedSurfaceModel::ptr& l, TopoDS_Shape& shape) {
Ifc2x3::IfcConnectedFaceSet::list facesets = l->FbsmFaces();
BRep_Builder builder;
TopoDS_Compound c;
builder.MakeCompound(c);
for( Ifc2x3::IfcConnectedFaceSet::it it = facesets->begin(); it != facesets->end(); ++ it ) {
TopoDS_Shape s;
if ( IfcGeom::convert_shape(*it,s) ) {
builder.Add(c,s);
}
}
shape = c;
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcHalfSpaceSolid::ptr& l, TopoDS_Shape& shape) {
Ifc2x3::IfcSurface::ptr surface = l->BaseSurface();
if ( ! surface->is(Ifc2x3::Type::IfcPlane) ) {
// Not implemented
return false;
}
gp_Pln pln;
IfcGeom::convert(reinterpret_pointer_cast<Ifc2x3::IfcSurface,Ifc2x3::IfcPlane>(surface),pln);
gp_Pnt pnt = pln.Location();
bool reverse = l->AgreementFlag();
if ( l->is(Ifc2x3::Type::IfcPolygonalBoundedHalfSpace) ) reverse = !reverse;
if ( reverse ) pnt.Translate(-pln.Axis().Direction());
else pnt.Translate(pln.Axis().Direction());
shape = BRepPrimAPI_MakeHalfSpace(BRepBuilderAPI_MakeFace(pln),pnt).Solid();
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcPolygonalBoundedHalfSpace::ptr& l, TopoDS_Shape& shape) {
TopoDS_Shape halfspace;
if ( ! IfcGeom::convert(reinterpret_pointer_cast<Ifc2x3::IfcPolygonalBoundedHalfSpace,Ifc2x3::IfcHalfSpaceSolid>(l),halfspace) ) return false;
TopoDS_Wire wire;
if ( ! IfcGeom::convert_wire(l->PolygonalBoundary(),wire) ) return false;
gp_Trsf trsf;
convert(l->Position(),trsf);
TopoDS_Shape extrusion = BRepPrimAPI_MakePrism(BRepBuilderAPI_MakeFace(wire),gp_Vec(0,0,20000.0));
gp_Trsf down; down.SetTranslation(gp_Vec(0,0,-10000.0));
extrusion.Move(down*trsf);
shape = BRepAlgoAPI_Cut(extrusion,halfspace);
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcShellBasedSurfaceModel::ptr& l, TopoDS_Shape& shape) {
IfcUtil::IfcAbstractSelect::list shells = l->SbsmBoundary();
BRep_Builder builder;
TopoDS_Compound c;
builder.MakeCompound(c);
for( IfcUtil::IfcAbstractSelect::it it = shells->begin(); it != shells->end(); ++ it ) {
TopoDS_Shape s;
if ( IfcGeom::convert_shape(*it,s) ) {
builder.Add(c,s);
}
}
shape = c;
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcBooleanClippingResult::ptr& l, TopoDS_Shape& shape) {
TopoDS_Shape s1, s2;
if ( ! IfcGeom::convert_shape(l->FirstOperand(),s1) )
return false;
if ( ! IfcGeom::convert_shape(l->SecondOperand(),s2) )
return false;
shape = BRepAlgoAPI_Cut(s1,s2);
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcClosedShell::ptr& l, TopoDS_Shape& shape) {
if ( ! IfcGeom::convert((Ifc2x3::IfcConnectedFaceSet::ptr)l,shape) ) return false;
try {
ShapeFix_Solid solid;
solid.LimitTolerance(0.01);
shape = solid.SolidFromShell(TopoDS::Shell(shape));
} catch(...) {}
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcConnectedFaceSet::ptr& l, TopoDS_Shape& shape) {
BRepOffsetAPI_Sewing builder;
builder.SetTolerance(0.01);
Ifc2x3::IfcFace::list faces = l->CfsFaces();
bool facesAdded = false;
for( Ifc2x3::IfcFace::it it = faces->begin(); it != faces->end(); ++ it ) {
TopoDS_Face face;
if ( IfcGeom::convert_face(*it,face) ) {
builder.Add(face);
facesAdded = true;
} else {
Ifc::LogMessage("Warning","Invalid face:",(*it)->entity);
}
}
if ( ! facesAdded ) return false;
builder.Perform();
shape = builder.SewedShape();
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcMappedItem::ptr& l, TopoDS_Shape& shape) {
gp_Trsf trsf1;
Ifc2x3::IfcCartesianTransformationOperator::ptr transform = l->MappingTarget();
if ( transform->is(Ifc2x3::Type::IfcCartesianTransformationOperator2DnonUniform) ||
transform->is(Ifc2x3::Type::IfcCartesianTransformationOperator3DnonUniform) ) {
// Not implemented
return false;
} else if ( transform->is(Ifc2x3::Type::IfcCartesianTransformationOperator3D) ) {
IfcGeom::convert(reinterpret_pointer_cast<Ifc2x3::IfcCartesianTransformationOperator,
Ifc2x3::IfcCartesianTransformationOperator3D>(transform),trsf1);
} else if ( transform->is(Ifc2x3::Type::IfcCartesianTransformationOperator2D) ) {
gp_Trsf2d trsf1_2d;
IfcGeom::convert(reinterpret_pointer_cast<Ifc2x3::IfcCartesianTransformationOperator,
Ifc2x3::IfcCartesianTransformationOperator2D>(transform),trsf1_2d);
trsf1 = trsf1_2d;
}
Ifc2x3::IfcRepresentationMap::ptr map = l->MappingSource();
Ifc2x3::IfcAxis2Placement placement = map->MappingOrigin();
gp_Trsf trsf2;
if (placement->is(Ifc2x3::Type::IfcAxis2Placement3D)) {
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement3D>(placement),trsf2);
} else {
gp_Trsf2d trsf2_2d;
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcAxis2Placement2D>(placement),trsf2_2d);
trsf2 = trsf2_2d;
}
if ( ! IfcGeom::convert_shape(map->MappedRepresentation(),shape) ) return false;
shape.Move(trsf2 * trsf1);
return !shape.IsNull();
}
bool IfcGeom::convert(const Ifc2x3::IfcShapeRepresentation::ptr& l, TopoDS_Shape& shape) {
Ifc2x3::IfcRepresentationItem::list items = l->Items();
if ( ! items->Size() ) return false;
BRep_Builder builder;
TopoDS_Compound c;
builder.MakeCompound(c);
for ( Ifc2x3::IfcRepresentationItem::it it = items->begin(); it != items->end(); ++ it ) {
TopoDS_Shape s;
if ( ! IfcGeom::convert_shape(*it,s)) continue;
builder.Add(c,s);
}
shape = c;
return !shape.IsNull();
}
-176
View File
@@ -1,176 +0,0 @@
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
/********************************************************************************
* *
* Implementations of the various conversion functions defined in IfcRegister.h *
* *
********************************************************************************/
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Trsf.hxx>
#include <gp_Trsf2d.hxx>
#include <gp_Mat.hxx>
#include <gp_Ax3.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Circ.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <Geom_Line.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <BRepOffsetAPI_Sewing.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Face.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepBuilderAPI_MakeShell.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <BRepPrimAPI_MakeHalfSpace.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#include <ShapeFix_Shape.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
#include <ShapeFix_Solid.hxx>
#include <BRepFilletAPI_MakeFillet2d.hxx>
#include <TopLoc_Location.hxx>
#include "../ifcparse/IfcGeom.h"
bool IfcGeom::convert(const Ifc2x3::IfcCompositeCurve::ptr& l, TopoDS_Wire& wire) {
Ifc2x3::IfcCompositeCurveSegment::list segments = l->Segments();
BRepBuilderAPI_MakeWire w;
for( Ifc2x3::IfcCompositeCurveSegment::it it = segments->begin(); it != segments->end(); ++ it ) {
const Ifc2x3::IfcCurve::ptr curve = (*it)->ParentCurve();
TopoDS_Wire wire2;
if ( ! IfcGeom::convert_wire(curve,wire2) ) continue;
ShapeFix_ShapeTolerance FTol;
FTol.SetTolerance(wire2, 0.01, TopAbs_WIRE);
w.Add(wire2);
if ( w.Error() != BRepBuilderAPI_WireDone ) {
Ifc::LogMessage("Error","Failed to join curve segments:",l->entity);
return false;
}
}
wire = w.Wire();
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcTrimmedCurve::ptr& l, TopoDS_Wire& wire) {
Ifc2x3::IfcCurve::ptr basis_curve = l->BasisCurve();
bool isConic = basis_curve->is(Ifc2x3::Type::IfcConic);
float parameterFactor = isConic ? Ifc::PlaneAngleUnit : Ifc::LengthUnit;
Handle(Geom_Curve) curve;
if ( ! IfcGeom::convert_curve(basis_curve,curve) ) return false;
bool trim_cartesian = l->MasterRepresentation() == Ifc2x3::IfcTrimmingPreference::CARTESIAN;
IfcUtil::IfcAbstractSelect::list trims1 = l->Trim1();
IfcUtil::IfcAbstractSelect::list trims2 = l->Trim2();
bool trimmed1 = false;
bool trimmed2 = false;
float flt1;
gp_Pnt pnt1;
BRepBuilderAPI_MakeWire w;
for ( IfcUtil::IfcAbstractSelect::it it = trims1->begin(); it != trims1->end(); it ++ ) {
const IfcUtil::IfcAbstractSelect::ptr i = *it;
if ( i->is(Ifc2x3::Type::IfcCartesianPoint) && trim_cartesian ) {
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcCartesianPoint>(i), pnt1 );
trimmed1 = true;
} else if ( i->is(Ifc2x3::Type::IfcParameterValue) ) {
const float value = *reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,IfcUtil::IfcArgumentSelect>(i)->wrappedValue();
flt1 = value * parameterFactor;
trimmed1 = true;
}
}
for ( IfcUtil::IfcAbstractSelect::it it = trims2->begin(); it != trims2->end(); it ++ ) {
const IfcUtil::IfcAbstractSelect::ptr i = *it;
if ( i->is(Ifc2x3::Type::IfcCartesianPoint) && trim_cartesian && trimmed1 ) {
gp_Pnt pnt2;
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcCartesianPoint>(i), pnt2 );
BRepBuilderAPI_MakeEdge e (curve,pnt1,pnt2);
w.Add(e.Edge());
trimmed2 = true;
} else if ( i->is(Ifc2x3::Type::IfcParameterValue) && trimmed1 ) {
const float value = *reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,IfcUtil::IfcArgumentSelect>(i)->wrappedValue();
float flt2 = value * parameterFactor;
BRepBuilderAPI_MakeEdge e (curve,flt1,flt2);
w.Add(e.Edge());
trimmed2 = true;
}
}
if ( trimmed2 ) wire = w.Wire();
return trimmed2;
}
bool IfcGeom::convert(const Ifc2x3::IfcPolyline::ptr& l, TopoDS_Wire& result) {
Ifc2x3::IfcCartesianPoint::list points = l->Points();
BRepBuilderAPI_MakeWire w;
gp_Pnt P1;gp_Pnt P2;
for( Ifc2x3::IfcCartesianPoint::it it = points->begin(); it != points->end(); ++ it ) {
IfcGeom::convert(*it,P2);
if ( it != points->begin() && ( P1.X() != P2.X() || P1.Y() != P2.Y() || P1.Z() != P2.Z() ) )
w.Add(BRepBuilderAPI_MakeEdge(P1,P2));
P1 = P2;
}
result = w.Wire();
return true;
}
bool IfcGeom::convert(const Ifc2x3::IfcPolyLoop::ptr& l, TopoDS_Wire& result) {
Ifc2x3::IfcCartesianPoint::list points = l->Polygon();
BRepBuilderAPI_MakeWire w;
gp_Pnt P1;gp_Pnt P2;gp_Pnt F;
int count = 0;
for( Ifc2x3::IfcCartesianPoint::it it = points->begin(); it != points->end(); ++ it ) {
IfcGeom::convert(*it,P2);
if ( it != points->begin() && ( P1.X() != P2.X() || P1.Y() != P2.Y() || P1.Z() != P2.Z() ) ) {
w.Add(BRepBuilderAPI_MakeEdge(P1,P2));
count ++;
} else if ( ! count ) F = P2;
P1 = P2;
}
if ( P1.X() != F.X() || P1.Y() != F.Y() || P1.Z() != F.Z() ) {
w.Add(BRepBuilderAPI_MakeEdge(P1,F));
count ++;
}
if ( count < 3 ) return false;
result = w.Wire();
return true;
}
+16 -13
View File
@@ -272,7 +272,7 @@ std::string TokenFunc::asString(Token t) {
}
std::string TokenFunc::toString(Token t) {
if ( isOperator(t) ) return std::string ( (char*) &t, 1 );
else return asString(t);
else return Ifc::tokens->TokenString(t - 128);
}
@@ -390,7 +390,7 @@ TokenArgument::operator SHARED_PTR<IfcUtil::IfcAbstractSelect>() const {
TokenArgument::operator IfcEntities() const { throw IfcException("Argument is not a list of entities"); }
unsigned int TokenArgument::Size() const { return 1; }
ArgumentPtr TokenArgument::operator [] (unsigned int i) const { throw IfcException("Argument is not a list of arguments"); }
std::string TokenArgument::toString() const { return TokenFunc::asString(token); }
std::string TokenArgument::toString() const { return TokenFunc::toString(token); }
bool TokenArgument::isNull() const { return TokenFunc::isOperator(token,'$'); }
//
// Functions for casting the EntityArgument to other types
@@ -454,7 +454,6 @@ void Entity::Load(std::vector<unsigned int>& ids, bool seek) {
if ( seek ) {
Ifc::file->Seek(offset);
Token datatype = Ifc::tokens->Next();
std::string dt = TokenFunc::toString(datatype);
if ( ! TokenFunc::isDatatype(datatype)) throw IfcException("Unexpected token while parsing entity");
_type = Ifc2x3::Type::FromString(TokenFunc::asString(datatype));
}
@@ -546,12 +545,16 @@ bool Ifc::Init(IfcParse::File* f) {
e = EntityPtr(new Entity(currentId,tokens));
entity = Ifc2x3::SchemaEntity(e);
if ( log1 && !((++x)%1000) ) std::cout << "\r#" << currentId << " " << std::flush;
IfcEntities L = EntitiesByType(entity->type());
if ( L == 0 ) {
L = IfcEntities(new IfcEntityList());
bytype[entity->type()] = L;
}
L->push(entity);
Ifc2x3::Type::Enum ty = entity->type();
do {
IfcEntities L = EntitiesByType(ty);
if ( L == 0 ) {
L = IfcEntities(new IfcEntityList());
bytype[ty] = L;
}
L->push(entity);
ty = Ifc2x3::Type::Parent(ty);
} while ( ty > -1 );
byid[currentId] = entity;
currentId = 0;
} else token = tokens->Next();
@@ -577,10 +580,10 @@ bool Ifc::Init(IfcParse::File* f) {
Ifc2x3::IfcUnitAssignment::list unit_assignments = EntitiesByType<Ifc2x3::IfcUnitAssignment>();
IfcUtil::IfcAbstractSelect::list units = IfcUtil::IfcAbstractSelect::list();
if ( unit_assignments->Size() ) {
Ifc2x3::IfcUnitAssignment::ptr unit_assignment = *unit_assignments->begin();
IfcUtil::IfcAbstractSelect::list units = unit_assignment->Units();
}
if ( units )
Ifc2x3::IfcUnitAssignment::ptr unit_assignment = *unit_assignments->begin();
units = unit_assignment->Units();
}
if ( ! units ) return true;
for ( IfcUtil::IfcAbstractSelect::it it = units->begin(); it != units->end(); ++ it ) {
const IfcUtil::IfcAbstractSelect::ptr base = *it;
Ifc2x3::IfcSIUnit::ptr unit = Ifc2x3::IfcSIUnit::ptr();
-56
View File
@@ -1,56 +0,0 @@
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
#include "IfcGeom.h"
namespace IfcGeom {
namespace Cache {
std::map<int,TopoDS_Shape> Shape;
void PurgeShapeCache() {
Shape.clear();
}
}
}
using namespace Ifc2x3;
using namespace IfcUtil;
bool IfcGeom::convert_shape(const SHARED_PTR<IfcBaseClass>& l, TopoDS_Shape& r) {
const unsigned int id = l->entity->id();
std::map<int,TopoDS_Shape>::const_iterator it = Cache::Shape.find(id);
if ( it != Cache::Shape.end() ) { r = it->second; return true; }
#include "IfcRegisterConvertShape.h"
Ifc::LogMessage("Error","No operation defined for:",l->entity);
return false;
}
bool IfcGeom::convert_wire(const SHARED_PTR<IfcBaseClass>& l, TopoDS_Wire& r) {
#include "IfcRegisterConvertWire.h"
Ifc::LogMessage("Error","No operation defined for:",l->entity);
return false;
}
bool IfcGeom::convert_face(const SHARED_PTR<IfcBaseClass>& l, TopoDS_Face& r) {
#include "IfcRegisterConvertFace.h"
Ifc::LogMessage("Error","No operation defined for:",l->entity);
return false;
}
bool IfcGeom::convert_curve(const SHARED_PTR<IfcBaseClass>& l, Handle(Geom_Curve)& r) {
#include "IfcRegisterConvertCurve.h"
Ifc::LogMessage("Error","No operation defined for:",l->entity);
return false;
}
-80
View File
@@ -1,80 +0,0 @@
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
/********************************************************************************
* *
* This file registers function prototypes for all supported IFC geometrical *
* entities. For entities of type CLASS an std::map is also created to cache *
* the output of the conversion functions *
* *
********************************************************************************/
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Face.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pln.hxx>
#include <gp_Dir.hxx>
#include <gp_Trsf.hxx>
#include <gp_Trsf2d.hxx>
#include "../ifcparse/IfcParse.h"
using namespace Ifc2x3;
SHAPE(IfcExtrudedAreaSolid);
SHAPE(IfcClosedShell);
SHAPE(IfcConnectedFaceSet);
SHAPE(IfcFacetedBrep);
SHAPE(IfcShellBasedSurfaceModel);
SHAPE(IfcFaceBasedSurfaceModel);
SHAPE(IfcBooleanClippingResult);
SHAPE(IfcShapeRepresentation);
SHAPE(IfcMappedItem);
SHAPE(IfcPolygonalBoundedHalfSpace);
SHAPE(IfcHalfSpaceSolid);
FACE(IfcArbitraryClosedProfileDef);
FACE(IfcArbitraryProfileDefWithVoids);
FACE(IfcRectangleProfileDef);
FACE(IfcIShapeProfileDef);
FACE(IfcCShapeProfileDef);
FACE(IfcLShapeProfileDef);
FACE(IfcCircleProfileDef);
FACE(IfcFace);
FACE(IfcCircleHollowProfileDef);
WIRE(IfcPolyline);
WIRE(IfcPolyLoop);
WIRE(IfcCompositeCurve);
WIRE(IfcTrimmedCurve);
CURVE(IfcCircle);
CURVE(IfcEllipse);
CURVE(IfcLine);
CLASS(IfcCartesianPoint,gp_Pnt);
CLASS(IfcDirection,gp_Dir);
CLASS(IfcAxis2Placement2D,gp_Trsf2d);
CLASS(IfcAxis2Placement3D,gp_Trsf);
CLASS(IfcCartesianTransformationOperator2D,gp_Trsf2d);
CLASS(IfcCartesianTransformationOperator3D,gp_Trsf);
CLASS(IfcObjectPlacement,gp_Trsf);
CLASS(IfcVector,gp_Vec);
CLASS(IfcPlane,gp_Pln);
-6
View File
@@ -1,6 +0,0 @@
#include "IfcRegisterUndef.h"
#define CURVE(T) \
if ( l->is(T::Class()) ) return convert(reinterpret_pointer_cast<IfcBaseClass,T>(l),r);
#include "IfcRegisterDef.h"
#include "IfcRegister.h"
-6
View File
@@ -1,6 +0,0 @@
#include "IfcRegisterUndef.h"
#define FACE(T) \
if ( l->is(T::Class()) ) return convert(reinterpret_pointer_cast<IfcBaseClass,T>(l),r);
#include "IfcRegisterDef.h"
#include "IfcRegister.h"
-14
View File
@@ -1,14 +0,0 @@
#include "IfcRegisterUndef.h"
#define SHAPE(T) \
if ( l->is(T::Class()) ) { \
try { \
bool b = convert(reinterpret_pointer_cast<IfcBaseClass,T>(l),r); \
if ( b ) { \
Cache::Shape[l->entity->id()] = r; \
return true; \
} else { return false; }\
} catch(...) { Ifc::LogMessage("Error","Failed to convert:",l->entity); } \
}
#include "IfcRegisterDef.h"
#include "IfcRegister.h"
-6
View File
@@ -1,6 +0,0 @@
#include "IfcRegisterUndef.h"
#define WIRE(T) \
if ( l->is(T::Class()) ) return convert(reinterpret_pointer_cast<IfcBaseClass,T>(l),r);
#include "IfcRegisterDef.h"
#include "IfcRegister.h"
-6
View File
@@ -1,6 +0,0 @@
#include "IfcRegisterUndef.h"
#define CLASS(T,V) \
std::map<int,V> T;
#include "IfcRegisterDef.h"
#include "IfcRegister.h"
-15
View File
@@ -1,15 +0,0 @@
#ifndef SHAPE
#define SHAPE(T)
#endif
#ifndef WIRE
#define WIRE(T)
#endif
#ifndef FACE
#define FACE(T)
#endif
#ifndef CURVE
#define CURVE(T)
#endif
#ifndef CLASS
#define CLASS(T,V)
#endif
-9
View File
@@ -1,9 +0,0 @@
#include "IfcRegisterUndef.h"
#define CLASS(T,V) bool convert(const T::ptr& L, V& r);
#define SHAPE(T) CLASS(T,TopoDS_Shape)
#define WIRE(T) CLASS(T,TopoDS_Wire)
#define FACE(T) CLASS(T,TopoDS_Face)
#define CURVE(T) CLASS(T,Handle(Geom_Curve))
#include "IfcRegisterDef.h"
#include "IfcRegister.h"
-6
View File
@@ -1,6 +0,0 @@
#include "IfcRegisterUndef.h"
#define CLASS(T,V) \
T.clear();
#include "IfcRegisterDef.h"
#include "IfcRegister.h"
-15
View File
@@ -1,15 +0,0 @@
#ifdef SHAPE
#undef SHAPE
#endif
#ifdef WIRE
#undef WIRE
#endif
#ifdef FACE
#undef FACE
#endif
#ifdef CURVE
#undef CURVE
#endif
#ifdef CLASS
#undef CLASS
#endif