StepFile: prepare code gen.
parent
e38629613c
commit
4003309e7a
|
@ -85,16 +85,16 @@ STEP::TypeError::TypeError (const std::string& s,uint64_t entity /* = ENTITY_NOT
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *ISO_Token = "ISO-10303-21;";
|
||||||
|
static const char *FILE_SCHEMA_Token = "FILE_SCHEMA";
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
STEP::DB* STEP::ReadFileHeader(std::shared_ptr<IOStream> stream)
|
STEP::DB* STEP::ReadFileHeader(std::shared_ptr<IOStream> stream) {
|
||||||
{
|
|
||||||
std::shared_ptr<StreamReaderLE> reader = std::shared_ptr<StreamReaderLE>(new StreamReaderLE(stream));
|
std::shared_ptr<StreamReaderLE> reader = std::shared_ptr<StreamReaderLE>(new StreamReaderLE(stream));
|
||||||
std::unique_ptr<STEP::DB> db = std::unique_ptr<STEP::DB>(new STEP::DB(reader));
|
std::unique_ptr<STEP::DB> db = std::unique_ptr<STEP::DB>(new STEP::DB(reader));
|
||||||
|
|
||||||
LineSplitter &splitter = db->GetSplitter();
|
LineSplitter &splitter = db->GetSplitter();
|
||||||
if (!splitter || *splitter != "ISO-10303-21;") {
|
if (!splitter || *splitter != ISO_Token ) {
|
||||||
throw STEP::SyntaxError("expected magic token: ISO-10303-21",1);
|
throw STEP::SyntaxError("expected magic token: " + std::string( ISO_Token ), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderInfo& head = db->GetHeader();
|
HeaderInfo& head = db->GetHeader();
|
||||||
|
@ -109,7 +109,7 @@ STEP::DB* STEP::ReadFileHeader(std::shared_ptr<IOStream> stream)
|
||||||
// want one-based line numbers for human readers, so +1
|
// want one-based line numbers for human readers, so +1
|
||||||
const uint64_t line = splitter.get_index()+1;
|
const uint64_t line = splitter.get_index()+1;
|
||||||
|
|
||||||
if (s.substr(0,11) == "FILE_SCHEMA") {
|
if (s.substr(0,11) == FILE_SCHEMA_Token) {
|
||||||
const char* sz = s.c_str()+11;
|
const char* sz = s.c_str()+11;
|
||||||
SkipSpaces(sz,&sz);
|
SkipSpaces(sz,&sz);
|
||||||
std::shared_ptr< const EXPRESS::DataType > schema = EXPRESS::DataType::Parse(sz);
|
std::shared_ptr< const EXPRESS::DataType > schema = EXPRESS::DataType::Parse(sz);
|
||||||
|
|
|
@ -235,7 +235,7 @@ def work(filename):
|
||||||
if not use_ifc_template:
|
if not use_ifc_template:
|
||||||
entitylist = 'step_entitylist.txt'
|
entitylist = 'step_entitylist.txt'
|
||||||
whitelist = []
|
whitelist = []
|
||||||
with open('entitylist.txt', 'rt') as inp:
|
with open(entitylist, 'rt') as inp:
|
||||||
whitelist = [n.strip() for n in inp.read().split('\n') if n[:1]!='#' and n.strip()]
|
whitelist = [n.strip() for n in inp.read().split('\n') if n[:1]!='#' and n.strip()]
|
||||||
|
|
||||||
schema.whitelist = set()
|
schema.whitelist = set()
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
token = []
|
||||||
|
file = open(sys.argv[1])
|
||||||
|
output = open("step_entitylist.txt", "a")
|
||||||
|
lines = file.readlines()
|
||||||
|
for line in lines:
|
||||||
|
pos = line.find("ENTITY")
|
||||||
|
if pos != -1:
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -8,104 +8,3 @@
|
||||||
# code generator. Also, the names of all used entities need to be present
|
# code generator. Also, the names of all used entities need to be present
|
||||||
# in the source code for this to work.
|
# 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
|
|
||||||
|
|
Loading…
Reference in New Issue