ソースを参照

Step-Importer: introduce data generation based on config.

Kim Kulling 7 年 前
コミット
78a70baf7c

+ 19 - 12
scripts/StepImporter/CppGenerator.py

@@ -5,7 +5,7 @@
 # Open Asset Import Library (ASSIMP)
 # ---------------------------------------------------------------------------
 #
-# Copyright (c) 2006-2010, ASSIMP Development Team
+# Copyright (c) 2006-2018, ASSIMP Development Team
 #
 # All rights reserved.
 #
@@ -48,11 +48,21 @@ if sys.version_info < (3, 0):
     print("must use python 3.0 or greater")
     sys.exit(-2)
 
-input_template_h = 'IFCReaderGen.h.template'
-input_template_cpp = 'IFCReaderGen.cpp.template'
-
-output_file_h = os.path.join('..','..','code','IFCReaderGen.h')
-output_file_cpp = os.path.join('..','..','code','IFCReaderGen.cpp')
+use_ifc_template = False
+	
+input_step_template_h   = 'StepReaderGen.h.template'
+input_step_template_cpp = 'StepReaderGen.cpp.template'
+input_template_h        = 'IFCReaderGen.h.template'
+input_template_cpp      = 'IFCReaderGen.cpp.template'
+
+output_file_h = ""
+output_file_cpp = ""
+if (use_ifc_template ):
+    output_file_h = os.path.join('..','..','code','IFCReaderGen.h')
+    output_file_cpp = os.path.join('..','..','code','IFCReaderGen.cpp')
+else:
+    output_file_h = os.path.join('..','..','code','StepReaderGen.h')
+    output_file_cpp = os.path.join('..','..','code','StepReaderGen.cpp')
 
 template_entity_predef = '\tstruct {entity};\n'
 template_entity_predef_ni = '\ttypedef NotImplemented {entity}; // (not currently used by Assimp)\n'
@@ -221,7 +231,9 @@ def work(filename):
     schema = ExpressReader.read(filename,silent=True)
     entities, stub_decls, schema_table, converters, typedefs, predefs = '','',[],'','',''
 
-    
+    entitylist = 'ifc_entitylist.txt'
+    if not use_ifc_template:
+        entitylist = 'step_entitylist.txt'
     whitelist = []
     with open('entitylist.txt', 'rt') as inp:
         whitelist = [n.strip() for n in inp.read().split('\n') if n[:1]!='#' and n.strip()]
@@ -280,8 +292,3 @@ def work(filename):
 
 if __name__ == "__main__":
     sys.exit(work(sys.argv[1] if len(sys.argv)>1 else 'schema.exp'))
-
-
-
-    
-    

+ 0 - 0
scripts/StepImporter/entitylist.txt → scripts/StepImporter/ifc_entitylist.txt


+ 111 - 0
scripts/StepImporter/step_entitylist.txt

@@ -0,0 +1,111 @@
+# ==============================================================================
+# List of IFC structures needed by Assimp
+# ==============================================================================
+# use genentitylist.sh to update this list
+
+# This machine-generated list is not complete, it lacks many intermediate
+# classes in the inheritance hierarchy. Those are magically augmented by the
+# code generator. Also, the names of all used entities need to be present
+# in the source code for this to work.
+
+IfcAnnotation
+IfcArbitraryClosedProfileDef
+IfcArbitraryOpenProfileDef
+IfcArbitraryProfileDefWithVoids
+IfcAxis1Placement
+IfcAxis2Placement
+IfcAxis2Placement2D
+IfcAxis2Placement3D
+IfcBooleanClippingResult
+IfcBooleanResult
+IfcBoundedCurve
+IfcBoundingBox
+IfcBSplineCurve
+IfcBuilding
+IfcCartesianPoint
+IfcCartesianTransformationOperator
+IfcCartesianTransformationOperator3D
+IfcCartesianTransformationOperator3DnonUniform
+IfcCircle
+IfcCircleHollowProfileDef
+IfcCircleProfileDef
+IfcClosedShell
+IfcColourOrFactor
+IfcColourRgb
+IfcCompositeCurve
+IfcCompositeCurveSegment
+IfcConic
+IfcConnectedFaceSet
+IfcConversionBasedUnit
+IfcCurve
+IfcDirection
+IfcDoor
+IfcEllipse
+IfcExtrudedAreaSolid
+IfcFace
+IfcFaceBasedSurfaceModel
+IfcFaceBound
+IfcFaceOuterBound
+IfcFeatureElementSubtraction
+IfcGeometricRepresentationContext
+IfcGeometricRepresentationItem
+IfcHalfSpaceSolid
+IfcLine
+IfcLocalPlacement
+IfcManifoldSolidBrep
+IfcMappedItem
+IfcMeasureWithUnit
+IfcNamedUnit
+IfcObjectDefinition
+IfcObjectPlacement
+IfcOpeningElement
+IfcParameterizedProfileDef
+IfcPlane
+IfcPolygonalBoundedHalfSpace
+IfcPolyline
+IfcPolyLoop
+IfcPresentationStyleAssignment
+IfcPresentationStyleSelect
+IfcProduct
+IfcProductRepresentation
+IfcProfileDef
+IfcProject
+IfcRectangleProfileDef
+IfcRelAggregates
+IfcRelContainedInSpatialStructure
+IfcRelFillsElement
+IfcRelVoidsElement
+IfcRepresentation
+IfcRepresentationContext
+IfcRepresentationItem
+IfcRepresentationMap
+IfcRevolvedAreaSolid
+IfcShell
+IfcShellBasedSurfaceModel
+IfcSite
+IfcSIUnit
+IfcSomething
+IfcSpace
+IfcSpatialStructureElement
+IfcSpatialStructureElements
+IfcStyledItem
+IfcSurfaceStyle
+IfcSurfaceStyleElementSelect
+IfcSurfaceStyleRendering
+IfcSurfaceStyleShading
+IfcSurfaceStyleWithTextures
+IfcSweptAreaSolid
+IfcSweptDiskSolid
+IfcTopologicalRepresentationItem
+IfcTrimmedCurve
+IfcUnit
+IfcUnitAssignment
+IfcVector
+IfcIShapeProfileDef
+IfcPropertyListValue
+IfcRelDefinesByProperties
+IfcPropertySet
+IfcPropertySingleValue
+IfcProperty
+IfcComplexProperty
+IfcElementQuantity