From be7d96c7fa74d9a2cc5c34e6be3ef529cb3e5b33 Mon Sep 17 00:00:00 2001 From: szv Date: Fri, 16 Dec 2016 14:50:53 +0300 Subject: [PATCH] IGES reader fixing --- src/IGESAppli/FILES | 44 - src/IGESAppli/IGESAppli.cxx | 13 +- .../IGESAppli_Array1OfFiniteElement.hxx | 4 +- src/IGESAppli/IGESAppli_Array1OfFlow.hxx | 26 - src/IGESAppli/IGESAppli_Array1OfNode.hxx | 4 +- src/IGESAppli/IGESAppli_DrilledHole.cxx | 70 +- src/IGESAppli/IGESAppli_DrilledHole.hxx | 61 +- src/IGESAppli/IGESAppli_ElementResults.cxx | 327 ++++--- src/IGESAppli/IGESAppli_ElementResults.hxx | 83 +- src/IGESAppli/IGESAppli_FiniteElement.cxx | 73 +- src/IGESAppli/IGESAppli_FiniteElement.hxx | 33 +- src/IGESAppli/IGESAppli_Flow.cxx | 219 +++-- src/IGESAppli/IGESAppli_Flow.hxx | 56 +- src/IGESAppli/IGESAppli_FlowLineSpec.cxx | 64 +- src/IGESAppli/IGESAppli_FlowLineSpec.hxx | 19 +- src/IGESAppli/IGESAppli_GeneralModule.cxx | 199 ----- src/IGESAppli/IGESAppli_GeneralModule.hxx | 10 - .../IGESAppli_HArray1OfFiniteElement.hxx | 2 - src/IGESAppli/IGESAppli_HArray1OfFlow.hxx | 27 - src/IGESAppli/IGESAppli_HArray1OfNode.hxx | 2 - src/IGESAppli/IGESAppli_LevelFunction.cxx | 53 +- src/IGESAppli/IGESAppli_LevelFunction.hxx | 37 +- .../IGESAppli_LevelToPWBLayerMap.cxx | 115 ++- .../IGESAppli_LevelToPWBLayerMap.hxx | 38 +- src/IGESAppli/IGESAppli_LineWidening.cxx | 99 ++- src/IGESAppli/IGESAppli_LineWidening.hxx | 65 +- src/IGESAppli/IGESAppli_NodalConstraint.cxx | 78 +- src/IGESAppli/IGESAppli_NodalConstraint.hxx | 34 +- src/IGESAppli/IGESAppli_NodalDisplAndRot.cxx | 203 ++++- src/IGESAppli/IGESAppli_NodalDisplAndRot.hxx | 38 +- src/IGESAppli/IGESAppli_NodalResults.cxx | 143 ++- src/IGESAppli/IGESAppli_NodalResults.hxx | 59 +- src/IGESAppli/IGESAppli_Node.cxx | 67 +- src/IGESAppli/IGESAppli_Node.hxx | 31 +- src/IGESAppli/IGESAppli_PWBArtworkStackup.cxx | 72 +- src/IGESAppli/IGESAppli_PWBArtworkStackup.hxx | 33 +- src/IGESAppli/IGESAppli_PWBDrilledHole.cxx | 61 +- src/IGESAppli/IGESAppli_PWBDrilledHole.hxx | 42 +- src/IGESAppli/IGESAppli_PartNumber.cxx | 67 +- src/IGESAppli/IGESAppli_PartNumber.hxx | 41 +- src/IGESAppli/IGESAppli_PinNumber.cxx | 58 +- src/IGESAppli/IGESAppli_PinNumber.hxx | 27 +- src/IGESAppli/IGESAppli_PipingFlow.cxx | 194 +++-- src/IGESAppli/IGESAppli_PipingFlow.hxx | 51 +- src/IGESAppli/IGESAppli_ReadWriteModule.cxx | 387 --------- src/IGESAppli/IGESAppli_ReadWriteModule.hxx | 57 -- .../IGESAppli_ReferenceDesignator.cxx | 59 +- .../IGESAppli_ReferenceDesignator.hxx | 29 +- src/IGESAppli/IGESAppli_RegionRestriction.cxx | 68 +- src/IGESAppli/IGESAppli_RegionRestriction.hxx | 44 +- src/IGESAppli/IGESAppli_SpecificModule.cxx | 280 ------ src/IGESAppli/IGESAppli_SpecificModule.hxx | 74 -- src/IGESAppli/IGESAppli_ToolDrilledHole.cxx | 113 --- src/IGESAppli/IGESAppli_ToolDrilledHole.hxx | 68 -- .../IGESAppli_ToolElementResults.cxx | 213 ----- .../IGESAppli_ToolElementResults.hxx | 63 -- src/IGESAppli/IGESAppli_ToolFiniteElement.cxx | 103 --- src/IGESAppli/IGESAppli_ToolFiniteElement.hxx | 63 -- src/IGESAppli/IGESAppli_ToolFlow.cxx | 227 ----- src/IGESAppli/IGESAppli_ToolFlow.hxx | 69 -- src/IGESAppli/IGESAppli_ToolFlowLineSpec.cxx | 89 -- src/IGESAppli/IGESAppli_ToolFlowLineSpec.hxx | 63 -- src/IGESAppli/IGESAppli_ToolLevelFunction.cxx | 102 --- src/IGESAppli/IGESAppli_ToolLevelFunction.hxx | 68 -- .../IGESAppli_ToolLevelToPWBLayerMap.cxx | 145 ---- .../IGESAppli_ToolLevelToPWBLayerMap.hxx | 63 -- src/IGESAppli/IGESAppli_ToolLineWidening.cxx | 135 --- src/IGESAppli/IGESAppli_ToolLineWidening.hxx | 68 -- .../IGESAppli_ToolNodalConstraint.cxx | 105 --- .../IGESAppli_ToolNodalConstraint.hxx | 63 -- .../IGESAppli_ToolNodalDisplAndRot.cxx | 210 ----- .../IGESAppli_ToolNodalDisplAndRot.hxx | 63 -- src/IGESAppli/IGESAppli_ToolNodalResults.cxx | 158 ---- src/IGESAppli/IGESAppli_ToolNodalResults.hxx | 63 -- src/IGESAppli/IGESAppli_ToolNode.cxx | 91 -- src/IGESAppli/IGESAppli_ToolNode.hxx | 63 -- .../IGESAppli_ToolPWBArtworkStackup.cxx | 98 --- .../IGESAppli_ToolPWBArtworkStackup.hxx | 63 -- .../IGESAppli_ToolPWBDrilledHole.cxx | 100 --- .../IGESAppli_ToolPWBDrilledHole.hxx | 68 -- src/IGESAppli/IGESAppli_ToolPartNumber.cxx | 117 --- src/IGESAppli/IGESAppli_ToolPartNumber.hxx | 68 -- src/IGESAppli/IGESAppli_ToolPinNumber.cxx | 93 -- src/IGESAppli/IGESAppli_ToolPinNumber.hxx | 68 -- src/IGESAppli/IGESAppli_ToolPipingFlow.cxx | 216 ----- src/IGESAppli/IGESAppli_ToolPipingFlow.hxx | 68 -- .../IGESAppli_ToolReferenceDesignator.cxx | 97 --- .../IGESAppli_ToolReferenceDesignator.hxx | 68 -- .../IGESAppli_ToolRegionRestriction.cxx | 101 --- .../IGESAppli_ToolRegionRestriction.hxx | 68 -- src/IGESBasic/FILES | 4 - src/IGESBasic/IGESBasic.cxx | 8 - .../IGESBasic_Array1OfLineFontEntity.hxx | 6 +- src/IGESBasic/IGESBasic_GeneralModule.cxx | 178 ---- src/IGESBasic/IGESBasic_GeneralModule.hxx | 10 - .../IGESBasic_HArray1OfLineFontEntity.hxx | 2 - src/IGESBasic/IGESBasic_ReadWriteModule.cxx | 342 -------- src/IGESBasic/IGESBasic_ReadWriteModule.hxx | 52 -- src/IGESBasic/IGESBasic_SpecificModule.cxx | 241 ----- src/IGESBasic/IGESBasic_SpecificModule.hxx | 75 -- .../IGESBasic_ToolAssocGroupType.cxx | 7 +- .../IGESBasic_ToolExternalRefFile.cxx | 4 +- .../IGESBasic_ToolExternalRefFileIndex.cxx | 6 +- .../IGESBasic_ToolExternalRefFileName.cxx | 7 +- .../IGESBasic_ToolExternalRefLibName.cxx | 6 +- .../IGESBasic_ToolExternalRefName.cxx | 4 +- .../IGESBasic_ToolExternalReferenceFile.cxx | 2 +- src/IGESBasic/IGESBasic_ToolGroup.cxx | 17 +- .../IGESBasic_ToolGroupWithoutBackP.cxx | 16 +- src/IGESBasic/IGESBasic_ToolHierarchy.cxx | 16 +- src/IGESBasic/IGESBasic_ToolName.cxx | 5 +- src/IGESBasic/IGESBasic_ToolOrderedGroup.cxx | 14 +- ...IGESBasic_ToolOrderedGroupWithoutBackP.cxx | 14 +- src/IGESBasic/IGESBasic_ToolSingleParent.cxx | 14 +- .../IGESBasic_ToolSingularSubfigure.cxx | 19 +- src/IGESBasic/IGESBasic_ToolSubfigureDef.cxx | 9 +- src/IGESCAFControl/IGESCAFControl_Writer.cxx | 15 +- src/IGESControl/IGESControl_Controller.cxx | 26 +- src/IGESControl/IGESControl_Writer.cxx | 94 +- src/IGESControl/IGESControl_Writer.hxx | 2 - src/IGESData/FILES | 21 - src/IGESData/IGESData.cxx | 3 - src/IGESData/IGESData_Array1OfIGESEntity.hxx | 4 +- src/IGESData/IGESData_DefaultGeneral.cxx | 31 - src/IGESData/IGESData_DefaultGeneral.hxx | 11 - src/IGESData/IGESData_DefaultSpecific.cxx | 60 -- src/IGESData/IGESData_DefaultSpecific.hxx | 71 -- src/IGESData/IGESData_DirChecker.cxx | 264 +----- src/IGESData/IGESData_DirChecker.hxx | 133 +-- src/IGESData/IGESData_DirPart.cxx | 8 +- src/IGESData/IGESData_DirPart.hxx | 28 +- src/IGESData/IGESData_GeneralModule.cxx | 58 +- src/IGESData/IGESData_GeneralModule.hxx | 42 +- .../IGESData_GlobalNodeOfSpecificLib.hxx | 86 -- .../IGESData_GlobalNodeOfSpecificLib_0.cxx | 40 - .../IGESData_GlobalNodeOfWriterLib.hxx | 86 -- .../IGESData_GlobalNodeOfWriterLib_0.cxx | 40 - src/IGESData/IGESData_GlobalSection.cxx | 393 +-------- src/IGESData/IGESData_GlobalSection.hxx | 227 +++-- src/IGESData/IGESData_HArray1OfIGESEntity.hxx | 2 - src/IGESData/IGESData_IGESDumper.cxx | 43 +- src/IGESData/IGESData_IGESDumper.hxx | 37 +- src/IGESData/IGESData_IGESEntity.cxx | 695 +++++++++++---- src/IGESData/IGESData_IGESEntity.hxx | 145 ++-- src/IGESData/IGESData_IGESModel.cxx | 177 +--- src/IGESData/IGESData_IGESModel.hxx | 96 +- src/IGESData/IGESData_IGESReaderData.cxx | 709 ++++++++++++--- src/IGESData/IGESData_IGESReaderData.hxx | 116 +-- src/IGESData/IGESData_IGESReaderTool.cxx | 580 +++++-------- src/IGESData/IGESData_IGESReaderTool.hxx | 87 +- src/IGESData/IGESData_IGESType.cxx | 30 - src/IGESData/IGESData_IGESType.hxx | 48 +- src/IGESData/IGESData_IGESWriter.cxx | 69 +- src/IGESData/IGESData_IGESWriter.hxx | 3 +- src/IGESData/IGESData_NodeOfSpecificLib.hxx | 83 -- src/IGESData/IGESData_NodeOfSpecificLib_0.cxx | 40 - src/IGESData/IGESData_NodeOfWriterLib.hxx | 83 -- src/IGESData/IGESData_NodeOfWriterLib_0.cxx | 40 - src/IGESData/IGESData_ParamCursor.cxx | 57 -- src/IGESData/IGESData_ParamCursor.hxx | 101 +-- src/IGESData/IGESData_ParamCursor.lxx | 35 - src/IGESData/IGESData_ParamReader.cxx | 563 +++--------- src/IGESData/IGESData_ParamReader.hxx | 138 ++- src/IGESData/IGESData_Protocol.cxx | 371 +++++++- src/IGESData/IGESData_Protocol.hxx | 10 +- src/IGESData/IGESData_ReadWriteModule.cxx | 43 - src/IGESData/IGESData_ReadWriteModule.hxx | 88 -- src/IGESData/IGESData_SpecificLib.hxx | 115 --- src/IGESData/IGESData_SpecificLib_0.cxx | 39 - src/IGESData/IGESData_SpecificModule.cxx | 25 - src/IGESData/IGESData_SpecificModule.hxx | 67 -- src/IGESData/IGESData_ToolLocation.cxx | 32 +- src/IGESData/IGESData_ToolLocation.hxx | 26 +- src/IGESData/IGESData_UndefinedEntity.cxx | 124 +-- src/IGESData/IGESData_UndefinedEntity.hxx | 45 +- src/IGESData/IGESData_WriterLib.hxx | 115 --- src/IGESData/IGESData_WriterLib_0.cxx | 39 - src/IGESDefs/FILES | 18 - src/IGESDefs/IGESDefs.cxx | 8 - src/IGESDefs/IGESDefs_Array1OfTabularData.hxx | 4 +- src/IGESDefs/IGESDefs_AssociativityDef.cxx | 153 +++- src/IGESDefs/IGESDefs_AssociativityDef.hxx | 73 +- src/IGESDefs/IGESDefs_AttributeDef.cxx | 371 +++++--- src/IGESDefs/IGESDefs_AttributeDef.hxx | 76 +- src/IGESDefs/IGESDefs_AttributeTable.cxx | 282 ++++-- src/IGESDefs/IGESDefs_AttributeTable.hxx | 53 +- src/IGESDefs/IGESDefs_GeneralModule.cxx | 138 --- src/IGESDefs/IGESDefs_GeneralModule.hxx | 15 - src/IGESDefs/IGESDefs_GenericData.cxx | 227 +++-- src/IGESDefs/IGESDefs_GenericData.hxx | 69 +- .../IGESDefs_HArray1OfTabularData.hxx | 2 - src/IGESDefs/IGESDefs_MacroDef.cxx | 96 +- src/IGESDefs/IGESDefs_MacroDef.hxx | 61 +- src/IGESDefs/IGESDefs_ReadWriteModule.cxx | 178 ---- src/IGESDefs/IGESDefs_ReadWriteModule.hxx | 52 -- src/IGESDefs/IGESDefs_SpecificModule.cxx | 101 --- src/IGESDefs/IGESDefs_SpecificModule.hxx | 69 -- src/IGESDefs/IGESDefs_TabularData.cxx | 195 +++-- src/IGESDefs/IGESDefs_TabularData.hxx | 77 +- .../IGESDefs_ToolAssociativityDef.cxx | 162 ---- .../IGESDefs_ToolAssociativityDef.hxx | 63 -- src/IGESDefs/IGESDefs_ToolAttributeDef.cxx | 402 --------- src/IGESDefs/IGESDefs_ToolAttributeDef.hxx | 70 -- src/IGESDefs/IGESDefs_ToolAttributeTable.cxx | 270 ------ src/IGESDefs/IGESDefs_ToolAttributeTable.hxx | 70 -- src/IGESDefs/IGESDefs_ToolGenericData.cxx | 234 ----- src/IGESDefs/IGESDefs_ToolGenericData.hxx | 70 -- src/IGESDefs/IGESDefs_ToolMacroDef.cxx | 121 --- src/IGESDefs/IGESDefs_ToolMacroDef.hxx | 63 -- src/IGESDefs/IGESDefs_ToolTabularData.cxx | 203 ----- src/IGESDefs/IGESDefs_ToolTabularData.hxx | 63 -- src/IGESDefs/IGESDefs_ToolUnitsData.cxx | 139 --- src/IGESDefs/IGESDefs_ToolUnitsData.hxx | 63 -- src/IGESDefs/IGESDefs_UnitsData.cxx | 112 ++- src/IGESDefs/IGESDefs_UnitsData.hxx | 44 +- src/IGESDimen/FILES | 4 - src/IGESDimen/IGESDimen.cxx | 8 - .../IGESDimen_Array1OfGeneralNote.hxx | 4 +- .../IGESDimen_Array1OfLeaderArrow.hxx | 6 +- src/IGESDimen/IGESDimen_GeneralModule.cxx | 272 ------ src/IGESDimen/IGESDimen_GeneralModule.hxx | 10 - .../IGESDimen_HArray1OfGeneralNote.hxx | 2 - .../IGESDimen_HArray1OfLeaderArrow.hxx | 2 - src/IGESDimen/IGESDimen_RadiusDimension.cxx | 3 +- src/IGESDimen/IGESDimen_ReadWriteModule.cxx | 462 ---------- src/IGESDimen/IGESDimen_ReadWriteModule.hxx | 79 -- src/IGESDimen/IGESDimen_SpecificModule.cxx | 310 ------- src/IGESDimen/IGESDimen_SpecificModule.hxx | 77 -- .../IGESDimen_ToolAngularDimension.cxx | 25 +- .../IGESDimen_ToolBasicDimension.cxx | 11 +- src/IGESDimen/IGESDimen_ToolCenterLine.cxx | 13 +- .../IGESDimen_ToolCurveDimension.cxx | 26 +- .../IGESDimen_ToolDiameterDimension.cxx | 14 +- .../IGESDimen_ToolDimensionDisplayData.cxx | 38 +- .../IGESDimen_ToolDimensionTolerance.cxx | 22 +- .../IGESDimen_ToolDimensionUnits.cxx | 16 +- .../IGESDimen_ToolDimensionedGeometry.cxx | 24 +- src/IGESDimen/IGESDimen_ToolFlagNote.cxx | 15 +- src/IGESDimen/IGESDimen_ToolGeneralLabel.cxx | 11 +- src/IGESDimen/IGESDimen_ToolGeneralNote.cxx | 33 +- src/IGESDimen/IGESDimen_ToolGeneralSymbol.cxx | 22 +- src/IGESDimen/IGESDimen_ToolLeaderArrow.cxx | 18 +- .../IGESDimen_ToolLinearDimension.cxx | 22 +- .../IGESDimen_ToolNewDimensionedGeometry.cxx | 24 +- .../IGESDimen_ToolNewGeneralNote.cxx | 72 +- .../IGESDimen_ToolOrdinateDimension.cxx | 11 +- .../IGESDimen_ToolPointDimension.cxx | 10 +- .../IGESDimen_ToolRadiusDimension.cxx | 15 +- src/IGESDimen/IGESDimen_ToolSection.cxx | 12 +- src/IGESDimen/IGESDimen_ToolSectionedArea.cxx | 26 +- src/IGESDimen/IGESDimen_ToolWitnessLine.cxx | 12 +- src/IGESDraw/FILES | 28 - src/IGESDraw/IGESDraw.cxx | 8 - .../IGESDraw_Array1OfConnectPoint.hxx | 4 +- .../IGESDraw_Array1OfViewKindEntity.hxx | 6 +- src/IGESDraw/IGESDraw_CircArraySubfigure.cxx | 174 ++-- src/IGESDraw/IGESDraw_CircArraySubfigure.hxx | 112 +-- src/IGESDraw/IGESDraw_ConnectPoint.cxx | 235 ++--- src/IGESDraw/IGESDraw_ConnectPoint.hxx | 127 ++- src/IGESDraw/IGESDraw_Drawing.cxx | 192 +++- src/IGESDraw/IGESDraw_Drawing.hxx | 58 +- src/IGESDraw/IGESDraw_DrawingWithRotation.cxx | 200 +++-- src/IGESDraw/IGESDraw_DrawingWithRotation.hxx | 59 +- src/IGESDraw/IGESDraw_GeneralModule.cxx | 304 ------- src/IGESDraw/IGESDraw_GeneralModule.hxx | 14 - .../IGESDraw_HArray1OfConnectPoint.hxx | 2 - .../IGESDraw_HArray1OfViewKindEntity.hxx | 2 - src/IGESDraw/IGESDraw_LabelDisplay.cxx | 162 +++- src/IGESDraw/IGESDraw_LabelDisplay.hxx | 59 +- src/IGESDraw/IGESDraw_NetworkSubfigure.cxx | 158 ++-- src/IGESDraw/IGESDraw_NetworkSubfigure.hxx | 90 +- src/IGESDraw/IGESDraw_NetworkSubfigureDef.cxx | 162 ++-- src/IGESDraw/IGESDraw_NetworkSubfigureDef.hxx | 86 +- src/IGESDraw/IGESDraw_PerspectiveView.cxx | 213 +++-- src/IGESDraw/IGESDraw_PerspectiveView.hxx | 96 +- src/IGESDraw/IGESDraw_Planar.cxx | 100 ++- src/IGESDraw/IGESDraw_Planar.hxx | 65 +- src/IGESDraw/IGESDraw_ReadWriteModule.cxx | 303 ------- src/IGESDraw/IGESDraw_ReadWriteModule.hxx | 79 -- src/IGESDraw/IGESDraw_RectArraySubfigure.cxx | 186 ++-- src/IGESDraw/IGESDraw_RectArraySubfigure.hxx | 97 +-- .../IGESDraw_SegmentedViewsVisible.cxx | 237 +++-- .../IGESDraw_SegmentedViewsVisible.hxx | 59 +- src/IGESDraw/IGESDraw_SpecificModule.cxx | 205 ----- src/IGESDraw/IGESDraw_SpecificModule.hxx | 75 -- .../IGESDraw_ToolCircArraySubfigure.cxx | 144 --- .../IGESDraw_ToolCircArraySubfigure.hxx | 63 -- src/IGESDraw/IGESDraw_ToolConnectPoint.cxx | 202 ----- src/IGESDraw/IGESDraw_ToolConnectPoint.hxx | 70 -- src/IGESDraw/IGESDraw_ToolDrawing.cxx | 257 ------ src/IGESDraw/IGESDraw_ToolDrawing.hxx | 75 -- .../IGESDraw_ToolDrawingWithRotation.cxx | 269 ------ .../IGESDraw_ToolDrawingWithRotation.hxx | 75 -- src/IGESDraw/IGESDraw_ToolLabelDisplay.cxx | 192 ---- src/IGESDraw/IGESDraw_ToolLabelDisplay.hxx | 67 -- .../IGESDraw_ToolNetworkSubfigure.cxx | 208 ----- .../IGESDraw_ToolNetworkSubfigure.hxx | 70 -- .../IGESDraw_ToolNetworkSubfigureDef.cxx | 197 ----- .../IGESDraw_ToolNetworkSubfigureDef.hxx | 70 -- src/IGESDraw/IGESDraw_ToolPerspectiveView.cxx | 180 ---- src/IGESDraw/IGESDraw_ToolPerspectiveView.hxx | 66 -- src/IGESDraw/IGESDraw_ToolPlanar.cxx | 160 ---- src/IGESDraw/IGESDraw_ToolPlanar.hxx | 75 -- .../IGESDraw_ToolRectArraySubfigure.cxx | 163 ---- .../IGESDraw_ToolRectArraySubfigure.hxx | 67 -- .../IGESDraw_ToolSegmentedViewsVisible.cxx | 257 ------ .../IGESDraw_ToolSegmentedViewsVisible.hxx | 67 -- src/IGESDraw/IGESDraw_ToolView.cxx | 150 ---- src/IGESDraw/IGESDraw_ToolView.hxx | 70 -- src/IGESDraw/IGESDraw_ToolViewsVisible.cxx | 35 +- src/IGESDraw/IGESDraw_ToolViewsVisible.hxx | 4 - .../IGESDraw_ToolViewsVisibleWithAttr.cxx | 43 +- .../IGESDraw_ToolViewsVisibleWithAttr.hxx | 4 - src/IGESDraw/IGESDraw_View.cxx | 164 ++-- src/IGESDraw/IGESDraw_View.hxx | 128 ++- src/IGESFile/FILES | 4 +- src/IGESFile/IGESFile_Buffer.cxx | 76 ++ src/IGESFile/IGESFile_Buffer.hxx | 59 ++ src/IGESFile/IGESFile_Read.cxx | 280 ------ src/IGESFile/IGESFile_Read.hxx | 29 - src/IGESFile/IGESFile_Reader.cxx | 820 ++++++++++++++++++ src/IGESFile/IGESFile_Reader.hxx | 127 +++ src/IGESFile/analiges.c | 80 -- src/IGESFile/igesread.c | 130 --- src/IGESFile/igesread.h | 2 - src/IGESFile/liriges.c | 73 +- src/IGESFile/structiges.c | 9 +- src/IGESGeom/FILES | 4 - src/IGESGeom/IGESGeom.cxx | 8 - src/IGESGeom/IGESGeom_GeneralModule.cxx | 249 ------ src/IGESGeom/IGESGeom_GeneralModule.hxx | 10 - src/IGESGeom/IGESGeom_ReadWriteModule.cxx | 451 ---------- src/IGESGeom/IGESGeom_ReadWriteModule.hxx | 79 -- src/IGESGeom/IGESGeom_SpecificModule.cxx | 287 ------ src/IGESGeom/IGESGeom_SpecificModule.hxx | 53 -- src/IGESGeom/IGESGeom_ToolBSplineCurve.cxx | 87 +- src/IGESGeom/IGESGeom_ToolBSplineSurface.cxx | 79 +- src/IGESGeom/IGESGeom_ToolBoundary.cxx | 57 +- src/IGESGeom/IGESGeom_ToolBoundedSurface.cxx | 22 +- src/IGESGeom/IGESGeom_ToolCircularArc.cxx | 25 +- src/IGESGeom/IGESGeom_ToolCompositeCurve.cxx | 13 +- src/IGESGeom/IGESGeom_ToolConicArc.cxx | 38 +- src/IGESGeom/IGESGeom_ToolCopiousData.cxx | 17 +- src/IGESGeom/IGESGeom_ToolCurveOnSurface.cxx | 23 +- src/IGESGeom/IGESGeom_ToolDirection.cxx | 7 +- src/IGESGeom/IGESGeom_ToolFlash.cxx | 11 +- src/IGESGeom/IGESGeom_ToolLine.cxx | 16 +- src/IGESGeom/IGESGeom_ToolOffsetCurve.cxx | 64 +- src/IGESGeom/IGESGeom_ToolOffsetSurface.cxx | 27 +- src/IGESGeom/IGESGeom_ToolPlane.cxx | 37 +- src/IGESGeom/IGESGeom_ToolPoint.cxx | 17 +- src/IGESGeom/IGESGeom_ToolRuledSurface.cxx | 17 +- src/IGESGeom/IGESGeom_ToolSplineCurve.cxx | 30 +- src/IGESGeom/IGESGeom_ToolSplineSurface.cxx | 31 +- .../IGESGeom_ToolSurfaceOfRevolution.cxx | 17 +- .../IGESGeom_ToolTabulatedCylinder.cxx | 14 +- .../IGESGeom_ToolTransformationMatrix.cxx | 14 +- src/IGESGeom/IGESGeom_ToolTrimmedSurface.cxx | 24 +- src/IGESGraph/FILES | 32 - src/IGESGraph/IGESGraph.cxx | 8 - src/IGESGraph/IGESGraph_Array1OfColor.hxx | 6 +- .../IGESGraph_Array1OfTextDisplayTemplate.hxx | 4 +- src/IGESGraph/IGESGraph_Color.cxx | 87 +- src/IGESGraph/IGESGraph_Color.hxx | 81 +- src/IGESGraph/IGESGraph_DefinitionLevel.cxx | 67 +- src/IGESGraph/IGESGraph_DefinitionLevel.hxx | 46 +- src/IGESGraph/IGESGraph_DrawingSize.cxx | 56 +- src/IGESGraph/IGESGraph_DrawingSize.hxx | 65 +- src/IGESGraph/IGESGraph_DrawingUnits.cxx | 145 +++- src/IGESGraph/IGESGraph_DrawingUnits.hxx | 66 +- src/IGESGraph/IGESGraph_GeneralModule.cxx | 264 ------ src/IGESGraph/IGESGraph_GeneralModule.hxx | 15 - src/IGESGraph/IGESGraph_HArray1OfColor.hxx | 2 - ...IGESGraph_HArray1OfTextDisplayTemplate.hxx | 2 - src/IGESGraph/IGESGraph_HighLight.cxx | 51 +- src/IGESGraph/IGESGraph_HighLight.hxx | 51 +- .../IGESGraph_IntercharacterSpacing.cxx | 52 +- .../IGESGraph_IntercharacterSpacing.hxx | 57 +- .../IGESGraph_LineFontDefPattern.cxx | 120 ++- .../IGESGraph_LineFontDefPattern.hxx | 57 +- .../IGESGraph_LineFontDefTemplate.cxx | 71 +- .../IGESGraph_LineFontDefTemplate.hxx | 75 +- .../IGESGraph_LineFontPredefined.cxx | 47 +- .../IGESGraph_LineFontPredefined.hxx | 54 +- src/IGESGraph/IGESGraph_NominalSize.cxx | 78 +- src/IGESGraph/IGESGraph_NominalSize.hxx | 76 +- src/IGESGraph/IGESGraph_Pick.cxx | 54 +- src/IGESGraph/IGESGraph_Pick.hxx | 58 +- src/IGESGraph/IGESGraph_ReadWriteModule.cxx | 304 ------- src/IGESGraph/IGESGraph_ReadWriteModule.hxx | 79 -- src/IGESGraph/IGESGraph_SpecificModule.cxx | 223 ----- src/IGESGraph/IGESGraph_SpecificModule.hxx | 76 -- .../IGESGraph_TextDisplayTemplate.cxx | 156 ++-- .../IGESGraph_TextDisplayTemplate.hxx | 137 ++- src/IGESGraph/IGESGraph_TextFontDef.cxx | 272 ++++-- src/IGESGraph/IGESGraph_TextFontDef.hxx | 119 +-- src/IGESGraph/IGESGraph_ToolColor.cxx | 102 --- src/IGESGraph/IGESGraph_ToolColor.hxx | 63 -- .../IGESGraph_ToolDefinitionLevel.cxx | 93 -- .../IGESGraph_ToolDefinitionLevel.hxx | 63 -- src/IGESGraph/IGESGraph_ToolDrawingSize.cxx | 107 --- src/IGESGraph/IGESGraph_ToolDrawingSize.hxx | 71 -- src/IGESGraph/IGESGraph_ToolDrawingUnits.cxx | 169 ---- src/IGESGraph/IGESGraph_ToolDrawingUnits.hxx | 71 -- src/IGESGraph/IGESGraph_ToolHighLight.cxx | 102 --- src/IGESGraph/IGESGraph_ToolHighLight.hxx | 71 -- .../IGESGraph_ToolIntercharacterSpacing.cxx | 103 --- .../IGESGraph_ToolIntercharacterSpacing.hxx | 71 -- .../IGESGraph_ToolLineFontDefPattern.cxx | 126 --- .../IGESGraph_ToolLineFontDefPattern.hxx | 66 -- .../IGESGraph_ToolLineFontDefTemplate.cxx | 118 --- .../IGESGraph_ToolLineFontDefTemplate.hxx | 70 -- .../IGESGraph_ToolLineFontPredefined.cxx | 101 --- .../IGESGraph_ToolLineFontPredefined.hxx | 71 -- src/IGESGraph/IGESGraph_ToolNominalSize.cxx | 133 --- src/IGESGraph/IGESGraph_ToolNominalSize.hxx | 71 -- src/IGESGraph/IGESGraph_ToolPick.cxx | 105 --- src/IGESGraph/IGESGraph_ToolPick.hxx | 71 -- .../IGESGraph_ToolTextDisplayTemplate.cxx | 169 ---- .../IGESGraph_ToolTextDisplayTemplate.hxx | 67 -- src/IGESGraph/IGESGraph_ToolTextFontDef.cxx | 265 ------ src/IGESGraph/IGESGraph_ToolTextFontDef.hxx | 67 -- .../IGESGraph_ToolUniformRectGrid.cxx | 158 ---- .../IGESGraph_ToolUniformRectGrid.hxx | 71 -- src/IGESGraph/IGESGraph_UniformRectGrid.cxx | 107 ++- src/IGESGraph/IGESGraph_UniformRectGrid.hxx | 80 +- src/IGESSolid/FILES | 4 - src/IGESSolid/IGESSolid.cxx | 8 - src/IGESSolid/IGESSolid_GeneralModule.cxx | 313 ------- src/IGESSolid/IGESSolid_GeneralModule.hxx | 10 - src/IGESSolid/IGESSolid_ReadWriteModule.cxx | 467 ---------- src/IGESSolid/IGESSolid_ReadWriteModule.hxx | 79 -- src/IGESSolid/IGESSolid_SpecificModule.cxx | 254 ------ src/IGESSolid/IGESSolid_SpecificModule.hxx | 69 -- src/IGESSolid/IGESSolid_ToolBlock.cxx | 30 +- src/IGESSolid/IGESSolid_ToolBooleanTree.cxx | 13 +- src/IGESSolid/IGESSolid_ToolConeFrustum.cxx | 26 +- .../IGESSolid_ToolConicalSurface.cxx | 17 +- src/IGESSolid/IGESSolid_ToolCylinder.cxx | 24 +- .../IGESSolid_ToolCylindricalSurface.cxx | 14 +- src/IGESSolid/IGESSolid_ToolEdgeList.cxx | 31 +- src/IGESSolid/IGESSolid_ToolEllipsoid.cxx | 30 +- src/IGESSolid/IGESSolid_ToolFace.cxx | 17 +- src/IGESSolid/IGESSolid_ToolLoop.cxx | 35 +- src/IGESSolid/IGESSolid_ToolManifoldSolid.cxx | 23 +- src/IGESSolid/IGESSolid_ToolPlaneSurface.cxx | 19 +- .../IGESSolid_ToolRightAngularWedge.cxx | 33 +- .../IGESSolid_ToolSelectedComponent.cxx | 7 +- src/IGESSolid/IGESSolid_ToolShell.cxx | 19 +- src/IGESSolid/IGESSolid_ToolSolidAssembly.cxx | 13 +- src/IGESSolid/IGESSolid_ToolSolidInstance.cxx | 3 +- .../IGESSolid_ToolSolidOfLinearExtrusion.cxx | 15 +- .../IGESSolid_ToolSolidOfRevolution.cxx | 23 +- src/IGESSolid/IGESSolid_ToolSphere.cxx | 12 +- .../IGESSolid_ToolSphericalSurface.cxx | 15 +- .../IGESSolid_ToolToroidalSurface.cxx | 16 +- src/IGESSolid/IGESSolid_ToolTorus.cxx | 23 +- src/IGESSolid/IGESSolid_ToolVertexList.cxx | 23 +- src/IGESToBRep/IGESToBRep_Reader.cxx | 14 +- src/Interface/Interface_FileReaderData.cxx | 48 +- src/Interface/Interface_FileReaderData.hxx | 49 +- src/Interface/Interface_FileReaderTool.cxx | 330 +++---- src/Interface/Interface_FileReaderTool.hxx | 57 +- src/Interface/Interface_Pointer.hxx | 65 ++ src/StepData/StepData_StepReaderTool.cxx | 11 +- src/StepData/StepData_StepReaderTool.hxx | 6 +- src/StepFile/StepFile_Read.cxx | 7 - 467 files changed, 10523 insertions(+), 30966 deletions(-) delete mode 100644 src/IGESAppli/IGESAppli_Array1OfFlow.hxx delete mode 100644 src/IGESAppli/IGESAppli_HArray1OfFlow.hxx delete mode 100644 src/IGESAppli/IGESAppli_ReadWriteModule.cxx delete mode 100644 src/IGESAppli/IGESAppli_ReadWriteModule.hxx delete mode 100644 src/IGESAppli/IGESAppli_SpecificModule.cxx delete mode 100644 src/IGESAppli/IGESAppli_SpecificModule.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolDrilledHole.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolDrilledHole.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolElementResults.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolElementResults.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolFiniteElement.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolFiniteElement.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolFlow.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolFlow.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolFlowLineSpec.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolFlowLineSpec.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolLevelFunction.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolLevelFunction.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolLevelToPWBLayerMap.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolLevelToPWBLayerMap.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolLineWidening.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolLineWidening.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolNodalConstraint.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolNodalConstraint.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolNodalDisplAndRot.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolNodalDisplAndRot.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolNodalResults.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolNodalResults.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolNode.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolNode.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolPWBArtworkStackup.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolPWBArtworkStackup.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolPWBDrilledHole.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolPWBDrilledHole.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolPartNumber.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolPartNumber.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolPinNumber.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolPinNumber.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolPipingFlow.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolPipingFlow.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolReferenceDesignator.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolReferenceDesignator.hxx delete mode 100644 src/IGESAppli/IGESAppli_ToolRegionRestriction.cxx delete mode 100644 src/IGESAppli/IGESAppli_ToolRegionRestriction.hxx delete mode 100644 src/IGESBasic/IGESBasic_ReadWriteModule.cxx delete mode 100644 src/IGESBasic/IGESBasic_ReadWriteModule.hxx delete mode 100644 src/IGESBasic/IGESBasic_SpecificModule.cxx delete mode 100644 src/IGESBasic/IGESBasic_SpecificModule.hxx delete mode 100644 src/IGESData/IGESData_DefaultSpecific.cxx delete mode 100644 src/IGESData/IGESData_DefaultSpecific.hxx delete mode 100644 src/IGESData/IGESData_GlobalNodeOfSpecificLib.hxx delete mode 100644 src/IGESData/IGESData_GlobalNodeOfSpecificLib_0.cxx delete mode 100644 src/IGESData/IGESData_GlobalNodeOfWriterLib.hxx delete mode 100644 src/IGESData/IGESData_GlobalNodeOfWriterLib_0.cxx delete mode 100644 src/IGESData/IGESData_IGESType.cxx delete mode 100644 src/IGESData/IGESData_NodeOfSpecificLib.hxx delete mode 100644 src/IGESData/IGESData_NodeOfSpecificLib_0.cxx delete mode 100644 src/IGESData/IGESData_NodeOfWriterLib.hxx delete mode 100644 src/IGESData/IGESData_NodeOfWriterLib_0.cxx delete mode 100644 src/IGESData/IGESData_ParamCursor.cxx delete mode 100644 src/IGESData/IGESData_ParamCursor.lxx delete mode 100644 src/IGESData/IGESData_ReadWriteModule.cxx delete mode 100644 src/IGESData/IGESData_ReadWriteModule.hxx delete mode 100644 src/IGESData/IGESData_SpecificLib.hxx delete mode 100644 src/IGESData/IGESData_SpecificLib_0.cxx delete mode 100644 src/IGESData/IGESData_SpecificModule.cxx delete mode 100644 src/IGESData/IGESData_SpecificModule.hxx delete mode 100644 src/IGESData/IGESData_WriterLib.hxx delete mode 100644 src/IGESData/IGESData_WriterLib_0.cxx delete mode 100644 src/IGESDefs/IGESDefs_ReadWriteModule.cxx delete mode 100644 src/IGESDefs/IGESDefs_ReadWriteModule.hxx delete mode 100644 src/IGESDefs/IGESDefs_SpecificModule.cxx delete mode 100644 src/IGESDefs/IGESDefs_SpecificModule.hxx delete mode 100644 src/IGESDefs/IGESDefs_ToolAssociativityDef.cxx delete mode 100644 src/IGESDefs/IGESDefs_ToolAssociativityDef.hxx delete mode 100644 src/IGESDefs/IGESDefs_ToolAttributeDef.cxx delete mode 100644 src/IGESDefs/IGESDefs_ToolAttributeDef.hxx delete mode 100644 src/IGESDefs/IGESDefs_ToolAttributeTable.cxx delete mode 100644 src/IGESDefs/IGESDefs_ToolAttributeTable.hxx delete mode 100644 src/IGESDefs/IGESDefs_ToolGenericData.cxx delete mode 100644 src/IGESDefs/IGESDefs_ToolGenericData.hxx delete mode 100644 src/IGESDefs/IGESDefs_ToolMacroDef.cxx delete mode 100644 src/IGESDefs/IGESDefs_ToolMacroDef.hxx delete mode 100644 src/IGESDefs/IGESDefs_ToolTabularData.cxx delete mode 100644 src/IGESDefs/IGESDefs_ToolTabularData.hxx delete mode 100644 src/IGESDefs/IGESDefs_ToolUnitsData.cxx delete mode 100644 src/IGESDefs/IGESDefs_ToolUnitsData.hxx delete mode 100644 src/IGESDimen/IGESDimen_ReadWriteModule.cxx delete mode 100644 src/IGESDimen/IGESDimen_ReadWriteModule.hxx delete mode 100644 src/IGESDimen/IGESDimen_SpecificModule.cxx delete mode 100644 src/IGESDimen/IGESDimen_SpecificModule.hxx delete mode 100644 src/IGESDraw/IGESDraw_ReadWriteModule.cxx delete mode 100644 src/IGESDraw/IGESDraw_ReadWriteModule.hxx delete mode 100644 src/IGESDraw/IGESDraw_SpecificModule.cxx delete mode 100644 src/IGESDraw/IGESDraw_SpecificModule.hxx delete mode 100644 src/IGESDraw/IGESDraw_ToolCircArraySubfigure.cxx delete mode 100644 src/IGESDraw/IGESDraw_ToolCircArraySubfigure.hxx delete mode 100644 src/IGESDraw/IGESDraw_ToolConnectPoint.cxx delete mode 100644 src/IGESDraw/IGESDraw_ToolConnectPoint.hxx delete mode 100644 src/IGESDraw/IGESDraw_ToolDrawing.cxx delete mode 100644 src/IGESDraw/IGESDraw_ToolDrawing.hxx delete mode 100644 src/IGESDraw/IGESDraw_ToolDrawingWithRotation.cxx delete mode 100644 src/IGESDraw/IGESDraw_ToolDrawingWithRotation.hxx delete mode 100644 src/IGESDraw/IGESDraw_ToolLabelDisplay.cxx delete mode 100644 src/IGESDraw/IGESDraw_ToolLabelDisplay.hxx delete mode 100644 src/IGESDraw/IGESDraw_ToolNetworkSubfigure.cxx delete mode 100644 src/IGESDraw/IGESDraw_ToolNetworkSubfigure.hxx delete mode 100644 src/IGESDraw/IGESDraw_ToolNetworkSubfigureDef.cxx delete mode 100644 src/IGESDraw/IGESDraw_ToolNetworkSubfigureDef.hxx delete mode 100644 src/IGESDraw/IGESDraw_ToolPerspectiveView.cxx delete mode 100644 src/IGESDraw/IGESDraw_ToolPerspectiveView.hxx delete mode 100644 src/IGESDraw/IGESDraw_ToolPlanar.cxx delete mode 100644 src/IGESDraw/IGESDraw_ToolPlanar.hxx delete mode 100644 src/IGESDraw/IGESDraw_ToolRectArraySubfigure.cxx delete mode 100644 src/IGESDraw/IGESDraw_ToolRectArraySubfigure.hxx delete mode 100644 src/IGESDraw/IGESDraw_ToolSegmentedViewsVisible.cxx delete mode 100644 src/IGESDraw/IGESDraw_ToolSegmentedViewsVisible.hxx delete mode 100644 src/IGESDraw/IGESDraw_ToolView.cxx delete mode 100644 src/IGESDraw/IGESDraw_ToolView.hxx create mode 100644 src/IGESFile/IGESFile_Buffer.cxx create mode 100644 src/IGESFile/IGESFile_Buffer.hxx delete mode 100644 src/IGESFile/IGESFile_Read.cxx delete mode 100644 src/IGESFile/IGESFile_Read.hxx create mode 100644 src/IGESFile/IGESFile_Reader.cxx create mode 100644 src/IGESFile/IGESFile_Reader.hxx delete mode 100644 src/IGESFile/igesread.c delete mode 100644 src/IGESGeom/IGESGeom_ReadWriteModule.cxx delete mode 100644 src/IGESGeom/IGESGeom_ReadWriteModule.hxx delete mode 100644 src/IGESGeom/IGESGeom_SpecificModule.cxx delete mode 100644 src/IGESGeom/IGESGeom_SpecificModule.hxx delete mode 100644 src/IGESGraph/IGESGraph_ReadWriteModule.cxx delete mode 100644 src/IGESGraph/IGESGraph_ReadWriteModule.hxx delete mode 100644 src/IGESGraph/IGESGraph_SpecificModule.cxx delete mode 100644 src/IGESGraph/IGESGraph_SpecificModule.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolColor.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolColor.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolDefinitionLevel.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolDefinitionLevel.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolDrawingSize.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolDrawingSize.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolDrawingUnits.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolDrawingUnits.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolHighLight.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolHighLight.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolIntercharacterSpacing.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolIntercharacterSpacing.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolLineFontDefPattern.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolLineFontDefPattern.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolLineFontDefTemplate.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolLineFontDefTemplate.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolLineFontPredefined.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolLineFontPredefined.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolNominalSize.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolNominalSize.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolPick.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolPick.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolTextDisplayTemplate.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolTextDisplayTemplate.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolTextFontDef.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolTextFontDef.hxx delete mode 100644 src/IGESGraph/IGESGraph_ToolUniformRectGrid.cxx delete mode 100644 src/IGESGraph/IGESGraph_ToolUniformRectGrid.hxx delete mode 100644 src/IGESSolid/IGESSolid_ReadWriteModule.cxx delete mode 100644 src/IGESSolid/IGESSolid_ReadWriteModule.hxx delete mode 100644 src/IGESSolid/IGESSolid_SpecificModule.cxx delete mode 100644 src/IGESSolid/IGESSolid_SpecificModule.hxx create mode 100644 src/Interface/Interface_Pointer.hxx diff --git a/src/IGESAppli/FILES b/src/IGESAppli/FILES index 1546fc98d6..b2b539bc26 100644 --- a/src/IGESAppli/FILES +++ b/src/IGESAppli/FILES @@ -1,7 +1,6 @@ IGESAppli.cxx IGESAppli.hxx IGESAppli_Array1OfFiniteElement.hxx -IGESAppli_Array1OfFlow.hxx IGESAppli_Array1OfNode.hxx IGESAppli_DrilledHole.cxx IGESAppli_DrilledHole.hxx @@ -16,7 +15,6 @@ IGESAppli_FlowLineSpec.hxx IGESAppli_GeneralModule.cxx IGESAppli_GeneralModule.hxx IGESAppli_HArray1OfFiniteElement.hxx -IGESAppli_HArray1OfFlow.hxx IGESAppli_HArray1OfNode.hxx IGESAppli_LevelFunction.cxx IGESAppli_LevelFunction.hxx @@ -44,49 +42,7 @@ IGESAppli_PWBArtworkStackup.cxx IGESAppli_PWBArtworkStackup.hxx IGESAppli_PWBDrilledHole.cxx IGESAppli_PWBDrilledHole.hxx -IGESAppli_ReadWriteModule.cxx -IGESAppli_ReadWriteModule.hxx IGESAppli_ReferenceDesignator.cxx IGESAppli_ReferenceDesignator.hxx IGESAppli_RegionRestriction.cxx IGESAppli_RegionRestriction.hxx -IGESAppli_SpecificModule.cxx -IGESAppli_SpecificModule.hxx -IGESAppli_ToolDrilledHole.cxx -IGESAppli_ToolDrilledHole.hxx -IGESAppli_ToolElementResults.cxx -IGESAppli_ToolElementResults.hxx -IGESAppli_ToolFiniteElement.cxx -IGESAppli_ToolFiniteElement.hxx -IGESAppli_ToolFlow.cxx -IGESAppli_ToolFlow.hxx -IGESAppli_ToolFlowLineSpec.cxx -IGESAppli_ToolFlowLineSpec.hxx -IGESAppli_ToolLevelFunction.cxx -IGESAppli_ToolLevelFunction.hxx -IGESAppli_ToolLevelToPWBLayerMap.cxx -IGESAppli_ToolLevelToPWBLayerMap.hxx -IGESAppli_ToolLineWidening.cxx -IGESAppli_ToolLineWidening.hxx -IGESAppli_ToolNodalConstraint.cxx -IGESAppli_ToolNodalConstraint.hxx -IGESAppli_ToolNodalDisplAndRot.cxx -IGESAppli_ToolNodalDisplAndRot.hxx -IGESAppli_ToolNodalResults.cxx -IGESAppli_ToolNodalResults.hxx -IGESAppli_ToolNode.cxx -IGESAppli_ToolNode.hxx -IGESAppli_ToolPartNumber.cxx -IGESAppli_ToolPartNumber.hxx -IGESAppli_ToolPinNumber.cxx -IGESAppli_ToolPinNumber.hxx -IGESAppli_ToolPipingFlow.cxx -IGESAppli_ToolPipingFlow.hxx -IGESAppli_ToolPWBArtworkStackup.cxx -IGESAppli_ToolPWBArtworkStackup.hxx -IGESAppli_ToolPWBDrilledHole.cxx -IGESAppli_ToolPWBDrilledHole.hxx -IGESAppli_ToolReferenceDesignator.cxx -IGESAppli_ToolReferenceDesignator.hxx -IGESAppli_ToolRegionRestriction.cxx -IGESAppli_ToolRegionRestriction.hxx diff --git a/src/IGESAppli/IGESAppli.cxx b/src/IGESAppli/IGESAppli.cxx index dd4dc47d39..45d2c3ed7e 100644 --- a/src/IGESAppli/IGESAppli.cxx +++ b/src/IGESAppli/IGESAppli.cxx @@ -15,14 +15,9 @@ #include #include #include -#include -#include -#include -#include #include #include #include -#include #include #include @@ -66,14 +61,8 @@ const Handle(IGESAppli_Protocol) & IGESAppli::Protocol () static Handle(IGESAppli_Protocol) protocol; if (protocol.IsNull()) { protocol = new IGESAppli_Protocol; - /*Interface_GeneralLib::SetGlobal (new IGESSolid_GeneralModule, protocol); - Interface_ReaderLib::SetGlobal (new IGESSolid_ReadWriteModule,protocol); - IGESData_WriterLib::SetGlobal (new IGESSolid_ReadWriteModule,protocol); - IGESData_SpecificLib::SetGlobal (new IGESSolid_SpecificModule, protocol);*/ + /*Interface_GeneralLib::SetGlobal (new IGESSolid_GeneralModule, protocol);*/ Interface_GeneralLib::SetGlobal (new IGESAppli_GeneralModule, protocol); - Interface_ReaderLib::SetGlobal (new IGESAppli_ReadWriteModule,protocol); - IGESData_WriterLib::SetGlobal (new IGESAppli_ReadWriteModule,protocol); - IGESData_SpecificLib::SetGlobal (new IGESAppli_SpecificModule, protocol); } return protocol; } diff --git a/src/IGESAppli/IGESAppli_Array1OfFiniteElement.hxx b/src/IGESAppli/IGESAppli_Array1OfFiniteElement.hxx index 90c6269ca6..3f8c2d687e 100644 --- a/src/IGESAppli/IGESAppli_Array1OfFiniteElement.hxx +++ b/src/IGESAppli/IGESAppli_Array1OfFiniteElement.hxx @@ -17,10 +17,10 @@ #ifndef IGESAppli_Array1OfFiniteElement_HeaderFile #define IGESAppli_Array1OfFiniteElement_HeaderFile +#include #include #include -typedef NCollection_Array1 IGESAppli_Array1OfFiniteElement; - +typedef NCollection_Array1> IGESAppli_Array1OfFiniteElement; #endif diff --git a/src/IGESAppli/IGESAppli_Array1OfFlow.hxx b/src/IGESAppli/IGESAppli_Array1OfFlow.hxx deleted file mode 100644 index 23babec4f4..0000000000 --- a/src/IGESAppli/IGESAppli_Array1OfFlow.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// Created on: 1993-01-11 -// Created by: CKY / Contract Toubro-Larsen (Anand NATRAJAN) -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef IGESAppli_Array1OfFlow_HeaderFile -#define IGESAppli_Array1OfFlow_HeaderFile - -#include -#include - -typedef NCollection_Array1 IGESAppli_Array1OfFlow; - - -#endif diff --git a/src/IGESAppli/IGESAppli_Array1OfNode.hxx b/src/IGESAppli/IGESAppli_Array1OfNode.hxx index 5e74513777..e505ea35f9 100644 --- a/src/IGESAppli/IGESAppli_Array1OfNode.hxx +++ b/src/IGESAppli/IGESAppli_Array1OfNode.hxx @@ -17,10 +17,10 @@ #ifndef IGESAppli_Array1OfNode_HeaderFile #define IGESAppli_Array1OfNode_HeaderFile +#include #include #include -typedef NCollection_Array1 IGESAppli_Array1OfNode; - +typedef NCollection_Array1> IGESAppli_Array1OfNode; #endif diff --git a/src/IGESAppli/IGESAppli_DrilledHole.cxx b/src/IGESAppli/IGESAppli_DrilledHole.cxx index 521a0a7471..c8d88957a1 100644 --- a/src/IGESAppli/IGESAppli_DrilledHole.cxx +++ b/src/IGESAppli/IGESAppli_DrilledHole.cxx @@ -17,22 +17,45 @@ //-------------------------------------------------------------------- #include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_DrilledHole,IGESData_IGESEntity) -void IGESAppli_DrilledHole::Init - (const Standard_Integer nbPropVal, - const Standard_Real aSize, const Standard_Real anotherSize, - const Standard_Integer aPlating, const Standard_Integer aLayer, - const Standard_Integer anotherLayer) +void IGESAppli_DrilledHole::OwnRead (IGESFile_Reader &theReader) { - theNbPropertyValues = nbPropVal; - theDrillDiaSize = aSize; - theFinishDiaSize = anotherSize; - thePlatingFlag = aPlating; - theNbLowerLayer = aLayer; - theNbHigherLayer = anotherLayer; - InitTypeAndForm(406,6); + Standard_Integer aNbPropertyValues = 5; + if (theReader.ReadInteger(aNbPropertyValues,"No. of Property values") == IGESFile_Reader::ParamError || aNbPropertyValues != 5) + theReader.AddFail("Number of Property Values != 5"); + theReader.ReadReal(myDrillDiaSize,"Drill diameter size"); + theReader.ReadReal(myFinishDiaSize,"Finish diameter size"); + theReader.ReadInteger(myPlatingFlag,"Plating Flag"); + theReader.ReadInteger(myNbLowerLayer,"Lower numbered layer"); + theReader.ReadInteger(myNbHigherLayer,"Higher numbered layer"); +} + +void IGESAppli_DrilledHole::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(5); + IW.Send(myDrillDiaSize); + IW.Send(myFinishDiaSize); + IW.SendBoolean(myPlatingFlag != 0); + IW.Send(myNbLowerLayer); + IW.Send(myNbHigherLayer); +} + + +IGESData_DirChecker IGESAppli_DrilledHole::DirChecker () const +{ + IGESData_DirChecker DC(406,6); //Form no = 6 & Type = 406 + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } void IGESAppli_DrilledHole::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const @@ -41,6 +64,25 @@ void IGESAppli_DrilledHole::OwnCheck (const Interface_ShareTool &, const Handle( if (DefLevel() != IGESData_DefOne && DefLevel() != IGESData_DefSeveral) theCheck->AddFail("Level type : Not value/reference"); - if (NbPropertyValues() != 5) - theCheck->AddFail("Number of Property Values != 5"); +} + +Standard_Boolean IGESAppli_DrilledHole::OwnCorrect () +{ + if (SubordinateStatus() != 0) { + Handle(IGESData_LevelListEntity) nulevel; + InitLevel(nulevel,0); + return Standard_True; + } + return Standard_False; +} + +void IGESAppli_DrilledHole::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const +{ + S << "IGESAppli_DrilledHole" << endl; + S << "Number of property values : 5" << endl; + S << "Drill diameter size : " << myDrillDiaSize << " "; + S << "Finish diameter size : " << myFinishDiaSize << endl; + S << "Plating indication flag : " << (myPlatingFlag? "YES" : "NO") << " - "; + S << "Lower Numbered Layer : " << myNbLowerLayer << " "; + S << "Higher Numbered Layer : " << myNbHigherLayer << endl; } diff --git a/src/IGESAppli/IGESAppli_DrilledHole.hxx b/src/IGESAppli/IGESAppli_DrilledHole.hxx index 673f95c020..5bb1340314 100644 --- a/src/IGESAppli/IGESAppli_DrilledHole.hxx +++ b/src/IGESAppli/IGESAppli_DrilledHole.hxx @@ -19,9 +19,6 @@ #include -class IGESAppli_DrilledHole; -DEFINE_STANDARD_HANDLE(IGESAppli_DrilledHole, IGESData_IGESEntity) - //! defines DrilledHole, Type <406> Form <6> //! in package IGESAppli //! Identifies an entity representing a drilled hole @@ -30,51 +27,55 @@ class IGESAppli_DrilledHole : public IGESData_IGESEntity { public: - IGESAppli_DrilledHole() {} - - //! This method is used to set the fields of the class - //! DrilledHole - //! - nbPropVal : Number of property values = 5 - //! - aSize : Drill diameter size - //! - anotherSize : Finish diameter size - //! - aPlating : Plating indication flag - //! False = not plating - //! True = is plating - //! - aLayer : Lower numbered layer - //! - anotherLayer : Higher numbered layer - Standard_EXPORT void Init (const Standard_Integer nbPropVal, const Standard_Real aSize, const Standard_Real anotherSize, const Standard_Integer aPlating, const Standard_Integer aLayer, const Standard_Integer anotherLayer); - - //! is always 5 - Standard_Integer NbPropertyValues() const { return theNbPropertyValues; } + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 6; } + + IGESAppli_DrilledHole() + : myDrillDiaSize(0.), + myFinishDiaSize(0.), + myPlatingFlag(0), + myNbLowerLayer(0), + myNbHigherLayer(0) + {} //! returns the drill diameter size - Standard_Real DrillDiaSize() const { return theDrillDiaSize; } + Standard_Real DrillDiaSize() const { return myDrillDiaSize; } //! returns the finish diameter size - Standard_Real FinishDiaSize() const { return theFinishDiaSize; } + Standard_Real FinishDiaSize() const { return myFinishDiaSize; } //! Returns Plating Status : //! False = not plating / True = is plating - Standard_Boolean IsPlating() const { return (thePlatingFlag != 0); } + Standard_Boolean IsPlating() const { return (myPlatingFlag != 0); } //! returns the lower numbered layer - Standard_Integer NbLowerLayer() const { return theNbLowerLayer; } + Standard_Integer NbLowerLayer() const { return myNbLowerLayer; } //! returns the higher numbered layer - Standard_Integer NbHigherLayer() const { return theNbHigherLayer; } + Standard_Integer NbHigherLayer() const { return myNbHigherLayer; } + + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean OwnCorrect () Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_DrilledHole,IGESData_IGESEntity) private: - Standard_Integer theNbPropertyValues; - Standard_Real theDrillDiaSize; - Standard_Real theFinishDiaSize; - Standard_Integer thePlatingFlag; - Standard_Integer theNbLowerLayer; - Standard_Integer theNbHigherLayer; + Standard_Real myDrillDiaSize; + Standard_Real myFinishDiaSize; + Standard_Integer myPlatingFlag; + Standard_Integer myNbLowerLayer; + Standard_Integer myNbHigherLayer; }; #endif // _IGESAppli_DrilledHole_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ElementResults.cxx b/src/IGESAppli/IGESAppli_ElementResults.cxx index 90500c6435..71f727264d 100644 --- a/src/IGESAppli/IGESAppli_ElementResults.cxx +++ b/src/IGESAppli/IGESAppli_ElementResults.cxx @@ -17,6 +17,8 @@ //-------------------------------------------------------------------- // UNFINISHED & UNSTARTED +#include +#include #include #include #include @@ -25,127 +27,73 @@ #include #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_ElementResults,IGESData_IGESEntity) -void IGESAppli_ElementResults::Init - (const Handle(IGESDimen_GeneralNote)& aNote, - const Standard_Integer aSubCase, const Standard_Real aTime, - const Standard_Integer nbResults, const Standard_Integer aResRepFlag, - const Handle(TColStd_HArray1OfInteger)& allElementIdents, - const Handle(IGESAppli_HArray1OfFiniteElement)& allFiniteElems, - const Handle(TColStd_HArray1OfInteger)& allTopTypes, - const Handle(TColStd_HArray1OfInteger)& nbLayers, - const Handle(TColStd_HArray1OfInteger)& allDataLayerFlags, - const Handle(TColStd_HArray1OfInteger)& allnbResDataLocs, - const Handle(IGESBasic_HArray1OfHArray1OfInteger)& allResDataLocs, - const Handle(IGESBasic_HArray1OfHArray1OfReal)& allResults) // UNFINISHED -{ - // raises exception if sizes are not consistent, (lower = 1 too) - // but how to check is not clear ?? - Standard_Integer num = allElementIdents->Length(); - if (allElementIdents->Lower() != 1 || - allFiniteElems->Lower() != 1 || allFiniteElems->Upper() != num || - allTopTypes->Lower() != 1 || allTopTypes->Upper() != num || - nbLayers->Lower() != 1 || nbLayers->Upper() != num || - allDataLayerFlags->Lower() != 1 || allDataLayerFlags->Upper() != num || - allnbResDataLocs->Lower() != 1 || allnbResDataLocs->Upper() != num || - allResDataLocs->Lower() != 1 || allResDataLocs->Upper() != num || - allResults->Lower() != 1 || allResults->Upper() != num ) - Standard_DimensionMismatch::Raise("IGESAppli_ElementsResults : Init"); - for (Standard_Integer i = 1; i <= num; i ++) { - Standard_Integer nl = nbLayers->Value(i); - Standard_Integer nrl = allnbResDataLocs->Value(i); - if (allResDataLocs->Value(i)->Lower() != 1 || - allResDataLocs->Value(i)->Upper() != nrl) - Standard_DimensionMismatch::Raise("IGESAppli_ElementsResults : DataLoc"); - if (allResults->Value(i)->Lower() != 1 || - allResults->Value(i)->Upper() != nl*nrl*nbResults) - Standard_DimensionMismatch::Raise("IGESAppli_ElementsResults : Results"); - } - - theNote = aNote; - theSubcaseNumber = aSubCase; - theTime = aTime; - theNbResultValues = nbResults; - theResultReportFlag = aResRepFlag; - theElementIdentifiers = allElementIdents; - theElements = allFiniteElems; - theElementTopologyTypes = allTopTypes; - theNbLayers = nbLayers; - theDataLayerFlags = allDataLayerFlags; - theNbResultDataLocs = allnbResDataLocs; - theResultDataLocs = allResDataLocs; - theResultData = allResults; - InitTypeAndForm(148,FormNumber()); -// FormNumber -> Type of the Results -} - -void IGESAppli_ElementResults::SetFormNumber (const Standard_Integer form) -{ - if (form < 0 || form > 34) Standard_OutOfRange::Raise - ("IGESAppli_ElementResults : SetFormNumber"); - InitTypeAndForm(148,form); -} - Standard_Integer IGESAppli_ElementResults::NbElements () const { - return theElements->Length(); + return myElements->Length(); } Standard_Integer IGESAppli_ElementResults::ElementIdentifier (const Standard_Integer Index) const { - return theElementIdentifiers->Value(Index); + return myElementIdentifiers->Value(Index); } const Handle(IGESAppli_FiniteElement) & IGESAppli_ElementResults::Element (const Standard_Integer Index) const { - return theElements->Value(Index); + return myElements->Value(Index); } Standard_Integer IGESAppli_ElementResults::ElementTopologyType (const Standard_Integer Index) const { - return theElementTopologyTypes->Value(Index); + return myElementTopologyTypes->Value(Index); } Standard_Integer IGESAppli_ElementResults::NbLayers (const Standard_Integer Index) const { - return theNbLayers->Value(Index); + return myNbLayers->Value(Index); } Standard_Integer IGESAppli_ElementResults::DataLayerFlag (const Standard_Integer Index) const { - return theDataLayerFlags->Value(Index); + return myDataLayerFlags->Value(Index); } Standard_Integer IGESAppli_ElementResults::NbResultDataLocs (const Standard_Integer Index) const { - return theNbResultDataLocs->Value(Index); + return myNbResultDataLocs->Value(Index); } // ?? VERIFIER Standard_Integer IGESAppli_ElementResults::ResultDataLoc (const Standard_Integer NElem, const Standard_Integer NLoc) const { - return theResultDataLocs->Value(NElem)->Value(NLoc); + return myResultDataLocs->Value(NElem)->Value(NLoc); } Standard_Integer IGESAppli_ElementResults::NbResults (const Standard_Integer Index) const { - return theResultData->Value(Index)->Length(); + return myResultData->Value(Index)->Length(); } Standard_Real IGESAppli_ElementResults::ResultData (const Standard_Integer NElem, const Standard_Integer num) const { - return theResultData->Value(NElem)->Value(num); + return myResultData->Value(NElem)->Value(num); } Standard_Integer IGESAppli_ElementResults::ResultRank (const Standard_Integer NElem, const Standard_Integer NVal, const Standard_Integer NLay, const Standard_Integer NLoc) const { - Standard_Integer num = NVal + theNbResultValues * - (NLay + theNbLayers->Value(NElem) * NLoc); + Standard_Integer num = NVal + myNbResultValues * + (NLay + myNbLayers->Value(NElem) * NLoc); return num; } @@ -153,12 +101,90 @@ Standard_Real IGESAppli_ElementResults::ResultData (const Standard_Integer NElem, const Standard_Integer NVal, const Standard_Integer NLay, const Standard_Integer NLoc) const { - return theResultData->Value(NElem)->Value(ResultRank(NElem,NVal,NLay,NLoc)); + return myResultData->Value(NElem)->Value(ResultRank(NElem,NVal,NLay,NLoc)); } Handle(TColStd_HArray1OfReal) IGESAppli_ElementResults::ResultList (const Standard_Integer NElem) const { - return theResultData->Value(NElem); + return myResultData->Value(NElem); +} + +void IGESAppli_ElementResults::OwnRead (IGESFile_Reader &theReader) +{ + Standard_Integer num = 0; + + theReader.ReadPointer(myNote,"General Note"); + theReader.ReadInteger(mySubcaseNumber,"Subcase Number"); + theReader.ReadReal(myTime,"Time"); + theReader.ReadInteger(myNbResultValues,"Number of Result Values"); + theReader.ReadInteger(myResultReportFlag,"Result Report Flag"); + theReader.ReadInteger(num,"Number of Finite Elements"); + + if (num > 0) + { + myElementIdentifiers = new TColStd_HArray1OfInteger(1, num); + myElements = new IGESAppli_HArray1OfFiniteElement(1, num); + myElementTopologyTypes = new TColStd_HArray1OfInteger(1, num); + myNbLayers = new TColStd_HArray1OfInteger(1, num); + myDataLayerFlags = new TColStd_HArray1OfInteger(1, num); + myNbResultDataLocs = new TColStd_HArray1OfInteger(1, num); + myResultDataLocs = new IGESBasic_HArray1OfHArray1OfInteger(1, num); + myResultData = new IGESBasic_HArray1OfHArray1OfReal(1, num); + + for (Standard_Integer i = 1; i <= num; i++) + { + Standard_Integer nl = 0, nrl = 0, numv = 0; + theReader.ReadInteger(myElementIdentifiers->ChangeValue(i),"FEM Element Identifier"); + theReader.ReadPointer(myElements->ChangeValue(i),"FEM Element Entity"); + theReader.ReadInteger(myElementTopologyTypes->ChangeValue(i),"FEM Element Topology Type"); + if (theReader.ReadInteger(nl,"Nb. of layers")) + myNbLayers->SetValue(i,nl); + theReader.ReadInteger(myDataLayerFlags->ChangeValue(i),"Data Layer Flag"); + + if (theReader.ReadInteger(nrl,"Nb. of result data locations")) + myNbResultDataLocs->SetValue(i,nrl); + + if (nrl > 0) { + Handle(TColStd_HArray1OfInteger) rdrl = new TColStd_HArray1OfInteger(1,nrl); + if (theReader.ReadInteger(rdrl->ChangeFirst(),nrl,"Result data locations")) + myResultDataLocs->SetValue(i,rdrl); + } + + theReader.ReadInteger(numv,"Nb. of result data locations"); + if (numv > 0) { + Handle(TColStd_HArray1OfReal) vres = new TColStd_HArray1OfReal(1,numv); + if (theReader.ReadReal(vres->ChangeFirst(),numv,"Result Data")) + myResultData->SetValue(i,vres); + } + } + } + else theReader.AddFail("Number of Finite Elements: Not Positive"); +} + +void IGESAppli_ElementResults::OwnWrite (IGESData_IGESWriter &IW) const +{ + const Standard_Integer num = NbElements(); + IW.Send(myNote); + IW.Send(mySubcaseNumber); + IW.Send(myTime); + IW.Send(myNbResultValues); + IW.Send(myResultReportFlag); + IW.Send(num); + Standard_Integer i,j; + for ( i = 1; i <= num; i++ ) { + const Standard_Integer nl = NbLayers(i); + const Standard_Integer nrl = NbResultDataLocs(i); + const Standard_Integer numv = NbResults(i); + IW.Send(ElementIdentifier(i)); + IW.Send(Element(i)); + IW.Send(ElementTopologyType(i)); + IW.Send(nl); + IW.Send(DataLayerFlag(i)); + IW.Send(nrl); + for (j = 1; j <= nrl; j ++) IW.Send(ResultDataLoc(i,j)); + IW.Send(numv); + for (j = 1; j <= numv; j ++) IW.Send(ResultData(i,j)); + } } void IGESAppli_ElementResults::OwnShared(Interface_EntityIterator &theIter) const @@ -169,51 +195,67 @@ void IGESAppli_ElementResults::OwnShared(Interface_EntityIterator &theIter) cons theIter.GetOneItem(Element(i)); } +IGESData_DirChecker IGESAppli_ElementResults::DirChecker () const +{ + IGESData_DirChecker DC(148, 0, 34); + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefAny); + DC.BlankStatusIgnored(); + DC.UseFlagRequired(3); + DC.HierarchyStatusIgnored(); + return DC; +} + void IGESAppli_ElementResults::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const { - Standard_Integer rrf = ResultReportFlag(); - if (rrf < 0 || rrf > 3) theCheck->AddFail("Result Report Flag not in [0-3]"); - Standard_Integer nv = NbResultValues(); + if (myResultReportFlag < 0 || myResultReportFlag > 3) + theCheck->AddFail("Result Report Flag not in [0-3]"); + Standard_Boolean OK = Standard_True; - switch (FormNumber()) { - case 0 : if (nv < 0) OK = Standard_False; break; - case 1 : if (nv != 1) OK = Standard_False; break; - case 2 : if (nv != 1) OK = Standard_False; break; - case 3 : if (nv != 3) OK = Standard_False; break; - case 4 : if (nv != 6) OK = Standard_False; break; - case 5 : if (nv != 3) OK = Standard_False; break; - case 6 : if (nv != 3) OK = Standard_False; break; - case 7 : if (nv != 3) OK = Standard_False; break; - case 8 : if (nv != 3) OK = Standard_False; break; - case 9 : if (nv != 3) OK = Standard_False; break; - case 10 : if (nv != 1) OK = Standard_False; break; - case 11 : if (nv != 1) OK = Standard_False; break; - case 12 : if (nv != 3) OK = Standard_False; break; - case 13 : if (nv != 1) OK = Standard_False; break; - case 14 : if (nv != 1) OK = Standard_False; break; - case 15 : if (nv != 3) OK = Standard_False; break; - case 16 : if (nv != 1) OK = Standard_False; break; - case 17 : if (nv != 3) OK = Standard_False; break; - case 18 : if (nv != 3) OK = Standard_False; break; - case 19 : if (nv != 3) OK = Standard_False; break; - case 20 : if (nv != 3) OK = Standard_False; break; - case 21 : if (nv != 3) OK = Standard_False; break; - case 22 : if (nv != 3) OK = Standard_False; break; - case 23 : if (nv != 6) OK = Standard_False; break; - case 24 : if (nv != 6) OK = Standard_False; break; - case 25 : if (nv != 6) OK = Standard_False; break; - case 26 : if (nv != 6) OK = Standard_False; break; - case 27 : if (nv != 6) OK = Standard_False; break; - case 28 : if (nv != 6) OK = Standard_False; break; - case 29 : if (nv != 9) OK = Standard_False; break; - case 30 : if (nv != 9) OK = Standard_False; break; - case 31 : if (nv != 9) OK = Standard_False; break; - case 32 : if (nv != 9) OK = Standard_False; break; - case 33 : if (nv != 9) OK = Standard_False; break; - case 34 : if (nv != 9) OK = Standard_False; break; + switch (myForm) { + case 0 : if (myNbResultValues < 0) OK = Standard_False; break; + case 1 : if (myNbResultValues != 1) OK = Standard_False; break; + case 2 : if (myNbResultValues != 1) OK = Standard_False; break; + case 3 : if (myNbResultValues != 3) OK = Standard_False; break; + case 4 : if (myNbResultValues != 6) OK = Standard_False; break; + case 5 : if (myNbResultValues != 3) OK = Standard_False; break; + case 6 : if (myNbResultValues != 3) OK = Standard_False; break; + case 7 : if (myNbResultValues != 3) OK = Standard_False; break; + case 8 : if (myNbResultValues != 3) OK = Standard_False; break; + case 9 : if (myNbResultValues != 3) OK = Standard_False; break; + case 10 : if (myNbResultValues != 1) OK = Standard_False; break; + case 11 : if (myNbResultValues != 1) OK = Standard_False; break; + case 12 : if (myNbResultValues != 3) OK = Standard_False; break; + case 13 : if (myNbResultValues != 1) OK = Standard_False; break; + case 14 : if (myNbResultValues != 1) OK = Standard_False; break; + case 15 : if (myNbResultValues != 3) OK = Standard_False; break; + case 16 : if (myNbResultValues != 1) OK = Standard_False; break; + case 17 : if (myNbResultValues != 3) OK = Standard_False; break; + case 18 : if (myNbResultValues != 3) OK = Standard_False; break; + case 19 : if (myNbResultValues != 3) OK = Standard_False; break; + case 20 : if (myNbResultValues != 3) OK = Standard_False; break; + case 21 : if (myNbResultValues != 3) OK = Standard_False; break; + case 22 : if (myNbResultValues != 3) OK = Standard_False; break; + case 23 : if (myNbResultValues != 6) OK = Standard_False; break; + case 24 : if (myNbResultValues != 6) OK = Standard_False; break; + case 25 : if (myNbResultValues != 6) OK = Standard_False; break; + case 26 : if (myNbResultValues != 6) OK = Standard_False; break; + case 27 : if (myNbResultValues != 6) OK = Standard_False; break; + case 28 : if (myNbResultValues != 6) OK = Standard_False; break; + case 29 : if (myNbResultValues != 9) OK = Standard_False; break; + case 30 : if (myNbResultValues != 9) OK = Standard_False; break; + case 31 : if (myNbResultValues != 9) OK = Standard_False; break; + case 32 : if (myNbResultValues != 9) OK = Standard_False; break; + case 33 : if (myNbResultValues != 9) OK = Standard_False; break; + case 34 : if (myNbResultValues != 9) OK = Standard_False; break; default : theCheck->AddFail("Incorrect Form Number"); break; } - if (!OK) theCheck->AddFail("Incorrect count of real values in array V for FEM node"); + if (!OK) + theCheck->AddFail("Incorrect count of real values in array V for FEM node"); + const Standard_Integer ne = NbElements(); for (Standard_Integer i = 1; i <= ne; i ++) { char mess[100]; @@ -226,14 +268,65 @@ void IGESAppli_ElementResults::OwnCheck (const Interface_ShareTool &, const Hand sprintf(mess,"Nb. of Layers n0.%d not ONE while Data Layer Flag is in [0-3]",i); theCheck->AddFail(mess); } - if (rrf == 1 || rrf == 2) + if (myResultReportFlag == 1 || myResultReportFlag == 2) if (nrl != 1 || ResultDataLoc(i,1) != 0) { sprintf(mess,"Result Data Locs n0.%d incorrect for Result Report = 1 or 2",i); theCheck->AddFail(mess); } - if (NbResults(i) != (nv*nl*nrl)) { - sprintf(mess,"Nb. of results for Element n0.%d incorrect, should be %d",i,nv*nl*nrl); + if (NbResults(i) != (myNbResultValues*nl*nrl)) { + sprintf(mess,"Nb. of results for Element n0.%d incorrect, should be %d",i,myNbResultValues*nl*nrl); theCheck->AddFail(mess); } } } + +void IGESAppli_ElementResults::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + Standard_Integer sublevel = (level > 4) ? 1 : 0; + S << "IGESAppli_ElementResults" << endl; + S << "General Note : "; + dumper.Dump(myNote,S,sublevel); + S << endl; + S << "Subcase Number : " << mySubcaseNumber << endl; + S << "Time : " << myTime << endl; + S << "Number of Result Values : " << myNbResultValues << endl; + S << "Result Report Flag : " << myResultReportFlag << endl; + S << "Element Identifiers : "; + IGESData_DumpVals(S,level,1,NbElements(),ElementIdentifier); + S << endl << "Elements : "; + IGESData_DumpEntities(S,dumper,level,1,NbElements(),Element); + S << endl << "Element Topology Types : "; + IGESData_DumpVals(S,level,1,NbElements(),ElementTopologyType); + S << endl << "Numbers of Layers : "; + IGESData_DumpVals(S,level,1,NbElements(),NbLayers); + S << endl << "Data Layer Flags : "; + IGESData_DumpVals(S,level,1,NbElements(),DataLayerFlag); + S << endl << "Numbers of Result Data Locations : "; + IGESData_DumpVals(S,level,1,NbElements(),NbResultDataLocs); + S << endl << "Result Data Locations : "; S << " TO BE DONE "; + +// ?? A VERIFIER DE PRES, pas du tout sur que ce soit bon +// cf aussi Write et Copy + if (level <= 4) S << " [ ask level > 4 for more, > 5 for complete ]" << endl; + else { + Standard_Integer i;// svv Jan 10 2000 : porting on DEC + for (i = 1; i <= NbElements(); i ++) { + Standard_Integer nloc = NbResultDataLocs(i); + S << " ["< 5 for complete Data ]" << endl; + else { + for (Standard_Integer j = 1; j <= nres; j ++) + S << " " << ResultData(i,j); // ?? is it all ?? UNFINISHED + } + } + } +} diff --git a/src/IGESAppli/IGESAppli_ElementResults.hxx b/src/IGESAppli/IGESAppli_ElementResults.hxx index 18e3761f95..d7b7bfec22 100644 --- a/src/IGESAppli/IGESAppli_ElementResults.hxx +++ b/src/IGESAppli/IGESAppli_ElementResults.hxx @@ -17,10 +17,10 @@ #ifndef _IGESAppli_ElementResults_HeaderFile #define _IGESAppli_ElementResults_HeaderFile -#include #include #include -#include +class TColStd_HArray1OfInteger; +class TColStd_HArray1OfReal; class IGESDimen_GeneralNote; class IGESBasic_HArray1OfHArray1OfInteger; class IGESBasic_HArray1OfHArray1OfReal; @@ -37,43 +37,32 @@ class IGESAppli_ElementResults : public IGESData_IGESEntity { public: - IGESAppli_ElementResults() {} - - //! This method is used to set the fields of the class - //! ElementResults - //! - aNote : GeneralNote Entity describing analysis - //! - aSubCase : Analysis Subcase number - //! - aTime : Analysis time value - //! - nbResults : Number of result values per FEM - //! - aResRepFlag : Results Reporting Flag - //! - allElementIdents : FEM element number for elements - //! - allFiniteElems : FEM element - //! - allTopTypes : Element Topology Types - //! - nbLayers : Number of layers per result data location - //! - allDataLayerFlags : Data Layer Flags - //! - allnbResDataLocs : Number of result data report locations - //! - allResDataLocs : Result Data Report Locations - //! - allResults : List of Result data values of FEM analysis - Standard_EXPORT void Init (const Handle(IGESDimen_GeneralNote)& aNote, const Standard_Integer aSubCase, const Standard_Real aTime, const Standard_Integer nbResults, const Standard_Integer aResRepFlag, const Handle(TColStd_HArray1OfInteger)& allElementIdents, const Handle(IGESAppli_HArray1OfFiniteElement)& allFiniteElems, const Handle(TColStd_HArray1OfInteger)& allTopTypes, const Handle(TColStd_HArray1OfInteger)& nbLayers, const Handle(TColStd_HArray1OfInteger)& allDataLayerFlags, const Handle(TColStd_HArray1OfInteger)& allnbResDataLocs, const Handle(IGESBasic_HArray1OfHArray1OfInteger)& allResDataLocs, const Handle(IGESBasic_HArray1OfHArray1OfReal)& allResults); - - //! Changes the FormNumber (which indicates Type of Result) - //! Error if not in range [0-34] - Standard_EXPORT void SetFormNumber (const Standard_Integer form); + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 148; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return myForm; } + + IGESAppli_ElementResults(const Standard_Integer theForm) + : myForm(theForm), + mySubcaseNumber(0), + myTime(0.), + myNbResultValues(0), + myResultReportFlag(0) + {} //! returns General Note Entity describing analysis case - const Handle(IGESDimen_GeneralNote) & Note() const { return theNote; } + const Handle(IGESDimen_GeneralNote) & Note() const { return myNote; } //! returns analysis Subcase number - Standard_Integer SubCaseNumber() const { return theSubcaseNumber; } + Standard_Integer SubCaseNumber() const { return mySubcaseNumber; } //! returns analysis time value - Standard_Real Time() const { return theTime; } + Standard_Real Time() const { return myTime; } //! returns number of result values per FEM - Standard_Integer NbResultValues() const { return theNbResultValues; } + Standard_Integer NbResultValues() const { return myNbResultValues; } //! returns Results Reporting Flag - Standard_Integer ResultReportFlag() const { return theResultReportFlag; } + Standard_Integer ResultReportFlag() const { return myResultReportFlag; } //! returns number of FEM elements Standard_EXPORT Standard_Integer NbElements() const; @@ -127,27 +116,37 @@ class IGESAppli_ElementResults : public IGESData_IGESEntity //! addressed as by ResultRank (See above) Standard_EXPORT Handle(TColStd_HArray1OfReal) ResultList (const Standard_Integer NElem) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared(Interface_EntityIterator &theIter) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESAppli_ElementResults,IGESData_IGESEntity) private: - Handle(IGESDimen_GeneralNote) theNote; - Standard_Integer theSubcaseNumber; - Standard_Real theTime; - Standard_Integer theNbResultValues; - Standard_Integer theResultReportFlag; - Handle(TColStd_HArray1OfInteger) theElementIdentifiers; - Handle(IGESAppli_HArray1OfFiniteElement) theElements; - Handle(TColStd_HArray1OfInteger) theElementTopologyTypes; - Handle(TColStd_HArray1OfInteger) theNbLayers; - Handle(TColStd_HArray1OfInteger) theDataLayerFlags; - Handle(TColStd_HArray1OfInteger) theNbResultDataLocs; - Handle(IGESBasic_HArray1OfHArray1OfInteger) theResultDataLocs; - Handle(IGESBasic_HArray1OfHArray1OfReal) theResultData; + Standard_Integer myForm; + //Handle(IGESDimen_GeneralNote) myNote; + Interface_Pointer myNote; + Standard_Integer mySubcaseNumber; + Standard_Real myTime; + Standard_Integer myNbResultValues; + Standard_Integer myResultReportFlag; + Handle(TColStd_HArray1OfInteger) myElementIdentifiers; + Handle(IGESAppli_HArray1OfFiniteElement) myElements; + Handle(TColStd_HArray1OfInteger) myElementTopologyTypes; + Handle(TColStd_HArray1OfInteger) myNbLayers; + Handle(TColStd_HArray1OfInteger) myDataLayerFlags; + Handle(TColStd_HArray1OfInteger) myNbResultDataLocs; + Handle(IGESBasic_HArray1OfHArray1OfInteger) myResultDataLocs; + Handle(IGESBasic_HArray1OfHArray1OfReal) myResultData; }; #endif // _IGESAppli_ElementResults_HeaderFile diff --git a/src/IGESAppli/IGESAppli_FiniteElement.cxx b/src/IGESAppli/IGESAppli_FiniteElement.cxx index 54c306f513..6325d9c826 100644 --- a/src/IGESAppli/IGESAppli_FiniteElement.cxx +++ b/src/IGESAppli/IGESAppli_FiniteElement.cxx @@ -23,35 +23,74 @@ #include #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_FiniteElement,IGESData_IGESEntity) -void IGESAppli_FiniteElement::Init - (const Standard_Integer aType, - const Handle(IGESAppli_HArray1OfNode)& allNodes, - const Handle(TCollection_HAsciiString)& aName) +Standard_Integer IGESAppli_FiniteElement::NbNodes () const { - if (allNodes->Lower() != 1) - Standard_DimensionMismatch::Raise("IGESAppli_FiniteElement : Init"); - theTopology = aType; - theNodes = allNodes; - theName = aName; - InitTypeAndForm(136,0); + return myNodes->Length(); } -Standard_Integer IGESAppli_FiniteElement::NbNodes () const +const Handle(IGESAppli_Node) & IGESAppli_FiniteElement::Node (const Standard_Integer Index) const { - return theNodes->Length(); + return myNodes->Value(Index); } -const Handle(IGESAppli_Node) & IGESAppli_FiniteElement::Node (const Standard_Integer Index) const +void IGESAppli_FiniteElement::OwnRead (IGESFile_Reader &theReader) +{ + theReader.ReadInteger(myTopology,"Topology type"); + Standard_Integer nb; + if (theReader.ReadInteger(nb,"No. of nodes defining element") && nb > 0) + { + myNodes = new IGESAppli_HArray1OfNode(1,nb); + for (Standard_Integer i = 1; i <= nb; i ++) + theReader.ReadPointer(myNodes->ChangeValue(i),"Node defining element"); + } + theReader.ReadText(myName,"Element type name"); +} + +void IGESAppli_FiniteElement::OwnWrite (IGESData_IGESWriter &IW) const { - return theNodes->Value(Index); + const Standard_Integer nb = myNodes->Length(); + IW.Send(myTopology); + IW.Send(nb); + for (Standard_Integer i = 1; i <= nb; i++) + IW.Send(myNodes->Value(i)); + IW.Send(myName); +} + +IGESData_DirChecker IGESAppli_FiniteElement::DirChecker () const +{ + IGESData_DirChecker DC(136,0); //Form no = 0 & Type = 136 + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefAny); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefAny); + DC.BlankStatusIgnored(); + DC.SubordinateStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } void IGESAppli_FiniteElement::OwnShared(Interface_EntityIterator &theIter) const { - const Standard_Integer upper = theNodes->Length(); - for (Standard_Integer i= 1; i <= upper ; i ++) - theIter.GetOneItem(theNodes->Value(i)); + const Standard_Integer nb = myNodes->Length(); + for (Standard_Integer i = 1; i <= nb ; i++) + theIter.GetOneItem(myNodes->Value(i)); +} + +void IGESAppli_FiniteElement::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESAppli_FiniteElement" << endl; + S << "Topology type : " << myTopology << endl; + S << "Nodes : "; + IGESData_DumpEntities(S,dumper,level,1,NbNodes(),Node); + S << endl << "Element Name : " << myName << endl; } diff --git a/src/IGESAppli/IGESAppli_FiniteElement.hxx b/src/IGESAppli/IGESAppli_FiniteElement.hxx index 7c0a1943f2..afbd72c66d 100644 --- a/src/IGESAppli/IGESAppli_FiniteElement.hxx +++ b/src/IGESAppli/IGESAppli_FiniteElement.hxx @@ -34,17 +34,16 @@ class IGESAppli_FiniteElement : public IGESData_IGESEntity { public: - IGESAppli_FiniteElement() {} - - //! This method is used to set the fields of the class - //! FiniteElement - //! - aType : Indicates the topology type - //! - allNodes : List of Nodes defining the element - //! - aName : Element type name - Standard_EXPORT void Init (const Standard_Integer aType, const Handle(IGESAppli_HArray1OfNode)& allNodes, const Handle(TCollection_HAsciiString)& aName); + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 136; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 0; } + + IGESAppli_FiniteElement() + : myTopology(0) + {} //! returns Topology type - Standard_Integer Topology() const { return theTopology; } + Standard_Integer Topology() const { return myTopology; } //! returns the number of nodes defining the element Standard_EXPORT Standard_Integer NbNodes() const; @@ -54,17 +53,25 @@ class IGESAppli_FiniteElement : public IGESData_IGESEntity Standard_EXPORT const Handle(IGESAppli_Node) & Node (const Standard_Integer Index) const; //! returns Element Type Name - const Handle(TCollection_HAsciiString) & Name() const { return theName; } + const Handle(TCollection_HAsciiString) & Name() const { return myName; } + + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; Standard_EXPORT virtual void OwnShared(Interface_EntityIterator &theIter) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_FiniteElement,IGESData_IGESEntity) private: - Standard_Integer theTopology; - Handle(IGESAppli_HArray1OfNode) theNodes; - Handle(TCollection_HAsciiString) theName; + Standard_Integer myTopology; + Handle(IGESAppli_HArray1OfNode) myNodes; + Handle(TCollection_HAsciiString) myName; }; #endif // _IGESAppli_FiniteElement_HeaderFile diff --git a/src/IGESAppli/IGESAppli_Flow.cxx b/src/IGESAppli/IGESAppli_Flow.cxx index 265580eb8f..65209a1b40 100644 --- a/src/IGESAppli/IGESAppli_Flow.cxx +++ b/src/IGESAppli/IGESAppli_Flow.cxx @@ -5,12 +5,12 @@ // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. +// my terms of my GNU Lesser General Public License version 2.1 as published +// by my Free Software Foundation, with special exception defined in my file +// OCCT_LGPL_EXCEPTION.txt. Consult my file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of my license and disclaimer of any warranty. // -// Alternatively, this file may be used under the terms of Open CASCADE +// Alternatively, this file may be used under my terms of Open CASCADE // commercial license or contractual agreement. //-------------------------------------------------------------------- @@ -24,120 +24,225 @@ #include #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_Flow,IGESData_IGESEntity) -void IGESAppli_Flow::Init - (const Standard_Integer nbContextFlags, - const Standard_Integer aFlowType, const Standard_Integer aFuncFlag, - const Handle(IGESData_HArray1OfIGESEntity)& allFlowAssocs, - const Handle(IGESDraw_HArray1OfConnectPoint)& allConnectPoints, - const Handle(IGESData_HArray1OfIGESEntity)& allJoins, - const Handle(Interface_HArray1OfHAsciiString)& allFlowNames, - const Handle(IGESGraph_HArray1OfTextDisplayTemplate)& allTextDisps, - const Handle(IGESData_HArray1OfIGESEntity)& allContFlowAssocs) -{ - theNbContextFlags = nbContextFlags; - theTypeOfFlow = aFlowType; - theFunctionFlag = aFuncFlag; - theFlowAssociativities = allFlowAssocs; - theConnectPoints = allConnectPoints; - theJoins = allJoins; - theFlowNames = allFlowNames; - theTextDisplayTemplates = allTextDisps; - theContFlowAssociativities = allContFlowAssocs; - InitTypeAndForm(402,18); -} - -Standard_Boolean IGESAppli_Flow::OwnCorrect () -{ - if (theNbContextFlags == 2) return Standard_False; - theNbContextFlags = 2; - return Standard_True; -} - - Standard_Integer IGESAppli_Flow::NbFlowAssociativities () const { - return (theFlowAssociativities.IsNull() ? 0 : theFlowAssociativities->Length()); + return (myFlowAssociativities.IsNull() ? 0 : myFlowAssociativities->Length()); } Standard_Integer IGESAppli_Flow::NbConnectPoints () const { - return (theConnectPoints.IsNull() ? 0 : theConnectPoints->Length()); + return (myConnectPoints.IsNull() ? 0 : myConnectPoints->Length()); } Standard_Integer IGESAppli_Flow::NbJoins () const { - return (theJoins.IsNull() ? 0 : theJoins->Length()); + return (myJoins.IsNull() ? 0 : myJoins->Length()); } Standard_Integer IGESAppli_Flow::NbFlowNames () const { - return (theFlowNames.IsNull() ? 0 : theFlowNames->Length()); + return (myFlowNames.IsNull() ? 0 : myFlowNames->Length()); } Standard_Integer IGESAppli_Flow::NbTextDisplayTemplates () const { - return (theTextDisplayTemplates.IsNull() ? 0 : theTextDisplayTemplates->Length()); + return (myTextDisplayTemplates.IsNull() ? 0 : myTextDisplayTemplates->Length()); } Standard_Integer IGESAppli_Flow::NbContFlowAssociativities () const { - return (theContFlowAssociativities.IsNull() ? 0 : theContFlowAssociativities->Length()); + return (myContFlowAssociativities.IsNull() ? 0 : myContFlowAssociativities->Length()); } const Handle(IGESData_IGESEntity) & IGESAppli_Flow::FlowAssociativity (const Standard_Integer Index) const { - return theFlowAssociativities->Value(Index); + return myFlowAssociativities->Value(Index); } const Handle(IGESDraw_ConnectPoint) & IGESAppli_Flow::ConnectPoint (const Standard_Integer Index) const { - return theConnectPoints->Value(Index); + return myConnectPoints->Value(Index); } const Handle(IGESData_IGESEntity) & IGESAppli_Flow::Join (const Standard_Integer Index) const { - return theJoins->Value(Index); + return myJoins->Value(Index); } const Handle(TCollection_HAsciiString) & IGESAppli_Flow::FlowName (const Standard_Integer Index) const { - return theFlowNames->Value(Index); + return myFlowNames->Value(Index); } const Handle(IGESGraph_TextDisplayTemplate) & IGESAppli_Flow::TextDisplayTemplate (const Standard_Integer Index) const { - return theTextDisplayTemplates->Value(Index); + return myTextDisplayTemplates->Value(Index); } const Handle(IGESData_IGESEntity) & IGESAppli_Flow::ContFlowAssociativity (const Standard_Integer Index) const { - return theContFlowAssociativities->Value(Index); + return myContFlowAssociativities->Value(Index); } -void IGESAppli_Flow::OwnShared(Interface_EntityIterator &theIter) const +void IGESAppli_Flow::OwnRead (IGESFile_Reader &theReader) +{ + Standard_Integer aNbContextFlags = 0; + theReader.ReadInteger(aNbContextFlags,"Number of Context Flags"); + if (aNbContextFlags != 2) + theReader.AddFail("Number of Context Flags != 2"); + + Standard_Integer nf = 0; + theReader.ReadInteger(nf,"Number of Flow Associativities"); + if (nf > 0) myFlowAssociativities = new IGESData_HArray1OfIGESEntity(1, nf); + else theReader.AddFail ("Number of Flow Associativities: Not Positive"); + + Standard_Integer nc = 0; + theReader.ReadInteger(nc,"Number of Connect Points"); + if (nc > 0) myConnectPoints = new IGESDraw_HArray1OfConnectPoint(1, nc); + else theReader.AddFail("Number of Connect Points: Not Positive"); + + Standard_Integer nj = 0; + theReader.ReadInteger(nj,"Number of Joins"); + if (nj > 0) myJoins = new IGESData_HArray1OfIGESEntity(1, nj); + else theReader.AddFail("Number of Joins: Not Positive"); + + Standard_Integer nn = 0; + theReader.ReadInteger(nn,"Number of Flow Names"); + if (nn > 0) myFlowNames = new Interface_HArray1OfHAsciiString(1, nn); + else theReader.AddFail("Number of Flow Names: Not Positive"); + + Standard_Integer nt = 0; + theReader.ReadInteger(nt,"Number of Text Displays"); + if (nt > 0) myTextDisplayTemplates = new IGESGraph_HArray1OfTextDisplayTemplate(1, nt); + else theReader.AddFail("Number of Text Displays: Not Positive"); + + Standard_Integer np = 0; + theReader.ReadInteger(np,"Number of Continuation Flows"); + if (np > 0) myContFlowAssociativities = new IGESData_HArray1OfIGESEntity(1, np); + else theReader.AddFail("Number of Continuation Flows Not Positive"); + + if (theReader.ReadInteger(myTypeOfFlow,"Type of Flow") != IGESFile_Reader::ParamOK) + myTypeOfFlow = 0; + + if (theReader.ReadInteger(myFunctionFlag,"Function Flag") != IGESFile_Reader::ParamOK) + myFunctionFlag = 0; + + Standard_Integer i; + + for ( i = 1; i <= nf; i++ ) + theReader.ReadPointer(myFlowAssociativities->ChangeValue(i),"Flow Associativity"); + + for ( i = 1; i <= nc; i++ ) + theReader.ReadPointer(myConnectPoints->ChangeValue(i),"Connect Point"); + + for ( i = 1; i <= nj; i++ ) + theReader.ReadPointer(myJoins->ChangeValue(i),"Join"); + + for ( i = 1; i <= nn; i++ ) + theReader.ReadText(myFlowNames->ChangeValue(i),"Flow Name"); + + for ( i = 1; i <= nt; i++ ) + theReader.ReadPointer(myTextDisplayTemplates->ChangeValue(i),"Text Display Template"); + + for ( i = 1; i <= np; i++ ) + theReader.ReadPointer(myContFlowAssociativities->ChangeValue(i),"Continuation Flow Associativities"); +} + +void IGESAppli_Flow::OwnWrite (IGESData_IGESWriter &IW) const { Standard_Integer i, num; + IW.Send(2); + IW.Send(NbFlowAssociativities()); + IW.Send(NbConnectPoints()); + IW.Send(NbJoins()); + IW.Send(NbFlowNames()); + IW.Send(NbTextDisplayTemplates()); + IW.Send(NbContFlowAssociativities()); + IW.Send(myTypeOfFlow); + IW.Send(myFunctionFlag); for ( num = NbFlowAssociativities(), i = 1; i <= num; i++ ) - theIter.GetOneItem(FlowAssociativity(i)); + IW.Send(FlowAssociativity(i)); for ( num = NbConnectPoints(), i = 1; i <= num; i++ ) - theIter.GetOneItem(ConnectPoint(i)); + IW.Send(ConnectPoint(i)); for ( num = NbJoins(), i = 1; i <= num; i++ ) - theIter.GetOneItem(Join(i)); + IW.Send(Join(i)); + for ( num = NbFlowNames(), i = 1; i <= num; i++ ) + IW.Send(FlowName(i)); for ( num = NbTextDisplayTemplates(), i = 1; i <= num; i++ ) - theIter.GetOneItem(TextDisplayTemplate(i)); + IW.Send(TextDisplayTemplate(i)); for ( num = NbContFlowAssociativities(), i = 1; i <= num; i++ ) - theIter.GetOneItem(ContFlowAssociativity(i)); + IW.Send(ContFlowAssociativity(i)); +} + +void IGESAppli_Flow::OwnShared(Interface_EntityIterator &myIter) const +{ + Standard_Integer i, num; + for ( num = NbFlowAssociativities(), i = 1; i <= num; i++ ) + myIter.GetOneItem(FlowAssociativity(i)); + for ( num = NbConnectPoints(), i = 1; i <= num; i++ ) + myIter.GetOneItem(ConnectPoint(i)); + for ( num = NbJoins(), i = 1; i <= num; i++ ) + myIter.GetOneItem(Join(i)); + for ( num = NbTextDisplayTemplates(), i = 1; i <= num; i++ ) + myIter.GetOneItem(TextDisplayTemplate(i)); + for ( num = NbContFlowAssociativities(), i = 1; i <= num; i++ ) + myIter.GetOneItem(ContFlowAssociativity(i)); +} + +IGESData_DirChecker IGESAppli_Flow::DirChecker () const +{ + IGESData_DirChecker DC(402, 18); + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagRequired(3); + DC.HierarchyStatusIgnored(); + return DC; } void IGESAppli_Flow::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const { - if (NbContextFlags() != 2) - theCheck->AddFail("Number of Context Flags != 2"); - if ((TypeOfFlow() < 0) || (TypeOfFlow() > 2)) + if ((myTypeOfFlow < 0) || (myTypeOfFlow > 2)) theCheck->AddFail("Type of Flow != 0,1,2"); - if ((FunctionFlag() < 0) || (FunctionFlag() > 2)) + if ((myFunctionFlag < 0) || (myFunctionFlag > 2)) theCheck->AddFail("Function Flag != 0,1,2"); } + +void IGESAppli_Flow::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESAppli_Flow" << endl; + S << "Number of Context Flags : 2" << endl; + S << "Type of Flow : " << myTypeOfFlow; + if (myTypeOfFlow == 1) S << " (logical)" << endl; + else if (myTypeOfFlow == 2) S << " (physical)" << endl; + else S << " (not specified)" << endl; + S << "Function Flag : " << myFunctionFlag; + if (myFunctionFlag == 1) S << " (electrical signal)" << endl; + else if (myFunctionFlag == 2) S << " (fluid flow path)" << endl; + else S << " (not specified)" << endl; + S << "Flow Associativities : "; + IGESData_DumpEntities(S,dumper,level,1,NbFlowAssociativities(),FlowAssociativity); + S << endl << "Connect Points : "; + IGESData_DumpEntities(S,dumper,level,1,NbConnectPoints(),ConnectPoint); + S << endl << "Joins : "; + IGESData_DumpEntities(S,dumper,level,1,NbJoins(),Join); + S << endl << "Flow Names : "; + IGESData_DumpStrings(S,level,1,NbFlowNames(),FlowName); + S << endl << "Text Display Templates : "; + IGESData_DumpEntities(S,dumper,level,1,NbTextDisplayTemplates(),TextDisplayTemplate); + S << endl << "Continuation Flow Associativities : "; + IGESData_DumpEntities(S,dumper,level,1,NbContFlowAssociativities(),ContFlowAssociativity); + S << endl; +} diff --git a/src/IGESAppli/IGESAppli_Flow.hxx b/src/IGESAppli/IGESAppli_Flow.hxx index 478a4a5e09..1d05ffb93f 100644 --- a/src/IGESAppli/IGESAppli_Flow.hxx +++ b/src/IGESAppli/IGESAppli_Flow.hxx @@ -40,25 +40,14 @@ class IGESAppli_Flow : public IGESData_IGESEntity { public: - IGESAppli_Flow() {} - - //! This method is used to set the fields of the class Flow - //! - nbContextFlags : Count of Context Flags, always = 2 - //! - aFlowType : Type of Flow, default = 0 - //! - aFuncFlag : Function Flag, default = 0 - //! - allFlowAssocs : Flow Associativity Entities - //! - allConnectPoints : Connect Point Entities - //! - allJoins : Join Entities - //! - allFlowNames : Flow Names - //! - allTextDisps : Text Display Template Entities - //! - allContFlowAssocs : Continuation Flow Associativity Entities - Standard_EXPORT void Init (const Standard_Integer nbContextFlags, const Standard_Integer aFlowType, const Standard_Integer aFuncFlag, const Handle(IGESData_HArray1OfIGESEntity)& allFlowAssocs, const Handle(IGESDraw_HArray1OfConnectPoint)& allConnectPoints, const Handle(IGESData_HArray1OfIGESEntity)& allJoins, const Handle(Interface_HArray1OfHAsciiString)& allFlowNames, const Handle(IGESGraph_HArray1OfTextDisplayTemplate)& allTextDisps, const Handle(IGESData_HArray1OfIGESEntity)& allContFlowAssocs); - - //! forces NbContextFalgs to 2, returns True if changed - Standard_EXPORT Standard_Boolean OwnCorrect(); - - //! returns number of Count of Context Flags, always = 2 - Standard_Integer NbContextFlags() const { return theNbContextFlags; } + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 402; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 18; } + + IGESAppli_Flow() + : myTypeOfFlow(0), + myFunctionFlag(0) + {} //! returns number of Flow Associativity Entities Standard_EXPORT Standard_Integer NbFlowAssociativities() const; @@ -81,12 +70,12 @@ class IGESAppli_Flow : public IGESData_IGESEntity //! returns Type of Flow = 0 : Not Specified (default) //! 1 : Logical //! 2 : Physical - Standard_Integer TypeOfFlow() const { return theTypeOfFlow; } + Standard_Integer TypeOfFlow() const { return myTypeOfFlow; } //! returns Function Flag = 0 : Not Specified (default) //! 1 : Electrical Signal //! 2 : Fluid Flow Path - Standard_Integer FunctionFlag() const { return theFunctionFlag; } + Standard_Integer FunctionFlag() const { return myFunctionFlag; } //! returns Flow Associativity Entity //! raises exception if Index <= 0 or Index > NbFlowAssociativities() @@ -112,23 +101,30 @@ class IGESAppli_Flow : public IGESData_IGESEntity //! raises exception if Index <= 0 or Index > NbContFlowAssociativities() Standard_EXPORT const Handle(IGESData_IGESEntity) & ContFlowAssociativity (const Standard_Integer Index) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared(Interface_EntityIterator &theIter) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_Flow,IGESData_IGESEntity) private: - Standard_Integer theNbContextFlags; - Standard_Integer theTypeOfFlow; - Standard_Integer theFunctionFlag; - Handle(IGESData_HArray1OfIGESEntity) theFlowAssociativities; - Handle(IGESDraw_HArray1OfConnectPoint) theConnectPoints; - Handle(IGESData_HArray1OfIGESEntity) theJoins; - Handle(Interface_HArray1OfHAsciiString) theFlowNames; - Handle(IGESGraph_HArray1OfTextDisplayTemplate) theTextDisplayTemplates; - Handle(IGESData_HArray1OfIGESEntity) theContFlowAssociativities; + Standard_Integer myTypeOfFlow; + Standard_Integer myFunctionFlag; + Handle(IGESData_HArray1OfIGESEntity) myFlowAssociativities; + Handle(IGESDraw_HArray1OfConnectPoint) myConnectPoints; + Handle(IGESData_HArray1OfIGESEntity) myJoins; + Handle(Interface_HArray1OfHAsciiString) myFlowNames; + Handle(IGESGraph_HArray1OfTextDisplayTemplate) myTextDisplayTemplates; + Handle(IGESData_HArray1OfIGESEntity) myContFlowAssociativities; }; #endif // _IGESAppli_Flow_HeaderFile diff --git a/src/IGESAppli/IGESAppli_FlowLineSpec.cxx b/src/IGESAppli/IGESAppli_FlowLineSpec.cxx index a47848f632..73aa34890c 100644 --- a/src/IGESAppli/IGESAppli_FlowLineSpec.cxx +++ b/src/IGESAppli/IGESAppli_FlowLineSpec.cxx @@ -19,31 +19,69 @@ #include #include #include -#include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_FlowLineSpec,IGESData_IGESEntity) -void IGESAppli_FlowLineSpec::Init - (const Handle(Interface_HArray1OfHAsciiString)& allProperties) -{ - if (allProperties->Lower() != 1) - Standard_DimensionMismatch::Raise("IGESAppli_FlowLineSpec : Init"); - theNameAndModifiers = allProperties; - InitTypeAndForm(406,14); -} - Standard_Integer IGESAppli_FlowLineSpec::NbPropertyValues () const { - return theNameAndModifiers->Length(); + return myNameAndModifiers->Length(); } const Handle(TCollection_HAsciiString) & IGESAppli_FlowLineSpec::FlowLineName () const { - return theNameAndModifiers->Value(1); + return myNameAndModifiers->Value(1); } const Handle(TCollection_HAsciiString) & IGESAppli_FlowLineSpec::Modifier (const Standard_Integer Index) const { - return theNameAndModifiers->Value(Index); + return myNameAndModifiers->Value(Index); +} + +void IGESAppli_FlowLineSpec::OwnRead (IGESFile_Reader &theReader) +{ + Standard_Integer num = 0; + theReader.ReadInteger(num,"Number of property values"); + if (num > 0) + { + myNameAndModifiers = new Interface_HArray1OfHAsciiString(1, num); + theReader.ReadTexts(myNameAndModifiers,num,"Name and Modifiers"); + } + else theReader.AddFail("Number of property values: Not Positive"); +} + +void IGESAppli_FlowLineSpec::OwnWrite (IGESData_IGESWriter &IW) const +{ + const Standard_Integer num = myNameAndModifiers->Length(); + IW.Send(num); + for ( Standard_Integer i = 1; i <= num; i++ ) + IW.Send(myNameAndModifiers->Value(i)); +} + +IGESData_DirChecker IGESAppli_FlowLineSpec::DirChecker () const +{ + IGESData_DirChecker DC(406, 14); + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; +} + +void IGESAppli_FlowLineSpec::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESAppli_FlowLineSpec" << endl; + S << "Name and Modifiers : "; + IGESData_DumpStrings(S,level,1,NbPropertyValues(),Modifier); + S << endl; } diff --git a/src/IGESAppli/IGESAppli_FlowLineSpec.hxx b/src/IGESAppli/IGESAppli_FlowLineSpec.hxx index 3e396a2efa..521446334a 100644 --- a/src/IGESAppli/IGESAppli_FlowLineSpec.hxx +++ b/src/IGESAppli/IGESAppli_FlowLineSpec.hxx @@ -33,13 +33,12 @@ class IGESAppli_FlowLineSpec : public IGESData_IGESEntity { public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 14; } + IGESAppli_FlowLineSpec() {} - //! This method is used to set the fields of the class - //! FlowLineSpec - //! - allProperties : primary flow line specification and modifiers - Standard_EXPORT void Init (const Handle(Interface_HArray1OfHAsciiString)& allProperties); - //! returns the number of property values Standard_EXPORT Standard_Integer NbPropertyValues() const; @@ -50,11 +49,19 @@ class IGESAppli_FlowLineSpec : public IGESData_IGESEntity //! raises exception if Index <= 1 or Index > NbPropertyValues Standard_EXPORT const Handle(TCollection_HAsciiString) & Modifier (const Standard_Integer Index) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_FlowLineSpec,IGESData_IGESEntity) private: - Handle(Interface_HArray1OfHAsciiString) theNameAndModifiers; + Handle(Interface_HArray1OfHAsciiString) myNameAndModifiers; }; #endif // _IGESAppli_FlowLineSpec_HeaderFile diff --git a/src/IGESAppli/IGESAppli_GeneralModule.cxx b/src/IGESAppli/IGESAppli_GeneralModule.cxx index fb684b5115..3c8014128b 100644 --- a/src/IGESAppli/IGESAppli_GeneralModule.cxx +++ b/src/IGESAppli/IGESAppli_GeneralModule.cxx @@ -81,25 +81,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include @@ -111,12 +92,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_GeneralModule,IGESData_GeneralModule) -void IGESAppli_GeneralModule::OwnSharedCase (const Standard_Integer, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const -{ - ent->OwnShared(iter); -} - - IGESData_DirChecker IGESAppli_GeneralModule::DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const { // For IGESSolid { @@ -266,185 +241,11 @@ IGESData_DirChecker IGESAppli_GeneralModule::DirChecker (const Standard_Integer return tool.DirChecker(anent); } // } - case 25 : { - DeclareAndCast(IGESAppli_DrilledHole,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolDrilledHole tool; - return tool.DirChecker(anent); - } - case 26 : { - DeclareAndCast(IGESAppli_ElementResults,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolElementResults tool; - return tool.DirChecker(anent); - } - case 27 : { - DeclareAndCast(IGESAppli_FiniteElement,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolFiniteElement tool; - return tool.DirChecker(anent); - } - case 28 : { - DeclareAndCast(IGESAppli_Flow,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolFlow tool; - return tool.DirChecker(anent); - } - case 29 : { - DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolFlowLineSpec tool; - return tool.DirChecker(anent); - } - case 30 : { - DeclareAndCast(IGESAppli_LevelFunction,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolLevelFunction tool; - return tool.DirChecker(anent); - } - case 31 : { - DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolLevelToPWBLayerMap tool; - return tool.DirChecker(anent); - } - case 32 : { - DeclareAndCast(IGESAppli_LineWidening,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolLineWidening tool; - return tool.DirChecker(anent); - } - case 33 : { - DeclareAndCast(IGESAppli_NodalConstraint,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolNodalConstraint tool; - return tool.DirChecker(anent); - } - case 34 : { - DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolNodalDisplAndRot tool; - return tool.DirChecker(anent); - } - case 35 : { - DeclareAndCast(IGESAppli_NodalResults,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolNodalResults tool; - return tool.DirChecker(anent); - } - case 36 : { - DeclareAndCast(IGESAppli_Node,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolNode tool; - return tool.DirChecker(anent); - } - case 37 : { - DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolPWBArtworkStackup tool; - return tool.DirChecker(anent); - } - case 38 : { - DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolPWBDrilledHole tool; - return tool.DirChecker(anent); - } - case 39 : { - DeclareAndCast(IGESAppli_PartNumber,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolPartNumber tool; - return tool.DirChecker(anent); - } - case 40 : { - DeclareAndCast(IGESAppli_PinNumber,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolPinNumber tool; - return tool.DirChecker(anent); - } - case 41 : { - DeclareAndCast(IGESAppli_PipingFlow,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolPipingFlow tool; - return tool.DirChecker(anent); - } - case 42 : { - DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolReferenceDesignator tool; - return tool.DirChecker(anent); - } - case 43 : { - DeclareAndCast(IGESAppli_RegionRestriction,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolRegionRestriction tool; - return tool.DirChecker(anent); - } default : break; } return IGESData_DirChecker(); // by default, no specific criterium } - -void IGESAppli_GeneralModule::OwnCheckCase (const Standard_Integer, const Handle(IGESData_IGESEntity)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const -{ - ent->OwnCheck(shares,ach); -} - - -Standard_Boolean IGESAppli_GeneralModule::NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& ent) const -{ - // For IGESSolid { - switch (CN) { - case 1 : ent = new IGESSolid_Block; break; - case 2 : ent = new IGESSolid_BooleanTree; break; - case 3 : ent = new IGESSolid_ConeFrustum; break; - case 4 : ent = new IGESSolid_ConicalSurface; break; - case 5 : ent = new IGESSolid_Cylinder; break; - case 6 : ent = new IGESSolid_CylindricalSurface; break; - case 7 : ent = new IGESSolid_EdgeList; break; - case 8 : ent = new IGESSolid_Ellipsoid; break; - case 9 : ent = new IGESSolid_Face; break; - case 10 : ent = new IGESSolid_Loop; break; - case 11 : ent = new IGESSolid_ManifoldSolid; break; - case 12 : ent = new IGESSolid_PlaneSurface; break; - case 13 : ent = new IGESSolid_RightAngularWedge; break; - case 14 : ent = new IGESSolid_SelectedComponent; break; - case 15 : ent = new IGESSolid_Shell; break; - case 16 : ent = new IGESSolid_SolidAssembly; break; - case 17 : ent = new IGESSolid_SolidInstance; break; - case 18 : ent = new IGESSolid_SolidOfLinearExtrusion; break; - case 19 : ent = new IGESSolid_SolidOfRevolution; break; - case 20 : ent = new IGESSolid_Sphere; break; - case 21 : ent = new IGESSolid_SphericalSurface; break; - case 22 : ent = new IGESSolid_ToroidalSurface; break; - case 23 : ent = new IGESSolid_Torus; break; - case 24 : ent = new IGESSolid_VertexList; break; - // } - case 25 : ent = new IGESAppli_DrilledHole; break; - case 26 : ent = new IGESAppli_ElementResults; break; - case 27 : ent = new IGESAppli_FiniteElement; break; - case 28 : ent = new IGESAppli_Flow; break; - case 29 : ent = new IGESAppli_FlowLineSpec; break; - case 30 : ent = new IGESAppli_LevelFunction; break; - case 31 : ent = new IGESAppli_LevelToPWBLayerMap; break; - case 32 : ent = new IGESAppli_LineWidening; break; - case 33 : ent = new IGESAppli_NodalConstraint; break; - case 34 : ent = new IGESAppli_NodalDisplAndRot; break; - case 35 : ent = new IGESAppli_NodalResults; break; - case 36 : ent = new IGESAppli_Node; break; - case 37 : ent = new IGESAppli_PWBArtworkStackup; break; - case 38 : ent = new IGESAppli_PWBDrilledHole; break; - case 39 : ent = new IGESAppli_PartNumber; break; - case 40 : ent = new IGESAppli_PinNumber; break; - case 41 : ent = new IGESAppli_PipingFlow; break; - case 42 : ent = new IGESAppli_ReferenceDesignator; break; - case 43 : ent = new IGESAppli_RegionRestriction; break; - default : return Standard_False; // by default, Failure on Recognize - } - return Standard_True; -} - Standard_Integer IGESAppli_GeneralModule::CategoryNumber (const Standard_Integer CN, const Handle(Standard_Transient)& /*ent*/, const Interface_ShareTool& ) const { // For IGESSolid { diff --git a/src/IGESAppli/IGESAppli_GeneralModule.hxx b/src/IGESAppli/IGESAppli_GeneralModule.hxx index 0cef4f7b65..4bb3730e5e 100644 --- a/src/IGESAppli/IGESAppli_GeneralModule.hxx +++ b/src/IGESAppli/IGESAppli_GeneralModule.hxx @@ -32,21 +32,11 @@ class IGESAppli_GeneralModule : public IGESData_GeneralModule //! Creates a GeneralModule from IGESAppli and puts it into GeneralLib IGESAppli_GeneralModule() {} - //! Lists the Entities shared by a given IGESEntity , from - //! its specific parameters : specific for each type - Standard_EXPORT void OwnSharedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - //! Returns a DirChecker, specific for each type of Entity //! (identified by its Case Number) : this DirChecker defines //! constraints which must be respected by the DirectoryPart Standard_EXPORT IGESData_DirChecker DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - //! Performs Specific Semantic Check for each type of Entity - Standard_EXPORT void OwnCheckCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE; - - //! Specific creation of a new void entity - Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE; - //! Returns a category number which characterizes an entity //! FEA for : ElementResults,FiniteElement,Node&Co //! Piping for : Flow & Co diff --git a/src/IGESAppli/IGESAppli_HArray1OfFiniteElement.hxx b/src/IGESAppli/IGESAppli_HArray1OfFiniteElement.hxx index 0bab1cdbdb..958ad0422b 100644 --- a/src/IGESAppli/IGESAppli_HArray1OfFiniteElement.hxx +++ b/src/IGESAppli/IGESAppli_HArray1OfFiniteElement.hxx @@ -17,11 +17,9 @@ #ifndef IGESAppli_HArray1OfFiniteElement_HeaderFile #define IGESAppli_HArray1OfFiniteElement_HeaderFile -#include #include #include DEFINE_HARRAY1(IGESAppli_HArray1OfFiniteElement, IGESAppli_Array1OfFiniteElement) - #endif diff --git a/src/IGESAppli/IGESAppli_HArray1OfFlow.hxx b/src/IGESAppli/IGESAppli_HArray1OfFlow.hxx deleted file mode 100644 index f3ff61d0a9..0000000000 --- a/src/IGESAppli/IGESAppli_HArray1OfFlow.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// Created on: 1993-01-11 -// Created by: CKY / Contract Toubro-Larsen (Anand NATRAJAN) -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef IGESAppli_HArray1OfFlow_HeaderFile -#define IGESAppli_HArray1OfFlow_HeaderFile - -#include -#include -#include - -DEFINE_HARRAY1(IGESAppli_HArray1OfFlow, IGESAppli_Array1OfFlow) - - -#endif diff --git a/src/IGESAppli/IGESAppli_HArray1OfNode.hxx b/src/IGESAppli/IGESAppli_HArray1OfNode.hxx index 23ceae72d8..3bdc2ae551 100644 --- a/src/IGESAppli/IGESAppli_HArray1OfNode.hxx +++ b/src/IGESAppli/IGESAppli_HArray1OfNode.hxx @@ -17,11 +17,9 @@ #ifndef IGESAppli_HArray1OfNode_HeaderFile #define IGESAppli_HArray1OfNode_HeaderFile -#include #include #include DEFINE_HARRAY1(IGESAppli_HArray1OfNode, IGESAppli_Array1OfNode) - #endif diff --git a/src/IGESAppli/IGESAppli_LevelFunction.cxx b/src/IGESAppli/IGESAppli_LevelFunction.cxx index 104ae9d2cd..cfa6c93480 100644 --- a/src/IGESAppli/IGESAppli_LevelFunction.cxx +++ b/src/IGESAppli/IGESAppli_LevelFunction.cxx @@ -18,22 +18,53 @@ #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_LevelFunction,IGESData_IGESEntity) - void IGESAppli_LevelFunction::Init - (const Standard_Integer nbPropVal, - const Standard_Integer aCode, - const Handle(TCollection_HAsciiString)& aFuncDescrip) +void IGESAppli_LevelFunction::OwnRead (IGESFile_Reader &theReader) { - theNbPropertyValues = nbPropVal; - theFuncDescripCode = aCode; - theFuncDescrip = aFuncDescrip; - InitTypeAndForm(406,3); + Standard_Integer aNbPropertyValues = 2; + if (theReader.ReadInteger(aNbPropertyValues,"No. of Property values") == IGESFile_Reader::ParamError || aNbPropertyValues != 2) + theReader.AddFail("Number of Property Values != 2"); + + myFuncDescripCode = 0; + theReader.ReadInteger(myFuncDescripCode,"Function description code"); + + theReader.ReadText(myFuncDescrip,"Function description"); +} + +void IGESAppli_LevelFunction::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(2); + IW.Send(myFuncDescripCode); + if (myFuncDescrip.IsNull()) IW.SendVoid(); + else IW.Send(myFuncDescrip); +} + +IGESData_DirChecker IGESAppli_LevelFunction::DirChecker () const +{ + IGESData_DirChecker DC(406,3); //Form no = 3 & Type = 406 + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + DC.SubordinateStatusRequired(00); + return DC; } -void IGESAppli_LevelFunction::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const +void IGESAppli_LevelFunction::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const { - if (NbPropertyValues() != 2) - theCheck->AddFail("Number of Property Values != 2"); + S << "IGESAppli_LevelFunction" << endl; + S << "Number of property values : 2" << endl; + S << "Function Description code : " << myFuncDescripCode << endl; + S << "Function Description : "; + IGESData_DumpString(S,myFuncDescrip); + S << endl; } diff --git a/src/IGESAppli/IGESAppli_LevelFunction.hxx b/src/IGESAppli/IGESAppli_LevelFunction.hxx index 0ef994fc7c..97a20b5cdc 100644 --- a/src/IGESAppli/IGESAppli_LevelFunction.hxx +++ b/src/IGESAppli/IGESAppli_LevelFunction.hxx @@ -32,36 +32,35 @@ class IGESAppli_LevelFunction : public IGESData_IGESEntity { public: - IGESAppli_LevelFunction() {} - - //! This method is used to set the fields of the class - //! LevelFunction - //! - nbPropVal : Number of Properties, always = 2 - //! - aCode : Function Description code - //! default = 0 - //! - aFuncDescrip : Function Description - //! default = null string - Standard_EXPORT void Init (const Standard_Integer nbPropVal, const Standard_Integer aCode, const Handle(TCollection_HAsciiString)& aFuncDescrip); - - //! is always 2 - Standard_Integer NbPropertyValues() const { return theNbPropertyValues; } + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 3; } + + IGESAppli_LevelFunction() + : myFuncDescripCode(0) + {} //! returns the function description code . Default = 0 - Standard_Integer FuncDescriptionCode() const { return theFuncDescripCode; } + Standard_Integer FuncDescriptionCode() const { return myFuncDescripCode; } //! returns the function description //! Default = null string - const Handle(TCollection_HAsciiString) & FuncDescription() const { return theFuncDescrip; } + const Handle(TCollection_HAsciiString) & FuncDescription() const { return myFuncDescrip; } + + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; - Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESAppli_LevelFunction,IGESData_IGESEntity) private: - Standard_Integer theNbPropertyValues; - Standard_Integer theFuncDescripCode; - Handle(TCollection_HAsciiString) theFuncDescrip; + Standard_Integer myFuncDescripCode; + Handle(TCollection_HAsciiString) myFuncDescrip; }; #endif // _IGESAppli_LevelFunction_HeaderFile diff --git a/src/IGESAppli/IGESAppli_LevelToPWBLayerMap.cxx b/src/IGESAppli/IGESAppli_LevelToPWBLayerMap.cxx index f5aa1aa939..9217d4dad7 100644 --- a/src/IGESAppli/IGESAppli_LevelToPWBLayerMap.cxx +++ b/src/IGESAppli/IGESAppli_LevelToPWBLayerMap.cxx @@ -20,51 +20,114 @@ #include #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_LevelToPWBLayerMap,IGESData_IGESEntity) -void IGESAppli_LevelToPWBLayerMap::Init - (const Standard_Integer nbPropVal, - const Handle(TColStd_HArray1OfInteger)& allExchLevels, - const Handle(Interface_HArray1OfHAsciiString)& allNativeLevels, - const Handle(TColStd_HArray1OfInteger)& allPhysLevels, - const Handle(Interface_HArray1OfHAsciiString)& allExchIdents) -{ - Standard_Integer num = allExchLevels->Length(); - if ( allExchLevels->Lower() != 1 || - (allNativeLevels->Lower() != 1 || allNativeLevels->Length() != num) || - (allPhysLevels->Lower() != 1 || allPhysLevels->Length() != num) || - (allExchIdents->Lower() != 1 || allExchIdents->Length() != num) ) - Standard_DimensionMismatch::Raise("IGESAppli_LevelToPWBLayerMap: Init"); - theNbPropertyValues = nbPropVal; - theExchangeFileLevelNumber = allExchLevels; - theNativeLevel = allNativeLevels; - thePhysicalLayerNumber = allPhysLevels; - theExchangeFileLevelIdent = allExchIdents; - InitTypeAndForm(406,24); -} - Standard_Integer IGESAppli_LevelToPWBLayerMap::NbLevelToLayerDefs () const { - return theExchangeFileLevelNumber->Length(); + return myExchangeFileLevelNumber->Length(); } Standard_Integer IGESAppli_LevelToPWBLayerMap::ExchangeFileLevelNumber (const Standard_Integer Index) const { - return theExchangeFileLevelNumber->Value(Index); + return myExchangeFileLevelNumber->Value(Index); } const Handle(TCollection_HAsciiString) & IGESAppli_LevelToPWBLayerMap::NativeLevel (const Standard_Integer Index) const { - return theNativeLevel->Value(Index); + return myNativeLevel->Value(Index); } Standard_Integer IGESAppli_LevelToPWBLayerMap::PhysicalLayerNumber (const Standard_Integer Index) const { - return thePhysicalLayerNumber->Value(Index); + return myPhysicalLayerNumber->Value(Index); } const Handle(TCollection_HAsciiString) & IGESAppli_LevelToPWBLayerMap::ExchangeFileLevelIdent (const Standard_Integer Index) const { - return theExchangeFileLevelIdent->Value(Index); + return myExchangeFileLevelIdent->Value(Index); +} + +void IGESAppli_LevelToPWBLayerMap::OwnRead (IGESFile_Reader &theReader) +{ + theReader.ReadInteger(myNbPropertyValues,"Number of property values"); + Standard_Integer num = 0; + theReader.ReadInteger(num,"Number of definitions"); + if (num > 0) + { + myExchangeFileLevelNumber = new TColStd_HArray1OfInteger(1, num); + myNativeLevel = new Interface_HArray1OfHAsciiString(1, num); + myPhysicalLayerNumber = new TColStd_HArray1OfInteger(1, num); + myExchangeFileLevelIdent = new Interface_HArray1OfHAsciiString(1, num); + + for ( Standard_Integer i = 1; i <= num; i++ ) + { + theReader.ReadInteger(myExchangeFileLevelNumber->ChangeValue(i),"Exchange File Level Number"); + theReader.ReadText(myNativeLevel->ChangeValue(i),"Native Level Identification"); + theReader.ReadInteger(myPhysicalLayerNumber->ChangeValue(i),"Physical Layer Number"); + theReader.ReadText(myExchangeFileLevelIdent->ChangeValue(i),"Exchange File Level Identification"); + } + } + else theReader.AddFail("Number of definitions: Not Positive"); +} + +void IGESAppli_LevelToPWBLayerMap::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(myNbPropertyValues); + const Standard_Integer num = myExchangeFileLevelNumber->Length(); + IW.Send(num); + for ( Standard_Integer i = 1; i <= num; i++ ) + { + IW.Send(myExchangeFileLevelNumber->Value(i)); + IW.Send(myNativeLevel->Value(i)); + IW.Send(myPhysicalLayerNumber->Value(i)); + IW.Send(myExchangeFileLevelIdent->Value(i)); + } +} + +IGESData_DirChecker IGESAppli_LevelToPWBLayerMap::DirChecker () const +{ + IGESData_DirChecker DC(406, 24); + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; +} + +void IGESAppli_LevelToPWBLayerMap::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESAppli_LevelToPWBLayerMap" << endl; + S << "Number of property values : " << myNbPropertyValues << endl; + S << "Exchange File Level Number : " << endl; + S << "Native Level Identification : " << endl; + S << "Physical Layer Number : " << endl; + S << "Exchange File Level Identification : "; + const Standard_Integer num = myExchangeFileLevelNumber->Length(); + IGESData_DumpStrings(S,-level,1,num,ExchangeFileLevelIdent); + S << endl; + if (level > 4) + for ( Standard_Integer i = 1; i <= num; i++ ) + { + S << "[" << i << "]: " << endl; + S << "Exchange File Level Number : " + << myExchangeFileLevelNumber->Value(i) << endl; + S << "Native Level Identification : "; + IGESData_DumpString(S,myNativeLevel->Value(i)); + S << endl; + S << "Physical Layer Number : " << myPhysicalLayerNumber->Value(i) << endl; + S << "Exchange File Level Identification : "; + IGESData_DumpString(S,myExchangeFileLevelIdent->Value(i)); + S << endl; + } } diff --git a/src/IGESAppli/IGESAppli_LevelToPWBLayerMap.hxx b/src/IGESAppli/IGESAppli_LevelToPWBLayerMap.hxx index d34f24007d..05f39fc932 100644 --- a/src/IGESAppli/IGESAppli_LevelToPWBLayerMap.hxx +++ b/src/IGESAppli/IGESAppli_LevelToPWBLayerMap.hxx @@ -36,21 +36,11 @@ class IGESAppli_LevelToPWBLayerMap : public IGESData_IGESEntity { public: - IGESAppli_LevelToPWBLayerMap() {} - - //! This method is used to set the fields of the class - //! LevelToPWBLayerMap - //! - nbPropVal : Number of property values - //! - allExchLevels : Exchange File Level Numbers - //! - allNativeLevels : Native Level Identifications - //! - allPhysLevels : Physical Layer Numbers - //! - allExchIdents : Exchange File Level Identifications - //! raises exception if allExchLevels, allNativeLevels, allPhysLevels - //! and all ExchIdents are not of same dimensions - Standard_EXPORT void Init (const Standard_Integer nbPropVal, const Handle(TColStd_HArray1OfInteger)& allExchLevels, const Handle(Interface_HArray1OfHAsciiString)& allNativeLevels, const Handle(TColStd_HArray1OfInteger)& allPhysLevels, const Handle(Interface_HArray1OfHAsciiString)& allExchIdents); - - //! returns number of property values - Standard_Integer NbPropertyValues() const { return theNbPropertyValues; } + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 24; } + + IGESAppli_LevelToPWBLayerMap() : myNbPropertyValues(0) {} //! returns number of level to layer definitions Standard_EXPORT Standard_Integer NbLevelToLayerDefs() const; @@ -69,15 +59,23 @@ class IGESAppli_LevelToPWBLayerMap : public IGESData_IGESEntity Standard_EXPORT const Handle(TCollection_HAsciiString) & ExchangeFileLevelIdent (const Standard_Integer Index) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_LevelToPWBLayerMap,IGESData_IGESEntity) private: - Standard_Integer theNbPropertyValues; - Handle(TColStd_HArray1OfInteger) theExchangeFileLevelNumber; - Handle(Interface_HArray1OfHAsciiString) theNativeLevel; - Handle(TColStd_HArray1OfInteger) thePhysicalLayerNumber; - Handle(Interface_HArray1OfHAsciiString) theExchangeFileLevelIdent; + Standard_Integer myNbPropertyValues; + Handle(TColStd_HArray1OfInteger) myExchangeFileLevelNumber; + Handle(Interface_HArray1OfHAsciiString) myNativeLevel; + Handle(TColStd_HArray1OfInteger) myPhysicalLayerNumber; + Handle(Interface_HArray1OfHAsciiString) myExchangeFileLevelIdent; }; #endif // _IGESAppli_LevelToPWBLayerMap_HeaderFile diff --git a/src/IGESAppli/IGESAppli_LineWidening.cxx b/src/IGESAppli/IGESAppli_LineWidening.cxx index 0356b3f2b1..7ef0ec2218 100644 --- a/src/IGESAppli/IGESAppli_LineWidening.cxx +++ b/src/IGESAppli/IGESAppli_LineWidening.cxx @@ -18,22 +18,49 @@ #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_LineWidening,IGESData_IGESEntity) -void IGESAppli_LineWidening::Init - (const Standard_Integer nbPropVal, - const Standard_Real aWidth, const Standard_Integer aCornering, - const Standard_Integer aExtnFlag, const Standard_Integer aJustifFlag, - const Standard_Real aExtnVal) +void IGESAppli_LineWidening::OwnRead (IGESFile_Reader &theReader) { - theNbPropertyValues = nbPropVal; - theWidth = aWidth; - theCorneringCode = aCornering; - theExtensionFlag = aExtnFlag; - theJustificationFlag = aJustifFlag; - theExtensionValue = aExtnVal; - InitTypeAndForm(406,5); + Standard_Integer aNbPropertyValues = 5; + if (theReader.ReadInteger(aNbPropertyValues,"No. of Property values") == IGESFile_Reader::ParamError || aNbPropertyValues != 5) + theReader.AddFail("Number of Property Values != 5"); + theReader.ReadReal(myWidth,"Width of metalization"); + theReader.ReadInteger(myCorneringCode,"Cornering code"); + theReader.ReadInteger(myExtensionFlag,"Extension Flag"); + theReader.ReadInteger(myJustificationFlag,"Justification Flag"); + myExtensionValue = 0.; + if (theReader.ReadReal(myExtensionValue,"Extension value") != IGESFile_Reader::ParamOK) + if (myExtensionFlag == 2) + theReader.AddFail("Extension Value not defined while Extension Flag = 2"); +} + +void IGESAppli_LineWidening::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(5); + IW.Send(myWidth); + IW.Send(myCorneringCode); + IW.Send(myExtensionFlag); + IW.Send(myJustificationFlag); + IW.Send(myExtensionValue); +} + +IGESData_DirChecker IGESAppli_LineWidening::DirChecker () const +{ + IGESData_DirChecker DC(406,5); //Form no = 5 & Type = 406 + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } void IGESAppli_LineWidening::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const @@ -42,12 +69,50 @@ void IGESAppli_LineWidening::OwnCheck (const Interface_ShareTool &, const Handle if (DefLevel() == IGESData_DefOne || DefLevel() == IGESData_DefSeveral) theCheck->AddWarning("Level type: defined while ignored"); - if (NbPropertyValues() != 5) - theCheck->AddFail("Number of Property Values != 5"); - if (CorneringCode() != 0 && CorneringCode() != 1) + + if (myCorneringCode != 0 && myCorneringCode != 1) theCheck->AddFail("Cornering Code incorrect"); - if (ExtensionFlag() < 0 || ExtensionFlag() > 2) + if (myExtensionFlag < 0 || myExtensionFlag > 2) theCheck->AddFail("Extension Flag value incorrect"); - if (JustificationFlag() < 0 || JustificationFlag() > 2) + if (myJustificationFlag < 0 || myJustificationFlag > 2) theCheck->AddFail("Justification Flag value incorrect"); } + +Standard_Boolean IGESAppli_LineWidening::OwnCorrect () +{ + if (SubordinateStatus() != 0) { + Handle(IGESData_LevelListEntity) nulevel; + InitLevel(nulevel,0); + return Standard_True; + } + return Standard_False; +} + +void IGESAppli_LineWidening::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const +{ + S << "IGESAppli_LineWidening" << endl; + S << "Number of property values : 5" << endl; + S << "Width of metalization : " << myWidth << endl; + + S << "Cornering Code : " ; + if (myCorneringCode == 0) S << "0 (rounded)" << endl; + else if (myCorneringCode == 1) S << "1 (squared)" << endl; + else S << "incorrect value" << endl; + + S << "Extension Flag : " ; + if (myExtensionFlag == 0) S << "0 (No Extension)" << endl; + else if (myExtensionFlag == 1) S << "1 (One-half width extension)" << endl; + else if (myExtensionFlag == 2) S << "2 (Extension set by ExtensionValue)" << endl; + else S << "incorrect value" << endl; + + S << "Justification Flag : " ; + if (myJustificationFlag == 0) S << "0 (centre justified)" << endl; + else if (myJustificationFlag == 1) S << "1 (left justified)" << endl; + else if (myJustificationFlag == 2) S << "2 (right justified)" << endl; + else S << "incorrect value" << endl; + + if (myExtensionFlag == 2) + S << "Extension Value : " << myExtensionValue << endl; + else + S << "No Extension Value (Extension Flag != 2)" << endl; +} diff --git a/src/IGESAppli/IGESAppli_LineWidening.hxx b/src/IGESAppli/IGESAppli_LineWidening.hxx index b0f7e578da..03c0242584 100644 --- a/src/IGESAppli/IGESAppli_LineWidening.hxx +++ b/src/IGESAppli/IGESAppli_LineWidening.hxx @@ -30,65 +30,62 @@ class IGESAppli_LineWidening : public IGESData_IGESEntity { public: - IGESAppli_LineWidening() {} - - //! This method is used to set the fields of the class - //! LineWidening - //! - nbPropVal : Number of property values = 5 - //! - aWidth : Width of metalization - //! - aCornering : Cornering codes - //! 0 = rounded - //! 1 = squared - //! - aExtnFlag : Extension Flag - //! 0 = No Extension - //! 1 = One-half width extension - //! 2 = Extn set by ExtnVal - //! - aJustifFlag : Justification flag - //! 0 = Center justified - //! 1 = left justified - //! 2 = right justified - //! - aExtnVal : Extension value if aExtnFlag = 2 - Standard_EXPORT void Init (const Standard_Integer nbPropVal, const Standard_Real aWidth, const Standard_Integer aCornering, const Standard_Integer aExtnFlag, const Standard_Integer aJustifFlag, const Standard_Real aExtnVal); - - //! returns the number of property values - //! is always 5 - Standard_Integer NbPropertyValues() const { return theNbPropertyValues; } + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 5; } + + IGESAppli_LineWidening() + : myWidth(0.), + myCorneringCode(0), + myExtensionFlag(0), + myJustificationFlag(0), + myExtensionValue(0.) + {} + //! returns the width of metallization - Standard_Real WidthOfMetalization() const { return theWidth; } + Standard_Real WidthOfMetalization() const { return myWidth; } //! returns the cornering code //! 0 = Rounded / 1 = Squared - Standard_Integer CorneringCode() const { return theCorneringCode; } + Standard_Integer CorneringCode() const { return myCorneringCode; } //! returns the extension flag //! 0 = No extension //! 1 = One-half width extension //! 2 = Extension set by theExtnVal - Standard_Integer ExtensionFlag() const { return theExtensionFlag; } + Standard_Integer ExtensionFlag() const { return myExtensionFlag; } //! returns the justification flag //! 0 = Centre justified //! 1 = Left justified //! 2 = Right justified - Standard_Integer JustificationFlag() const { return theJustificationFlag; } + Standard_Integer JustificationFlag() const { return myJustificationFlag; } //! returns the Extension Value //! Present only if theExtnFlag = 2 - Standard_Real ExtensionValue() const { return theExtensionValue; } + Standard_Real ExtensionValue() const { return myExtensionValue; } + + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual Standard_Boolean OwnCorrect () Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_LineWidening,IGESData_IGESEntity) private: - Standard_Integer theNbPropertyValues; - Standard_Real theWidth; - Standard_Integer theCorneringCode; - Standard_Integer theExtensionFlag; - Standard_Integer theJustificationFlag; - Standard_Real theExtensionValue; + Standard_Real myWidth; + Standard_Integer myCorneringCode; + Standard_Integer myExtensionFlag; + Standard_Integer myJustificationFlag; + Standard_Real myExtensionValue; }; #endif // _IGESAppli_LineWidening_HeaderFile diff --git a/src/IGESAppli/IGESAppli_NodalConstraint.cxx b/src/IGESAppli/IGESAppli_NodalConstraint.cxx index 31239808c8..b4efac2170 100644 --- a/src/IGESAppli/IGESAppli_NodalConstraint.cxx +++ b/src/IGESAppli/IGESAppli_NodalConstraint.cxx @@ -22,42 +22,84 @@ #include #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_NodalConstraint,IGESData_IGESEntity) -void IGESAppli_NodalConstraint::Init - (const Standard_Integer aType, - const Handle(IGESAppli_Node)& aNode, - const Handle(IGESDefs_HArray1OfTabularData)& allTabData) +Standard_Integer IGESAppli_NodalConstraint::NbCases () const { - if (allTabData->Lower() != 1) - Standard_DimensionMismatch::Raise("IGESAppli_NodalConstraint : Init"); - theType = aType; - theNode = aNode; - theTabularDataProps = allTabData; - InitTypeAndForm(418,0); + return myTabularDataProps->Length(); } -Standard_Integer IGESAppli_NodalConstraint::NbCases () const +const Handle(IGESDefs_TabularData) & IGESAppli_NodalConstraint::TabularData (const Standard_Integer Index) const { - return theTabularDataProps->Length(); + return myTabularDataProps->Value(Index); } -const Handle(IGESDefs_TabularData) & IGESAppli_NodalConstraint::TabularData (const Standard_Integer Index) const +void IGESAppli_NodalConstraint::OwnRead (IGESFile_Reader &theReader) { - return theTabularDataProps->Value(Index); + Standard_Integer num = 0; + theReader.ReadInteger(num,"Number of cases"); + if (num > 0) myTabularDataProps = new IGESDefs_HArray1OfTabularData(1, num); + else theReader.AddFail("Number of cases: Not Positive"); + + theReader.ReadInteger(myType,"Type of Constraint"); + theReader.ReadPointer(myNode,"Node"); + + for ( Standard_Integer i = 1; i <= num; i++ ) + theReader.ReadPointer(myTabularDataProps->ChangeValue(i),"Tabular Data Property"); +} + +void IGESAppli_NodalConstraint::OwnWrite (IGESData_IGESWriter &IW) const +{ + const Standard_Integer num = myTabularDataProps->Length(); + IW.Send(num); + IW.Send(myType); + IW.Send(myNode); + for ( Standard_Integer i = 1; i <= num; i++ ) + IW.Send(myTabularDataProps->Value(i)); } void IGESAppli_NodalConstraint::OwnShared(Interface_EntityIterator &theIter) const { - theIter.GetOneItem(NodeEntity()); - const Standard_Integer num = NbCases(); + theIter.GetOneItem(myNode); + const Standard_Integer num = myTabularDataProps->Length(); for ( Standard_Integer i = 1; i <= num; i++ ) - theIter.GetOneItem(TabularData(i)); + theIter.GetOneItem(myTabularDataProps->Value(i)); +} + +IGESData_DirChecker IGESAppli_NodalConstraint::DirChecker () const +{ + IGESData_DirChecker DC(418, 0); + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.HierarchyStatusIgnored(); + return DC; } void IGESAppli_NodalConstraint::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const { - if ((Type() != 1) && (Type() != 2)) + if ((myType != 1) && (myType != 2)) theCheck->AddFail("Type of Constraint != 1,2"); } + +void IGESAppli_NodalConstraint::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + Standard_Integer sublevel = (level > 4) ? 1 : 0; + S << "IGESAppli_NodalConstraint" << endl; + S << "Type of Constraint : " << myType << endl; + S << "Node : "; + dumper.Dump(myNode,S,sublevel); + S << endl; + S << "Tabular Data Properties : "; + IGESData_DumpEntities(S,dumper,level,1,NbCases(),TabularData); + S << endl; +} diff --git a/src/IGESAppli/IGESAppli_NodalConstraint.hxx b/src/IGESAppli/IGESAppli_NodalConstraint.hxx index 5a31a6ccdb..d0053cdd01 100644 --- a/src/IGESAppli/IGESAppli_NodalConstraint.hxx +++ b/src/IGESAppli/IGESAppli_NodalConstraint.hxx @@ -36,40 +36,46 @@ class IGESAppli_NodalConstraint : public IGESData_IGESEntity { public: - IGESAppli_NodalConstraint() {} - - //! This method is used to set the fields of the class - //! NodalConstraint - //! - aType : Loads / Constraints - //! - aNode : the Node - //! - allTabData : Tabular Data Property carrying the load - //! or constraint vector - Standard_EXPORT void Init (const Standard_Integer aType, const Handle(IGESAppli_Node)& aNode, const Handle(IGESDefs_HArray1OfTabularData)& allTabData); + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 418; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 0; } + + IGESAppli_NodalConstraint() + : myType(0) + {} //! returns total number of cases Standard_EXPORT Standard_Integer NbCases() const; //! returns whether Loads (1) or Constraints (2) - Standard_Integer Type() const { return theType; } + Standard_Integer Type() const { return myType; } //! returns the Node - const Handle(IGESAppli_Node) & NodeEntity() const { return theNode; } + const Handle(IGESAppli_Node) & NodeEntity() const { return myNode; } //! returns Tabular Data Property carrying load or constraint vector //! raises exception if Index <= 0 or Index > NbCases Standard_EXPORT const Handle(IGESDefs_TabularData) & TabularData (const Standard_Integer Index) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared(Interface_EntityIterator &theIter) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_NodalConstraint,IGESData_IGESEntity) private: - Standard_Integer theType; - Handle(IGESAppli_Node) theNode; - Handle(IGESDefs_HArray1OfTabularData) theTabularDataProps; + Standard_Integer myType; + Interface_Pointer myNode; + Handle(IGESDefs_HArray1OfTabularData) myTabularDataProps; }; #endif // _IGESAppli_NodalConstraint_HeaderFile diff --git a/src/IGESAppli/IGESAppli_NodalDisplAndRot.cxx b/src/IGESAppli/IGESAppli_NodalDisplAndRot.cxx index 86eee184f1..890789f238 100644 --- a/src/IGESAppli/IGESAppli_NodalDisplAndRot.cxx +++ b/src/IGESAppli/IGESAppli_NodalDisplAndRot.cxx @@ -25,86 +25,197 @@ #include #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_NodalDisplAndRot,IGESData_IGESEntity) -void IGESAppli_NodalDisplAndRot::Init - (const Handle(IGESDimen_HArray1OfGeneralNote)& allNotes, - const Handle(TColStd_HArray1OfInteger)& allIdentifiers, - const Handle(IGESAppli_HArray1OfNode)& allNodes, - const Handle(IGESBasic_HArray1OfHArray1OfXYZ)& allRotParams, - const Handle(IGESBasic_HArray1OfHArray1OfXYZ)& allTransParams) -{ - if ( allNodes->Lower() != 1 || - (allIdentifiers->Lower() != 1 || - allIdentifiers->Length() != allNodes->Length()) || - (allTransParams->Lower() != 1 || - allTransParams->Length() != allNodes->Length()) || - (allRotParams->Lower() != 1 || - allRotParams->Length() != allNodes->Length()) ) - Standard_DimensionMismatch::Raise - ("IGESAppli_NodalDisplAndRot : Init(Lengths of arrays inconsistent)"); - - for (Standard_Integer i= 1; i <= allNodes->Length(); i++) - { - Handle(TColgp_HArray1OfXYZ) temp1 = allTransParams->Value(i); - Handle(TColgp_HArray1OfXYZ) temp2 = allRotParams->Value(i); - if ((temp1->Lower() != 1 || temp1->Length() != allNotes->Length()) || - (temp2->Lower() != 1 || temp2->Length() != allNotes->Length()) ) - Standard_DimensionMismatch::Raise - ("IGESAppli_NodalDisplAndRot: Init(No. of Param per Node != Nbcases)"); - } - - theNotes = allNotes; - theNodes = allNodes; - theNodeIdentifiers = allIdentifiers; - theTransParam = allTransParams; - theRotParam = allRotParams; - InitTypeAndForm(138,0); -} - Standard_Integer IGESAppli_NodalDisplAndRot::NbCases () const { - return theNotes->Length(); + return myNotes->Length(); } Standard_Integer IGESAppli_NodalDisplAndRot::NbNodes () const { - return theNodes->Length(); + return myNodes->Length(); } const Handle(IGESDimen_GeneralNote) & IGESAppli_NodalDisplAndRot::Note (const Standard_Integer Index) const { - return theNotes->Value(Index); + return myNotes->Value(Index); } Standard_Integer IGESAppli_NodalDisplAndRot::NodeIdentifier (const Standard_Integer Index) const { - return theNodeIdentifiers->Value(Index); + return myNodeIdentifiers->Value(Index); } const Handle(IGESAppli_Node) & IGESAppli_NodalDisplAndRot::Node (const Standard_Integer Index) const { - return theNodes->Value(Index); + return myNodes->Value(Index); } const gp_XYZ & IGESAppli_NodalDisplAndRot::TranslationParameter (const Standard_Integer NodeNum, const Standard_Integer CaseNum) const { - return theTransParam->Value(NodeNum)->Value(CaseNum); + return myTransParam->Value(NodeNum)->Value(CaseNum); } const gp_XYZ & IGESAppli_NodalDisplAndRot::RotationalParameter (const Standard_Integer NodeNum, const Standard_Integer CaseNum) const { - return theRotParam->Value(NodeNum)->Value(CaseNum); + return myRotParam->Value(NodeNum)->Value(CaseNum); +} + +void IGESAppli_NodalDisplAndRot::OwnRead (IGESFile_Reader &theReader) +{ + Standard_Integer nbcases = 0; + theReader.ReadInteger(nbcases,"No. of analysis cases"); + if (nbcases > 0) + { + myNotes = new IGESDimen_HArray1OfGeneralNote(1,nbcases); + for (Standard_Integer i=1; i <= nbcases; i++) + theReader.ReadPointer(myNotes->ChangeValue(i),"General Note"); + } + + Standard_Integer nbnodes = 0; + theReader.ReadInteger(nbnodes,"No. of nodes"); + if (nbnodes > 0) + { + myNodeIdentifiers = new TColStd_HArray1OfInteger(1,nbnodes); + myNodes = new IGESAppli_HArray1OfNode(1,nbnodes); + myTransParam = new IGESBasic_HArray1OfHArray1OfXYZ(1, nbnodes); + myRotParam = new IGESBasic_HArray1OfHArray1OfXYZ(1, nbnodes); + + for (Standard_Integer j=1; j <=nbnodes; j++) + { + theReader.ReadInteger(myNodeIdentifiers->ChangeValue(j),"Node number"); + theReader.ReadPointer(myNodes->ChangeValue(j),"Node Directory Entry"); + + if (nbcases > 0) + { + Handle(TColgp_HArray1OfXYZ) arr1 = new TColgp_HArray1OfXYZ(1,nbcases); + Handle(TColgp_HArray1OfXYZ) arr2 = new TColgp_HArray1OfXYZ(1,nbcases); + for (Standard_Integer k = 1; k <= nbcases; k++) + { + theReader.ReadXYZ(arr1->ChangeValue(k),"Translation XYZ"); + theReader.ReadXYZ(arr2->ChangeValue(k),"Rotational XYZ"); + } + myTransParam->SetValue(j,arr1); + myRotParam->SetValue(j,arr2); + } + } + } +} + +void IGESAppli_NodalDisplAndRot::OwnWrite (IGESData_IGESWriter &IW) const +{ + const Standard_Integer nbcases = myNotes->Length(); + const Standard_Integer nbnodes = myNodes->Length(); + + IW.Send(nbcases); + for (Standard_Integer i = 1; i <= nbcases; i ++) + IW.Send(myNotes->Value(i)); + IW.Send(nbnodes); + for (Standard_Integer j = 1; j <= nbnodes; j ++) + { + IW.Send(myNodeIdentifiers->Value(j)); + IW.Send(myNodes->Value(j)); + for (Standard_Integer k = 1; k <= nbcases; k ++) + { + IW.Send(TranslationParameter(j,k).X()); + IW.Send(TranslationParameter(j,k).Y()); + IW.Send(TranslationParameter(j,k).Z()); + IW.Send(RotationalParameter(j,k).X()); + IW.Send(RotationalParameter(j,k).Y()); + IW.Send(RotationalParameter(j,k).Z()); + } + } } void IGESAppli_NodalDisplAndRot::OwnShared(Interface_EntityIterator &theIter) const { - const Standard_Integer nbcases = theNotes->Length(); - const Standard_Integer nbnodes = theNodes->Length(); + const Standard_Integer nbcases = myNotes->Length(); + const Standard_Integer nbnodes = myNodes->Length(); for (Standard_Integer i = 1; i <= nbcases; i ++) - theIter.GetOneItem(theNotes->Value(i)); + theIter.GetOneItem(myNotes->Value(i)); for (Standard_Integer j = 1; j <= nbnodes; j ++) - theIter.GetOneItem(theNodes->Value(j)); + theIter.GetOneItem(myNodes->Value(j)); +} + +IGESData_DirChecker IGESAppli_NodalDisplAndRot::DirChecker () const +{ + IGESData_DirChecker DC(138,0); //Form no = 0 & Type = 138 + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.HierarchyStatusIgnored(); + return DC; +} + +void IGESAppli_NodalDisplAndRot::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESAppli_NodalDisplAndRot" << endl; + + const Standard_Integer nbcases = myNotes->Length(); + const Standard_Integer nbnodes = myNodes->Length(); + + S << "No. of analysis cases : " << nbcases << endl; + S << "General Notes : "; + IGESData_DumpEntities(S,dumper,level,1,nbcases,Note); + S << endl; + + switch (level) + { + case 4: + S << "Nodes : "; + IGESData_DumpEntities(S,dumper,-level,1,nbnodes,Node); + S << "NodeIdentifiers : "; + IGESData_DumpVals(S,-level,1,nbnodes,NodeIdentifier); + S << "Translation Parameters : "; + S << "Rotational Parameters : "; + S << " TO BE DONE" << endl; + break; + case 5: + case 6: { + for (Standard_Integer i = 1; i <= nbcases; i ++) + { + S << "[" << i << "]: "; + dumper.Dump (Note(i),S, 1); + S << endl; + } + S << "Nodes : " << endl; + S << "Node Identifiers : " << endl; + S << "Translation Parameters : " << endl; + S << "Rotational Parameters : Count = " << nbcases; + S << endl; + for (Standard_Integer j = 1; j <= nbnodes; j ++) + { + S << "[" << j << "]: - NodeIdentifier : " + << NodeIdentifier(j) << " - Node :"< NbCases() Standard_EXPORT const gp_XYZ & RotationalParameter (const Standard_Integer NodeNum, const Standard_Integer CaseNum) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared(Interface_EntityIterator &theIter) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_NodalDisplAndRot,IGESData_IGESEntity) private: - Handle(IGESDimen_HArray1OfGeneralNote) theNotes; - Handle(TColStd_HArray1OfInteger) theNodeIdentifiers; - Handle(IGESAppli_HArray1OfNode) theNodes; - Handle(IGESBasic_HArray1OfHArray1OfXYZ) theTransParam; - Handle(IGESBasic_HArray1OfHArray1OfXYZ) theRotParam; + Handle(IGESDimen_HArray1OfGeneralNote) myNotes; + Handle(TColStd_HArray1OfInteger) myNodeIdentifiers; + Handle(IGESAppli_HArray1OfNode) myNodes; + Handle(IGESBasic_HArray1OfHArray1OfXYZ) myTransParam; + Handle(IGESBasic_HArray1OfHArray1OfXYZ) myRotParam; }; #endif // _IGESAppli_NodalDisplAndRot_HeaderFile diff --git a/src/IGESAppli/IGESAppli_NodalResults.cxx b/src/IGESAppli/IGESAppli_NodalResults.cxx index dd6112782d..2292b1e974 100644 --- a/src/IGESAppli/IGESAppli_NodalResults.cxx +++ b/src/IGESAppli/IGESAppli_NodalResults.cxx @@ -23,79 +23,109 @@ #include #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_NodalResults,IGESData_IGESEntity) -// Data : Col -> // Nodes. Row : Data per Node - -void IGESAppli_NodalResults::Init - (const Handle(IGESDimen_GeneralNote)& aNote, - const Standard_Integer aNumber, const Standard_Real aTime, - const Handle(TColStd_HArray1OfInteger)& allNodeIdentifiers, - const Handle(IGESAppli_HArray1OfNode)& allNodes, - const Handle(TColStd_HArray2OfReal)& allData) +const Handle(IGESAppli_Node) & IGESAppli_NodalResults::Node (const Standard_Integer Index) const { - if (allNodes->Lower() != 1 || allNodeIdentifiers->Lower() != 1 || - allNodes->Length() != allNodeIdentifiers->Length() || - allData->LowerCol() != 1 || allData->LowerRow() != 1 || - allNodes->Length() != allData->UpperRow() ) - Standard_DimensionMismatch::Raise("IGESAppli_NodalResults : Init"); - theNote = aNote; - theSubCaseNum = aNumber; - theTime = aTime; - theNodeIdentifiers = allNodeIdentifiers; - theNodes = allNodes; - theData = allData; - InitTypeAndForm(146,FormNumber()); -// FormNumber -> Type of the Results + return myNodes->Value(Index); } -void IGESAppli_NodalResults::SetFormNumber (const Standard_Integer form) +Standard_Integer IGESAppli_NodalResults::NbNodes () const { - if (form < 0 || form > 34) Standard_OutOfRange::Raise - ("IGESAppli_NodalResults : SetFormNumber"); - InitTypeAndForm(146,form); + return myNodes->Length(); } -const Handle(IGESAppli_Node) & IGESAppli_NodalResults::Node (const Standard_Integer Index) const +Standard_Integer IGESAppli_NodalResults::NbData () const { - return theNodes->Value(Index); + return myData->RowLength(); } -Standard_Integer IGESAppli_NodalResults::NbNodes () const +Standard_Integer IGESAppli_NodalResults::NodeIdentifier (const Standard_Integer Index) const { - return theNodes->Length(); + return myNodeIdentifiers->Value(Index); } -Standard_Integer IGESAppli_NodalResults::NbData () const +Standard_Real IGESAppli_NodalResults::Data (const Standard_Integer NodeNum, const Standard_Integer DataNum) const { - return theData->RowLength(); + return myData->Value(NodeNum,DataNum); } -Standard_Integer IGESAppli_NodalResults::NodeIdentifier (const Standard_Integer Index) const +void IGESAppli_NodalResults::OwnRead (IGESFile_Reader &theReader) { - return theNodeIdentifiers->Value(Index); + theReader.ReadPointer(myNote,"General Note describing the analysis case"); + theReader.ReadInteger(mySubCaseNum,"Subcase number"); + theReader.ReadReal(myTime,"Analysis time used"); + Standard_Integer nbval = 0; + theReader.ReadInteger(nbval,"No. of values"); + Standard_Integer nbnodes = 0; + theReader.ReadInteger(nbnodes,"No. of nodes"); + if (nbnodes > 0 && nbval > 0) + { + myData = new TColStd_HArray2OfReal(1,nbnodes,1,nbval); + myNodes = new IGESAppli_HArray1OfNode(1,nbnodes); + myNodeIdentifiers = new TColStd_HArray1OfInteger(1,nbnodes); + + for (Standard_Integer i = 1; i <= nbnodes; i ++) + { + theReader.ReadInteger(myNodeIdentifiers->ChangeValue(i),"Node no. identifier"); + theReader.ReadPointer(myNodes->ChangeValue(i),"FEM Node"); + for (Standard_Integer j = 1; j <= nbval; j ++) + theReader.ReadReal(myData->ChangeValue(i,j),"Value"); + } + } } -Standard_Real IGESAppli_NodalResults::Data (const Standard_Integer NodeNum, const Standard_Integer DataNum) const +void IGESAppli_NodalResults::OwnWrite (IGESData_IGESWriter &IW) const { - return theData->Value(NodeNum,DataNum); + const Standard_Integer nbnodes = myNodes->Length(); + Standard_Integer nbdata = myData->RowLength(); + IW.Send(myNote); + IW.Send(mySubCaseNum); + IW.Send(myTime); + IW.Send(nbdata); + IW.Send(nbnodes); + for (Standard_Integer i = 1; i <= nbnodes; i++) + { + IW.Send(myNodeIdentifiers->Value(i)); + IW.Send(myNodes->Value(i)); + for (Standard_Integer j = 1; j <= nbdata; j++) + IW.Send(myData->Value(i,j)); + } } void IGESAppli_NodalResults::OwnShared(Interface_EntityIterator &theIter) const { - theIter.GetOneItem(Note()); - const Standard_Integer nbnodes = NbNodes(); + theIter.GetOneItem(myNote); + const Standard_Integer nbnodes = myNodes->Length(); for (Standard_Integer i = 1; i <= nbnodes; i++) - theIter.GetOneItem(Node(i)); + theIter.GetOneItem(myNodes->Value(i)); +} + +IGESData_DirChecker IGESAppli_NodalResults::DirChecker () const +{ + IGESData_DirChecker DC(146,0,34); // Type = 146 Form No. = 0 to 34 + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefAny); + DC.BlankStatusIgnored(); + DC.UseFlagRequired(03); + DC.HierarchyStatusIgnored(); + return DC; } void IGESAppli_NodalResults::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const { - const Standard_Integer FormNum = FormNumber(); const Standard_Integer nv = NbData(); Standard_Boolean OK = Standard_True; - switch (FormNum) { + switch (myForm) { case 0 : if (nv < 0) OK = Standard_False; break; case 1 : if (nv != 1) OK = Standard_False; break; case 2 : if (nv != 1) OK = Standard_False; break; @@ -135,3 +165,36 @@ void IGESAppli_NodalResults::OwnCheck (const Interface_ShareTool &, const Handle } if (!OK) theCheck->AddFail("Incorrect count of real values in array V for FEM node"); } + +void IGESAppli_NodalResults::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESAppli_NodalResults" << endl; + + S << "General Note : "; + dumper.Dump(myNote,S,(level <= 4) ? 0 : 1); + S << endl; + S << "Analysis subcase number : " << mySubCaseNum << " "; + S << "Time used : " << myTime << endl; + S << "No. of nodes : " << myNodes->Length() << " "; + S << "No. of values for a node : " << myData->RowLength() << endl; + S << "Node Identifiers : " << endl; + S << "Nodes : " << endl; + S << "Data : "; if (level < 6) S << " [ask level > 5]"; + S << endl; + if (level > 4) + { + for (Standard_Integer i=1; i <= myNodes->Length(); i++) + { + S << "[" << i << "]: "; + S << "NodeIdentifier : " << myNodeIdentifiers->Value(i) << " "; + S << "Node : "; + dumper.Dump (myNodes->Value(i),S,1); + S << endl; + if (level < 6) continue; + S << "Data : [ "; + for (Standard_Integer j = 1; j <= myData->RowLength(); j ++) + S << " " << myData->Value(i,j); + S << " ]" << endl; + } + } +} diff --git a/src/IGESAppli/IGESAppli_NodalResults.hxx b/src/IGESAppli/IGESAppli_NodalResults.hxx index 9f7a2d0cfc..22bd982d78 100644 --- a/src/IGESAppli/IGESAppli_NodalResults.hxx +++ b/src/IGESAppli/IGESAppli_NodalResults.hxx @@ -24,10 +24,6 @@ class IGESDimen_GeneralNote; class IGESAppli_Node; - -class IGESAppli_NodalResults; -DEFINE_STANDARD_HANDLE(IGESAppli_NodalResults, IGESData_IGESEntity) - //! defines NodalResults, Type <146> //! in package IGESAppli //! Used to store the Analysis Data results per FEM Node @@ -35,36 +31,26 @@ class IGESAppli_NodalResults : public IGESData_IGESEntity { public: - IGESAppli_NodalResults() {} - - //! This method is used to set the fields of the class - //! NodalResults - //! - aNote : General Note that describes the - //! analysis case - //! - aNumber : Analysis Subcase number - //! - aTime : Analysis time - //! - allNodeIdentifiers : Node identifiers for the nodes - //! - allNodes : List of FEM Node Entities - //! - allData : Values of the Finite Element analysis - //! result data - //! raises exception if Lengths of allNodeIdentifiers, allNodes and - //! allData (Cols) are not same - Standard_EXPORT void Init (const Handle(IGESDimen_GeneralNote)& aNote, const Standard_Integer aNumber, const Standard_Real aTime, const Handle(TColStd_HArray1OfInteger)& allNodeIdentifiers, const Handle(IGESAppli_HArray1OfNode)& allNodes, const Handle(TColStd_HArray2OfReal)& allData); - - //! Changes the FormNumber (which indicates Type of Result) - //! Error if not in range [0-34] - Standard_EXPORT void SetFormNumber (const Standard_Integer form); + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 146; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return myForm; } + + IGESAppli_NodalResults(const Standard_Integer theForm) + : myForm(theForm), + mySubCaseNum(0), + myTime(0.) + {} //! returns the General Note Entity that describes the analysis case - const Handle(IGESDimen_GeneralNote) & Note() const { return theNote; } + const Handle(IGESDimen_GeneralNote) & Note() const { return myNote; } //! returns zero if there is no subcase - Standard_Integer SubCaseNumber() const { return theSubCaseNum; } + Standard_Integer SubCaseNumber() const { return mySubCaseNum; } //! returns the Analysis time value for this subcase. It is the time //! at which transient analysis results occur in the mathematical //! FEM model. - Standard_Real Time() const { return theTime; } + Standard_Real Time() const { return myTime; } //! returns number of real values in array V for a FEM node Standard_EXPORT Standard_Integer NbData() const; @@ -85,20 +71,29 @@ class IGESAppli_NodalResults : public IGESData_IGESEntity //! if (DataNum <=0 or DataNum > NbData()) Standard_EXPORT Standard_Real Data (const Standard_Integer NodeNum, const Standard_Integer DataNum) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared(Interface_EntityIterator &theIter) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_NodalResults,IGESData_IGESEntity) private: - Handle(IGESDimen_GeneralNote) theNote; - Standard_Integer theSubCaseNum; - Standard_Real theTime; - Handle(TColStd_HArray1OfInteger) theNodeIdentifiers; - Handle(IGESAppli_HArray1OfNode) theNodes; - Handle(TColStd_HArray2OfReal) theData; + Standard_Integer myForm; + Interface_Pointer myNote; + Standard_Integer mySubCaseNum; + Standard_Real myTime; + Handle(TColStd_HArray1OfInteger) myNodeIdentifiers; + Handle(IGESAppli_HArray1OfNode) myNodes; + Handle(TColStd_HArray2OfReal) myData; }; #endif // _IGESAppli_NodalResults_HeaderFile diff --git a/src/IGESAppli/IGESAppli_Node.cxx b/src/IGESAppli/IGESAppli_Node.cxx index 5f6b7b2e0d..ed9efab9c3 100644 --- a/src/IGESAppli/IGESAppli_Node.cxx +++ b/src/IGESAppli/IGESAppli_Node.cxx @@ -23,46 +23,55 @@ #include #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_Node,IGESData_IGESEntity) -void IGESAppli_Node::Init - (const gp_XYZ& aCoord, - const Handle(IGESGeom_TransformationMatrix)& aCoordSystem) +Standard_Integer IGESAppli_Node::SystemType () const { - theCoord = aCoord; - theSystem = aCoordSystem; - InitTypeAndForm(134,0); + return (mySystem.IsNull()? 0 : (mySystem->FormNumber() - 9)); // 0 Global Cartesien, 1 Cartesien, 2 Cylind. 3 Spher. } -gp_Pnt IGESAppli_Node::Coord () const +gp_Pnt IGESAppli_Node::TransformedNodalCoord () const { - return gp_Pnt(theCoord); + gp_XYZ tempCoord = myCoord; + if (!mySystem.IsNull()) mySystem->Value().Transforms(tempCoord); + return gp_Pnt(tempCoord); } -Handle(IGESData_TransfEntity) IGESAppli_Node::System () const +void IGESAppli_Node::OwnRead (IGESFile_Reader &theReader) { - //if Null, Global Cartesian Coordinate System - return Handle(IGESData_TransfEntity)(theSystem); + theReader.ReadXYZ(myCoord,"Coordinates of Node (XYZ)"); + theReader.ReadPointer(mySystem,"Transformation Matrix",Standard_True); } -Standard_Integer IGESAppli_Node::SystemType () const +void IGESAppli_Node::OwnWrite (IGESData_IGESWriter &IW) const { - if (theSystem.IsNull()) return 0; // 0 Global Cartesien - return (theSystem->FormNumber() - 9); // 1 Cartesien, 2 Cylind. 3 Spher. + IW.Send(myCoord.X()); + IW.Send(myCoord.Y()); + IW.Send(myCoord.Z()); + IW.Send(mySystem); } -gp_Pnt IGESAppli_Node::TransformedNodalCoord () const +void IGESAppli_Node::OwnShared(Interface_EntityIterator &theIter) const { - gp_XYZ tempCoord = Coord().XYZ(); - Handle(IGESData_TransfEntity) temp = System(); - if (!temp.IsNull()) temp->Value().Transforms(tempCoord); - return gp_Pnt(tempCoord); + theIter.GetOneItem(mySystem); } -void IGESAppli_Node::OwnShared(Interface_EntityIterator &theIter) const +IGESData_DirChecker IGESAppli_Node::DirChecker () const { - theIter.GetOneItem(System()); + IGESData_DirChecker DC(134,0); //Form no = 0 & Type = 134 + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefAny); + DC.UseFlagRequired(04); + return DC; } void IGESAppli_Node::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const @@ -71,7 +80,19 @@ void IGESAppli_Node::OwnCheck (const Interface_ShareTool &, const Handle(Interfa theCheck->AddFail("SubScript Number expected (for Node Number) not present"); if (!HasTransf()) theCheck->AddFail("Transformation Matrix expected, not present"); - if (!System().IsNull()) - if (System()->FormNumber() < 10) + if (!mySystem.IsNull()) + if (mySystem->FormNumber() < 10) theCheck->AddFail("System : Incorrect FormNumber (not 10-11-12)"); } + +void IGESAppli_Node::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESAppli_Node" << endl; + S << "Nodal Coords : 1st " << myCoord.X() << " 2nd : " << myCoord.Y() << " 3rd : " << myCoord.Z() < Form <0> //! in package IGESAppli //! Geometric point used in the definition of a finite element. @@ -34,22 +30,19 @@ class IGESAppli_Node : public IGESData_IGESEntity { public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 134; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 0; } + IGESAppli_Node() {} - //! This method is used to set the fields of the class Node - //! - aCoord : Nodal Coordinates - //! - aCoordSystem : the Nodal Displacement Coordinate - //! System Entity (default 0 is Global - //! Cartesian Coordinate system) - Standard_EXPORT void Init (const gp_XYZ& aCoord, const Handle(IGESGeom_TransformationMatrix)& aCoordSystem); - //! returns the nodal coordinates - Standard_EXPORT gp_Pnt Coord() const; + Standard_EXPORT const gp_XYZ & Coord() const { return myCoord; } //! returns TransfEntity if a Nodal Displacement Coordinate //! System Entity is defined //! else (for Global Cartesien) returns Null Handle - Standard_EXPORT Handle(IGESData_TransfEntity) System() const; + const Handle(IGESGeom_TransformationMatrix) & System() const { return mySystem; } //! Computes & returns the Type of Coordinate System : //! 0 GlobalCartesian, 1 Cartesian, 2 Cylindrical, 3 Spherical @@ -58,16 +51,24 @@ class IGESAppli_Node : public IGESData_IGESEntity //! returns the Nodal coordinates after transformation Standard_EXPORT gp_Pnt TransformedNodalCoord() const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared(Interface_EntityIterator &theIter) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_Node,IGESData_IGESEntity) private: - gp_XYZ theCoord; - Handle(IGESGeom_TransformationMatrix) theSystem; + gp_XYZ myCoord; + Interface_Pointer mySystem; }; #endif // _IGESAppli_Node_HeaderFile diff --git a/src/IGESAppli/IGESAppli_PWBArtworkStackup.cxx b/src/IGESAppli/IGESAppli_PWBArtworkStackup.cxx index f7b5cb6dac..5b82699407 100644 --- a/src/IGESAppli/IGESAppli_PWBArtworkStackup.cxx +++ b/src/IGESAppli/IGESAppli_PWBArtworkStackup.cxx @@ -20,28 +20,72 @@ #include #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_PWBArtworkStackup,IGESData_IGESEntity) -void IGESAppli_PWBArtworkStackup::Init - (const Standard_Integer nbPropVal, - const Handle(TCollection_HAsciiString)& anArtIdent, - const Handle(TColStd_HArray1OfInteger)& allLevelNums) +Standard_Integer IGESAppli_PWBArtworkStackup::NbLevelNumbers () const { - if (allLevelNums->Lower() != 1) - Standard_DimensionMismatch::Raise("IGESAppli_PWBArtworkStackup : Init"); - theNbPropertyValues = nbPropVal; - theArtworkStackupIdent = anArtIdent; - theLevelNumbers = allLevelNums; - InitTypeAndForm(406,25); + return myLevelNumbers->Length(); } -Standard_Integer IGESAppli_PWBArtworkStackup::NbLevelNumbers () const +Standard_Integer IGESAppli_PWBArtworkStackup::LevelNumber (const Standard_Integer Index) const { - return theLevelNumbers->Length(); + return myLevelNumbers->Value(Index); } -Standard_Integer IGESAppli_PWBArtworkStackup::LevelNumber (const Standard_Integer Index) const +void IGESAppli_PWBArtworkStackup::OwnRead (IGESFile_Reader &theReader) +{ + theReader.ReadInteger(myNbPropertyValues,"Number of property values"); + theReader.ReadText(myArtworkStackupIdent,"Artwork Stackup Identification"); + + Standard_Integer num = 0; + theReader.ReadInteger(num,"Number of level numbers"); + if (num > 0) + { + myLevelNumbers = new TColStd_HArray1OfInteger(1, num); + theReader.ReadInteger(myLevelNumbers->ChangeFirst(),num,"Level Numbers"); + } + else theReader.AddFail("Number of level numbers: Not Positive"); +} + +void IGESAppli_PWBArtworkStackup::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(myNbPropertyValues); + IW.Send(myArtworkStackupIdent); + const Standard_Integer num = myLevelNumbers->Length(); + IW.Send(num); + for ( Standard_Integer i = 1; i <= num; i++ ) + IW.Send(myLevelNumbers->Value(i)); +} + +IGESData_DirChecker IGESAppli_PWBArtworkStackup::DirChecker () const +{ + IGESData_DirChecker DC(406, 25); + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; +} + +void IGESAppli_PWBArtworkStackup::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer level) const { - return theLevelNumbers->Value(Index); + S << "IGESAppli_PWBArtworkStackup" << endl; + S << "Number of property values : " << myNbPropertyValues << endl; + S << "Artwork Stackup Identification : "; + IGESData_DumpString(S,myArtworkStackupIdent); + S << endl; + S << "Level Numbers : "; + IGESData_DumpVals(S,level,1,NbLevelNumbers(),LevelNumber); + S << endl; } diff --git a/src/IGESAppli/IGESAppli_PWBArtworkStackup.hxx b/src/IGESAppli/IGESAppli_PWBArtworkStackup.hxx index 7988f5a917..6c0038b1c2 100644 --- a/src/IGESAppli/IGESAppli_PWBArtworkStackup.hxx +++ b/src/IGESAppli/IGESAppli_PWBArtworkStackup.hxx @@ -37,20 +37,19 @@ class IGESAppli_PWBArtworkStackup : public IGESData_IGESEntity { public: - IGESAppli_PWBArtworkStackup() {} - - //! This method is used to set the fields of the class - //! PWBArtworkStackup - //! - nbPropVal : number of property values - //! - anArtIdent : Artwork Stackup Identification - //! - allLevelNums : Level Numbers - Standard_EXPORT void Init (const Standard_Integer nbPropVal, const Handle(TCollection_HAsciiString)& anArtIdent, const Handle(TColStd_HArray1OfInteger)& allLevelNums); + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 25; } + + IGESAppli_PWBArtworkStackup() + : myNbPropertyValues(0) + {} //! returns number of property values - Standard_Integer NbPropertyValues() const { return theNbPropertyValues; } + Standard_Integer NbPropertyValues() const { return myNbPropertyValues; } //! returns Artwork Stackup Identification - const Handle(TCollection_HAsciiString) & Identification() const { return theArtworkStackupIdent; } + const Handle(TCollection_HAsciiString) & Identification() const { return myArtworkStackupIdent; } //! returns total number of Level Numbers Standard_EXPORT Standard_Integer NbLevelNumbers() const; @@ -59,13 +58,21 @@ class IGESAppli_PWBArtworkStackup : public IGESData_IGESEntity //! raises exception if Index <= 0 or Index > NbLevelNumbers Standard_EXPORT Standard_Integer LevelNumber (const Standard_Integer Index) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_PWBArtworkStackup,IGESData_IGESEntity) private: - Standard_Integer theNbPropertyValues; - Handle(TCollection_HAsciiString) theArtworkStackupIdent; - Handle(TColStd_HArray1OfInteger) theLevelNumbers; + Standard_Integer myNbPropertyValues; + Handle(TCollection_HAsciiString) myArtworkStackupIdent; + Handle(TColStd_HArray1OfInteger) myLevelNumbers; }; #endif // _IGESAppli_PWBArtworkStackup_HeaderFile diff --git a/src/IGESAppli/IGESAppli_PWBDrilledHole.cxx b/src/IGESAppli/IGESAppli_PWBDrilledHole.cxx index 01bd038bd0..e926bb03de 100644 --- a/src/IGESAppli/IGESAppli_PWBDrilledHole.cxx +++ b/src/IGESAppli/IGESAppli_PWBDrilledHole.cxx @@ -17,27 +17,60 @@ //-------------------------------------------------------------------- #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_PWBDrilledHole,IGESData_IGESEntity) -void IGESAppli_PWBDrilledHole::Init - (const Standard_Integer nbPropVal, - const Standard_Real aDrillDia, const Standard_Real aFinishDia, - const Standard_Integer aCode) +void IGESAppli_PWBDrilledHole::OwnRead (IGESFile_Reader &theReader) { - theNbPropertyValues = nbPropVal; - theDrillDiameter = aDrillDia; - theFinishDiameter = aFinishDia; - theFunctionCode = aCode; - InitTypeAndForm(406,26); + Standard_Integer aNbPropertyValues = 3; + if (theReader.ReadInteger(aNbPropertyValues,"Number of property values") == IGESFile_Reader::ParamError || aNbPropertyValues != 3) + theReader.AddFail("Number of property values != 3"); + theReader.ReadReal(myDrillDiameter,"Drill Diameter Size"); + theReader.ReadReal(myFinishDiameter,"Finish Diameter Size"); + theReader.ReadInteger(myFunctionCode,"Drilled Hole Function Code"); +} + +void IGESAppli_PWBDrilledHole::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(3); + IW.Send(myDrillDiameter); + IW.Send(myFinishDiameter); + IW.Send(myFunctionCode); +} + +IGESData_DirChecker IGESAppli_PWBDrilledHole::DirChecker () const +{ + IGESData_DirChecker DC(406, 26); + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } void IGESAppli_PWBDrilledHole::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const { - if (NbPropertyValues() != 3) - theCheck->AddFail("Number of property values != 3"); - if ( (FunctionCode() < 1) || - ((FunctionCode() > 5) && (FunctionCode() < 5001)) || - (FunctionCode() > 9999)) + if ( (myFunctionCode < 1) || + ((myFunctionCode > 5) && (myFunctionCode < 5001)) || + (myFunctionCode > 9999)) theCheck->AddFail("Drilled Hole Function Code != 1-5,5001-9999"); } + +void IGESAppli_PWBDrilledHole::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const +{ + S << "IGESAppli_PWBDrilledHole" << endl; + S << "Number of property values : 3" << endl; + S << "Drill Diameter Size : " << myDrillDiameter << endl; + S << "Finish Diameter Size : " << myFinishDiameter << endl; + S << "Drilled Hole Function Code : " << myFunctionCode << endl; +} diff --git a/src/IGESAppli/IGESAppli_PWBDrilledHole.hxx b/src/IGESAppli/IGESAppli_PWBDrilledHole.hxx index a307e4f124..fcf4a0613a 100644 --- a/src/IGESAppli/IGESAppli_PWBDrilledHole.hxx +++ b/src/IGESAppli/IGESAppli_PWBDrilledHole.hxx @@ -30,39 +30,43 @@ class IGESAppli_PWBDrilledHole : public IGESData_IGESEntity { public: - IGESAppli_PWBDrilledHole() {} - - //! This method is used to set the fields of the class - //! PWBDrilledHole - //! - nbPropVal : number of property values, always = 3 - //! - aDrillDia : Drill diameter size - //! - aFinishDia : Finish diameter size - //! - aCode : Function code for drilled hole - Standard_EXPORT void Init (const Standard_Integer nbPropVal, const Standard_Real aDrillDia, const Standard_Real aFinishDia, const Standard_Integer aCode); - - //! returns number of property values, always = 3 - Standard_Integer NbPropertyValues() const { return theNbPropertyValues; } + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 26; } + + IGESAppli_PWBDrilledHole() + : myDrillDiameter(0.), + myFinishDiameter(0.), + myFunctionCode(0) + {} //! returns Drill diameter size - Standard_Real DrillDiameterSize() const { return theDrillDiameter; } + Standard_Real DrillDiameterSize() const { return myDrillDiameter; } //! returns Finish diameter size - Standard_Real FinishDiameterSize() const { return theFinishDiameter; } + Standard_Real FinishDiameterSize() const { return myFinishDiameter; } //! returns Function code for drilled hole //! is 0, 1, 2, 3, 4, 5 or 5001-9999 - Standard_Integer FunctionCode() const { return theFunctionCode; } + Standard_Integer FunctionCode() const { return myFunctionCode; } + + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_PWBDrilledHole,IGESData_IGESEntity) private: - Standard_Integer theNbPropertyValues; - Standard_Real theDrillDiameter; - Standard_Real theFinishDiameter; - Standard_Integer theFunctionCode; + Standard_Real myDrillDiameter; + Standard_Real myFinishDiameter; + Standard_Integer myFunctionCode; }; #endif // _IGESAppli_PWBDrilledHole_HeaderFile diff --git a/src/IGESAppli/IGESAppli_PartNumber.cxx b/src/IGESAppli/IGESAppli_PartNumber.cxx index 8b543ecfbd..4161799140 100644 --- a/src/IGESAppli/IGESAppli_PartNumber.cxx +++ b/src/IGESAppli/IGESAppli_PartNumber.cxx @@ -18,26 +18,63 @@ #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_PartNumber,IGESData_IGESEntity) -void IGESAppli_PartNumber::Init - (const Standard_Integer nbPropVal, - const Handle(TCollection_HAsciiString)& aGenName, - const Handle(TCollection_HAsciiString)& aMilName, - const Handle(TCollection_HAsciiString)& aVendName, - const Handle(TCollection_HAsciiString)& anIntName) +void IGESAppli_PartNumber::OwnRead (IGESFile_Reader &theReader) { - theNbPropertyValues = nbPropVal; - theGenericNumber = aGenName; - theMilitaryNumber = aMilName; - theVendorNumber = aVendName; - theInternalNumber = anIntName; - InitTypeAndForm(406,9); + Standard_Integer aNbPropertyValues = 4; + if (theReader.ReadInteger(aNbPropertyValues,"Number of property values") == IGESFile_Reader::ParamError || aNbPropertyValues != 4) + theReader.AddFail("Number of property values != 4"); + theReader.ReadText(myGenericNumber,"Generic Number or Name"); + theReader.ReadText(myMilitaryNumber,"Military Number or Name"); + theReader.ReadText(myVendorNumber,"Vendor Number or Name"); + theReader.ReadText(myInternalNumber,"Internal Number or Name"); } -void IGESAppli_PartNumber::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const +void IGESAppli_PartNumber::OwnWrite (IGESData_IGESWriter &IW) const { - if (NbPropertyValues() != 4) - theCheck->AddFail("Number of property values != 4"); + IW.Send(4); + IW.Send(myGenericNumber); + IW.Send(myMilitaryNumber); + IW.Send(myVendorNumber); + IW.Send(myInternalNumber); +} + +IGESData_DirChecker IGESAppli_PartNumber::DirChecker () const +{ + IGESData_DirChecker DC(406, 9); + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; +} + +void IGESAppli_PartNumber::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const +{ + S << "IGESAppli_PartNumber" << endl; + S << "Number of property values : 4" << endl; + S << "Generic Number or Name : "; + IGESData_DumpString(S,myGenericNumber); + S << endl; + S << "Military Number or Name : "; + IGESData_DumpString(S,myMilitaryNumber); + S << endl; + S << "Vendor Number or Name : "; + IGESData_DumpString(S,myVendorNumber); + S << endl; + S << "Internal Number or Name : "; + IGESData_DumpString(S,myInternalNumber); + S << endl; } diff --git a/src/IGESAppli/IGESAppli_PartNumber.hxx b/src/IGESAppli/IGESAppli_PartNumber.hxx index c7782d1f75..d2bb3ac2f2 100644 --- a/src/IGESAppli/IGESAppli_PartNumber.hxx +++ b/src/IGESAppli/IGESAppli_PartNumber.hxx @@ -33,43 +33,40 @@ class IGESAppli_PartNumber : public IGESData_IGESEntity { public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 9; } + IGESAppli_PartNumber() {} - - //! This method is used to set the fields of the class - //! PartNumber - //! - nbPropVal : number of property values, always = 4 - //! - aGenName : Generic part number or name - //! - aMilName : Military Standard (MIL-STD) part number - //! - aVendName : Vendor part number or name - //! - anIntName : Internal part number - Standard_EXPORT void Init (const Standard_Integer nbPropVal, const Handle(TCollection_HAsciiString)& aGenName, const Handle(TCollection_HAsciiString)& aMilName, const Handle(TCollection_HAsciiString)& aVendName, const Handle(TCollection_HAsciiString)& anIntName); - - //! returns number of property values, always = 4 - Standard_Integer NbPropertyValues() const { return theNbPropertyValues; } //! returns Generic part number or name - const Handle(TCollection_HAsciiString) & GenericNumber() const { return theGenericNumber; } + const Handle(TCollection_HAsciiString) & GenericNumber() const { return myGenericNumber; } //! returns Military Standard (MIL-STD) part number - const Handle(TCollection_HAsciiString) & MilitaryNumber() const { return theMilitaryNumber; } + const Handle(TCollection_HAsciiString) & MilitaryNumber() const { return myMilitaryNumber; } //! returns Vendor part number or name - const Handle(TCollection_HAsciiString) & VendorNumber() const { return theVendorNumber; } + const Handle(TCollection_HAsciiString) & VendorNumber() const { return myVendorNumber; } //! returns Internal part number - const Handle(TCollection_HAsciiString) & InternalNumber() const { return theInternalNumber; } + const Handle(TCollection_HAsciiString) & InternalNumber() const { return myInternalNumber; } + + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; - Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESAppli_PartNumber,IGESData_IGESEntity) private: - Standard_Integer theNbPropertyValues; - Handle(TCollection_HAsciiString) theGenericNumber; - Handle(TCollection_HAsciiString) theMilitaryNumber; - Handle(TCollection_HAsciiString) theVendorNumber; - Handle(TCollection_HAsciiString) theInternalNumber; + Handle(TCollection_HAsciiString) myGenericNumber; + Handle(TCollection_HAsciiString) myMilitaryNumber; + Handle(TCollection_HAsciiString) myVendorNumber; + Handle(TCollection_HAsciiString) myInternalNumber; }; #endif // _IGESAppli_PartNumber_HeaderFile diff --git a/src/IGESAppli/IGESAppli_PinNumber.cxx b/src/IGESAppli/IGESAppli_PinNumber.cxx index 2fe181f2e5..343165c023 100644 --- a/src/IGESAppli/IGESAppli_PinNumber.cxx +++ b/src/IGESAppli/IGESAppli_PinNumber.cxx @@ -17,18 +17,39 @@ //-------------------------------------------------------------------- #include -#include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_PinNumber,IGESData_IGESEntity) -void IGESAppli_PinNumber::Init - (const Standard_Integer nbPropVal, - const Handle(TCollection_HAsciiString)& aValue) +void IGESAppli_PinNumber::OwnRead (IGESFile_Reader &theReader) { - thePinNumber = aValue; - theNbPropertyValues = nbPropVal; - InitTypeAndForm(406,8); + Standard_Integer aNbPropertyValues = 1; + if (theReader.ReadInteger(aNbPropertyValues,"Number of property values") == IGESFile_Reader::ParamError || aNbPropertyValues != 1) + theReader.AddFail("Number of Property Values != 1"); + theReader.ReadText(myPinNumber,"PinNumber"); +} + +void IGESAppli_PinNumber::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(1); + IW.Send(myPinNumber); +} + +IGESData_DirChecker IGESAppli_PinNumber::DirChecker () const +{ + IGESData_DirChecker DC(406,8); //Form no = 8 & Type = 406 + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } void IGESAppli_PinNumber::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const @@ -37,8 +58,23 @@ void IGESAppli_PinNumber::OwnCheck (const Interface_ShareTool &, const Handle(In if (DefLevel() != IGESData_DefOne && DefLevel() != IGESData_DefSeveral) theCheck->AddFail("Level type: Incorrect"); - if (NbPropertyValues() != 1) - theCheck->AddFail("Number of Property Values != 1"); - //UNFINISHED - //Level to be ignored if the property is subordinate -- queried +} + +Standard_Boolean IGESAppli_PinNumber::OwnCorrect () +{ + if (SubordinateStatus() != 0) { + Handle(IGESData_LevelListEntity) nulevel; + InitLevel(nulevel,0); + return Standard_True; + } + return Standard_False; +} + +void IGESAppli_PinNumber::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const +{ + S << "IGESAppli_PinNumber" << endl; + S << "Number of Property Values : 1" << endl; + S << "PinNumber : "; + IGESData_DumpString(S,myPinNumber); + S << endl; } diff --git a/src/IGESAppli/IGESAppli_PinNumber.hxx b/src/IGESAppli/IGESAppli_PinNumber.hxx index b1b5283a38..2d0ca42fad 100644 --- a/src/IGESAppli/IGESAppli_PinNumber.hxx +++ b/src/IGESAppli/IGESAppli_PinNumber.hxx @@ -33,29 +33,32 @@ class IGESAppli_PinNumber : public IGESData_IGESEntity { public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 8; } + IGESAppli_PinNumber() {} - //! This method is used to set the fields of the class - //! PinNumber - //! - nbPropVal : Number of property values (always = 1) - //! - aValue : Pin Number value - Standard_EXPORT void Init (const Standard_Integer nbPropVal, const Handle(TCollection_HAsciiString)& aValue); + //! returns the pin number value + const Handle(TCollection_HAsciiString) & PinNumberVal() const { return myPinNumber; } + + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; - //! returns the number of property values - //! is always 1 - Standard_Integer NbPropertyValues() const { return theNbPropertyValues; } + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; - //! returns the pin number value - const Handle(TCollection_HAsciiString) & PinNumberVal() const { return thePinNumber; } + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean OwnCorrect () Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_PinNumber,IGESData_IGESEntity) private: - Standard_Integer theNbPropertyValues; - Handle(TCollection_HAsciiString) thePinNumber; + Handle(TCollection_HAsciiString) myPinNumber; }; #endif // _IGESAppli_PinNumber_HeaderFile diff --git a/src/IGESAppli/IGESAppli_PipingFlow.cxx b/src/IGESAppli/IGESAppli_PipingFlow.cxx index 4c4b6ca07b..32c4978258 100644 --- a/src/IGESAppli/IGESAppli_PipingFlow.cxx +++ b/src/IGESAppli/IGESAppli_PipingFlow.cxx @@ -24,102 +24,164 @@ #include #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_PipingFlow,IGESData_IGESEntity) -void IGESAppli_PipingFlow::Init - (const Standard_Integer nbContextFlags, - const Standard_Integer aFlowType, - const Handle(IGESData_HArray1OfIGESEntity)& allFlowAssocs, - const Handle(IGESDraw_HArray1OfConnectPoint)& allConnectPoints, - const Handle(IGESData_HArray1OfIGESEntity)& allJoins, - const Handle(Interface_HArray1OfHAsciiString)& allFlowNames, - const Handle(IGESGraph_HArray1OfTextDisplayTemplate)& allTextDisps, - const Handle(IGESData_HArray1OfIGESEntity)& allContFlowAssocs) -{ - Standard_Integer num = allFlowAssocs->Length(); - if (allFlowAssocs->Lower() != 1 || - allConnectPoints->Lower() != 1 || allConnectPoints->Length() != num || - allJoins->Lower() != 1 || allJoins->Length() != num || - allFlowNames->Lower() != 1 || allFlowNames->Length() != num || - allContFlowAssocs->Lower() != 1 || allContFlowAssocs->Length() != num ) - Standard_DimensionMismatch::Raise("IGESAppli_PipingFlow : Init"); - theNbContextFlags = nbContextFlags; - theTypeOfFlow = aFlowType; - theFlowAssociativities = allFlowAssocs; - theConnectPoints = allConnectPoints; - theJoins = allJoins; - theFlowNames = allFlowNames; - theTextDisplayTemplates = allTextDisps; - theContFlowAssociativities = allContFlowAssocs; - InitTypeAndForm(402,20); -} - -Standard_Boolean IGESAppli_PipingFlow::OwnCorrect () -{ - if (theNbContextFlags == 1) return Standard_False; - theNbContextFlags = 1; - return Standard_True; -} - Standard_Integer IGESAppli_PipingFlow::NbFlowAssociativities () const { - return theFlowAssociativities->Length(); + return myFlowAssociativities->Length(); } Standard_Integer IGESAppli_PipingFlow::NbConnectPoints () const { - return theConnectPoints->Length(); + return myConnectPoints->Length(); } Standard_Integer IGESAppli_PipingFlow::NbJoins () const { - return theJoins->Length(); + return myJoins->Length(); } Standard_Integer IGESAppli_PipingFlow::NbFlowNames () const { - return theFlowNames->Length(); + return myFlowNames->Length(); } Standard_Integer IGESAppli_PipingFlow::NbTextDisplayTemplates () const { - return theTextDisplayTemplates->Length(); + return myTextDisplayTemplates->Length(); } Standard_Integer IGESAppli_PipingFlow::NbContFlowAssociativities () const { - return theContFlowAssociativities->Length(); + return myContFlowAssociativities->Length(); } const Handle(IGESData_IGESEntity) & IGESAppli_PipingFlow::FlowAssociativity (const Standard_Integer Index) const { - return theFlowAssociativities->Value(Index); + return myFlowAssociativities->Value(Index); } const Handle(IGESDraw_ConnectPoint) & IGESAppli_PipingFlow::ConnectPoint (const Standard_Integer Index) const { - return theConnectPoints->Value(Index); + return myConnectPoints->Value(Index); } const Handle(IGESData_IGESEntity) & IGESAppli_PipingFlow::Join (const Standard_Integer Index) const { - return theJoins->Value(Index); + return myJoins->Value(Index); } const Handle(TCollection_HAsciiString) & IGESAppli_PipingFlow::FlowName (const Standard_Integer Index) const { - return theFlowNames->Value(Index); + return myFlowNames->Value(Index); } const Handle(IGESGraph_TextDisplayTemplate) & IGESAppli_PipingFlow::TextDisplayTemplate (const Standard_Integer Index) const { - return theTextDisplayTemplates->Value(Index); + return myTextDisplayTemplates->Value(Index); } const Handle(IGESData_IGESEntity) & IGESAppli_PipingFlow::ContFlowAssociativity (const Standard_Integer Index) const { - return theContFlowAssociativities->Value(Index); + return myContFlowAssociativities->Value(Index); +} + +void IGESAppli_PipingFlow::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer i, num; + + Standard_Integer aNbContextFlags = 1; + if (PR.ReadInteger(aNbContextFlags,"Number of Context Flags") == IGESFile_Reader::ParamError || aNbContextFlags != 1) + PR.AddFail("Number of Context Flags != 1"); + + num = 0; + PR.ReadInteger(num,"Number of Flow Associativities"); + if (num > 0) myFlowAssociativities = new IGESData_HArray1OfIGESEntity(1, num); + else PR.AddFail("Number of Flow Associativities: Not Positive"); + + num = 0; + PR.ReadInteger(num,"Number of Connect Points"); + if (num > 0) myConnectPoints = new IGESDraw_HArray1OfConnectPoint(1, num); + else PR.AddFail("Number of Connect Points: Not Positive"); + + num = 0; + PR.ReadInteger(num,"Number of Joins"); + if (num > 0) myJoins = new IGESData_HArray1OfIGESEntity(1, num); + else PR.AddFail("Number of Joins: Not Positive"); + + num = 0; + PR.ReadInteger(num,"Number of Flow Names"); + if (num > 0) myFlowNames = new Interface_HArray1OfHAsciiString(1, num); + else PR.AddFail("Number of Flow Names: Not Positive"); + + num = 0; + PR.ReadInteger(num,"Number of Text Displays"); + if (num > 0) myTextDisplayTemplates = new IGESGraph_HArray1OfTextDisplayTemplate(1, num); + else PR.AddFail("Number of Text Displays: Not Positive"); + + num = 0; + PR.ReadInteger(num,"Number of Continuation Flows"); + if (num > 0) myContFlowAssociativities = new IGESData_HArray1OfIGESEntity(1, num); + else PR.AddFail("Number of Continuation Flows: Not Positive"); + + myTypeOfFlow = 0; + PR.ReadInteger(myTypeOfFlow,"Type of Flow"); + + if (!myFlowAssociativities.IsNull()) + for ( num = myFlowAssociativities->Length(), i = 1; i <= num; i++ ) + PR.ReadPointer(myFlowAssociativities->ChangeValue(i),"Flow Associativity"); + + if (!myConnectPoints.IsNull()) + for ( num = myConnectPoints->Length(), i = 1; i <= num; i++ ) + PR.ReadPointer(myConnectPoints->ChangeValue(i),"Connect Point"); + + if (!myJoins.IsNull()) + for ( num = myJoins->Length(), i = 1; i <= num; i++ ) + PR.ReadPointer(myJoins->ChangeValue(i),"Join"); + + if (!myFlowNames.IsNull()) + for ( num = myFlowNames->Length(), i = 1; i <= num; i++ ) + PR.ReadText(myFlowNames->ChangeValue(i),"Flow Name"); + + if (!myTextDisplayTemplates.IsNull()) + for ( num = myTextDisplayTemplates->Length(), i = 1; i <= num; i++ ) + PR.ReadPointer(myTextDisplayTemplates->ChangeValue(i),"Text Display Template"); + + if (!myContFlowAssociativities.IsNull()) + for ( num = myContFlowAssociativities->Length(), i = 1; i <= num; i++ ) + PR.ReadPointer(myContFlowAssociativities->ChangeValue(i),"Continuation Flow Assocs"); +} + +void IGESAppli_PipingFlow::OwnWrite (IGESData_IGESWriter &IW) const +{ + Standard_Integer i, num; + IW.Send(1); + IW.Send(NbFlowAssociativities()); + IW.Send(NbConnectPoints()); + IW.Send(NbJoins()); + IW.Send(NbFlowNames()); + IW.Send(NbTextDisplayTemplates()); + IW.Send(NbContFlowAssociativities()); + IW.Send(myTypeOfFlow); + for ( num = NbFlowAssociativities(), i = 1; i <= num; i++ ) + IW.Send(FlowAssociativity(i)); + for ( num = NbConnectPoints(), i = 1; i <= num; i++ ) + IW.Send(ConnectPoint(i)); + for ( num = NbJoins(), i = 1; i <= num; i++ ) + IW.Send(Join(i)); + for ( num = NbFlowNames(), i = 1; i <= num; i++ ) + IW.Send(FlowName(i)); + for ( num = NbTextDisplayTemplates(), i = 1; i <= num; i++ ) + IW.Send(TextDisplayTemplate(i)); + for ( num = NbContFlowAssociativities(), i = 1; i <= num; i++ ) + IW.Send(ContFlowAssociativity(i)); } void IGESAppli_PipingFlow::OwnShared(Interface_EntityIterator &theIter) const @@ -137,10 +199,42 @@ void IGESAppli_PipingFlow::OwnShared(Interface_EntityIterator &theIter) const theIter.GetOneItem(ContFlowAssociativity(i)); } +IGESData_DirChecker IGESAppli_PipingFlow::DirChecker () const +{ + IGESData_DirChecker DC(402, 20); + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagRequired(3); + DC.HierarchyStatusIgnored(); + return DC; +} + void IGESAppli_PipingFlow::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const { - if (NbContextFlags() != 1) - theCheck->AddFail("Number of Context Flags != 1"); - if ((TypeOfFlow() < 0) || (TypeOfFlow() > 2)) + if ((myTypeOfFlow < 0) || (myTypeOfFlow > 2)) theCheck->AddFail("Type of Flow != 0,1,2"); } + +void IGESAppli_PipingFlow::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESAppli_PipingFlow" << endl; + S << "Number of Context Flags : 1" << endl; + S << "Type of Flow : " << TypeOfFlow() << endl; + S << "Flow Associativities : "; + IGESData_DumpEntities(S,dumper,level,1,NbFlowAssociativities(),FlowAssociativity); + S << "Connect Points : "; + IGESData_DumpEntities(S,dumper,level,1,NbConnectPoints(),ConnectPoint); + S << "Joins : "; + IGESData_DumpEntities(S,dumper,level,1,NbJoins(),Join); + S << "Flow Names : "; + IGESData_DumpStrings(S,level,1,NbFlowNames(),FlowName); + S << "Text Display Templates : "; + IGESData_DumpEntities(S,dumper,level,1,NbTextDisplayTemplates(),TextDisplayTemplate); + S << "Continuation Flow Associativities : "; + IGESData_DumpEntities(S,dumper,level,1,NbContFlowAssociativities(),ContFlowAssociativity); + S << endl; +} diff --git a/src/IGESAppli/IGESAppli_PipingFlow.hxx b/src/IGESAppli/IGESAppli_PipingFlow.hxx index 137f78816e..0bcfc666f4 100644 --- a/src/IGESAppli/IGESAppli_PipingFlow.hxx +++ b/src/IGESAppli/IGESAppli_PipingFlow.hxx @@ -38,25 +38,13 @@ class IGESAppli_PipingFlow : public IGESData_IGESEntity { public: - IGESAppli_PipingFlow() {} - - //! This method is used to set the fields of the class - //! PipingFlow - //! - nbContextFlags : Count of Context Flags, always = 1 - //! - aFlowType : Type of Flow, default = 0 - //! - allFlowAssocs : PipingFlow Associativity Entities - //! - allConnectPoints : Connect Point Entities - //! - allJoins : Join Entities - //! - allFlowNames : PipingFlow Names - //! - allTextDispTs : Text Display Template Entities - //! - allContFlowAssocs : Continuation Flow Associativity Entities - Standard_EXPORT void Init (const Standard_Integer nbContextFlags, const Standard_Integer aFlowType, const Handle(IGESData_HArray1OfIGESEntity)& allFlowAssocs, const Handle(IGESDraw_HArray1OfConnectPoint)& allConnectPoints, const Handle(IGESData_HArray1OfIGESEntity)& allJoins, const Handle(Interface_HArray1OfHAsciiString)& allFlowNames, const Handle(IGESGraph_HArray1OfTextDisplayTemplate)& allTextDisps, const Handle(IGESData_HArray1OfIGESEntity)& allContFlowAssocs); - - //! forces NbContextFalgs to 1, returns True if changed - Standard_EXPORT Standard_Boolean OwnCorrect(); - - //! returns number of Count of Context Flags, always = 1 - Standard_Integer NbContextFlags() const { return theNbContextFlags; } + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 402; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 20; } + + IGESAppli_PipingFlow() + : myTypeOfFlow(0) + {} //! returns number of Piping Flow Associativity Entities Standard_EXPORT Standard_Integer NbFlowAssociativities() const; @@ -79,7 +67,7 @@ class IGESAppli_PipingFlow : public IGESData_IGESEntity //! returns Type of Flow = 0 : Not specified, //! 1 : Logical, //! 2 : Physical - Standard_Integer TypeOfFlow() const { return theTypeOfFlow; } + Standard_Integer TypeOfFlow() const { return myTypeOfFlow; } //! returns Piping Flow Associativity Entity //! raises exception if Index <= 0 or Index > NbFlowAssociativities() @@ -105,22 +93,29 @@ class IGESAppli_PipingFlow : public IGESData_IGESEntity //! raises exception if Index <= 0 or Index > NbContFlowAssociativities() Standard_EXPORT const Handle(IGESData_IGESEntity) & ContFlowAssociativity (const Standard_Integer Index) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared(Interface_EntityIterator &theIter) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_PipingFlow,IGESData_IGESEntity) private: - Standard_Integer theNbContextFlags; - Standard_Integer theTypeOfFlow; - Handle(IGESData_HArray1OfIGESEntity) theFlowAssociativities; - Handle(IGESDraw_HArray1OfConnectPoint) theConnectPoints; - Handle(IGESData_HArray1OfIGESEntity) theJoins; - Handle(Interface_HArray1OfHAsciiString) theFlowNames; - Handle(IGESGraph_HArray1OfTextDisplayTemplate) theTextDisplayTemplates; - Handle(IGESData_HArray1OfIGESEntity) theContFlowAssociativities; + Standard_Integer myTypeOfFlow; + Handle(IGESData_HArray1OfIGESEntity) myFlowAssociativities; + Handle(IGESDraw_HArray1OfConnectPoint) myConnectPoints; + Handle(IGESData_HArray1OfIGESEntity) myJoins; + Handle(Interface_HArray1OfHAsciiString) myFlowNames; + Handle(IGESGraph_HArray1OfTextDisplayTemplate) myTextDisplayTemplates; + Handle(IGESData_HArray1OfIGESEntity) myContFlowAssociativities; }; #endif // _IGESAppli_PipingFlow_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ReadWriteModule.cxx b/src/IGESAppli/IGESAppli_ReadWriteModule.cxx deleted file mode 100644 index 6660824117..0000000000 --- a/src/IGESAppli/IGESAppli_ReadWriteModule.cxx +++ /dev/null @@ -1,387 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_ReadWriteModule,IGESData_ReadWriteModule) - - - Standard_Integer IGESAppli_ReadWriteModule::CaseIGES - (const Standard_Integer typenum, const Standard_Integer formnum) const -{ - switch (typenum) { - case 134 : return 12; - case 136 : return 3; - case 138 : return 10; - case 146 : return 11; - case 148 : return 2; - case 402 : - switch (formnum) { - case 18 : return 4; - case 20 : return 17; - default : break; - } - break; - case 406 : - switch (formnum) { - case 2 : return 19; - case 3 : return 6; - case 5 : return 8; - case 6 : return 1; - case 7 : return 18; - case 8 : return 16; - case 9 : return 15; - case 14 : return 5; - case 24 : return 7; - case 25 : return 13; - case 26 : return 14; - default : break; - } - break; - case 418 : return 9; - default : break; - } - return 0; -} - - - void IGESAppli_ReadWriteModule::ReadOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESAppli_DrilledHole,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolDrilledHole tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 2 : { - DeclareAndCast(IGESAppli_ElementResults,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolElementResults tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 3 : { - DeclareAndCast(IGESAppli_FiniteElement,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolFiniteElement tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 4 : { - DeclareAndCast(IGESAppli_Flow,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolFlow tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 5 : { - DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolFlowLineSpec tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 6 : { - DeclareAndCast(IGESAppli_LevelFunction,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolLevelFunction tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 7 : { - DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolLevelToPWBLayerMap tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 8 : { - DeclareAndCast(IGESAppli_LineWidening,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolLineWidening tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 9 : { - DeclareAndCast(IGESAppli_NodalConstraint,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolNodalConstraint tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 10 : { - DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolNodalDisplAndRot tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 11 : { - DeclareAndCast(IGESAppli_NodalResults,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolNodalResults tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 12 : { - DeclareAndCast(IGESAppli_Node,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolNode tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 13 : { - DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPWBArtworkStackup tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 14 : { - DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPWBDrilledHole tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 15 : { - DeclareAndCast(IGESAppli_PartNumber,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPartNumber tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 16 : { - DeclareAndCast(IGESAppli_PinNumber,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPinNumber tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 17 : { - DeclareAndCast(IGESAppli_PipingFlow,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPipingFlow tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 18 : { - DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolReferenceDesignator tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 19 : { - DeclareAndCast(IGESAppli_RegionRestriction,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolRegionRestriction tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - default : break; - } -} - - - void IGESAppli_ReadWriteModule::WriteOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - IGESData_IGESWriter& IW) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESAppli_DrilledHole,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolDrilledHole tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 2 : { - DeclareAndCast(IGESAppli_ElementResults,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolElementResults tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 3 : { - DeclareAndCast(IGESAppli_FiniteElement,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolFiniteElement tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 4 : { - DeclareAndCast(IGESAppli_Flow,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolFlow tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 5 : { - DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolFlowLineSpec tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 6 : { - DeclareAndCast(IGESAppli_LevelFunction,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolLevelFunction tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 7 : { - DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolLevelToPWBLayerMap tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 8 : { - DeclareAndCast(IGESAppli_LineWidening,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolLineWidening tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 9 : { - DeclareAndCast(IGESAppli_NodalConstraint,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolNodalConstraint tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 10 : { - DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolNodalDisplAndRot tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 11 : { - DeclareAndCast(IGESAppli_NodalResults,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolNodalResults tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 12 : { - DeclareAndCast(IGESAppli_Node,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolNode tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 13 : { - DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPWBArtworkStackup tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 14 : { - DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPWBDrilledHole tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 15 : { - DeclareAndCast(IGESAppli_PartNumber,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPartNumber tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 16 : { - DeclareAndCast(IGESAppli_PinNumber,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPinNumber tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 17 : { - DeclareAndCast(IGESAppli_PipingFlow,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPipingFlow tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 18 : { - DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolReferenceDesignator tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 19 : { - DeclareAndCast(IGESAppli_RegionRestriction,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolRegionRestriction tool; - tool.WriteOwnParams(anent,IW); - } - break; - default : break; - } -} diff --git a/src/IGESAppli/IGESAppli_ReadWriteModule.hxx b/src/IGESAppli/IGESAppli_ReadWriteModule.hxx deleted file mode 100644 index 4dadb5690d..0000000000 --- a/src/IGESAppli/IGESAppli_ReadWriteModule.hxx +++ /dev/null @@ -1,57 +0,0 @@ -// Created on: 1993-09-06 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ReadWriteModule_HeaderFile -#define _IGESAppli_ReadWriteModule_HeaderFile - -#include -#include - -#include -#include -class Standard_DomainError; -class IGESData_IGESEntity; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; - - -class IGESAppli_ReadWriteModule; -DEFINE_STANDARD_HANDLE(IGESAppli_ReadWriteModule, IGESData_ReadWriteModule) - -//! Defines basic File Access Module for IGESAppli (specific parts) -//! Specific actions concern : Read and Write Own Parameters of -//! an IGESEntity. -class IGESAppli_ReadWriteModule : public IGESData_ReadWriteModule -{ - public: - - //! Creates a ReadWriteModule & puts it into ReaderLib & WriterLib - IGESAppli_ReadWriteModule() {} - - //! Defines Case Numbers for Entities of IGESAppli - Standard_EXPORT Standard_Integer CaseIGES (const Standard_Integer typenum, const Standard_Integer formnum) const Standard_OVERRIDE; - - //! Reads own parameters from file for an Entity of IGESAppli - Standard_EXPORT void ReadOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const Standard_OVERRIDE; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, IGESData_IGESWriter& IW) const Standard_OVERRIDE; - - DEFINE_STANDARD_RTTIEXT(IGESAppli_ReadWriteModule,IGESData_ReadWriteModule) -}; - -#endif // _IGESAppli_ReadWriteModule_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ReferenceDesignator.cxx b/src/IGESAppli/IGESAppli_ReferenceDesignator.cxx index 8969690e23..04c6fe3986 100644 --- a/src/IGESAppli/IGESAppli_ReferenceDesignator.cxx +++ b/src/IGESAppli/IGESAppli_ReferenceDesignator.cxx @@ -20,27 +20,64 @@ #include #include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_ReferenceDesignator,IGESData_IGESEntity) -void IGESAppli_ReferenceDesignator::Init - (const Standard_Integer nbPropVal, - const Handle(TCollection_HAsciiString)& aText) +void IGESAppli_ReferenceDesignator::OwnRead (IGESFile_Reader &theReader) { - theRefDesigText = aText; - theNbPropertyValues = nbPropVal; - InitTypeAndForm(406,7); + Standard_Integer aNbPropertyValues = 1; + if (theReader.ReadInteger(aNbPropertyValues,"Number of property values") == IGESFile_Reader::ParamError || aNbPropertyValues != 1) + theReader.AddFail("Number of Property Values != 1"); + theReader.ReadText(myRefDesigText,"ReferenceDesignator"); +} + +void IGESAppli_ReferenceDesignator::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(1); + IW.Send(myRefDesigText); +} + +IGESData_DirChecker IGESAppli_ReferenceDesignator::DirChecker () const +{ + //UNFINISHED + IGESData_DirChecker DC(406,7); //Form no = 7 & Type = 406 + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } void IGESAppli_ReferenceDesignator::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const { if (SubordinateStatus() != 0) - //the level is ignored if this property is subordinate if (DefLevel() != IGESData_DefOne && DefLevel() != IGESData_DefSeveral) theCheck->AddFail("Level type: Not value/reference"); - if (NbPropertyValues() != 1) - theCheck->AddFail("Number of Property Values != 1"); - //UNFINISHED - //the level is ignored if this property is subordinate -- queried +} + +Standard_Boolean IGESAppli_ReferenceDesignator::OwnCorrect () +{ + if (SubordinateStatus() != 0) { + Handle(IGESData_LevelListEntity) nulevel; + InitLevel(nulevel,0); + return Standard_True; + } + return Standard_False; +} + +void IGESAppli_ReferenceDesignator::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const +{ + S << "IGESAppli_ReferenceDesignator" << endl; + S << "Number of Property Values : 1" << endl; + S << "ReferenceDesignator : "; + IGESData_DumpString(S,myRefDesigText); + S << endl; } diff --git a/src/IGESAppli/IGESAppli_ReferenceDesignator.hxx b/src/IGESAppli/IGESAppli_ReferenceDesignator.hxx index 5863d9cf95..69a5e1bcfe 100644 --- a/src/IGESAppli/IGESAppli_ReferenceDesignator.hxx +++ b/src/IGESAppli/IGESAppli_ReferenceDesignator.hxx @@ -33,29 +33,32 @@ class IGESAppli_ReferenceDesignator : public IGESData_IGESEntity { public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 7; } + IGESAppli_ReferenceDesignator() {} - - //! This method is used to set the fields of the class - //! ReferenceDesignator - //! - nbPropVal : Number of property values = 1 - //! - aText : Reference designator text - Standard_EXPORT void Init (const Standard_Integer nbPropVal, const Handle(TCollection_HAsciiString)& aText); - - //! returns the number of property values - //! is always 1 - Standard_Integer NbPropertyValues() const { return theNbPropertyValues; } //! returns the Reference designator text - const Handle(TCollection_HAsciiString) & RefDesignatorText() const { return theRefDesigText; } + const Handle(TCollection_HAsciiString) & RefDesignatorText() const { return myRefDesigText; } + + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual Standard_Boolean OwnCorrect () Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_ReferenceDesignator,IGESData_IGESEntity) private: - Standard_Integer theNbPropertyValues; - Handle(TCollection_HAsciiString) theRefDesigText; + Handle(TCollection_HAsciiString) myRefDesigText; }; #endif // _IGESAppli_ReferenceDesignator_HeaderFile diff --git a/src/IGESAppli/IGESAppli_RegionRestriction.cxx b/src/IGESAppli/IGESAppli_RegionRestriction.cxx index b591f41c81..b00142a911 100644 --- a/src/IGESAppli/IGESAppli_RegionRestriction.cxx +++ b/src/IGESAppli/IGESAppli_RegionRestriction.cxx @@ -17,18 +17,42 @@ //-------------------------------------------------------------------- #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_RegionRestriction,IGESData_IGESEntity) -void IGESAppli_RegionRestriction::Init - (const Standard_Integer nbPropVal, const Standard_Integer aViasRest, - const Standard_Integer aCompoRest, const Standard_Integer aCktRest) +void IGESAppli_RegionRestriction::OwnRead (IGESFile_Reader &theReader) { - theNbPropertyValues = nbPropVal; - theElectViasRestrict = aViasRest; - theElectCompRestrict = aCompoRest; - theElectCktRestrict = aCktRest; - InitTypeAndForm(406,2); + Standard_Integer aNbPropertyValues = 3; + if (theReader.ReadInteger(aNbPropertyValues,"No. of Property values") == IGESFile_Reader::ParamError || aNbPropertyValues != 3) + theReader.AddFail("Number of Property Values != 3"); + theReader.ReadInteger(myElectViasRestrict,"Electrical vias restriction"); + theReader.ReadInteger(myElectCompRestrict,"Electrical components restriction"); + theReader.ReadInteger(myElectCktRestrict," Electrical circuitary restriction"); +} + +void IGESAppli_RegionRestriction::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(3); + IW.Send(myElectViasRestrict); + IW.Send(myElectCompRestrict); + IW.Send(myElectCktRestrict); +} + +IGESData_DirChecker IGESAppli_RegionRestriction::DirChecker () const +{ + IGESData_DirChecker DC(406,2); //Form no = 2 & Type = 406 + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } void IGESAppli_RegionRestriction::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &theCheck) const @@ -37,14 +61,32 @@ void IGESAppli_RegionRestriction::OwnCheck (const Interface_ShareTool &, const H if (DefLevel() != IGESData_DefOne && DefLevel() != IGESData_DefSeveral) theCheck->AddFail("Level type: Not value/reference"); - if (NbPropertyValues() != 3) - theCheck->AddFail("Number of Property Values != 3"); - if (ElectricalViasRestriction() < 0 || ElectricalViasRestriction() > 2) + + if (myElectViasRestrict < 0 || myElectViasRestrict > 2) theCheck->AddFail("Incorrect value for Electrical Vias Restriction"); - if (ElectricalComponentRestriction() < 0 || ElectricalComponentRestriction() > 2) + if (myElectCompRestrict < 0 || myElectCompRestrict > 2) theCheck->AddFail("Incorrect value for Electrical Component Restriction"); - if (ElectricalCktRestriction() < 0 || ElectricalCktRestriction() > 2) + if (myElectCktRestrict < 0 || myElectCktRestrict > 2) theCheck->AddFail("Incorrect value for Electrical Circuit Restriction"); //UNFINISHED //level ignored if this property is subordinate -- queried } + +Standard_Boolean IGESAppli_RegionRestriction::OwnCorrect () +{ + if (SubordinateStatus() != 0) { + Handle(IGESData_LevelListEntity) nulevel; + InitLevel(nulevel,0); + return Standard_True; + } + return Standard_False; +} + +void IGESAppli_RegionRestriction::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const +{ + S << "IGESAppli_RegionRestriction" << endl; + S << "Number of property values : 3" << endl; + S << "Electrical vias restriction : " << myElectViasRestrict << endl; + S << "Electrical components restriction : " << myElectCompRestrict << endl; + S << "Electrical circuitary restriction : " << myElectCktRestrict << endl; +} diff --git a/src/IGESAppli/IGESAppli_RegionRestriction.hxx b/src/IGESAppli/IGESAppli_RegionRestriction.hxx index c4d31b29b9..a7b0e5e513 100644 --- a/src/IGESAppli/IGESAppli_RegionRestriction.hxx +++ b/src/IGESAppli/IGESAppli_RegionRestriction.hxx @@ -30,41 +30,47 @@ class IGESAppli_RegionRestriction : public IGESData_IGESEntity { public: - IGESAppli_RegionRestriction() {} - - //! This method is used to set the fields of the class - //! RegionRestriction - //! - nbPropVal : Number of property values, always = 3 - //! - aViasRest : Electrical Vias restriction - //! - aCompoRest : Electrical components restriction - //! - aCktRest : Electrical circuitry restriction - Standard_EXPORT void Init (const Standard_Integer nbPropVal, const Standard_Integer aViasRest, const Standard_Integer aCompoRest, const Standard_Integer aCktRest); - - //! is always 3 - Standard_Integer NbPropertyValues() const { return theNbPropertyValues; } + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 2; } + + IGESAppli_RegionRestriction() + : myElectViasRestrict(0), + myElectCompRestrict(0), + myElectCktRestrict(0) + {} //! returns the Electrical vias restriction //! is 0, 1 or 2 - Standard_Integer ElectricalViasRestriction() const { return theElectViasRestrict; } + Standard_Integer ElectricalViasRestriction() const { return myElectViasRestrict; } //! returns the Electrical components restriction //! is 0, 1 or 2 - Standard_Integer ElectricalComponentRestriction() const { return theElectCompRestrict; } + Standard_Integer ElectricalComponentRestriction() const { return myElectCompRestrict; } //! returns the Electrical circuitry restriction //! is 0, 1 or 2 - Standard_Integer ElectricalCktRestriction() const { return theElectCktRestrict; } + Standard_Integer ElectricalCktRestriction() const { return myElectCktRestrict; } + + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual Standard_Boolean OwnCorrect () Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESAppli_RegionRestriction,IGESData_IGESEntity) private: - Standard_Integer theNbPropertyValues; - Standard_Integer theElectViasRestrict; - Standard_Integer theElectCompRestrict; - Standard_Integer theElectCktRestrict; + Standard_Integer myElectViasRestrict; + Standard_Integer myElectCompRestrict; + Standard_Integer myElectCktRestrict; }; #endif // _IGESAppli_RegionRestriction_HeaderFile diff --git a/src/IGESAppli/IGESAppli_SpecificModule.cxx b/src/IGESAppli/IGESAppli_SpecificModule.cxx deleted file mode 100644 index 57583f81d5..0000000000 --- a/src/IGESAppli/IGESAppli_SpecificModule.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_SpecificModule,IGESData_SpecificModule) - -// Each Module is attached to a Protocol : it must interprete Case Numbers -// (arguments of various methods) in accordance to values returned by -// the method TypeNumber from this Protocol -IGESAppli_SpecificModule::IGESAppli_SpecificModule() { } - - - void IGESAppli_SpecificModule::OwnDump - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, - const Standard_Integer own) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESAppli_DrilledHole,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolDrilledHole tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 2 : { - DeclareAndCast(IGESAppli_ElementResults,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolElementResults tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 3 : { - DeclareAndCast(IGESAppli_FiniteElement,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolFiniteElement tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 4 : { - DeclareAndCast(IGESAppli_Flow,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolFlow tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 5 : { - DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolFlowLineSpec tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 6 : { - DeclareAndCast(IGESAppli_LevelFunction,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolLevelFunction tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 7 : { - DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolLevelToPWBLayerMap tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 8 : { - DeclareAndCast(IGESAppli_LineWidening,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolLineWidening tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 9 : { - DeclareAndCast(IGESAppli_NodalConstraint,anent,ent) ; - if (anent.IsNull()) return; - IGESAppli_ToolNodalConstraint tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 10 : { - DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolNodalDisplAndRot tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 11 : { - DeclareAndCast(IGESAppli_NodalResults,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolNodalResults tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 12 : { - DeclareAndCast(IGESAppli_Node,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolNode tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 13 : { - DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPWBArtworkStackup tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 14 : { - DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPWBDrilledHole tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 15 : { - DeclareAndCast(IGESAppli_PartNumber,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPartNumber tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 16 : { - DeclareAndCast(IGESAppli_PinNumber,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPinNumber tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 17 : { - DeclareAndCast(IGESAppli_PipingFlow,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolPipingFlow tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 18 : { - DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolReferenceDesignator tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 19 : { - DeclareAndCast(IGESAppli_RegionRestriction,anent,ent); - if (anent.IsNull()) return; - IGESAppli_ToolRegionRestriction tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - default : break; - } -} - - - Standard_Boolean IGESAppli_SpecificModule::OwnCorrect - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const -{ -// Applies only on some types - switch (CN) { - case 1 : { - DeclareAndCast(IGESAppli_DrilledHole,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolDrilledHole tool; - return tool.OwnCorrect(anent); - } - case 4 : { - DeclareAndCast(IGESAppli_Flow,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolFlow tool; - return tool.OwnCorrect(anent); - } - case 6 : { - DeclareAndCast(IGESAppli_LevelFunction,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolLevelFunction tool; - return tool.OwnCorrect(anent); - } - case 8 : { - DeclareAndCast(IGESAppli_LineWidening,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolLineWidening tool; - return tool.OwnCorrect(anent); - } - case 14 : { - DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolPWBDrilledHole tool; - return tool.OwnCorrect(anent); - } - case 15 : { - DeclareAndCast(IGESAppli_PartNumber,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolPartNumber tool; - return tool.OwnCorrect(anent); - } - case 16 : { - DeclareAndCast(IGESAppli_PinNumber,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolPinNumber tool; - return tool.OwnCorrect(anent); - } - case 17 : { - DeclareAndCast(IGESAppli_PipingFlow,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolPipingFlow tool; - return tool.OwnCorrect(anent); - } - case 18 : { - DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolReferenceDesignator tool; - return tool.OwnCorrect(anent); - } - case 19 : { - DeclareAndCast(IGESAppli_RegionRestriction,anent,ent); - if (anent.IsNull()) break; - IGESAppli_ToolRegionRestriction tool; - return tool.OwnCorrect(anent); - } - default : break; - } - return Standard_False; -} diff --git a/src/IGESAppli/IGESAppli_SpecificModule.hxx b/src/IGESAppli/IGESAppli_SpecificModule.hxx deleted file mode 100644 index 2e723c6f5f..0000000000 --- a/src/IGESAppli/IGESAppli_SpecificModule.hxx +++ /dev/null @@ -1,74 +0,0 @@ -// Created on: 1993-09-07 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_SpecificModule_HeaderFile -#define _IGESAppli_SpecificModule_HeaderFile - -#include -#include - -#include -#include -#include -class IGESData_IGESEntity; -class IGESData_IGESDumper; -class Message_Messenger; - - -class IGESAppli_SpecificModule; -DEFINE_STANDARD_HANDLE(IGESAppli_SpecificModule, IGESData_SpecificModule) - -//! Defines Services attached to IGES Entities : -//! Dump & OwnCorrect, for IGESAppli -class IGESAppli_SpecificModule : public IGESData_SpecificModule -{ - -public: - - - //! Creates a SpecificModule from IGESAppli & puts it into SpecificLib - Standard_EXPORT IGESAppli_SpecificModule(); - - //! Specific Dump (own parameters) for IGESAppli - Standard_EXPORT void OwnDump (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const Standard_OVERRIDE; - - //! ---Purpose - Standard_EXPORT virtual Standard_Boolean OwnCorrect (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IGESAppli_SpecificModule,IGESData_SpecificModule) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IGESAppli_SpecificModule_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolDrilledHole.cxx b/src/IGESAppli/IGESAppli_ToolDrilledHole.cxx deleted file mode 100644 index b01f4957eb..0000000000 --- a/src/IGESAppli/IGESAppli_ToolDrilledHole.cxx +++ /dev/null @@ -1,113 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolDrilledHole::ReadOwnParams - (const Handle(IGESAppli_DrilledHole)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - Standard_Integer tempNbPropertyValues; - Standard_Real tempDrillDiaSize; - Standard_Real tempFinishDiaSize; - Standard_Integer tempPlatingFlag; - Standard_Integer tempNbLowerLayer; - Standard_Integer tempNbHigherLayer; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(),"No. of Property values",tempNbPropertyValues); - PR.ReadReal(PR.Current(),"Drill diameter size",tempDrillDiaSize); - PR.ReadReal(PR.Current(),"Finish diameter size",tempFinishDiaSize); - PR.ReadInteger(PR.Current(),"Plating Flag",tempPlatingFlag); - PR.ReadInteger(PR.Current(),"Lower numbered layer", tempNbLowerLayer); - PR.ReadInteger(PR.Current(),"Higher numbered layer", tempNbHigherLayer); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempNbPropertyValues,tempDrillDiaSize,tempFinishDiaSize, - tempPlatingFlag, tempNbLowerLayer,tempNbHigherLayer); -} - -void IGESAppli_ToolDrilledHole::WriteOwnParams - (const Handle(IGESAppli_DrilledHole)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->NbPropertyValues()); - IW.Send(ent->DrillDiaSize()); - IW.Send(ent->FinishDiaSize()); - IW.SendBoolean(ent->IsPlating()); - IW.Send(ent->NbLowerLayer()); - IW.Send(ent->NbHigherLayer()); -} - - -Standard_Boolean IGESAppli_ToolDrilledHole::OwnCorrect - (const Handle(IGESAppli_DrilledHole)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 5); - if (res) ent->Init - (5,ent->DrillDiaSize(),ent->FinishDiaSize(),(ent->IsPlating() ? 1 : 0), - ent->NbLowerLayer(),ent->NbHigherLayer()); - if (ent->SubordinateStatus() != 0) { - Handle(IGESData_LevelListEntity) nulevel; - ent->InitLevel(nulevel,0); - res = Standard_True; - } // NbPropertyvalues = 5 + RAZ level selon subordinate - return res; -} - -IGESData_DirChecker IGESAppli_ToolDrilledHole::DirChecker - (const Handle(IGESAppli_DrilledHole)& /*ent*/) const -{ - IGESData_DirChecker DC(406,6); //Form no = 6 & Type = 406 - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolDrilledHole::OwnDump - (const Handle(IGESAppli_DrilledHole)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const -{ - S << "IGESAppli_DrilledHole" << endl; - - S << "Number of property values : " << ent->NbPropertyValues() << endl; - S << "Drill diameter size :" << ent->DrillDiaSize() << " "; - S << "Finish diameter size : " << ent->FinishDiaSize() << endl; - S << "Plating indication flag : "; - if (!ent->IsPlating()) S << "NO" << " - "; - else S << "YES - "; - S << "Lower Numbered Layer : " << ent->NbLowerLayer() << " "; - S << "Higher Numbered Layer : " << ent->NbHigherLayer() << endl; -} diff --git a/src/IGESAppli/IGESAppli_ToolDrilledHole.hxx b/src/IGESAppli/IGESAppli_ToolDrilledHole.hxx deleted file mode 100644 index d2d15164c8..0000000000 --- a/src/IGESAppli/IGESAppli_ToolDrilledHole.hxx +++ /dev/null @@ -1,68 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolDrilledHole_HeaderFile -#define _IGESAppli_ToolDrilledHole_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESAppli_DrilledHole; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a DrilledHole. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolDrilledHole -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolDrilledHole, ready to work - IGESAppli_ToolDrilledHole() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_DrilledHole)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_DrilledHole)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a DrilledHole - //! (NbPropertyValues forced to 5, Level cleared if Subordinate != 0) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESAppli_DrilledHole)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_DrilledHole)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_DrilledHole)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolDrilledHole_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolElementResults.cxx b/src/IGESAppli/IGESAppli_ToolElementResults.cxx deleted file mode 100644 index 9c9dfd5a4c..0000000000 --- a/src/IGESAppli/IGESAppli_ToolElementResults.cxx +++ /dev/null @@ -1,213 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- -// UNFINISHED & UNSTARTED - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - - -void IGESAppli_ToolElementResults::ReadOwnParams - (const Handle(IGESAppli_ElementResults)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer num = 0; - Handle(IGESDimen_GeneralNote) aNote; - Standard_Integer aSubcaseNumber = 0; - Standard_Real aTime = 0; - Standard_Integer nv = 0; - Standard_Integer aResultReportFlag = 0; - Handle(TColStd_HArray1OfInteger) allElementIdentifiers; - Handle(IGESAppli_HArray1OfFiniteElement) allElements; - Handle(TColStd_HArray1OfInteger) allElementTopologyType; - Handle(TColStd_HArray1OfInteger) allNbLayers; - Handle(TColStd_HArray1OfInteger) allDataLayerFlag; - Handle(TColStd_HArray1OfInteger) allNbResultDataLocs; - Handle(IGESBasic_HArray1OfHArray1OfInteger) allResultDataLoc; - Handle(IGESBasic_HArray1OfHArray1OfReal) allResultData; - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadEntity(IR, PR.Current(), "General Note", STANDARD_TYPE(IGESDimen_GeneralNote), aNote); - PR.ReadInteger(PR.Current(), "Subcase Number", aSubcaseNumber); - PR.ReadReal(PR.Current(), "Time", aTime); - PR.ReadInteger(PR.Current(), "Number of Result Values", nv); - PR.ReadInteger(PR.Current(), "Result Report Flag", aResultReportFlag); - PR.ReadInteger(PR.Current(), "Number of Finite Elements", num); - - if (num > 0) { - allElementIdentifiers = new TColStd_HArray1OfInteger(1, num); - allElements = new IGESAppli_HArray1OfFiniteElement(1, num); - allElementTopologyType = new TColStd_HArray1OfInteger(1, num); - allNbLayers = new TColStd_HArray1OfInteger(1, num); - allDataLayerFlag = new TColStd_HArray1OfInteger(1, num); - allNbResultDataLocs = new TColStd_HArray1OfInteger(1, num); - allResultDataLoc = new IGESBasic_HArray1OfHArray1OfInteger(1, num); - allResultData = new IGESBasic_HArray1OfHArray1OfReal(1, num); -// ?? WHAT ABOUT FILLING ? - } - else PR.AddFail("Number of Finite Elements: Not Positive"); - - for (Standard_Integer nume = 1; nume <= num; nume ++) { - Standard_Integer ival, nl, nrl, numv; - ival = nl = nrl = numv = 0; - Handle(IGESAppli_FiniteElement) aFEM; - Handle(TColStd_HArray1OfInteger) rdrl; - Handle(TColStd_HArray1OfReal) vres; - //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger (PR.Current(), "FEM Element Identifier", ival)) - allElementIdentifiers->SetValue(nume,ival); - if (PR.ReadEntity (IR,PR.Current(), "FEM Element Entity", STANDARD_TYPE(IGESAppli_FiniteElement), aFEM)) - allElements->SetValue (nume,aFEM); - if (PR.ReadInteger (PR.Current(), "FEM Element Topology Type", ival)) - allElementTopologyType->SetValue (nume,ival); - if (PR.ReadInteger (PR.Current(), "Nb. of layers", nl)) - allNbLayers->SetValue (nume,nl); - if (PR.ReadInteger (PR.Current(), "Data Layer Flag", ival)) - allDataLayerFlag->SetValue (nume,ival); - if (PR.ReadInteger (PR.Current(), "Nb. of result data locations", nrl)) - allNbResultDataLocs->SetValue (nume,nrl); - if (PR.ReadInts (PR.CurrentList(nrl), "Result data locations", rdrl)) - allResultDataLoc->SetValue (nume,rdrl); - PR.ReadInteger (PR.Current(), "Nb. of result data locations", numv); //szv#4:S4163:12Mar99 `st=` not needed - if (PR.ReadReals (PR.CurrentList(numv), "Result Data", vres)) - allResultData->SetValue(nume,vres); - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(aNote, aSubcaseNumber, aTime, nv, aResultReportFlag, - allElementIdentifiers, allElements, allElementTopologyType, - allNbLayers, allDataLayerFlag, allNbResultDataLocs, - allResultDataLoc, allResultData); -} - -void IGESAppli_ToolElementResults::WriteOwnParams - (const Handle(IGESAppli_ElementResults)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer i,j; Standard_Integer num = ent->NbElements(); - IW.Send(ent->Note()); - IW.Send(ent->SubCaseNumber()); - IW.Send(ent->Time()); - IW.Send(ent->NbResultValues()); - IW.Send(ent->ResultReportFlag()); - IW.Send(num); - for ( i = 1; i <= num; i++ ) { - Standard_Integer nl = ent->NbLayers(i); - Standard_Integer nrl = ent->NbResultDataLocs(i); - Standard_Integer numv = ent->NbResults(i); - IW.Send(ent->ElementIdentifier(i)); - IW.Send(ent->Element(i)); - IW.Send(ent->ElementTopologyType(i)); - IW.Send(nl); - IW.Send(ent->DataLayerFlag(i)); - IW.Send(nrl); - for (j = 1; j <= nrl; j ++) IW.Send(ent->ResultDataLoc(i,j)); - IW.Send(numv); - for (j = 1; j <= numv; j ++) IW.Send(ent->ResultData(i,j)); - } -} - - -IGESData_DirChecker IGESAppli_ToolElementResults::DirChecker - (const Handle(IGESAppli_ElementResults)& /* ent */) const -{ - IGESData_DirChecker DC(148, 0, 34); - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefAny); - DC.BlankStatusIgnored(); - DC.UseFlagRequired(3); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolElementResults::OwnDump - (const Handle(IGESAppli_ElementResults)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const // UNFINISHED -{ - Standard_Integer sublevel = (level > 4) ? 1 : 0; - S << "IGESAppli_ElementResults" << endl; - S << "General Note : "; - dumper.Dump(ent->Note(),S, sublevel); - S << endl; - S << "Subcase Number : " << ent->SubCaseNumber() << endl; - S << "Time : " << ent->Time() << endl; - S << "Number of Result Values : " << ent->NbResultValues() << endl; - S << "Result Report Flag : " << ent->ResultReportFlag() << endl; - S << "Element Identifiers : "; - IGESData_DumpVals(S ,level,1, ent->NbElements(),ent->ElementIdentifier); - S << endl << "Elements : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbElements(),ent->Element); - S << endl << "Element Topology Types : "; - IGESData_DumpVals(S ,level,1, ent->NbElements(),ent->ElementTopologyType); - S << endl << "Numbers of Layers : "; - IGESData_DumpVals(S ,level,1, ent->NbElements(),ent->NbLayers); - S << endl << "Data Layer Flags : "; - IGESData_DumpVals(S ,level,1, ent->NbElements(),ent->DataLayerFlag); - S << endl << "Numbers of Result Data Locations : "; - IGESData_DumpVals(S ,level,1, ent->NbElements(),ent->NbResultDataLocs); - S << endl << "Result Data Locations : "; S << " TO BE DONE "; - -// ?? A VERIFIER DE PRES, pas du tout sur que ce soit bon -// cf aussi Write et Copy - if (level <= 4) S << " [ ask level > 4 for more, > 5 for complete ]" << endl; - else { - Standard_Integer i;// svv Jan 10 2000 : porting on DEC - for (i = 1; i <= ent->NbElements(); i ++) { - Standard_Integer nloc = ent->NbResultDataLocs(i); - S << " ["<ResultDataLoc (i,j); - S << endl; - } - S << "Result Data : "; - - for (i = 1; i <= ent->NbElements(); i ++) { - Standard_Integer nres = ent->NbResults(i); - S << " ["< 5 for complete Data ]" << endl; - else { - for (Standard_Integer j = 1; j <= nres; j ++) - S << " " << ent->ResultData(i,j); // ?? is it all ?? UNFINISHED - } - } - } -} diff --git a/src/IGESAppli/IGESAppli_ToolElementResults.hxx b/src/IGESAppli/IGESAppli_ToolElementResults.hxx deleted file mode 100644 index 7aff73f667..0000000000 --- a/src/IGESAppli/IGESAppli_ToolElementResults.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolElementResults_HeaderFile -#define _IGESAppli_ToolElementResults_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESAppli_ElementResults; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a ElementResults. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolElementResults -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolElementResults, ready to work - IGESAppli_ToolElementResults() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_ElementResults)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_ElementResults)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_ElementResults)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_ElementResults)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolElementResults_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolFiniteElement.cxx b/src/IGESAppli/IGESAppli_ToolFiniteElement.cxx deleted file mode 100644 index 6df5864cfe..0000000000 --- a/src/IGESAppli/IGESAppli_ToolFiniteElement.cxx +++ /dev/null @@ -1,103 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolFiniteElement::ReadOwnParams - (const Handle(IGESAppli_FiniteElement)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - Standard_Integer tempTopology; - Handle(TCollection_HAsciiString) tempName; - Standard_Integer nbval = 0; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Handle(IGESAppli_HArray1OfNode) tempData; - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(),"Topology type",tempTopology); - PR.ReadInteger(PR.Current(),"No. of nodes defining element",nbval); - tempData = new IGESAppli_HArray1OfNode(1,nbval); - for (Standard_Integer i = 1; i <= nbval; i ++) - { - Handle(IGESAppli_Node) tempNode; - //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity (IR,PR.Current(),"Node defining element", STANDARD_TYPE(IGESAppli_Node),tempNode)) - tempData->SetValue(i,tempNode); - } - PR.ReadText(PR.Current(),"Element type name",tempName); //szv#4:S4163:12Mar99 `st=` not needed - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempTopology,tempData,tempName); -} - -void IGESAppli_ToolFiniteElement::WriteOwnParams - (const Handle(IGESAppli_FiniteElement)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer upper = ent->NbNodes(); - IW.Send(ent->Topology()); - IW.Send(upper); - for (Standard_Integer i= 1; i <= upper ; i ++) - IW.Send(ent->Node(i)); - IW.Send(ent->Name()); -} - -IGESData_DirChecker IGESAppli_ToolFiniteElement::DirChecker - (const Handle(IGESAppli_FiniteElement)& /* ent */ ) const -{ - IGESData_DirChecker DC(136,0); //Form no = 0 & Type = 136 - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefAny); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefAny); - DC.BlankStatusIgnored(); - DC.SubordinateStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolFiniteElement::OwnDump - (const Handle(IGESAppli_FiniteElement)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESAppli_FiniteElement" << endl; - - S << "Topology type : " << ent->Topology() << endl; - S << "Nodes : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbNodes(),ent->Node); - S << endl << "Element Name : " << ent->Name(); - S << endl; -} diff --git a/src/IGESAppli/IGESAppli_ToolFiniteElement.hxx b/src/IGESAppli/IGESAppli_ToolFiniteElement.hxx deleted file mode 100644 index 0752463977..0000000000 --- a/src/IGESAppli/IGESAppli_ToolFiniteElement.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolFiniteElement_HeaderFile -#define _IGESAppli_ToolFiniteElement_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESAppli_FiniteElement; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a FiniteElement. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolFiniteElement -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolFiniteElement, ready to work - IGESAppli_ToolFiniteElement() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_FiniteElement)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_FiniteElement)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_FiniteElement)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_FiniteElement)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolFiniteElement_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolFlow.cxx b/src/IGESAppli/IGESAppli_ToolFlow.cxx deleted file mode 100644 index 9e9ad7a119..0000000000 --- a/src/IGESAppli/IGESAppli_ToolFlow.cxx +++ /dev/null @@ -1,227 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolFlow::ReadOwnParams - (const Handle(IGESAppli_Flow)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer tempNbContextFlags; - Standard_Integer tempTypeOfFlow; - Standard_Integer tempFunctionFlag; - Standard_Integer i, nf,nc,nj,nn,nt,np; - Handle(IGESData_HArray1OfIGESEntity) tempFlowAssocs; - Handle(IGESDraw_HArray1OfConnectPoint) tempConnectPoints; - Handle(IGESData_HArray1OfIGESEntity) tempJoins; - Handle(Interface_HArray1OfHAsciiString) tempFlowNames; - Handle(IGESGraph_HArray1OfTextDisplayTemplate) tempTextDisplayTemplates; - Handle(IGESData_HArray1OfIGESEntity) tempContFlowAssocs; - - //szv#4:S4163:12Mar99 `st=` not needed - if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Number of Context Flags", tempNbContextFlags); - else - tempNbContextFlags = 2; - - //szv#4:S4163:12Mar99 moved in if - if (!PR.ReadInteger(PR.Current(), "Number of Flow Associativities", nf)) nf = 0; - if (nf > 0) tempFlowAssocs = new IGESData_HArray1OfIGESEntity(1, nf); - else PR.AddFail ("Number of Flow Associativities: Not Positive"); - - if (!PR.ReadInteger(PR.Current(), "Number of Connect Points", nc)) nc = 0; - if (nc > 0) tempConnectPoints = new IGESDraw_HArray1OfConnectPoint(1, nc); - else PR.AddFail("Number of Connect Points: Not Positive"); - - if (!PR.ReadInteger(PR.Current(), "Number of Joins", nj)) nj = 0; - if (nj > 0) tempJoins = new IGESData_HArray1OfIGESEntity(1, nj); - else PR.AddFail("Number of Joins: Not Positive"); - - if (!PR.ReadInteger(PR.Current(), "Number of Flow Names", nn)) nn = 0; - if (nn > 0) tempFlowNames = new Interface_HArray1OfHAsciiString(1, nn); - else PR.AddFail("Number of Flow Names: Not Positive"); - - if (!PR.ReadInteger(PR.Current(), "Number of Text Displays", nt)) nt = 0; - if (nt > 0) tempTextDisplayTemplates = - new IGESGraph_HArray1OfTextDisplayTemplate(1, nt); - else PR.AddFail("Number of Text Displays: Not Positive"); - - if (!PR.ReadInteger(PR.Current(), "Number of Continuation Flows", np)) np = 0; - if (np > 0) tempContFlowAssocs = new IGESData_HArray1OfIGESEntity(1, np); - else PR.AddFail("Number of Continuation Flows Not Positive"); - - if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Type of Flow", tempTypeOfFlow); - else - tempTypeOfFlow = 0; - - if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Function Flag", tempFunctionFlag); - else - tempFunctionFlag = 0; - - for ( i = 1; i <= nf; i++ ) { - Handle(IGESData_IGESEntity) tempEntity; - if (PR.ReadEntity(IR, PR.Current(), "Flow Associativity", tempEntity)) - tempFlowAssocs->SetValue(i, tempEntity); - } - - for ( i = 1; i <= nc; i++ ) { - Handle(IGESDraw_ConnectPoint) tempEntity; - if (PR.ReadEntity(IR, PR.Current(), "Connect Point", STANDARD_TYPE(IGESDraw_ConnectPoint), tempEntity)) - tempConnectPoints->SetValue(i, tempEntity); - } - - for ( i = 1; i <= nj; i++ ) { - Handle(IGESData_IGESEntity) tempEntity; - if (PR.ReadEntity(IR, PR.Current(), "Join", tempEntity)) - tempJoins->SetValue(i, tempEntity); - } - - for ( i = 1; i <= nn; i++ ) { - Handle(TCollection_HAsciiString) tempString; - if (PR.ReadText(PR.Current(), "Flow Name", tempString)) - tempFlowNames->SetValue(i, tempString); - } - - for ( i = 1; i <= nt; i++ ) { - Handle(IGESGraph_TextDisplayTemplate) tempEntity; - if (PR.ReadEntity(IR, PR.Current(), "Text Display Template", - STANDARD_TYPE(IGESGraph_TextDisplayTemplate), tempEntity)) - tempTextDisplayTemplates->SetValue(i, tempEntity); - } - - for ( i = 1; i <= np; i++ ) { - Handle(IGESData_IGESEntity) tempEntity; - if (PR.ReadEntity(IR, PR.Current(), "Continuation Flow Associativities", tempEntity)) - tempContFlowAssocs->SetValue(i, tempEntity); - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempNbContextFlags, tempTypeOfFlow, tempFunctionFlag, - tempFlowAssocs, tempConnectPoints, tempJoins, tempFlowNames, - tempTextDisplayTemplates, tempContFlowAssocs); -} - -void IGESAppli_ToolFlow::WriteOwnParams - (const Handle(IGESAppli_Flow)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer i, num; - IW.Send(ent->NbContextFlags()); - IW.Send(ent->NbFlowAssociativities()); - IW.Send(ent->NbConnectPoints()); - IW.Send(ent->NbJoins()); - IW.Send(ent->NbFlowNames()); - IW.Send(ent->NbTextDisplayTemplates()); - IW.Send(ent->NbContFlowAssociativities()); - IW.Send(ent->TypeOfFlow()); - IW.Send(ent->FunctionFlag()); - for ( num = ent->NbFlowAssociativities(), i = 1; i <= num; i++ ) - IW.Send(ent->FlowAssociativity(i)); - for ( num = ent->NbConnectPoints(), i = 1; i <= num; i++ ) - IW.Send(ent->ConnectPoint(i)); - for ( num = ent->NbJoins(), i = 1; i <= num; i++ ) - IW.Send(ent->Join(i)); - for ( num = ent->NbFlowNames(), i = 1; i <= num; i++ ) - IW.Send(ent->FlowName(i)); - for ( num = ent->NbTextDisplayTemplates(), i = 1; i <= num; i++ ) - IW.Send(ent->TextDisplayTemplate(i)); - for ( num = ent->NbContFlowAssociativities(), i = 1; i <= num; i++ ) - IW.Send(ent->ContFlowAssociativity(i)); -} - -Standard_Boolean IGESAppli_ToolFlow::OwnCorrect - (const Handle(IGESAppli_Flow)& ent) const -{ - return ent->OwnCorrect(); // nbcontextflags = 2 -} - -IGESData_DirChecker IGESAppli_ToolFlow::DirChecker - (const Handle(IGESAppli_Flow)& /* ent */ ) const -{ - IGESData_DirChecker DC(402, 18); - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagRequired(3); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolFlow::OwnDump - (const Handle(IGESAppli_Flow)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESAppli_Flow" << endl; - S << "Number of Context Flags : " << ent->NbContextFlags() << endl; - Standard_Integer tf = ent->TypeOfFlow(); - S << "Type of Flow : " << tf; - if (tf == 1) S << " (logical)" << endl; - else if (tf == 2) S << " (physical)" << endl; - else S << " (not specified)" << endl; - tf = ent->FunctionFlag(); - S << "Function Flag : " << tf; - if (tf == 1) S << " (electrical signal)" << endl; - else if (tf == 2) S << " (fluid flow path)" << endl; - else S << " (not specified)" << endl; - S << "Flow Associativities : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbFlowAssociativities(), - ent->FlowAssociativity); - S << endl << "Connect Points : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbConnectPoints(), - ent->ConnectPoint); - S << endl << "Joins : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbJoins(),ent->Join); - S << endl << "Flow Names : "; - IGESData_DumpStrings(S ,level,1, ent->NbFlowNames(),ent->FlowName); - S << endl << "Text Display Templates : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbTextDisplayTemplates(), - ent->TextDisplayTemplate); - S << endl << "Continuation Flow Associativities : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbContFlowAssociativities(), - ent->ContFlowAssociativity); - S << endl; -} - diff --git a/src/IGESAppli/IGESAppli_ToolFlow.hxx b/src/IGESAppli/IGESAppli_ToolFlow.hxx deleted file mode 100644 index 9d92ed6b4f..0000000000 --- a/src/IGESAppli/IGESAppli_ToolFlow.hxx +++ /dev/null @@ -1,69 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolFlow_HeaderFile -#define _IGESAppli_ToolFlow_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESAppli_Flow; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a Flow. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolFlow -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolFlow, ready to work - IGESAppli_ToolFlow() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_Flow)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_Flow)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a Flow - //! (NbContextFlags forced to 2) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESAppli_Flow)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_Flow)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_Flow)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; - -}; - -#endif // _IGESAppli_ToolFlow_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolFlowLineSpec.cxx b/src/IGESAppli/IGESAppli_ToolFlowLineSpec.cxx deleted file mode 100644 index 324cfaae2e..0000000000 --- a/src/IGESAppli/IGESAppli_ToolFlowLineSpec.cxx +++ /dev/null @@ -1,89 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolFlowLineSpec::ReadOwnParams - (const Handle(IGESAppli_FlowLineSpec)& ent, - const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer num; - Handle(Interface_HArray1OfHAsciiString) tempNameAndModifiers; - if (!PR.ReadInteger(PR.Current(), "Number of property values", num)) num = 0; - if (num > 0) tempNameAndModifiers = new Interface_HArray1OfHAsciiString(1, num); - else PR.AddFail("Number of property values: Not Positive"); - //szv#4:S4163:12Mar99 `st=` not needed - if (!tempNameAndModifiers.IsNull()) - PR.ReadTexts(PR.CurrentList(num), "Name and Modifiers", tempNameAndModifiers); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempNameAndModifiers); -} - -void IGESAppli_ToolFlowLineSpec::WriteOwnParams - (const Handle(IGESAppli_FlowLineSpec)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer i, num; - IW.Send(ent->NbPropertyValues()); - for ( num = ent->NbPropertyValues(), i = 1; i <= num; i++ ) - IW.Send(ent->Modifier(i)); -} - -IGESData_DirChecker IGESAppli_ToolFlowLineSpec::DirChecker - (const Handle(IGESAppli_FlowLineSpec)& /* ent */ ) const -{ - IGESData_DirChecker DC(406, 14); - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolFlowLineSpec::OwnDump - (const Handle(IGESAppli_FlowLineSpec)& ent, const IGESData_IGESDumper& /* dumper */, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESAppli_FlowLineSpec" << endl; - S << "Name and Modifiers : "; - IGESData_DumpStrings(S ,level,1, ent->NbPropertyValues(),ent->Modifier); - S << endl; -} - diff --git a/src/IGESAppli/IGESAppli_ToolFlowLineSpec.hxx b/src/IGESAppli/IGESAppli_ToolFlowLineSpec.hxx deleted file mode 100644 index 1023c44129..0000000000 --- a/src/IGESAppli/IGESAppli_ToolFlowLineSpec.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolFlowLineSpec_HeaderFile -#define _IGESAppli_ToolFlowLineSpec_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESAppli_FlowLineSpec; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a FlowLineSpec. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolFlowLineSpec -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolFlowLineSpec, ready to work - IGESAppli_ToolFlowLineSpec() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_FlowLineSpec)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_FlowLineSpec)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_FlowLineSpec)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_FlowLineSpec)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolFlowLineSpec_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolLevelFunction.cxx b/src/IGESAppli/IGESAppli_ToolLevelFunction.cxx deleted file mode 100644 index 0f767d4d05..0000000000 --- a/src/IGESAppli/IGESAppli_ToolLevelFunction.cxx +++ /dev/null @@ -1,102 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolLevelFunction::ReadOwnParams - (const Handle(IGESAppli_LevelFunction)& ent, - const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const -{ - Standard_Integer tempNbPropertyValues; - Standard_Integer tempFuncDescripCode; - Handle(TCollection_HAsciiString) tempFuncDescrip; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(),"No. of Property values", tempNbPropertyValues); - - if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(),"Function description code",tempFuncDescripCode); - else - tempFuncDescripCode = 0; - - if (PR.DefinedElseSkip()) - PR.ReadText(PR.Current(),"Function description",tempFuncDescrip); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init (tempNbPropertyValues,tempFuncDescripCode,tempFuncDescrip); -} - -void IGESAppli_ToolLevelFunction::WriteOwnParams - (const Handle(IGESAppli_LevelFunction)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->NbPropertyValues()); - IW.Send(ent->FuncDescriptionCode()); - if (ent->FuncDescription().IsNull()) IW.SendVoid(); - else IW.Send(ent->FuncDescription()); -} - -Standard_Boolean IGESAppli_ToolLevelFunction::OwnCorrect - (const Handle(IGESAppli_LevelFunction)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 2); - if (res) ent->Init(2,ent->FuncDescriptionCode(),ent->FuncDescription()); - return res; // nbpropertyvalues = 2 -} - -IGESData_DirChecker IGESAppli_ToolLevelFunction::DirChecker - (const Handle(IGESAppli_LevelFunction)& /* ent */ ) const -{ - IGESData_DirChecker DC(406,3); //Form no = 3 & Type = 406 - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - DC.SubordinateStatusRequired(00); - return DC; -} - -void IGESAppli_ToolLevelFunction::OwnDump - (const Handle(IGESAppli_LevelFunction)& ent, const IGESData_IGESDumper& /* dumper */, - const Handle(Message_Messenger)& S, const Standard_Integer /* level */) const -{ - S << "IGESAppli_LevelFunction" << endl; - - S << "Number of property values : " << ent->NbPropertyValues() << endl; - S << "Function Description code : " << ent->FuncDescriptionCode() << endl; - S << "Function Description : "; - IGESData_DumpString(S,ent->FuncDescription()); - S << endl; -} diff --git a/src/IGESAppli/IGESAppli_ToolLevelFunction.hxx b/src/IGESAppli/IGESAppli_ToolLevelFunction.hxx deleted file mode 100644 index c9ae7721e8..0000000000 --- a/src/IGESAppli/IGESAppli_ToolLevelFunction.hxx +++ /dev/null @@ -1,68 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolLevelFunction_HeaderFile -#define _IGESAppli_ToolLevelFunction_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESAppli_LevelFunction; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a LevelFunction. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolLevelFunction -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolLevelFunction, ready to work - IGESAppli_ToolLevelFunction() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_LevelFunction)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_LevelFunction)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a LevelFunction - //! (NbPropertyValues forced to 2) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESAppli_LevelFunction)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_LevelFunction)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_LevelFunction)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolLevelFunction_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolLevelToPWBLayerMap.cxx b/src/IGESAppli/IGESAppli_ToolLevelToPWBLayerMap.cxx deleted file mode 100644 index 6d92ec7d11..0000000000 --- a/src/IGESAppli/IGESAppli_ToolLevelToPWBLayerMap.cxx +++ /dev/null @@ -1,145 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolLevelToPWBLayerMap::ReadOwnParams - (const Handle(IGESAppli_LevelToPWBLayerMap)& ent, - const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer num, i; - Standard_Integer tempNbPropertyValues; - Handle(TColStd_HArray1OfInteger) tempExchangeFileLevelNumber; - Handle(Interface_HArray1OfHAsciiString) tempNativeLevel; - Handle(TColStd_HArray1OfInteger) tempPhysicalLayerNumber; - Handle(Interface_HArray1OfHAsciiString) tempExchangeFileLevelIdent; - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(), "Number of property values", tempNbPropertyValues); - if (!PR.ReadInteger(PR.Current(), "Number of definitions", num)) num = 0; - if (num > 0) { - tempExchangeFileLevelNumber = - new TColStd_HArray1OfInteger(1, num); - tempNativeLevel = new Interface_HArray1OfHAsciiString(1, num); - tempPhysicalLayerNumber = new TColStd_HArray1OfInteger(1, num); - tempExchangeFileLevelIdent = new Interface_HArray1OfHAsciiString(1, num); - } - else PR.AddFail("Number of definitions: Not Positive"); - - if (!tempExchangeFileLevelNumber.IsNull() && - !tempNativeLevel.IsNull() && - !tempPhysicalLayerNumber.IsNull() && - !tempExchangeFileLevelIdent.IsNull() ) - for ( i = 1; i <= num; i++ ) - { - Standard_Integer tempEFLN; - //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Exchange File Level Number", tempEFLN)) - tempExchangeFileLevelNumber->SetValue(i, tempEFLN); - Handle(TCollection_HAsciiString) tempNL; - if (PR.ReadText(PR.Current(), "Native Level Identification", tempNL)) - tempNativeLevel->SetValue(i, tempNL); - Standard_Integer tempPLN; - if (PR.ReadInteger(PR.Current(), "Physical Layer Number", tempPLN)) - tempPhysicalLayerNumber->SetValue(i, tempPLN); - Handle(TCollection_HAsciiString) tempEFLI; - if (PR.ReadText(PR.Current(), "Exchange File Level Identification", tempEFLI)) - tempExchangeFileLevelIdent->SetValue(i, tempEFLI); - } - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempNbPropertyValues, tempExchangeFileLevelNumber, - tempNativeLevel, tempPhysicalLayerNumber, tempExchangeFileLevelIdent); -} - -void IGESAppli_ToolLevelToPWBLayerMap::WriteOwnParams - (const Handle(IGESAppli_LevelToPWBLayerMap)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer i, num; - IW.Send(ent->NbPropertyValues()); - IW.Send(ent->NbLevelToLayerDefs()); - for ( num = ent->NbLevelToLayerDefs(), i = 1; i <= num; i++ ) - { - IW.Send(ent->ExchangeFileLevelNumber(i)); - IW.Send(ent->NativeLevel(i)); - IW.Send(ent->PhysicalLayerNumber(i)); - IW.Send(ent->ExchangeFileLevelIdent(i)); - } -} - -IGESData_DirChecker IGESAppli_ToolLevelToPWBLayerMap::DirChecker - (const Handle(IGESAppli_LevelToPWBLayerMap)& /* ent */ ) const -{ - IGESData_DirChecker DC(406, 24); - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolLevelToPWBLayerMap::OwnDump - (const Handle(IGESAppli_LevelToPWBLayerMap)& ent, const IGESData_IGESDumper& /* dumper */, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer i, num; - S << "IGESAppli_LevelToPWBLayerMap" << endl; - S << "Number of property values : " << ent->NbPropertyValues() << endl; - S << "Exchange File Level Number : " << endl; - S << "Native Level Identification : " << endl; - S << "Physical Layer Number : " << endl; - S << "Exchange File Level Identification : "; - IGESData_DumpStrings - (S,-level,1, ent->NbLevelToLayerDefs(),ent->ExchangeFileLevelIdent); - S << endl; - if (level > 4) - for ( num = ent->NbLevelToLayerDefs(), i = 1; i <= num; i++ ) - { - S << "[" << i << "]: " << endl; - S << "Exchange File Level Number : " - << ent->ExchangeFileLevelNumber(i) << endl; - S << "Native Level Identification : "; - IGESData_DumpString(S,ent->NativeLevel(i)); - S << endl; - S << "Physical Layer Number : " << ent->PhysicalLayerNumber(i) << endl; - S << "Exchange File Level Identification : "; - IGESData_DumpString(S,ent->ExchangeFileLevelIdent(i)); - S << endl; - } -} diff --git a/src/IGESAppli/IGESAppli_ToolLevelToPWBLayerMap.hxx b/src/IGESAppli/IGESAppli_ToolLevelToPWBLayerMap.hxx deleted file mode 100644 index e132973921..0000000000 --- a/src/IGESAppli/IGESAppli_ToolLevelToPWBLayerMap.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolLevelToPWBLayerMap_HeaderFile -#define _IGESAppli_ToolLevelToPWBLayerMap_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESAppli_LevelToPWBLayerMap; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a LevelToPWBLayerMap. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolLevelToPWBLayerMap -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolLevelToPWBLayerMap, ready to work - IGESAppli_ToolLevelToPWBLayerMap() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_LevelToPWBLayerMap)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_LevelToPWBLayerMap)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_LevelToPWBLayerMap)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_LevelToPWBLayerMap)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolLevelToPWBLayerMap_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolLineWidening.cxx b/src/IGESAppli/IGESAppli_ToolLineWidening.cxx deleted file mode 100644 index e358835a84..0000000000 --- a/src/IGESAppli/IGESAppli_ToolLineWidening.cxx +++ /dev/null @@ -1,135 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolLineWidening::ReadOwnParams - (const Handle(IGESAppli_LineWidening)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - Standard_Integer tempNbPropertyValues; - Standard_Real tempWidth; - Standard_Integer tempCorneringCode; - Standard_Integer tempExtensionFlag; - Standard_Integer tempJustificationFlag; - Standard_Real tempExtensionValue = 0.; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(),"No. of Property values",tempNbPropertyValues); - PR.ReadReal(PR.Current(),"Width of metalization",tempWidth); - PR.ReadInteger(PR.Current(),"Cornering code",tempCorneringCode); - PR.ReadInteger(PR.Current(),"Extension Flag",tempExtensionFlag); - PR.ReadInteger(PR.Current(),"Justification Flag",tempJustificationFlag); - if (PR.IsParamDefined(PR.CurrentNumber())) - PR.ReadReal(PR.Current(),"Extension value",tempExtensionValue); - else if (tempExtensionFlag == 2) - PR.AddFail("Extension Value not defined while Extension Flag = 2"); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempNbPropertyValues,tempWidth,tempCorneringCode,tempExtensionFlag, - tempJustificationFlag,tempExtensionValue); -} - -void IGESAppli_ToolLineWidening::WriteOwnParams - (const Handle(IGESAppli_LineWidening)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->NbPropertyValues()); - IW.Send(ent->WidthOfMetalization()); - IW.Send(ent->CorneringCode()); - IW.Send(ent->ExtensionFlag()); - IW.Send(ent->JustificationFlag()); - IW.Send(ent->ExtensionValue()); -} - -Standard_Boolean IGESAppli_ToolLineWidening::OwnCorrect - (const Handle(IGESAppli_LineWidening)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 5); - if (res) ent->Init - (5,ent->WidthOfMetalization(),ent->CorneringCode(),ent->ExtensionFlag(), - ent->JustificationFlag(),ent->ExtensionValue()); - if (ent->SubordinateStatus() != 0) { - Handle(IGESData_LevelListEntity) nulevel; - ent->InitLevel(nulevel,0); - res = Standard_True; - } - return res; // nbpropertyvalues = 5 + RAZ level selon subordinate -} - -IGESData_DirChecker IGESAppli_ToolLineWidening::DirChecker - (const Handle(IGESAppli_LineWidening)& /*ent*/ ) const -{ - IGESData_DirChecker DC(406,5); //Form no = 5 & Type = 406 - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolLineWidening::OwnDump - (const Handle(IGESAppli_LineWidening)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const -{ - S << "IGESAppli_LineWidening" << endl; - - S << "Number of property values : " << ent->NbPropertyValues() << endl; - S << "Width of metalization : " << ent->WidthOfMetalization() << endl; - S << "Cornering Code : " ; - if (ent->CorneringCode() == 0) S << "0 (rounded)" << endl; - else if (ent->CorneringCode() == 1) S << "1 (squared)" << endl; - else S << "incorrect value" << endl; - - S << "Extension Flag : " ; - if (ent->ExtensionFlag() == 0) S << "0 (No Extension)" << endl; - else if (ent->ExtensionFlag() == 1) S << "1 (One-half width extension)" << endl; - else if (ent->ExtensionFlag() == 2) S << "2 (Extension set by ExtensionValue)" << endl; - else S << "incorrect value" << endl; - - S << "Justification Flag : " ; - if (ent->JustificationFlag() == 0) - S << "0 (Centre justified)" << endl; - else if (ent->JustificationFlag() == 1) - S << "1 (left justified)" << endl; - else if (ent->JustificationFlag() == 2) - S << "2 (right justified)" << endl; - else - S << "incorrect value" << endl; - - if (ent->ExtensionFlag() == 2) - S << "Extension Value : " << ent->ExtensionValue() << endl; - else - S << "No Extension Value (Extension Flag != 2)" << endl; -} - diff --git a/src/IGESAppli/IGESAppli_ToolLineWidening.hxx b/src/IGESAppli/IGESAppli_ToolLineWidening.hxx deleted file mode 100644 index b731e646c0..0000000000 --- a/src/IGESAppli/IGESAppli_ToolLineWidening.hxx +++ /dev/null @@ -1,68 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolLineWidening_HeaderFile -#define _IGESAppli_ToolLineWidening_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESAppli_LineWidening; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a LineWidening. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolLineWidening -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolLineWidening, ready to work - IGESAppli_ToolLineWidening() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_LineWidening)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_LineWidening)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a LineWidening - //! (NbPropertyValues forced to 5, Level cleared if Subordinate != 0) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESAppli_LineWidening)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_LineWidening)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_LineWidening)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolLineWidening_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolNodalConstraint.cxx b/src/IGESAppli/IGESAppli_ToolNodalConstraint.cxx deleted file mode 100644 index 7c64e00eb5..0000000000 --- a/src/IGESAppli/IGESAppli_ToolNodalConstraint.cxx +++ /dev/null @@ -1,105 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolNodalConstraint::ReadOwnParams - (const Handle(IGESAppli_NodalConstraint)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer num, i; - Standard_Integer tempType; - Handle(IGESAppli_Node) tempNode; - Handle(IGESDefs_HArray1OfTabularData) tempTabularDataProps; - if (!PR.ReadInteger(PR.Current(), "Number of cases", num)) num = 0; - if (num > 0) tempTabularDataProps = new IGESDefs_HArray1OfTabularData(1, num); - else PR.AddFail("Number of cases: Not Positive"); - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(), "Type of Constraint", tempType); - PR.ReadEntity(IR, PR.Current(), "Node", STANDARD_TYPE(IGESAppli_Node), tempNode); - - if (!tempTabularDataProps.IsNull()) - for ( i = 1; i <= num; i++ ) - { - Handle(IGESDefs_TabularData) tempEntity; - //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR, PR.Current(), "Tabular Data Property", - STANDARD_TYPE(IGESDefs_TabularData), tempEntity)) - tempTabularDataProps->SetValue(i, tempEntity); - } - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init (tempType, tempNode, tempTabularDataProps); -} - -void IGESAppli_ToolNodalConstraint::WriteOwnParams - (const Handle(IGESAppli_NodalConstraint)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer i, num; - IW.Send(ent->NbCases()); - IW.Send(ent->Type()); - IW.Send(ent->NodeEntity()); - for ( num = ent->NbCases(), i = 1; i <= num; i++ ) - IW.Send(ent->TabularData(i)); -} - -IGESData_DirChecker IGESAppli_ToolNodalConstraint::DirChecker - (const Handle(IGESAppli_NodalConstraint)& /* ent */ ) const -{ - IGESData_DirChecker DC(418, 0); - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolNodalConstraint::OwnDump - (const Handle(IGESAppli_NodalConstraint)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer sublevel = (level > 4) ? 1 : 0; - S << "IGESAppli_NodalConstraint" << endl; - S << "Type of Constraint : " << ent->Type() << endl; - S << "Node : "; - dumper.Dump(ent->NodeEntity(),S, sublevel); - S << endl; - S << "Tabular Data Properties : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbCases(),ent->TabularData); - S << endl; -} diff --git a/src/IGESAppli/IGESAppli_ToolNodalConstraint.hxx b/src/IGESAppli/IGESAppli_ToolNodalConstraint.hxx deleted file mode 100644 index 7b59359adc..0000000000 --- a/src/IGESAppli/IGESAppli_ToolNodalConstraint.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolNodalConstraint_HeaderFile -#define _IGESAppli_ToolNodalConstraint_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESAppli_NodalConstraint; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a NodalConstraint. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolNodalConstraint -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolNodalConstraint, ready to work - IGESAppli_ToolNodalConstraint() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_NodalConstraint)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_NodalConstraint)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_NodalConstraint)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_NodalConstraint)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolNodalConstraint_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolNodalDisplAndRot.cxx b/src/IGESAppli/IGESAppli_ToolNodalDisplAndRot.cxx deleted file mode 100644 index d8a33a9969..0000000000 --- a/src/IGESAppli/IGESAppli_ToolNodalDisplAndRot.cxx +++ /dev/null @@ -1,210 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolNodalDisplAndRot::ReadOwnParams - (const Handle(IGESAppli_NodalDisplAndRot)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer nbcases = 0; - Standard_Integer nbnodes = 0; - Handle(IGESDimen_HArray1OfGeneralNote) tempNotes ; - Handle(TColStd_HArray1OfInteger) tempNodeIdentifiers ; - Handle(IGESAppli_HArray1OfNode) tempNodes; - Handle(IGESBasic_HArray1OfHArray1OfXYZ) tempTransParam ; - Handle(IGESBasic_HArray1OfHArray1OfXYZ) tempRotParam ; - - Standard_Boolean tempFlag = PR.ReadInteger(PR.Current(),"No. of analysis cases",nbcases); - if (tempFlag) { - tempNotes = new IGESDimen_HArray1OfGeneralNote(1,nbcases); - for (Standard_Integer i=1; i <= nbcases; i++) { - Handle(IGESDimen_GeneralNote) anentity; - //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR,PR.Current(),"General Note", STANDARD_TYPE(IGESDimen_GeneralNote), anentity)) - tempNotes->SetValue(i,anentity); - } - } - //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(),"No. of nodes",nbnodes)) { - tempNodeIdentifiers = new TColStd_HArray1OfInteger(1,nbnodes); - tempNodes = new IGESAppli_HArray1OfNode(1,nbnodes); - tempTransParam = new IGESBasic_HArray1OfHArray1OfXYZ(1, nbnodes); - tempRotParam = new IGESBasic_HArray1OfHArray1OfXYZ(1, nbnodes); - for (Standard_Integer j=1; j <=nbnodes; j++) { - Handle(IGESAppli_Node) aNode = new IGESAppli_Node(); - Standard_Integer nodeno; - if (PR.ReadInteger( PR.Current(), "Node number", nodeno)) - tempNodeIdentifiers->SetValue(j,nodeno); - if (PR.ReadEntity(IR,PR.Current(),"Node Directory Entry", STANDARD_TYPE(IGESAppli_Node), aNode)) - tempNodes->SetValue(j,aNode); - - Handle(TColgp_HArray1OfXYZ) tempArray1; - Handle(TColgp_HArray1OfXYZ) tempArray; - if (tempFlag) { - // tempFlag indicates if nbcases has been properly read - tempArray1 = new TColgp_HArray1OfXYZ(1,nbcases); - tempArray = new TColgp_HArray1OfXYZ(1,nbcases); - for (Standard_Integer k = 1; k <= nbcases; k++) { - gp_XYZ atrans,arot; - if (PR.ReadXYZ(PR.CurrentList(1,3),"Translation XYZ",atrans)) - tempArray->SetValue(k,atrans); - if (PR.ReadXYZ(PR.CurrentList(1,3),"Rotational XYZ",arot)) - tempArray1->SetValue(k,arot); - } - } - tempTransParam->SetValue(j,tempArray); - tempRotParam->SetValue(j,tempArray1); - } - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempNotes,tempNodeIdentifiers,tempNodes,tempRotParam,tempTransParam); -} - -void IGESAppli_ToolNodalDisplAndRot::WriteOwnParams - (const Handle(IGESAppli_NodalDisplAndRot)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer nbcases = ent->NbCases(); - Standard_Integer nbnodes = ent->NbNodes(); - - IW.Send(nbcases); - for (Standard_Integer i = 1; i <= nbcases; i ++) - IW.Send(ent->Note(i)); - IW.Send(nbnodes); - for (Standard_Integer j = 1; j <= nbnodes; j ++) - { - IW.Send(ent->NodeIdentifier(j)); - IW.Send(ent->Node(j)); - for (Standard_Integer k = 1; k <= nbcases; k ++) - { - IW.Send(ent->TranslationParameter(j,k).X()); - IW.Send(ent->TranslationParameter(j,k).Y()); - IW.Send(ent->TranslationParameter(j,k).Z()); - IW.Send(ent->RotationalParameter(j,k).X()); - IW.Send(ent->RotationalParameter(j,k).Y()); - IW.Send(ent->RotationalParameter(j,k).Z()); - } - } -} - -IGESData_DirChecker IGESAppli_ToolNodalDisplAndRot::DirChecker - (const Handle(IGESAppli_NodalDisplAndRot)& /* ent */ ) const -{ - IGESData_DirChecker DC(138,0); //Form no = 0 & Type = 138 - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolNodalDisplAndRot::OwnDump - (const Handle(IGESAppli_NodalDisplAndRot)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESAppli_NodalDisplAndRot" << endl; - - Standard_Integer nbcases = ent->NbCases(); - Standard_Integer nbnodes = ent->NbNodes(); - - S << "No. of analysis cases : " << nbcases << endl; - S << "General Notes : "; - IGESData_DumpEntities(S,dumper ,level,1, nbcases,ent->Note); - S << endl; - -// gp_GTrsf loca; // true location n.u. - switch (level) - { - case 4: - S << "Nodes : "; - IGESData_DumpEntities(S,dumper,-level,1, nbnodes,ent->Node); - S << "NodeIdentifiers : "; - IGESData_DumpVals(S,-level,1, nbnodes,ent->NodeIdentifier); - S << "Translation Parameters : "; -// ?? Possibly JAGGED ?? -// IGESData_DumpListXYZL(S,-level,1,nbcases,ent->TranslationParameter,loca); - S << "Rotational Parameters : "; -// IGESData_DumpListXYZL(S,-level,1,nbcases,ent->RotationalParameter,loca); - S << " TO BE DONE" << endl; - break; - case 5: - case 6: { - for (Standard_Integer i = 1; i <= nbcases; i ++) - { - S << "[" << i << "]: "; - dumper.Dump (ent->Note(i),S, 1); - S << endl; - } - S << "Nodes : " << endl; - S << "Node Identifiers : " << endl; - S << "Translation Parameters : " << endl; - S << "Rotational Parameters : Count = " << nbcases; -// IGESData_DumpListXYZL(S,-level,1,nbcases,ent->RotationalParameter,loca); - S << endl; - for (Standard_Integer j = 1; j <= nbnodes; j ++) - { - S << "[" << j << "]: - NodeIdentifier : " - << ent->NodeIdentifier(j) << " - Node :"<Node(j),S, 1); - S << " - Parameters : " << endl; - for (Standard_Integer k = 1; k <= nbcases; k ++) - { - S << " [" << k << "]: " << endl; - S << "Translational Parameter : X=" - << ent->TranslationParameter(j,k).X() << ", Y=" - << ent->TranslationParameter(j,k).Y() << ", Z=" - << ent->TranslationParameter(j,k).Z() << endl; - S << "Rotational Parameter : X=" - << ent->RotationalParameter(j,k).X() << ", Y=" - << ent->RotationalParameter(j,k).Y() << ", Z=" - << ent->RotationalParameter(j,k).Z(); - if (k == nbcases) S << "] "; - S << endl; - } - } - } - break; - default: break; - } - S << endl; -} diff --git a/src/IGESAppli/IGESAppli_ToolNodalDisplAndRot.hxx b/src/IGESAppli/IGESAppli_ToolNodalDisplAndRot.hxx deleted file mode 100644 index 0ee5c939ad..0000000000 --- a/src/IGESAppli/IGESAppli_ToolNodalDisplAndRot.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolNodalDisplAndRot_HeaderFile -#define _IGESAppli_ToolNodalDisplAndRot_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESAppli_NodalDisplAndRot; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a NodalDisplAndRot. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolNodalDisplAndRot -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolNodalDisplAndRot, ready to work - IGESAppli_ToolNodalDisplAndRot() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_NodalDisplAndRot)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_NodalDisplAndRot)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_NodalDisplAndRot)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_NodalDisplAndRot)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolNodalDisplAndRot_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolNodalResults.cxx b/src/IGESAppli/IGESAppli_ToolNodalResults.cxx deleted file mode 100644 index 50ae39a96b..0000000000 --- a/src/IGESAppli/IGESAppli_ToolNodalResults.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolNodalResults::ReadOwnParams - (const Handle(IGESAppli_NodalResults)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - Standard_Integer tempSubCaseNum = 0; - Standard_Real tempTime; - Standard_Integer nbval = 0; - Standard_Integer nbnodes = 0; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Handle(IGESDimen_GeneralNote) tempNote; - Handle(TColStd_HArray2OfReal) tempData ; - Handle(IGESAppli_HArray1OfNode) tempNodes ; - Handle(TColStd_HArray1OfInteger) tempNodeIdentifiers ; - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadEntity(IR,PR.Current(),"General Note describing the analysis case", - STANDARD_TYPE(IGESDimen_GeneralNote), tempNote); - PR.ReadInteger (PR.Current(),"Subcase number",tempSubCaseNum); - PR.ReadReal(PR.Current(),"Analysis time used",tempTime); - Standard_Boolean tempFlag = PR.ReadInteger(PR.Current(),"No. of values",nbval); - //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(),"No. of nodes",nbnodes)) { - tempData = new TColStd_HArray2OfReal(1,nbnodes,1,nbval); - tempNodes = new IGESAppli_HArray1OfNode(1,nbnodes); - tempNodeIdentifiers = new TColStd_HArray1OfInteger(1,nbnodes); - for (Standard_Integer i = 1; i <= nbnodes; i ++) { - Standard_Integer aitem; - //Check whether nbval properly read or not. - Handle(IGESAppli_Node) aNode ; - - if (PR.ReadInteger(PR.Current(),"Node no. identifier",aitem)) - tempNodeIdentifiers->SetValue(i,aitem); - if (PR.ReadEntity(IR,PR.Current(),"FEM Node", STANDARD_TYPE(IGESAppli_Node), aNode)) - tempNodes->SetValue(i,aNode); - if (tempFlag) - //Check whether nbval properly read or not. - for (Standard_Integer j = 1; j <= nbval; j ++) { - Standard_Real aval; - if (PR.ReadReal(PR.Current(),"Value",aval)) - tempData->SetValue(i,j,aval); - } - } - } - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempNote,tempSubCaseNum,tempTime,tempNodeIdentifiers,tempNodes,tempData); -} - -void IGESAppli_ToolNodalResults::WriteOwnParams - (const Handle(IGESAppli_NodalResults)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer nbnodes = ent->NbNodes(); - Standard_Integer nbdata = ent->NbData (); - IW.Send(ent->Note()); - IW.Send(ent->SubCaseNumber()); - IW.Send(ent->Time()); - IW.Send(nbdata); - IW.Send(nbnodes); - for (Standard_Integer i = 1; i <= nbnodes; i++) - { - IW.Send(ent->NodeIdentifier(i)); - IW.Send(ent->Node(i)); - for (Standard_Integer j = 1; j <= nbdata; j++) - IW.Send(ent->Data(i,j)); - } -} - -IGESData_DirChecker IGESAppli_ToolNodalResults::DirChecker - (const Handle(IGESAppli_NodalResults)& /* ent */ ) const -{ - IGESData_DirChecker DC(146,0,34); // Type = 146 Form No. = 0 to 34 - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefAny); - DC.BlankStatusIgnored(); - DC.UseFlagRequired(03); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolNodalResults::OwnDump - (const Handle(IGESAppli_NodalResults)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ -// Standard_Integer nbnodes = ent->NbNodes(); -// Standard_Integer nbdata = ent->NbData (); - S << "IGESAppli_NodalResults" << endl; - - S << "General Note : "; - dumper.Dump(ent->Note(),S, (level <= 4) ? 0 : 1); - S << endl; - S << "Analysis subcase number : " << ent->SubCaseNumber() << " "; - S << "Time used : " << ent->Time() << endl; - S << "No. of nodes : " << ent->NbNodes() << " "; - S << "No. of values for a node : " << ent->NbData() << endl; - S << "Node Identifiers : " << endl; - S << "Nodes : " << endl; - S << "Data : "; if (level < 6) S << " [ask level > 5]"; -// IGESData_DumpRectVals(S ,-level,1, ent->NbData(),ent->Data); - S << endl; - if (level > 4) - { - for (Standard_Integer i=1; i <= ent->NbNodes(); i++) - { - S << "[" << i << "]: "; - S << "NodeIdentifier : " << ent->NodeIdentifier(i) << " "; - S << "Node : "; - dumper.Dump (ent->Node(i),S, 1); - S << endl; - if (level < 6) continue; - S << "Data : [ "; - for (Standard_Integer j = 1; j <= ent->NbData(); j ++) - S << " " << ent->Data(i,j); - S << " ]" << endl; - } - } -} diff --git a/src/IGESAppli/IGESAppli_ToolNodalResults.hxx b/src/IGESAppli/IGESAppli_ToolNodalResults.hxx deleted file mode 100644 index 6aa7802e99..0000000000 --- a/src/IGESAppli/IGESAppli_ToolNodalResults.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolNodalResults_HeaderFile -#define _IGESAppli_ToolNodalResults_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESAppli_NodalResults; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a NodalResults. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolNodalResults -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolNodalResults, ready to work - IGESAppli_ToolNodalResults() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_NodalResults)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_NodalResults)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_NodalResults)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_NodalResults)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolNodalResults_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolNode.cxx b/src/IGESAppli/IGESAppli_ToolNode.cxx deleted file mode 100644 index e3eb11ff79..0000000000 --- a/src/IGESAppli/IGESAppli_ToolNode.cxx +++ /dev/null @@ -1,91 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolNode::ReadOwnParams - (const Handle(IGESAppli_Node)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - gp_XYZ tempCoordinates; - Handle(IGESGeom_TransformationMatrix) tempSystem; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadXYZ(PR.CurrentList(1, 3),"Coordinates of Node (XYZ)",tempCoordinates); - - if (PR.DefinedElseSkip()) - PR.ReadEntity(IR,PR.Current(),"Transformation Matrix", - STANDARD_TYPE(IGESGeom_TransformationMatrix), tempSystem,Standard_True); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempCoordinates,tempSystem); -} - -void IGESAppli_ToolNode::WriteOwnParams - (const Handle(IGESAppli_Node)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->Coord().X()); - IW.Send(ent->Coord().Y()); - IW.Send(ent->Coord().Z()); - IW.Send(ent->System()); -} - -IGESData_DirChecker IGESAppli_ToolNode::DirChecker - (const Handle(IGESAppli_Node)& /*ent*/ ) const -{ - IGESData_DirChecker DC(134,0); //Form no = 0 & Type = 134 - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefAny); - DC.UseFlagRequired(04); - return DC; -} - -void IGESAppli_ToolNode::OwnDump - (const Handle(IGESAppli_Node)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESAppli_Node" << endl; - S << " Nodal Coords : 1st " << ent->Coord().X() - << " 2nd : " << ent->Coord().Y() << " 3rd : " << ent->Coord().Z() <System().IsNull()) - dumper.Dump(ent->System(),S, level); - else - S << "Global Cartesian Coordinate System (default)"; - S << endl; -} diff --git a/src/IGESAppli/IGESAppli_ToolNode.hxx b/src/IGESAppli/IGESAppli_ToolNode.hxx deleted file mode 100644 index 91e6d8f8ef..0000000000 --- a/src/IGESAppli/IGESAppli_ToolNode.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolNode_HeaderFile -#define _IGESAppli_ToolNode_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESAppli_Node; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a Node. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolNode -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolNode, ready to work - IGESAppli_ToolNode() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_Node)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_Node)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_Node)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_Node)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolNode_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolPWBArtworkStackup.cxx b/src/IGESAppli/IGESAppli_ToolPWBArtworkStackup.cxx deleted file mode 100644 index 9ad3a18789..0000000000 --- a/src/IGESAppli/IGESAppli_ToolPWBArtworkStackup.cxx +++ /dev/null @@ -1,98 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolPWBArtworkStackup::ReadOwnParams - (const Handle(IGESAppli_PWBArtworkStackup)& ent, - const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer num; - Standard_Integer tempNbPropertyValues; - Handle(TCollection_HAsciiString) tempArtworkStackupIdent; - Handle(TColStd_HArray1OfInteger) tempLevelNumbers; - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(), "Number of property values", tempNbPropertyValues); - PR.ReadText(PR.Current(), "Artwork Stackup Identification", tempArtworkStackupIdent); - if (!PR.ReadInteger(PR.Current(), "Number of level numbers", num)) num = 0; - if (num > 0) tempLevelNumbers = new TColStd_HArray1OfInteger(1, num); - else PR.AddFail("Number of level numbers: Not Positive"); - if (!tempLevelNumbers.IsNull()) - PR.ReadInts(PR.CurrentList(num), "Level Numbers", tempLevelNumbers); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init (tempNbPropertyValues, tempArtworkStackupIdent, tempLevelNumbers); -} - -void IGESAppli_ToolPWBArtworkStackup::WriteOwnParams - (const Handle(IGESAppli_PWBArtworkStackup)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer i, num; - IW.Send(ent->NbPropertyValues()); - IW.Send(ent->Identification()); - IW.Send(ent->NbLevelNumbers()); - for ( num = ent->NbLevelNumbers(), i = 1; i <= num; i++ ) - IW.Send(ent->LevelNumber(i)); -} - -IGESData_DirChecker IGESAppli_ToolPWBArtworkStackup::DirChecker - (const Handle(IGESAppli_PWBArtworkStackup)& /* ent */ ) const -{ - IGESData_DirChecker DC(406, 25); - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolPWBArtworkStackup::OwnDump - (const Handle(IGESAppli_PWBArtworkStackup)& ent, const IGESData_IGESDumper& /* dumper */, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESAppli_PWBArtworkStackup" << endl; - S << "Number of property values : " << ent->NbPropertyValues() << endl; - S << "Artwork Stackup Identification : "; - IGESData_DumpString(S,ent->Identification()); - S << endl; - S << "Level Numbers : "; - IGESData_DumpVals(S ,level,1, ent->NbLevelNumbers(),ent->LevelNumber); - S << endl; -} diff --git a/src/IGESAppli/IGESAppli_ToolPWBArtworkStackup.hxx b/src/IGESAppli/IGESAppli_ToolPWBArtworkStackup.hxx deleted file mode 100644 index 3184e395a9..0000000000 --- a/src/IGESAppli/IGESAppli_ToolPWBArtworkStackup.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolPWBArtworkStackup_HeaderFile -#define _IGESAppli_ToolPWBArtworkStackup_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESAppli_PWBArtworkStackup; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a PWBArtworkStackup. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolPWBArtworkStackup -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolPWBArtworkStackup, ready to work - IGESAppli_ToolPWBArtworkStackup() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_PWBArtworkStackup)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_PWBArtworkStackup)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_PWBArtworkStackup)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_PWBArtworkStackup)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolPWBArtworkStackup_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolPWBDrilledHole.cxx b/src/IGESAppli/IGESAppli_ToolPWBDrilledHole.cxx deleted file mode 100644 index 8fa90ec251..0000000000 --- a/src/IGESAppli/IGESAppli_ToolPWBDrilledHole.cxx +++ /dev/null @@ -1,100 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolPWBDrilledHole::ReadOwnParams - (const Handle(IGESAppli_PWBDrilledHole)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer tempNbPropertyValues; - Standard_Real tempDrillDiameter; - Standard_Real tempFinishDiameter; - Standard_Integer tempFunctionCode; - - //szv#4:S4163:12Mar99 `st=` not needed - if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Number of property values", tempNbPropertyValues); - else - tempNbPropertyValues = 3; - - PR.ReadReal(PR.Current(), "Drill Diameter Size", tempDrillDiameter); - PR.ReadReal(PR.Current(), "Finish Diameter Size", tempFinishDiameter); - PR.ReadInteger(PR.Current(), "Drilled Hole Function Code", tempFunctionCode); - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempNbPropertyValues, tempDrillDiameter, tempFinishDiameter, tempFunctionCode); -} - -void IGESAppli_ToolPWBDrilledHole::WriteOwnParams - (const Handle(IGESAppli_PWBDrilledHole)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->NbPropertyValues()); - IW.Send(ent->DrillDiameterSize()); - IW.Send(ent->FinishDiameterSize()); - IW.Send(ent->FunctionCode()); -} - -Standard_Boolean IGESAppli_ToolPWBDrilledHole::OwnCorrect - (const Handle(IGESAppli_PWBDrilledHole)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 3); - if (res) ent->Init - (3,ent->DrillDiameterSize(),ent->FinishDiameterSize(),ent->FunctionCode()); -// nbpropertyvalues=3 - return res; -} - -IGESData_DirChecker IGESAppli_ToolPWBDrilledHole::DirChecker - (const Handle(IGESAppli_PWBDrilledHole)& /*ent*/) const -{ - IGESData_DirChecker DC(406, 26); - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolPWBDrilledHole::OwnDump - (const Handle(IGESAppli_PWBDrilledHole)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const -{ - S << "IGESAppli_PWBDrilledHole" << endl; - S << "Number of property values : " << ent->NbPropertyValues() << endl; - S << "Drill Diameter Size : " << ent->DrillDiameterSize() << endl; - S << "Finish Diameter Size : " << ent->FinishDiameterSize() << endl; - S << "Drilled Hole Function Code : " << ent->FunctionCode() << endl; -} diff --git a/src/IGESAppli/IGESAppli_ToolPWBDrilledHole.hxx b/src/IGESAppli/IGESAppli_ToolPWBDrilledHole.hxx deleted file mode 100644 index b68ace770c..0000000000 --- a/src/IGESAppli/IGESAppli_ToolPWBDrilledHole.hxx +++ /dev/null @@ -1,68 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolPWBDrilledHole_HeaderFile -#define _IGESAppli_ToolPWBDrilledHole_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESAppli_PWBDrilledHole; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a PWBDrilledHole. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolPWBDrilledHole -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolPWBDrilledHole, ready to work - IGESAppli_ToolPWBDrilledHole() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_PWBDrilledHole)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_PWBDrilledHole)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a PWBDrilledHole - //! (NbPropertyValues forced to 3) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESAppli_PWBDrilledHole)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_PWBDrilledHole)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_PWBDrilledHole)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolPWBDrilledHole_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolPartNumber.cxx b/src/IGESAppli/IGESAppli_ToolPartNumber.cxx deleted file mode 100644 index f783e594c0..0000000000 --- a/src/IGESAppli/IGESAppli_ToolPartNumber.cxx +++ /dev/null @@ -1,117 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolPartNumber::ReadOwnParams - (const Handle(IGESAppli_PartNumber)& ent, - const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer tempNbPropertyValues; - Handle(TCollection_HAsciiString) tempGenericNumber; - Handle(TCollection_HAsciiString) tempMilitaryNumber; - Handle(TCollection_HAsciiString) tempVendorNumber; - Handle(TCollection_HAsciiString) tempInternalNumber; - - //szv#4:S4163:12Mar99 `st=` not needed - if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Number of property values", tempNbPropertyValues); - else - tempNbPropertyValues = 4; - - PR.ReadText(PR.Current(), "Generic Number or Name", tempGenericNumber); - PR.ReadText(PR.Current(), "Military Number or Name", tempMilitaryNumber); - PR.ReadText(PR.Current(), "Vendor Number or Name", tempVendorNumber); - PR.ReadText(PR.Current(), "Internal Number or Name", tempInternalNumber); - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempNbPropertyValues, tempGenericNumber, - tempMilitaryNumber, tempVendorNumber, tempInternalNumber); -} - -void IGESAppli_ToolPartNumber::WriteOwnParams - (const Handle(IGESAppli_PartNumber)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->NbPropertyValues()); - IW.Send(ent->GenericNumber()); - IW.Send(ent->MilitaryNumber()); - IW.Send(ent->VendorNumber()); - IW.Send(ent->InternalNumber()); -} - -Standard_Boolean IGESAppli_ToolPartNumber::OwnCorrect - (const Handle(IGESAppli_PartNumber)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 4); - if (res) ent->Init - (4,ent->GenericNumber(),ent->MilitaryNumber(),ent->VendorNumber(), - ent->InternalNumber()); // nbpropertyvalues= 4 - return res; -} - -IGESData_DirChecker IGESAppli_ToolPartNumber::DirChecker - (const Handle(IGESAppli_PartNumber)& /* ent */ ) const -{ - IGESData_DirChecker DC(406, 9); - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolPartNumber::OwnDump - (const Handle(IGESAppli_PartNumber)& ent, const IGESData_IGESDumper& /* dumper */, - const Handle(Message_Messenger)& S, const Standard_Integer /* level */) const -{ - //Standard_Integer sublevel = (level > 4) ? 1 : 0; //szv#4:S4163:12Mar99 unused - S << "IGESAppli_PartNumber" << endl; - S << "Number of property values : " << ent->NbPropertyValues() << endl; - S << "Generic Number or Name : "; - IGESData_DumpString(S,ent->GenericNumber()); - S << endl; - S << "Military Number or Name : "; - IGESData_DumpString(S,ent->MilitaryNumber()); - S << endl; - S << "Vendor Number or Name : "; - IGESData_DumpString(S,ent->VendorNumber()); - S << endl; - S << "Internal Number or Name : "; - IGESData_DumpString(S,ent->InternalNumber()); - S << endl; -} diff --git a/src/IGESAppli/IGESAppli_ToolPartNumber.hxx b/src/IGESAppli/IGESAppli_ToolPartNumber.hxx deleted file mode 100644 index ac3686569b..0000000000 --- a/src/IGESAppli/IGESAppli_ToolPartNumber.hxx +++ /dev/null @@ -1,68 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolPartNumber_HeaderFile -#define _IGESAppli_ToolPartNumber_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESAppli_PartNumber; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a PartNumber. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolPartNumber -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolPartNumber, ready to work - IGESAppli_ToolPartNumber() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_PartNumber)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_PartNumber)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a PartNumber - //! (NbPropertyValues forced to 4) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESAppli_PartNumber)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_PartNumber)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_PartNumber)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolPartNumber_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolPinNumber.cxx b/src/IGESAppli/IGESAppli_ToolPinNumber.cxx deleted file mode 100644 index 3307179beb..0000000000 --- a/src/IGESAppli/IGESAppli_ToolPinNumber.cxx +++ /dev/null @@ -1,93 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolPinNumber::ReadOwnParams - (const Handle(IGESAppli_PinNumber)& ent, - const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const -{ - Standard_Integer tempNbPropertyValues; - Handle(TCollection_HAsciiString) tempPinNumber; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(),"Number of property values",tempNbPropertyValues); - PR.ReadText(PR.Current(),"PinNumber",tempPinNumber); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempNbPropertyValues,tempPinNumber); -} - -void IGESAppli_ToolPinNumber::WriteOwnParams - (const Handle(IGESAppli_PinNumber)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->NbPropertyValues()); - IW.Send(ent->PinNumberVal()); -} - -Standard_Boolean IGESAppli_ToolPinNumber::OwnCorrect - (const Handle(IGESAppli_PinNumber)& ent) const -{ - Standard_Boolean res = (ent->SubordinateStatus() != 0); - if (res) { - Handle(IGESData_LevelListEntity) nulevel; - ent->InitLevel(nulevel,0); - } - return res; // RAZ level selon subordibate -} - -IGESData_DirChecker IGESAppli_ToolPinNumber::DirChecker - (const Handle(IGESAppli_PinNumber)& /* ent */ ) const -{ - IGESData_DirChecker DC(406,8); //Form no = 8 & Type = 406 - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolPinNumber::OwnDump - (const Handle(IGESAppli_PinNumber)& ent, const IGESData_IGESDumper& /* dumper */, - const Handle(Message_Messenger)& S, const Standard_Integer /* level */) const -{ - S << "IGESAppli_PinNumber" << endl; - S << "Number of Property Values : " << ent->NbPropertyValues() << endl; - S << "PinNumber : "; - IGESData_DumpString(S,ent->PinNumberVal()); - S << endl; -} diff --git a/src/IGESAppli/IGESAppli_ToolPinNumber.hxx b/src/IGESAppli/IGESAppli_ToolPinNumber.hxx deleted file mode 100644 index 755dd42d68..0000000000 --- a/src/IGESAppli/IGESAppli_ToolPinNumber.hxx +++ /dev/null @@ -1,68 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolPinNumber_HeaderFile -#define _IGESAppli_ToolPinNumber_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESAppli_PinNumber; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a PinNumber. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolPinNumber -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolPinNumber, ready to work - IGESAppli_ToolPinNumber() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_PinNumber)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_PinNumber)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a PinNumber - //! (Level cleared in D.E. if Subordinate != 0) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESAppli_PinNumber)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_PinNumber)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_PinNumber)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolPinNumber_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolPipingFlow.cxx b/src/IGESAppli/IGESAppli_ToolPipingFlow.cxx deleted file mode 100644 index 187af27fac..0000000000 --- a/src/IGESAppli/IGESAppli_ToolPipingFlow.cxx +++ /dev/null @@ -1,216 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolPipingFlow::ReadOwnParams - (const Handle(IGESAppli_PipingFlow)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Standard_Integer tempNbContextFlags; - Standard_Integer tempTypeOfFlow; - Standard_Integer i, num; - Handle(IGESData_HArray1OfIGESEntity) tempFlowAssocs; - Handle(IGESDraw_HArray1OfConnectPoint) tempConnectPoints; - Handle(IGESData_HArray1OfIGESEntity) tempJoins; - Handle(Interface_HArray1OfHAsciiString) tempFlowNames; - Handle(IGESGraph_HArray1OfTextDisplayTemplate) tempTextDisplayTemplates; - Handle(IGESData_HArray1OfIGESEntity) tempContFlowAssocs; - - //szv#4:S4163:12Mar99 `st=` not needed - if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Number of Context Flags", tempNbContextFlags); - else - tempNbContextFlags = 1; - - if (!PR.ReadInteger(PR.Current(), "Number of Flow Associativities", num)) num = 0; - if (num > 0) tempFlowAssocs = new IGESData_HArray1OfIGESEntity(1, num); - else PR.AddFail("Number of Flow Associativities: Not Positive"); - - if (!PR.ReadInteger(PR.Current(), "Number of Connect Points", num)) num = 0; - if (num > 0) tempConnectPoints = new IGESDraw_HArray1OfConnectPoint(1, num); - else PR.AddFail("Number of Connect Points: Not Positive"); - - if (!PR.ReadInteger(PR.Current(), "Number of Joins", num)) num = 0; - if (num > 0) tempJoins = new IGESData_HArray1OfIGESEntity(1, num); - else PR.AddFail("Number of Joins: Not Positive"); - - if (!PR.ReadInteger(PR.Current(), "Number of Flow Names", num)) num = 0; - if (num > 0) tempFlowNames = new Interface_HArray1OfHAsciiString(1, num); - else PR.AddFail("Number of Flow Names: Not Positive"); - - if (!PR.ReadInteger(PR.Current(), "Number of Text Displays", num)) num = 0; - if (num > 0) tempTextDisplayTemplates = new IGESGraph_HArray1OfTextDisplayTemplate(1, num); - else PR.AddFail("Number of Text Displays: Not Positive"); - - if (!PR.ReadInteger(PR.Current(), "Number of Continuation Flows", num)) num = 0; - if (num > 0) tempContFlowAssocs = new IGESData_HArray1OfIGESEntity(1, num); - else PR.AddFail("Number of Continuation Flows: Not Positive"); - - if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Type of Flow", tempTypeOfFlow); - else - tempTypeOfFlow = 0; - - if (!tempFlowAssocs.IsNull()) - for ( num = tempFlowAssocs->Length(), i = 1; i <= num; i++ ) { - Handle(IGESData_IGESEntity) tempEntity; - //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity (IR, PR.Current(), "Flow Associativity", STANDARD_TYPE(IGESData_IGESEntity),tempEntity)) - tempFlowAssocs->SetValue(i, tempEntity); - } - - if (!tempConnectPoints.IsNull()) - for ( num = tempConnectPoints->Length(), i = 1; i <= num; i++ ) { - Handle(IGESDraw_ConnectPoint) tempEntity; - if (PR.ReadEntity(IR, PR.Current(), "Connect Point", STANDARD_TYPE(IGESDraw_ConnectPoint),tempEntity)) - tempConnectPoints->SetValue(i, tempEntity); - } - - if (!tempJoins.IsNull()) - for ( num = tempJoins->Length(), i = 1; i <= num; i++ ) { - Handle(IGESData_IGESEntity) tempEntity; - if (PR.ReadEntity(IR, PR.Current(), "Join", tempEntity)) - tempJoins->SetValue(i, tempEntity); - } - - if (!tempFlowNames.IsNull()) - for ( num = tempFlowNames->Length(), i = 1; i <= num; i++ ) { - Handle(TCollection_HAsciiString) tempString; - if (PR.ReadText(PR.Current(), "Flow Name", tempString)) - tempFlowNames->SetValue(i, tempString); - } - - if (!tempTextDisplayTemplates.IsNull()) - for ( num = tempTextDisplayTemplates->Length(), i = 1; i <= num; i++ ) { - Handle(IGESGraph_TextDisplayTemplate) tempEntity; - if (PR.ReadEntity (IR, PR.Current(), "Text Display Template", - STANDARD_TYPE(IGESGraph_TextDisplayTemplate),tempEntity)) - tempTextDisplayTemplates->SetValue(i, tempEntity); - } - - if (!tempContFlowAssocs.IsNull()) - for ( num = tempContFlowAssocs->Length(), i = 1; i <= num; i++ ) { - Handle(IGESData_IGESEntity) tempEntity; - if (PR.ReadEntity (IR, PR.Current(), "Continuation Flow Assocs", tempEntity)) - tempContFlowAssocs->SetValue(i, tempEntity); - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempNbContextFlags, tempTypeOfFlow, tempFlowAssocs, - tempConnectPoints, tempJoins, tempFlowNames, - tempTextDisplayTemplates, tempContFlowAssocs); -} - -void IGESAppli_ToolPipingFlow::WriteOwnParams - (const Handle(IGESAppli_PipingFlow)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer i, num; - IW.Send(ent->NbContextFlags()); - IW.Send(ent->NbFlowAssociativities()); - IW.Send(ent->NbConnectPoints()); - IW.Send(ent->NbJoins()); - IW.Send(ent->NbFlowNames()); - IW.Send(ent->NbTextDisplayTemplates()); - IW.Send(ent->NbContFlowAssociativities()); - IW.Send(ent->TypeOfFlow()); - for ( num = ent->NbFlowAssociativities(), i = 1; i <= num; i++ ) - IW.Send(ent->FlowAssociativity(i)); - for ( num = ent->NbConnectPoints(), i = 1; i <= num; i++ ) - IW.Send(ent->ConnectPoint(i)); - for ( num = ent->NbJoins(), i = 1; i <= num; i++ ) - IW.Send(ent->Join(i)); - for ( num = ent->NbFlowNames(), i = 1; i <= num; i++ ) - IW.Send(ent->FlowName(i)); - for ( num = ent->NbTextDisplayTemplates(), i = 1; i <= num; i++ ) - IW.Send(ent->TextDisplayTemplate(i)); - for ( num = ent->NbContFlowAssociativities(), i = 1; i <= num; i++ ) - IW.Send(ent->ContFlowAssociativity(i)); -} - -Standard_Boolean IGESAppli_ToolPipingFlow::OwnCorrect - (const Handle(IGESAppli_PipingFlow)& ent) const -{ - return ent->OwnCorrect(); // nbcontextflags = 1 -} - -IGESData_DirChecker IGESAppli_ToolPipingFlow::DirChecker - (const Handle(IGESAppli_PipingFlow)& /* ent */) const -{ - IGESData_DirChecker DC(402, 20); - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagRequired(3); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolPipingFlow::OwnDump - (const Handle(IGESAppli_PipingFlow)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESAppli_PipingFlow" << endl; - S << "Number of Context Flags : " << ent->NbContextFlags() << endl; - S << "Type of Flow : " << ent->TypeOfFlow() << endl; - S << "Flow Associativities : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbFlowAssociativities(), - ent->FlowAssociativity); - S << "Connect Points : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbConnectPoints() - ,ent->ConnectPoint); - S << "Joins : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbJoins(),ent->Join); - S << "Flow Names : "; - IGESData_DumpStrings(S ,level,1, ent->NbFlowNames(),ent->FlowName); - S << "Text Display Templates : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbTextDisplayTemplates(), - ent->TextDisplayTemplate); - S << "Continuation Flow Associativities : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbContFlowAssociativities(), - ent->ContFlowAssociativity); - S << endl; -} - diff --git a/src/IGESAppli/IGESAppli_ToolPipingFlow.hxx b/src/IGESAppli/IGESAppli_ToolPipingFlow.hxx deleted file mode 100644 index de236af0ab..0000000000 --- a/src/IGESAppli/IGESAppli_ToolPipingFlow.hxx +++ /dev/null @@ -1,68 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolPipingFlow_HeaderFile -#define _IGESAppli_ToolPipingFlow_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESAppli_PipingFlow; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a PipingFlow. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolPipingFlow -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolPipingFlow, ready to work - IGESAppli_ToolPipingFlow() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_PipingFlow)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_PipingFlow)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a PipingFlow - //! (NbContextFlags forced to 1) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESAppli_PipingFlow)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_PipingFlow)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_PipingFlow)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolPipingFlow_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolReferenceDesignator.cxx b/src/IGESAppli/IGESAppli_ToolReferenceDesignator.cxx deleted file mode 100644 index 4abc29f7fd..0000000000 --- a/src/IGESAppli/IGESAppli_ToolReferenceDesignator.cxx +++ /dev/null @@ -1,97 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolReferenceDesignator::ReadOwnParams - (const Handle(IGESAppli_ReferenceDesignator)& ent, - const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const -{ - Standard_Integer tempNbPropertyValues; - Handle(TCollection_HAsciiString) tempReferenceDesignator; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(),"Number of property values",tempNbPropertyValues); - PR.ReadText(PR.Current(),"ReferenceDesignator",tempReferenceDesignator); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempNbPropertyValues,tempReferenceDesignator); -} - -void IGESAppli_ToolReferenceDesignator::WriteOwnParams - (const Handle(IGESAppli_ReferenceDesignator)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->NbPropertyValues()); - IW.Send(ent->RefDesignatorText()); -} - -Standard_Boolean IGESAppli_ToolReferenceDesignator::OwnCorrect - (const Handle(IGESAppli_ReferenceDesignator)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 1); - if (res) ent->Init(1,ent->RefDesignatorText()); -// nbpropertyvalues=1 - if (ent->SubordinateStatus() != 0) { - Handle(IGESData_LevelListEntity) nulevel; - ent->InitLevel(nulevel,0); - res = Standard_True; - } - return res; // + RAZ level selon subordibate -} - -IGESData_DirChecker IGESAppli_ToolReferenceDesignator::DirChecker - (const Handle(IGESAppli_ReferenceDesignator)& /* ent */ ) const -{ - //UNFINISHED - IGESData_DirChecker DC(406,7); //Form no = 7 & Type = 406 - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolReferenceDesignator::OwnDump - (const Handle(IGESAppli_ReferenceDesignator)& ent, const IGESData_IGESDumper& /* dumper */, - const Handle(Message_Messenger)& S, const Standard_Integer /* level */) const -{ - S << "IGESAppli_ReferenceDesignator" << endl; - S << "Number of Property Values : " << ent->NbPropertyValues() << endl; - S << "ReferenceDesignator : "; - IGESData_DumpString(S,ent->RefDesignatorText()); - S << endl; -} diff --git a/src/IGESAppli/IGESAppli_ToolReferenceDesignator.hxx b/src/IGESAppli/IGESAppli_ToolReferenceDesignator.hxx deleted file mode 100644 index d6b36210b4..0000000000 --- a/src/IGESAppli/IGESAppli_ToolReferenceDesignator.hxx +++ /dev/null @@ -1,68 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolReferenceDesignator_HeaderFile -#define _IGESAppli_ToolReferenceDesignator_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESAppli_ReferenceDesignator; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a ReferenceDesignator. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolReferenceDesignator -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolReferenceDesignator, ready to work - IGESAppli_ToolReferenceDesignator() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_ReferenceDesignator)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_ReferenceDesignator)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a ReferenceDesignator - //! (NbPropertyValues forced to 1, Level cleared if Subordinate != 0) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESAppli_ReferenceDesignator)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_ReferenceDesignator)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_ReferenceDesignator)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolReferenceDesignator_HeaderFile diff --git a/src/IGESAppli/IGESAppli_ToolRegionRestriction.cxx b/src/IGESAppli/IGESAppli_ToolRegionRestriction.cxx deleted file mode 100644 index 5bd1e5fe26..0000000000 --- a/src/IGESAppli/IGESAppli_ToolRegionRestriction.cxx +++ /dev/null @@ -1,101 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESAppli_ToolRegionRestriction::ReadOwnParams - (const Handle(IGESAppli_RegionRestriction)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - Standard_Integer tempNbPropertyValues; - Standard_Integer tempElectViasRestrict; - Standard_Integer tempElectCompRestrict; - Standard_Integer tempElectCktRestrict; - - PR.ReadInteger(PR.Current(),"No. of Property values",tempNbPropertyValues); - PR.ReadInteger(PR.Current(),"Electrical vias restriction",tempElectViasRestrict); - PR.ReadInteger(PR.Current(),"Electrical components restriction", tempElectCompRestrict); - PR.ReadInteger(PR.Current(), " Electrical circuitary restriction",tempElectCktRestrict); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempNbPropertyValues,tempElectViasRestrict,tempElectCompRestrict, tempElectCktRestrict); -} - -void IGESAppli_ToolRegionRestriction::WriteOwnParams - (const Handle(IGESAppli_RegionRestriction)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->NbPropertyValues()); - IW.Send(ent->ElectricalViasRestriction()); - IW.Send(ent->ElectricalComponentRestriction()); - IW.Send(ent->ElectricalCktRestriction()); -} - -Standard_Boolean IGESAppli_ToolRegionRestriction::OwnCorrect - (const Handle(IGESAppli_RegionRestriction)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 3); - if (res) ent->Init - (3,ent->ElectricalViasRestriction(),ent->ElectricalComponentRestriction(), - ent->ElectricalCktRestriction()); // nbprops = 3 - if (ent->SubordinateStatus() != 0) { - Handle(IGESData_LevelListEntity) nulevel; - ent->InitLevel(nulevel,0); - res = Standard_True; - } - return res; // + RAZ level selon subordibate -} - -IGESData_DirChecker IGESAppli_ToolRegionRestriction::DirChecker - (const Handle(IGESAppli_RegionRestriction)& /*ent*/ ) const -{ - IGESData_DirChecker DC(406,2); //Form no = 2 & Type = 406 - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESAppli_ToolRegionRestriction::OwnDump - (const Handle(IGESAppli_RegionRestriction)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const -{ - S << "IGESAppli_RegionRestriction" << endl; - S << "Number of property values : " << ent->NbPropertyValues() << endl; - S << "Electrical vias restriction : " - << ent->ElectricalViasRestriction() << endl; - S << "Electrical components restriction : " - << ent->ElectricalComponentRestriction() << endl; - S << "Electrical circuitary restriction : " - << ent->ElectricalCktRestriction() << endl; -} diff --git a/src/IGESAppli/IGESAppli_ToolRegionRestriction.hxx b/src/IGESAppli/IGESAppli_ToolRegionRestriction.hxx deleted file mode 100644 index c86d2ffa36..0000000000 --- a/src/IGESAppli/IGESAppli_ToolRegionRestriction.hxx +++ /dev/null @@ -1,68 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESAppli_ToolRegionRestriction_HeaderFile -#define _IGESAppli_ToolRegionRestriction_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESAppli_RegionRestriction; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a RegionRestriction. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESAppli_ToolRegionRestriction -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolRegionRestriction, ready to work - IGESAppli_ToolRegionRestriction() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESAppli_RegionRestriction)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESAppli_RegionRestriction)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a RegionRestriction - //! (NbPropertyValues forced to 3, Level cleared if Subordinate != 0) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESAppli_RegionRestriction)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESAppli_RegionRestriction)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESAppli_RegionRestriction)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESAppli_ToolRegionRestriction_HeaderFile diff --git a/src/IGESBasic/FILES b/src/IGESBasic/FILES index 460c433fba..17f1d9ce3c 100644 --- a/src/IGESBasic/FILES +++ b/src/IGESBasic/FILES @@ -44,14 +44,10 @@ IGESBasic_OrderedGroupWithoutBackP.cxx IGESBasic_OrderedGroupWithoutBackP.hxx IGESBasic_Protocol.cxx IGESBasic_Protocol.hxx -IGESBasic_ReadWriteModule.cxx -IGESBasic_ReadWriteModule.hxx IGESBasic_SingleParent.cxx IGESBasic_SingleParent.hxx IGESBasic_SingularSubfigure.cxx IGESBasic_SingularSubfigure.hxx -IGESBasic_SpecificModule.cxx -IGESBasic_SpecificModule.hxx IGESBasic_SubfigureDef.cxx IGESBasic_SubfigureDef.hxx IGESBasic_ToolAssocGroupType.cxx diff --git a/src/IGESBasic/IGESBasic.cxx b/src/IGESBasic/IGESBasic.cxx index d4b8fb85db..111d6bf591 100644 --- a/src/IGESBasic/IGESBasic.cxx +++ b/src/IGESBasic/IGESBasic.cxx @@ -15,13 +15,8 @@ #include #include #include -#include -#include #include -#include -#include #include -#include /*void IGESBasic::Init () @@ -36,9 +31,6 @@ const Handle(IGESBasic_Protocol) & IGESBasic::Protocol () if (protocol.IsNull()) { protocol = new IGESBasic_Protocol; Interface_GeneralLib::SetGlobal (new IGESBasic_GeneralModule, protocol); - Interface_ReaderLib::SetGlobal (new IGESBasic_ReadWriteModule,protocol); - IGESData_WriterLib::SetGlobal (new IGESBasic_ReadWriteModule,protocol); - IGESData_SpecificLib::SetGlobal (new IGESBasic_SpecificModule, protocol); } return protocol; } diff --git a/src/IGESBasic/IGESBasic_Array1OfLineFontEntity.hxx b/src/IGESBasic/IGESBasic_Array1OfLineFontEntity.hxx index 2b21ffc84f..55625c3c9d 100644 --- a/src/IGESBasic/IGESBasic_Array1OfLineFontEntity.hxx +++ b/src/IGESBasic/IGESBasic_Array1OfLineFontEntity.hxx @@ -17,10 +17,10 @@ #ifndef IGESBasic_Array1OfLineFontEntity_HeaderFile #define IGESBasic_Array1OfLineFontEntity_HeaderFile -#include +#include #include +#include -typedef NCollection_Array1 IGESBasic_Array1OfLineFontEntity; - +typedef NCollection_Array1> IGESBasic_Array1OfLineFontEntity; #endif diff --git a/src/IGESBasic/IGESBasic_GeneralModule.cxx b/src/IGESBasic/IGESBasic_GeneralModule.cxx index d00e9be4df..934b654897 100644 --- a/src/IGESBasic/IGESBasic_GeneralModule.cxx +++ b/src/IGESBasic/IGESBasic_GeneralModule.cxx @@ -56,72 +56,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESBasic_GeneralModule,IGESData_GeneralModule) - void IGESBasic_GeneralModule::OwnSharedCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - Interface_EntityIterator& iter) const -{ - switch (CN) { - case 3 : { - DeclareAndCast(IGESBasic_ExternalRefFileIndex,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefFileIndex tool; - tool.OwnShared(anent,iter); - } - break; - case 8 : { - DeclareAndCast(IGESBasic_Group,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolGroup tool; - tool.OwnShared(anent,iter); - } - break; - case 9 : { - DeclareAndCast(IGESBasic_GroupWithoutBackP,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolGroupWithoutBackP tool; - tool.OwnShared(anent,iter); - } - break; - case 12 : { - DeclareAndCast(IGESBasic_OrderedGroup,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolOrderedGroup tool; - tool.OwnShared(anent,iter); - } - break; - case 13 : { - DeclareAndCast(IGESBasic_OrderedGroupWithoutBackP,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolOrderedGroupWithoutBackP tool; - tool.OwnShared(anent,iter); - } - break; - case 14 : { - DeclareAndCast(IGESBasic_SingleParent,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSingleParent tool; - tool.OwnShared(anent,iter); - } - break; - case 15 : { - DeclareAndCast(IGESBasic_SingularSubfigure,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSingularSubfigure tool; - tool.OwnShared(anent,iter); - } - break; - case 16 : { - DeclareAndCast(IGESBasic_SubfigureDef,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSubfigureDef tool; - tool.OwnShared(anent,iter); - } - break; - default : break; - } -} - - IGESData_DirChecker IGESBasic_GeneralModule::DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const { @@ -228,118 +162,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESBasic_GeneralModule,IGESData_GeneralModule) } - void IGESBasic_GeneralModule::OwnCheckCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESBasic_AssocGroupType,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolAssocGroupType tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 4 : { - DeclareAndCast(IGESBasic_ExternalRefFileName,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefFileName tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 7 : { - DeclareAndCast(IGESBasic_ExternalReferenceFile,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalReferenceFile tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 8 : { - DeclareAndCast(IGESBasic_Group,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolGroup tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 9 : { - DeclareAndCast(IGESBasic_GroupWithoutBackP,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolGroupWithoutBackP tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 10 : { - DeclareAndCast(IGESBasic_Hierarchy,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolHierarchy tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 11 : { - DeclareAndCast(IGESBasic_Name,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolName tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 12 : { - DeclareAndCast(IGESBasic_OrderedGroup,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolOrderedGroup tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 13 : { - DeclareAndCast(IGESBasic_OrderedGroupWithoutBackP,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolOrderedGroupWithoutBackP tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 14 : { - DeclareAndCast(IGESBasic_SingleParent,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSingleParent tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 16 : { - DeclareAndCast(IGESBasic_SubfigureDef,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSubfigureDef tool; - tool.OwnCheck(anent,shares,ach); - } - break; - default : break; - } -} - - - Standard_Boolean IGESBasic_GeneralModule::NewVoid - (const Standard_Integer CN, Handle(Standard_Transient)& ent) const -{ - switch (CN) { - case 1 : ent = new IGESBasic_AssocGroupType; break; - case 2 : ent = new IGESBasic_ExternalRefFile; break; - case 3 : ent = new IGESBasic_ExternalRefFileIndex; break; - case 4 : ent = new IGESBasic_ExternalRefFileName; break; - case 5 : ent = new IGESBasic_ExternalRefLibName; break; - case 6 : ent = new IGESBasic_ExternalRefName; break; - case 7 : ent = new IGESBasic_ExternalReferenceFile; break; - case 8 : ent = new IGESBasic_Group; break; - case 9 : ent = new IGESBasic_GroupWithoutBackP; break; - case 10 : ent = new IGESBasic_Hierarchy; break; - case 11 : ent = new IGESBasic_Name; break; - case 12 : ent = new IGESBasic_OrderedGroup; break; - case 13 : ent = new IGESBasic_OrderedGroupWithoutBackP; break; - case 14 : ent = new IGESBasic_SingleParent; break; - case 15 : ent = new IGESBasic_SingularSubfigure; break; - case 16 : ent = new IGESBasic_SubfigureDef; break; - default : return Standard_False; // by default, Failure on Recognize - } - return Standard_True; -} - Standard_Integer IGESBasic_GeneralModule::CategoryNumber (const Standard_Integer CN, const Handle(Standard_Transient)& , const Interface_ShareTool& ) const diff --git a/src/IGESBasic/IGESBasic_GeneralModule.hxx b/src/IGESBasic/IGESBasic_GeneralModule.hxx index af0a2e79ab..43c299c9a4 100644 --- a/src/IGESBasic/IGESBasic_GeneralModule.hxx +++ b/src/IGESBasic/IGESBasic_GeneralModule.hxx @@ -31,21 +31,11 @@ class IGESBasic_GeneralModule : public IGESData_GeneralModule //! Creates a GeneralModule from IGESBasic and puts it into GeneralLib IGESBasic_GeneralModule() {} - //! Lists the Entities shared by a given IGESEntity , from - //! its specific parameters : specific for each type - Standard_EXPORT void OwnSharedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - //! Returns a DirChecker, specific for each type of Entity //! (identified by its Case Number) : this DirChecker defines //! constraints which must be respected by the DirectoryPart Standard_EXPORT IGESData_DirChecker DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - //! Performs Specific Semantic Check for each type of Entity - Standard_EXPORT void OwnCheckCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE; - - //! Specific creation of a new void entity - Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE; - //! Returns a category number which characterizes an entity //! Structure for Groups, Figures & Co //! Description for External Refs diff --git a/src/IGESBasic/IGESBasic_HArray1OfLineFontEntity.hxx b/src/IGESBasic/IGESBasic_HArray1OfLineFontEntity.hxx index a896241de2..e8c87f4522 100644 --- a/src/IGESBasic/IGESBasic_HArray1OfLineFontEntity.hxx +++ b/src/IGESBasic/IGESBasic_HArray1OfLineFontEntity.hxx @@ -17,11 +17,9 @@ #ifndef IGESBasic_HArray1OfLineFontEntity_HeaderFile #define IGESBasic_HArray1OfLineFontEntity_HeaderFile -#include #include #include DEFINE_HARRAY1(IGESBasic_HArray1OfLineFontEntity, IGESBasic_Array1OfLineFontEntity) - #endif diff --git a/src/IGESBasic/IGESBasic_ReadWriteModule.cxx b/src/IGESBasic/IGESBasic_ReadWriteModule.cxx deleted file mode 100644 index c2c41504a0..0000000000 --- a/src/IGESBasic/IGESBasic_ReadWriteModule.cxx +++ /dev/null @@ -1,342 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESBasic_ReadWriteModule,IGESData_ReadWriteModule) - - - Standard_Integer IGESBasic_ReadWriteModule::CaseIGES - (const Standard_Integer typenum, const Standard_Integer formnum) const -{ - switch (typenum) { - case 308 : return 16; - case 402 : - switch (formnum) { - case 1 : return 8; - case 7 : return 9; - case 9 : return 14; - case 12 : return 3; - case 14 : return 12; - case 15 : return 13; - default : break; - } - break; - case 406 : - switch (formnum) { - case 10 : return 10; - case 12 : return 7; - case 15 : return 11; - case 23 : return 1; - default : break; - } - break; - case 408 : return 15; - case 416 : - switch (formnum) { - case 0 : return 4; - case 1 : return 2; - case 2 : return 4; - case 3 : return 6; - case 4 : return 5; - default : break; - } - break; - default : break; - } - return 0; -} - - - void IGESBasic_ReadWriteModule::ReadOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESBasic_AssocGroupType,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolAssocGroupType tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 2 : { - DeclareAndCast(IGESBasic_ExternalRefFile,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefFile tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 3 : { - DeclareAndCast(IGESBasic_ExternalRefFileIndex,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefFileIndex tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 4 : { - DeclareAndCast(IGESBasic_ExternalRefFileName,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefFileName tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 5 : { - DeclareAndCast(IGESBasic_ExternalRefLibName,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefLibName tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 6 : { - DeclareAndCast(IGESBasic_ExternalRefName,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefName tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 7 : { - DeclareAndCast(IGESBasic_ExternalReferenceFile,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalReferenceFile tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 8 : { - DeclareAndCast(IGESBasic_Group,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolGroup tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 9 : { - DeclareAndCast(IGESBasic_GroupWithoutBackP,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolGroupWithoutBackP tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 10 : { - DeclareAndCast(IGESBasic_Hierarchy,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolHierarchy tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 11 : { - DeclareAndCast(IGESBasic_Name,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolName tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 12 : { - DeclareAndCast(IGESBasic_OrderedGroup,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolOrderedGroup tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 13 : { - DeclareAndCast(IGESBasic_OrderedGroupWithoutBackP,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolOrderedGroupWithoutBackP tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 14 : { - DeclareAndCast(IGESBasic_SingleParent,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSingleParent tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 15 : { - DeclareAndCast(IGESBasic_SingularSubfigure,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSingularSubfigure tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 16 : { - DeclareAndCast(IGESBasic_SubfigureDef,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSubfigureDef tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - default : break; - } -} - - - void IGESBasic_ReadWriteModule::WriteOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - IGESData_IGESWriter& IW) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESBasic_AssocGroupType,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolAssocGroupType tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 2 : { - DeclareAndCast(IGESBasic_ExternalRefFile,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefFile tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 3 : { - DeclareAndCast(IGESBasic_ExternalRefFileIndex,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefFileIndex tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 4 : { - DeclareAndCast(IGESBasic_ExternalRefFileName,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefFileName tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 5 : { - DeclareAndCast(IGESBasic_ExternalRefLibName,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefLibName tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 6 : { - DeclareAndCast(IGESBasic_ExternalRefName,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefName tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 7 : { - DeclareAndCast(IGESBasic_ExternalReferenceFile,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalReferenceFile tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 8 : { - DeclareAndCast(IGESBasic_Group,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolGroup tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 9 : { - DeclareAndCast(IGESBasic_GroupWithoutBackP,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolGroupWithoutBackP tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 10 : { - DeclareAndCast(IGESBasic_Hierarchy,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolHierarchy tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 11 : { - DeclareAndCast(IGESBasic_Name,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolName tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 12 : { - DeclareAndCast(IGESBasic_OrderedGroup,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolOrderedGroup tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 13 : { - DeclareAndCast(IGESBasic_OrderedGroupWithoutBackP,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolOrderedGroupWithoutBackP tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 14 : { - DeclareAndCast(IGESBasic_SingleParent,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSingleParent tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 15 : { - DeclareAndCast(IGESBasic_SingularSubfigure,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSingularSubfigure tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 16 : { - DeclareAndCast(IGESBasic_SubfigureDef,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSubfigureDef tool; - tool.WriteOwnParams(anent,IW); - } - break; - default : break; - } -} diff --git a/src/IGESBasic/IGESBasic_ReadWriteModule.hxx b/src/IGESBasic/IGESBasic_ReadWriteModule.hxx deleted file mode 100644 index 8271461227..0000000000 --- a/src/IGESBasic/IGESBasic_ReadWriteModule.hxx +++ /dev/null @@ -1,52 +0,0 @@ -// Created on: 1993-09-06 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESBasic_ReadWriteModule_HeaderFile -#define _IGESBasic_ReadWriteModule_HeaderFile - -#include -class IGESData_IGESEntity; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; - - -class IGESBasic_ReadWriteModule; -DEFINE_STANDARD_HANDLE(IGESBasic_ReadWriteModule, IGESData_ReadWriteModule) - -//! Defines basic File Access Module for IGESBasic (specific parts) -//! Specific actions concern : Read and Write Own Parameters of -//! an IGESEntity. -class IGESBasic_ReadWriteModule : public IGESData_ReadWriteModule -{ - public: - - //! Creates a ReadWriteModule & puts it into ReaderLib & WriterLib - IGESBasic_ReadWriteModule() {} - - //! Defines Case Numbers for Entities of IGESBasic - Standard_EXPORT Standard_Integer CaseIGES (const Standard_Integer typenum, const Standard_Integer formnum) const Standard_OVERRIDE; - - //! Reads own parameters from file for an Entity of IGESBasic - Standard_EXPORT void ReadOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const Standard_OVERRIDE; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, IGESData_IGESWriter& IW) const Standard_OVERRIDE; - - DEFINE_STANDARD_RTTIEXT(IGESBasic_ReadWriteModule,IGESData_ReadWriteModule) -}; - -#endif // _IGESBasic_ReadWriteModule_HeaderFile diff --git a/src/IGESBasic/IGESBasic_SpecificModule.cxx b/src/IGESBasic/IGESBasic_SpecificModule.cxx deleted file mode 100644 index 39e3d62d7d..0000000000 --- a/src/IGESBasic/IGESBasic_SpecificModule.cxx +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESBasic_SpecificModule,IGESData_SpecificModule) - -// Each Module is attached to a Protocol : it must interprete Case Numbers -// (arguments of various methods) in accordance to values returned by -// the method TypeNumber from this Protocol -IGESBasic_SpecificModule::IGESBasic_SpecificModule() { } - - - void IGESBasic_SpecificModule::OwnDump - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, - const Standard_Integer own) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESBasic_AssocGroupType,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolAssocGroupType tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 2 : { - DeclareAndCast(IGESBasic_ExternalRefFile,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefFile tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 3 : { - DeclareAndCast(IGESBasic_ExternalRefFileIndex,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefFileIndex tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 4 : { - DeclareAndCast(IGESBasic_ExternalRefFileName,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefFileName tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 5 : { - DeclareAndCast(IGESBasic_ExternalRefLibName,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefLibName tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 6 : { - DeclareAndCast(IGESBasic_ExternalRefName,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalRefName tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 7 : { - DeclareAndCast(IGESBasic_ExternalReferenceFile,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolExternalReferenceFile tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 8 : { - DeclareAndCast(IGESBasic_Group,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolGroup tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 9 : { - DeclareAndCast(IGESBasic_GroupWithoutBackP,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolGroupWithoutBackP tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 10 : { - DeclareAndCast(IGESBasic_Hierarchy,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolHierarchy tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 11 : { - DeclareAndCast(IGESBasic_Name,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolName tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 12 : { - DeclareAndCast(IGESBasic_OrderedGroup,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolOrderedGroup tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 13 : { - DeclareAndCast(IGESBasic_OrderedGroupWithoutBackP,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolOrderedGroupWithoutBackP tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 14 : { - DeclareAndCast(IGESBasic_SingleParent,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSingleParent tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 15 : { - DeclareAndCast(IGESBasic_SingularSubfigure,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSingularSubfigure tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 16 : { - DeclareAndCast(IGESBasic_SubfigureDef,anent,ent); - if (anent.IsNull()) return; - IGESBasic_ToolSubfigureDef tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - default : break; - } -} - - - Standard_Boolean IGESBasic_SpecificModule::OwnCorrect - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const -{ -// Applies only on some types - switch (CN) { - case 1 : { - DeclareAndCast(IGESBasic_AssocGroupType,anent,ent); - if (anent.IsNull()) break; - IGESBasic_ToolAssocGroupType tool; - return tool.OwnCorrect(anent); - } - case 8 : { - DeclareAndCast(IGESBasic_Group,anent,ent); - if (anent.IsNull()) break; - IGESBasic_ToolGroup tool; - return tool.OwnCorrect(anent); - } - case 9 : { - DeclareAndCast(IGESBasic_GroupWithoutBackP,anent,ent); - if (anent.IsNull()) break; - IGESBasic_ToolGroupWithoutBackP tool; - return tool.OwnCorrect(anent); - } - case 10 : { - DeclareAndCast(IGESBasic_Hierarchy,anent,ent); - if (anent.IsNull()) break; - IGESBasic_ToolHierarchy tool; - return tool.OwnCorrect(anent); - } - case 11 : { - DeclareAndCast(IGESBasic_Name,anent,ent); - if (anent.IsNull()) break; - IGESBasic_ToolName tool; - return tool.OwnCorrect(anent); - } - case 12 : { - DeclareAndCast(IGESBasic_OrderedGroup,anent,ent); - if (anent.IsNull()) break; - IGESBasic_ToolOrderedGroup tool; - return tool.OwnCorrect(anent); - } - case 13 : { - DeclareAndCast(IGESBasic_OrderedGroupWithoutBackP,anent,ent); - if (anent.IsNull()) break; - IGESBasic_ToolOrderedGroupWithoutBackP tool; - return tool.OwnCorrect(anent); - } - case 14 : { - DeclareAndCast(IGESBasic_SingleParent,anent,ent); - if (anent.IsNull()) break; - IGESBasic_ToolSingleParent tool; - return tool.OwnCorrect(anent); - } - default : break; - } - return Standard_False; -} diff --git a/src/IGESBasic/IGESBasic_SpecificModule.hxx b/src/IGESBasic/IGESBasic_SpecificModule.hxx deleted file mode 100644 index 6e464c251b..0000000000 --- a/src/IGESBasic/IGESBasic_SpecificModule.hxx +++ /dev/null @@ -1,75 +0,0 @@ -// Created on: 1993-09-07 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESBasic_SpecificModule_HeaderFile -#define _IGESBasic_SpecificModule_HeaderFile - -#include -#include - -#include -#include -#include -class IGESData_IGESEntity; -class IGESData_IGESDumper; -class Message_Messenger; - - -class IGESBasic_SpecificModule; -DEFINE_STANDARD_HANDLE(IGESBasic_SpecificModule, IGESData_SpecificModule) - -//! Defines Services attached to IGES Entities : -//! Dump & OwnCorrect, for IGESBasic -class IGESBasic_SpecificModule : public IGESData_SpecificModule -{ - -public: - - - //! Creates a SpecificModule from IGESBasic & puts it into SpecificLib - Standard_EXPORT IGESBasic_SpecificModule(); - - //! Specific Dump (own parameters) for IGESBasic - Standard_EXPORT void OwnDump (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const Standard_OVERRIDE; - - //! Performs non-ambiguous Corrections on Entities which support - //! them (AssocGroupType,Hierarchy,Name,SingleParent) - Standard_EXPORT virtual Standard_Boolean OwnCorrect (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IGESBasic_SpecificModule,IGESData_SpecificModule) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IGESBasic_SpecificModule_HeaderFile diff --git a/src/IGESBasic/IGESBasic_ToolAssocGroupType.cxx b/src/IGESBasic/IGESBasic_ToolAssocGroupType.cxx index e5ee16a0c3..509f45e434 100644 --- a/src/IGESBasic/IGESBasic_ToolAssocGroupType.cxx +++ b/src/IGESBasic/IGESBasic_ToolAssocGroupType.cxx @@ -38,16 +38,15 @@ void IGESBasic_ToolAssocGroupType::ReadOwnParams (const Handle(IGESBasic_AssocGroupType)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Integer tempNbData; Standard_Integer tempType; Handle(TCollection_HAsciiString) tempName; if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Number of data fields", tempNbData); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempNbData,"Number of data fields"); else tempNbData = 2; - PR.ReadInteger(PR.Current(), "Type of attached associativity",tempType); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadText(PR.Current(), "Name of attached associativity", tempName); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempType,"Type of attached associativity"); + PR.ReadText("Name of attached associativity", tempName); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(tempNbData, tempType, tempName); } diff --git a/src/IGESBasic/IGESBasic_ToolExternalRefFile.cxx b/src/IGESBasic/IGESBasic_ToolExternalRefFile.cxx index e793142ddd..0d761b8c94 100644 --- a/src/IGESBasic/IGESBasic_ToolExternalRefFile.cxx +++ b/src/IGESBasic/IGESBasic_ToolExternalRefFile.cxx @@ -38,10 +38,8 @@ void IGESBasic_ToolExternalRefFile::ReadOwnParams (const Handle(IGESBasic_ExternalRefFile)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Handle(TCollection_HAsciiString) tempExtRefFileIdentifier; - PR.ReadText(PR.Current(), "External Reference File Identifier", - tempExtRefFileIdentifier); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadText("External Reference File Identifier", tempExtRefFileIdentifier); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(tempExtRefFileIdentifier); diff --git a/src/IGESBasic/IGESBasic_ToolExternalRefFileIndex.cxx b/src/IGESBasic/IGESBasic_ToolExternalRefFileIndex.cxx index 57654437f2..ae5639caa1 100644 --- a/src/IGESBasic/IGESBasic_ToolExternalRefFileIndex.cxx +++ b/src/IGESBasic/IGESBasic_ToolExternalRefFileIndex.cxx @@ -45,7 +45,7 @@ void IGESBasic_ToolExternalRefFileIndex::ReadOwnParams Standard_Integer num, i; Handle(Interface_HArray1OfHAsciiString) tempNames; Handle(IGESData_HArray1OfIGESEntity) tempEntities; - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of index entries", num); + Standard_Boolean st = PR.ReadInteger(num,"Number of index entries"); if (st && num > 0) { tempNames = new Interface_HArray1OfHAsciiString(1, num); @@ -56,10 +56,10 @@ void IGESBasic_ToolExternalRefFileIndex::ReadOwnParams for ( i = 1; i <= num; i++ ) { Handle(TCollection_HAsciiString) tempNam; - if (PR.ReadText(PR.Current(), "External Reference Entity", tempNam)) //szv#4:S4163:12Mar99 `st=` not needed + if (PR.ReadText("External Reference Entity", tempNam)) tempNames->SetValue(i, tempNam); Handle(IGESData_IGESEntity) tempEnt; - if (PR.ReadEntity(IR, PR.Current(), "Internal Entity", tempEnt)) //szv#4:S4163:12Mar99 `st=` not needed + if (PR.ReadEntity(IR, "Internal Entity", tempEnt)) tempEntities->SetValue(i, tempEnt); } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); diff --git a/src/IGESBasic/IGESBasic_ToolExternalRefFileName.cxx b/src/IGESBasic/IGESBasic_ToolExternalRefFileName.cxx index 62e1edd229..ea8a069e2f 100644 --- a/src/IGESBasic/IGESBasic_ToolExternalRefFileName.cxx +++ b/src/IGESBasic/IGESBasic_ToolExternalRefFileName.cxx @@ -38,13 +38,10 @@ void IGESBasic_ToolExternalRefFileName::ReadOwnParams (const Handle(IGESBasic_ExternalRefFileName)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Handle(TCollection_HAsciiString) tempExtRefFileIdentifier; Handle(TCollection_HAsciiString) tempExtRefEntitySymbName; - PR.ReadText(PR.Current(), "External Reference File Identifier", - tempExtRefFileIdentifier); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadText(PR.Current(), "External Reference Symbolic Name", - tempExtRefEntitySymbName); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadText("External Reference File Identifier", tempExtRefFileIdentifier); + PR.ReadText("External Reference Symbolic Name", tempExtRefEntitySymbName); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init (tempExtRefFileIdentifier, tempExtRefEntitySymbName); diff --git a/src/IGESBasic/IGESBasic_ToolExternalRefLibName.cxx b/src/IGESBasic/IGESBasic_ToolExternalRefLibName.cxx index d3a1bd3bd2..1b99c21d6a 100644 --- a/src/IGESBasic/IGESBasic_ToolExternalRefLibName.cxx +++ b/src/IGESBasic/IGESBasic_ToolExternalRefLibName.cxx @@ -38,12 +38,10 @@ void IGESBasic_ToolExternalRefLibName::ReadOwnParams (const Handle(IGESBasic_ExternalRefLibName)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Handle(TCollection_HAsciiString) tempLibName; Handle(TCollection_HAsciiString) tempExtRefEntitySymbName; - PR.ReadText(PR.Current(), "Name of Library", tempLibName); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadText(PR.Current(), "External Reference Symbolic Name", - tempExtRefEntitySymbName); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadText("Name of Library", tempLibName); + PR.ReadText("External Reference Symbolic Name", tempExtRefEntitySymbName); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(tempLibName, tempExtRefEntitySymbName); diff --git a/src/IGESBasic/IGESBasic_ToolExternalRefName.cxx b/src/IGESBasic/IGESBasic_ToolExternalRefName.cxx index d44f8674ad..41d6a8187a 100644 --- a/src/IGESBasic/IGESBasic_ToolExternalRefName.cxx +++ b/src/IGESBasic/IGESBasic_ToolExternalRefName.cxx @@ -38,10 +38,8 @@ void IGESBasic_ToolExternalRefName::ReadOwnParams (const Handle(IGESBasic_ExternalRefName)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Handle(TCollection_HAsciiString) tempExtRefEntitySymbName; - PR.ReadText(PR.Current(), "External Reference Symbolic Name", - tempExtRefEntitySymbName); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadText("External Reference Symbolic Name", tempExtRefEntitySymbName); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(tempExtRefEntitySymbName); diff --git a/src/IGESBasic/IGESBasic_ToolExternalReferenceFile.cxx b/src/IGESBasic/IGESBasic_ToolExternalReferenceFile.cxx index d50844d9a9..85603ed57c 100644 --- a/src/IGESBasic/IGESBasic_ToolExternalReferenceFile.cxx +++ b/src/IGESBasic/IGESBasic_ToolExternalReferenceFile.cxx @@ -42,7 +42,7 @@ void IGESBasic_ToolExternalReferenceFile::ReadOwnParams //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down Standard_Integer num; Handle(Interface_HArray1OfHAsciiString) tempNames; - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of list entries", num); + Standard_Boolean st = PR.ReadInteger(num,"Number of list entries"); if (st && num > 0) tempNames = new Interface_HArray1OfHAsciiString(1, num); else PR.AddFail("Number of list entries: Not Positive"); if (!tempNames.IsNull()) diff --git a/src/IGESBasic/IGESBasic_ToolGroup.cxx b/src/IGESBasic/IGESBasic_ToolGroup.cxx index 1149fa979f..2029d04b0d 100644 --- a/src/IGESBasic/IGESBasic_ToolGroup.cxx +++ b/src/IGESBasic/IGESBasic_ToolGroup.cxx @@ -40,31 +40,18 @@ void IGESBasic_ToolGroup::ReadOwnParams (const Handle(IGESBasic_Group)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - // MGE 03/08/98 - // Building of messages - //======================================== -// Message_Msg Msg202("XSTEP_202"); -// Message_Msg Msg203("XSTEP_203"); - //======================================== - - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Integer nbval = 0; -// Msg202.Arg(1); - //st = PR.ReadInteger( PR.Current(), Msg202, nbval); //szv#4:S4163:12Mar99 moved down - //st = PR.ReadInteger( PR.Current(), "Count of Entities", nbval); - Handle(IGESData_HArray1OfIGESEntity) EntArray; - if ( PR.ReadInteger( PR.Current(), nbval) ) { //szv#4:S4163:12Mar99 `st=` not needed + if ( PR.ReadInteger(nbval) ) { Message_Msg Msg203("XSTEP_203"); Msg203.Arg(1); - PR.ReadEnts (IR,PR.CurrentList(nbval),Msg203,EntArray); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEnts (IR,PR.CurrentList(nbval),Msg203,EntArray); } else { Message_Msg Msg202("XSTEP_202"); Msg202.Arg(1); PR.SendFail(Msg202); } - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(EntArray); diff --git a/src/IGESBasic/IGESBasic_ToolGroupWithoutBackP.cxx b/src/IGESBasic/IGESBasic_ToolGroupWithoutBackP.cxx index ec320ce6b6..0c990e48c6 100644 --- a/src/IGESBasic/IGESBasic_ToolGroupWithoutBackP.cxx +++ b/src/IGESBasic/IGESBasic_ToolGroupWithoutBackP.cxx @@ -40,24 +40,12 @@ void IGESBasic_ToolGroupWithoutBackP::ReadOwnParams (const Handle(IGESBasic_GroupWithoutBackP)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - // MGE 03/08/98 - // Building of messages - //======================================== -// Message_Msg Msg202("XSTEP_202"); -// Message_Msg Msg203("XSTEP_203"); - //======================================== - - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Integer nbval = 0; Handle(IGESData_HArray1OfIGESEntity) EntArray; -// Msg202.Arg(7); - //st = PR.ReadInteger( PR.Current(), Msg202, nbval); //szv#4:S4163:12Mar99 not needed - //st = PR.ReadInteger( PR.Current(), "Count of Entities", nbval); - if (PR.ReadInteger( PR.Current(), nbval)) { //szv#4:S4163:12Mar99 `st=` not needed + if (PR.ReadInteger(nbval)) { Message_Msg Msg203("XSTEP_203"); Msg203.Arg(7); - PR.ReadEnts (IR,PR.CurrentList(nbval),Msg203,EntArray); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadEnts (IR,PR.CurrentList(nbval),"Entities",EntArray); + PR.ReadEnts (IR,PR.CurrentList(nbval),Msg203,EntArray); } else{ Message_Msg Msg202("XSTEP_202"); diff --git a/src/IGESBasic/IGESBasic_ToolHierarchy.cxx b/src/IGESBasic/IGESBasic_ToolHierarchy.cxx index 6be2369fb2..1e97016e3f 100644 --- a/src/IGESBasic/IGESBasic_ToolHierarchy.cxx +++ b/src/IGESBasic/IGESBasic_ToolHierarchy.cxx @@ -42,16 +42,14 @@ void IGESBasic_ToolHierarchy::ReadOwnParams Standard_Integer tempBlankStatus; Standard_Integer tempLineWeight; Standard_Integer tempColorNum; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(),"No. of Property values",tempNbPropertyValues); - PR.ReadInteger(PR.Current(),"LineFont",tempLineFont); - PR.ReadInteger(PR.Current(),"View",tempView); - PR.ReadInteger(PR.Current(),"Entity level",tempEntityLevel); - PR.ReadInteger(PR.Current(),"Blank status",tempBlankStatus); - PR.ReadInteger(PR.Current(),"Line weight",tempLineWeight); - PR.ReadInteger(PR.Current(),"Color number",tempColorNum); + PR.ReadInteger(tempNbPropertyValues,"No. of Property values"); + PR.ReadInteger(tempLineFont,"LineFont"); + PR.ReadInteger(tempView,"View"); + PR.ReadInteger(tempEntityLevel,"Entity level"); + PR.ReadInteger(tempBlankStatus,"Blank status"); + PR.ReadInteger(tempLineWeight,"Line weight"); + PR.ReadInteger(tempColorNum,"Color number"); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(tempNbPropertyValues,tempLineFont,tempView,tempEntityLevel, diff --git a/src/IGESBasic/IGESBasic_ToolName.cxx b/src/IGESBasic/IGESBasic_ToolName.cxx index a9eeaf066a..6539aa79ff 100644 --- a/src/IGESBasic/IGESBasic_ToolName.cxx +++ b/src/IGESBasic/IGESBasic_ToolName.cxx @@ -40,10 +40,9 @@ void IGESBasic_ToolName::ReadOwnParams { Standard_Integer tempNbPropertyValues; Handle(TCollection_HAsciiString) tempName; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadInteger(PR.Current(),"Number of property values",tempNbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadText(PR.Current(),"Name",tempName); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempNbPropertyValues,"Number of property values"); + PR.ReadText("Name",tempName); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(tempNbPropertyValues,tempName); diff --git a/src/IGESBasic/IGESBasic_ToolOrderedGroup.cxx b/src/IGESBasic/IGESBasic_ToolOrderedGroup.cxx index bc96253b51..5b7ec39277 100644 --- a/src/IGESBasic/IGESBasic_ToolOrderedGroup.cxx +++ b/src/IGESBasic/IGESBasic_ToolOrderedGroup.cxx @@ -39,21 +39,11 @@ void IGESBasic_ToolOrderedGroup::ReadOwnParams (const Handle(IGESBasic_OrderedGroup)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Integer nbval = 0; Handle(IGESData_HArray1OfIGESEntity) EntArray; - if (PR.ReadInteger( PR.Current(), "Count of Entities", nbval)) { //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadEnts (IR,PR.CurrentList(nbval),"Entities",EntArray); //szv#4:S4163:12Mar99 `st=` not needed -/* - EntArray = new IGESData_HArray1OfIGESEntity(1,nbval); - for (Standard_Integer i = 1;i <= nbval;i++) - { - Handle(IGESData_IGESEntity) anent; - st = PR.ReadEntity (IR,PR.Current(),"Element of the Group",anent,Standard_True); - if (st) EntArray->SetValue(i,anent); - } -*/ + if (PR.ReadInteger(nbval,"Count of Entities")) { + PR.ReadEnts (IR,PR.CurrentList(nbval),"Entities",EntArray); } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(EntArray); diff --git a/src/IGESBasic/IGESBasic_ToolOrderedGroupWithoutBackP.cxx b/src/IGESBasic/IGESBasic_ToolOrderedGroupWithoutBackP.cxx index b92280a941..d322e26b4c 100644 --- a/src/IGESBasic/IGESBasic_ToolOrderedGroupWithoutBackP.cxx +++ b/src/IGESBasic/IGESBasic_ToolOrderedGroupWithoutBackP.cxx @@ -39,21 +39,11 @@ void IGESBasic_ToolOrderedGroupWithoutBackP::ReadOwnParams (const Handle(IGESBasic_OrderedGroupWithoutBackP)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Integer nbval = 0; Handle(IGESData_HArray1OfIGESEntity) EntArray; - if (PR.ReadInteger( PR.Current(), "Count of Entities", nbval)) { //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadEnts (IR,PR.CurrentList(nbval),"Entities",EntArray); //szv#4:S4163:12Mar99 `st=` not needed -/* - EntArray = new IGESData_HArray1OfIGESEntity(1,nbval); - for (Standard_Integer i = 1;i <= nbval;i++) - { - Handle(IGESData_IGESEntity) anent; - st = PR.ReadEntity (IR,PR.Current(),"Element of the Group",anent,Standard_True); - if (st) EntArray->SetValue(i,anent); - } -*/ + if (PR.ReadInteger(nbval,"Count of Entities")) { + PR.ReadEnts (IR,PR.CurrentList(nbval),"Entities",EntArray); } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(EntArray); diff --git a/src/IGESBasic/IGESBasic_ToolSingleParent.cxx b/src/IGESBasic/IGESBasic_ToolSingleParent.cxx index 314e9b768a..66e02397ca 100644 --- a/src/IGESBasic/IGESBasic_ToolSingleParent.cxx +++ b/src/IGESBasic/IGESBasic_ToolSingleParent.cxx @@ -49,26 +49,21 @@ void IGESBasic_ToolSingleParent::ReadOwnParams Standard_Integer tempNbParentEntities; Handle(IGESData_IGESEntity) tempParent; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Integer nbval = 0; Handle(IGESData_HArray1OfIGESEntity) tempChildren; IGESData_Status aStatus; - if(!PR.ReadInteger (PR.Current(),tempNbParentEntities)){ //szv#4:S4163:12Mar99 `st=` not needed + if(!PR.ReadInteger(tempNbParentEntities)) { Message_Msg Msg204("XSTEP_204"); PR.SendFail(Msg204); } - //st = PR.ReadInteger(PR.Current(), Msg205, nbval); //szv#4:S4163:12Mar99 moved down -// st = PR.ReadInteger (PR.Current(),"Number of Parent entities",tempNbParentEntities); -// st = PR.ReadInteger(PR.Current(), "Count of Children", nbval); - if (!PR.ReadInteger(PR.Current(), nbval)){ + if (!PR.ReadInteger(nbval)) { Message_Msg Msg205("XSTEP_205"); PR.SendFail(Msg205); nbval = -1; } - if (!PR.ReadEntity(IR,PR.Current(),aStatus,tempParent)){ //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadEntity(IR,PR.Current(),"ParentEntity",tempParent); + if (!PR.ReadEntity(IR,aStatus,tempParent)) { Message_Msg Msg206("XSTEP_206"); switch(aStatus) { case IGESData_ReferenceError: { @@ -86,8 +81,7 @@ void IGESBasic_ToolSingleParent::ReadOwnParams } } - if (nbval > 0) PR.ReadEnts (IR,PR.CurrentList(nbval),Msg207,tempChildren); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadEnts (IR,PR.CurrentList(nbval),"Child Entities",tempChildren); + if (nbval > 0) PR.ReadEnts (IR,PR.CurrentList(nbval),Msg207,tempChildren); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(tempNbParentEntities,tempParent,tempChildren); } diff --git a/src/IGESBasic/IGESBasic_ToolSingularSubfigure.cxx b/src/IGESBasic/IGESBasic_ToolSingularSubfigure.cxx index 2697e101c4..e21b7d6303 100644 --- a/src/IGESBasic/IGESBasic_ToolSingularSubfigure.cxx +++ b/src/IGESBasic/IGESBasic_ToolSingularSubfigure.cxx @@ -42,20 +42,13 @@ void IGESBasic_ToolSingularSubfigure::ReadOwnParams (const Handle(IGESBasic_SingularSubfigure)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - // MGE 03/08/98 - // Building of messages - //======================================== - Message_Msg Msg213("XSTEP_213"); - //======================================== - - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Boolean temphasscale; Standard_Real tempScaleFactor; Handle(IGESBasic_SubfigureDef) tempSubfigureDef; gp_XYZ tempTranslation; IGESData_Status aStatus; - if(!PR.ReadEntity(IR,PR.Current(),aStatus,STANDARD_TYPE(IGESBasic_SubfigureDef),tempSubfigureDef)){ //szv#4:S4163:12Mar99 `st=` not needed; + if(!PR.ReadEntity(IR,aStatus,STANDARD_TYPE(IGESBasic_SubfigureDef),tempSubfigureDef)) { Message_Msg Msg212("XSTEP_212"); switch(aStatus) { case IGESData_ReferenceError: { @@ -77,16 +70,10 @@ void IGESBasic_ToolSingularSubfigure::ReadOwnParams } } } - PR.ReadXYZ (PR.CurrentList(1, 3),Msg213,tempTranslation); //szv#4:S4163:12Mar99 `st=` not needed -//st = PR.ReadEntity(IR,PR.Current(),"Subfigure definition entity", -// STANDARD_TYPE(IGESBasic_SubfigureDef), tempSubfigureDef); -//st = PR.ReadXYZ -// (PR.CurrentList(1, 3),"Translation data",tempTranslation); + PR.ReadXYZ(tempTranslation); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(),Msg214,tempScaleFactor); //szv#4:S4163:12Mar99 moved down - //st = PR.ReadReal(PR.Current(),"Scale Factor",tempScaleFactor); - temphasscale = PR.ReadReal(PR.Current(),tempScaleFactor); + temphasscale = PR.ReadReal(tempScaleFactor); if (!temphasscale){ Message_Msg Msg214("XSTEP_214"); PR.SendFail(Msg214); diff --git a/src/IGESBasic/IGESBasic_ToolSubfigureDef.cxx b/src/IGESBasic/IGESBasic_ToolSubfigureDef.cxx index db097a2aba..43ece637b3 100644 --- a/src/IGESBasic/IGESBasic_ToolSubfigureDef.cxx +++ b/src/IGESBasic/IGESBasic_ToolSubfigureDef.cxx @@ -52,18 +52,17 @@ void IGESBasic_ToolSubfigureDef::ReadOwnParams Standard_Integer tempDepth; Handle(TCollection_HAsciiString) tempName; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Integer nbval = 0; Handle(IGESData_HArray1OfIGESEntity) EntArray; - if(!PR.ReadInteger(PR.Current(),tempDepth)){ //szv#4:S4163:12Mar99 `st=` not needed + if(!PR.ReadInteger(tempDepth)) { Message_Msg Msg208("XSTEP_208"); PR.SendFail(Msg208); } - PR.ReadText(PR.Current(),Msg209,tempName); //szv#4:S4163:12Mar99 `st=` not needed - if (PR.ReadInteger( PR.Current(), nbval)) { //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadText(Msg209,tempName); + if (PR.ReadInteger(nbval)) { Message_Msg Msg211("XSTEP_211"); - PR.ReadEnts (IR,PR.CurrentList(nbval),Msg211,EntArray); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEnts (IR,PR.CurrentList(nbval),Msg211,EntArray); } else{ Message_Msg Msg210("XSTEP_210"); diff --git a/src/IGESCAFControl/IGESCAFControl_Writer.cxx b/src/IGESCAFControl/IGESCAFControl_Writer.cxx index cab20bed93..a59537b475 100644 --- a/src/IGESCAFControl/IGESCAFControl_Writer.cxx +++ b/src/IGESCAFControl/IGESCAFControl_Writer.cxx @@ -17,9 +17,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -272,15 +272,14 @@ void IGESCAFControl_Writer::MakeColors (const TopoDS_Shape &S, XCAFPrs_Style c; // style used as key in the map c.SetColorSurf ( col ); if ( colors.IsBound ( c ) ) { - colent = Handle(IGESGraph_Color)::DownCast ( colors.Find(c) ); + colent = Handle(IGESGraph_Color)::DownCast ( colors.Find(c) ); } else { - Handle(TCollection_HAsciiString) str = - new TCollection_HAsciiString ( col.StringName ( col.Name() ) ); - colent = new IGESGraph_Color; - colent->Init ( col.Red() * 100., col.Green() * 100., col.Blue() * 100., str ); - AddEntity ( colent ); - colors.Bind ( c, colent ); + Handle(TCollection_HAsciiString) str = + new TCollection_HAsciiString ( col.StringName ( col.Name() ) ); + colent = new IGESGraph_Color( col.Red() * 100., col.Green() * 100., col.Blue() * 100., str ); + AddEntity ( colent ); + colors.Bind ( c, colent ); } } Handle(Transfer_FinderProcess) FP = TransferProcess(); diff --git a/src/IGESControl/IGESControl_Controller.cxx b/src/IGESControl/IGESControl_Controller.cxx index 27c9f17838..af7d7d8640 100644 --- a/src/IGESControl/IGESControl_Controller.cxx +++ b/src/IGESControl/IGESControl_Controller.cxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -142,11 +142,13 @@ Standard_Integer IGESControl_Controller::ReadFile (const Standard_CString theFil { DeclareAndCast(IGESData_Protocol,prot,myAdaptorProtocol); - Handle(IGESData_IGESModel) igesmod = new IGESData_IGESModel; - char* pname=(char*) theFileName; - Standard_Integer status = IGESFile_Read (pname,igesmod,prot); + IGESFile_Reader aReader(prot); - Handle(Message_Messenger) sout = Message::DefaultMessenger(); + const Standard_Integer status = aReader.Read(theFileName); + + const Handle(IGESData_IGESModel) &igesmod = aReader.Model(); + + const Handle(Message_Messenger) &sout = Message::DefaultMessenger(); if (status < 0) sout<<"File not found : "< 0) sout<<"Error when reading file : "<AddFail("IGES File could not be created"); sout<<" - IGES File could not be created : " << theFileName << endl; @@ -187,7 +188,7 @@ Standard_Boolean IGESControl_Controller::WriteFile (const Standard_CString theFi sout << " (all model)"; // Envoi - VW.SendModel(prot); + VW.SendModel(); sout<<" Write "; if (themodefnes) VW.WriteMode() = 10; Standard_Boolean status = VW.Print(fout); @@ -209,14 +210,13 @@ Standard_Boolean IGESControl_Controller::WriteFile (const Standard_CString theFi void IGESControl_Controller::DumpEntity (const Handle(Interface_InterfaceModel)& model, - const Handle(Interface_Protocol)& protocol, + const Handle(Interface_Protocol)& , const Handle(Standard_Transient)& entity, const Handle(Message_Messenger)& S, const Standard_Integer level) const { DeclareAndCast(IGESData_IGESModel,igesmod,model); - DeclareAndCast(IGESData_Protocol,igespro,protocol); DeclareAndCast(IGESData_IGESEntity,igesent,entity); - if (igesmod.IsNull() || igespro.IsNull() || igesent.IsNull()) return; + if (igesmod.IsNull() || igesent.IsNull()) return; Standard_Integer num = igesmod->Number(igesent); if (num == 0) return; @@ -241,7 +241,7 @@ void IGESControl_Controller::DumpEntity } else S << " Type cdl : " << igesent->DynamicType()->Name(); - IGESData_IGESDumper dump(igesmod,igespro); + IGESData_IGESDumper dump(igesmod); try { OCC_CATCH_SIGNALS dump.Dump(igesent,S,level,(level-1)/3); diff --git a/src/IGESControl/IGESControl_Writer.cxx b/src/IGESControl/IGESControl_Writer.cxx index c93f710a19..5f6c231448 100644 --- a/src/IGESControl/IGESControl_Writer.cxx +++ b/src/IGESControl/IGESControl_Writer.cxx @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -224,47 +223,31 @@ void IGESControl_Writer::ComputeModel () } } -Standard_Boolean IGESControl_Writer::Write - (Standard_OStream& S, const Standard_Boolean fnes) +Standard_Boolean IGESControl_Writer::Write (Standard_OStream& S, const Standard_Boolean fnes) { if (!S) return Standard_False; ComputeModel(); Standard_Integer nbEnt = myModel->NbEntities(); -#ifdef OCCT_DEBUG - cout<<" IGES Write : "<NbEntities(); + const Standard_Integer nb = myModel->NbEntities(); if (nb == 0) return; TColStd_Array1OfInteger subs (0,nb); subs.Init(0); // gere Subordinate Status Interface_Graph G (myModel); // gere & memorise UseFlag @@ -340,24 +322,17 @@ void IGESControl_Writer::ComputeStatus () // Traites actuellement (necessaires) : // 1(Annotation), aussi 4(pour maillage). 5(ParamUV) traite par AutoCorrect - Standard_Integer CN; Standard_Integer i; // svv Jan11 2000 : porting on DEC for (i = 1; i <= nb; i ++) { // Subordinate (sur directs en propre seulement) Handle(IGESData_IGESEntity) ent = myModel->Entity(i); - Standard_Integer igt = ent->TypeNumber(); - Handle(Interface_GeneralModule) gmodule; - if (myGLib.Select (ent,gmodule,CN)) { - Handle(IGESData_GeneralModule) gmod = - Handle(IGESData_GeneralModule)::DownCast (gmodule); - Interface_EntityIterator sh; - gmod->OwnSharedCase (CN,ent,sh); - for (sh.Start(); sh.More(); sh.Next()) { - Standard_Integer nums = myModel->Number(sh.Value()); - if (igt == 402 || igt == 404) subs.SetValue (nums,subs.Value(nums) | 2); - else subs.SetValue (nums,subs.Value(nums) | 1); -//// cout<<"ComputeStatus : nums = "<"<TypeNumber(); + Interface_EntityIterator sh; + ent->OwnShared (sh); + for (sh.Start(); sh.More(); sh.Next()) { + const Standard_Integer nums = myModel->Number(sh.Value()); + if (igt == 402 || igt == 404) subs.SetValue (nums,subs.Value(nums) | 2); + else subs.SetValue (nums,subs.Value(nums) | 1); } // UseFlag (a propager) if (igt / 100 == 2) { @@ -384,46 +359,37 @@ void IGESControl_Writer::ComputeStatus () Standard_Boolean IGESControl_Writer::AutoCorrect (const Handle(IGESData_IGESEntity)& ent) { - if (myModel.IsNull()) return Standard_False; - Handle(IGESData_IGESEntity) bof, subent; - Handle(IGESData_LineFontEntity) linefont; - Handle(IGESData_LevelListEntity) levelist; - Handle(IGESData_ViewKindEntity) view; - Handle(IGESData_TransfEntity) transf; - Handle(IGESData_LabelDisplayEntity) labdisp; - Handle(IGESData_ColorEntity) color; + if (ent.IsNull()) return Standard_False; Standard_Boolean done = Standard_False; - if (ent.IsNull()) return done; // Corrections dans les Assocs (les Props restent attachees a l Entite) Interface_EntityIterator iter = ent->Associativities(); - for (iter.Start(); iter.More(); iter.Next()) { - subent = GetCasted(IGESData_IGESEntity,iter.Value()); - if (!subent.IsNull() && myModel->Number(subent) == 0) - { subent->Dissociate(ent); done = Standard_True; } + for (iter.Start(); iter.More(); iter.Next()) + { + const Handle(Standard_Transient) &aent = iter.Value(); + if (!aent.IsNull() && myModel->Number(aent) == 0) + { + DeclareAndCast(IGESData_IGESEntity,subent,aent); + subent->Dissociate(ent); + done = Standard_True; + } } // Corrections specifiques - Standard_Integer CN; - Handle(Interface_GeneralModule) gmodule; - if (myGLib.Select (ent,gmodule,CN)) { - Handle(IGESData_GeneralModule) gmod = - Handle(IGESData_GeneralModule)::DownCast (gmodule); - IGESData_DirChecker DC = gmod->DirChecker(CN,ent); - done |= DC.Correct(ent); - } + //szv_c1:done |= ent->DirChecker().Correct(ent); should be called from OwnCorrect - Handle(IGESData_SpecificModule) smod; - if (mySLib.Select (ent,smod,CN)) done |= smod->OwnCorrect (CN,ent); + done |= ent->OwnCorrect(); return done; } Standard_Integer IGESControl_Writer::AutoCorrectModel () { + if (myModel.IsNull()) return 0; + Standard_Integer res = 0; - Standard_Integer nb = myModel->NbEntities(); + const Standard_Integer nb = myModel->NbEntities(); for (Standard_Integer i = 1; i <= nb; i ++) { if (AutoCorrect (myModel->Entity(i))) res ++; } diff --git a/src/IGESControl/IGESControl_Writer.hxx b/src/IGESControl/IGESControl_Writer.hxx index e2e52e38b9..6588004187 100644 --- a/src/IGESControl/IGESControl_Writer.hxx +++ b/src/IGESControl/IGESControl_Writer.hxx @@ -23,7 +23,6 @@ #include #include -#include class TopoDS_Shape; class Transfer_FinderProcess; class IGESData_IGESModel; @@ -140,7 +139,6 @@ public: Standard_Integer myWriteMode; Standard_Boolean myIsComputed; Interface_GeneralLib myGLib; - IGESData_SpecificLib mySLib; }; #endif // _IGESControl_Writer_HeaderFile diff --git a/src/IGESData/FILES b/src/IGESData/FILES index eebb70e74b..b31b7e117c 100755 --- a/src/IGESData/FILES +++ b/src/IGESData/FILES @@ -6,8 +6,6 @@ IGESData_ColorEntity.cxx IGESData_ColorEntity.hxx IGESData_DefaultGeneral.cxx IGESData_DefaultGeneral.hxx -IGESData_DefaultSpecific.cxx -IGESData_DefaultSpecific.hxx IGESData_DefList.hxx IGESData_DefSwitch.cxx IGESData_DefSwitch.hxx @@ -23,10 +21,6 @@ IGESData_FreeFormatEntity.cxx IGESData_FreeFormatEntity.hxx IGESData_GeneralModule.cxx IGESData_GeneralModule.hxx -IGESData_GlobalNodeOfSpecificLib.hxx -IGESData_GlobalNodeOfSpecificLib_0.cxx -IGESData_GlobalNodeOfWriterLib.hxx -IGESData_GlobalNodeOfWriterLib_0.cxx IGESData_GlobalSection.cxx IGESData_GlobalSection.hxx IGESData_HArray1OfIGESEntity.hxx @@ -40,7 +34,6 @@ IGESData_IGESReaderData.cxx IGESData_IGESReaderData.hxx IGESData_IGESReaderTool.cxx IGESData_IGESReaderTool.hxx -IGESData_IGESType.cxx IGESData_IGESType.hxx IGESData_IGESWriter.cxx IGESData_IGESWriter.hxx @@ -52,26 +45,14 @@ IGESData_LineFontEntity.cxx IGESData_LineFontEntity.hxx IGESData_NameEntity.cxx IGESData_NameEntity.hxx -IGESData_NodeOfSpecificLib.hxx -IGESData_NodeOfSpecificLib_0.cxx -IGESData_NodeOfWriterLib.hxx -IGESData_NodeOfWriterLib_0.cxx -IGESData_ParamCursor.cxx IGESData_ParamCursor.hxx -IGESData_ParamCursor.lxx IGESData_ParamReader.cxx IGESData_ParamReader.hxx IGESData_Protocol.cxx IGESData_Protocol.hxx IGESData_ReadStage.hxx -IGESData_ReadWriteModule.cxx -IGESData_ReadWriteModule.hxx IGESData_SingleParentEntity.cxx IGESData_SingleParentEntity.hxx -IGESData_SpecificLib.hxx -IGESData_SpecificLib_0.cxx -IGESData_SpecificModule.cxx -IGESData_SpecificModule.hxx IGESData_Status.hxx IGESData_ToolLocation.cxx IGESData_ToolLocation.hxx @@ -81,5 +62,3 @@ IGESData_UndefinedEntity.cxx IGESData_UndefinedEntity.hxx IGESData_ViewKindEntity.cxx IGESData_ViewKindEntity.hxx -IGESData_WriterLib.hxx -IGESData_WriterLib_0.cxx diff --git a/src/IGESData/IGESData.cxx b/src/IGESData/IGESData.cxx index 01b028ad90..ea886d998a 100644 --- a/src/IGESData/IGESData.cxx +++ b/src/IGESData/IGESData.cxx @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -39,13 +38,11 @@ static Handle(IGESData_Protocol) gIGESProto; static Handle(IGESData_IGESModel) gIGESModel; static Handle(IGESData_DefaultGeneral) stmod; -static Handle(IGESData_DefaultSpecific) speci; void IGESData::Init () { if (gIGESProto.IsNull()) gIGESProto = new IGESData_Protocol; if (stmod.IsNull()) stmod = new IGESData_DefaultGeneral; - if (speci.IsNull()) speci = new IGESData_DefaultSpecific; // et modele template "iges" if (!gIGESModel.IsNull()) return; diff --git a/src/IGESData/IGESData_Array1OfIGESEntity.hxx b/src/IGESData/IGESData_Array1OfIGESEntity.hxx index d2409df707..be0251a76f 100644 --- a/src/IGESData/IGESData_Array1OfIGESEntity.hxx +++ b/src/IGESData/IGESData_Array1OfIGESEntity.hxx @@ -17,10 +17,10 @@ #ifndef IGESData_Array1OfIGESEntity_HeaderFile #define IGESData_Array1OfIGESEntity_HeaderFile +#include #include #include -typedef NCollection_Array1 IGESData_Array1OfIGESEntity; - +typedef NCollection_Array1> IGESData_Array1OfIGESEntity; #endif diff --git a/src/IGESData/IGESData_DefaultGeneral.cxx b/src/IGESData/IGESData_DefaultGeneral.cxx index c9aac2aeca..90e3c1479e 100644 --- a/src/IGESData/IGESData_DefaultGeneral.cxx +++ b/src/IGESData/IGESData_DefaultGeneral.cxx @@ -32,38 +32,7 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESData_DefaultGeneral,IGESData_GeneralModule) IGESData_DefaultGeneral::IGESData_DefaultGeneral () { Interface_GeneralLib::SetGlobal(this, IGESData::Protocol()); } - void IGESData_DefaultGeneral::OwnSharedCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - Interface_EntityIterator& iter) const -{ - if (CN == 0) return; - DeclareAndCast(IGESData_UndefinedEntity,anent,ent); - if (anent.IsNull()) return; - Handle(Interface_UndefinedContent) cont = anent->UndefinedContent(); - Standard_Integer nb = cont->NbParams(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (cont->IsParamEntity(i)) iter.GetOneItem (cont->ParamEntity(i)); - } -} - IGESData_DirChecker IGESData_DefaultGeneral::DirChecker (const Standard_Integer , const Handle(IGESData_IGESEntity)& ) const { IGESData_DirChecker dc; return dc; } // aucun critere specifique - - - void IGESData_DefaultGeneral::OwnCheckCase - (const Standard_Integer , const Handle(IGESData_IGESEntity)& , - const Interface_ShareTool& , Handle(Interface_Check)& ) const -{ } // aucun critere specifique - - - Standard_Boolean IGESData_DefaultGeneral::NewVoid - (const Standard_Integer CN, Handle(Standard_Transient)& entto) const -{ - entto.Nullify(); - if (CN == 0) return Standard_False; - if (CN == 1) entto = new IGESData_UndefinedEntity; - if (CN == 2) entto = new IGESData_FreeFormatEntity; - return (!entto.IsNull()); -} diff --git a/src/IGESData/IGESData_DefaultGeneral.hxx b/src/IGESData/IGESData_DefaultGeneral.hxx index 0e224cadc1..f42ff73ede 100644 --- a/src/IGESData/IGESData_DefaultGeneral.hxx +++ b/src/IGESData/IGESData_DefaultGeneral.hxx @@ -33,20 +33,9 @@ class IGESData_DefaultGeneral : public IGESData_GeneralModule //! bound with a Protocol from IGESData Standard_EXPORT IGESData_DefaultGeneral(); - //! Lists the Entities shared by an IGESEntity, which must be - //! an UndefinedEntity - Standard_EXPORT void OwnSharedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - //! Returns a DirChecker, specific for each type of Entity //! Here, Returns an empty DirChecker (no constraint to check) Standard_EXPORT IGESData_DirChecker DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - - //! Performs Specific Semantic Check for each type of Entity - //! Here, does nothing (no constraint to check) - Standard_EXPORT void OwnCheckCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE; - - //! Specific creation of a new void entity (UndefinedEntity only) - Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESData_DefaultGeneral,IGESData_GeneralModule) }; diff --git a/src/IGESData/IGESData_DefaultSpecific.cxx b/src/IGESData/IGESData_DefaultSpecific.cxx deleted file mode 100644 index f4718082df..0000000000 --- a/src/IGESData/IGESData_DefaultSpecific.cxx +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESData_DefaultSpecific,IGESData_SpecificModule) - -IGESData_DefaultSpecific::IGESData_DefaultSpecific () -{ IGESData_SpecificLib::SetGlobal(this, IGESData::Protocol()); } - - void IGESData_DefaultSpecific::OwnDump - (const Standard_Integer /*CN*/, const Handle(IGESData_IGESEntity)& ent, - const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, - const Standard_Integer /*own*/) const -{ - DeclareAndCast(IGESData_UndefinedEntity,lent,ent); - if (lent.IsNull()) return; - - Standard_Integer dstat = lent->DirStatus(); - if (dstat != 0) S - << " -- Directory Entry Error Status = " << dstat << " --" << endl; - Handle(Interface_UndefinedContent) cont = lent->UndefinedContent(); - Standard_Integer nb = cont->NbParams(); - S << " UNDEFINED ENTITY ...\n"<ParamType(i); - if (ptyp == Interface_ParamVoid) S<<" ["<IsParamEntity(i)) { - DeclareAndCast(IGESData_IGESEntity,anent,cont->ParamEntity(i)); - S<<" ["<FormNumber() < theform1 || ent->FormNumber() > theform2) { Message_Msg Msg71 ("XSTEP_71"); - ach->SendFail(Msg71); + ach->SendFail(Msg71); } } } // Sending of message : Structure field is undefined. - if (thestructure == IGESData_DefReference && !ent->HasStructure()) { + if (thestructure == IGESData_DefReference && ent->Structure().IsNull()) { Message_Msg Msg59 ("XSTEP_59"); ach->SendFail (Msg59); } @@ -376,7 +128,7 @@ void IGESData_DirChecker::Check(Handle(Interface_Check)& ach, } } - +*/ //======================================================================= //function : CheckTypeAndForm @@ -424,9 +176,8 @@ void IGESData_DirChecker::CheckTypeAndForm(Handle(Interface_Check)& ach, //function : Correct //purpose : //======================================================================= - -Standard_Boolean IGESData_DirChecker::Correct - (const Handle(IGESData_IGESEntity)& ent) const +/*szv_c1: +Standard_Boolean IGESData_DirChecker::Correct (const Handle(IGESData_IGESEntity)& ent) const { Standard_Boolean done = Standard_False; Standard_Integer type = ent->TypeNumber(); @@ -461,7 +212,7 @@ Standard_Boolean IGESData_DirChecker::Correct { ent->InitView(nulview); ent->InitLevel(nulevel); done = Standard_True; } if ((thegraphier == -1 && (!ent->LabelDisplay().IsNull() || ent->LineWeightNumber() != 0)) || - (ent->HasStructure() && thestructure == IGESData_DefVoid) ) // combines : + (!ent->Structure().IsNull() && thestructure == IGESData_DefVoid) ) // combines : { ent->InitMisc (structure,label,linew); done = Standard_True; } Standard_Boolean force = Standard_False; @@ -480,3 +231,4 @@ Standard_Boolean IGESData_DirChecker::Correct if (force) { ent->InitStatus(stb,sts,stu,sth); done = Standard_True; } return done; } +*/ \ No newline at end of file diff --git a/src/IGESData/IGESData_DirChecker.hxx b/src/IGESData/IGESData_DirChecker.hxx index 8356e4e04e..9874f0ce12 100644 --- a/src/IGESData/IGESData_DirChecker.hxx +++ b/src/IGESData/IGESData_DirChecker.hxx @@ -21,8 +21,6 @@ #include #include -#include -#include #include class Interface_Check; class IGESData_IGESEntity; @@ -49,96 +47,119 @@ public: //! Returns a DirChecker, with no criterium at all to be checked - Standard_EXPORT IGESData_DirChecker(); + IGESData_DirChecker() + : thetype(0), theform1(0), theform2(0), + thestructure(IGESData_ErrorRef), + thelinefont(IGESData_ErrorRef), + thelineweig(IGESData_ErrorRef), + thecolor(IGESData_ErrorRef), + thegraphier(-100), // ne pas tester GraphicsIgnored + theblankst(-100), thesubordst(-100), theuseflag(-100), thehierst(-100) // ne pas tester + {} //! Returns a DirChecker, with no criterium except Required Type - Standard_EXPORT IGESData_DirChecker(const Standard_Integer atype); - + IGESData_DirChecker(const Standard_Integer atype) + : thetype(atype), theform1(0), theform2(-1), // test de forme inhibe + thestructure(IGESData_ErrorRef), + thelinefont(IGESData_ErrorRef), + thelineweig(IGESData_ErrorRef), + thecolor(IGESData_ErrorRef), + thegraphier(-100), // ne pas tester GraphicsIgnored + theblankst(-100), thesubordst(-100), theuseflag(-100), thehierst(-100) // ne pas tester + {} + //! Returns a DirChecker, with no criterium except Required values //! for Type and Form numbers - Standard_EXPORT IGESData_DirChecker(const Standard_Integer atype, const Standard_Integer aform); - + IGESData_DirChecker(const Standard_Integer atype, const Standard_Integer aform) + : thetype(atype), theform1(aform), theform2(aform), // forme : valeur requise + thestructure(IGESData_ErrorRef), + thelinefont(IGESData_ErrorRef), + thelineweig(IGESData_ErrorRef), + thecolor(IGESData_ErrorRef), + thegraphier(-100), // ne pas tester GraphicsIgnored + theblankst(-100), thesubordst(-100), theuseflag(-100), thehierst(-100) // ne pas tester + {} + //! Returns a DirChecker, with no criterium except Required values //! for Type number (atype), and Required Range for Form number //! (which must be between aform1 and aform2 included) - Standard_EXPORT IGESData_DirChecker(const Standard_Integer atype, const Standard_Integer aform1, const Standard_Integer aform2); - - //! Returns True if at least one criterium has already been set - //! Allows user to store a DirChecker (static variable) then ask - //! if it has been set before setting it - Standard_EXPORT Standard_Boolean IsSet() const; - - //! Sets a DirChecker with most current criteria, that is : - //! Structure Ignored ( worths call Structure(crit = DefVoid) ) - Standard_EXPORT void SetDefault(); - + IGESData_DirChecker(const Standard_Integer atype, const Standard_Integer aform1, const Standard_Integer aform2) + : thetype(atype), theform1(aform1), theform2(aform2), // forme : [...] + thestructure(IGESData_ErrorRef), + thelinefont(IGESData_ErrorRef), + thelineweig(IGESData_ErrorRef), + thecolor(IGESData_ErrorRef), + thegraphier(-100), // ne pas tester GraphicsIgnored + theblankst(-100), thesubordst(-100), theuseflag(-100), thehierst(-100) // ne pas tester + {} + //! Sets Structure criterium. //! If crit is DefVoid, Ignored : should not be defined //! If crit is DefReference, Required : must be defined //! Other values are not taken in account - Standard_EXPORT void Structure (const IGESData_DefType crit); - + void Structure (const IGESData_DefType crit) { thestructure = crit; } + //! Sets LineFont criterium //! If crit is DefVoid, Ignored : should not be defined //! If crit is DefAny, Required : must be defined (value or ref) //! If crit is DefValue, Required as a Value (error if Reference) //! Other values are not taken in account - Standard_EXPORT void LineFont (const IGESData_DefType crit); - + void LineFont (const IGESData_DefType crit) { thelinefont = crit; } + //! Sets LineWeight criterium //! If crit is DefVoid, Ignored : should not be defined //! If crit is DefValue, Required //! Other values are not taken in account - Standard_EXPORT void LineWeight (const IGESData_DefType crit); - + void LineWeight (const IGESData_DefType crit) { thelineweig = crit; } + //! Sets Color criterium //! If crit is DefVoid, Ignored : should not be defined //! If crit is DefAny, Required : must be defined (value or ref) //! Other values are not taken in account - Standard_EXPORT void Color (const IGESData_DefType crit); - + void Color (const IGESData_DefType crit) { thecolor = crit; } + //! Sets Graphics data (LineFont, LineWeight, Color, Level, View) //! to be ignored according value of Hierarchy status : //! If hierarchy is not given, they are Ignored any way //! (that is, they should not be defined) //! If hierarchy is given, Graphics are Ignored if the Hierarchy //! status has the value given in argument "hierarchy" - Standard_EXPORT void GraphicsIgnored (const Standard_Integer hierarchy = -1); - + void GraphicsIgnored (const Standard_Integer hierarchy = -1) { thegraphier = hierarchy; } + //! Sets Blank Status to be ignored //! (should not be defined, or its value should be 0) - Standard_EXPORT void BlankStatusIgnored(); + void BlankStatusIgnored() { theblankst = -10; } //! Sets Blank Status to be required at a given value - Standard_EXPORT void BlankStatusRequired (const Standard_Integer val); - + void BlankStatusRequired (const Standard_Integer val) { theblankst = val; } + //! Sets Subordinate Status to be ignored //! (should not be defined, or its value should be 0) - Standard_EXPORT void SubordinateStatusIgnored(); - + void SubordinateStatusIgnored() { thesubordst = -10; } + //! Sets Subordinate Status to be required at a given value - Standard_EXPORT void SubordinateStatusRequired (const Standard_Integer val); - + void SubordinateStatusRequired (const Standard_Integer val) { thesubordst = val; } + //! Sets Blank Status to be ignored //! (should not be defined, or its value should be 0) - Standard_EXPORT void UseFlagIgnored(); - + void UseFlagIgnored() { theuseflag = -10; } + //! Sets Blank Status to be required at a given value //! Give -1 to demand UseFlag not zero (but no precise value req.) - Standard_EXPORT void UseFlagRequired (const Standard_Integer val); - + void UseFlagRequired (const Standard_Integer val) { theuseflag = val; } + //! Sets Hierarchy Status to be ignored //! (should not be defined, or its value should be 0) - Standard_EXPORT void HierarchyStatusIgnored(); - + void HierarchyStatusIgnored() { thehierst = -10; } + //! Sets Hierarchy Status to be required at a given value - Standard_EXPORT void HierarchyStatusRequired (const Standard_Integer val); - + void HierarchyStatusRequired (const Standard_Integer val) { thehierst = val; } + //! Performs the Checks on an IGESEntity, according to the //! recorded criteria //! In addition, does minimal Checks, such as admitted range for //! Status, or presence of Error status in some data (Color, ...) - Standard_EXPORT void Check (Handle(Interface_Check)& ach, const Handle(IGESData_IGESEntity)& ent) const; + //szv_c1:Standard_EXPORT void Check (Handle(Interface_Check)& ach, const Handle(IGESData_IGESEntity)& ent) const; //! Performs a Check only on Values of Type Number and Form Number //! This allows to do a check on an Entity not yet completely @@ -154,22 +175,10 @@ public: //! - Type Number is enforced //! - finally Form Number is enforced only if one and only Value //! is admitted (no range, see Constructors of DirChecker) - Standard_EXPORT Standard_Boolean Correct (const Handle(IGESData_IGESEntity)& ent) const; - - - - -protected: - - + //szv_c1:Standard_EXPORT Standard_Boolean Correct (const Handle(IGESData_IGESEntity)& ent) const; + //private: - -private: - - - - Standard_Boolean isitset; Standard_Integer thetype; Standard_Integer theform1; Standard_Integer theform2; @@ -182,14 +191,6 @@ private: Standard_Integer thesubordst; Standard_Integer theuseflag; Standard_Integer thehierst; - - }; - - - - - - #endif // _IGESData_DirChecker_HeaderFile diff --git a/src/IGESData/IGESData_DirPart.cxx b/src/IGESData/IGESData_DirPart.cxx index 2b8f3e7043..c2d317e978 100644 --- a/src/IGESData/IGESData_DirPart.cxx +++ b/src/IGESData/IGESData_DirPart.cxx @@ -16,9 +16,7 @@ #include #include -IGESData_DirPart::IGESData_DirPart () { } - - void IGESData_DirPart::Init +void IGESData_DirPart::Init (const Standard_Integer i1, const Standard_Integer i2, const Standard_Integer i3, const Standard_Integer i4, const Standard_Integer i5, const Standard_Integer i6, const Standard_Integer i7, const Standard_Integer i8, const Standard_Integer i9, const Standard_Integer i10, const Standard_Integer i11, @@ -93,5 +91,5 @@ void IGESData_DirPart::Values (Standard_Integer& i1, } - IGESData_IGESType IGESData_DirPart::Type () const - { return IGESData_IGESType(thevals[0],thevals[16]); } // type & forme +IGESData_IGESType IGESData_DirPart::Type () const +{ return IGESData_IGESType(thevals[0],thevals[16]); } // type & forme diff --git a/src/IGESData/IGESData_DirPart.hxx b/src/IGESData/IGESData_DirPart.hxx index 5593a18417..550b279490 100644 --- a/src/IGESData/IGESData_DirPart.hxx +++ b/src/IGESData/IGESData_DirPart.hxx @@ -21,8 +21,6 @@ #include #include -#include -#include #include class IGESData_IGESType; @@ -31,13 +29,12 @@ class IGESData_IGESType; //! taken from file class IGESData_DirPart { -public: + public: DEFINE_STANDARD_ALLOC - //! creates an empty DirPart, ready to be filled by Init - Standard_EXPORT IGESData_DirPart(); + IGESData_DirPart() {} //! fills DirPart with consistant data read from file Standard_EXPORT void Init (const Standard_Integer i1, const Standard_Integer i2, const Standard_Integer i3, const Standard_Integer i4, const Standard_Integer i5, const Standard_Integer i6, const Standard_Integer i7, const Standard_Integer i8, const Standard_Integer i9, const Standard_Integer i19, const Standard_Integer i11, const Standard_Integer i12, const Standard_Integer i13, const Standard_Integer i14, const Standard_Integer i15, const Standard_Integer i16, const Standard_Integer i17, const Standard_CString res1, const Standard_CString res2, const Standard_CString label, const Standard_CString subscript); @@ -49,32 +46,13 @@ public: //! returns "type" and "form" info, used to recognize the entity Standard_EXPORT IGESData_IGESType Type() const; - - - -protected: - - - - - -private: - - + private: Standard_Integer thevals[17]; Standard_Character theres1[10]; Standard_Character theres2[10]; Standard_Character thelabl[10]; Standard_Character thesubs[10]; - - }; - - - - - - #endif // _IGESData_DirPart_HeaderFile diff --git a/src/IGESData/IGESData_GeneralModule.cxx b/src/IGESData/IGESData_GeneralModule.cxx index 81e126dd08..30936a6984 100644 --- a/src/IGESData/IGESData_GeneralModule.cxx +++ b/src/IGESData/IGESData_GeneralModule.cxx @@ -27,19 +27,20 @@ #include #include #include -#include -#include +//#include #include #include +#include +#include + IMPLEMENT_STANDARD_RTTIEXT(IGESData_GeneralModule,Interface_GeneralModule) -void IGESData_GeneralModule::FillSharedCase - (const Standard_Integer CN, const Handle(Standard_Transient)& ent, - Interface_EntityIterator& iter) const +void IGESData_GeneralModule::FillSharedCase (const Standard_Integer, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const { DeclareAndCast(IGESData_IGESEntity,anent,ent); if (anent.IsNull()) return; + // .... Directory Part iter.AddItem (anent->DirFieldEntity (3)); iter.AddItem (anent->DirFieldEntity (4)); @@ -50,41 +51,52 @@ void IGESData_GeneralModule::FillSharedCase iter.AddItem (anent->DirFieldEntity (13)); // .... Own Parameters - OwnSharedCase (CN,anent,iter); + anent->OwnShared (iter); // .... Properties Interface_EntityIterator assocs = anent->Properties(); for (; assocs.More(); assocs.Next()) iter.AddItem (assocs.Value()); } - void IGESData_GeneralModule::ListImpliedCase +void IGESData_GeneralModule::ListImpliedCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const { - DeclareAndCast(IGESData_IGESEntity,anent,ent); - if (anent.IsNull()) return; - OwnImpliedCase (CN,anent,iter); - Interface_EntityIterator assocs = anent->Associativities(); + DeclareAndCast(IGESData_IGESEntity,aent,ent); + if (aent.IsNull()) return; + switch (CN ) { + case 13 : { + DeclareAndCast(IGESDraw_ViewsVisible,anent,aent); + if (anent.IsNull()) break; + const Standard_Integer nb = anent->NbDisplayedEntities(); + for (Standard_Integer i = 1; i <= nb; i++) + iter.GetOneItem(anent->DisplayedEntity(i)); + break; + } + case 14 : { + DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,aent); + if (anent.IsNull()) break; + const Standard_Integer nb = anent->NbDisplayedEntities(); + for (Standard_Integer i = 1; i <= nb; i++) + iter.GetOneItem(anent->DisplayedEntity(i)); + break; + } + default : break; + } + Interface_EntityIterator assocs = aent->Associativities(); for (; assocs.More(); assocs.Next()) iter.AddItem (assocs.Value()); } - void IGESData_GeneralModule::OwnImpliedCase - (const Standard_Integer , const Handle(IGESData_IGESEntity)& , - Interface_EntityIterator& ) const - { } // par defaut, rien (redefinissable) - - - - void IGESData_GeneralModule::CheckCase - (const Standard_Integer CN, const Handle(Standard_Transient)& ent, +void IGESData_GeneralModule::CheckCase + (const Standard_Integer, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const { DeclareAndCast(IGESData_IGESEntity,anent,ent); - IGESData_DirChecker dc = DirChecker(CN,anent); - dc.Check(ach,anent); - OwnCheckCase (CN,anent,shares,ach); + //szv_c1:anent->DirChecker().Check(ach,anent); should be called from OwnCheck + + anent->OwnCheck (shares,ach); } diff --git a/src/IGESData/IGESData_GeneralModule.hxx b/src/IGESData/IGESData_GeneralModule.hxx index c9389ee9d8..1d069368e0 100644 --- a/src/IGESData/IGESData_GeneralModule.hxx +++ b/src/IGESData/IGESData_GeneralModule.hxx @@ -42,70 +42,36 @@ DEFINE_STANDARD_HANDLE(IGESData_GeneralModule, Interface_GeneralModule) //! Properties are specifically processed class IGESData_GeneralModule : public Interface_GeneralModule { + public: -public: - - //! Fills the list of Entities shared by an IGESEntity , //! according a Case Number (formerly computed by CaseNum). //! Considers Properties and Directory Part, and calls //! OwnSharedCase (which is adapted to each Type of Entity) Standard_EXPORT void FillSharedCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - //! Lists the Entities shared by a given IGESEntity , from - //! its specific parameters : specific for each type - Standard_EXPORT virtual void OwnSharedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const = 0; - //! Lists the Implied References of . Here, these are the //! Associativities, plus the Entities defined by OwnSharedCase Standard_EXPORT virtual void ListImpliedCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - //! Specific list of Entities implied by a given IGESEntity - //! (in addition to Associativities). By default, there are none, - //! but this method can be redefined as required - Standard_EXPORT virtual void OwnImpliedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const; - //! Semantic Checking of an IGESEntity. Performs general Checks, //! which use DirChecker, then call OwnCheck which does a check //! specific for each type of Entity - Standard_EXPORT void CheckCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE; + Standard_EXPORT virtual void CheckCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE; //! Returns a DirChecker, specific for each type of Entity //! (identified by its Case Number) : this DirChecker defines //! constraints which must be respected by the DirectoryPart Standard_EXPORT virtual IGESData_DirChecker DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const = 0; - //! Performs Specific Semantic Check for each type of Entity - Standard_EXPORT virtual void OwnCheckCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const = 0; - - //! Specific creation of a new void entity - Standard_EXPORT virtual Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE = 0; + //! Not needed for IGES + Standard_EXPORT virtual Standard_Boolean NewVoid (const Standard_Integer, Handle(Standard_Transient) &) const Standard_OVERRIDE { return Standard_False; } //! Returns the name of an IGES Entity (its NameValue) //! Can be redefined for an even more specific case ... Standard_EXPORT virtual Handle(TCollection_HAsciiString) Name (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares) const Standard_OVERRIDE; - - - DEFINE_STANDARD_RTTIEXT(IGESData_GeneralModule,Interface_GeneralModule) - -protected: - - - - -private: - - - - }; - - - - - - #endif // _IGESData_GeneralModule_HeaderFile diff --git a/src/IGESData/IGESData_GlobalNodeOfSpecificLib.hxx b/src/IGESData/IGESData_GlobalNodeOfSpecificLib.hxx deleted file mode 100644 index 8332059cf2..0000000000 --- a/src/IGESData/IGESData_GlobalNodeOfSpecificLib.hxx +++ /dev/null @@ -1,86 +0,0 @@ -// Created on: 1992-04-06 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESData_GlobalNodeOfSpecificLib_HeaderFile -#define _IGESData_GlobalNodeOfSpecificLib_HeaderFile - -#include -#include - -#include -class Interface_Protocol; -class IGESData_SpecificModule; -class IGESData_IGESEntity; -class IGESData_SpecificLib; -class IGESData_NodeOfSpecificLib; - - -class IGESData_GlobalNodeOfSpecificLib; -DEFINE_STANDARD_HANDLE(IGESData_GlobalNodeOfSpecificLib, Standard_Transient) - - -class IGESData_GlobalNodeOfSpecificLib : public Standard_Transient -{ - -public: - - - //! Creates an empty GlobalNode, with no Next - Standard_EXPORT IGESData_GlobalNodeOfSpecificLib(); - - //! Adds a Module bound with a Protocol to the list : does - //! nothing if already in the list, THAT IS, Same Type (exact - //! match) and Same State (that is, IsEqual is not required) - //! Once added, stores its attached Protocol in correspondance - Standard_EXPORT void Add (const Handle(IGESData_SpecificModule)& amodule, const Handle(Interface_Protocol)& aprotocol); - - //! Returns the Module stored in a given GlobalNode - Standard_EXPORT const Handle(IGESData_SpecificModule)& Module() const; - - //! Returns the attached Protocol stored in a given GlobalNode - Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; - - //! Returns the Next GlobalNode. If none is defined, returned - //! value is a Null Handle - Standard_EXPORT const Handle(IGESData_GlobalNodeOfSpecificLib)& Next() const; - - - - - DEFINE_STANDARD_RTTI_INLINE(IGESData_GlobalNodeOfSpecificLib,Standard_Transient) - -protected: - - - - -private: - - - Handle(IGESData_SpecificModule) themod; - Handle(Interface_Protocol) theprot; - Handle(IGESData_GlobalNodeOfSpecificLib) thenext; - - -}; - - - - - - - -#endif // _IGESData_GlobalNodeOfSpecificLib_HeaderFile diff --git a/src/IGESData/IGESData_GlobalNodeOfSpecificLib_0.cxx b/src/IGESData/IGESData_GlobalNodeOfSpecificLib_0.cxx deleted file mode 100644 index 0ce9a69d78..0000000000 --- a/src/IGESData/IGESData_GlobalNodeOfSpecificLib_0.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// Created on: 1992-04-06 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -#include - -#include -#include -#include -#include -#include - -#define TheObject Handle(IGESData_IGESEntity) -#define TheObject_hxx -#define Handle_TheModule Handle(IGESData_SpecificModule) -#define TheModule IGESData_SpecificModule -#define TheModule_hxx -#define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node IGESData_NodeOfSpecificLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(IGESData_GlobalNodeOfSpecificLib) -#define Handle_LibCtl_Node Handle(IGESData_NodeOfSpecificLib) -#define LibCtl_Library IGESData_SpecificLib -#define LibCtl_Library_hxx -#include diff --git a/src/IGESData/IGESData_GlobalNodeOfWriterLib.hxx b/src/IGESData/IGESData_GlobalNodeOfWriterLib.hxx deleted file mode 100644 index 96b98786fa..0000000000 --- a/src/IGESData/IGESData_GlobalNodeOfWriterLib.hxx +++ /dev/null @@ -1,86 +0,0 @@ -// Created on: 1992-04-06 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESData_GlobalNodeOfWriterLib_HeaderFile -#define _IGESData_GlobalNodeOfWriterLib_HeaderFile - -#include -#include - -#include -class Interface_Protocol; -class IGESData_ReadWriteModule; -class IGESData_IGESEntity; -class IGESData_WriterLib; -class IGESData_NodeOfWriterLib; - - -class IGESData_GlobalNodeOfWriterLib; -DEFINE_STANDARD_HANDLE(IGESData_GlobalNodeOfWriterLib, Standard_Transient) - - -class IGESData_GlobalNodeOfWriterLib : public Standard_Transient -{ - -public: - - - //! Creates an empty GlobalNode, with no Next - Standard_EXPORT IGESData_GlobalNodeOfWriterLib(); - - //! Adds a Module bound with a Protocol to the list : does - //! nothing if already in the list, THAT IS, Same Type (exact - //! match) and Same State (that is, IsEqual is not required) - //! Once added, stores its attached Protocol in correspondance - Standard_EXPORT void Add (const Handle(IGESData_ReadWriteModule)& amodule, const Handle(Interface_Protocol)& aprotocol); - - //! Returns the Module stored in a given GlobalNode - Standard_EXPORT const Handle(IGESData_ReadWriteModule)& Module() const; - - //! Returns the attached Protocol stored in a given GlobalNode - Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; - - //! Returns the Next GlobalNode. If none is defined, returned - //! value is a Null Handle - Standard_EXPORT const Handle(IGESData_GlobalNodeOfWriterLib)& Next() const; - - - - - DEFINE_STANDARD_RTTI_INLINE(IGESData_GlobalNodeOfWriterLib,Standard_Transient) - -protected: - - - - -private: - - - Handle(IGESData_ReadWriteModule) themod; - Handle(Interface_Protocol) theprot; - Handle(IGESData_GlobalNodeOfWriterLib) thenext; - - -}; - - - - - - - -#endif // _IGESData_GlobalNodeOfWriterLib_HeaderFile diff --git a/src/IGESData/IGESData_GlobalNodeOfWriterLib_0.cxx b/src/IGESData/IGESData_GlobalNodeOfWriterLib_0.cxx deleted file mode 100644 index 983f03f237..0000000000 --- a/src/IGESData/IGESData_GlobalNodeOfWriterLib_0.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// Created on: 1992-04-06 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -#include - -#include -#include -#include -#include -#include - -#define TheObject Handle(IGESData_IGESEntity) -#define TheObject_hxx -#define Handle_TheModule Handle(IGESData_ReadWriteModule) -#define TheModule IGESData_ReadWriteModule -#define TheModule_hxx -#define LibCtl_GlobalNode IGESData_GlobalNodeOfWriterLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node IGESData_NodeOfWriterLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(IGESData_GlobalNodeOfWriterLib) -#define Handle_LibCtl_Node Handle(IGESData_NodeOfWriterLib) -#define LibCtl_Library IGESData_WriterLib -#define LibCtl_Library_hxx -#include diff --git a/src/IGESData/IGESData_GlobalSection.cxx b/src/IGESData/IGESData_GlobalSection.cxx index 0d71cbc34c..2c40621e2d 100644 --- a/src/IGESData/IGESData_GlobalSection.cxx +++ b/src/IGESData/IGESData_GlobalSection.cxx @@ -64,27 +64,13 @@ void MakeHollerith(const Handle(TCollection_HAsciiString)& astr, } -//======================================================================= -//function : IGESData_GlobalSection -//purpose : -//======================================================================= - -IGESData_GlobalSection::IGESData_GlobalSection () -{ -// convunit = 1000.; - //#73 rln 10.03.99 S4135: "read.scale.unit" is applied after translation - //if (Interface_Static::IVal("read.scale.unit") == 1) convunit = 1; -} - - // pourrait etre une methode generale au package en fait //======================================================================= //function : TranslatedFromHollerith //purpose : //======================================================================= -Handle(TCollection_HAsciiString) IGESData_GlobalSection::TranslatedFromHollerith - (const Handle(TCollection_HAsciiString)& astr) const +Handle(TCollection_HAsciiString) IGESData_GlobalSection::TranslatedFromHollerith (const Handle(TCollection_HAsciiString)& astr) const { Handle(TCollection_HAsciiString) res; if (astr.IsNull()) return res; @@ -105,17 +91,8 @@ Handle(TCollection_HAsciiString) IGESData_GlobalSection::TranslatedFromHollerith //purpose : //======================================================================= -void IGESData_GlobalSection::Init(const Handle(Interface_ParamSet)& params, - Handle(Interface_Check)& ach) +void IGESData_GlobalSection::Init(const Handle(Interface_ParamSet)& params, Handle(Interface_Check)& ach) { - // MGE 21/07/98 - // Building of messages - //====================================== - //Message_Msg Msg39 ("XSTEP_39"); - //Message_Msg Msg48 ("XSTEP_48"); - //Message_Msg Msg49 ("XSTEP_49"); - //====================================== - theSeparator = ','; theEndMark = ';'; theSendName.Nullify(); theFileName.Nullify(); theSystemId.Nullify(); theInterfaceVersion.Nullify(); @@ -385,303 +362,6 @@ Handle(Interface_ParamSet) IGESData_GlobalSection::Params () const // ############### QUERIES ############### -//======================================================================= -//function : Separator -//purpose : -//======================================================================= - -Standard_Character IGESData_GlobalSection::Separator () const -{ - return theSeparator; -} - - -//======================================================================= -//function : EndMark -//purpose : -//======================================================================= - -Standard_Character IGESData_GlobalSection::EndMark () const -{ - return theEndMark; -} - - -//======================================================================= -//function : SendName -//purpose : -//======================================================================= - -Handle(TCollection_HAsciiString) IGESData_GlobalSection::SendName () const -{ - return theSendName; -} - - -//======================================================================= -//function : FileName -//purpose : -//======================================================================= - -Handle(TCollection_HAsciiString) IGESData_GlobalSection::FileName () const -{ - return theFileName; -} - - -//======================================================================= -//function : SystemId -//purpose : -//======================================================================= - -Handle(TCollection_HAsciiString) IGESData_GlobalSection::SystemId () const -{ - return theSystemId; -} - - -//======================================================================= -//function : InterfaceVersion -//purpose : -//======================================================================= - -Handle(TCollection_HAsciiString) IGESData_GlobalSection::InterfaceVersion () const -{ - return theInterfaceVersion; -} - - -//======================================================================= -//function : IntegerBits -//purpose : -//======================================================================= - -Standard_Integer IGESData_GlobalSection::IntegerBits () const -{ - return theIntegerBits; -} - - -//======================================================================= -//function : MaxPower10Single -//purpose : -//======================================================================= - -Standard_Integer IGESData_GlobalSection::MaxPower10Single () const -{ - return theMaxPower10Single; -} - - -//======================================================================= -//function : MaxDigitsSingle -//purpose : -//======================================================================= - -Standard_Integer IGESData_GlobalSection::MaxDigitsSingle () const -{ - return theMaxDigitsSingle; -} - - -//======================================================================= -//function : MaxPower10Double -//purpose : -//======================================================================= - -Standard_Integer IGESData_GlobalSection::MaxPower10Double () const -{ - return theMaxPower10Double; -} - - -//======================================================================= -//function : MaxDigitsDouble -//purpose : -//======================================================================= - -Standard_Integer IGESData_GlobalSection::MaxDigitsDouble () const -{ - return theMaxDigitsDouble; -} - - -//======================================================================= -//function : ReceiveName -//purpose : -//======================================================================= - -Handle(TCollection_HAsciiString) IGESData_GlobalSection::ReceiveName () const -{ - return theReceiveName; -} - - -//======================================================================= -//function : Scale -//purpose : -//======================================================================= - -Standard_Real IGESData_GlobalSection::Scale () const -{ - return theScale; -} - - -//======================================================================= -//function : UnitFlag -//purpose : -//======================================================================= - -Standard_Integer IGESData_GlobalSection::UnitFlag () const -{ - return theUnitFlag; -} - - -//======================================================================= -//function : UnitName -//purpose : -//======================================================================= - -Handle(TCollection_HAsciiString) IGESData_GlobalSection::UnitName () const -{ - return theUnitName; -} - - -//======================================================================= -//function : LineWeightGrad -//purpose : -//======================================================================= - -Standard_Integer IGESData_GlobalSection::LineWeightGrad () const -{ - return theLineWeightGrad; -} - - -//======================================================================= -//function : MaxLineWeight -//purpose : -//======================================================================= - -Standard_Real IGESData_GlobalSection::MaxLineWeight () const -{ - return theMaxLineWeight; -} - - -//======================================================================= -//function : Date -//purpose : -//======================================================================= - -Handle(TCollection_HAsciiString) IGESData_GlobalSection::Date () const -{ - return theDate; -} - - -//======================================================================= -//function : Resolution -//purpose : -//======================================================================= - -Standard_Real IGESData_GlobalSection::Resolution () const -{ - return theResolution; -} - - -//======================================================================= -//function : MaxCoord -//purpose : -//======================================================================= - -Standard_Real IGESData_GlobalSection::MaxCoord () const -{ - return theMaxCoord; -} - - -//======================================================================= -//function : HasMaxCoord -//purpose : -//======================================================================= - -Standard_Boolean IGESData_GlobalSection::HasMaxCoord () const -{ - return hasMaxCoord; -} - - -//======================================================================= -//function : AuthorName -//purpose : -//======================================================================= - -Handle(TCollection_HAsciiString) IGESData_GlobalSection::AuthorName () const -{ - return theAuthorName; -} - - -//======================================================================= -//function : CompanyName -//purpose : -//======================================================================= - -Handle(TCollection_HAsciiString) IGESData_GlobalSection::CompanyName () const -{ - return theCompanyName; -} - - -//======================================================================= -//function : IGESVersion -//purpose : -//======================================================================= - -Standard_Integer IGESData_GlobalSection::IGESVersion () const -{ - return theIGESVersion; -} - - -//======================================================================= -//function : DraftingStandard -//purpose : -//======================================================================= - -Standard_Integer IGESData_GlobalSection::DraftingStandard () const -{ - return theDraftingStandard; -} - - -//======================================================================= -//function : LastChangeDate -//purpose : -//======================================================================= - -Handle(TCollection_HAsciiString) IGESData_GlobalSection::LastChangeDate () const -{ - return theLastChangeDate; -} - - -//======================================================================= -//function : HasLastChangeDate -//purpose : -//======================================================================= - -Standard_Boolean IGESData_GlobalSection::HasLastChangeDate () const -{ - return (!theLastChangeDate.IsNull()); -} - - //======================================================================= //function : SetLastChangeDate //purpose : @@ -694,34 +374,8 @@ void IGESData_GlobalSection::SetLastChangeDate () OSD_Process system; Quantity_Date ladate = system.SystemDate(); ladate.Values (mois,jour,annee,heure,minute,seconde,millisec,microsec); - if (annee < 2000) - //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000) - theLastChangeDate = NewDateString (annee,mois,jour,heure,minute,seconde,0); - else - //#65 rln 12.02.99 S4151 (explicitly force YYYYMMDD.HHMMSS after Y2000) - theLastChangeDate = NewDateString (annee,mois,jour,heure,minute,seconde, -1); -} - - -//======================================================================= -//function : HasApplicationProtocol -//purpose : -//======================================================================= - -Standard_Boolean IGESData_GlobalSection::HasApplicationProtocol () const -{ - return !theAppliProtocol.IsNull(); -} - - -//======================================================================= -//function : ApplicationProtocol -//purpose : -//======================================================================= - -Handle(TCollection_HAsciiString) IGESData_GlobalSection::ApplicationProtocol () const -{ - return theAppliProtocol; + //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000) + theLastChangeDate = NewDateString (annee,mois,jour,heure,minute,seconde,(annee < 2000)? 0 : -1); } @@ -809,12 +463,6 @@ Standard_Real IGESData_GlobalSection::UnitValue () const // ############### UPDATES ############### - void IGESData_GlobalSection::SetSeparator (const Standard_Character val) - { theSeparator = val; } - - void IGESData_GlobalSection::SetEndMark (const Standard_Character val) - { theEndMark = val; } - void IGESData_GlobalSection::SetSendName (const Handle(TCollection_HAsciiString)& val) { theSendName = TranslatedFromHollerith(val); } @@ -827,39 +475,12 @@ Standard_Real IGESData_GlobalSection::UnitValue () const void IGESData_GlobalSection::SetInterfaceVersion (const Handle(TCollection_HAsciiString)& val) { theInterfaceVersion = TranslatedFromHollerith(val); } - void IGESData_GlobalSection::SetIntegerBits (const Standard_Integer val) - { theIntegerBits = val; } - - void IGESData_GlobalSection::SetMaxPower10Single (const Standard_Integer val) - { theMaxPower10Single = val; } - - void IGESData_GlobalSection::SetMaxDigitsSingle (const Standard_Integer val) - { theMaxDigitsSingle = val; } - - void IGESData_GlobalSection::SetMaxPower10Double (const Standard_Integer val) - { theMaxPower10Double = val; } - - void IGESData_GlobalSection::SetMaxDigitsDouble (const Standard_Integer val) - { theMaxDigitsDouble = val; } - void IGESData_GlobalSection::SetReceiveName (const Handle(TCollection_HAsciiString)& val) { theReceiveName = TranslatedFromHollerith(val); } - void IGESData_GlobalSection::SetScale (const Standard_Real val) - { theScale = val; } - - void IGESData_GlobalSection::SetUnitFlag (const Standard_Integer val) - { theUnitFlag = val; } - void IGESData_GlobalSection::SetUnitName (const Handle(TCollection_HAsciiString)& val) { theUnitName = TranslatedFromHollerith(val); } - void IGESData_GlobalSection::SetLineWeightGrad (const Standard_Integer val) - { theLineWeightGrad = val; } - - void IGESData_GlobalSection::SetMaxLineWeight (const Standard_Real val) - { theMaxLineWeight = val; } - void IGESData_GlobalSection::SetDate (const Handle(TCollection_HAsciiString)& val) { theDate = TranslatedFromHollerith(val); } @@ -889,12 +510,6 @@ Standard_Real IGESData_GlobalSection::UnitValue () const void IGESData_GlobalSection::SetCompanyName (const Handle(TCollection_HAsciiString)& val) { theCompanyName = TranslatedFromHollerith(val); } - void IGESData_GlobalSection::SetIGESVersion (const Standard_Integer val) - { theIGESVersion = val; } - - void IGESData_GlobalSection::SetDraftingStandard (const Standard_Integer val) - { theDraftingStandard = val; } - void IGESData_GlobalSection::SetLastChangeDate (const Handle(TCollection_HAsciiString)& val) { theLastChangeDate = TranslatedFromHollerith(val); } diff --git a/src/IGESData/IGESData_GlobalSection.hxx b/src/IGESData/IGESData_GlobalSection.hxx index 4b9f7efe9b..18b79f4569 100644 --- a/src/IGESData/IGESData_GlobalSection.hxx +++ b/src/IGESData/IGESData_GlobalSection.hxx @@ -40,20 +40,36 @@ class gp_XYZ; //! From 5.3, one more : ApplicationProtocol (optional) class IGESData_GlobalSection { -public: + public: DEFINE_STANDARD_ALLOC - //! Creates an empty GlobalSection, ready to be filled, //! Warning : No default value is provided - Standard_EXPORT IGESData_GlobalSection(); + IGESData_GlobalSection() + : theSeparator(','), + theEndMark(';'), + theIntegerBits(32), + theMaxPower10Single(38), + theMaxDigitsSingle(6), + theMaxPower10Double(308), + theMaxDigitsDouble(15), + theScale(1.), + theUnitFlag(0), + theLineWeightGrad(1), + theMaxLineWeight(0.), + theResolution(0.), + theMaxCoord(0.), + hasMaxCoord(Standard_False), + theIGESVersion(11), + theDraftingStandard(0) + {} //! Fills GlobalSection from a ParamSet (i.e. taken from file) //! undefined parameters do not change default values when defined //! Fills Check about Corrections or Fails Standard_EXPORT void Init (const Handle(Interface_ParamSet)& params, Handle(Interface_Check)& ach); - + //! Copies data referenced by Handle (that is, Strings) //! usefull to "isolate" a GlobalSection after copy by "=" //! (from a Model to another Model for instance) @@ -63,101 +79,95 @@ public: //! Remark : Strings are given under Hollerith form Standard_EXPORT Handle(Interface_ParamSet) Params() const; - //! Returns a string withpout its Hollerith marks (nnnH ahead). - //! Remark : all strings stored in GlobalSection are expurged - //! from Hollerith informations (without nnnH) - //! If is not Hollerith form, it is simply copied - Standard_EXPORT Handle(TCollection_HAsciiString) TranslatedFromHollerith (const Handle(TCollection_HAsciiString)& astr) const; - //! Returns the parameter delimiter character. - Standard_EXPORT Standard_Character Separator() const; - + Standard_Character Separator() const { return theSeparator; } + //! Returns the record delimiter character. - Standard_EXPORT Standard_Character EndMark() const; - + Standard_Character EndMark() const { return theEndMark; } + //! Returns the name of the sending system. - Standard_EXPORT Handle(TCollection_HAsciiString) SendName() const; - + const Handle(TCollection_HAsciiString) & SendName() const { return theSendName; } + //! Returns the name of the IGES file. - Standard_EXPORT Handle(TCollection_HAsciiString) FileName() const; - + const Handle(TCollection_HAsciiString) & FileName() const { return theFileName; } + //! Returns the Native System ID of the system that created the IGES file. - Standard_EXPORT Handle(TCollection_HAsciiString) SystemId() const; - + const Handle(TCollection_HAsciiString) & SystemId() const { return theSystemId; } + //! Returns the name of the pre-processor used to write the IGES file. - Standard_EXPORT Handle(TCollection_HAsciiString) InterfaceVersion() const; - + const Handle(TCollection_HAsciiString) & InterfaceVersion() const { return theInterfaceVersion; } + //! Returns the number of binary bits for integer representations. - Standard_EXPORT Standard_Integer IntegerBits() const; - + Standard_Integer IntegerBits() const { return theIntegerBits; } + //! Returns the maximum power of a decimal representation of a //! single-precision floating point number in the sending system. - Standard_EXPORT Standard_Integer MaxPower10Single() const; - - Standard_EXPORT Standard_Integer MaxDigitsSingle() const; - + Standard_Integer MaxPower10Single() const { return theMaxPower10Single; } + + Standard_Integer MaxDigitsSingle() const { return theMaxDigitsSingle; } + //! Returns the maximum power of a decimal representation of a //! double-precision floating point number in the sending system. - Standard_EXPORT Standard_Integer MaxPower10Double() const; - - Standard_EXPORT Standard_Integer MaxDigitsDouble() const; - + Standard_Integer MaxPower10Double() const { return theMaxPower10Double; } + + Standard_Integer MaxDigitsDouble() const { return theMaxDigitsDouble; } + //! Returns the name of the receiving system. - Standard_EXPORT Handle(TCollection_HAsciiString) ReceiveName() const; - + const Handle(TCollection_HAsciiString) & ReceiveName() const { return theReceiveName; } + //! Returns the scale used in the IGES file. - Standard_EXPORT Standard_Real Scale() const; - + Standard_Real Scale() const { return theScale; } + //! Returns the unit flag that was used to write the IGES file. - Standard_EXPORT Standard_Integer UnitFlag() const; - + Standard_Integer UnitFlag() const { return theUnitFlag; } + //! Returns the name of the unit the IGES file was written in. - Standard_EXPORT Handle(TCollection_HAsciiString) UnitName() const; - + const Handle(TCollection_HAsciiString) & UnitName() const { return theUnitName; } + //! Returns the maximum number of line weight gradations. - Standard_EXPORT Standard_Integer LineWeightGrad() const; - + Standard_Integer LineWeightGrad() const { return theLineWeightGrad; } + //! Returns the of maximum line weight width in IGES file units. - Standard_EXPORT Standard_Real MaxLineWeight() const; - + Standard_Real MaxLineWeight() const { return theMaxLineWeight; } + //! Returns the IGES file creation date. - Standard_EXPORT Handle(TCollection_HAsciiString) Date() const; - + const Handle(TCollection_HAsciiString) & Date() const { return theDate; } + //! Returns the resolution used in the IGES file. - Standard_EXPORT Standard_Real Resolution() const; - + Standard_Real Resolution() const { return theResolution; } + //! Returns the approximate maximum coordinate value found in the model. - Standard_EXPORT Standard_Real MaxCoord() const; - + Standard_Real MaxCoord() const { return theMaxCoord; } + //! Returns True if the approximate maximum coordinate value found in //! the model is greater than 0. - Standard_EXPORT Standard_Boolean HasMaxCoord() const; - + Standard_Boolean HasMaxCoord() const { return hasMaxCoord; } + //! Returns the name of the IGES file author. - Standard_EXPORT Handle(TCollection_HAsciiString) AuthorName() const; - + const Handle(TCollection_HAsciiString) & AuthorName() const { return theAuthorName; } + //! Returns the name of the company where the IGES file was written. - Standard_EXPORT Handle(TCollection_HAsciiString) CompanyName() const; - + const Handle(TCollection_HAsciiString) & CompanyName() const { return theCompanyName; } + //! Returns the IGES version that the IGES file was written in. - Standard_EXPORT Standard_Integer IGESVersion() const; - - Standard_EXPORT Standard_Integer DraftingStandard() const; - + Standard_Integer IGESVersion() const { return theIGESVersion; } + + Standard_Integer DraftingStandard() const { return theDraftingStandard; } + //! Returns the date and time when the model was created or last //! modified (for IGES 5.1 and later). - Standard_EXPORT Handle(TCollection_HAsciiString) LastChangeDate() const; - + const Handle(TCollection_HAsciiString) & LastChangeDate() const { return theLastChangeDate; } + //! Returns True if the date and time when the model was created or //! last modified are specified, i.e. not defaulted to NULL. - Standard_EXPORT Standard_Boolean HasLastChangeDate() const; - + Standard_Boolean HasLastChangeDate() const { return (!theLastChangeDate.IsNull()); } + Standard_EXPORT void SetLastChangeDate(); - Standard_EXPORT Handle(TCollection_HAsciiString) ApplicationProtocol() const; - - Standard_EXPORT Standard_Boolean HasApplicationProtocol() const; - + const Handle(TCollection_HAsciiString) & ApplicationProtocol() const { return theAppliProtocol; } + + Standard_Boolean HasApplicationProtocol() const { return !theAppliProtocol.IsNull(); } + //! Returns a string built from year, //! month, day, hour, minute and second values. The form of the //! resulting string is defined as follows: @@ -181,10 +191,10 @@ public: //! meters) that the IGES file was written in. Standard_EXPORT Standard_Real UnitValue() const; - Standard_EXPORT void SetSeparator (const Standard_Character val); - - Standard_EXPORT void SetEndMark (const Standard_Character val); - + void SetSeparator (const Standard_Character val) { theSeparator = val; } + + void SetEndMark (const Standard_Character val) { theEndMark = val; } + Standard_EXPORT void SetSendName (const Handle(TCollection_HAsciiString)& val); Standard_EXPORT void SetFileName (const Handle(TCollection_HAsciiString)& val); @@ -193,31 +203,31 @@ public: Standard_EXPORT void SetInterfaceVersion (const Handle(TCollection_HAsciiString)& val); - Standard_EXPORT void SetIntegerBits (const Standard_Integer val); - - Standard_EXPORT void SetMaxPower10Single (const Standard_Integer val); - - Standard_EXPORT void SetMaxDigitsSingle (const Standard_Integer val); - - Standard_EXPORT void SetMaxPower10Double (const Standard_Integer val); - - Standard_EXPORT void SetMaxDigitsDouble (const Standard_Integer val); - + void SetIntegerBits (const Standard_Integer val) { theIntegerBits = val; } + + void SetMaxPower10Single (const Standard_Integer val) { theMaxPower10Single = val; } + + void SetMaxDigitsSingle (const Standard_Integer val) { theMaxDigitsSingle = val; } + + void SetMaxPower10Double (const Standard_Integer val) { theMaxPower10Double = val; } + + void SetMaxDigitsDouble (const Standard_Integer val) { theMaxDigitsDouble = val; } + Standard_EXPORT void SetReceiveName (const Handle(TCollection_HAsciiString)& val); - Standard_EXPORT void SetScale (const Standard_Real val); - - Standard_EXPORT void SetUnitFlag (const Standard_Integer val); - + void SetScale (const Standard_Real val) { theScale = val; } + + void SetUnitFlag (const Standard_Integer val) { theUnitFlag = val; } + Standard_EXPORT void SetUnitName (const Handle(TCollection_HAsciiString)& val); - Standard_EXPORT void SetLineWeightGrad (const Standard_Integer val); - - Standard_EXPORT void SetMaxLineWeight (const Standard_Real val); - + void SetLineWeightGrad (const Standard_Integer val) { theLineWeightGrad = val; } + + void SetMaxLineWeight (const Standard_Real val) { theMaxLineWeight = val; } + Standard_EXPORT void SetDate (const Handle(TCollection_HAsciiString)& val); - Standard_EXPORT void SetResolution (const Standard_Real val); + void SetResolution (const Standard_Real val) { theResolution = val; } Standard_EXPORT void SetMaxCoord (const Standard_Real val = 0.0); @@ -229,26 +239,21 @@ public: Standard_EXPORT void SetCompanyName (const Handle(TCollection_HAsciiString)& val); - Standard_EXPORT void SetIGESVersion (const Standard_Integer val); - - Standard_EXPORT void SetDraftingStandard (const Standard_Integer val); - + void SetIGESVersion (const Standard_Integer val) { theIGESVersion = val; } + + void SetDraftingStandard (const Standard_Integer val) { theDraftingStandard = val; } + Standard_EXPORT void SetLastChangeDate (const Handle(TCollection_HAsciiString)& val); Standard_EXPORT void SetApplicationProtocol (const Handle(TCollection_HAsciiString)& val); - - - -protected: - - - - - -private: - - + private: + + //! Returns a string withpout its Hollerith marks (nnnH ahead). + //! Remark : all strings stored in GlobalSection are expurged + //! from Hollerith informations (without nnnH) + //! If is not Hollerith form, it is simply copied + Standard_EXPORT Handle(TCollection_HAsciiString) TranslatedFromHollerith (const Handle(TCollection_HAsciiString)& astr) const; Standard_Character theSeparator; Standard_Character theEndMark; @@ -277,14 +282,6 @@ private: Standard_Integer theDraftingStandard; Handle(TCollection_HAsciiString) theLastChangeDate; Handle(TCollection_HAsciiString) theAppliProtocol; - - }; - - - - - - #endif // _IGESData_GlobalSection_HeaderFile diff --git a/src/IGESData/IGESData_HArray1OfIGESEntity.hxx b/src/IGESData/IGESData_HArray1OfIGESEntity.hxx index 66d050ae84..fa7ff8826b 100644 --- a/src/IGESData/IGESData_HArray1OfIGESEntity.hxx +++ b/src/IGESData/IGESData_HArray1OfIGESEntity.hxx @@ -17,11 +17,9 @@ #ifndef IGESData_HArray1OfIGESEntity_HeaderFile #define IGESData_HArray1OfIGESEntity_HeaderFile -#include #include #include DEFINE_HARRAY1(IGESData_HArray1OfIGESEntity, IGESData_Array1OfIGESEntity) - #endif diff --git a/src/IGESData/IGESData_IGESDumper.cxx b/src/IGESData/IGESData_IGESDumper.cxx index 6614427f4d..2c7290de60 100644 --- a/src/IGESData/IGESData_IGESDumper.cxx +++ b/src/IGESData/IGESData_IGESDumper.cxx @@ -19,9 +19,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -31,22 +28,13 @@ #include #include -IGESData_IGESDumper::IGESData_IGESDumper - (const Handle(IGESData_IGESModel)& model, - const Handle(IGESData_Protocol)& protocol) - : thelib (protocol) - { themodel = model; } - - - void IGESData_IGESDumper::PrintDNum - (const Handle(IGESData_IGESEntity)& ent, const Handle(Message_Messenger)& S) const +void IGESData_IGESDumper::PrintDNum (const Handle(IGESData_IGESEntity)& ent, const Handle(Message_Messenger)& S) const { // Affichage garanti sur 12 caracteres 12345/D24689 Standard_Integer num = 0; if (!ent.IsNull()) { if (themodel.IsNull()) S<<" D??? "; else if ( (num = themodel->Number(ent)) == 0) S<<" 0:D?????"; -// Interface_InterfaceError::Raise ("IGESDumper : PrintDNum"); else { S<Number(ent); @@ -68,10 +54,7 @@ IGESData_IGESDumper::IGESData_IGESDumper } } - - void IGESData_IGESDumper::Dump - (const Handle(IGESData_IGESEntity)& ent, const Handle(Message_Messenger)& S, - const Standard_Integer own, const Standard_Integer attached) const +void IGESData_IGESDumper::Dump (const Handle(IGESData_IGESEntity)& ent, const Handle(Message_Messenger)& S, const Standard_Integer own, const Standard_Integer attached) const { Standard_Integer att = attached; Standard_Integer diratt = 1; @@ -123,7 +106,7 @@ IGESData_IGESDumper::IGESData_IGESDumper if (own >= 2) { - if (ent->HasStructure()) + if (!ent->Structure().IsNull()) { S<<"** Structure :"; PrintDNum (ent->Structure(),S); S<<"\n"; } S<<"\n Graphic Attributes\n"; @@ -151,7 +134,7 @@ IGESData_IGESDumper::IGESData_IGESDumper if (own > 3) { S<<"**** Own Data ****\n\n"; - OwnDump(ent,S,own); + ent->OwnDump(*this,S,own); } } @@ -180,19 +163,3 @@ IGESData_IGESDumper::IGESData_IGESDumper if (iasuit) { if (att <= 1) S << "\n"; } S<<"\n**** End of Dump ****\n"<OwnDump(CN,ent,*this,S,own); - else if (themodel.IsNull()) - S <<" **** Dump impossible. Type "<DynamicType()->Name()<Number(ent)<<":D" - <DNum(ent)<<" Type "<DynamicType()->Name()< #include -#include -#include class IGESData_IGESModel; -class Interface_InterfaceError; -class IGESData_Protocol; class IGESData_IGESEntity; class Message_Messenger; @@ -40,18 +36,17 @@ class Message_Messenger; //! from Lists of Associativities and Properties) class IGESData_IGESDumper { -public: + public: DEFINE_STANDARD_ALLOC - //! Returns an IGESDumper ready to work. The IGESModel provides //! the numbering of Entities : as for any InterfaceModel, it //! gives each Entity a number; but for IGESEntities, the "Number //! of Directory Entry" according to the definition of IGES Files, //! is also usefull - Standard_EXPORT IGESData_IGESDumper(const Handle(IGESData_IGESModel)& model, const Handle(IGESData_Protocol)& protocol); - + IGESData_IGESDumper (const Handle(IGESData_IGESModel)& model) : themodel(model) {} + //! Prints onto an output, the "Number of Directory Entry" which //! corresponds to an IGESEntity in the IGESModel, under the form //! "D#nnn" (a Null Handle gives D#0) @@ -63,34 +58,10 @@ public: Standard_EXPORT void PrintShort (const Handle(IGESData_IGESEntity)& ent, const Handle(Message_Messenger)& S) const; Standard_EXPORT void Dump (const Handle(IGESData_IGESEntity)& ent, const Handle(Message_Messenger)& S, const Standard_Integer own, const Standard_Integer attached = -1) const; - - //! Specific Dump for each IGES Entity, call by Dump (just above) - //! is the parameter from Dump - Standard_EXPORT void OwnDump (const Handle(IGESData_IGESEntity)& ent, const Handle(Message_Messenger)& S, const Standard_Integer own) const; - - - - -protected: - - - - - -private: - + private: Handle(IGESData_IGESModel) themodel; - IGESData_SpecificLib thelib; - - }; - - - - - - #endif // _IGESData_IGESDumper_HeaderFile diff --git a/src/IGESData/IGESData_IGESEntity.cxx b/src/IGESData/IGESData_IGESEntity.cxx index e2b43da7d9..81f8821a98 100644 --- a/src/IGESData/IGESData_IGESEntity.cxx +++ b/src/IGESData/IGESData_IGESEntity.cxx @@ -14,14 +14,12 @@ #include #include -#include #include #include #include #include #include #include -#include #include #include #include @@ -31,8 +29,12 @@ #include #include #include -#include #include +#include +#include +#include +#include +#include #include IMPLEMENT_STANDARD_RTTIEXT(IGESData_IGESEntity,MMgt_TShared) @@ -55,9 +57,7 @@ namespace //purpose : Default constructor. //======================================================================= IGESData_IGESEntity::IGESData_IGESEntity() -: theType (0), - theForm (0), - theDefLevel (0), +: theDefLevel (0), theStatusNum (0), theLWeightNum (0), theLWeightVal (0.0), @@ -81,10 +81,8 @@ void IGESData_IGESEntity::Clear () theSubScriptN = 0; theShortLabel.Nullify(); // Autres Valeurs, Listes - theType = theForm = 0; theStatusNum = theLWeightNum = 0; theLWeightVal = 0.; -// theRes1[0] = theRes2[0] = '\0'; theProps.Clear(); theAssocs.Clear(); } @@ -92,36 +90,6 @@ void IGESData_IGESEntity::Clear () // ######################################################################### // .... Definition IGES : Directory Entry .... - IGESData_IGESType IGESData_IGESEntity::IGESType () const - { return IGESData_IGESType(theType,theForm); } - - Standard_Integer IGESData_IGESEntity::TypeNumber () const - { return theType; } - - Standard_Integer IGESData_IGESEntity::FormNumber () const - { return theForm; } - - - Handle(IGESData_IGESEntity) IGESData_IGESEntity::DirFieldEntity - (const Standard_Integer num) const -{ - Handle(IGESData_IGESEntity) ent; - if (num == 3) ent = theStructure; - if (num == 4) ent = theLineFont; - if (num == 5) ent = theLevelList; - if (num == 6) ent = theView; - if (num == 7) ent = theTransf; - if (num == 8) ent = theLabDisplay; - if (num == 13) ent = theColor; - return ent; -} - - Standard_Boolean IGESData_IGESEntity::HasStructure () const - { return (!theStructure.IsNull()); } - - Handle(IGESData_IGESEntity) IGESData_IGESEntity::Structure () const - { return theStructure; } - IGESData_DefType IGESData_IGESEntity::DefLineFont () const { return theDefLineFont.DefType(); } @@ -138,9 +106,6 @@ void IGESData_IGESEntity::Clear () return IGESData_DefNone; } - Standard_Integer IGESData_IGESEntity::Level () const - { return theDefLevel; } - Handle(IGESData_LevelListEntity) IGESData_IGESEntity::LevelList () const { return GetCasted(IGESData_LevelListEntity,theLevelList); } @@ -170,56 +135,43 @@ void IGESData_IGESEntity::Clear () } - Standard_Boolean IGESData_IGESEntity::HasTransf () const - { return (!theTransf.IsNull()); } - - Handle(IGESData_TransfEntity) IGESData_IGESEntity::Transf () const - { return GetCasted(IGESData_TransfEntity,theTransf); } - +Handle(IGESData_TransfEntity) IGESData_IGESEntity::Transf () const +{ return GetCasted(IGESData_TransfEntity,theTransf); } - Standard_Boolean IGESData_IGESEntity::HasLabelDisplay () const - { return (!theLabDisplay.IsNull()); } - Handle(IGESData_LabelDisplayEntity) IGESData_IGESEntity::LabelDisplay - () const - { return GetCasted(IGESData_LabelDisplayEntity,theLabDisplay); } +Handle(IGESData_LabelDisplayEntity) IGESData_IGESEntity::LabelDisplay () const +{ return GetCasted(IGESData_LabelDisplayEntity,theLabDisplay); } // Status : un Integer pour BlankStatus,SubrodinateStatus,USeFlag,HierarchySt. // Decoupage : 4 bits chacun (BlankStatus tout a droite, etc) - Standard_Integer IGESData_IGESEntity::BlankStatus () const - { return (theStatusNum & IGESStatusField); } +Standard_Integer IGESData_IGESEntity::BlankStatus () const +{ return (theStatusNum & IGESStatusField); } - Standard_Integer IGESData_IGESEntity::SubordinateStatus () const - { return ((theStatusNum >> IGESShiftSubord) & IGESStatusField); } +Standard_Integer IGESData_IGESEntity::SubordinateStatus () const +{ return ((theStatusNum >> IGESShiftSubord) & IGESStatusField); } - Standard_Integer IGESData_IGESEntity::UseFlag () const - { return ((theStatusNum >> IGESShiftUse) & IGESStatusField); } +Standard_Integer IGESData_IGESEntity::UseFlag () const +{ return ((theStatusNum >> IGESShiftUse) & IGESStatusField); } - Standard_Integer IGESData_IGESEntity::HierarchyStatus () const - { return ((theStatusNum >> IGESShiftHier) & IGESStatusField); } +Standard_Integer IGESData_IGESEntity::HierarchyStatus () const +{ return ((theStatusNum >> IGESShiftHier) & IGESStatusField); } - Standard_Integer IGESData_IGESEntity::LineWeightNumber () const - { return theLWeightNum; } +IGESData_DefType IGESData_IGESEntity::DefColor () const +{ return theDefColor.DefType(); } - Standard_Real IGESData_IGESEntity::LineWeight () const - { return theLWeightVal; } +Standard_Integer IGESData_IGESEntity::RankColor () const +{ return theDefColor.Value(); } - - IGESData_DefType IGESData_IGESEntity::DefColor () const - { return theDefColor.DefType(); } - - Standard_Integer IGESData_IGESEntity::RankColor () const - { return theDefColor.Value(); } - - Handle(IGESData_ColorEntity) IGESData_IGESEntity::Color () const - { return GetCasted(IGESData_ColorEntity,theColor); } +Handle(IGESData_ColorEntity) IGESData_IGESEntity::Color () const +{ return GetCasted(IGESData_ColorEntity,theColor); } //======================================================================= //function : CResValues //purpose : //======================================================================= + Standard_Boolean IGESData_IGESEntity::CResValues (const Standard_CString res1, const Standard_CString res2) const { @@ -242,60 +194,27 @@ Standard_Boolean IGESData_IGESEntity::CResValues (const Standard_CString res1, return res; } - Standard_Boolean IGESData_IGESEntity::HasShortLabel () const - { return (!theShortLabel.IsNull()); } - - Handle(TCollection_HAsciiString) IGESData_IGESEntity::ShortLabel () const - { return theShortLabel; } - - Standard_Boolean IGESData_IGESEntity::HasSubScriptNumber () const - { return (theSubScriptN >= 0); } // =0 nul mais defini, <0 absent - - Standard_Integer IGESData_IGESEntity::SubScriptNumber () const -{ - if (theSubScriptN < 0) return 0; - return theSubScriptN; -} +Standard_Boolean IGESData_IGESEntity::HasSubScriptNumber () const +{ return (theSubScriptN >= 0); } // =0 nul mais defini, <0 absent // .... (Re)Initialisation du Directory .... - void IGESData_IGESEntity::InitTypeAndForm - (const Standard_Integer typenum, const Standard_Integer formnum) - { theType = typenum; theForm = formnum; } - - void IGESData_IGESEntity::InitDirFieldEntity - (const Standard_Integer num, const Handle(IGESData_IGESEntity)& ent) -{ - if (num == 3) theStructure = ent; - if (num == 4) theLineFont = ent; - if (num == 5) theLevelList = ent; - if (num == 6) theView = ent; - if (num == 7) theTransf = ent; - if (num == 8) theLabDisplay = ent; - if (num == 13) theColor = ent; -} - - void IGESData_IGESEntity::InitTransf - (const Handle(IGESData_TransfEntity)& ent) +void IGESData_IGESEntity::InitTransf (const Handle(IGESData_TransfEntity)& ent) { theTransf = ent; } - void IGESData_IGESEntity::InitView - (const Handle(IGESData_ViewKindEntity)& ent) +void IGESData_IGESEntity::InitView (const Handle(IGESData_ViewKindEntity)& ent) { theView = ent; } - void IGESData_IGESEntity::InitLineFont - (const Handle(IGESData_LineFontEntity)& ent, const Standard_Integer rank) +void IGESData_IGESEntity::InitLineFont (const Handle(IGESData_LineFontEntity)& ent, const Standard_Integer rank) { theDefLineFont.SetRank((ent.IsNull() ? rank : -1)); theLineFont = ent; } - void IGESData_IGESEntity::InitLevel - (const Handle(IGESData_LevelListEntity)& ent, const Standard_Integer val) +void IGESData_IGESEntity::InitLevel (const Handle(IGESData_LevelListEntity)& ent, const Standard_Integer val) { theLevelList = ent; theDefLevel = (ent.IsNull() ? val : -1); } - void IGESData_IGESEntity::InitColor - (const Handle(IGESData_ColorEntity)& ent, const Standard_Integer rank) +void IGESData_IGESEntity::InitColor (const Handle(IGESData_ColorEntity)& ent, const Standard_Integer rank) { theDefColor.SetRank((ent.IsNull() ? rank : -1)); theColor = ent; } - void IGESData_IGESEntity::InitStatus +void IGESData_IGESEntity::InitStatus (const Standard_Integer blank, const Standard_Integer subordinate, const Standard_Integer useflag, const Standard_Integer hierarchy) { @@ -306,11 +225,7 @@ Standard_Boolean IGESData_IGESEntity::CResValues (const Standard_CString res1, ((hierarchy & IGESStatusField) << IGESShiftHier); } - void IGESData_IGESEntity::SetLabel - (const Handle(TCollection_HAsciiString)& label, const Standard_Integer sub) -{ theShortLabel = label; theSubScriptN = sub; } - - void IGESData_IGESEntity::InitMisc +void IGESData_IGESEntity::InitMisc (const Handle(IGESData_IGESEntity)& str, const Handle(IGESData_LabelDisplayEntity)& lab, const Standard_Integer weightnum) @@ -347,9 +262,6 @@ Standard_Boolean IGESData_IGESEntity::CResValues (const Standard_CString res1, gp_GTrsf IGESData_IGESEntity::Location () const { - //szv#4:S4163:12Mar99 unreachcble eliminated - //if (!HasTransf()) return gp_GTrsf(); // Identite - //else return Transf()->Value(); // c-a-d Compoound if (!HasTransf()) return gp_GTrsf(); // Identite Handle(IGESData_TransfEntity) trsf = Transf(); return (trsf.IsNull())? gp_GTrsf() : trsf->Value(); @@ -410,100 +322,525 @@ Handle(TCollection_HAsciiString) IGESData_IGESEntity::NameValue () const return (theStatusNum & IGESFlagAssocs) != 0; } - Standard_Integer IGESData_IGESEntity::NbAssociativities () const +Standard_Integer IGESData_IGESEntity::NbAssociativities () const { - if (theAssocs.IsEmpty()) return 0; - return theAssocs.NbEntities(); + return (theAssocs.IsEmpty()? 0 : theAssocs.NbEntities()); } - Interface_EntityIterator IGESData_IGESEntity::Associativities () const +Interface_EntityIterator IGESData_IGESEntity::Associativities () const { Interface_EntityIterator iter; theAssocs.FillIterator(iter); return iter; } - Standard_Integer IGESData_IGESEntity::NbTypedAssociativities - (const Handle(Standard_Type)& atype) const - { return theAssocs.NbTypedEntities(atype); } +Standard_Integer IGESData_IGESEntity::NbTypedAssociativities (const Handle(Standard_Type)& atype) const +{ return theAssocs.NbTypedEntities(atype); } - Handle(IGESData_IGESEntity) IGESData_IGESEntity::TypedAssociativity - (const Handle(Standard_Type)& atype) const +Handle(IGESData_IGESEntity) IGESData_IGESEntity::TypedAssociativity (const Handle(Standard_Type)& atype) const { return GetCasted(IGESData_IGESEntity,theAssocs.TypedEntity(atype)); } - void IGESData_IGESEntity::AddAssociativity - (const Handle(IGESData_IGESEntity)& ent) - { theAssocs.Append(ent); } - - void IGESData_IGESEntity::RemoveAssociativity - (const Handle(IGESData_IGESEntity)& ent) - { theAssocs.Remove(ent); } - - void IGESData_IGESEntity::LoadAssociativities - (const Interface_EntityList& list) - { theAssocs = list; theStatusNum = (theStatusNum | IGESFlagAssocs); } - - void IGESData_IGESEntity::ClearAssociativities () - { theAssocs.Clear(); } - - void IGESData_IGESEntity::Associate - (const Handle(IGESData_IGESEntity)& ent) const - { if (!ent.IsNull()) ent->AddAssociativity(ThisEntity); } - - void IGESData_IGESEntity::Dissociate - (const Handle(IGESData_IGESEntity)& ent) const - { if (!ent.IsNull()) ent->RemoveAssociativity(ThisEntity); } +void IGESData_IGESEntity::Associate (const Handle(IGESData_IGESEntity)& ent) const +{ + if (!ent.IsNull()) { + Handle(IGESData_IGESEntity) aThis(this); + ent->theAssocs.Append(aThis); + } +} +void IGESData_IGESEntity::Dissociate (const Handle(IGESData_IGESEntity)& ent) const +{ + if (!ent.IsNull()) { + Handle(IGESData_IGESEntity) aThis(this); + ent->theAssocs.Remove(aThis); + } +} - Standard_Boolean IGESData_IGESEntity::ArePresentProperties () const +Standard_Boolean IGESData_IGESEntity::ArePresentProperties () const { if (!theProps.IsEmpty()) return Standard_True; return (theStatusNum & IGESFlagProps) != 0; } - Standard_Integer IGESData_IGESEntity::NbProperties () const +Standard_Integer IGESData_IGESEntity::NbProperties () const { - if (theProps.IsEmpty()) return 0; - return theProps.NbEntities(); + return (theProps.IsEmpty()? 0 : theProps.NbEntities()); } - Interface_EntityIterator IGESData_IGESEntity::Properties () const +Interface_EntityIterator IGESData_IGESEntity::Properties () const { Interface_EntityIterator iter; theProps.FillIterator(iter); return iter; } - Standard_Integer IGESData_IGESEntity::NbTypedProperties - (const Handle(Standard_Type)& atype) const - { return theProps.NbTypedEntities(atype); } +Standard_Integer IGESData_IGESEntity::NbTypedProperties (const Handle(Standard_Type)& atype) const +{ return theProps.NbTypedEntities(atype); } - Handle(IGESData_IGESEntity) IGESData_IGESEntity::TypedProperty - (const Handle(Standard_Type)& atype, const Standard_Integer anum) const +Handle(IGESData_IGESEntity) IGESData_IGESEntity::TypedProperty (const Handle(Standard_Type)& atype, const Standard_Integer anum) const { return GetCasted(IGESData_IGESEntity,theProps.TypedEntity(atype, anum)); } - void IGESData_IGESEntity::AddProperty - (const Handle(IGESData_IGESEntity)& ent) - { theProps.Append(ent); } - - void IGESData_IGESEntity::RemoveProperty - (const Handle(IGESData_IGESEntity)& ent) - { theProps.Remove(ent); } - - void IGESData_IGESEntity::LoadProperties - (const Interface_EntityList& list) - { theProps = list; theStatusNum = (theStatusNum | IGESFlagProps); } +void IGESData_IGESEntity::AddProperty (const Handle(IGESData_IGESEntity)& ent) +{ theProps.Append(ent); } - void IGESData_IGESEntity::ClearProperties () - { theProps.Clear(); } +void IGESData_IGESEntity::RemoveProperty (const Handle(IGESData_IGESEntity)& ent) +{ theProps.Remove(ent); } // .... Actions liees au Transfert .... - void IGESData_IGESEntity::SetLineWeight - (const Standard_Real defw, const Standard_Real maxw, - const Standard_Integer gradw) +void IGESData_IGESEntity::SetLineWeight (const Standard_Real defw, const Standard_Real maxw, const Standard_Integer gradw) { if (theLWeightNum == 0) theLWeightVal = defw; else if (gradw == 1) theLWeightVal = maxw*theLWeightNum; else theLWeightVal = (maxw*theLWeightNum)/gradw; } + +//======================================================================= +//function : OwnRead +//purpose : +//======================================================================= + +#include +#include +#include +#include +#include + +Standard_Boolean IGESData_IGESEntity::OwnRead (IGESData_IGESReaderTool &theReader) +{ + const Standard_Integer entity_number = theReader.EntityNumber(); + + Handle(IGESData_IGESReaderData) IR = theReader.ReaderData(); + + Handle(Interface_Check) &ach = theReader.Check(); + + IGESData_DirPart DP = IR->DirPart(entity_number); // qui le copie ... + +// UndefinedEntity : une pre-analyse est faite + DeclareAndCast(IGESData_UndefinedEntity,undent,this); + /*szv_c1:if (!undent.IsNull()) + undent->ReadDir (igesdat,DP,ach);*/ + + //! Reads directory part componants from file; DP is the litteral + //! directory part, IR detains entities referenced by DP + Standard_Integer v[17]; + Standard_Character nom[9], snum[9], theRes1[9], theRes2[9]; + + DP.Values(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11], + v[12],v[13],v[14],v[15],v[16],theRes1,theRes2,nom,snum); + + //s1:this->InitTypeAndForm (v[0] , v[16]); + + Handle(IGESData_IGESEntity) fieldent, Structure, fieldlab; + if (v[2] < 0) Structure = GetCasted(IGESData_IGESEntity,IR->BoundEntity( (1-v[2])/2 )); + + Handle(IGESData_LineFontEntity) Lnf; + if (v[3] < 0) { + fieldent = GetCasted(IGESData_IGESEntity, IR->BoundEntity( (1-v[3])/2 )); + Lnf = GetCasted(IGESData_LineFontEntity, fieldent); + if (Lnf.IsNull()) { + // Sending of message : Incorrect Line Font Pattern + Message_Msg Msg29 ("XSTEP_29"); + Msg29.Arg(entity_number); + Msg29.Arg(TypeNumber()); + ach->SendWarning(Msg29); + this->theLineFont = fieldent; + } + else InitLineFont (Lnf); + } + else InitLineFont(Lnf,v[3]); // ici Lnf Null + + Handle(IGESData_LevelListEntity) Lvs; + if (v[4] < 0) { + fieldent = GetCasted(IGESData_IGESEntity, IR->BoundEntity( (1-v[4])/2 )); + Lvs = GetCasted(IGESData_LevelListEntity, fieldent); + if (Lvs.IsNull()) { + // Sending of message : Incorrect Line Font Pattern + Message_Msg Msg30 ("XSTEP_30"); + Msg30.Arg(entity_number); + Msg30.Arg(TypeNumber()); + ach->SendWarning(Msg30); + this->theLevelList = fieldent; + } + else InitLevel(Lvs,-1); + } + else InitLevel(Lvs,v[4]); // ici Lvs Null + + if (v[5] != 0) { + fieldent = GetCasted(IGESData_IGESEntity,IR->BoundEntity( (1+v[5])/2 )); + DeclareAndCast(IGESData_ViewKindEntity,View,fieldent); + if (View.IsNull()) { + // Sending of message : Incorrect View + Message_Msg Msg31 ("XSTEP_31"); + Msg31.Arg(entity_number); + Msg31.Arg(TypeNumber()); + ach->SendWarning(Msg31); + this->theView = fieldent; + } + else this->InitView(View); + } + + if (v[6] != 0) { + fieldent = GetCasted(IGESData_IGESEntity,IR->BoundEntity( (1+v[6])/2 )); + DeclareAndCast(IGESData_TransfEntity,Transf,fieldent); + if (Transf.IsNull()) { + // Sending of message : Incorrect Transformation Matrix + Message_Msg Msg32 ("XSTEP_32"); + Msg32.Arg(entity_number); + Msg32.Arg(TypeNumber()); + ach->SendWarning(Msg32); + this->theTransf = fieldent; + } + else this->InitTransf(Transf); + } + + Handle(IGESData_LabelDisplayEntity) Lbd; + if (v[7] != 0) { + fieldlab = GetCasted(IGESData_IGESEntity,IR->BoundEntity( (1+v[7])/2 )); + Lbd = GetCasted(IGESData_LabelDisplayEntity,fieldent); + if (Lbd.IsNull()) { + // Sending of message : Incorrect Label Display + Message_Msg Msg33 ("XSTEP_33"); + Msg33.Arg(entity_number); + Msg33.Arg(this->TypeNumber()); + ach->SendWarning(Msg33); + } + } + + this->InitStatus (v[8] , v[9] , v[10] , v[11]); + + Standard_Integer LWeightNum = v[13]; + + Handle(IGESData_ColorEntity) Color; + if (v[14] < 0) { + fieldent = GetCasted(IGESData_IGESEntity,IR->BoundEntity( (1-v[14])/2 )); + Color = GetCasted(IGESData_ColorEntity, fieldent); + if (Color.IsNull()) { + // Sending of message : Incorrect Color Number + Message_Msg Msg34 ("XSTEP_34"); + Msg34.Arg(entity_number); + Msg34.Arg(this->TypeNumber()); + ach->SendWarning(Msg34); + this->theColor = fieldent; + } + else this->InitColor(Color); + } + else this->InitColor(Color,v[14]); + + this->InitMisc (Structure,Lbd,LWeightNum); + this->theLabDisplay = fieldlab; + +// ignores : 1(type),2(ptrPsect),13(type),16(lignesPsect),17(form) +// type et forme sont lus directement du DirPart; autres infos recalculees + +// Restent a analyser nom (short label) et snum (subscript number) + Handle(TCollection_HAsciiString) ShortLabel; + Standard_Integer SubScriptN = -1; + Standard_Integer iacar = 0; + Standard_Integer i; // svv Jan11 2000 : porting on DEC + for (i = 0; i < 8; i ++) { if (nom[i] > ' ') iacar = 1; } + if (iacar > 0) ShortLabel = new TCollection_HAsciiString(nom); + iacar = 0; + for (i = 0; i < 8; i ++) + { if (snum[i] > ' ') iacar = 1; if(snum[i] == 0) break; } + if (iacar > 0) SubScriptN = atoi(snum); + this->SetLabel(ShortLabel,SubScriptN); + +// Enfin, SetLineWeight, tenant compte du defaut + SetLineWeight (IR->DefaultLineWeight(),theReader.MaxWeight(),theReader.GradWeight()); + +// Liste de Parametres : controle de son entete + const Standard_Integer nbpar = IR->NbParams(entity_number); + const Standard_Integer n0par = (entity_number == 1 ? 1 : (IR->ParamFirstRank(entity_number-1) +1)); + if (nbpar < 1) { +// Liste vide non admise, sauf si Undefined (par exemple type nul) + if (!undent.IsNull()) return Standard_True; + // Sending of message : DE : no parameter + Message_Msg Msg27 ("XSTEP_27"); + Msg27.Arg(entity_number); + ach->SendFail(Msg27); + return Standard_False; + } + + Handle(Interface_ParamList) thelist = IR->Params(); + const Interface_FileParameter& FP = thelist->Value(n0par); + if ((FP.ParamType() != Interface_ParamInteger) || (atoi(FP.CValue()) != this->TypeNumber())) + { + // Sending of message : DE : Incorrect type + Message_Msg Msg28 ("XSTEP_28"); + Msg28.Arg(entity_number); + ach->SendFail(Msg28); + return Standard_False; + } + + IGESData_ParamReader PR (thelist,ach,n0par,nbpar,entity_number); + + IGESData_ReadStage thestep; + + OwnReadParams(IR,PR); + + if ((thestep = PR.Stage()) == IGESData_ReadOwn) PR.NextStage(); + if (thestep == IGESData_ReadEnd) { + if (!PR.IsCheckEmpty()) ach = PR.Check(); + return (!ach->HasFailed()); + } + + Standard_Integer ncur, nbp; + + //! Reads Associativity List, if there is (if not, does nothing) + //! criterium is : current parameter of PR remains inside params list, and Stage is "Own" + //! Same conditions as above; in addition, no parameter must be let after the list once read + //! Note that "Associated" entities are not declared "Shared" + //Handle(Interface_Check) ach = new Interface_Check; + Message_Msg Msg37 ("XSTEP_37"); + Msg37.Arg(entity_number); + Msg37.Arg(TypeNumber()); + if (PR.Stage() != IGESData_ReadAssocs) + ach->SendFail(Msg37); + ncur = PR.CurrentNumber(); + nbp = PR.NbParams(); + if (ncur == nbp + 1) PR.EndAll(); + else + { + if (ncur > nbp || ncur == 0) + ach->SendWarning(Msg37); + + if (PR.DefinedElseSkip()) { + Standard_Integer nbassocs = 0; + if (!PR.ReadInteger(nbassocs)) { + Message_Msg Msg220 ("XSTEP_220"); + PR.SendFail(Msg220); + } + else if (nbassocs > 0) { + Interface_EntityList assocs; + if (PR.ReadEntList(IR,PR.CurrentList(nbassocs),Msg37,assocs,Standard_False)) { + theAssocs = assocs; theStatusNum = (theStatusNum | IGESFlagAssocs); + } + } + } + } + + if ((thestep = PR.Stage()) == IGESData_ReadAssocs) PR.NextStage(); + if (thestep == IGESData_ReadEnd) { + if (!PR.IsCheckEmpty()) ach = PR.Check(); + return (!ach->HasFailed()); + } + + //! Reads Property List, if there is (if not, does nothing) + //! criterium is : current parameter of PR remains inside params + //! list, and Stage is "Own" + //! Current parameter must be a positive integer, which value + //! gives the length of the list; else, a Fail is produced (into + //! Check of PR) and reading process is stopped + //Handle(Interface_Check) ach = new Interface_Check; + Message_Msg Msg38 ("XSTEP_38"); + Msg38.Arg(entity_number); + Msg38.Arg(this->TypeNumber()); + if (PR.Stage() != IGESData_ReadProps) + ach->SendFail(Msg38); + ncur = PR.CurrentNumber(); + nbp = PR.NbParams(); + if (ncur == nbp + 1) PR.EndAll(); + else { + if (ncur > nbp || ncur == 0) + ach->SendWarning(Msg38); + + if (PR.DefinedElseSkip()) { + PR.SetCurrentNumber(ncur); + Standard_Integer nbprops = 0; + if (!PR.ReadInteger(nbprops)) { + Message_Msg Msg221 ("XSTEP_221"); + PR.SendFail(Msg221); + } + else if (nbprops > 0) { + Interface_EntityList props; + if (PR.ReadEntList(IR,PR.CurrentList(nbprops),Msg38,props,Standard_False)) { + theProps = props; theStatusNum = (theStatusNum | IGESFlagProps); + } + } + } + } + + if (!PR.IsCheckEmpty()) ach = PR.Check(); + return (!ach->HasFailed()); +} + +//======================================================================= +//function : OwnWrite +//purpose : +//======================================================================= + +void IGESData_IGESEntity::OwnWrite (IGESData_IGESWriter &IW) const +{ + OwnWriteParams(IW); +} + +//======================================================================= +//function : DirChecker +//purpose : +//======================================================================= + +IGESData_DirChecker IGESData_IGESEntity::DirChecker () const +{ + return IGESData_DirChecker(); +}; + +//======================================================================= +//function : OwnCheck +//purpose : +//======================================================================= + +void IGESData_IGESEntity::OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &ach) const +{ + IGESData_DirChecker DC = DirChecker(); + + /*if (DC.thetype != 0) + { + // Sending of message : Entity Type Number field is incorrect. + if (TypeNumber() != DC.thetype) { + Message_Msg Msg58 ("XSTEP_58"); + ach->SendFail(Msg58); + } + + // Sending of message : Form Number field is incorrect. + if (DC.theform1 <= DC.theform2) { + if (FormNumber() < DC.theform1 || FormNumber() > DC.theform2) { + Message_Msg Msg71 ("XSTEP_71"); + ach->SendFail(Msg71); + } + } + }*/ + + // Sending of message : Structure field is undefined. + if (DC.thestructure == IGESData_DefReference && theStructure.IsNull()) { + Message_Msg Msg59 ("XSTEP_59"); + ach->SendFail (Msg59); + } + + if (DC.thegraphier == -1 || DC.thegraphier == HierarchyStatus()) { } + else + { + IGESData_DefType df = DefLineFont(); + + // Sending of message : Line Font Pattern field is incorrect + if (df == IGESData_ErrorVal || df == IGESData_ErrorRef) { + Message_Msg Msg60 ("XSTEP_60"); + ach->SendFail (Msg60); + } + else if (DC.thelinefont == IGESData_DefValue && df != IGESData_DefValue) { + Message_Msg Msg60 ("XSTEP_60"); + ach->SendWarning (Msg60); + } + + Standard_Integer dlw = LineWeightNumber(); + Message_Msg Msg69 ("XSTEP_69"); + // Sending of message : Line Weight Number is undefined. + if (DC.thelineweig == IGESData_DefValue && dlw == 0) { + ach->SendWarning (Msg69); + } + + df = DefColor(); + + // Sending of message : Color Number field is incorrect. + if (df == IGESData_ErrorVal || df == IGESData_ErrorRef) { + ach->SendFail (Msg69); + } + else if (DC.thecolor == IGESData_DefValue && df != IGESData_DefValue) { + ach->SendWarning (Msg69); + } + } + + Standard_Integer st = BlankStatus(); + + // Sending of message : Blank Status field is incorrect. + if (st < 0 || st > 1) { + Message_Msg Msg65 ("XSTEP_65"); + ach->SendFail (Msg65); + } + + st = SubordinateStatus(); + + // Sending of message : Subordinate Entity Switch field is incorrect. + if (st < 0 || st > 3) { + Message_Msg Msg66 ("XSTEP_66"); + ach->SendFail(Msg66); + } + + st = UseFlag(); + + // Send of message : Entity Use Flag is incorrect. + if (st < 0 || st > 5) { + Message_Msg Msg67 ("XSTEP_67"); + ach->SendFail(Msg67); + } + + st = HierarchyStatus(); + + //Sending of message : Hierarchy field is incorrect. + if (st < 0 || st > 2) { + Message_Msg Msg68 ("XSTEP_68"); + ach->SendFail(Msg68); + } +} + +//======================================================================= +//function : OwnCorrect +//purpose : +//======================================================================= + +Standard_Boolean IGESData_IGESEntity::OwnCorrect () +{ + IGESData_DirChecker DC = DirChecker(); + + Standard_Boolean done = Standard_False; + /*Standard_Integer type = TypeNumber(); + Standard_Integer form = FormNumber(); + if (DC.thetype != 0) + { + if (DC.theform1 >= 0 && DC.theform1 == DC.theform2 && DC.theform1 != form) + { + InitTypeAndForm (DC.thetype,DC.theform1); done = Standard_True; + } + else if (DC.thetype != type) + { + InitTypeAndForm (DC.thetype,form); done = Standard_True; + } + }*/ + + Handle(IGESData_IGESEntity) structure; // par defaut Nulle + if (DC.thestructure != IGESData_DefVoid) structure = Structure(); + Handle(IGESData_ViewKindEntity) nulview; + Handle(IGESData_LineFontEntity) nulfont; + Handle(IGESData_LevelListEntity) nulevel; + Handle(IGESData_ColorEntity) nulcolor; + Handle(IGESData_LabelDisplayEntity) label; // par defaut Nulle + if (DC.thegraphier != -1) label = LabelDisplay(); + Standard_Integer linew = 0; + if (DC.thegraphier != -1 && DC.thelineweig != IGESData_DefVoid) + linew = LineWeightNumber(); + + if (DC.thegraphier == -1 || (RankLineFont() != 0 && DC.thelinefont == IGESData_DefVoid) ) + { InitLineFont(nulfont); done = Standard_True; } + if (DC.thegraphier == -1 || (RankColor() != 0 && DC.thecolor == IGESData_DefVoid) ) + { InitColor(nulcolor); done = Standard_True; } + if (DC.thegraphier == -1 && (!View().IsNull() || Level() != 0) ) + { InitView(nulview); InitLevel(nulevel); done = Standard_True; } + if ((DC.thegraphier == -1 && (!LabelDisplay().IsNull() || LineWeightNumber() != 0)) || (!theStructure.IsNull() && DC.thestructure == IGESData_DefVoid) ) // combines : + { InitMisc (structure,label,linew); done = Standard_True; } + + Standard_Boolean force = Standard_False; + Standard_Integer stb = BlankStatus(); + Standard_Integer sts = SubordinateStatus(); + Standard_Integer stu = UseFlag(); + Standard_Integer sth = HierarchyStatus(); + if (DC.theblankst >= 0 && DC.theblankst != stb) + { force = Standard_True; stb = DC.theblankst; } + if (DC.thesubordst >= 0 && DC.thesubordst != sts) + { force = Standard_True; sts = DC.thesubordst; } + if (DC.theuseflag >= 0 && DC.theuseflag != stu) + { force = Standard_True; stu = DC.theuseflag; } + if (DC.thehierst >= 0 && DC.thehierst != sth) + { force = Standard_True; sth = DC.thehierst; } + if (force) { InitStatus(stb,sts,stu,sth); done = Standard_True; } + return done; +} diff --git a/src/IGESData/IGESData_IGESEntity.hxx b/src/IGESData/IGESData_IGESEntity.hxx index 6d19c31175..a846230f5a 100644 --- a/src/IGESData/IGESData_IGESEntity.hxx +++ b/src/IGESData/IGESData_IGESEntity.hxx @@ -24,18 +24,22 @@ #include #include #include +#include #include #include #include class TCollection_HAsciiString; class Interface_InterfaceError; -class IGESData_ReadWriteModule; class IGESData_GeneralModule; +class IGESData_IGESDumper; +class IGESFile_Reader; class IGESData_IGESReaderTool; +class IGESData_IGESWriter; +class IGESData_DirPart; class IGESData_DirChecker; -class IGESData_IGESType; class IGESData_LineFontEntity; class IGESData_LevelListEntity; +class IGESData_ParamReader; class IGESData_ViewKindEntity; class IGESData_TransfEntity; class IGESData_LabelDisplayEntity; @@ -43,6 +47,7 @@ class IGESData_ColorEntity; class gp_GTrsf; class Interface_EntityIterator; class Interface_EntityList; +class Message_Messenger; class IGESData_IGESEntity; @@ -54,32 +59,38 @@ class IGESData_IGESEntity : public MMgt_TShared { public: - //! gives IGES typing info (includes "Type" and "Form" data) - Standard_EXPORT IGESData_IGESType IGESType() const; - //! gives IGES Type Number (often coupled with Form Number) - Standard_EXPORT Standard_Integer TypeNumber() const; - - //! Returns the form number for that - //! type of an IGES entity. The default form number is 0. - Standard_EXPORT Standard_Integer FormNumber() const; - + Standard_EXPORT virtual Standard_Integer TypeNumber() const { return 0; }// { return theType; } + + //! Returns the form number for that type of an IGES entity. + //! The default form number is 0. + Standard_EXPORT virtual Standard_Integer FormNumber() const { return 0; }//theForm; } + //! Returns the Entity which has been recorded for a given //! Field Number, i.e. without any cast. Maps with : //! 3 : Structure 4 : LineFont 5 : LevelList 6 : View //! 7 : Transf(ormation Matrix) 8 : LabelDisplay //! 13 : Color. Other values give a null handle //! It can then be of any kind, while specific items have a Type - Standard_EXPORT Handle(IGESData_IGESEntity) DirFieldEntity (const Standard_Integer fieldnum) const; - - //! returns True if an IGESEntity is defined with a Structure - //! (it is normally reserved for certain classes, such as Macros) - Standard_EXPORT Standard_Boolean HasStructure() const; - + Handle(IGESData_IGESEntity) DirFieldEntity (const Standard_Integer fieldnum) const + { + switch (fieldnum) { + case 3: return theStructure; + case 4: return theLineFont; + case 5: return theLevelList; + case 6: return theView; + case 7: return theTransf; + case 8: return theLabDisplay; + case 13: return theColor; + default: break; + } + return NULL; + } + //! Returns Structure (used by some types of IGES Entities only) //! Returns a Null Handle if Structure is not defined - Standard_EXPORT Handle(IGESData_IGESEntity) Structure() const; - + const Handle(IGESData_IGESEntity) & Structure() const { return theStructure; } + //! Returns the definition status of LineFont Standard_EXPORT virtual IGESData_DefType DefLineFont() const; @@ -96,8 +107,8 @@ class IGESData_IGESEntity : public MMgt_TShared //! Returns the level the entity //! belongs to. Returns -1 if the entity belongs to more than one level. - Standard_EXPORT Standard_Integer Level() const; - + Standard_Integer Level() const { return theDefLevel; } + //! Returns LevelList if Level is //! defined as a list. Returns a null handle if DefLevel is not DefSeveral. Standard_EXPORT Handle(IGESData_LevelListEntity) LevelList() const; @@ -110,7 +121,7 @@ class IGESData_IGESEntity : public MMgt_TShared //! This view can be a single view or a list of views. //! Warning A null handle is returned if the view is not defined. Standard_EXPORT Handle(IGESData_ViewKindEntity) View() const; - + //! Returns the view as a single view //! if it was defined as such and not as a list of views. //! Warning A null handle is returned if DefView does not have the value DefOne. @@ -122,16 +133,16 @@ class IGESData_IGESEntity : public MMgt_TShared Standard_EXPORT Handle(IGESData_ViewKindEntity) ViewList() const; //! Returns True if a Transformation Matrix is defined - Standard_EXPORT Standard_Boolean HasTransf() const; - + Standard_Boolean HasTransf() const { return (!theTransf.IsNull()); } + //! Returns the Transformation Matrix (under IGES definition) //! Returns a Null Handle if there is none //! for a more complete use, see Location & CompoundLocation Standard_EXPORT Handle(IGESData_TransfEntity) Transf() const; //! Returns True if a LabelDisplay mode is defined for this entity - Standard_EXPORT Standard_Boolean HasLabelDisplay() const; - + Standard_Boolean HasLabelDisplay() const { return (!theLabDisplay.IsNull()); } + //! Returns the Label Display //! Associativity Entity if there is one. Returns a null handle if there is none. Standard_EXPORT Handle(IGESData_LabelDisplayEntity) LabelDisplay() const; @@ -149,12 +160,12 @@ class IGESData_IGESEntity : public MMgt_TShared Standard_EXPORT Standard_Integer HierarchyStatus() const; //! Returns the LineWeight Number (0 not defined), see also LineWeight - Standard_EXPORT Standard_Integer LineWeightNumber() const; - + Standard_Integer LineWeightNumber() const { return theLWeightNum; } + //! Returns the true Line Weight, computed from LineWeightNumber and //! Global Parameter in the Model by call to SetLineWeight - Standard_EXPORT Standard_Real LineWeight() const; - + Standard_Real LineWeight() const { return theLWeightVal; } + //! Returns the definition status of Color. Standard_EXPORT virtual IGESData_DefType DefColor() const; @@ -177,30 +188,26 @@ class IGESData_IGESEntity : public MMgt_TShared //! Returns true if a short label is defined. //! A short label is a non-blank 8-character string. - Standard_EXPORT Standard_Boolean HasShortLabel() const; - + Standard_Boolean HasShortLabel() const { return (!theShortLabel.IsNull()); } + //! Returns the label value for this IGES entity as a string. //! Warning If the label is blank, this string is null. - Standard_EXPORT Handle(TCollection_HAsciiString) ShortLabel() const; - + const Handle(TCollection_HAsciiString) & ShortLabel() const { return theShortLabel; } + //! Returns true if a subscript number is defined. //! A subscript number is an integer used to identify a label. Standard_EXPORT virtual Standard_Boolean HasSubScriptNumber() const; //! Returns the integer subscript number used to identify this IGES entity. //! Warning 0 is returned if no subscript number is defined for this IGES entity. - Standard_EXPORT Standard_Integer SubScriptNumber() const; - - //! Initializes a directory field as an Entiy of any kind - //! See DirFieldEntity for more details - Standard_EXPORT void InitDirFieldEntity (const Standard_Integer fieldnum, const Handle(IGESData_IGESEntity)& ent); + Standard_Integer SubScriptNumber() const { return (theSubScriptN < 0)? 0 : theSubScriptN; } //! Initializes Transf, or erases it if is given Null Standard_EXPORT void InitTransf (const Handle(IGESData_TransfEntity)& ent); - + //! Initializes View, or erases it if is given Null Standard_EXPORT void InitView (const Handle(IGESData_ViewKindEntity)& ent); - + //! Initializes LineFont : if is not Null, it gives LineFont, //! else gives or erases (if zero) RankLineFont Standard_EXPORT void InitLineFont (const Handle(IGESData_LineFontEntity)& ent, const Standard_Integer rank = 0); @@ -219,8 +226,9 @@ class IGESData_IGESEntity : public MMgt_TShared //! Sets a new Label to an IGES Entity //! If is given, it sets value of SubScriptNumber //! else, SubScriptNumber is erased - Standard_EXPORT void SetLabel (const Handle(TCollection_HAsciiString)& label, const Standard_Integer sub = -1); - + void SetLabel (const Handle(TCollection_HAsciiString)& label, const Standard_Integer sub = -1) + { theShortLabel = label; theSubScriptN = sub; } + //! Initializes various data (those not yet seen above), or erases //! them if they are given as Null (Zero for ) : //! for Structure, for LabelDisplay, and @@ -317,16 +325,32 @@ class IGESData_IGESEntity : public MMgt_TShared //! or sets it to defw (Default) if LineWeightNumber is null Standard_EXPORT void SetLineWeight (const Standard_Real defw, const Standard_Real maxw, const Standard_Integer gradw); -friend class IGESData_ReadWriteModule; friend class IGESData_GeneralModule; friend class IGESData_IGESReaderTool; friend class IGESData_DirChecker; + + //! Reads own parameters + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &); + + //! Writes own parameters + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const; //! Lists the Entities shared by , from its specific (own) parameters Standard_EXPORT virtual void OwnShared(Interface_EntityIterator &) const {} + //! Returns a DirChecker, specific for each type of Entity + //! (identified by its Case Number) : this DirChecker defines + //! constraints which must be respected by the DirectoryPart + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const; + //! Performs Specific Semantic Check - Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const {} + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, const Handle(Interface_Check) &) const; // {} + + //! Performs non-ambiguous Corrections on Entities that support them (AssocGroupType,Hierarchy,Name,SingleParent) + Standard_EXPORT virtual Standard_Boolean OwnCorrect (); // { return Standard_False; } + + //! Dump of Specific Parameters + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const {} DEFINE_STANDARD_RTTIEXT(IGESData_IGESEntity,MMgt_TShared) @@ -335,37 +359,18 @@ friend class IGESData_DirChecker; //! prepares lists of optionnal data, set values to defaults Standard_EXPORT IGESData_IGESEntity(); - //! Initializes Type and Form Numbers to new values. Reserved for - //! special uses - Standard_EXPORT void InitTypeAndForm (const Standard_Integer typenum, const Standard_Integer formnum); - - //! Loads a complete, already loaded, List of Asociativities - //! (used during Read or Copy Operations) - Standard_EXPORT void LoadAssociativities (const Interface_EntityList& list); - - //! Loads a complete, already loaded, List of Properties - //! (used during Read or Copy Operations) - Standard_EXPORT void LoadProperties (const Interface_EntityList& list); - - //! Removes all properties in once - Standard_EXPORT void ClearProperties(); + //! Initializes Type and Form Numbers to new values. Reserved for special uses + //void InitTypeAndForm (const Standard_Integer typenum, const Standard_Integer formnum) + //{ theType = typenum; theForm = formnum; } + void InitTypeAndForm (const Standard_Integer, const Standard_Integer) {} //temporary!!! + + void CheckTypeAndForm(const Handle(Interface_Check) &) {} //temporary!!! private: //! Clears specific IGES data Standard_EXPORT void Clear(); - - //! Adds an Associativity in the list (called by Associate only) - Standard_EXPORT void AddAssociativity (const Handle(IGESData_IGESEntity)& ent); - - //! Removes an Associativity from the list (called by Dissociate) - Standard_EXPORT void RemoveAssociativity (const Handle(IGESData_IGESEntity)& ent); - - //! Removes all associativities in once - Standard_EXPORT void ClearAssociativities(); - Standard_Integer theType; - Standard_Integer theForm; Handle(IGESData_IGESEntity) theStructure; IGESData_DefSwitch theDefLineFont; Handle(IGESData_IGESEntity) theLineFont; diff --git a/src/IGESData/IGESData_IGESModel.cxx b/src/IGESData/IGESData_IGESModel.cxx index a6ca5f8dc9..61a3b72f13 100644 --- a/src/IGESData/IGESData_IGESModel.cxx +++ b/src/IGESData/IGESData_IGESModel.cxx @@ -43,19 +43,6 @@ void IGESData_VerifyDate -//======================================================================= -//function : IGESData_IGESModel -//purpose : -//======================================================================= - -IGESData_IGESModel::IGESData_IGESModel () -{ - thestart = new TColStd_HSequenceOfHAsciiString(); -// thecheckstx = new Interface_Check; -// thechecksem = new Interface_Check; -} - - //======================================================================= //function : ClearHeader //purpose : @@ -77,7 +64,7 @@ void IGESData_IGESModel::ClearHeader () void IGESData_IGESModel::DumpHeader (const Handle(Message_Messenger)& S, const Standard_Integer ) const { - Standard_Integer ns = thestart->Length(); + const Standard_Integer ns = thestart->Length(); S<<"**** Dump of IGES Model , Start and Global Sections ****"< 0) { S << "**** Start Section : "<ToCString()<<"\n"; S << "[13] Scale : " << theheader.Scale()<<"\n"; S << "[14] Unit Flag : " << theheader.UnitFlag(); -// if (Interface_Static::IVal("read.scale.unit") == 1) - //#73 rln 10.03.99 S4135: "read.scale.unit" does not affect GlobalSection -// S << " -> Value (in Meter) = " << theheader.UnitValue() / 1000 <<"\n"; -// else S << " -> Value (in Millimeter) = " << theheader.UnitValue()<<"\n"; //abv 02 Mar 00: no unit parameter in OCC S << " -> Value (in CASCADE units) = " << theheader.UnitValue() <<"\n"; @@ -161,120 +144,12 @@ void IGESData_IGESModel::DumpHeader } -//======================================================================= -//function : StartSection -//purpose : -//======================================================================= - -Handle(TColStd_HSequenceOfHAsciiString) IGESData_IGESModel::StartSection - () const -{ return thestart; } - - -//======================================================================= -//function : NbStartLines -//purpose : -//======================================================================= - -Standard_Integer IGESData_IGESModel::NbStartLines () const -{ return thestart->Length(); } - - -//======================================================================= -//function : StartLine -//purpose : -//======================================================================= - -Standard_CString IGESData_IGESModel::StartLine - (const Standard_Integer num) const -{ - if (num > 0 && num <= thestart->Length()) return - thestart->Value(num)->ToCString(); - return voidline; -} - - -//======================================================================= -//function : ClearStartSection -//purpose : -//======================================================================= - -void IGESData_IGESModel::ClearStartSection () - { thestart->Clear(); } - - void IGESData_IGESModel::SetStartSection - (const Handle(TColStd_HSequenceOfHAsciiString)& list, - const Standard_Boolean copy) -{ - if (copy) { - thestart = new TColStd_HSequenceOfHAsciiString(); - if (list.IsNull()) return; - Standard_Integer i, nb = list->Length(); - for (i = 1; i <= nb; i ++) thestart->Append - (new TCollection_HAsciiString(list->Value(i)->ToCString())); - } - else if (list.IsNull()) thestart = new TColStd_HSequenceOfHAsciiString(); - else thestart = list; -} - - -//======================================================================= -//function : AddStartLine -//purpose : -//======================================================================= - -void IGESData_IGESModel::AddStartLine - (const Standard_CString line, const Standard_Integer atnum) -{ - if (atnum <= 0 || atnum > thestart->Length()) - thestart->Append (new TCollection_HAsciiString(line)); - else thestart->InsertBefore (atnum,new TCollection_HAsciiString(line)); -} - - -//======================================================================= -//function : ApplyStatic -//purpose : -//======================================================================= - -Standard_Boolean IGESData_IGESModel::ApplyStatic - (const Standard_CString param) -{ - if (param[0] == '\0') { - //Standard_Boolean ret = Standard_True; //szv#4:S4163:12Mar99 not needed - ApplyStatic("receiver"); //szv#4:S4163:12Mar99 'ret =' not needed - ApplyStatic("author"); //szv#4:S4163:12Mar99 'ret =' not needed - ApplyStatic("company"); //szv#4:S4163:12Mar99 'ret =' not needed - return Standard_True; - } - - Standard_CString val; - if (param[0] == 'r') { - val = Interface_Static::CVal("write.iges.header.receiver"); - if (!val || val[0] == '\0') return Standard_False; - theheader.SetReceiveName (new TCollection_HAsciiString(val)); - } - if (param[0] == 'a') { - val = Interface_Static::CVal("write.iges.header.author"); - if (!val || val[0] == '\0') return Standard_False; - theheader.SetAuthorName (new TCollection_HAsciiString(val)); - } - if (param[0] == 'c') { - val = Interface_Static::CVal("write.iges.header.company"); - if (!val || val[0] == '\0') return Standard_False; - theheader.SetCompanyName (new TCollection_HAsciiString(val)); - } - return Standard_True; -} - - //======================================================================= //function : Entity //purpose : //======================================================================= -Handle(IGESData_IGESEntity) IGESData_IGESModel::Entity - (const Standard_Integer num) const +Handle(IGESData_IGESEntity) IGESData_IGESModel::Entity (const Standard_Integer num) const { return GetCasted(IGESData_IGESEntity,Value(num)); } @@ -283,8 +158,7 @@ Handle(IGESData_IGESEntity) IGESData_IGESModel::Entity //purpose : //======================================================================= -Standard_Integer IGESData_IGESModel::DNum - (const Handle(IGESData_IGESEntity)& ent) const +Standard_Integer IGESData_IGESModel::DNum (const Handle(IGESData_IGESEntity)& ent) const { Standard_Integer num = Number(ent); if (num == 0) return 0; @@ -301,7 +175,13 @@ void IGESData_IGESModel::GetFromAnother (const Handle(IGESData_IGESModel)& other { theheader = other->GlobalSection(); theheader.CopyRefs(); - SetStartSection (other->StartSection(),Standard_True); + + thestart = new TColStd_HSequenceOfHAsciiString(); + const Handle(TColStd_HSequenceOfHAsciiString)& list = other->thestart; + if (list.IsNull()) return; + Standard_Integer i, nb = list->Length(); + for (i = 1; i <= nb; i ++) thestart->Append + (new TCollection_HAsciiString(list->Value(i)->ToCString())); } @@ -502,22 +382,6 @@ void IGESData_VerifyDate(const Handle(TCollection_HAsciiString)& str, } -//======================================================================= -//function : SetLineWeights -//purpose : -//======================================================================= - -void IGESData_IGESModel::SetLineWeights (const Standard_Real defw) -{ - Standard_Integer nb = NbEntities(); - Standard_Integer lwg = theheader.LineWeightGrad(); - Standard_Real maxw = theheader.MaxLineWeight(); - if (lwg > 0) { maxw = maxw/lwg; lwg = 1; } - for (Standard_Integer i = 1; i <= nb; i ++) - Entity(i)->SetLineWeight(defw,maxw,lwg); -} - - //======================================================================= //function : ClearLabels //purpose : @@ -560,27 +424,6 @@ void IGESData_IGESModel::PrintToLog if (num == 0) S<<"??"; else { S<<" DE : "<<(2*num-1) << " type : " << igesent->TypeNumber(); -// Standard_Integer num2 = igesent->TypeNumber(); - } - } -} - - -//======================================================================= -//function : PrintInfo -//purpose : -//======================================================================= - -void IGESData_IGESModel::PrintInfo - (const Handle(Standard_Transient)& ent, const Handle(Message_Messenger)& S) const -{ - DeclareAndCast(IGESData_IGESEntity,igesent,ent); - if (igesent.IsNull()) S<<"(NOT IGES)"; - else { - Standard_Integer num = Number(ent); - if (num == 0) S<<"??"; - else { - S<<(2*num-1) << "type " << Type(ent)->Name(); } } } diff --git a/src/IGESData/IGESData_IGESModel.hxx b/src/IGESData/IGESData_IGESModel.hxx index fcc9c56d06..ad068eb11d 100644 --- a/src/IGESData/IGESData_IGESModel.hxx +++ b/src/IGESData/IGESData_IGESModel.hxx @@ -55,66 +55,34 @@ DEFINE_STANDARD_HANDLE(IGESData_IGESModel, Interface_InterfaceModel) //! -Terminate class IGESData_IGESModel : public Interface_InterfaceModel { + public: -public: + IGESData_IGESModel() : thestart(new TColStd_HSequenceOfHAsciiString()) {} - - Standard_EXPORT IGESData_IGESModel(); - //! Erases all data specific to IGES file Header (Start + Global) Standard_EXPORT void ClearHeader() Standard_OVERRIDE; - //! Prints the IGES file header - //! (Start and Global Sections) to the log file. The integer - //! parameter is intended to be used as a level indicator but is not used at present. - Standard_EXPORT void DumpHeader (const Handle(Message_Messenger)& S, const Standard_Integer level = 0) const Standard_OVERRIDE; - //! Returns Model's Start Section (list of comment lines) - Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) StartSection() const; - - //! Returns the count of recorded Start Lines - Standard_EXPORT Standard_Integer NbStartLines() const; - - //! Returns a line from the IGES file - //! Start section by specifying its number. An empty string is - //! returned if the number given is out of range, the range being - //! from 1 to NbStartLines. - Standard_EXPORT Standard_CString StartLine (const Standard_Integer num) const; - - //! Clears the IGES file Start Section - Standard_EXPORT void ClearStartSection(); + const Handle(TColStd_HSequenceOfHAsciiString) & StartSection() const { return thestart; } - //! Sets a new Start section from a list of strings. - //! If copy is false, the Start section will be shared. Any - //! modifications made to the strings later on, will have an effect on - //! the Start section. If copy is true (default value), - //! an independent copy of the strings is created and used as - //! the Start section. Any modifications made to the strings - //! later on, will have no effect on the Start section. - Standard_EXPORT void SetStartSection (const Handle(TColStd_HSequenceOfHAsciiString)& list, const Standard_Boolean copy = Standard_True); - - //! Adds a new string to the existing - //! Start section at the end if atnum is 0 or not given, or before - //! atnumth line. - Standard_EXPORT void AddStartLine (const Standard_CString line, const Standard_Integer atnum = 0); + //! Sets a new Start section from a list of strings. The Start section will be shared. + //! Any modifications made to the strings later on, will have an effect on the Start section. + void SetStartSection (const Handle(TColStd_HSequenceOfHAsciiString)& list) + { + if (list.IsNull()) thestart = new TColStd_HSequenceOfHAsciiString(); + else thestart = list; + } //! Returns the Global section of the IGES file. const IGESData_GlobalSection& GlobalSection() const { return theheader; } //! Sets the Global section of the IGES file. void SetGlobalSection (const IGESData_GlobalSection& header) { theheader = header; } - - //! Sets some of the Global section - //! parameters with the values defined by the translation - //! parameters. param may be: - //! - receiver (value read in XSTEP.iges.header.receiver), - //! - author (value read in XSTEP.iges.header.author), - //! - company (value read in XSTEP.iges.header.company). - //! The default value for param is an empty string. - //! Returns True when done and if param is given, False if param is - //! unknown or empty. Note: Set the unit in the IGES - //! file Global section via IGESData class. - Standard_EXPORT Standard_Boolean ApplyStatic (const Standard_CString param = ""); + + //! Prints the IGES file header + //! (Start and Global Sections) to the log file. The integer + //! parameter is intended to be used as a level indicator but is not used at present. + Standard_EXPORT virtual void DumpHeader (const Handle(Message_Messenger)& S, const Standard_Integer level = 0) const Standard_OVERRIDE; //! Returns an IGES entity given by its rank number. Standard_EXPORT Handle(IGESData_IGESEntity) Entity (const Standard_Integer num) const; @@ -131,54 +99,28 @@ public: //! section contains valid data that conforms to the IGES specifications. Standard_EXPORT virtual void VerifyCheck (Handle(Interface_Check)& ach) const Standard_OVERRIDE; - //! Sets LineWeights of contained Entities according header data - //! (MaxLineWeight and LineWeightGrad) or to a default value for - //! undefined weights - Standard_EXPORT void SetLineWeights (const Standard_Real defw); - //! erases specific labels, i.e. does nothing - Standard_EXPORT void ClearLabels() Standard_OVERRIDE; + Standard_EXPORT virtual void ClearLabels() Standard_OVERRIDE; //! Prints label specific to IGES norm for a given entity, i.e. //! its directory entry number (2*Number-1) - Standard_EXPORT void PrintLabel (const Handle(Standard_Transient)& ent, const Handle(Message_Messenger)& S) const Standard_OVERRIDE; + Standard_EXPORT virtual void PrintLabel (const Handle(Standard_Transient)& ent, const Handle(Message_Messenger)& S) const Standard_OVERRIDE; //! Prints label specific to IGES norm for a given -- -- //! entity, i.e. its directory entry number (2*Number-1) //! in the log file format. Standard_EXPORT virtual void PrintToLog (const Handle(Standard_Transient)& ent, const Handle(Message_Messenger)& S) const Standard_OVERRIDE; - //! Prints label specific to IGES norm for a given entity, i.e. - //! its directory entry number (2*Number-1) - Standard_EXPORT void PrintInfo (const Handle(Standard_Transient)& ent, const Handle(Message_Messenger)& S) const; - //! Returns a string with the label attached to a given entity, //! i.e. a string "Dnn" with nn = directory entry number (2*N-1) - Standard_EXPORT Handle(TCollection_HAsciiString) StringLabel (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE; - - - + Standard_EXPORT virtual Handle(TCollection_HAsciiString) StringLabel (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESData_IGESModel,Interface_InterfaceModel) -protected: - - - - -private: - + private: Handle(TColStd_HSequenceOfHAsciiString) thestart; IGESData_GlobalSection theheader; - - }; - - - - - - #endif // _IGESData_IGESModel_HeaderFile diff --git a/src/IGESData/IGESData_IGESReaderData.cxx b/src/IGESData/IGESData_IGESReaderData.cxx index d5ef0b39c2..f20d4f0410 100644 --- a/src/IGESData/IGESData_IGESReaderData.cxx +++ b/src/IGESData/IGESData_IGESReaderData.cxx @@ -27,164 +27,637 @@ #include #include #include +#include +#include +#include -IMPLEMENT_STANDARD_RTTIEXT(IGESData_IGESReaderData,Interface_FileReaderData) +#include -IGESData_IGESReaderData::IGESData_IGESReaderData - (const Standard_Integer nbe, const Standard_Integer nbp) - : Interface_FileReaderData (nbe,nbp) , thectyp (0,0) , thedirs(0,nbe) -{ - thestep = IGESData_ReadDir; thedefw = 0.; - theparh = new Interface_ParamSet(30); - thestar = new TColStd_HSequenceOfHAsciiString(); - thechk = new Interface_Check; -} +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////#include +/* structiges : */ +struct parlist { + struct oneparam *first, *last; + int nbparam; +}; - void IGESData_IGESReaderData::AddStartLine - (const Standard_CString aval) -{ - thestar->Append (new TCollection_HAsciiString(aval)); +struct dirpart { + int typ,poi,pdef,tra,niv,vue,trf,aff,blk,sub,use,her; /* ligne 1 */ + int typ2,epa,col,nbl,form; /* ligne 2 */ + char res1[10],res2[10],nom[10],num[10]; + struct parlist list; /* liste Psect */ + int numpart; /* n0 en Dsect */ +}; + +int igesread (char* nomfic,int lesect[6],int modefnes); + +#ifdef __cplusplus +extern "C" { +#endif + + /* structiges : */ + int iges_lirpart + (int* *tabval,char* *res1,char* *res2,char* *nom,char* *num,int* nbparam); + void iges_stats (int* nbpart, int* nbparam); + void iges_setglobal (); + void iges_nextpart (); + int iges_lirparam (int* typarg,char* *parval); + void iges_finfile (int mode); + struct dirpart *iges_get_curp (void); + void iges_curpart (int dnum); + + void iges_initfile(); + void iges_newparam(int typarg,int longval, char *parval); + void iges_param(int *Pstat,char *ligne,char c_separ,char c_fin,int lonlin); + void iges_Psect(int numsec,char ligne[80]); + + /* MGE 20/07/98 */ + void IGESFile_Check2 (int mode,char * code, int num, char * str); + void IGESFile_Check3 (int mode,char * code); + +#ifdef __cplusplus } +#endif + +/* Definition des types de parametres de l'analyseur de base IGES */ +#define ArgVide 0 +#define ArgQuid 1 +#define ArgChar 2 +#define ArgInt 3 /* Entier non signe : peut evoluer vers Real ou Char */ +#define ArgSign 4 /* Entier signe : peut evoluer vers Real */ +#define ArgReal 5 +#define ArgExp 6 /* Real + lettre E : attendre confirmation */ +#define ArgRexp 7 /* Real + Exposant : se ramene a Real */ +#define ArgMexp 8 /* Real + Exposant INCOMPLET (pas de point decimal) */ - Handle(TColStd_HSequenceOfHAsciiString) IGESData_IGESReaderData::StartSection - () const - { return thestar; } +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////#include - void IGESData_IGESReaderData::AddGlobal - (const Interface_ParamType atype, const Standard_CString aval) +// Correspondance entre types igesread et types Interface_ParamFile ... +static Interface_ParamType LesTypes[10]; + +// decoupage interne pour faciliter les recuperations d erreurs +static Handle(Interface_Check)& checkread() { - theparh->Append(aval,(int)strlen(aval),atype,0); + static Handle(Interface_Check) chrd = new Interface_Check; + return chrd; } - void IGESData_IGESReaderData::SetGlobalSection () - { thehead.Init(theparh,thechk); } - - const IGESData_GlobalSection& IGESData_IGESReaderData::GlobalSection () const - { return thehead; } - - void IGESData_IGESReaderData::SetDirPart - (const Standard_Integer num, - const Standard_Integer i1, const Standard_Integer i2, - const Standard_Integer i3, const Standard_Integer i4, - const Standard_Integer i5, const Standard_Integer i6, - const Standard_Integer i7, const Standard_Integer i8, - const Standard_Integer i9, const Standard_Integer i10, - const Standard_Integer i11, const Standard_Integer i12, - const Standard_Integer i13, const Standard_Integer i14, - const Standard_Integer i15, const Standard_Integer i16, - const Standard_Integer i17, - const Standard_CString res1, const Standard_CString res2, - const Standard_CString label, const Standard_CString subs) +void IGESFile_Check2 (int mode,char * code, int num, char * str) { - IGESData_DirPart& DP = thedirs(num); - DP.Init(i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14, - i15,i16,i17,res1,res2,label,subs); -//// thedirs(num) = DP; // verifier si utile - //InitParams(num); gka optimization memory -} + // MGE 20/07/98 + Message_Msg amsg (code); + amsg.Arg(num); + amsg.Arg(str); + switch (mode) + { + case 0 : checkread()->SendFail (amsg); break; + case 1 : checkread()->SendWarning (amsg); break; + case 2 : checkread()->SendMsg (amsg); break; + default : checkread()->SendMsg (amsg); + } +} - const IGESData_DirPart& IGESData_IGESReaderData::DirPart - (const Standard_Integer num) const - { return thedirs(num); } - - void IGESData_IGESReaderData::DirValues - (const Standard_Integer num, - Standard_Integer& i1, Standard_Integer& i2, Standard_Integer& i3, - Standard_Integer& i4, Standard_Integer& i5, Standard_Integer& i6, - Standard_Integer& i7, Standard_Integer& i8, Standard_Integer& i9, - Standard_Integer& i10, Standard_Integer& i11, Standard_Integer& i12, - Standard_Integer& i13, Standard_Integer& i14, Standard_Integer& i15, - Standard_Integer& i16, Standard_Integer& i17, - Standard_CString& res1, Standard_CString& res2, - Standard_CString& label, Standard_CString& subs) const +void IGESFile_Check3 (int mode,char * code) { - thedirs(num).Values(i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14, - i15,i16,i17,res1,res2,label,subs); + // MGE 20/07/98 + Message_Msg amsg (code); + switch (mode) + { + case 0 : checkread()->SendFail (amsg); break; + case 1 : checkread()->SendWarning (amsg); break; + case 2 : checkread()->SendMsg (amsg); break; + default : checkread()->SendMsg (amsg); + } } - IGESData_IGESType IGESData_IGESReaderData::DirType - (const Standard_Integer num) const - { return thedirs(num).Type(); } +/* Lecture section D + Chaque entite tient sur deux lignes + + Dstat demarre a zero "on lit une nouvelle entite" + et bascule avec un "deuxieme ligne de l'entite" +*/ - Standard_Integer IGESData_IGESReaderData::NbEntities () const - { return thedirs.Upper(); } +/* DECODAGE : parce que scanf ne fait pas vraiment ce qu'il faut */ +/* Utilitaire decodant un nombre en format fixe dans une ligne + Il part de "depuis" inclus (debut ligne = 0) et prend "tant" caracteres + Valeur lue en retour de fonction */ +static bool IGES_decode (const char* theLine, const int theStart, const int theLength, int &theVal) +{ + static const int bases[] = { 1,10,100,1000,10000,100000,1000000, 10000000,100000000,1000000000 }; + const int s = theStart+theLength-1; + theVal = 0; + for (int i = 0; i < theLength; i ++) + { + const char c = theLine[s-i]; + switch (c) { + case ' ': return true; + case '-': theVal = -theVal; + case '+': + case '0': break; + case '1': theVal += 1*bases[i]; break; + case '2': theVal += 2*bases[i]; break; + case '3': theVal += 3*bases[i]; break; + case '4': theVal += 4*bases[i]; break; + case '5': theVal += 5*bases[i]; break; + case '6': theVal += 6*bases[i]; break; + case '7': theVal += 7*bases[i]; break; + case '8': theVal += 8*bases[i]; break; + case '9': theVal += 9*bases[i]; break; + default: return false; + } + } + return true; +} - Standard_Integer IGESData_IGESReaderData::FindNextRecord - (const Standard_Integer num) const +/* Recopie d'une chaine de caracteres de longueur fixe (close par \0) */ +void IGES_copstr (const char *ligne, const int start, const int length, char* dans) { - if (num >= thedirs.Upper()) return 0; - else return (num + 1); + for (int i = 0; i < length; i ++) { dans[i] = ligne[start+i]; } + dans[length] = '\0'; } -// Reference a d'autres entites : c'est a la fois tres simple et problematique -// Tres simple : une reference a une entite est un numero (dans directory list) -// qui vaut (2*N-1) si N est le rang vrai de l'entite -// Problematique : ce numero est un Entier ... rien ne le distingue d'un autre -// D'ou critere : tout entier impair inferieur a 2*NbRecords PEUT etre une -// reference ... C'est a chaque entite de faire ensuite son tri ... -// Attention, une reference peut etre donnee en "Pointeur Negatif" -// N.B.: DirPart non concernes (lecture specifique assuree par IGESEntity) +IMPLEMENT_STANDARD_RTTIEXT(IGESData_IGESReaderData,MMgt_TShared) + +//======================================================================= +//function : Contructor +//purpose : +//======================================================================= - void IGESData_IGESReaderData::SetEntityNumbers () +IGESData_IGESReaderData::IGESData_IGESReaderData () +: theparh (new Interface_ParamSet(30)), + thechk (new Interface_Check), + myFile(NULL) +{} + +//======================================================================= +//function : Read +//purpose : +//======================================================================= + +Standard_Integer IGESData_IGESReaderData::Read (const Standard_CString theFileName, const Standard_Boolean theModeFnes) { -// On essaie de se baser uniquement sur calcul de IGESRead -/* - Standard_Integer nbd = thedirs.Upper(); - for (Standard_Integer i = 1; i <= nbd; i ++) { - Standard_Integer nbp = NbParams(i); - for (Standard_Integer j = 1; j <= nbp; j ++) { - Interface_FileParameter& FP = ChangeParam(i,j); - if (FP.ParamType() == Interface_ParamInteger) { - Standard_Integer val = atoi(FP.CValue()); - if (val > 0) { - if (val != ((val/2) *2) && val < 2*nbd) { // candidat possible - FP.SetEntityNumber((val+1)/2); - } - } else if (val < 0) { - Standard_Integer mval = -val; - if (mval != ((mval/2) *2) && mval < 2*nbd) { // candidat possible - FP.SetEntityNumber((mval+1)/2); - } - } + //==================================== + Message_Msg Msg1("XSTEP_1"); + Message_Msg Msg15("XSTEP_15"); + //==================================== + + // Sending of message : Beginning of the reading + checkread()->SendMsg(Msg1); + + checkread()->Clear(); + //Init() + { + iges_initfile(); + + myModeFnes = theModeFnes; + + myFile = stdin; + if (theFileName[0] != '\0') + myFile = OSD_OpenFile(theFileName,"r"); + if (myFile == NULL) return -1; // File could not be opened + + for (int i = 0; i < sizeof(myBuffer); i++) myBuffer[i] = 0; + + // Prepare variables for start section + Standard_Integer aNbStartLines = 0; + myStartSection = new TColStd_HSequenceOfHAsciiString(); + } + + //int result = igesread((char*)theFileName,lesect,modefnes); + //int igesread (char* nomfic, int lesect[6], int modefnes) + //{ + static const char sects[] = " SGDPT "; + + char str[2]; + int Pstat = 0; char c_separ = ','; char c_fin = ';'; + int aNumLine = 0, numl = 0, i, i0 = 0; + + int lesect[6]; + for (i = 1; i < 6; i++) lesect[i] = 0; + + // Prepare variables for directory section + struct dirpart { + int typ,poi,pdef,tra,niv,vue,trf,aff,blk,sub,use,her; // ligne 1 + int typ2,epa,col,nbl,form; // ligne 2 + char res1[10],res2[10],nom[10],num[10]; + struct parlist list; // liste Psect + int numpart; // n0 en Dsect + } curp_s; + bool isDirLineEnd = false; + + for(;;) { + numl ++; + const Standard_Integer cur_section = ReadLine(aNumLine); + if (cur_section <= 0 || cur_section < i0) { + if (cur_section == 0) break; + // Sending of message : Syntax error + { + str[1] = '\0'; + str[0] = sects[i0]; + IGESFile_Check2 (0,"XSTEP_18",numl,str); + } + + if (i0 == 0) return -1; + lesect[i0] ++; + continue; + } + lesect[i]++; i0 = cur_section; + + if (aNumLine != lesect[i]) { + // Sending of message : Syntax error + str[1] = '\0'; + str[0] = sects[i0]; + IGESFile_Check2 (0,"XSTEP_19",numl,str); + } + + if (cur_section == 1) // Start Section (comm.) + { + // Skip ending spaces + Standard_Integer j = 71; + for (; j >= 0; j--) + if (myBuffer[j] > 32) break; + myBuffer[j+1] = '\0'; + // Add a start section line + if (j >= 0 || myStartSection->Length() > 0) + myStartSection->Append (new TCollection_HAsciiString(myBuffer)); + } + else if (cur_section == 2) // Header (Global sect) + { + iges_setglobal(); + for (;;) { + // Record specific separators + if (lesect[cur_section] == 1) { + int n0 = 0; + if (myBuffer[0] != ',') { c_separ = myBuffer[2]; n0 = 3; } + if (myBuffer[n0+1] != c_separ) { c_fin = myBuffer[n0+3]; } + } + iges_param(&Pstat,myBuffer,c_separ,c_fin,72); + if (Pstat != 2) break; + /* TODO!!!!!!!!!!!!!!!!!!!!!!!!! + char* parval; + int typarg; + while (iges_lirparam(&typarg,&parval) != 0) + theparh->Append(parval,(int)strlen(parval),LesTypes[typarg],0);*/ + } + } + else if (cur_section == 3) // Directory (Dsect) + { + struct dirpart *curp = &curp_s; + if (!isDirLineEnd) { + IGES_decode(myBuffer, 0,8,curp->typ); + IGES_decode(myBuffer, 8,8,curp->poi); + IGES_decode(myBuffer,16,8,curp->pdef); + IGES_decode(myBuffer,24,8,curp->tra); + IGES_decode(myBuffer,32,8,curp->niv); + IGES_decode(myBuffer,40,8,curp->vue); + IGES_decode(myBuffer,48,8,curp->trf); + IGES_decode(myBuffer,56,8,curp->aff); + IGES_decode(myBuffer,64,2,curp->blk); + IGES_decode(myBuffer,66,2,curp->sub); + IGES_decode(myBuffer,68,2,curp->use); + IGES_decode(myBuffer,70,2,curp->her); + isDirLineEnd = true; + } + else { + IGES_decode(myBuffer, 0,8,curp->typ2); + IGES_decode(myBuffer, 8,8,curp->epa); + IGES_decode(myBuffer,16,8,curp->col); + IGES_decode(myBuffer,24,8,curp->nbl); + IGES_decode(myBuffer,32,8,curp->form); + IGES_copstr(myBuffer,40,8,curp->res1); + IGES_copstr(myBuffer,48,8,curp->res2); + IGES_copstr(myBuffer,56,8,curp->nom); + IGES_copstr(myBuffer,64,8,curp->num); + isDirLineEnd = false; + // Send directory to entity - TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + } + } + else if (cur_section == 4) // Parametres (Psect) + { + //iges_Psect(aNumLine,myBuffer); + // Lecture section P : preanalyse + // Extraction du numero D et troncature a 64 caracteres + //void iges_Psect (int numsec, char myBuffer[80]) + const int dnum = atoi(&myBuffer[65]); //directory number + myBuffer[64] = '\0'; + iges_curpart(dnum); + for (;;) { + iges_param(&Pstat,myBuffer,c_separ,c_fin,64); + if (Pstat != 2) break; } } } -*/ + + // Sending of message : No Terminal Section + if (lesect[5] == 0) + IGESFile_Check3 (1, "XSTEP_20"); + + fclose (myFile); + + //return 0; + //} + //if (result != 0) return result; + +// Chargement des resultats dans un IGESReader + + LesTypes[ArgVide] = Interface_ParamVoid; + LesTypes[ArgQuid] = Interface_ParamMisc; + LesTypes[ArgChar] = Interface_ParamText; + LesTypes[ArgInt] = Interface_ParamInteger; + LesTypes[ArgSign] = Interface_ParamInteger; + LesTypes[ArgReal] = Interface_ParamReal; + LesTypes[ArgExp ] = Interface_ParamMisc; // exposant pas termine + LesTypes[ArgRexp] = Interface_ParamReal; // exposant complet + LesTypes[ArgMexp] = Interface_ParamEnum; // exposant mais pas de point + + int nbparts, nbparams; + iges_stats(&nbparts,&nbparams); // et fait les Initialisations necessaires + + //! creates IGESReaderData correctly dimensionned (for arrays) + //! count of entities, that is, half nb of directory lines + //! : count of parameters + { + const int nbe = (lesect[3]+1)/2; + thenumpar = new TColStd_HArray1OfInteger(0,nbe); + thenumpar->Init(0); + theparams = new Interface_ParamSet (nbparams); + + theents = new TColStd_HArray1OfTransient(0,nbe); + thedirs = new IGESData_HArray1OfDirPart(0,nbe); + } + + try { + OCC_CATCH_SIGNALS + + // d abord les start lines (commentaires) + char* parval; + int typarg; + /*while (iges_lirparam(&typarg,&parval) != 0) { + Standard_Integer j; // svv Jan11 2000 : porting on DEC + for (j = 72; j >= 0; j--) + if (parval[j] > 32) break; + parval[j+1] = '\0'; + if (j >= 0 || l > 0) + thestar->Append (new TCollection_HAsciiString(parval)); + l++; + }*/ + // puis la Global Section + iges_setglobal(); + while (iges_lirparam(&typarg,&parval) != 0) + theparh->Append(parval,(int)strlen(parval),LesTypes[typarg],0); + thehead.Init(theparh,thechk); + } // fin essai 1 (global) + catch (Standard_Failure) { + // Sending of message : Internal error during the header reading + const Message_Msg Msg11("XSTEP_11"); + checkread()->SendWarning (Msg11); + } + + if (nbparts > 0) + { + /*static*/ Standard_Integer recupne = 0,recupnp = 0; // pour affichage en cas de pepin + + char *res1, *res2, *nom, *num, *parval; + int *v; int typarg; + int nbparam; + + Standard_Integer nn=0; + int ns; + + try { + OCC_CATCH_SIGNALS + + while ( (ns = iges_lirpart(&v,&res1,&res2,&nom,&num,&nbparam)) != 0) { + nn++; + recupnp = 0; + recupne = (ns+1)/2; // numero entite + thedirs->ChangeValue(recupne).Init(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15],v[16],res1,res2,nom,num); + while (iges_lirparam(&typarg,&parval) != 0) { + recupnp ++; + Standard_Integer nument = 0; + if (typarg == ArgInt || typarg == ArgSign) { + nument = atoi(parval); + if (nument < 0) nument = -nument; + if (nument & 1) nument = (nument+1)/2; + else nument = 0; + } + theparams->Append(parval,-1,LesTypes[typarg],nument); + } + // Record current number of parameters + thenumpar->SetValue(recupne,theparams->NbParams()); + iges_nextpart(); + } + + // Sending of message : Loaded data + } // fin essai 2 (entites) + catch (Standard_Failure) { + // Sending of message : Internal error during the content reading + if (recupnp == 0) { + Message_Msg Msg13("XSTEP_13"); + Msg13.Arg(recupne); + checkread()->SendWarning (Msg13); + } + else { + Message_Msg Msg14("XSTEP_14"); + Msg14.Arg(recupne); + Msg14.Arg(recupnp); + checkread()->SendWarning (Msg14); + } + } + } + + Standard_Integer nbr = NbRecords(); + // Sending of message : Number of total loaded entities + Msg15.Arg(nbr); + checkread()->SendMsg(Msg15); + + iges_finfile(1); + + /* + // A present, le check + // Nb warning in global section. + Standard_Integer nbWarn = checkread()->NbWarnings(), nbFail = checkread()->NbFails(); + if (nbWarn + nbFail > 0) { + const Handle(Interface_Check)& oldglob = amodel->GlobalCheck(); + checkread()->GetMessages (oldglob); + amodel->SetGlobalCheck (checkread()); + } + + checkread()->Trace(0,1); + + iges_finfile(2);*/ + + return 0; } +const IGESData_DirPart & IGESData_IGESReaderData::DirPart (const Standard_Integer num) const +{ return thedirs->Value(num); } -//======================================================================= -//function : GlobalCheck -//purpose : -//======================================================================= +Standard_Integer IGESData_IGESReaderData::NbRecords () const +{ return thedirs->Upper();/*thenumpar.Upper();*/ } -Handle(Interface_Check) IGESData_IGESReaderData::GlobalCheck () const +Standard_Integer IGESData_IGESReaderData::NbEntities () const +{ return thedirs->Upper(); } + +Standard_Integer IGESData_IGESReaderData::FindNextRecord (const Standard_Integer num) const { - return thechk; + return (num >= thedirs->Upper())? 0 : (num + 1); } +Standard_Integer IGESData_IGESReaderData::NbParams (const Standard_Integer num) const +{ + if (num > 1) return (thenumpar->Value(num) - thenumpar->Value(num-1)); + if (num ==1) return thenumpar->Value(num); + return theparams->NbParams(); +} -//======================================================================= -//function : SetDefaultLineWeight -//purpose : -//======================================================================= - -void IGESData_IGESReaderData::SetDefaultLineWeight (const Standard_Real defw) +Standard_EXPORT Handle(Interface_ParamList) IGESData_IGESReaderData::Params () const { - thedefw = defw; + return theparams->Params(0,0); // complet } +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////liriges.c -//======================================================================= -//function : DefaultLineWeight -//purpose : -//======================================================================= +/* A routine to read a line from an IGES File + + This routine returns: + - status (function return): section no .: S, G, D, P, T (for 73) or + 0 (EOF) or -1 (jump stain) + - a line number in the section (numbers 74 to 80) + - the truncated line has 72 characters (0 in the 73rd) + It is necessary to provide it a line buffer reserved to 81 characters +*/ -Standard_Real IGESData_IGESReaderData::DefaultLineWeight () const +Standard_Integer IGESData_IGESReaderData::ReadLine (Standard_Integer &theNumLine) { - return thedefw; + if (theNumLine == 0) + myBuffer[72] = myBuffer[79] = ' '; + + myBuffer[0] = '\0'; + + if (myModeFnes) + { + if (fgets(myBuffer,99,myFile) == NULL) // kept for compatibility with fnes + return 0; + } + else + { + while ( fgets(myBuffer,2,myFile) && ( myBuffer[0] == '\r' || myBuffer[0] == '\n' ) ) + {} + + if (fgets(&myBuffer[1],80,myFile) == NULL) + return 0; + } + + if (theNumLine == 0 && myBuffer[72] != 'S' && myBuffer[79] == ' ') + { + // CASE OF FNES : Skip the first line + myBuffer[0] = '\0'; + + if (myModeFnes) + { + if (fgets(myBuffer,99,myFile) == NULL) // kept for compatibility with fnes + return 0; + } + else + { + while ( fgets(myBuffer,2,myFile) && ( myBuffer[0] == '\r' || myBuffer[0] == '\n' ) ) + {} + + if (fgets(&myBuffer[1],80,myFile) == NULL) + return 0; + } + } + + if (myModeFnes && (myBuffer[0] & 128)) + { + for (int i = 0; i < 80; i ++) + myBuffer[i] = (char)(myBuffer[i] ^ (150 + (i & 3))); + } + + if (feof(myFile)) + return 0; + + {//0x1A is END_OF_FILE for OS DOS and WINDOWS. For other OS we set this rule forcefully. + char *fc = strchr(myBuffer, 0x1A); + if(fc != 0) + { + fc[0] = '\0'; + return 0; + } + } + + if (myBuffer[0] == '\0' || myBuffer[0] == '\n' || myBuffer[0] == '\r') + return ReadLine(theNumLine); + + int i, result; + + if (sscanf(&myBuffer[73],"%d",&result) != 0) + { + theNumLine = result; + char typesec = myBuffer[72]; + switch (typesec) + { + case 'S' : myBuffer[72] = '\0'; return (1); + case 'G' : myBuffer[72] = '\0'; return (2); + case 'D' : myBuffer[72] = '\0'; return (3); + case 'P' : myBuffer[72] = '\0'; return (4); + case 'T' : myBuffer[72] = '\0'; return (5); + default :; + } + // the column 72 is empty, try to check the neighbour + if (strlen(myBuffer)==80 && (myBuffer[79]=='\n' || myBuffer[79]=='\r') && (myBuffer[0]<='9' && myBuffer[0]>='0')) + { + // check if the case of losted + int index; + for(index = 1; myBuffer[index]<='9' && myBuffer[index]>='0'; index++); + if (myBuffer[index]=='D' || myBuffer[index]=='d') { + for(index = 79; index > 0; index--) + myBuffer[index] = myBuffer[index-1]; + myBuffer[0]='.'; + } + char typesec = myBuffer[72]; + switch (typesec) + { + case 'S' : myBuffer[72] = '\0'; return (1); + case 'G' : myBuffer[72] = '\0'; return (2); + case 'D' : myBuffer[72] = '\0'; return (3); + case 'P' : myBuffer[72] = '\0'; return (4); + case 'T' : myBuffer[72] = '\0'; return (5); + default :; + } + } + } + + // the line does not conform to standard, try to read it (if there are some missing spaces) + // find the number end + i = (int)strlen(myBuffer); + while ((myBuffer[i] == '\0' || myBuffer[i] == '\n' || myBuffer[i] == '\r' || myBuffer[i] == ' ') && i > 0) + i--; + if (i != (int)strlen(myBuffer)) + myBuffer[i + 1] = '\0'; + // find the number start + while (myBuffer[i] >= '0' && myBuffer[i] <= '9' && i > 0) + i--; + if (sscanf(&myBuffer[i + 1],"%d",&result) == 0) + return -1; + theNumLine = result; + // find type of line + while (myBuffer[i] == ' ' && i > 0) + i--; + char typesec = myBuffer[i]; + switch (typesec) { + case 'S' : myBuffer[i] = '\0'; return (1); + case 'G' : myBuffer[i] = '\0'; return (2); + case 'D' : myBuffer[i] = '\0'; return (3); + case 'P' : myBuffer[i] = '\0'; return (4); + case 'T' : myBuffer[i] = '\0'; return (5); + default :; + } + return -1; } + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////liriges.c diff --git a/src/IGESData/IGESData_IGESReaderData.hxx b/src/IGESData/IGESData_IGESReaderData.hxx index 71ac9d06dc..8b213b8eeb 100644 --- a/src/IGESData/IGESData_IGESReaderData.hxx +++ b/src/IGESData/IGESData_IGESReaderData.hxx @@ -21,24 +21,25 @@ #include #include +#include +#include #include #include #include -#include -#include -#include -#include -#include +//#include #include +class Interface_ParamList; class Interface_ParamSet; class Interface_Check; class IGESData_GlobalSection; class IGESData_DirPart; class IGESData_IGESType; +#include +DEFINE_HARRAY1(IGESData_HArray1OfDirPart,IGESData_Array1OfDirPart) class IGESData_IGESReaderData; -DEFINE_STANDARD_HANDLE(IGESData_IGESReaderData, Interface_FileReaderData) +DEFINE_STANDARD_HANDLE(IGESData_IGESReaderData, MMgt_TShared) //! specific FileReaderData for IGES //! contains header as GlobalSection, and for each Entity, its @@ -46,101 +47,70 @@ DEFINE_STANDARD_HANDLE(IGESData_IGESReaderData, Interface_FileReaderData) //! Each Item has a DirPart, plus classically a ParamSet and the //! correspondant recognized Entity (inherited from FileReaderData) //! Parameters are accessed through specific objects, ParamReaders -class IGESData_IGESReaderData : public Interface_FileReaderData +class IGESData_IGESReaderData : public MMgt_TShared //Interface_FileReaderData { + public: -public: + //! Default constructor + Standard_EXPORT IGESData_IGESReaderData(); + + Standard_EXPORT Standard_Integer Read (const Standard_CString theFileName, const Standard_Boolean theModeFnes = Standard_False); - - //! creates IGESReaderData correctly dimensionned (for arrays) - //! count of entities, that is, half nb of directory lines - //! : count of parameters - Standard_EXPORT IGESData_IGESReaderData(const Standard_Integer nbe, const Standard_Integer nbp); - - //! adds a start line to start section - Standard_EXPORT void AddStartLine (const Standard_CString aval); - //! Returns the Start Section in once - Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) StartSection() const; - - //! adds a parameter to global section's parameter list - Standard_EXPORT void AddGlobal (const Interface_ParamType atype, const Standard_CString aval); - - //! reads header (as GlobalSection) content from the ParamSet - //! after it has been filled by successive calls to AddGlobal - Standard_EXPORT void SetGlobalSection(); + const Handle(TColStd_HSequenceOfHAsciiString) & StartSection() const { return myStartSection; } //! returns header as GlobalSection - Standard_EXPORT const IGESData_GlobalSection& GlobalSection() const; - - //! fills a DirPart, designated by its rank (that is, (N+1)/2 if N - //! is its first number in section D) - Standard_EXPORT void SetDirPart (const Standard_Integer num, const Standard_Integer i1, const Standard_Integer i2, const Standard_Integer i3, const Standard_Integer i4, const Standard_Integer i5, const Standard_Integer i6, const Standard_Integer i7, const Standard_Integer i8, const Standard_Integer i9, const Standard_Integer i10, const Standard_Integer i11, const Standard_Integer i12, const Standard_Integer i13, const Standard_Integer i14, const Standard_Integer i15, const Standard_Integer i16, const Standard_Integer i17, const Standard_CString res1, const Standard_CString res2, const Standard_CString label, const Standard_CString subs); + const IGESData_GlobalSection & GlobalSection() const { return thehead; } //! returns DirPart identified by record no (half Dsect number) - Standard_EXPORT const IGESData_DirPart& DirPart (const Standard_Integer num) const; - - //! returns values recorded in directory part n0 - Standard_EXPORT void DirValues (const Standard_Integer num, Standard_Integer& i1, Standard_Integer& i2, Standard_Integer& i3, Standard_Integer& i4, Standard_Integer& i5, Standard_Integer& i6, Standard_Integer& i7, Standard_Integer& i8, Standard_Integer& i9, Standard_Integer& i10, Standard_Integer& i11, Standard_Integer& i12, Standard_Integer& i13, Standard_Integer& i14, Standard_Integer& i15, Standard_Integer& i16, Standard_Integer& i17, Standard_CString& res1, Standard_CString& res2, Standard_CString& label, Standard_CString& subs) const; - - //! returns "type" and "form" info from a directory part - Standard_EXPORT IGESData_IGESType DirType (const Standard_Integer num) const; - + const IGESData_DirPart & DirPart (const Standard_Integer num) const; + + Standard_EXPORT virtual Standard_Integer NbRecords () const Standard_OVERRIDE; + //! Returns count of recorded Entities (i.e. size of Directory) Standard_EXPORT virtual Standard_Integer NbEntities() const Standard_OVERRIDE; //! determines next suitable record from num; that is num+1 except //! for last one which gives 0 - Standard_EXPORT Standard_Integer FindNextRecord (const Standard_Integer num) const Standard_OVERRIDE; - - //! determines reference numbers in EntityNumber fields (called by - //! SetEntities from IGESReaderTool) - //! works on "Integer" type Parameters, because IGES does not - //! distinguish Integer and Entity Refs : every Integer which is - //! odd and less than twice NbRecords can be an Entity Ref ... - //! (Ref Number is then (N+1)/2 if N is the Integer Value) - Standard_EXPORT void SetEntityNumbers(); + Standard_EXPORT virtual Standard_Integer FindNextRecord (const Standard_Integer num) const Standard_OVERRIDE; - //! Returns the recorded Global Check - Standard_EXPORT Handle(Interface_Check) GlobalCheck() const; - - //! allows to set a default line weight, will be later applied at - //! load time, on Entities which have no specified line weight - Standard_EXPORT void SetDefaultLineWeight (const Standard_Real defw); - - //! Returns the recorded Default Line Weight, if there is - //! (else, returns 0) - Standard_EXPORT Standard_Real DefaultLineWeight() const; - + const Handle(Standard_Transient)& BoundEntity (const Standard_Integer num) const { return theents->Value(num); } + void BindEntity (const Standard_Integer num, const Handle(Standard_Transient)& ent) { theents->SetValue(num,ent); } + //! Returns count of parameters attached to record "num" + //! If = 0, returns the total recorded count of parameters + Standard_EXPORT Standard_Integer NbParams (const Standard_Integer num) const; - DEFINE_STANDARD_RTTIEXT(IGESData_IGESReaderData,Interface_FileReaderData) + Standard_EXPORT Handle(Interface_ParamList) Params () const; -protected: + Standard_Integer ParamFirstRank (const Standard_Integer num) const { return thenumpar->Value(num); } + //! Returns the recorded Global Check + const Handle(Interface_Check) & GlobalCheck() const { return thechk; } + + //! Returns the recorded Default Line Weight, if there is (else, returns 0) + Standard_Real DefaultLineWeight() const { return 0.; } + DEFINE_STANDARD_RTTIEXT(IGESData_IGESReaderData,MMgt_TShared) + private: -private: + Standard_Integer ReadLine (Standard_Integer &theNumLine); + Handle(Interface_ParamSet) theparams; + Handle(TColStd_HArray1OfInteger) thenumpar; + Handle(TColStd_HArray1OfTransient) theents; - IGESData_IGESType thectyp; - Handle(TColStd_HSequenceOfHAsciiString) thestar; + Handle(TColStd_HSequenceOfHAsciiString) myStartSection; Handle(Interface_ParamSet) theparh; IGESData_GlobalSection thehead; - IGESData_Array1OfDirPart thedirs; - IGESData_ReadStage thestep; - Standard_Real thedefw; + Handle(IGESData_HArray1OfDirPart) thedirs; Handle(Interface_Check) thechk; - + Standard_Boolean myModeFnes; + FILE* myFile; + char myBuffer[100]; }; - - - - - - #endif // _IGESData_IGESReaderData_HeaderFile diff --git a/src/IGESData/IGESData_IGESReaderTool.cxx b/src/IGESData/IGESData_IGESReaderTool.cxx index c60a480efc..bfcf427e79 100644 --- a/src/IGESData/IGESData_IGESReaderTool.cxx +++ b/src/IGESData/IGESData_IGESReaderTool.cxx @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -34,377 +33,278 @@ #include #include #include +#include #include -#include +#include #include +#include +#include +#include +#include +#include #include -// MGE 17/06/98 -// To use Msg class -IGESData_IGESReaderTool::IGESData_IGESReaderTool - (const Handle(IGESData_IGESReaderData)& reader, - const Handle(IGESData_Protocol)& protocol) -: Interface_FileReaderTool(protocol) -{ SetData (reader,protocol); } +//======================================================================= +//function : LoadModel +//purpose : +//======================================================================= -// ########################################################################### -// ######## PREPARATION ######## - -void IGESData_IGESReaderTool::Prepare () +Standard_Integer IGESData_IGESReaderTool::Read (const Standard_CString theFileName, const Handle(IGESData_IGESModel)& amodel, const Standard_Boolean modefnes) { - DeclareAndCast(IGESData_IGESReaderData,igesdat,Data()); - igesdat->SetEntityNumbers(); - SetEntities(); - thelist = igesdat->Params(0); -} + myData = new IGESData_IGESReaderData; //((lesect[3]+1)/2, gNbParams); + int result = myData->Read(theFileName, modefnes); -Standard_Boolean IGESData_IGESReaderTool::Recognize (const Standard_Integer num, Handle(Standard_Transient)& ent) -{ - DeclareAndCast(IGESData_IGESReaderData,igesdat,Data()); - thecnum = num; thectyp = igesdat->DirType(num); - return RecognizeByLib (num,ent); -} + if (result != 0) return result; + LoadModel(amodel); -// ########################################################################### -// ######## LECTURE (Controle General) ######## + if (amodel->Protocol().IsNull()) amodel->SetProtocol (myProtocol); -// (Elements enchaines par la classe de base Interface_FileReaderTool) + /* + // A present, le check + // Nb warning in global section. + Standard_Integer nbWarn = checkread()->NbWarnings(), nbFail = checkread()->NbFails(); + if (nbWarn + nbFail > 0) { + const Handle(Interface_Check)& oldglob = amodel->GlobalCheck(); + checkread()->GetMessages (oldglob); + amodel->SetGlobalCheck (checkread()); + } -void IGESData_IGESReaderTool::BeginRead (const Handle(Interface_InterfaceModel)& amodel) -{ - DeclareAndCast(IGESData_IGESModel,amod,amodel); - DeclareAndCast(IGESData_IGESReaderData,igesdat,Data()); - const IGESData_GlobalSection& gs = igesdat->GlobalSection(); - amod->SetStartSection (igesdat->StartSection(),Standard_False); - amod->SetGlobalSection (gs); - Handle(Interface_Check) glob = amod->GlobalCheck(); - glob->GetMessages (igesdat->GlobalCheck()); - amod->SetGlobalCheck (glob); - themaxweight = gs.MaxLineWeight(); - thegradweight = gs.LineWeightGrad(); - if (thegradweight > 0) - { themaxweight = themaxweight/thegradweight; thegradweight = 1; } - thedefweight = igesdat->DefaultLineWeight(); + checkread()->Trace(0,1); + + iges_finfile(2);*/ + + return 0; } +//======================================================================= +//function : LoadModel +//purpose : +//======================================================================= -// Manquent les procedures de reprise sur erreur en cours de route ... -Standard_Boolean IGESData_IGESReaderTool::AnalyseRecord (const Standard_Integer num, const Handle(Standard_Transient)& anent, Handle(Interface_Check)& ach) +void IGESData_IGESReaderTool::LoadModel (const Handle(Interface_InterfaceModel)& amodel) { - Handle(TCollection_HAsciiString) lab; - - DeclareAndCast(IGESData_IGESEntity,ent,anent); - DeclareAndCast(IGESData_IGESReaderData,igesdat,Data()); + //s1:thelist = thereader->Params(0); -// Demarrage de la lecture : Faire Clear - ent->Clear(); + Standard_Integer numr; + Standard_Integer thenbreps = 0, thenbrep0 = 0; + Handle(TColStd_HArray1OfTransient) thereports; -// UndefinedEntity : une pre-analyse est faite - DeclareAndCast(IGESData_UndefinedEntity,undent,ent); - if (!undent.IsNull()) { - IGESData_DirPart DP = igesdat->DirPart(num); // qui le copie ... - undent->ReadDir (igesdat,DP,ach); // DP a pu etre modifie - ReadDir (ent,igesdat,DP,ach); // Lecture avec ce DP - } - else ReadDir (ent,igesdat,igesdat->DirPart(num),ach); - - thestep = IGESData_ReadDir; - -// Liste de Parametres : controle de son entete -// Handle(Interface_ParamList) list = Data()->Params(num); - Standard_Integer nbpar = Data()->NbParams(num); - Standard_Integer n0par = (num == 1 ? 1 : (Data()->ParamFirstRank(num-1) +1)); - if (nbpar < 1) { -// Liste vide non admise, sauf si Undefined (par exemple type nul) - if (!undent.IsNull()) return Standard_True; - // Sending of message : DE : no parameter - Message_Msg Msg27 ("XSTEP_27"); - Msg27.Arg(thecnum); - ach->SendFail(Msg27); - return Standard_False; - } - const Interface_FileParameter& FP = thelist->Value(n0par); - if ((FP.ParamType() != Interface_ParamInteger) || (atoi(FP.CValue()) != ent->TypeNumber())) - { - // Sending of message : DE : Incorrect type - Message_Msg Msg28 ("XSTEP_28"); - Msg28.Arg(thecnum); - ach->SendFail(Msg28); - return Standard_False; + for (numr = myData->FindNextRecord(0); numr > 0; + numr = myData->FindNextRecord(numr)) + { + Handle(Standard_Transient) newent = myProtocol->NewEntity(myData->DirPart(numr).Type()); + + if (newent.IsNull()) { + newent = myProtocol->UnknownEntity(); + if (thereports.IsNull()) + thereports = new TColStd_HArray1OfTransient (1,myData->NbRecords()); + thenbreps ++; thenbrep0 ++; + thereports->SetValue (numr,new Interface_ReportEntity(newent)); } - - IGESData_ParamReader PR (thelist,ach,n0par,nbpar,num); - thestep = IGESData_ReadOwn; - ReadOwnParams (ent,igesdat,PR); - if ((thestep = PR.Stage()) == IGESData_ReadOwn) PR.NextStage(); - if (thestep == IGESData_ReadEnd) { - if (!PR.IsCheckEmpty()) ach = PR.Check(); - return (!ach->HasFailed()); + myData->BindEntity (numr,newent); } - ReadAssocs (ent,igesdat,PR); - if ((thestep = PR.Stage()) == IGESData_ReadAssocs) PR.NextStage(); - if (thestep == IGESData_ReadEnd) { - if (!PR.IsCheckEmpty()) ach = PR.Check(); - return (!ach->HasFailed()); - } - ReadProps (ent,igesdat,PR); - if (!PR.IsCheckEmpty()) ach = PR.Check(); - return (!ach->HasFailed()); -} + //==================================== + const Handle(Message_Messenger) &TF = Message::DefaultMessenger(); //this->Messenger(); + //==================================== + Handle(Interface_Check) ach = new Interface_Check; + //themodel = amodel; -// ########################################################################### -// ######## UNE ENTITE ######## - -// ######## Directory Part ######## - - void IGESData_IGESReaderTool::ReadDir - (const Handle(IGESData_IGESEntity)& ent, - const Handle(IGESData_IGESReaderData)& IR, - const IGESData_DirPart& DP, Handle(Interface_Check)& ach) const -{ - - Standard_Integer v[17]; - Standard_Character nom[9]; Standard_Character snum[9], theRes1[9],theRes2[9]; - //char mess[50]; //szv#4:S4163:12Mar99 unused - - DP.Values(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11], - v[12],v[13],v[14],v[15],v[16],theRes1,theRes2,nom,snum); - - ent->InitTypeAndForm (v[0] , v[16]); - Handle(IGESData_IGESEntity) fieldent, Structure, fieldlab; - if (v[2] < 0) Structure = GetCasted - (IGESData_IGESEntity, IR->BoundEntity( (1-v[2])/2 )); - - Handle(IGESData_LineFontEntity) Lnf; - if (v[3] < 0) { - fieldent = GetCasted(IGESData_IGESEntity, IR->BoundEntity( (1-v[3])/2 )); - Lnf = GetCasted(IGESData_LineFontEntity, fieldent); - if (Lnf.IsNull()) { - // Sending of message : Incorrect Line Font Pattern - Message_Msg Msg29 ("XSTEP_29"); - Msg29.Arg(thecnum); - Msg29.Arg(thectyp.Type()); - ach->SendWarning(Msg29); - ent->InitDirFieldEntity(4,fieldent); - } - else ent->InitLineFont (Lnf); - } - else ent->InitLineFont(Lnf,v[3]); // ici Lnf Null - - Handle(IGESData_LevelListEntity) Lvs; - if (v[4] < 0) { - fieldent = GetCasted(IGESData_IGESEntity, IR->BoundEntity( (1-v[4])/2 )); - Lvs = GetCasted(IGESData_LevelListEntity, fieldent); - if (Lvs.IsNull()) { - // Sending of message : Incorrect Line Font Pattern - Message_Msg Msg30 ("XSTEP_30"); - Msg30.Arg(thecnum); - Msg30.Arg(thectyp.Type()); - ach->SendWarning(Msg30); - ent->InitDirFieldEntity(5,fieldent); - } - else ent->InitLevel(Lvs,-1); - } - else ent->InitLevel(Lvs,v[4]); // ici Lvs Null - - if (v[5] != 0) { - fieldent = GetCasted(IGESData_IGESEntity,IR->BoundEntity( (1+v[5])/2 )); - DeclareAndCast(IGESData_ViewKindEntity,View,fieldent); - if (View.IsNull()) { - // Sending of message : Incorrect View - Message_Msg Msg31 ("XSTEP_31"); - Msg31.Arg(thecnum); - Msg31.Arg(thectyp.Type()); - ach->SendWarning(Msg31); - ent->InitDirFieldEntity(6,fieldent); - } - else ent->InitView(View); - } +// .. Demarrage : Lecture du Header .. + try { + OCC_CATCH_SIGNALS - if (v[6] != 0) { - fieldent = GetCasted(IGESData_IGESEntity,IR->BoundEntity( (1+v[6])/2 )); - DeclareAndCast(IGESData_TransfEntity,Transf,fieldent); - if (Transf.IsNull()) { - // Sending of message : Incorrect Transformation Matrix - Message_Msg Msg32 ("XSTEP_32"); - Msg32.Arg(thecnum); - Msg32.Arg(thectyp.Type()); - ach->SendWarning(Msg32); - ent->InitDirFieldEntity(7,fieldent); - } - else ent->InitTransf(Transf); - } + DeclareAndCast(IGESData_IGESModel,amod,amodel); + const IGESData_GlobalSection& gs = myData->GlobalSection(); + amod->SetStartSection (myData->StartSection()); + amod->SetGlobalSection (gs); + const Handle(Interface_Check) &glob = amod->GlobalCheck(); + glob->GetMessages (myData->GlobalCheck()); + //not needed:amod->SetGlobalCheck (glob); - Handle(IGESData_LabelDisplayEntity) Lbd; - if (v[7] != 0) { - fieldlab = GetCasted(IGESData_IGESEntity,IR->BoundEntity( (1+v[7])/2 )); - Lbd = GetCasted(IGESData_LabelDisplayEntity,fieldent); - if (Lbd.IsNull()) { - // Sending of message : Incorrect Label Display - Message_Msg Msg33 ("XSTEP_33"); - Msg33.Arg(thecnum); - Msg33.Arg(thectyp.Type()); - ach->SendWarning(Msg33); - } + themaxweight = gs.MaxLineWeight(); + thegradweight = gs.LineWeightGrad(); + if (thegradweight > 0) + { themaxweight = themaxweight/thegradweight; thegradweight = 1; } + thedefweight = myData->DefaultLineWeight(); } - - ent->InitStatus (v[8] , v[9] , v[10] , v[11]); - - Standard_Integer LWeightNum = v[13]; - - Handle(IGESData_ColorEntity) Color; - if (v[14] < 0) { - fieldent = GetCasted(IGESData_IGESEntity,IR->BoundEntity( (1-v[14])/2 )); - Color = GetCasted(IGESData_ColorEntity, fieldent); - if (Color.IsNull()) { - // Sending of message : Incorrect Color Number - Message_Msg Msg34 ("XSTEP_34"); - Msg34.Arg(thecnum); - Msg34.Arg(thectyp.Type()); - ach->SendWarning(Msg34); - ent->InitDirFieldEntity(13,fieldent); - } - else ent->InitColor(Color); + catch (Standard_Failure) { + // Sendinf of message : Internal error during the header reading + Message_Msg Msg11("XSTEP_11"); + TF->Send (Msg11, Message_Info); } - else ent->InitColor(Color,v[14]); - - ent->InitMisc (Structure,Lbd,LWeightNum); - ent->InitDirFieldEntity(8,fieldlab); - -// ignores : 1(type),2(ptrPsect),13(type),16(lignesPsect),17(form) -// type et forme sont lus directement du DirPart; autres infos recalculees - -// Restent a analyser nom (short label) et snum (subscript number) - Handle(TCollection_HAsciiString) ShortLabel; - Standard_Integer SubScriptN = -1; - Standard_Integer iacar = 0; - Standard_Integer i; // svv Jan11 2000 : porting on DEC - for (i = 0; i < 8; i ++) { if (nom[i] > ' ') iacar = 1; } - if (iacar > 0) ShortLabel = new TCollection_HAsciiString(nom); - iacar = 0; - for (i = 0; i < 8; i ++) - { if (snum[i] > ' ') iacar = 1; if(snum[i] == 0) break; } - if (iacar > 0) SubScriptN = atoi(snum); - ent->SetLabel(ShortLabel,SubScriptN); - -// Enfin, SetLineWeight, tenant compte du defaut - ent->SetLineWeight (IR->DefaultLineWeight(),themaxweight,thegradweight); -} - -// ######## Partie Specifique ######## - - void IGESData_IGESReaderTool::ReadOwnParams - (const Handle(IGESData_IGESEntity)& ent, - const Handle(IGESData_IGESReaderData)& IR, - IGESData_ParamReader& PR) const -{ - Handle(Interface_Check) ach = new Interface_Check;; - Handle(Interface_ReaderModule) imodule; - Standard_Integer CN; - -// Les Modules font tout - if (therlib.Select(ent,imodule,CN)) - { - Handle(IGESData_ReadWriteModule) module = - Handle(IGESData_ReadWriteModule)::DownCast (imodule); - module->ReadOwnParams(CN,ent,IR,PR); - } - else if (ent.IsNull()) { -// Pas trouve dutout - // Sending of message : Null Entity - Message_Msg Msg35 ("XSTEP_35"); - Msg35.Arg(thecnum); - ach->SendFail(Msg35); -// Cas de UndefinedEntity - } else if (ent->IsKind(STANDARD_TYPE(IGESData_UndefinedEntity))) { - DeclareAndCast(IGESData_UndefinedEntity,undent,ent); - undent->ReadOwnParams(IR,PR); -// IGESEntity creee puis non reconnue ... (bizarre, non ?) - } else { - // Sending of message : Unknown Entity - Message_Msg Msg36 ("XSTEP_36"); - Msg36.Arg(thecnum); - ach->SendFail(Msg36); - } -} + // .. Lecture des Entites .. + amodel->Reservate (myData->NbEntities()); -// ######## Proprietes ######## + numr = myData->FindNextRecord(0); - void IGESData_IGESReaderTool::ReadProps - (const Handle(IGESData_IGESEntity)& ent, - const Handle(IGESData_IGESReaderData)& IR, - IGESData_ParamReader& PR) const -{ - // MGE 17/06/98 - // Building of Messages - //===================================== - Message_Msg Msg38 ("XSTEP_38"); - //Message_Msg Msg221 ("XSTEP_221"); - //===================================== - Handle(Interface_Check) ach = new Interface_Check; - Msg38.Arg(thecnum); - Msg38.Arg(thectyp.Type()); - if (PR.Stage() != IGESData_ReadProps) ach->SendFail(Msg38); - Standard_Integer ncur = PR.CurrentNumber(); - Standard_Integer nbp = PR.NbParams(); - if (ncur == nbp + 1) { PR.EndAll(); return; } - else if (ncur > nbp || ncur == 0) ach->SendWarning(Msg38); - - Standard_Integer nbprops = 0; - if (!PR.DefinedElseSkip()) return; - if (!PR.ReadInteger(ncur,nbprops)) { - Message_Msg Msg221 ("XSTEP_221"); - PR.SendFail(Msg221); - return; + Standard_Integer num = numr; + while (num > 0) + { + Standard_Integer ierr = 0; // erreur sur analyse d une entite + Handle(Standard_Transient) anent; + try + { + OCC_CATCH_SIGNALS + for (num = numr; num > 0; num = myData->FindNextRecord(num)) + { + numr = num; + + // Lecture sous protection contre crash + // (fait aussi AddEntity mais pas SetReportEntity) + Handle(Standard_Transient) anent = myData->BoundEntity(num); + Handle(Interface_Check) ach = new Interface_Check(anent); + Handle(Interface_ReportEntity) rep; // entite Report, s il y a lieu + Standard_Integer irep = 0; + if (thenbrep0 > 0) { + rep = Handle(Interface_ReportEntity)::DownCast(thereports->Value(num)); + if (!rep.IsNull()) { irep = num; ach = rep->Check(); } + } + + // .. Chargement proprement dit : Specifique de la Norme .. + thechk = ach; + thecnum = num; + + DeclareAndCast(IGESData_IGESEntity,ent,anent); + ent->Clear(); + ent->OwnRead(*this); + + // .. Ajout dans le modele de l entite telle quelle .. + // ATTENTION, ReportEntity traitee en bloc apres les Load + amodel->AddEntity(anent); + + // Erreur ou Correction : On cree une ReportEntity qui memorise le Check, + // l Entite, et en cas d Erreur une UndefinedEntity pour les Parametres + + // On exploite ici le flag IsLoadError : s il a ete defini (a vrai ou faux) + // il a priorite sur les fails du check. Sinon, ce sont les fails qui parlent + + Standard_Integer nbf = ach->NbFails(); + Standard_Integer nbw = ach->NbWarnings(); + if (nbf + nbw > 0) + { + amodel->NbEntities(); + rep = new Interface_ReportEntity(ach,anent); + if (irep == 0) + { + if (thereports.IsNull()) + thereports = new TColStd_HArray1OfTransient (1,myData->NbRecords()); + irep = num; + thenbreps ++; + } + thereports->SetValue(irep,rep); + } + + // Rechargement ? si oui, dans une UnknownEntity fournie par le protocole + if (nbf > 0) { + Handle(Standard_Transient) undef = myProtocol->UnknownEntity(); + GetCasted(IGESData_IGESEntity,undef)->OwnRead(*this); + rep->SetContent(undef); + } + + // .. Fin Lecture .. + if (anent.IsNull()) { + // Sending of message : Number of ignored Null Entities + Message_Msg Msg21("XSTEP_21"); + Msg21.Arg(amodel->NbEntities()); + TF->Send (Msg21, Message_Info); + continue; + } + // LoadedEntity fait AddEntity MAIS PAS SetReport (en bloc a la fin) + + } // ---- fin boucle sur entites + numr = 0; // plus rien + } // ---- fin du try, le catch suit + + // En cas d erreur NON PREVUE par l analyse, recuperation par defaut + // Attention : la recuperation peut elle-meme planter ... (cf ierr) + catch (Standard_Failure) { + // Au passage suivant, on attaquera le record suivant + numr = myData->FindNextRecord(num); //:g9 abv 28 May 98: tr8_as2_ug.stp - infinite cycle: (0); + + Handle(Standard_Failure) afail = Standard_Failure::Caught(); +#ifdef _WIN32 + if (afail.IsNull() || afail->IsKind(STANDARD_TYPE(OSD_Exception))) ierr = 2; +#else + if (afail.IsNull() || afail->IsKind(STANDARD_TYPE(OSD_Signal))) ierr = 2; +#endif + anent = myData->BoundEntity(num); + if (anent.IsNull()) { + // Sending of message : Number of ignored Null Entities + Message_Msg Msg21("XSTEP_21"); + Msg21.Arg(amodel->NbEntities()+1); + TF->Send (Msg21, Message_Info); + continue; + } + ach = new Interface_Check(anent); + //: abv 03 Apr 00: trj3_s1-tc-214.stp: generate a message on exception + Message_Msg Msg278("XSTEP_278"); + Msg278.Arg(amodel->StringLabel(anent)); + ach->SendFail (Msg278); + + if (ierr == 2) { + // Sending of message : reading of entity failed + Message_Msg Msg22("XSTEP_22"); + Msg22.Arg(amodel->StringLabel(anent)); + TF->Send (Msg22, Message_Info); + return; + } + + if (!ierr) { + ierr = 1; + // ce qui serait bien ici serait de recuperer le texte de l erreur pour ach ... + // Sending of message : recovered entity + Message_Msg Msg23("XSTEP_23"); + Msg23.Arg(num); + TF->Send (Msg23, Message_Info); + + // Finalement, on charge une Entite Inconnue + thenbreps ++; + Handle(Interface_ReportEntity) rep = new Interface_ReportEntity(ach,anent); + Handle(Standard_Transient) undef = myProtocol->UnknownEntity(); + GetCasted(IGESData_IGESEntity,undef)->OwnRead(*this); + rep->SetContent(undef); + + if (thereports.IsNull()) + thereports = new TColStd_HArray1OfTransient (1,myData->NbRecords()); + + thenbreps ++; + thereports->SetValue (num,rep); + amodel->AddEntity (anent); // pas fait par LoadedEntity ... + } + else { + // Sending of message : reading of entity failed + Message_Msg Msg22("XSTEP_22"); + Msg22.Arg(amodel->StringLabel(anent)); + TF->Send (Msg22, Message_Info); + // On garde telle quelle : pas d analyse fichier supplementaire, + // Mais la phase preliminaire eventuelle est conservee + // (en particulier, on garde trace du Type lu du fichier, etc...) + } + } // ----- fin complete du try/catch + } // ----- fin du while + +// .. Ajout des Reports, silya + if (!thereports.IsNull()) { + // Sending of message : report + Message_Msg Msg24("XSTEP_24"); + Msg24.Arg(thenbreps); + TF->Send (Msg24, Message_Info); + amodel->Reservate (-thenbreps-10); + thenbreps = thereports->Upper(); + for (Standard_Integer nr = 1; nr <= thenbreps; nr ++) { + if (thereports->Value(nr).IsNull()) continue; + Handle(Standard_Transient) anent = myData->BoundEntity (nr); + Handle(Interface_ReportEntity) rep = + Handle(Interface_ReportEntity)::DownCast(thereports->Value(nr)); + amodel->SetReportEntity (-amodel->Number(anent),rep); + } } - if (nbprops == 0) return; ncur ++; - Interface_EntityList props; - if (PR.ReadEntList - (IR,PR.CurrentList(nbprops),Msg38, props,Standard_False) ) - ent->LoadProperties(props); -} - - -// ######## Associativites ######## - - void IGESData_IGESReaderTool::ReadAssocs - (const Handle(IGESData_IGESEntity)& ent, - const Handle(IGESData_IGESReaderData)& IR, - IGESData_ParamReader& PR) const -{ - // MGE 17/06/98 - // Building of Messages - //===================================== - Message_Msg Msg37 ("XSTEP_37"); -// Message_Msg Msg220 ("XSTEP_220"); - //===================================== - Msg37.Arg(thecnum); - Msg37.Arg(thectyp.Type()); - Handle(Interface_Check) ach = new Interface_Check; - if (PR.Stage() != IGESData_ReadAssocs) ach->SendFail(Msg37); - Standard_Integer ncur = PR.CurrentNumber(); - Standard_Integer nbp = PR.NbParams(); - if (ncur == nbp + 1) { PR.EndAll(); return; } - else if (ncur > nbp || ncur == 0) ach->SendWarning(Msg37); - - Standard_Integer nbassocs = 0; - if (!PR.DefinedElseSkip()) return; - if (!PR.ReadInteger(PR.Current(),nbassocs)){ - Message_Msg Msg220 ("XSTEP_220"); - PR.SendFail(Msg220); - return; -} - if (nbassocs == 0) return; - Interface_EntityList assocs; - if (PR.ReadEntList - (IR,PR.CurrentList(nbassocs),Msg37, assocs,Standard_False) ) - ent->LoadAssociativities(assocs); } diff --git a/src/IGESData/IGESData_IGESReaderTool.hxx b/src/IGESData/IGESData_IGESReaderTool.hxx index 99558bbb5b..f49f519a03 100644 --- a/src/IGESData/IGESData_IGESReaderTool.hxx +++ b/src/IGESData/IGESData_IGESReaderTool.hxx @@ -21,13 +21,12 @@ #include #include -#include -#include #include -class Interface_ParamList; +//class Interface_ParamList; class Interface_Check; class IGESData_IGESReaderData; class IGESData_Protocol; +class IGESData_IGESModel; class Standard_Transient; class Interface_InterfaceModel; class IGESData_IGESEntity; @@ -37,66 +36,46 @@ class IGESData_ParamReader; //! specific FileReaderTool for IGES //! Parameters are accessed through specific objects, ParamReaders -class IGESData_IGESReaderTool : public Interface_FileReaderTool +class IGESData_IGESReaderTool { public: DEFINE_STANDARD_ALLOC - //! creates IGESReaderTool to work with an IGESReaderData and an - //! IGES Protocol. - //! Actually, no Lib is used - Standard_EXPORT IGESData_IGESReaderTool(const Handle(IGESData_IGESReaderData)& reader, const Handle(IGESData_Protocol)& protocol); + //! creates IGESReaderTool to work with an IGESReaderData and an IGES Protocol. + IGESData_IGESReaderTool(const Handle(IGESData_Protocol)& theProtocol) + : myProtocol(theProtocol) + {} + + Standard_Integer EntityNumber () const { return thecnum; } + + const Handle(IGESData_IGESReaderData) & ReaderData() const { return myData; } + + Handle(Interface_Check) & Check() { return thechk; } + + Standard_Integer GradWeight() const { return thegradweight; } + + Standard_Real MaxWeight() const { return themaxweight; } - //! binds empty entities to records, works with the Protocol - //! (from IGESData) stored and later used - //! RQ : Actually, sets DNum into IGES Entities - //! Also loads the list of parameters for ParamReader - Standard_EXPORT void Prepare (); + Standard_EXPORT Standard_Integer Read (const Standard_CString theFileName, const Handle(IGESData_IGESModel)& amodel, const Standard_Boolean modefnes = Standard_False); private: - - //! recognizes records by asking Protocol (on data of DirType) - Standard_EXPORT virtual Standard_Boolean Recognize (const Standard_Integer num, Handle(Standard_Transient)& ent) Standard_OVERRIDE; - - //! fills model's header, that is, its GlobalSection - Standard_EXPORT virtual void BeginRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE; - - //! fills an entity, given record no; works by calling ReadDirPart - //! then ReadParams (with help of a ParamReader), then if required - //! ReadProps and ReadAssocs, from IGESEntity - //! Returns True if no fail has been recorded - Standard_EXPORT virtual Standard_Boolean AnalyseRecord (const Standard_Integer num, const Handle(Standard_Transient)& anent, Handle(Interface_Check)& acheck) Standard_OVERRIDE; - - //! Reads directory part componants from file; DP is the litteral - //! directory part, IR detains entities referenced by DP - Standard_EXPORT void ReadDir (const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, const IGESData_DirPart& DP, Handle(Interface_Check)& ach) const; - - //! Performs Reading of own Parameters for each IGESEntity - //! Works with the ReaderLib loaded with ReadWriteModules for IGES - //! In case of failure, tries UndefinedEntity from IGES - Standard_EXPORT void ReadOwnParams (const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Reads Property List, if there is (if not, does nothing) - //! criterium is : current parameter of PR remains inside params - //! list, and Stage is "Own" - //! Current parameter must be a positive integer, which value - //! gives the length of the list; else, a Fail is produced (into - //! Check of PR) and reading process is stopped - Standard_EXPORT void ReadProps (const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Reads Associativity List, if there is (if not, does nothing) - //! criterium is : current parameter of PR remains inside params - //! list, and Stage is "Own" - //! Same conditions as above; in addition, no parameter must be - //! let after the list once read - //! Note that "Associated" entities are not declared "Shared" - Standard_EXPORT void ReadAssocs (const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - Handle(Interface_ParamList) thelist; + + //! Reads and fills Entities from the FileReaderData set by + //! SetData to an InterfaceModel. + //! It enchains required operations, the specific ones correspond + //! to deferred methods (below) to be defined for each Norm. + //! It manages also error recovery and trace. + //! Remark : it calls SetModel. + //! It Can raise any error which can occur during a load + //! operation, unless Error Handling is set. + //! This method can also be redefined if judged necessary. + Standard_EXPORT void LoadModel (const Handle(Interface_InterfaceModel)& amodel); + + Handle(IGESData_Protocol) myProtocol; + Handle(IGESData_IGESReaderData) myData; + Standard_Integer thecnum; - IGESData_IGESType thectyp; - IGESData_ReadStage thestep; Handle(Interface_Check) thechk; Standard_Integer thegradweight; Standard_Real themaxweight; diff --git a/src/IGESData/IGESData_IGESType.cxx b/src/IGESData/IGESData_IGESType.cxx deleted file mode 100644 index 1b620116b6..0000000000 --- a/src/IGESData/IGESData_IGESType.cxx +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include - -IGESData_IGESType::IGESData_IGESType () { thetype = 0; theform = 0; } - - IGESData_IGESType::IGESData_IGESType - (const Standard_Integer atype, const Standard_Integer aform) - { thetype = atype; theform = aform; } - - Standard_Integer IGESData_IGESType::Type () const { return thetype; } - - Standard_Integer IGESData_IGESType::Form () const { return theform; } - - Standard_Boolean IGESData_IGESType::IsEqual (const IGESData_IGESType& other) const - { return (thetype == other.Type() && theform == other.Form()); } - - void IGESData_IGESType::Nullify () { thetype = 0; theform = 0; } diff --git a/src/IGESData/IGESData_IGESType.hxx b/src/IGESData/IGESData_IGESType.hxx index 2723675b2e..1c531cf693 100644 --- a/src/IGESData/IGESData_IGESType.hxx +++ b/src/IGESData/IGESData_IGESType.hxx @@ -21,62 +21,32 @@ #include #include -#include -#include - //! taken from directory part of an entity (from file or model), //! gives "type" and "form" data, used to recognize entity's type class IGESData_IGESType { -public: + public: DEFINE_STANDARD_ALLOC - - Standard_EXPORT IGESData_IGESType(); - - Standard_EXPORT IGESData_IGESType(const Standard_Integer atype, const Standard_Integer aform); - - //! returns "type" data - Standard_EXPORT Standard_Integer Type() const; - - //! returns "form" data - Standard_EXPORT Standard_Integer Form() const; - - //! compares two IGESTypes, avoiding comparing their fields - Standard_EXPORT Standard_Boolean IsEqual (const IGESData_IGESType& another) const; -Standard_Boolean operator == (const IGESData_IGESType& another) const -{ - return IsEqual(another); -} - - //! resets fields (usefull when an IGESType is stored as mask) - Standard_EXPORT void Nullify(); - - + IGESData_IGESType() : thetype(0), theform(0) {} + IGESData_IGESType(const Standard_Integer atype, const Standard_Integer aform) : thetype(atype), theform(aform) {} -protected: + Standard_Integer Type() const { return thetype; } + Standard_Integer Form() const { return theform; } + //! compares two IGESTypes, avoiding comparing their fields + Standard_Boolean IsEqual (const IGESData_IGESType& another) const { return (thetype == another.Type() && theform == another.Form()); } + Standard_Boolean operator == (const IGESData_IGESType& another) const { return IsEqual(another); } - -private: - - + private: Standard_Integer thetype; Standard_Integer theform; - - }; - - - - - - #endif // _IGESData_IGESType_HeaderFile diff --git a/src/IGESData/IGESData_IGESWriter.cxx b/src/IGESData/IGESData_IGESWriter.cxx index 01506604d2..dca3167ca2 100644 --- a/src/IGESData/IGESData_IGESWriter.cxx +++ b/src/IGESData/IGESData_IGESWriter.cxx @@ -24,12 +24,9 @@ #include #include #include -#include -#include #include #include #include -#include #include #include #include @@ -49,8 +46,6 @@ #define MaxcarsG 72 #define MaxcarsP 64 -//#define PATIENCELOG - // Constructeur complet : taille OK, et se remplit depuis le modele en direct @@ -113,28 +108,21 @@ void IGESData_IGESWriter::SendStartLine (const Standard_CString startline) SendStartLine (&startline[MaxcarsG]); } - void IGESData_IGESWriter::SendModel - (const Handle(IGESData_Protocol)& protocol) +void IGESData_IGESWriter::SendModel () { - Handle(Message_Messenger) sout = Message::DefaultMessenger(); - IGESData_WriterLib lib(protocol); + const Handle(Message_Messenger) &sout = Message::DefaultMessenger(); - Standard_Integer nb = themodel->NbEntities(); -#ifdef PATIENCELOG - sout<< " IGESWriter : " << nb << " Entities (* = 1000 Ent.s)" << endl; -#endif + const Standard_Integer nb = themodel->NbEntities(); SectionS (); - Standard_Integer ns = themodel->NbStartLines(); + const Standard_Integer ns = themodel->StartSection()->Length(); Standard_Integer i; // svv Jan11 2000 : porting on DEC - for (i = 1; i <= ns; i ++) SendStartLine (themodel->StartLine(i)); + for (i = 1; i <= ns; i ++) + SendStartLine (themodel->StartSection()->Value(i)->ToCString()); SectionG (themodel->GlobalSection()); SectionsDP (); for (i = 1; i <= nb; i ++) { Handle(IGESData_IGESEntity) ent = themodel->Entity(i); Handle(IGESData_IGESEntity) cnt = ent; -#ifdef PATIENCELOG - if (i % 1000 == 1) cout << "*" << flush; -#endif // Attention aux cas d erreur : contenu redefini if (themodel->IsRedefinedContent(i)) { sout << " -- IGESWriter : Erroneous Entity N0."< ... // Envoi proprement dit des Parametres proprement definis - Handle(IGESData_ReadWriteModule) module; Standard_Integer CN; -// Differents cas - if (lib.Select(cnt,module,CN)) - module->WriteOwnParams (CN,cnt,*this); - else if (cnt->IsKind(STANDARD_TYPE(IGESData_UndefinedEntity))) { - DeclareAndCast(IGESData_UndefinedEntity,undent,cnt); - undent->WriteOwnParams (*this); - } - else sout<<" -- IGESWriter : Not Processed for n0."<TypeNumber()<<" Form "<FormNumber()<OwnWrite(*this); Associativities (cnt); Properties (cnt); EndEntity (); } -#ifdef PATIENCELOG - cout << " Envoi des Entites Termine"<TypeNumber(); v[1] = 0; // numero en section P : calcule ulterieurement - if (anent->HasStructure()) v[2] = - themodel->DNum(anent->DirFieldEntity(3)); - else v[2] = 0; + v[2] = (anent->Structure().IsNull()? 0 : - themodel->DNum(anent->Structure())); IGESData_DefType linet = anent->DefLineFont(); if (linet == IGESData_DefReference) v[3] = - themodel->DNum(anent->DirFieldEntity(4)); @@ -483,9 +457,6 @@ Standard_Boolean IGESData_IGESWriter::Print (Standard_OStream& S) const if(!isGood) return isGood; char ligne[81]; -#ifdef PATIENCELOG - Standard_Integer lignespatience = 1000; -#endif char blancs[73]; Standard_Integer i; // svv Jan11 2000 : porting on DEC for (i = 0; i < MaxcarsG; i ++) blancs[i] = ' '; @@ -524,9 +495,6 @@ Standard_Boolean IGESData_IGESWriter::Print (Standard_OStream& S) const else S << finlin; S << endl; } } -#ifdef PATIENCELOG - cout << "Global Section : " << flush; -#endif isGood = S.good(); // Global Section : convertie dans Standard_Integer nbg = thehead->Length(); @@ -545,15 +513,9 @@ Standard_Boolean IGESData_IGESWriter::Print (Standard_OStream& S) const } if(!isGood) return isGood; -#ifdef PATIENCELOG - cout << nbg << " lines" << endl; -#endif // Directory Section Standard_Integer nbd = thedirs.Upper(); // 0 -> NbEnts -#ifdef PATIENCELOG - cout << "\nDirectory section : " << nbd << " Entites" << endl; -#endif for (i = 1; i <= nbd && isGood ; i ++) { Standard_Integer v[17]; char res1[9],res2[9],lab[9],num[9]; thedirs.Value(i).Values(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9], @@ -579,11 +541,6 @@ Standard_Boolean IGESData_IGESWriter::Print (Standard_OStream& S) const if(!isGood) return isGood; // Parameter Section -#ifdef PATIENCELOG - cout<<" Parameter Section : "< -#include - -#include -class Interface_Protocol; -class IGESData_GlobalNodeOfSpecificLib; -class IGESData_IGESEntity; -class IGESData_SpecificModule; -class IGESData_SpecificLib; - - -class IGESData_NodeOfSpecificLib; -DEFINE_STANDARD_HANDLE(IGESData_NodeOfSpecificLib, MMgt_TShared) - - -class IGESData_NodeOfSpecificLib : public MMgt_TShared -{ - -public: - - - //! Creates an empty Node, with no Next - Standard_EXPORT IGESData_NodeOfSpecificLib(); - - //! Adds a couple (Module,Protocol), that is, stores it into - //! itself if not yet done, else creates a Next Node to do it - Standard_EXPORT void AddNode (const Handle(IGESData_GlobalNodeOfSpecificLib)& anode); - - //! Returns the Module designated by a precise Node - Standard_EXPORT const Handle(IGESData_SpecificModule)& Module() const; - - //! Returns the Protocol designated by a precise Node - Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; - - //! Returns the Next Node. If none was defined, returned value - //! is a Null Handle - Standard_EXPORT const Handle(IGESData_NodeOfSpecificLib)& Next() const; - - - - - DEFINE_STANDARD_RTTI_INLINE(IGESData_NodeOfSpecificLib,MMgt_TShared) - -protected: - - - - -private: - - - Handle(IGESData_GlobalNodeOfSpecificLib) thenode; - Handle(IGESData_NodeOfSpecificLib) thenext; - - -}; - - - - - - - -#endif // _IGESData_NodeOfSpecificLib_HeaderFile diff --git a/src/IGESData/IGESData_NodeOfSpecificLib_0.cxx b/src/IGESData/IGESData_NodeOfSpecificLib_0.cxx deleted file mode 100644 index 8ce07ebde2..0000000000 --- a/src/IGESData/IGESData_NodeOfSpecificLib_0.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// Created on: 1992-04-06 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -#include - -#include -#include -#include -#include -#include - -#define TheObject Handle(IGESData_IGESEntity) -#define TheObject_hxx -#define Handle_TheModule Handle(IGESData_SpecificModule) -#define TheModule IGESData_SpecificModule -#define TheModule_hxx -#define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node IGESData_NodeOfSpecificLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(IGESData_GlobalNodeOfSpecificLib) -#define Handle_LibCtl_Node Handle(IGESData_NodeOfSpecificLib) -#define LibCtl_Library IGESData_SpecificLib -#define LibCtl_Library_hxx -#include diff --git a/src/IGESData/IGESData_NodeOfWriterLib.hxx b/src/IGESData/IGESData_NodeOfWriterLib.hxx deleted file mode 100644 index 543b63e29c..0000000000 --- a/src/IGESData/IGESData_NodeOfWriterLib.hxx +++ /dev/null @@ -1,83 +0,0 @@ -// Created on: 1992-04-06 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESData_NodeOfWriterLib_HeaderFile -#define _IGESData_NodeOfWriterLib_HeaderFile - -#include -#include - -#include -class Interface_Protocol; -class IGESData_GlobalNodeOfWriterLib; -class IGESData_IGESEntity; -class IGESData_ReadWriteModule; -class IGESData_WriterLib; - - -class IGESData_NodeOfWriterLib; -DEFINE_STANDARD_HANDLE(IGESData_NodeOfWriterLib, MMgt_TShared) - - -class IGESData_NodeOfWriterLib : public MMgt_TShared -{ - -public: - - - //! Creates an empty Node, with no Next - Standard_EXPORT IGESData_NodeOfWriterLib(); - - //! Adds a couple (Module,Protocol), that is, stores it into - //! itself if not yet done, else creates a Next Node to do it - Standard_EXPORT void AddNode (const Handle(IGESData_GlobalNodeOfWriterLib)& anode); - - //! Returns the Module designated by a precise Node - Standard_EXPORT const Handle(IGESData_ReadWriteModule)& Module() const; - - //! Returns the Protocol designated by a precise Node - Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; - - //! Returns the Next Node. If none was defined, returned value - //! is a Null Handle - Standard_EXPORT const Handle(IGESData_NodeOfWriterLib)& Next() const; - - - - - DEFINE_STANDARD_RTTI_INLINE(IGESData_NodeOfWriterLib,MMgt_TShared) - -protected: - - - - -private: - - - Handle(IGESData_GlobalNodeOfWriterLib) thenode; - Handle(IGESData_NodeOfWriterLib) thenext; - - -}; - - - - - - - -#endif // _IGESData_NodeOfWriterLib_HeaderFile diff --git a/src/IGESData/IGESData_NodeOfWriterLib_0.cxx b/src/IGESData/IGESData_NodeOfWriterLib_0.cxx deleted file mode 100644 index c554c9362d..0000000000 --- a/src/IGESData/IGESData_NodeOfWriterLib_0.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// Created on: 1992-04-06 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -#include - -#include -#include -#include -#include -#include - -#define TheObject Handle(IGESData_IGESEntity) -#define TheObject_hxx -#define Handle_TheModule Handle(IGESData_ReadWriteModule) -#define TheModule IGESData_ReadWriteModule -#define TheModule_hxx -#define LibCtl_GlobalNode IGESData_GlobalNodeOfWriterLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node IGESData_NodeOfWriterLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(IGESData_GlobalNodeOfWriterLib) -#define Handle_LibCtl_Node Handle(IGESData_NodeOfWriterLib) -#define LibCtl_Library IGESData_WriterLib -#define LibCtl_Library_hxx -#include diff --git a/src/IGESData/IGESData_ParamCursor.cxx b/src/IGESData/IGESData_ParamCursor.cxx deleted file mode 100644 index 9b676418b0..0000000000 --- a/src/IGESData/IGESData_ParamCursor.cxx +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include - -IGESData_ParamCursor::IGESData_ParamCursor (const Standard_Integer num) -{ - thestart = num; thelimit = thestart+1; - thecount = 1; theadv = Standard_True; - theisize = 1; theoffst = 0; thetsize = 1; -} - - IGESData_ParamCursor::IGESData_ParamCursor - (const Standard_Integer num, - const Standard_Integer nb, const Standard_Integer size) -{ - thestart = num; thelimit = num + (nb*size); - thecount = nb; theadv = Standard_True; - theisize = size; theoffst = 0; thetsize = size; -} - - void IGESData_ParamCursor::SetTerm - (const Standard_Integer size, const Standard_Boolean autoadv) -{ - theoffst += thetsize; - thetsize = size; - if (autoadv) theadv = (theoffst + thetsize == theisize); - if (theoffst + thetsize > theisize) Interface_InterfaceError::Raise - ("IGESDAta ParamCursor : required Term size overpass whole Item size"); -} - - void IGESData_ParamCursor::SetOne (const Standard_Boolean autoadv) - { SetTerm (1, autoadv); } - - void IGESData_ParamCursor::SetXY (const Standard_Boolean autoadv) - { SetTerm (2, autoadv); } - - void IGESData_ParamCursor::SetXYZ (const Standard_Boolean autoadv) - { SetTerm (3, autoadv); } - - void IGESData_ParamCursor::SetAdvance(const Standard_Boolean advance) - { theadv = advance; } - -// LA SUITE : inline , cf lxx -// (Start,Limit,Count,ItemSize,TermSize,Offset,Advance) diff --git a/src/IGESData/IGESData_ParamCursor.hxx b/src/IGESData/IGESData_ParamCursor.hxx index 6ba7005696..400af778e4 100644 --- a/src/IGESData/IGESData_ParamCursor.hxx +++ b/src/IGESData/IGESData_ParamCursor.hxx @@ -48,18 +48,22 @@ class Interface_InterfaceError; //! ParamReader offers methods which create most useful cases class IGESData_ParamCursor { -public: + public: DEFINE_STANDARD_ALLOC - //! Creates a Cursor to read a precise parameter of ParamReader, //! identified by its number, then set Current Number to "num + 1" //! (this constructor allows to simply give a Number to a method //! Read... from ParamReader, which will be translated into a //! ParamCursor by compiler) - Standard_EXPORT IGESData_ParamCursor(const Standard_Integer num); - + IGESData_ParamCursor (const Standard_Integer num) + : thestart(num), + thelimit(num+1), + thecount(1), + thesize(1) + {} + //! Creates a Cursor to read a list of parameters (count "nb") //! starting from a precise one (number "num") included, then //! set Current Number of ParamNumber to the first following one @@ -69,90 +73,31 @@ public: //! instance, a Parameter comprises one Integer, or one Entity ... //! Size gives the complete size of each Item if it is complex. //! To be used ONLY IF it is constant - Standard_EXPORT IGESData_ParamCursor(const Standard_Integer num, const Standard_Integer nb, const Standard_Integer size = 1); - - //! Defines the size of a term to read in the item : this commands - //! ParamReader to read "size" parameters for each item, then - //! skip the remainder of the item to the same term of next Item - //! (that is, skip "item size" - "term size") - //! - //! In addition, Offset from beginning of Item is managed : - //! After being created, and for the frist call to SetTerm, the - //! part of Item to be read begins exactly as the Item begins - //! But after a SetTerm, the next read will add an offset which is - //! the size of former term. - //! - //! autoadv commands Advance management. If it is True (default), - //! the last SetTerm (Item size has been covered) calls SetAdvance - //! If it is False, SetAdvance must be called directly if necessary - //! - //! Error if a SetTerm overpasses the size of the Item - Standard_EXPORT void SetTerm (const Standard_Integer size, const Standard_Boolean autoadv = Standard_True); - - //! Defines a term of one Parameter (very current case) - Standard_EXPORT void SetOne (const Standard_Boolean autoadv = Standard_True); - - //! Defines a term of two Parameters for a XY (current case) - Standard_EXPORT void SetXY (const Standard_Boolean autoadv = Standard_True); - - //! Defines a term of three Parameters for XYZ (current case) - Standard_EXPORT void SetXYZ (const Standard_Boolean autoadv = Standard_True); - - //! Changes command to advance current cursor after reading - //! parameters. If "advance" True, sets advance, if "False", - //! resets it. ParamCursor is created by default with True. - Standard_EXPORT void SetAdvance (const Standard_Boolean advance); + IGESData_ParamCursor (const Standard_Integer num, const Standard_Integer nb, const Standard_Integer size = 1) + : thestart(num), + thelimit(num + (nb*size)), + thecount(nb), + thesize(size) + {} //! Returns (included) starting number for reading parameters - Standard_Integer Start() const; - - //! Returns (excluded) upper limit number for reading parameters - Standard_Integer Limit() const; - - //! Returns required count of items to be read - Standard_Integer Count() const; - - //! Returns length of item (count of parameters per item) - Standard_Integer ItemSize() const; - - //! Returns length of current term (count of parameters) in item - Standard_Integer TermSize() const; - - //! Returns offset from which current term must be read in item - Standard_Integer Offset() const; - - //! Returns True if Advance command has been set - Standard_Boolean Advance() const; - - - - -protected: - - - + Standard_Integer Start() const { return thestart; } + //! Returns (excluded) upper limit number for reading parameters + Standard_Integer Limit() const { return thelimit; } -private: + //! Returns required count of items to be read + Standard_Integer Count() const { return thecount; } + //! Returns length of item (count of parameters per item) + Standard_Integer Size() const { return thesize; } + private: Standard_Integer thestart; Standard_Integer thelimit; Standard_Integer thecount; - Standard_Integer theisize; - Standard_Integer theoffst; - Standard_Integer thetsize; - Standard_Boolean theadv; - - + Standard_Integer thesize; }; - -#include - - - - - #endif // _IGESData_ParamCursor_HeaderFile diff --git a/src/IGESData/IGESData_ParamCursor.lxx b/src/IGESData/IGESData_ParamCursor.lxx deleted file mode 100644 index 612cd4d48a..0000000000 --- a/src/IGESData/IGESData_ParamCursor.lxx +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -// IGESData_ParamCursor inline - -inline Standard_Integer IGESData_ParamCursor::Start () const - { return thestart; } - -inline Standard_Integer IGESData_ParamCursor::Limit () const - { return thelimit; } - -inline Standard_Integer IGESData_ParamCursor::Count () const - { return thecount; } - -inline Standard_Integer IGESData_ParamCursor::ItemSize () const - { return theisize; } - -inline Standard_Integer IGESData_ParamCursor::TermSize () const - { return thetsize; } - -inline Standard_Integer IGESData_ParamCursor::Offset () const - { return theoffst; } - -inline Standard_Boolean IGESData_ParamCursor::Advance() const - { return theadv; } diff --git a/src/IGESData/IGESData_ParamReader.cxx b/src/IGESData/IGESData_ParamReader.cxx index 66b63e4b19..97526910a4 100644 --- a/src/IGESData/IGESData_ParamReader.cxx +++ b/src/IGESData/IGESData_ParamReader.cxx @@ -59,17 +59,6 @@ IGESData_ParamReader::IGESData_ParamReader(const Handle(Interface_ParamList)& li } -//======================================================================= -//function : EntityNumber -//purpose : -//======================================================================= - -Standard_Integer IGESData_ParamReader::EntityNumber () const -{ - return thenum; -} - - //======================================================================= //function : Clear //purpose : @@ -83,41 +72,6 @@ void IGESData_ParamReader::Clear () } -//======================================================================= -//function : CurrentNumber -//purpose : -//======================================================================= - -Standard_Integer IGESData_ParamReader::CurrentNumber () const -{ - return thecurr; -} - - -//======================================================================= -//function : SetCurrentNumber -//purpose : -//======================================================================= - -void IGESData_ParamReader::SetCurrentNumber (const Standard_Integer num) -{ - //if (num <= NbParams() + 1) thecurr = num; // NbParams+1 : "fin d'objet" - //else thecurr = 0; - thecurr = num; -} - - -//======================================================================= -//function : Stage -//purpose : -//======================================================================= - -IGESData_ReadStage IGESData_ParamReader::Stage () const -{ - return thestage; -} - - //======================================================================= //function : NextStage //purpose : @@ -130,38 +84,15 @@ void IGESData_ParamReader::NextStage () } -//======================================================================= -//function : EndAll -//purpose : -//======================================================================= - -void IGESData_ParamReader::EndAll () -{ - thestage = IGESData_ReadEnd; -} - - // .... Acces de base aux parametres .... -//======================================================================= -//function : NbParams -//purpose : -//======================================================================= - -Standard_Integer IGESData_ParamReader::NbParams () const -{ - return (thenbpar - 1); -} - - //======================================================================= //function : ParamType //purpose : //======================================================================= -Interface_ParamType IGESData_ParamReader::ParamType - (const Standard_Integer num) const +Interface_ParamType IGESData_ParamReader::ParamType (const Standard_Integer num) const { return theparams->Value(num+thebase).ParamType(); } @@ -172,8 +103,7 @@ Interface_ParamType IGESData_ParamReader::ParamType //purpose : //======================================================================= -Standard_CString IGESData_ParamReader::ParamValue - (const Standard_Integer num) const +Standard_CString IGESData_ParamReader::ParamValue (const Standard_Integer num) const { return theparams->Value(num+thebase).CValue(); } @@ -184,26 +114,13 @@ Standard_CString IGESData_ParamReader::ParamValue //purpose : //======================================================================= -Standard_Boolean IGESData_ParamReader::IsParamDefined - (const Standard_Integer num) const +Standard_Boolean IGESData_ParamReader::IsParamDefined (const Standard_Integer num) const { if (num >= thenbpar) return Standard_False; return (theparams->Value(num+thebase).ParamType() != Interface_ParamVoid); } -//======================================================================= -//function : IsParamEntity -//purpose : -//======================================================================= - -Standard_Boolean IGESData_ParamReader::IsParamEntity - (const Standard_Integer num) const -{ - return (ParamNumber(num) != 0); -} - - //======================================================================= //function : ParamNumber //purpose : @@ -261,50 +178,12 @@ IGESData_ParamCursor IGESData_ParamReader::Current () const //purpose : //======================================================================= -IGESData_ParamCursor IGESData_ParamReader::CurrentList - (const Standard_Integer nb, const Standard_Integer size) const +IGESData_ParamCursor IGESData_ParamReader::CurrentList (const Standard_Integer nb, const Standard_Integer size) const { return IGESData_ParamCursor(thecurr,nb,size); } -// PrepareRead for MoniTool - - -//======================================================================= -//function : PrepareRead -//purpose : -//======================================================================= - -Standard_Boolean IGESData_ParamReader::PrepareRead - (const IGESData_ParamCursor& PC, const Standard_Boolean several, - const Standard_Integer size) -{ - theindex = PC.Start(); - themaxind = PC.Limit(); - thenbitem = PC.Count(); - theitemsz = PC.ItemSize(); - theoffset = PC.Offset(); - thetermsz = PC.TermSize(); - if (!several && thenbitem > 1) { - // AddFail (mess," : List not allowed",""); - return Standard_False; - } - if (size > 1) { - if (thetermsz % size != 0) { - return Standard_False; - } - } - if (theindex <= 0 || (themaxind-1) > NbParams()) { - return Standard_False; - } - if (PC.Advance()) - SetCurrentNumber (themaxind); //themaxind : prochain index - thelast = Standard_True; - return Standard_True; -} - - //======================================================================= //function : PrepareRead //purpose : @@ -317,26 +196,28 @@ Standard_Boolean IGESData_ParamReader::PrepareRead theindex = PC.Start(); themaxind = PC.Limit(); thenbitem = PC.Count(); - theitemsz = PC.ItemSize(); - theoffset = PC.Offset(); - thetermsz = PC.TermSize(); + theitemsz = PC.Size(); + thetermsz = PC.Size(); if (!several && thenbitem > 1) { - AddFail (mess," : List not allowed",""); + if (mess) + AddFail (mess," : List not allowed",""); return Standard_False; } if (size > 1) { if (thetermsz % size != 0) { - AddFail (mess," : term size mismatch",""); + if (mess) + AddFail (mess," : term size mismatch",""); return Standard_False; } } if (theindex <= 0 || (themaxind-1) > NbParams()) { - if (thenbitem == 1) AddFail (mess," : Parameter number out of range",""); - //else AddFail (mess," : too many values to read" ,""); - else AddWarning (mess," : too many values to read" ,""); + if (mess) { + if (thenbitem == 1) AddFail (mess," : Parameter number out of range",""); + else AddWarning (mess," : too many values to read" ,""); + } return Standard_False; } - if (PC.Advance()) SetCurrentNumber (themaxind); //themaxind : prochain index + thecurr = themaxind; //themaxind : prochain index thelast = Standard_True; return Standard_True; } @@ -356,7 +237,6 @@ Standard_Boolean IGESData_ParamReader::PrepareRead Standard_Integer IGESData_ParamReader::FirstRead (const Standard_Integer nb) { - theindex += theoffset; // On se cale d office sur le debut du terme a lire Standard_Integer res = theindex; thenbterm = nb; if (thenbterm >= thetermsz) { @@ -399,45 +279,23 @@ Standard_Boolean IGESData_ParamReader::DefinedElseSkip () } -// ReadInteger for MoniTool - //======================================================================= //function : ReadInteger //purpose : //======================================================================= -Standard_Boolean IGESData_ParamReader::ReadInteger (const IGESData_ParamCursor& PC, - Standard_Integer& val) +Standard_Boolean IGESData_ParamReader::ReadInteger (Standard_Integer& val, const Standard_CString mess) { - if (!PrepareRead(PC,Standard_False)) return Standard_False; + const IGESData_ParamCursor PC(thecurr); + if (!PrepareRead(PC,mess,Standard_False)) return Standard_False; const Interface_FileParameter& FP = theparams->Value(theindex+thebase); if (FP.ParamType() != Interface_ParamInteger) { - if (FP.ParamType() == Interface_ParamVoid){ + if (FP.ParamType() == Interface_ParamVoid) { val = 0; return Standard_True; } // DEFAULT - return Standard_False; - } - val = atoi(FP.CValue()); - return Standard_True; -} - - -//======================================================================= -//function : ReadInteger -//purpose : -//======================================================================= - -Standard_Boolean IGESData_ParamReader::ReadInteger - (const IGESData_ParamCursor& PC, const Standard_CString mess, - Standard_Integer& val) -{ - if (!PrepareRead(PC,mess,Standard_False)) return Standard_False; - const Interface_FileParameter& FP = theparams->Value(theindex+thebase); - if (FP.ParamType() != Interface_ParamInteger) { - if (FP.ParamType() == Interface_ParamVoid) - { val = 0; return Standard_True; } // DEFAULT - AddFail (mess," : not given as an Integer",""); + if (mess) + AddFail (mess," : not given as an Integer",""); return Standard_False; } val = atoi(FP.CValue()); @@ -452,11 +310,10 @@ Standard_Boolean IGESData_ParamReader::ReadInteger //purpose : //======================================================================= -Standard_Boolean IGESData_ParamReader::ReadBoolean - (const IGESData_ParamCursor& PC, const Message_Msg& amsg, - Standard_Boolean& val, const Standard_Boolean exact) +Standard_Boolean IGESData_ParamReader::ReadBoolean (const Message_Msg& amsg, Standard_Boolean& val, const Standard_Boolean exact) { - if (!PrepareRead(PC,Standard_False)) return Standard_False; + const IGESData_ParamCursor PC(thecurr); + if (!PrepareRead(PC,NULL,Standard_False)) return Standard_False; const Interface_FileParameter& FP = theparams->Value(theindex+thebase); if (FP.ParamType() != Interface_ParamInteger) { if (FP.ParamType() == Interface_ParamVoid) { @@ -490,10 +347,9 @@ Standard_Boolean IGESData_ParamReader::ReadBoolean //purpose : //======================================================================= -Standard_Boolean IGESData_ParamReader::ReadBoolean - (const IGESData_ParamCursor& PC, const Standard_CString mess, - Standard_Boolean& val, const Standard_Boolean exact) +Standard_Boolean IGESData_ParamReader::ReadBoolean (const Standard_CString mess, Standard_Boolean& val, const Standard_Boolean exact) { + const IGESData_ParamCursor PC(thecurr); if (!PrepareRead(PC,mess,Standard_False)) return Standard_False; const Interface_FileParameter& FP = theparams->Value(theindex+thebase); if (FP.ParamType() != Interface_ParamInteger) { @@ -524,109 +380,51 @@ Standard_Boolean IGESData_ParamReader::ReadBoolean } -// ReadReal for MoniTool - -//======================================================================= -//function : ReadReal -//purpose : -//======================================================================= - -Standard_Boolean IGESData_ParamReader::ReadReal (const IGESData_ParamCursor& PC, - Standard_Real& val) -{ - if (!PrepareRead(PC,Standard_False)) return Standard_False; -// return ReadingReal (theindex,amsg,val); - return ReadingReal (theindex,val); -} - - //======================================================================= //function : ReadReal //purpose : //======================================================================= -Standard_Boolean IGESData_ParamReader::ReadReal - (const IGESData_ParamCursor& PC,const Standard_CString mess, - Standard_Real& val) +Standard_Boolean IGESData_ParamReader::ReadReal (Standard_Real& val, const Standard_CString mess) { + const IGESData_ParamCursor PC(thecurr); if (!PrepareRead(PC,mess,Standard_False)) return Standard_False; - return ReadingReal (theindex,mess,val); + return ReadingReal (theindex,val,mess); } -// ReadXY for MoniTool - //======================================================================= //function : ReadXY //purpose : //======================================================================= -Standard_Boolean IGESData_ParamReader::ReadXY - (const IGESData_ParamCursor& PC,Message_Msg& /*amsg*/, gp_XY& val) -{ - if (!PrepareRead(PC,Standard_False,2)) return Standard_False; - Standard_Real X,Y = 0.; - Standard_Boolean stat = - (ReadingReal (theindex ,X) && - ReadingReal (theindex+1,Y) ); - if (stat) val.SetCoord(X,Y); - return stat; -} - - -//======================================================================= -//function : ReadXY -//purpose : -//======================================================================= - -Standard_Boolean IGESData_ParamReader::ReadXY - (const IGESData_ParamCursor& PC, const Standard_CString mess, gp_XY& val) +Standard_Boolean IGESData_ParamReader::ReadXY (gp_XY& val, const Standard_CString mess) { + const IGESData_ParamCursor PC(thecurr,1,2); if (!PrepareRead(PC,mess,Standard_False,2)) return Standard_False; Standard_Real X,Y = 0.; Standard_Boolean stat = - (ReadingReal (theindex ,mess,X) && - ReadingReal (theindex+1,mess,Y) ); + (ReadingReal (theindex ,X,mess) && + ReadingReal (theindex+1,Y,mess) ); if (stat) val.SetCoord(X,Y); return stat; } -// ReadXYZ for MoniTool - //======================================================================= //function : ReadXYZ //purpose : //======================================================================= -Standard_Boolean IGESData_ParamReader::ReadXYZ - (const IGESData_ParamCursor& PC,Message_Msg& /*amsg*/, gp_XYZ& val) -{ - if (!PrepareRead(PC,Standard_False,3)) return Standard_False; - Standard_Real X,Y = 0.,Z = 0.; - Standard_Boolean stat = - (ReadingReal (theindex ,X) && - ReadingReal (theindex+1,Y) && - ReadingReal (theindex+2,Z) ); - if (stat) val.SetCoord(X,Y,Z); - return Standard_True; -} - - -//======================================================================= -//function : ReadXYZ -//purpose : -//======================================================================= - -Standard_Boolean IGESData_ParamReader::ReadXYZ - (const IGESData_ParamCursor& PC, const Standard_CString mess, gp_XYZ& val) +Standard_Boolean IGESData_ParamReader::ReadXYZ (gp_XYZ& val, const Standard_CString mess) { + const IGESData_ParamCursor PC(thecurr,1,3); if (!PrepareRead(PC,mess,Standard_False,3)) return Standard_False; Standard_Real X,Y = 0.,Z = 0.; Standard_Boolean stat = - (ReadingReal (theindex ,mess,X) && - ReadingReal (theindex+1,mess,Y) && - ReadingReal (theindex+2,mess,Z) ); + (ReadingReal (theindex ,X,mess) && + ReadingReal (theindex+1,Y,mess) && + ReadingReal (theindex+2,Z,mess) ); if (stat) val.SetCoord(X,Y,Z); return Standard_True; } @@ -639,11 +437,10 @@ Standard_Boolean IGESData_ParamReader::ReadXYZ //purpose : //======================================================================= -Standard_Boolean IGESData_ParamReader::ReadText - (const IGESData_ParamCursor& PC, const Message_Msg& amsg, - Handle(TCollection_HAsciiString)& val) +Standard_Boolean IGESData_ParamReader::ReadText (const Message_Msg& amsg, Handle(TCollection_HAsciiString)& val) { - if (!PrepareRead(PC,Standard_False)) return Standard_False; + const IGESData_ParamCursor PC(thecurr); + if (!PrepareRead(PC,NULL,Standard_False)) return Standard_False; const Interface_FileParameter& FP = theparams->Value(theindex+thebase); if (FP.ParamType() != Interface_ParamText) { if (FP.ParamType() == Interface_ParamVoid) { @@ -673,10 +470,9 @@ Standard_Boolean IGESData_ParamReader::ReadText //purpose : //======================================================================= -Standard_Boolean IGESData_ParamReader::ReadText - (const IGESData_ParamCursor& PC, const Standard_CString mess, - Handle(TCollection_HAsciiString)& val) +Standard_Boolean IGESData_ParamReader::ReadText (const Standard_CString mess, Handle(TCollection_HAsciiString)& val) { + const IGESData_ParamCursor PC(thecurr); if (!PrepareRead(PC,mess,Standard_False)) return Standard_False; const Interface_FileParameter& FP = theparams->Value(theindex+thebase); if (FP.ParamType() != Interface_ParamText) { @@ -703,32 +499,25 @@ Standard_Boolean IGESData_ParamReader::ReadText } -// ReadEntity for MoniTool - //======================================================================= //function : ReadEntity //purpose : //======================================================================= Standard_Boolean IGESData_ParamReader::ReadEntity (const Handle(IGESData_IGESReaderData)& IR, - const IGESData_ParamCursor& PC, IGESData_Status& aStatus, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul) { + const IGESData_ParamCursor PC(thecurr); aStatus = IGESData_EntityError; - if (!PrepareRead(PC,Standard_False)) return Standard_False; + if (!PrepareRead(PC,NULL,Standard_False)) return Standard_False; Standard_Integer nval; -// if (!ReadingEntityNumber(theindex,amsg,nval)) return Standard_False; - if (!ReadingEntityNumber(theindex,nval)) return Standard_False; + if (!ReadingEntityNumber(theindex,nval,NULL)) return Standard_False; if (nval == 0) { val.Nullify(); if (!canbenul) { aStatus = IGESData_ReferenceError; - // Message_Msg Msg216 ("IGESP_216"); - // amsg.Arg(amsg.Value()); - // SendFail (amsg); - thelast = Standard_True; } else @@ -739,13 +528,10 @@ Standard_Boolean IGESData_ParamReader::ReadEntity (const Handle(IGESData_IGESRea if (val.IsNull()) return canbenul; // Cas du "Nul IGES" if (val->TypeNumber() == 0) { // Null ou pas encore rempli ... - if (IR->DirType(nval).Type() == 0) { // le vrai critere (un peu cher) + if (IR->DirPart(nval).Type().Type() == 0) { // le vrai critere (un peu cher) val.Nullify(); if (!canbenul) { - aStatus = IGESData_EntityError; - // Message_Msg Msg217 ("IGES_217"); - //amsg.Arg(Msg217.Value()); - //SendFail (amsg); + aStatus = IGESData_EntityError; thelast = Standard_True; } else @@ -764,12 +550,13 @@ Standard_Boolean IGESData_ParamReader::ReadEntity (const Handle(IGESData_IGESRea //======================================================================= Standard_Boolean IGESData_ParamReader::ReadEntity - (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, + (const Handle(IGESData_IGESReaderData)& IR, const Standard_CString mess, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul) { + const IGESData_ParamCursor PC(thecurr); if (!PrepareRead(PC,mess,Standard_False)) return Standard_False; Standard_Integer nval; - if (!ReadingEntityNumber(theindex,mess,nval)) return Standard_False; + if (!ReadingEntityNumber(theindex,nval,mess)) return Standard_False; if (nval == 0) { val.Nullify(); if (!canbenul) { @@ -782,11 +569,11 @@ Standard_Boolean IGESData_ParamReader::ReadEntity if (val.IsNull()) return canbenul; // Cas du "Nul IGES" if (val->TypeNumber() == 0) { // Null ou pas encore rempli ... - if (IR->DirType(nval).Type() == 0) { // le vrai critere (un peu cher) + if (IR->DirPart(nval).Type().Type() == 0) { // le vrai critere (un peu cher) val.Nullify(); if (!canbenul) { - AddFail (mess," : IGES Null Entity",""); - thelast = Standard_True; + AddFail (mess," : IGES Null Entity",""); + thelast = Standard_True; } return canbenul; } @@ -803,22 +590,16 @@ Standard_Boolean IGESData_ParamReader::ReadEntity //======================================================================= Standard_Boolean IGESData_ParamReader::ReadEntity (const Handle(IGESData_IGESReaderData)& IR, - const IGESData_ParamCursor& PC, IGESData_Status& aStatus, const Handle(Standard_Type)& type, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul) { - Standard_Boolean res = ReadEntity (IR,PC,aStatus,val,canbenul); - if (!res) { - return res; - } + const Standard_Boolean res = ReadEntity (IR,aStatus,val,canbenul); + if (!res) return res; if (val.IsNull()) return res; if (!val->IsKind(type)) { aStatus = IGESData_TypeError; - // Message_Msg Msg218 ("IGES_218"); - //amsg.Arg(Msg218.Value()); - //SendFail(amsg); thelast = Standard_True; val.Nullify(); return Standard_False; @@ -834,11 +615,11 @@ Standard_Boolean IGESData_ParamReader::ReadEntity (const Handle(IGESData_IGESRea Standard_Boolean IGESData_ParamReader::ReadEntity (const Handle(IGESData_IGESReaderData)& IR, - const IGESData_ParamCursor& PC, const Standard_CString mess, + const Standard_CString mess, const Handle(Standard_Type)& type, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul) { - Standard_Boolean res = ReadEntity (IR,PC,mess,val,canbenul); + Standard_Boolean res = ReadEntity (IR,mess,val,canbenul); if (!res) return res; if (val.IsNull()) return res; if (!val->IsKind(type)) { @@ -858,14 +639,12 @@ Standard_Boolean IGESData_ParamReader::ReadEntity //purpose : //======================================================================= -Standard_Boolean IGESData_ParamReader::ReadInts - (const IGESData_ParamCursor& PC, const Message_Msg& amsg , - Handle(TColStd_HArray1OfInteger)& val, const Standard_Integer index) +Standard_Boolean IGESData_ParamReader::ReadInts (const IGESData_ParamCursor& PC, const Message_Msg& amsg, Handle(TColStd_HArray1OfInteger)& val) { - if (!PrepareRead(PC,Standard_True)) return Standard_False; + if (!PrepareRead(PC,NULL,Standard_True)) return Standard_False; if (thenbitem == 0) return Standard_True; // vide : retour Null ... - val = new TColStd_HArray1OfInteger (index,index+thenbitem*thetermsz-1); - Standard_Integer ind = index; + val = new TColStd_HArray1OfInteger (1,thenbitem*thetermsz); + Standard_Integer ind = 1; for (Standard_Integer i = FirstRead(); i > 0; i = NextRead()) { const Interface_FileParameter& FP = theparams->Value(i+thebase); @@ -887,14 +666,12 @@ Standard_Boolean IGESData_ParamReader::ReadInts //purpose : //======================================================================= -Standard_Boolean IGESData_ParamReader::ReadInts - (const IGESData_ParamCursor& PC, const Standard_CString mess, - Handle(TColStd_HArray1OfInteger)& val, const Standard_Integer index) +Standard_Boolean IGESData_ParamReader::ReadInts (const IGESData_ParamCursor& PC, const Standard_CString mess, Handle(TColStd_HArray1OfInteger)& val) { if (!PrepareRead(PC,mess,Standard_True)) return Standard_False; if (thenbitem == 0) return Standard_True; // vide : retour Null ... - val = new TColStd_HArray1OfInteger (index,index+thenbitem*thetermsz-1); - Standard_Integer ind = index; + val = new TColStd_HArray1OfInteger (1,thenbitem*thetermsz); + Standard_Integer ind = 1; for (Standard_Integer i = FirstRead(); i > 0; i = NextRead()) { const Interface_FileParameter& FP = theparams->Value(i+thebase); @@ -924,14 +701,14 @@ Standard_Boolean IGESData_ParamReader::ReadReals (const IGESData_ParamCursor& PC,Message_Msg& /*amsg*/, Handle(TColStd_HArray1OfReal)& val, const Standard_Integer index) { - if (!PrepareRead(PC,Standard_True)) return Standard_False; + if (!PrepareRead(PC,NULL,Standard_True)) return Standard_False; if (thenbitem == 0) return Standard_True; // vide : retour Null ... val = new TColStd_HArray1OfReal (index,index+thenbitem*thetermsz-1); Standard_Integer ind = index; for (Standard_Integer i = FirstRead(); i > 0; i = NextRead()) { Standard_Real rval; - if (!ReadingReal(i,rval)) return Standard_False; + if (!ReadingReal(i,rval,NULL)) return Standard_False; val->SetValue (ind, rval); ind ++; } return Standard_True; @@ -954,7 +731,7 @@ Standard_Boolean IGESData_ParamReader::ReadReals for (Standard_Integer i = FirstRead(); i > 0; i = NextRead()) { Standard_Real rval; - if (!ReadingReal(i,mess,rval)) return Standard_False; + if (!ReadingReal(i,rval,mess)) return Standard_False; val->SetValue (ind, rval); ind ++; } return Standard_True; @@ -972,7 +749,7 @@ Standard_Boolean IGESData_ParamReader::ReadTexts (const IGESData_ParamCursor& PC, const Message_Msg& amsg , Handle(Interface_HArray1OfHAsciiString)& val, const Standard_Integer index) { - if (!PrepareRead(PC,Standard_True)) return Standard_False; + if (!PrepareRead(PC,NULL,Standard_True)) return Standard_False; if (thenbitem == 0) return Standard_True; // vide : retour Null ... val = new Interface_HArray1OfHAsciiString(index,index+thenbitem*thetermsz-1); Standard_Integer ind = index; @@ -990,7 +767,6 @@ Standard_Boolean IGESData_ParamReader::ReadTexts return Standard_False; } Handle(TCollection_HAsciiString) tval = new TCollection_HAsciiString (FP.CValue()); - // IGESFile_Read a filtre Standard_Integer lnt = tval->Length(); Standard_Integer lnh = tval->Location(1,'H',1,lnt); if (lnh <= 1 || lnh >= lnt) { @@ -1035,7 +811,6 @@ Standard_Boolean IGESData_ParamReader::ReadTexts return Standard_False; } Handle(TCollection_HAsciiString) tval = new TCollection_HAsciiString (FP.CValue()); - // IGESFile_Read a filtre Standard_Integer lnt = tval->Length(); Standard_Integer lnh = tval->Location(1,'H',1,lnt); if (lnh <= 1 || lnh >= lnt) { @@ -1065,7 +840,7 @@ Standard_Boolean IGESData_ParamReader::ReadEnts const IGESData_ParamCursor& PC, const Message_Msg& amsg , Handle(IGESData_HArray1OfIGESEntity)& val, const Standard_Integer index) { - if (!PrepareRead(PC,Standard_True)) return Standard_False; + if (!PrepareRead(PC,NULL,Standard_True)) return Standard_False; if (thenbitem == 0) return Standard_True; // vide : retour Null ... Standard_Integer indmax = index+thenbitem*thetermsz-1; val = new IGESData_HArray1OfIGESEntity (index , indmax); @@ -1075,12 +850,12 @@ Standard_Boolean IGESData_ParamReader::ReadEnts Standard_Integer i; // svv Jan11 2000 : porting on DEC for (i = FirstRead(); i > 0; i = NextRead()) { Standard_Integer nval; - if (!ReadingEntityNumber(i,nval)) nval = 0; //return Standard_False; + if (!ReadingEntityNumber(i,nval,NULL)) nval = 0; //return Standard_False; if (nval < 0) nbneg ++; if (nval > 0) { DeclareAndCast(IGESData_IGESEntity,anent,IR->BoundEntity(nval)); if (anent.IsNull()) nbnul ++; - else if (IR->DirType(nval).Type() == 0) nbnul ++; + else if (IR->DirPart(nval).Type().Type() == 0) nbnul ++; else { val->SetValue (ind, anent); ind ++; } } } @@ -1117,15 +892,15 @@ Standard_Boolean IGESData_ParamReader::ReadEnts Standard_Integer ind = index; Standard_Integer nbneg = 0, nbnul = 0; - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i; for (i = FirstRead(); i > 0; i = NextRead()) { Standard_Integer nval; - if (!ReadingEntityNumber(i,mess,nval)) nval = 0; //return Standard_False; + if (!ReadingEntityNumber(i,nval,mess)) nval = 0; if (nval < 0) nbneg ++; if (nval > 0) { DeclareAndCast(IGESData_IGESEntity,anent,IR->BoundEntity(nval)); if (anent.IsNull()) nbnul ++; - else if (IR->DirType(nval).Type() == 0) nbnul ++; + else if (IR->DirPart(nval).Type().Type() == 0) nbnul ++; else { val->SetValue (ind, anent); ind ++; } } } @@ -1165,12 +940,12 @@ Standard_Boolean IGESData_ParamReader::ReadEntList Interface_EntityList& val, const Standard_Boolean ord) { - if (!PrepareRead(PC,Standard_True)) return Standard_False; + if (!PrepareRead(PC,NULL,Standard_True)) return Standard_False; val.Clear(); if (thenbitem == 0) return Standard_True; // vide : retour Null ... for (Standard_Integer i = FirstRead(); i > 0; i = NextRead()) { Standard_Integer nval; - if (!ReadingEntityNumber(i,nval)) return Standard_False; + if (!ReadingEntityNumber(i,nval,NULL)) return Standard_False; if (nval < 0) { Message_Msg Msg219 ("XSTEP_219"); @@ -1185,7 +960,7 @@ Standard_Boolean IGESData_ParamReader::ReadEntList amsg.Arg(Msg216.Value()); SendWarning(amsg); } - else if (IR->DirType(nval).Type() == 0) + else if (IR->DirPart(nval).Type().Type() == 0) { Message_Msg Msg217 ("XSTEP_217"); SendWarning(TCollection_AsciiString(Msg217.Value()).ToCString()); @@ -1212,12 +987,12 @@ Standard_Boolean IGESData_ParamReader::ReadEntList if (thenbitem == 0) return Standard_True; // vide : retour Null ... for (Standard_Integer i = FirstRead(); i > 0; i = NextRead()) { Standard_Integer nval; - if (!ReadingEntityNumber(i,mess,nval)) return Standard_False; + if (!ReadingEntityNumber(i,nval,mess)) return Standard_False; if (nval < 0) AddWarning(" Negative Pointer, skipped",""); if (nval <= 0) continue; DeclareAndCast(IGESData_IGESEntity,anent,IR->BoundEntity(nval)); if (anent.IsNull()) AddWarning(" Null Pointer, skipped",""); - else if (IR->DirType(nval).Type() == 0) AddWarning(" Pointer to IGES Null Entity, skipped",""); + else if (IR->DirPart(nval).Type().Type() == 0) AddWarning(" Pointer to IGES Null Entity, skipped",""); else if (ord) val.Append (anent); else val.Add (anent); } @@ -1225,93 +1000,24 @@ Standard_Boolean IGESData_ParamReader::ReadEntList } -// ReadingReal for MoniTool - //======================================================================= //function : ReadingReal //purpose : //======================================================================= -Standard_Boolean IGESData_ParamReader::ReadingReal (const Standard_Integer num, - Standard_Real& val) -{ - const Interface_FileParameter& FP = theparams->Value(num+thebase); - if(FP.ParamType() == Interface_ParamInteger) { - if (!pbrealint) { - if (testconv < 0) testconv = 0; //Interface_Static::IVal("iges.convert.read"); - if (testconv > 0) { - // char ssem[100]; - pbrealint = num; - // sprintf(ssem,": Integer converted to Real, 1st rank=%d",num); - // AddWarning (mess,ssem,"At least one Integer converted to Real, 1st rank=%d"); - } - } - Standard_Integer ival = atoi(FP.CValue()); - val = ival; - return Standard_True; - } - char text[50]; - Standard_CString orig = FP.CValue(); - Standard_Integer i , j = 0; - for (i = 0; i < 50; i ++) { - if (orig[i] == 'D' || orig[i] == 'd') - text[j++] = 'e'; - else - text[j++] = orig[i]; - if (orig[i] == '\0') break; - } - if (FP.ParamType() == Interface_ParamReal) - val = Atof(text); - else if (FP.ParamType() == Interface_ParamEnum) { // convention - if (!pbrealform) { - if (testconv < 0) testconv = 0; //Interface_Static::IVal("iges.convert.read"); - if (testconv > 0) { - // char ssem[100]; - pbrealform = num; - // sprintf(ssem,"Real with no decimal point (added), 1st rank=%d",num); - // AddWarning (mess,ssem,"Real with no decimal point (added), 1st rank=%d"); - } - } - // Par convention (pas d enum explicite dans IGES), signifie - // "reconnu comme flottant mais pas blanc-bleu" c-a-d sans point decimal - // mais avec exposant (sinon ce serait un entier) - // -> un message avertissement + on ajoute le point puis on convertit - - val = Atof(text); - } else if (FP.ParamType() == Interface_ParamVoid) { - val = 0.0; // DEFAULT - } else { - // char ssem[100]; - // sprintf(ssem,": not given as Real, rank %d",num); - // AddFail (mess,ssem,": not given as Real, rank %d"); - /* TCollection_AsciiString mess = amsg.Value(); - if ((mess.Search("ter %d"))||(mess.Search("tre %d"))) - amsg.AddInteger(num); // Parameter index - */ - return Standard_False; - } - return Standard_True; -} - - -//======================================================================= -//function : ReadingReal -//purpose : -//======================================================================= - -Standard_Boolean IGESData_ParamReader::ReadingReal - (const Standard_Integer num, const Standard_CString mess, - Standard_Real& val) +Standard_Boolean IGESData_ParamReader::ReadingReal (const Standard_Integer num, Standard_Real& val, const Standard_CString mess) { const Interface_FileParameter& FP = theparams->Value(num+thebase); if (FP.ParamType() == Interface_ParamInteger) { if (!pbrealint) { - if (testconv < 0) testconv = 0; //Interface_Static::IVal("iges.convert.read"); + if (testconv < 0) testconv = 0; if (testconv > 0) { - char ssem[100]; - pbrealint = num; - sprintf(ssem,": Integer converted to Real, 1st rank=%d",num); - AddWarning (mess,ssem,"At least one Integer converted to Real, 1st rank=%d"); + pbrealint = num; + if (mess) { + char ssem[100]; + sprintf(ssem,": Integer converted to Real, 1st rank=%d",num); + AddWarning (mess,ssem,"At least one Integer converted to Real, 1st rank=%d"); + } } } Standard_Integer ival = atoi(FP.CValue()); @@ -1332,78 +1038,54 @@ Standard_Boolean IGESData_ParamReader::ReadingReal val = Atof(text); else if (FP.ParamType() == Interface_ParamEnum) { // convention if (!pbrealform) { - if (testconv < 0) testconv = 0; //Interface_Static::IVal("iges.convert.read"); + if (testconv < 0) testconv = 0; if (testconv > 0) { - char ssem[100]; - pbrealform = num; - sprintf(ssem,"Real with no decimal point (added), 1st rank=%d",num); - AddWarning (mess,ssem,"Real with no decimal point (added), 1st rank=%d"); + pbrealform = num; + if (mess) { + char ssem[100]; + sprintf(ssem,"Real with no decimal point (added), 1st rank=%d",num); + AddWarning (mess,ssem,"Real with no decimal point (added), 1st rank=%d"); + } } } // Par convention (pas d enum explicite dans IGES), signifie // "reconnu comme flottant mais pas blanc-bleu" c-a-d sans point decimal // mais avec exposant (sinon ce serait un entier) // -> un message avertissement + on ajoute le point puis on convertit - val = Atof(text); } else if (FP.ParamType() == Interface_ParamVoid) { val = 0.0; // DEFAULT } else { val = 0.0; // DEFAULT - char ssem[100]; - sprintf(ssem,": not given as Real, rank %d",num); - AddFail (mess,ssem,": not given as Real, rank %d"); + if (mess) { + char ssem[100]; + sprintf(ssem,": not given as Real, rank %d",num); + AddFail (mess,ssem,": not given as Real, rank %d"); + } return Standard_False; } return Standard_True; } -// ReadingEntityNumber for MoniTool - -//======================================================================= -//function : ReadingEntityNumber -//purpose : -//======================================================================= - -Standard_Boolean IGESData_ParamReader::ReadingEntityNumber (const Standard_Integer num, - Standard_Integer& val) -{ - const Interface_FileParameter& FP = theparams->Value(num+thebase); - val = ParamNumber(num); - if (val == 0) { - Standard_Boolean nulref = Standard_False; - if (FP.ParamType() == Interface_ParamInteger) - nulref = (atoi(FP.CValue()) == 0); - else if (FP.ParamType() == Interface_ParamVoid) nulref = Standard_True; - if (!nulref) { - // AddFail (mess," : cannot refer to an Entity",""); - thelast = Standard_True; - return Standard_False; - } - } - return Standard_True; -} - - //======================================================================= //function : ReadingEntityNumber //purpose : //======================================================================= -Standard_Boolean IGESData_ParamReader::ReadingEntityNumber - (const Standard_Integer num, const Standard_CString mess, - Standard_Integer& val) +Standard_Boolean IGESData_ParamReader::ReadingEntityNumber (const Standard_Integer num, Standard_Integer& val, const Standard_CString mess) { const Interface_FileParameter& FP = theparams->Value(num+thebase); val = ParamNumber(num); if (val == 0) { Standard_Boolean nulref = Standard_False; if (FP.ParamType() == Interface_ParamInteger) - nulref = (atoi(FP.CValue()) == 0); - else if (FP.ParamType() == Interface_ParamVoid) nulref = Standard_True; + nulref = (atoi(FP.CValue()) == 0); + else if (FP.ParamType() == Interface_ParamVoid) + nulref = Standard_True; if (!nulref) { - AddFail (mess," : cannot refer to an Entity",""); + if (mess) + AddFail (mess," : cannot refer to an Entity",""); thelast = Standard_True; return Standard_False; } @@ -1565,39 +1247,6 @@ void IGESData_ParamReader::Mend (const Standard_CString pref) } -//======================================================================= -//function : HasFailed -//purpose : -//======================================================================= - -Standard_Boolean IGESData_ParamReader::HasFailed () const -{ - return !thelast; -} //thecheck.HasFailed(); - - -//======================================================================= -//function : Check -//purpose : -//======================================================================= - -const Handle(Interface_Check)& IGESData_ParamReader::Check () const -{ - return thecheck; -} - - -//======================================================================= -//function : CCheck -//purpose : -//======================================================================= - -Handle(Interface_Check)& IGESData_ParamReader::CCheck () -{ - return thecheck; -} - - //======================================================================= //function : IsCheckEmpty //purpose : diff --git a/src/IGESData/IGESData_ParamReader.hxx b/src/IGESData/IGESData_ParamReader.hxx index fa708501ef..e8b6dff589 100644 --- a/src/IGESData/IGESData_ParamReader.hxx +++ b/src/IGESData/IGESData_ParamReader.hxx @@ -70,8 +70,8 @@ public: Standard_EXPORT IGESData_ParamReader(const Handle(Interface_ParamList)& list, const Handle(Interface_Check)& ach, const Standard_Integer base = 1, const Standard_Integer nbpar = 0, const Standard_Integer num = 0); //! Returns the entity number in the file - Standard_EXPORT Standard_Integer EntityNumber() const; - + Standard_Integer EntityNumber() const { return thenum; } + //! resets state (stage, current param number, check with no fail) Standard_EXPORT void Clear(); @@ -81,8 +81,8 @@ public: //! Properties), which can be empty, or even absent. Hence, it is //! necessary to know, at the end of specific reading, how many //! parameters have been read : the optionnal lists follow - Standard_EXPORT Standard_Integer CurrentNumber() const; - + Standard_Integer CurrentNumber() const { return thecurr; } + //! sets current parameter number to a new value //! must be done at end of each step : set on first parameter //! following last read one; is done by some Read... methods @@ -90,21 +90,21 @@ public: //! num greater than NbParams means that following lists are empty //! If current num is not managed, it remains at 1, which probably //! will cause error when successive steps of reading are made - Standard_EXPORT void SetCurrentNumber (const Standard_Integer num); - + void SetCurrentNumber (const Standard_Integer num) { thecurr = num; } + //! gives current stage (Own-Props-Assocs-End, begins at Own) - Standard_EXPORT IGESData_ReadStage Stage() const; - + IGESData_ReadStage Stage() const { return thestage; } + //! passes to next stage (must be linked with setting Current) Standard_EXPORT void NextStage(); //! passes directly to the end of reading process - Standard_EXPORT void EndAll(); - + void EndAll() { thestage = IGESData_ReadEnd; } + //! returns number of parameters (minus the first one) //! following method skip the first parameter (1 gives the 2nd) - Standard_EXPORT Standard_Integer NbParams() const; - + Standard_Integer NbParams() const { return (thenbpar - 1); } + //! returns type of parameter; note that "Ident" or "Sub" cannot //! be encountered, they correspond to "Integer", see also below Standard_EXPORT Interface_ParamType ParamType (const Standard_Integer num) const; @@ -119,8 +119,8 @@ public: //! says if a parameter can be regarded as an entity reference //! (see Prepare from IGESReaderData for more explanation) //! Note that such a parameter can seen as be a plain Integer too - Standard_EXPORT Standard_Boolean IsParamEntity (const Standard_Integer num) const; - + Standard_Boolean IsParamEntity (const Standard_Integer num) const { return (ParamNumber(num) != 0); } + //! returns entity number corresponding to a parameter if there is //! otherwise zero (according criterium IsParamEntity) Standard_EXPORT Standard_Integer ParamNumber (const Standard_Integer num) const; @@ -155,17 +155,15 @@ public: //! For Message Standard_EXPORT Standard_Boolean DefinedElseSkip(); - Standard_EXPORT Standard_Boolean ReadInteger (const IGESData_ParamCursor& PC, Standard_Integer& val); - //! Reads an Integer value designated by PC //! The method Current designates the current parameter and //! advances the Current Number by one after reading //! Note that if a count (not 1) is given, it is ignored //! If it is not an Integer, fills Check with a Fail (using mess) //! and returns False - Standard_EXPORT Standard_Boolean ReadInteger (const IGESData_ParamCursor& PC, const Standard_CString mess, Standard_Integer& val); + Standard_EXPORT Standard_Boolean ReadInteger (Standard_Integer& val, const Standard_CString mess = NULL); - Standard_EXPORT Standard_Boolean ReadBoolean (const IGESData_ParamCursor& PC, const Message_Msg& amsg, Standard_Boolean& val, const Standard_Boolean exact = Standard_True); + Standard_EXPORT Standard_Boolean ReadBoolean (const Message_Msg& amsg, Standard_Boolean& val, const Standard_Boolean exact = Standard_True); //! Reads a Boolean value from parameter "num" //! A Boolean is given as an Integer value 0 (False) or 1 (True) @@ -175,42 +173,36 @@ public: //! (with a Warning error message, and return is True) //! In case of error (not an Integer, or not 0/1 and exact True), //! Check is filled with a Fail (using mess) and return is False - Standard_EXPORT Standard_Boolean ReadBoolean (const IGESData_ParamCursor& PC, const Standard_CString mess, Standard_Boolean& val, const Standard_Boolean exact = Standard_True); - - Standard_EXPORT Standard_Boolean ReadReal (const IGESData_ParamCursor& PC, Standard_Real& val); - + Standard_EXPORT Standard_Boolean ReadBoolean (const Standard_CString mess, Standard_Boolean& val, const Standard_Boolean exact = Standard_True); + //! Reads a Real value from parameter "num" //! An Integer is accepted (Check is filled with a Warning //! message) and causes return to be True (as normal case) //! In other cases, Check is filled with a Fail and return is False - Standard_EXPORT Standard_Boolean ReadReal (const IGESData_ParamCursor& PC, const Standard_CString mess, Standard_Real& val); - - Standard_EXPORT Standard_Boolean ReadXY (const IGESData_ParamCursor& PC, Message_Msg& amsg, gp_XY& val); + Standard_EXPORT Standard_Boolean ReadReal (Standard_Real& val, const Standard_CString mess = NULL); //! Reads a couple of Real values (X,Y) from parameter "num" //! Integers are accepted (Check is filled with a Warning //! message) and cause return to be True (as normal case) //! In other cases, Check is filled with a Fail and return is False - Standard_EXPORT Standard_Boolean ReadXY (const IGESData_ParamCursor& PC, const Standard_CString mess, gp_XY& val); - - Standard_EXPORT Standard_Boolean ReadXYZ (const IGESData_ParamCursor& PC, Message_Msg& amsg, gp_XYZ& val); + Standard_EXPORT Standard_Boolean ReadXY (gp_XY& val, const Standard_CString mess = NULL); //! Reads a triplet of Real values (X,Y,Z) from parameter "num" //! Integers are accepted (Check is filled with a Warning //! message) and cause return to be True (as normal case) //! In other cases, Check is filled with a Fail and return is False //! For Message - Standard_EXPORT Standard_Boolean ReadXYZ (const IGESData_ParamCursor& PC, const Standard_CString mess, gp_XYZ& val); + Standard_EXPORT Standard_Boolean ReadXYZ (gp_XYZ& val, const Standard_CString mess = NULL); - Standard_EXPORT Standard_Boolean ReadText (const IGESData_ParamCursor& PC, const Message_Msg& amsg, Handle(TCollection_HAsciiString)& val); + Standard_EXPORT Standard_Boolean ReadText (const Message_Msg& amsg, Handle(TCollection_HAsciiString)& val); //! Reads a Text value from parameter "num", as a String from //! Collection, that is, Hollerith text without leading "nnnH" //! If it is not a String, fills Check with a Fail (using mess) //! and returns False - Standard_EXPORT Standard_Boolean ReadText (const IGESData_ParamCursor& PC, const Standard_CString mess, Handle(TCollection_HAsciiString)& val); + Standard_EXPORT Standard_Boolean ReadText (const Standard_CString mess, Handle(TCollection_HAsciiString)& val); - Standard_EXPORT Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, IGESData_Status& aStatus, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul = Standard_False); + Standard_EXPORT Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, IGESData_Status& aStatus, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul = Standard_False); //! Reads an IGES entity from parameter "num" //! An Entity is known by its reference, which has the form of an @@ -220,16 +212,16 @@ public: //! If is False, a Null Reference causes an Error //! If the parameter cannot refer to an entity (or null), fills //! Check with a Fail (using mess) and returns False - Standard_EXPORT Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, const Standard_CString mess, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul = Standard_False); + Standard_EXPORT Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const Standard_CString mess, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul = Standard_False); - Standard_EXPORT Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, IGESData_Status& aStatus, const Handle(Standard_Type)& type, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul = Standard_False); + Standard_EXPORT Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, IGESData_Status& aStatus, const Handle(Standard_Type)& type, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul = Standard_False); //! Safe variant for arbitrary type of argument template - Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, IGESData_Status& aStatus, const Handle(Standard_Type)& type, Handle(T)& val, const Standard_Boolean canbenul = Standard_False) + Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, IGESData_Status& aStatus, const Handle(Standard_Type)& type, Handle(T)& val, const Standard_Boolean canbenul = Standard_False) { Handle(IGESData_IGESEntity) aVal = val; - Standard_Boolean aRes = ReadEntity (IR, PC, aStatus, type, aVal, canbenul); + Standard_Boolean aRes = ReadEntity (IR, aStatus, type, aVal, canbenul); val = Handle(T)::DownCast(aVal); return aRes && (canbenul || ! val.IsNull()); } @@ -239,19 +231,19 @@ public: //! Then, gives the same fail cases as ReadEntity without Type, //! plus the case "Incorrect Type" //! (in such a case, returns False and givel = Null) - Standard_EXPORT Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, const Standard_CString mess, const Handle(Standard_Type)& type, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul = Standard_False); + Standard_EXPORT Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const Standard_CString mess, const Handle(Standard_Type)& type, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul = Standard_False); //! Safe variant for arbitrary type of argument template - Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, const Standard_CString mess, const Handle(Standard_Type)& type, Handle(T)& val, const Standard_Boolean canbenul = Standard_False) + Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const Standard_CString mess, const Handle(Standard_Type)& type, Handle(T)& val, const Standard_Boolean canbenul = Standard_False) { Handle(IGESData_IGESEntity) aVal = val; - Standard_Boolean aRes = ReadEntity (IR, PC, mess, type, aVal, canbenul); + Standard_Boolean aRes = ReadEntity (IR, mess, type, aVal, canbenul); val = Handle(T)::DownCast(aVal); return aRes && (canbenul || ! val.IsNull()); } - Standard_EXPORT Standard_Boolean ReadInts (const IGESData_ParamCursor& PC, const Message_Msg& amsg, Handle(TColStd_HArray1OfInteger)& val, const Standard_Integer index = 1); + Standard_EXPORT Standard_Boolean ReadInts (const IGESData_ParamCursor& PC, const Message_Msg& amsg, Handle(TColStd_HArray1OfInteger)& val); //! Reads a list of Integer values, defined by PC (with a count of //! parameters). PC can start from Current Number and command it @@ -259,7 +251,7 @@ public: //! The list is given as a HArray1, numered from "index" //! If all params are not Integer, Check is filled (using mess) //! and return value is False - Standard_EXPORT Standard_Boolean ReadInts (const IGESData_ParamCursor& PC, const Standard_CString mess, Handle(TColStd_HArray1OfInteger)& val, const Standard_Integer index = 1); + Standard_EXPORT Standard_Boolean ReadInts (const IGESData_ParamCursor& PC, const Standard_CString mess, Handle(TColStd_HArray1OfInteger)& val); Standard_EXPORT Standard_Boolean ReadReals (const IGESData_ParamCursor& PC, Message_Msg& amsg, Handle(TColStd_HArray1OfReal)& val, const Standard_Integer index = 1); @@ -307,22 +299,6 @@ public: //! Warning Give "ord" to False ONLY if order is not significant Standard_EXPORT Standard_Boolean ReadEntList (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, const Standard_CString mess, Interface_EntityList& val, const Standard_Boolean ord = Standard_True); - Standard_EXPORT Standard_Boolean ReadingReal (const Standard_Integer num, Standard_Real& val); - - //! Routine which reads a Real parameter, given its number - //! Same conditions as ReadReal for mess, val, and return value - Standard_EXPORT Standard_Boolean ReadingReal (const Standard_Integer num, const Standard_CString mess, Standard_Real& val); - - Standard_EXPORT Standard_Boolean ReadingEntityNumber (const Standard_Integer num, Standard_Integer& val); - - //! Routine which reads an Entity Number (which allows to read the - //! Entity in the IGESReaderData by BoundEntity), given its number - //! in the list of Parameters - //! Same conditions as ReadEntity for mess, val, and return value - //! In particular, returns True and val to zero means Null Entity, - //! and val not zero means Entity read by BoundEntity - Standard_EXPORT Standard_Boolean ReadingEntityNumber (const Standard_Integer num, const Standard_CString mess, Standard_Integer& val); - Standard_EXPORT void SendFail (const Message_Msg& amsg); Standard_EXPORT void SendWarning (const Message_Msg& amsg); @@ -340,34 +316,22 @@ public: Standard_EXPORT void Mend (const Standard_CString pref = ""); //! says if fails have been recorded into the Check - Standard_EXPORT Standard_Boolean HasFailed() const; - + Standard_Boolean HasFailed() const { return !thelast; } + //! returns the Check //! Note that any error signaled above is also recorded into it - Standard_EXPORT const Handle(Interface_Check)& Check() const; - + const Handle(Interface_Check)& Check() const { return thecheck; } + //! returns the check in a way which allows to work on it directly //! (i.e. messages added to the Check are added to ParamReader too) - Standard_EXPORT Handle(Interface_Check)& CCheck(); - + Handle(Interface_Check)& CCheck() { return thecheck; } + //! Returns True if the Check is Empty //! Else, it has to be recorded with the Read Entity Standard_EXPORT Standard_Boolean IsCheckEmpty() const; + private: - - -protected: - - - - - -private: - - - Standard_EXPORT Standard_Boolean PrepareRead (const IGESData_ParamCursor& PC, const Standard_Boolean several, const Standard_Integer size = 1); - //! Prepares work for Read... methods which call it to begin //! The required count of parameters must not overpass NbParams. //! If several is given False, PC count must be one. @@ -387,6 +351,18 @@ private: //! Then commands to skip 1 parameter (default) or nb if given Standard_EXPORT Standard_Integer NextRead (const Standard_Integer nb = 1); + //! Routine which reads a Real parameter, given its number + //! Same conditions as ReadReal for mess, val, and return value + Standard_EXPORT Standard_Boolean ReadingReal (const Standard_Integer num, Standard_Real& val, const Standard_CString mess); + + //! Routine which reads an Entity Number (which allows to read the + //! Entity in the IGESReaderData by BoundEntity), given its number + //! in the list of Parameters + //! Same conditions as ReadEntity for mess, val, and return value + //! In particular, returns True and val to zero means Null Entity, + //! and val not zero means Entity read by BoundEntity + Standard_EXPORT Standard_Boolean ReadingEntityNumber (const Standard_Integer num, Standard_Integer& val, const Standard_CString mess); + //! internal method which builds a Fail message from an //! identification "idm" and a diagnostic ("afail") //! Also feeds LastReadStatus @@ -407,7 +383,6 @@ private: //! empty means = Standard_EXPORT void AddWarning (const Standard_CString idm, const Standard_CString aw, const Standard_CString bw); - Handle(Interface_ParamList) theparams; Handle(Interface_Check) thecheck; Standard_Integer thebase; @@ -418,21 +393,12 @@ private: Standard_Integer theindex; Standard_Integer thenbitem; Standard_Integer theitemsz; - Standard_Integer theoffset; Standard_Integer thetermsz; Standard_Integer themaxind; Standard_Integer thenbterm; Standard_Integer pbrealint; Standard_Integer pbrealform; Standard_Integer thenum; - - }; - - - - - - #endif // _IGESData_ParamReader_HeaderFile diff --git a/src/IGESData/IGESData_Protocol.cxx b/src/IGESData/IGESData_Protocol.cxx index fc8a5e11f1..448a21f743 100644 --- a/src/IGESData/IGESData_Protocol.cxx +++ b/src/IGESData/IGESData_Protocol.cxx @@ -12,33 +12,376 @@ // commercial license or contractual agreement. -#include +#include #include #include #include #include -#include -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + IMPLEMENT_STANDARD_RTTIEXT(IGESData_Protocol,Interface_Protocol) // TypeNumber : Ici, on reconnait UndefinedEntity (faut bien quelqu un) - Standard_Integer IGESData_Protocol::TypeNumber - (const Handle(Standard_Type)& atype) const +Standard_Integer IGESData_Protocol::TypeNumber (const Handle(Standard_Type)& atype) const { if (atype->SubType(STANDARD_TYPE(IGESData_UndefinedEntity))) return 1; return 0; } - Handle(Interface_InterfaceModel) IGESData_Protocol::NewModel () const - { return new IGESData_IGESModel; } +Handle(Interface_InterfaceModel) IGESData_Protocol::NewModel () const +{ + return new IGESData_IGESModel; +} - Handle(Standard_Transient) IGESData_Protocol::UnknownEntity () const - { return new IGESData_UndefinedEntity; } +Handle(Standard_Transient) IGESData_Protocol::UnknownEntity () const +{ + return new IGESData_UndefinedEntity; +} + +Standard_Boolean IGESData_Protocol::IsUnknownEntity (const Handle(Standard_Transient)& ent) const +{ + return ent->IsKind(STANDARD_TYPE(IGESData_UndefinedEntity)); +} - Standard_Boolean IGESData_Protocol::IsUnknownEntity - (const Handle(Standard_Transient)& ent) const - { return ent->IsKind(STANDARD_TYPE(IGESData_UndefinedEntity)); } +Handle(IGESData_IGESEntity) IGESData_Protocol::NewEntity (const IGESData_IGESType &theType) const +{ + const Standard_Integer aType = theType.Type(); + const Standard_Integer aForm = theType.Form(); + + switch (aType) { + case 100 : return new IGESGeom_CircularArc; + case 102 : return new IGESGeom_CompositeCurve; + case 104 : return new IGESGeom_ConicArc; + case 106 : + switch (aForm) { + case 20: return new IGESDimen_CenterLine; + case 21: return new IGESDimen_CenterLine; + case 40: return new IGESDimen_WitnessLine; + default: + if (aForm < 20 || aForm > 40) return new IGESGeom_CopiousData; + if (aForm > 30 && aForm < 40) return new IGESDimen_Section; + break; + } + break; + case 108 : return new IGESGeom_Plane; + case 110 : return new IGESGeom_Line; + case 112 : return new IGESGeom_SplineCurve; + case 114 : return new IGESGeom_SplineSurface; + case 116 : return new IGESGeom_Point; + case 118 : return new IGESGeom_RuledSurface; + case 120 : return new IGESGeom_SurfaceOfRevolution; + case 122 : return new IGESGeom_TabulatedCylinder; + case 123 : return new IGESGeom_Direction; + case 124 : return new IGESGeom_TransformationMatrix; + case 125 : return new IGESGeom_Flash; + case 126 : return new IGESGeom_BSplineCurve; + case 128 : return new IGESGeom_BSplineSurface; + case 130 : return new IGESGeom_OffsetCurve; + case 132 : return new IGESDraw_ConnectPoint; //+ + case 134 : return new IGESAppli_Node; //+ + case 136 : return new IGESAppli_FiniteElement; //+ + case 138 : return new IGESAppli_NodalDisplAndRot; //+ + case 140 : return new IGESGeom_OffsetSurface; + case 141 : return new IGESGeom_Boundary; + case 142 : return new IGESGeom_CurveOnSurface; + case 143 : return new IGESGeom_BoundedSurface; + case 144 : return new IGESGeom_TrimmedSurface; + case 146 : return new IGESAppli_NodalResults(aForm); //+ + case 148 : return new IGESAppli_ElementResults(aForm); //+ + case 150 : return new IGESSolid_Block; + case 152 : return new IGESSolid_RightAngularWedge; + case 154 : return new IGESSolid_Cylinder; + case 156 : return new IGESSolid_ConeFrustum; + case 158 : return new IGESSolid_Sphere; + case 160 : return new IGESSolid_Torus; + case 162 : return new IGESSolid_SolidOfRevolution; + case 164 : return new IGESSolid_SolidOfLinearExtrusion; + case 168 : return new IGESSolid_Ellipsoid; + case 180 : return new IGESSolid_BooleanTree; + case 182 : return new IGESSolid_SelectedComponent; + case 184 : return new IGESSolid_SolidAssembly; + case 186 : return new IGESSolid_ManifoldSolid; + case 190 : return new IGESSolid_PlaneSurface; + case 192 : return new IGESSolid_CylindricalSurface; + case 194 : return new IGESSolid_ConicalSurface; + case 196 : return new IGESSolid_SphericalSurface; + case 198 : return new IGESSolid_ToroidalSurface; + case 202 : return new IGESDimen_AngularDimension; + case 204 : return new IGESDimen_CurveDimension; + case 206 : return new IGESDimen_DiameterDimension; + case 208 : return new IGESDimen_FlagNote; + case 210 : return new IGESDimen_GeneralLabel; + case 212 : return new IGESDimen_GeneralNote; + case 213 : return new IGESDimen_NewGeneralNote; + case 214 : return new IGESDimen_LeaderArrow; + case 216 : return new IGESDimen_LinearDimension; + case 218 : return new IGESDimen_OrdinateDimension; + case 220 : return new IGESDimen_PointDimension; + case 222 : return new IGESDimen_RadiusDimension; + case 228 : return new IGESDimen_GeneralSymbol; + case 230 : return new IGESDimen_SectionedArea; + case 302 : return new IGESDefs_AssociativityDef(aForm); //+ + case 304 : + switch (aForm) { + case 1 : return new IGESGraph_LineFontDefTemplate; //+ + case 2 : return new IGESGraph_LineFontDefPattern; //+ + default : break; + } + break; + case 306 : return new IGESDefs_MacroDef; //+ + case 308 : return new IGESBasic_SubfigureDef; + case 310 : return new IGESGraph_TextFontDef; //+ + case 312 : return new IGESGraph_TextDisplayTemplate(aForm); //+ + case 314 : return new IGESGraph_Color; //+ + case 316 : return new IGESDefs_UnitsData; //+ + case 320 : return new IGESDraw_NetworkSubfigureDef; //+ + case 322 : return new IGESDefs_AttributeDef(aForm); //+ + case 402 : + switch (aForm) { + case 1 : return new IGESBasic_Group; + case 3 : return new IGESDraw_ViewsVisible; + case 4 : return new IGESDraw_ViewsVisibleWithAttr; + case 5 : return new IGESDraw_LabelDisplay; //+ + case 7 : return new IGESBasic_GroupWithoutBackP; + case 9 : return new IGESBasic_SingleParent; + case 12 : return new IGESBasic_ExternalRefFileIndex; + case 13 : return new IGESDimen_DimensionedGeometry; + case 14 : return new IGESBasic_OrderedGroup; + case 15 : return new IGESBasic_OrderedGroupWithoutBackP; + case 16 : return new IGESDraw_Planar; //+ + case 18 : return new IGESAppli_Flow; //+ + case 19 : return new IGESDraw_SegmentedViewsVisible; //+ + case 20 : return new IGESAppli_PipingFlow; //+ + case 21 : return new IGESDimen_NewDimensionedGeometry; + default : break; + } + break; + case 404 : + switch (aForm) { + case 0 : return new IGESDraw_Drawing; //+ + case 1 : return new IGESDraw_DrawingWithRotation; //+ + default : break; + } + break; + case 406 : + switch (aForm) { + case 1 : return new IGESGraph_DefinitionLevel; //+ + case 2 : return new IGESAppli_RegionRestriction; //+ + case 3 : return new IGESAppli_LevelFunction; //+ + case 5 : return new IGESAppli_LineWidening; //+ + case 6 : return new IGESAppli_DrilledHole; //+ + case 7 : return new IGESAppli_ReferenceDesignator; //+ + case 8 : return new IGESAppli_PinNumber; //+ + case 9 : return new IGESAppli_PartNumber; //+ + case 10 : return new IGESBasic_Hierarchy; + case 11 : return new IGESDefs_TabularData; //+ + case 12 : return new IGESBasic_ExternalReferenceFile; + case 13 : return new IGESGraph_NominalSize; //+ + case 14 : return new IGESAppli_FlowLineSpec; //+ + case 15 : return new IGESBasic_Name; + case 16 : return new IGESGraph_DrawingSize; //+ + case 17 : return new IGESGraph_DrawingUnits; //+ + case 18 : return new IGESGraph_IntercharacterSpacing; //+ + case 19 : return new IGESGraph_LineFontPredefined; //+ + case 20 : return new IGESGraph_HighLight; //+ + case 21 : return new IGESGraph_Pick; //+ + case 22 : return new IGESGraph_UniformRectGrid; //+ + case 23 : return new IGESBasic_AssocGroupType; + case 24 : return new IGESAppli_LevelToPWBLayerMap; //+ + case 25 : return new IGESAppli_PWBArtworkStackup; //+ + case 26 : return new IGESAppli_PWBDrilledHole; //+ + case 27 : return new IGESDefs_GenericData; //+ + case 28 : return new IGESDimen_DimensionUnits; + case 29 : return new IGESDimen_DimensionTolerance; + case 30 : return new IGESDimen_DimensionDisplayData; + case 31 : return new IGESDimen_BasicDimension; + default : break; + } + break; + case 408 : return new IGESBasic_SingularSubfigure; + case 410 : + switch (aForm) { + case 0 : return new IGESDraw_View; //+ + case 1 : return new IGESDraw_PerspectiveView; //+ + default : break; + } + break; + case 412 : return new IGESDraw_RectArraySubfigure; //+ + case 414 : return new IGESDraw_CircArraySubfigure; //+ + case 416 : + switch (aForm) { + case 0 : return new IGESBasic_ExternalRefFileName; + case 1 : return new IGESBasic_ExternalRefFile; + case 2 : return new IGESBasic_ExternalRefFileName; + case 3 : return new IGESBasic_ExternalRefName; + case 4 : return new IGESBasic_ExternalRefLibName; + default : break; + } + break; + case 418 : return new IGESAppli_NodalConstraint; //+ + case 420 : return new IGESDraw_NetworkSubfigure; //+ + case 422 : return new IGESDefs_AttributeTable(aForm); //+ + case 430 : return new IGESSolid_SolidInstance; + case 502 : return new IGESSolid_VertexList; + case 504 : return new IGESSolid_EdgeList; + case 508 : return new IGESSolid_Loop; + case 510 : return new IGESSolid_Face; + case 514 : return new IGESSolid_Shell; + default : break; + } + + /*szv_c1:Standard_Boolean IGESData_DefaultGeneral::NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const + if (CN == 1) entto = new IGESData_UndefinedEntity; + if (CN == 2) entto = new IGESData_FreeFormatEntity;*/ + + return Handle(IGESData_IGESEntity)(); +} diff --git a/src/IGESData/IGESData_Protocol.hxx b/src/IGESData/IGESData_Protocol.hxx index 88e7c5706e..e51fb10e78 100644 --- a/src/IGESData/IGESData_Protocol.hxx +++ b/src/IGESData/IGESData_Protocol.hxx @@ -17,12 +17,9 @@ #ifndef _IGESData_Protocol_HeaderFile #define _IGESData_Protocol_HeaderFile -#include -#include - #include -class Interface_InterfaceModel; - +class IGESData_IGESEntity; +class IGESData_IGESType; class IGESData_Protocol; DEFINE_STANDARD_HANDLE(IGESData_Protocol, Interface_Protocol) @@ -50,6 +47,9 @@ class IGESData_Protocol : public Interface_Protocol //! Type UndefinedEntity, status Unknown Standard_EXPORT Standard_Boolean IsUnknownEntity (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE; + //! Creates a new entity of the given type + Standard_EXPORT Handle(IGESData_IGESEntity) NewEntity(const IGESData_IGESType &theType) const; + DEFINE_STANDARD_RTTIEXT(IGESData_Protocol,Interface_Protocol) }; diff --git a/src/IGESData/IGESData_ReadWriteModule.cxx b/src/IGESData/IGESData_ReadWriteModule.cxx deleted file mode 100644 index becf33c547..0000000000 --- a/src/IGESData/IGESData_ReadWriteModule.cxx +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESData_ReadWriteModule,Interface_ReaderModule) - -Standard_Integer IGESData_ReadWriteModule::CaseNum - (const Handle(Interface_FileReaderData)& data, - const Standard_Integer num) const -{ - IGESData_IGESType DT = GetCasted(IGESData_IGESReaderData,data)->DirType(num); - return CaseIGES (DT.Type() , DT.Form()); -} - - -void IGESData_ReadWriteModule::Read - (const Standard_Integer , - const Handle(Interface_FileReaderData)& , const Standard_Integer , - Handle(Interface_Check)& , const Handle(Standard_Transient)& ) const -{ - // IGESReaderTool fait tout -} diff --git a/src/IGESData/IGESData_ReadWriteModule.hxx b/src/IGESData/IGESData_ReadWriteModule.hxx deleted file mode 100644 index f2a10b724f..0000000000 --- a/src/IGESData/IGESData_ReadWriteModule.hxx +++ /dev/null @@ -1,88 +0,0 @@ -// Created on: 1993-09-06 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESData_ReadWriteModule_HeaderFile -#define _IGESData_ReadWriteModule_HeaderFile - -#include -class Interface_FileReaderData; -class Interface_Check; -class IGESData_IGESEntity; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; - - -class IGESData_ReadWriteModule; -DEFINE_STANDARD_HANDLE(IGESData_ReadWriteModule, Interface_ReaderModule) - -//! Defines basic File Access Module, under the control of -//! IGESReaderTool for Reading and IGESWriter for Writing : -//! Specific actions concern : Read and Write Own Parameters of -//! an IGESEntity. -//! The common parts (Directory Entry, Lists of Associativities -//! and Properties) are processed by IGESReaderTool & IGESWriter -//! -//! Each sub-class of ReadWriteModule is used in conjunction with -//! a sub-class of Protocol from IGESData and processes several -//! types of IGESEntity (typically, them of a package) : -//! The Protocol gives a unique positive integer Case Number for -//! each type of IGESEntity it recognizes, the corresponding -//! ReadWriteModule processes an Entity by using the Case Number -//! to known what is to do -//! On Reading, the general service NewVoid is used to create an -//! IGES Entity the first time -//! -//! Warning : Works with an IGESReaderData which stores "DE parts" of Items -class IGESData_ReadWriteModule : public Interface_ReaderModule -{ - public: - - //! Translates the Type of record in to a positive - //! Case Number, or 0 if failed. - //! Works with IGESReaderData which provides Type & Form Numbers, - //! and calls CaseIGES (see below) - Standard_EXPORT Standard_Integer CaseNum (const Handle(Interface_FileReaderData)& data, const Standard_Integer num) const Standard_OVERRIDE; - - //! Defines Case Numbers corresponding to the Entity Types taken - //! into account by a sub-class of ReadWriteModule (hence, each - //! sub-class of ReadWriteModule has to redefine this method) - //! Called by CaseNum. Its result will then be used to call - //! Read, etc ... - Standard_EXPORT virtual Standard_Integer CaseIGES (const Standard_Integer typenum, const Standard_Integer formnum) const = 0; - - //! General Read Function. See IGESReaderTool for more info - Standard_EXPORT void Read (const Standard_Integer CN, const Handle(Interface_FileReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(Standard_Transient)& ent) const Standard_OVERRIDE; - - //! Reads own parameters from file for an Entity; gives - //! access to them, detains parameter types and values - //! For each class, there must be a specific action provided - //! Note that Properties and Associativities Lists are Read by - //! specific methods (see below), they are called under control - //! of reading process (only one call) according Stage recorded - //! in ParamReader - Standard_EXPORT virtual void ReadOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const = 0; - - //! Writes own parameters to IGESWriter; defined for each class - //! (to be redefined for other IGES ReadWriteModules) - //! Warning : Properties and Associativities are directly managed by - //! WriteIGES, must not be sent by this method - Standard_EXPORT virtual void WriteOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, IGESData_IGESWriter& IW) const = 0; - - DEFINE_STANDARD_RTTIEXT(IGESData_ReadWriteModule,Interface_ReaderModule) -}; - -#endif // _IGESData_ReadWriteModule_HeaderFile diff --git a/src/IGESData/IGESData_SpecificLib.hxx b/src/IGESData/IGESData_SpecificLib.hxx deleted file mode 100644 index 8914d119ab..0000000000 --- a/src/IGESData/IGESData_SpecificLib.hxx +++ /dev/null @@ -1,115 +0,0 @@ -// Created on: 1992-04-06 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESData_SpecificLib_HeaderFile -#define _IGESData_SpecificLib_HeaderFile - -#include -#include -#include - -#include -#include -class IGESData_NodeOfSpecificLib; -class Standard_NoSuchObject; -class IGESData_IGESEntity; -class IGESData_SpecificModule; -class IGESData_GlobalNodeOfSpecificLib; -class Interface_Protocol; - - - -class IGESData_SpecificLib -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! Adds a couple (Module-Protocol) into the global definition set - //! for this class of Library. - Standard_EXPORT static void SetGlobal (const Handle(IGESData_SpecificModule)& amodule, const Handle(Interface_Protocol)& aprotocol); - - //! Creates a Library which complies with a Protocol, that is : - //! Same class (criterium IsInstance) - //! This creation gets the Modules from the global set, those - //! which are bound to the given Protocol and its Resources - Standard_EXPORT IGESData_SpecificLib(const Handle(Interface_Protocol)& aprotocol); - - //! Creates an empty Library : it will later by filled by method - //! AddProtocol - Standard_EXPORT IGESData_SpecificLib(); - - //! Adds a couple (Module-Protocol) to the Library, given the - //! class of a Protocol. Takes Resources into account. - //! (if is not of type TheProtocol, it is not added) - Standard_EXPORT void AddProtocol (const Handle(Interface_Protocol)& aprotocol); - - //! Clears the list of Modules of a library (can be used to - //! redefine the order of Modules before action : Clear then - //! refill the Library by calls to AddProtocol) - Standard_EXPORT void Clear(); - - //! Selects a Module from the Library, given an Object. - //! Returns True if Select has succeeded, False else. - //! Also Returns (as arguments) the selected Module and the Case - //! Number determined by the associated Protocol. - //! If Select has failed, is Null Handle and CN is zero. - //! (Select can work on any criterium, such as Object DynamicType) - Standard_EXPORT Standard_Boolean Select (const Handle(IGESData_IGESEntity)& obj, Handle(IGESData_SpecificModule)& module, Standard_Integer& CN) const; - - //! Starts Iteration on the Modules (sets it on the first one) - Standard_EXPORT void Start(); - - //! Returns True if there are more Modules to iterate on - Standard_EXPORT Standard_Boolean More() const; - - //! Iterates by getting the next Module in the list - //! If there is none, the exception will be raised by Value - Standard_EXPORT void Next(); - - //! Returns the current Module in the Iteration - Standard_EXPORT const Handle(IGESData_SpecificModule)& Module() const; - - //! Returns the current Protocol in the Iteration - Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; - - - - -protected: - - - - - -private: - - - - Handle(IGESData_NodeOfSpecificLib) thelist; - Handle(IGESData_NodeOfSpecificLib) thecurr; - - -}; - - - - - - - -#endif // _IGESData_SpecificLib_HeaderFile diff --git a/src/IGESData/IGESData_SpecificLib_0.cxx b/src/IGESData/IGESData_SpecificLib_0.cxx deleted file mode 100644 index 0a91b118fc..0000000000 --- a/src/IGESData/IGESData_SpecificLib_0.cxx +++ /dev/null @@ -1,39 +0,0 @@ -// Created on: 1992-04-06 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -#include -#include -#include -#include -#include - - -#define TheObject Handle(IGESData_IGESEntity) -#define TheObject_hxx -#define Handle_TheModule Handle(IGESData_SpecificModule) -#define TheModule IGESData_SpecificModule -#define TheModule_hxx -#define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node IGESData_NodeOfSpecificLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(IGESData_GlobalNodeOfSpecificLib) -#define Handle_LibCtl_Node Handle(IGESData_NodeOfSpecificLib) -#define LibCtl_Library IGESData_SpecificLib -#define LibCtl_Library_hxx -#include diff --git a/src/IGESData/IGESData_SpecificModule.cxx b/src/IGESData/IGESData_SpecificModule.cxx deleted file mode 100644 index 0eec2f5374..0000000000 --- a/src/IGESData/IGESData_SpecificModule.cxx +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESData_SpecificModule,Standard_Transient) - -Standard_Boolean IGESData_SpecificModule::OwnCorrect - (const Standard_Integer , const Handle(IGESData_IGESEntity)& ) const -{ return Standard_False; } // par defaut, ne fait rien diff --git a/src/IGESData/IGESData_SpecificModule.hxx b/src/IGESData/IGESData_SpecificModule.hxx deleted file mode 100644 index 03ebfc8ea3..0000000000 --- a/src/IGESData/IGESData_SpecificModule.hxx +++ /dev/null @@ -1,67 +0,0 @@ -// Created on: 1993-09-07 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESData_SpecificModule_HeaderFile -#define _IGESData_SpecificModule_HeaderFile - -#include -#include - -#include -class IGESData_IGESEntity; -class IGESData_IGESDumper; -class Message_Messenger; - - -class IGESData_SpecificModule; -DEFINE_STANDARD_HANDLE(IGESData_SpecificModule, Standard_Transient) - -//! This class defines some Services which are specifically -//! attached to IGES Entities : Dump -class IGESData_SpecificModule : public Standard_Transient -{ - public: - - //! Specific Dump for each type of IGES Entity : it concerns only - //! own parameters, the general data (Directory Part, Lists) are - //! taken into account by the IGESDumper - //! See class IGESDumper for the rules to follow for and - //! level - Standard_EXPORT virtual void OwnDump (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const = 0; - - //! Specific Automatic Correction on own Parameters of an Entity. - //! It works by setting in accordance redundant data, if there are - //! when there is no ambiguity (else, it does nothing). - //! Remark that classic Corrections on Directory Entry (to set - //! void data) are taken into account alsewhere. - //! - //! For instance, many "Associativity Entities" have a Number of - //! Properties which must have a fixed value. - //! Or, a ConicalArc has its Form Number which records the kind of - //! Conic, also determined from its coefficients - //! But, a CircularArc of which Distances (Center-Start) and - //! (Center-End) are not equal cannot be corrected ... - //! - //! Returns True if something has been corrected in - //! By default, does nothing. If at least one of the Types - //! processed by a sub-class of SpecificModule has a Correct - //! procedure attached, this method can be redefined - Standard_EXPORT virtual Standard_Boolean OwnCorrect (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const; - - DEFINE_STANDARD_RTTIEXT(IGESData_SpecificModule,Standard_Transient) -}; - -#endif // _IGESData_SpecificModule_HeaderFile diff --git a/src/IGESData/IGESData_ToolLocation.cxx b/src/IGESData/IGESData_ToolLocation.cxx index 95ccc16b1b..19f64e45e6 100644 --- a/src/IGESData/IGESData_ToolLocation.cxx +++ b/src/IGESData/IGESData_ToolLocation.cxx @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -36,14 +35,12 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESData_ToolLocation,MMgt_TShared) #define TYPEFORASSOC 402 -IGESData_ToolLocation::IGESData_ToolLocation (const Handle(IGESData_IGESModel)& amodel, - const Handle(IGESData_Protocol)& protocol) -: thelib (protocol), +IGESData_ToolLocation::IGESData_ToolLocation (const Handle(IGESData_IGESModel)& amodel) +: theprec (1.e-05), + themodel (amodel), therefs (0,amodel->NbEntities()), theassocs (0,amodel->NbEntities()) { - theprec = 1.e-05; - themodel = amodel; therefs.Init(0); theassocs.Init(0); Load(); } @@ -52,7 +49,7 @@ void IGESData_ToolLocation::Load () { // Pour chaque Entite, sauf Transf et Assoc (sauf SingleParent), on considere // ses "OwnShared" comme etant dependents - Standard_Integer nb = themodel->NbEntities(); + const Standard_Integer nb = themodel->NbEntities(); for (Standard_Integer i = 1; i <= nb; i ++) { Handle(IGESData_IGESEntity) ent = themodel->Entity(i); if (ent->IsKind(STANDARD_TYPE(IGESData_TransfEntity))) continue; @@ -78,7 +75,7 @@ void IGESData_ToolLocation::SetReference (const Handle(IGESData_IGESEntity)& par const Handle(IGESData_IGESEntity)& child) { Standard_Integer np = themodel->Number(parent); - Standard_Integer nc = themodel->Number(child); + const Standard_Integer nc = themodel->Number(child); if (np == 0 || nc == 0) return; if (therefs(nc) > 0) np = -1; // note ambigu therefs.SetValue(nc,np); @@ -88,7 +85,7 @@ void IGESData_ToolLocation::SetParentAssoc (const Handle(IGESData_IGESEntity)& p const Handle(IGESData_IGESEntity)& child) { Standard_Integer np = themodel->Number(parent); - Standard_Integer nc = themodel->Number(child); + const Standard_Integer nc = themodel->Number(child); if (np == 0 || nc == 0) return; if (theassocs(nc) > 0) np = -1; // note ambigu theassocs.SetValue(nc,np); @@ -96,7 +93,7 @@ void IGESData_ToolLocation::SetParentAssoc (const Handle(IGESData_IGESEntity)& p void IGESData_ToolLocation::ResetDependences (const Handle(IGESData_IGESEntity)& child) { - Standard_Integer nc = themodel->Number(child); + const Standard_Integer nc = themodel->Number(child); if (nc == 0) return; therefs.SetValue(nc,0); theassocs.SetValue(nc,0); @@ -104,13 +101,8 @@ void IGESData_ToolLocation::ResetDependences (const Handle(IGESData_IGESEntity) void IGESData_ToolLocation::SetOwnAsDependent (const Handle(IGESData_IGESEntity)& ent) { - Standard_Integer CN; - Handle(Interface_GeneralModule) gmodule; - if (!thelib.Select(ent,gmodule,CN)) return; - Handle(IGESData_GeneralModule) module = - Handle(IGESData_GeneralModule)::DownCast (gmodule); Interface_EntityIterator list; - module->OwnSharedCase(CN,ent,list); + ent->OwnShared(list); // Remarque : en toute rigueur, il faudrait ignorer les entites referencees // dont le SubordinateStatus vaut 0 ou 2 ... // Question : ce Status est-il toujours bien comme il faut ? @@ -141,7 +133,7 @@ gp_GTrsf IGESData_ToolLocation::ExplicitLocation Standard_Boolean IGESData_ToolLocation::IsAmbiguous (const Handle(IGESData_IGESEntity)& ent) const { - Standard_Integer num = themodel->Number(ent); + const Standard_Integer num = themodel->Number(ent); if (num == 0) return Standard_False; if (therefs(num) < 0 || theassocs(num) < 0) return Standard_True; if (therefs(num) != 0 && theassocs(num) != 0) return Standard_True; @@ -151,7 +143,7 @@ Standard_Boolean IGESData_ToolLocation::IsAmbiguous Standard_Boolean IGESData_ToolLocation::HasParent (const Handle(IGESData_IGESEntity)& ent) const { - Standard_Integer num = themodel->Number(ent); + const Standard_Integer num = themodel->Number(ent); if (num == 0) return Standard_False; if (therefs(num) < 0 || theassocs(num) < 0) Standard_DomainError::Raise ("IGESData_ToolLocation : HasParent"); @@ -165,7 +157,7 @@ Handle(IGESData_IGESEntity) IGESData_ToolLocation::Parent (const Handle(IGESData_IGESEntity)& ent) const { Handle(IGESData_IGESEntity) parent; - Standard_Integer num = themodel->Number(ent); + const Standard_Integer num = themodel->Number(ent); if (num == 0) return parent; if (therefs(num) < 0 || theassocs(num) < 0) Standard_DomainError::Raise ("IGESData_ToolLocation : Parent"); @@ -179,7 +171,7 @@ Handle(IGESData_IGESEntity) IGESData_ToolLocation::Parent Standard_Boolean IGESData_ToolLocation::HasParentByAssociativity (const Handle(IGESData_IGESEntity)& ent) const { - Standard_Integer num = themodel->Number(ent); + const Standard_Integer num = themodel->Number(ent); if (num == 0) return Standard_False; if (therefs(num) < 0 || theassocs(num) < 0) Standard_DomainError::Raise ("IGESData_ToolLocation : HasParentByAssociativity"); diff --git a/src/IGESData/IGESData_ToolLocation.hxx b/src/IGESData/IGESData_ToolLocation.hxx index 612d0dba00..9f853b68d6 100644 --- a/src/IGESData/IGESData_ToolLocation.hxx +++ b/src/IGESData/IGESData_ToolLocation.hxx @@ -20,14 +20,10 @@ #include #include -#include -#include #include #include -#include class IGESData_IGESModel; class Standard_DomainError; -class IGESData_Protocol; class IGESData_IGESEntity; class gp_GTrsf; class gp_Trsf; @@ -65,7 +61,7 @@ public: //! Creates a ToolLocation on a given Model, filled with the help //! of a Protocol (which allows to known Entities referenced by //! other ones) - Standard_EXPORT IGESData_ToolLocation(const Handle(IGESData_IGESModel)& amodel, const Handle(IGESData_Protocol)& protocol); + Standard_EXPORT IGESData_ToolLocation(const Handle(IGESData_IGESModel)& amodel); //! Does the effective work of determining Locations of Entities Standard_EXPORT void Load(); @@ -151,32 +147,14 @@ public: //! As a class method, it can be called separately Standard_EXPORT static Standard_Boolean ConvertLocation (const Standard_Real prec, const gp_GTrsf& loc, gp_Trsf& result, const Standard_Real uni = 1); - - - DEFINE_STANDARD_RTTIEXT(IGESData_ToolLocation,MMgt_TShared) -protected: - - - - -private: - + private: Standard_Real theprec; Handle(IGESData_IGESModel) themodel; - Interface_GeneralLib thelib; TColStd_Array1OfInteger therefs; TColStd_Array1OfInteger theassocs; - - }; - - - - - - #endif // _IGESData_ToolLocation_HeaderFile diff --git a/src/IGESData/IGESData_UndefinedEntity.cxx b/src/IGESData/IGESData_UndefinedEntity.cxx index f055741230..922c07af08 100644 --- a/src/IGESData/IGESData_UndefinedEntity.cxx +++ b/src/IGESData/IGESData_UndefinedEntity.cxx @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -25,9 +26,10 @@ #include #include #include +#include #include #include -#include +#include #include #include @@ -44,76 +46,9 @@ IGESData_UndefinedEntity::IGESData_UndefinedEntity () } -//======================================================================= -//function : UndefinedContent -//purpose : -//======================================================================= - -Handle(Interface_UndefinedContent) IGESData_UndefinedEntity::UndefinedContent () const -{ - return thecont; -} - - -//======================================================================= -//function : ChangeableContent -//purpose : -//======================================================================= - -Handle(Interface_UndefinedContent) IGESData_UndefinedEntity::ChangeableContent () -{ - return thecont; -} - - -//======================================================================= -//function : SetNewContent -//purpose : -//======================================================================= - -void IGESData_UndefinedEntity::SetNewContent - (const Handle(Interface_UndefinedContent)& cont) -{ - thecont = cont; -} - - // .... (Re)definitions specifiques a UndefinedEntity .... -//======================================================================= -//function : IsOKDirPart -//purpose : -//======================================================================= - -Standard_Boolean IGESData_UndefinedEntity::IsOKDirPart () const -{ - return (thedstat == 0); -} - - -//======================================================================= -//function : DirStatus -//purpose : -//======================================================================= - -Standard_Integer IGESData_UndefinedEntity::DirStatus () const -{ - return thedstat; -} - - -//======================================================================= -//function : SetOKDirPart -//purpose : -//======================================================================= - -void IGESData_UndefinedEntity::SetOKDirPart () -{ - thedstat = 0; -} - - //======================================================================= //function : DefLineFont //purpose : @@ -340,17 +275,10 @@ Standard_Boolean IGESData_UndefinedEntity::ReadDir void IGESData_UndefinedEntity::ReadOwnParams (const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) { - Standard_Integer nb = PR.NbParams(); - + const Standard_Integer nb = PR.NbParams(); thecont->Reservate(nb,nb); for (Standard_Integer i = 1; i <= nb; i ++) { Interface_ParamType ptyp = PR.ParamType(i); -/* if (PR.IsParamEntity(i)) { - thecont->AddEntity (ptyp,PR.ParamEntity(IR,i)); - } - else thecont->AddLiteral (ptyp,new TCollection_HAsciiString(PR.ParamValue(i))); -*/ -// On est TOUJOURS en mode litteral, c est bien plus clair ! thecont->AddLiteral (ptyp,new TCollection_HAsciiString(PR.ParamValue(i))); } PR.SetCurrentNumber(nb+1); @@ -375,3 +303,47 @@ void IGESData_UndefinedEntity::WriteOwnParams(IGESData_IGESWriter& IW) const else IW.SendString (thecont->ParamValue(i)); } } + + +//======================================================================= +//function : OwnShared +//purpose : +//======================================================================= + +void IGESData_UndefinedEntity::OwnShared (Interface_EntityIterator& theIter) const +{ + const Standard_Integer nb = thecont->NbParams(); + for (Standard_Integer i = 1; i <= nb; i ++) { + if (thecont->IsParamEntity(i)) + theIter.GetOneItem (thecont->ParamEntity(i)); + } +} + + +//======================================================================= +//function : OwnDump +//purpose : +//======================================================================= + +void IGESData_UndefinedEntity::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer) const +{ + const Standard_Integer dstat = thedstat; + if (dstat != 0) + S << " -- Directory Entry Error Status = " << dstat << " --" << endl; + Handle(Interface_UndefinedContent) cont = UndefinedContent(); + const Standard_Integer nb = cont->NbParams(); + S << " UNDEFINED ENTITY ...\n" << nb + <<" Parameters (WARNING : Odd Integer Values Interpreted as Entities)\n"; + for (Standard_Integer i = 1; i <= nb; i ++) { + Interface_ParamType ptyp = cont->ParamType(i); + if (ptyp == Interface_ParamVoid) S<<" ["<IsParamEntity(i)) { + DeclareAndCast(IGESData_IGESEntity,anent,cont->ParamEntity(i)); + S<<" ["<Length(); } - void IGESDefs_AssociativityDef::SetFormNumber (const Standard_Integer form) +Standard_Boolean IGESDefs_AssociativityDef::IsBackPointerReq (const Standard_Integer ClassNum) const { - InitTypeAndForm(302,form); + return (myBackPointerReqs->Value(ClassNum) == 1); +// 1 True 2 False } - Standard_Integer IGESDefs_AssociativityDef::NbClassDefs () const +Standard_Integer IGESDefs_AssociativityDef::BackPointerReq (const Standard_Integer ClassNum) const { - return theBackPointerReqs->Length(); + return myBackPointerReqs->Value(ClassNum); } - Standard_Boolean IGESDefs_AssociativityDef::IsBackPointerReq - (const Standard_Integer ClassNum) const +Standard_Boolean IGESDefs_AssociativityDef::IsOrdered (const Standard_Integer ClassNum) const { - return (theBackPointerReqs->Value(ClassNum) == 1); + return (myClassOrders->Value(ClassNum) == 1); // 1 True 2 False } - Standard_Integer IGESDefs_AssociativityDef::BackPointerReq - (const Standard_Integer ClassNum) const +Standard_Integer IGESDefs_AssociativityDef::ClassOrder (const Standard_Integer ClassNum) const { - return theBackPointerReqs->Value(ClassNum); + return myClassOrders->Value(ClassNum); } - Standard_Boolean IGESDefs_AssociativityDef::IsOrdered - (const Standard_Integer ClassNum) const +Standard_Integer IGESDefs_AssociativityDef::NbItemsPerClass (const Standard_Integer ClassNum) const { - return (theClassOrders->Value(ClassNum) == 1); -// 1 True 2 False + return myNbItemsPerClass->Value(ClassNum); } - Standard_Integer IGESDefs_AssociativityDef::ClassOrder - (const Standard_Integer ClassNum) const +Standard_Integer IGESDefs_AssociativityDef::Item (const Standard_Integer ClassNum, const Standard_Integer ItemNum) const { - return theClassOrders->Value(ClassNum); + return myItems->Value(ClassNum)->Value(ItemNum); } - Standard_Integer IGESDefs_AssociativityDef::NbItemsPerClass - (const Standard_Integer ClassNum) const -{ - return theNbItemsPerClass->Value(ClassNum); +void IGESDefs_AssociativityDef::OwnRead (IGESFile_Reader& theReader) +{ + Standard_Integer nbval = 0; + theReader.ReadInteger(nbval,"No. of Class definitions"); + if (nbval > 0) + { + myBackPointerReqs = new TColStd_HArray1OfInteger(1, nbval); + myClassOrders = new TColStd_HArray1OfInteger(1, nbval); + myNbItemsPerClass = new TColStd_HArray1OfInteger(1, nbval); + myItems = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval); + + for (Standard_Integer i = 1; i <= nbval; i++) + { + theReader.ReadInteger(myBackPointerReqs->ChangeValue(i),"Back Pointer Requirement"); + theReader.ReadInteger(myClassOrders->ChangeValue(i),"Ordered/Unordered Class"); + + Standard_Integer numItem = 0; + theReader.ReadInteger(numItem,"No. of items per entry"); + if (numItem > 0) + { + myNbItemsPerClass->SetValue(i, numItem); + Handle(TColStd_HArray1OfInteger) item = new TColStd_HArray1OfInteger(1, numItem); + for (Standard_Integer j = 1; j <= numItem; j++) + theReader.ReadInteger(item->ChangeValue(j),"Item"); + myItems->SetValue(i, item); + } + } + } + else theReader.AddFail("No. of Class definitions: Not Positive"); } - Standard_Integer IGESDefs_AssociativityDef::Item - (const Standard_Integer ClassNum, const Standard_Integer ItemNum) const -{ - return theItems->Value(ClassNum)->Value(ItemNum); +void IGESDefs_AssociativityDef::OwnWrite (IGESData_IGESWriter& IW) const +{ + const Standard_Integer upper = NbClassDefs(); + IW.Send(upper); + for (Standard_Integer i = 1; i <= upper; i++) { + IW.Send(BackPointerReq(i)); + IW.Send(ClassOrder(i)); + IW.Send(NbItemsPerClass(i)); + const Standard_Integer items = NbItemsPerClass(i); + for (Standard_Integer j = 1; j <= items; j++) + IW.Send(Item(i,j)); + } +} + +IGESData_DirChecker IGESDefs_AssociativityDef::DirChecker () const +{ + IGESData_DirChecker DC (302, 5001, 9999); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.SubordinateStatusRequired(0); + DC.UseFlagRequired(2); + DC.HierarchyStatusIgnored(); + return DC; +} + +void IGESDefs_AssociativityDef::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESDefs_AssociativityDef" << endl; + S << "Number of Class Definitions : " << NbClassDefs() << endl; + S << "Back Pointer Requirement : " << endl; + S << "Ordered / Unordered Class : " << endl; + S << "Number Of Items per Entry : " << endl; + S << "Items : " << endl; + IGESData_DumpVals(S,-level,1,NbClassDefs(),BackPointerReq); + S << endl; + if (level > 4) { + // Warning : Item is a JAGGED Array + const Standard_Integer upper = NbClassDefs(); + for (Standard_Integer i = 1; i <= upper; i ++) { + S << "[" << i << "]: " << endl; + S << "Back Pointer Requirement : " << BackPointerReq(i) << (IsBackPointerReq(i)? " (Yes) " : " (No) "); + S << " Ordered/Unordered Class : " << ClassOrder(i) << (IsOrdered(i)? " (Yes)" : " (No)") << endl; + S << "Number Of Items per Entry : " << NbItemsPerClass(i); + if (level < 6) { + S << " [ask level > 5 for more]" << endl; + continue; + } + S << endl << " ["; + for (Standard_Integer j = 1; j <= NbItemsPerClass(i); j ++) + S << " " << Item(i,j); + S << "]" << endl; + } + } + S << endl; } diff --git a/src/IGESDefs/IGESDefs_AssociativityDef.hxx b/src/IGESDefs/IGESDefs_AssociativityDef.hxx index 905eda05b6..53281ccf0a 100644 --- a/src/IGESDefs/IGESDefs_AssociativityDef.hxx +++ b/src/IGESDefs/IGESDefs_AssociativityDef.hxx @@ -17,20 +17,8 @@ #ifndef _IGESDefs_AssociativityDef_HeaderFile #define _IGESDefs_AssociativityDef_HeaderFile -#include -#include - #include #include -#include -#include -class IGESBasic_HArray1OfHArray1OfInteger; -class Standard_DimensionMismatch; -class Standard_OutOfRange; - - -class IGESDefs_AssociativityDef; -DEFINE_STANDARD_HANDLE(IGESDefs_AssociativityDef, IGESData_IGESEntity) //! defines IGES Associativity Definition Entity, Type <302> //! Form <5001 - 9999> in package IGESDefs. @@ -39,28 +27,21 @@ DEFINE_STANDARD_HANDLE(IGESDefs_AssociativityDef, IGESData_IGESEntity) //! defines the type of relationship. class IGESDefs_AssociativityDef : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 302; } - - Standard_EXPORT IGESDefs_AssociativityDef(); - - //! This method is used to set the fields of the class - //! AssociativityDef - //! - requirements : Back Pointers requirements - //! - orders : Class Orders - //! - numItems : Number of Items per Class - //! - items : Items in each class - //! raises exception if lengths of the arrays are not the same. - Standard_EXPORT void Init (const Handle(TColStd_HArray1OfInteger)& requirements, const Handle(TColStd_HArray1OfInteger)& orders, const Handle(TColStd_HArray1OfInteger)& numItems, const Handle(IGESBasic_HArray1OfHArray1OfInteger)& items); - - Standard_EXPORT void SetFormNumber (const Standard_Integer form); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return myForm; } + + IGESDefs_AssociativityDef(const Standard_Integer theForm) + : myForm(theForm) + {} //! returns the Number of class definitions Standard_EXPORT Standard_Integer NbClassDefs() const; - //! returns 1 if the theBackPointerReqs(ClassNum) = 1 - //! returns 0 if the theBackPointerReqs(ClassNum) = 2 + //! returns 1 if the myBackPointerReqs(ClassNum) = 1 + //! returns 0 if the myBackPointerReqs(ClassNum) = 2 //! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs() Standard_EXPORT Standard_Boolean IsBackPointerReq (const Standard_Integer ClassNum) const; @@ -68,8 +49,8 @@ public: //! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs() Standard_EXPORT Standard_Integer BackPointerReq (const Standard_Integer ClassNum) const; - //! returns 1 if theClassOrders(ClassNum) = 1 (ordered class) - //! returns 0 if theClassOrders(ClassNum) = 2 (unordered class) + //! returns 1 if myClassOrders(ClassNum) = 1 (ordered class) + //! returns 0 if myClassOrders(ClassNum) = 2 (unordered class) //! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs() Standard_EXPORT Standard_Boolean IsOrdered (const Standard_Integer ClassNum) const; @@ -87,31 +68,23 @@ public: //! ItemNum <= 0 or ItemNum > NbItemsPerClass(ClassNum) Standard_EXPORT Standard_Integer Item (const Standard_Integer ClassNum, const Standard_Integer ItemNum) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; - + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESDefs_AssociativityDef,IGESData_IGESEntity) -protected: - - - - -private: - - - Handle(TColStd_HArray1OfInteger) theBackPointerReqs; - Handle(TColStd_HArray1OfInteger) theClassOrders; - Handle(TColStd_HArray1OfInteger) theNbItemsPerClass; - Handle(IGESBasic_HArray1OfHArray1OfInteger) theItems; - + private: + Standard_Integer myForm; + Handle(TColStd_HArray1OfInteger) myBackPointerReqs; + Handle(TColStd_HArray1OfInteger) myClassOrders; + Handle(TColStd_HArray1OfInteger) myNbItemsPerClass; + Handle(IGESBasic_HArray1OfHArray1OfInteger) myItems; }; - - - - - - #endif // _IGESDefs_AssociativityDef_HeaderFile diff --git a/src/IGESDefs/IGESDefs_AttributeDef.cxx b/src/IGESDefs/IGESDefs_AttributeDef.cxx index 6780fd332e..3acd48af8d 100644 --- a/src/IGESDefs/IGESDefs_AttributeDef.cxx +++ b/src/IGESDefs/IGESDefs_AttributeDef.cxx @@ -16,6 +16,10 @@ //-------------------------------------------------------------------- //-------------------------------------------------------------------- +#include +#include +#include +#include #include #include #include @@ -27,153 +31,326 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_AttributeDef,IGESData_IGESEntity) -// For each Attribute Value, according to Attribute Type : -// 0 -> Void, 1 -> Integer, 2 -> Real, 3 -> String, 4 -> Entity 6 -> Logical -IGESDefs_AttributeDef::IGESDefs_AttributeDef () { } - - - void IGESDefs_AttributeDef::Init - (const Handle(TCollection_HAsciiString)& aName, - const Standard_Integer aListType, - const Handle(TColStd_HArray1OfInteger)& attrTypes, - const Handle(TColStd_HArray1OfInteger)& attrValueDataTypes, - const Handle(TColStd_HArray1OfInteger)& attrValueCounts, - const Handle(TColStd_HArray1OfTransient)& attrValues, - const Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate)& - attrValuePointers) +Standard_Integer IGESDefs_AttributeDef::NbAttributes () const { - Standard_Integer nb = attrTypes->Length(); - if (attrTypes->Lower() != 1 || attrValueDataTypes->Lower() != 1 || - attrValueDataTypes->Length() != nb || - attrValueCounts->Lower() != 1 || attrValueCounts->Length() != nb) - Standard_DimensionMismatch::Raise("IGESDefs_AttributeDef : Init"); - - if (FormNumber() >= 1) - if (attrValues->Lower() != 1 || attrValues->Length() != nb) - Standard_DimensionMismatch::Raise("IGESDefs_AttributeDef : Init"); - - if (FormNumber() == 2) - if (attrValuePointers->Lower() != 1 || attrValuePointers->Length() != nb) - Standard_DimensionMismatch::Raise("IGESDefs_AttributeDef : Init"); -// Form 1 : attrValues defined Form = 2 : attrValuePointers defined - - theName = aName; - theListType = aListType; - theAttrTypes = attrTypes; - theAttrValueDataTypes = attrValueDataTypes; - theAttrValueCounts = attrValueCounts; - theAttrValues = attrValues; - theAttrValuePointers = attrValuePointers; - if (attrValues.IsNull()) InitTypeAndForm(322,0); - else if (attrValuePointers.IsNull()) InitTypeAndForm(322,1); - else InitTypeAndForm(322,2); + return theAttrTypes->Length(); } - Standard_Boolean IGESDefs_AttributeDef::HasTableName () const +Standard_Integer IGESDefs_AttributeDef::AttributeType (const Standard_Integer num) const { - return (!theName.IsNull()); + return theAttrTypes->Value(num); } - Handle(TCollection_HAsciiString) IGESDefs_AttributeDef::TableName () const +Standard_Integer IGESDefs_AttributeDef::AttributeValueDataType (const Standard_Integer num) const { - return theName; + return theAttrValueDataTypes->Value(num); } - Standard_Integer IGESDefs_AttributeDef::ListType () const +Standard_Integer IGESDefs_AttributeDef::AttributeValueCount (const Standard_Integer num) const { - return theListType; + return theAttrValueCounts->Value(num); } - Standard_Integer IGESDefs_AttributeDef::NbAttributes () const +Handle(IGESGraph_TextDisplayTemplate) IGESDefs_AttributeDef::AttributeTextDisplay (const Standard_Integer AttrNum, const Standard_Integer PointerNum) const { - return theAttrTypes->Length(); + Handle(IGESGraph_TextDisplayTemplate) res; + if (HasTextDisplay()) + res = theAttrValuePointers->Value(AttrNum)->Value(PointerNum); + return res; } - Standard_Integer IGESDefs_AttributeDef::AttributeType - (const Standard_Integer num) const +Handle(Standard_Transient) IGESDefs_AttributeDef::AttributeList (const Standard_Integer AttrNum) const { - return theAttrTypes->Value(num); + Handle(Standard_Transient) nulres; + if (!HasValues()) return nulres; + return theAttrValues->Value(AttrNum); } - Standard_Integer IGESDefs_AttributeDef::AttributeValueDataType - (const Standard_Integer num) const +Standard_Integer IGESDefs_AttributeDef::AttributeAsInteger (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const { - return theAttrValueDataTypes->Value(num); + return GetCasted(TColStd_HArray1OfInteger,theAttrValues->Value(AttrNum))->Value(ValueNum); } - Standard_Integer IGESDefs_AttributeDef::AttributeValueCount - (const Standard_Integer num) const +Standard_Real IGESDefs_AttributeDef::AttributeAsReal (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const { - return theAttrValueCounts->Value(num); + return GetCasted(TColStd_HArray1OfReal,theAttrValues->Value(AttrNum))->Value(ValueNum); } - Standard_Boolean IGESDefs_AttributeDef::HasValues () const +Handle(TCollection_HAsciiString) IGESDefs_AttributeDef::AttributeAsString (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const { - return (!theAttrValues.IsNull()); + return GetCasted(Interface_HArray1OfHAsciiString,theAttrValues->Value(AttrNum))->Value(ValueNum); } - Standard_Boolean IGESDefs_AttributeDef::HasTextDisplay () const +Handle(IGESData_IGESEntity) IGESDefs_AttributeDef::AttributeAsEntity (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const { - return (!theAttrValuePointers.IsNull()); + return GetCasted(IGESData_HArray1OfIGESEntity,theAttrValues->Value(AttrNum))->Value(ValueNum); } - Handle(IGESGraph_TextDisplayTemplate) - IGESDefs_AttributeDef::AttributeTextDisplay - (const Standard_Integer AttrNum, const Standard_Integer PointerNum) const +Standard_Boolean IGESDefs_AttributeDef::AttributeAsLogical (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const { - Handle(IGESGraph_TextDisplayTemplate) res; - if (HasTextDisplay()) res = - theAttrValuePointers->Value(AttrNum)->Value(PointerNum); - return res; + return (GetCasted(TColStd_HArray1OfInteger,theAttrValues->Value(AttrNum))->Value(ValueNum) != 0); } - Handle(Standard_Transient) IGESDefs_AttributeDef::AttributeList - (const Standard_Integer AttrNum) const +void IGESDefs_AttributeDef::OwnRead (IGESFile_Reader& theReader) { - Handle(Standard_Transient) nulres; - if (!HasValues()) return nulres; - return theAttrValues->Value(AttrNum); + theReader.ReadText(theName,"Attribute Table Name"); + theReader.ReadInteger(theListType,"Attribute List Type"); + + Standard_Integer nbval = 0; + theReader.ReadInteger(nbval,"Number of Attributes"); + if (nbval > 0) + { + theAttrTypes = new TColStd_HArray1OfInteger(1, nbval); + theAttrValueDataTypes = new TColStd_HArray1OfInteger(1, nbval); + theAttrValueCounts = new TColStd_HArray1OfInteger(1, nbval); + if (myForm > 0) + theAttrValues = new TColStd_HArray1OfTransient(1, nbval); + if (myForm > 1) + theAttrValuePointers = new IGESDefs_HArray1OfHArray1OfTextDisplayTemplate(1, nbval); + + for (Standard_Integer i = 1; i <= nbval; i++) + { + theReader.ReadInteger(theAttrTypes->ChangeValue(i),"Attribute Type"); + + Standard_Integer attrValueDataType = 0; + theReader.ReadInteger(attrValueDataType,"Attribute Data Type"); + theAttrValueDataTypes->SetValue(i, attrValueDataType); + + Standard_Integer avc = 0; + if (theReader.ReadInteger(avc,"Attribute Value Count") == IGESFile_Reader::ParamEmpty) avc = 1; + theAttrValueCounts->SetValue(i, avc); + + Handle(IGESGraph_HArray1OfTextDisplayTemplate) attrValuePointer; + if (myForm > 1 && avc > 0) attrValuePointer = new IGESGraph_HArray1OfTextDisplayTemplate(1, avc); + + if (myForm > 0) + { + Handle(TColStd_HArray1OfInteger) attrInt; + Handle(TColStd_HArray1OfReal) attrReal; + Handle(Interface_HArray1OfHAsciiString) attrStr; + Handle(IGESData_HArray1OfIGESEntity) attrEnt; + switch (attrValueDataType) + { + case 1 : + case 6 : attrInt = new TColStd_HArray1OfInteger (1,avc); theAttrValues->SetValue(i,attrInt); break; + case 2 : attrReal = new TColStd_HArray1OfReal (1,avc); theAttrValues->SetValue(i,attrReal); break; + case 3 : attrStr = new Interface_HArray1OfHAsciiString(1,avc); theAttrValues->SetValue(i,attrStr); break; + case 4 : attrEnt = new IGESData_HArray1OfIGESEntity (1,avc); theAttrValues->SetValue(i,attrEnt); break; + default : break; + } + for (Standard_Integer j = 1; j <= avc; j++) + { + switch (attrValueDataType) + { + case 0: theReader.ReadAny(); break; + case 1: theReader.ReadInteger(attrInt->ChangeValue(j),"Attribute Value"); break; + case 2: theReader.ReadReal(attrReal->ChangeValue(j),"Attribute Value"); break; + case 3: theReader.ReadText(attrStr->ChangeValue(j),"Attribute Value"); break; + case 4: theReader.ReadPointer(attrEnt->ChangeValue(j),"Attribute Value"); break; + case 5: theReader.ReadAny(); break; + case 6: + { + Standard_Boolean temp = Standard_False; + theReader.ReadBoolean(temp,"Attribute Value"); + attrInt->SetValue(j, (temp ? 1 : 0)); + } + break; + } + if (!attrValuePointer.IsNull()) + theReader.ReadPointer(attrValuePointer->ChangeValue(j),"Attribute Val. Pointer"); + } + if (!attrValuePointer.IsNull()) + theAttrValuePointers->SetValue(i, attrValuePointer); + } + } + } + else theReader.AddFail("Number of Attributes: Not Positive"); } - Standard_Integer IGESDefs_AttributeDef::AttributeAsInteger - (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const +void IGESDefs_AttributeDef::OwnWrite (IGESData_IGESWriter& IW) const { - return GetCasted(TColStd_HArray1OfInteger,theAttrValues->Value(AttrNum)) - ->Value(ValueNum); + if (HasTableName()) IW.Send(TableName()); + else IW.SendVoid(); + IW.Send(ListType()); + const Standard_Integer upper = NbAttributes(); + IW.Send(upper); + + for (Standard_Integer i = 1; i <= upper; i++) + { + const Standard_Integer check = AttributeValueDataType(i); + const Standard_Integer count = AttributeValueCount(i); + IW.Send(AttributeType(i)); + IW.Send(check); + IW.Send(count); + if (FormNumber() > 0) + { + for (Standard_Integer j = 1; j <= count; j++) + { + switch (check) { + case 0 : IW.SendVoid(); break; + case 1 : IW.Send(AttributeAsInteger(i,j)); break; + case 2 : IW.Send(AttributeAsReal(i,j)); break; + case 3 : IW.Send(AttributeAsString(i,j)); break; + case 4 : IW.Send(AttributeAsEntity(i,j)); break; + case 5 : IW.SendVoid(); break; + case 6 : IW.SendBoolean(AttributeAsLogical(i,j)); break; + default : break; + } + if (FormNumber() == 2) + IW.Send(AttributeTextDisplay(i,j)); + } + } + } } - Standard_Real IGESDefs_AttributeDef::AttributeAsReal - (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const +void IGESDefs_AttributeDef::OwnShared (Interface_EntityIterator& iter) const { - return GetCasted(TColStd_HArray1OfReal,theAttrValues->Value(AttrNum)) - ->Value(ValueNum); + const Standard_Integer upper = NbAttributes(); + for (Standard_Integer i = 1; i <= upper; i++) + { + const Standard_Integer check = AttributeValueDataType(i); + const Standard_Integer count = AttributeValueCount(i); + if (FormNumber() > 0) + { + for (Standard_Integer j = 1; j <= count; j++) + { + if ( check == 4 ) + iter.GetOneItem(AttributeAsEntity(i,j)); + if ( FormNumber() == 2 ) + iter.GetOneItem(AttributeTextDisplay(i,j)); + } + } + } } - Handle(TCollection_HAsciiString) IGESDefs_AttributeDef::AttributeAsString - (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const +IGESData_DirChecker IGESDefs_AttributeDef::DirChecker () const { - return GetCasted(Interface_HArray1OfHAsciiString,theAttrValues->Value(AttrNum)) - ->Value(ValueNum); + IGESData_DirChecker DC (322, 0, 2); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefAny); + DC.LineWeight(IGESData_DefValue); + DC.Color(IGESData_DefAny); + DC.BlankStatusIgnored(); + DC.SubordinateStatusRequired(0); + DC.UseFlagRequired(2); + DC.GraphicsIgnored(1); + return DC; } - Handle(IGESData_IGESEntity) IGESDefs_AttributeDef::AttributeAsEntity - (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const +void IGESDefs_AttributeDef::OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) & ach) const { - return GetCasted(IGESData_HArray1OfIGESEntity,theAttrValues->Value(AttrNum)) - ->Value(ValueNum); + const Standard_Integer nb = NbAttributes(); + const Standard_Integer fn = FormNumber(); + for (Standard_Integer i = 1; i <= nb; i ++) { + char mess[80]; + if (AttributeType(i) < 0 || AttributeType(i) > 9999) { + sprintf(mess,"Attribute Type n0.%d not in <0 - 9999>", AttributeType(i)); + ach->AddFail(mess); + } + const Standard_Integer aty = AttributeValueDataType(i); + if (aty < 0 || aty > 6) { + sprintf(mess,"Attribute Value Data Type n0.%d not in <0 - 6>", aty); + ach->AddFail(mess); + } + if (AttributeValueCount(i) <= 0) continue; + Handle(Standard_Transient) list = AttributeList(i); + if (fn > 0 && list.IsNull()) { + if (aty == 0 || aty == 5) continue; + sprintf(mess,"Form Number > 0 and Attribute Value List n0.%d undefined", aty); + ach->AddFail(mess); + continue; + } + else if (fn == 0) continue; + mess[0] = '\0'; + switch (aty) { + case 1 : if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfInteger))) sprintf(mess,"Attribute List n0.%d (Integers) badly defined", aty); break; + case 2 : if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfReal))) sprintf(mess,"Attribute List n0.%d (Reals) badly defined", aty); break; + case 3 : if (!list->IsKind(STANDARD_TYPE(Interface_HArray1OfHAsciiString))) sprintf(mess,"Attribute List n0.%d (Strings) badly defined", aty); break; + case 4 : if (!list->IsKind(STANDARD_TYPE(IGESData_HArray1OfIGESEntity))) sprintf(mess,"Attribute List n0.%d (IGES Pointers) badly defined", aty); break; + case 6 : if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfInteger))) sprintf(mess,"Attribute List n0.%d (Logicals i.e. Integers) badly defined", aty); break; + default : break; + } + if (mess[0] != '\0') ach->AddFail(mess); + } } - Standard_Boolean IGESDefs_AttributeDef::AttributeAsLogical - (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const +void IGESDefs_AttributeDef::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const { - return (GetCasted(TColStd_HArray1OfInteger,theAttrValues->Value(AttrNum)) - ->Value(ValueNum) != 0); + Standard_Integer sublevel = (level > 4) ? 1 : 0; + + S << "IGESDefs_AttributeDef" << endl; + S << "Attribute Table Name: "; + IGESData_DumpString(S,TableName()); + S << endl; + S << "Attribute List Type : " << ListType() << endl; + S << "Number of Attributes : " << NbAttributes() << endl; + S << "Attribute Types : " << endl; + S << "Attribute Value Data Types : " << endl; + S << "Attribute Value Counts : " << endl; + if (HasValues()) S << "Attribute Values : " << endl; + if (HasTextDisplay()) S << "Attribute Value Entities : " << endl; + IGESData_DumpVals(S,-level,1,NbAttributes(),AttributeType); + S << endl; + if (level > 4) + { + const Standard_Integer upper = NbAttributes(); + for (Standard_Integer i = 1; i <= upper ; i ++) + { + const Standard_Integer avc = AttributeValueCount(i); + Standard_Integer typ = AttributeValueDataType(i); + S << "[" << i << "]: "; + S << "Attribute Type : " << AttributeType(i) << " "; + S << "Value Data Type : " << typ; + switch (typ) { + case 0 : S << " (Void)"; break; + case 1 : S << " : Integer "; break; + case 2 : S << " : Real "; break; + case 3 : S << " : String "; break; + case 4 : S << " : Entity "; break; + case 5 : S << " (Not Used)"; break; + case 6 : S << " : Logical "; break; + default : break; + } + S << " Count : " << avc << endl; + if (HasValues()) + { + if (level <= 5) { + S << " [ content (Values) : ask level > 5 ]" << endl; + continue; + } + for (Standard_Integer j = 1; j <= avc; j ++) + { + S << "[" << j << "]: "; + switch(AttributeValueDataType(i)) + { + case 0: S << "(Void) "; break; + case 1: S << AttributeAsInteger(i,j); break; + case 2: S << AttributeAsReal(i,j); break; + case 3: IGESData_DumpString(S,AttributeAsString(i,j)); break; + case 4: dumper.Dump(AttributeAsEntity(i,j),S,level-5); break; + case 5: S << "(Not Used)"; break; + case 6: S << (AttributeAsLogical(i,j) ? "True" : "False"); break; + default : break; + } + if (HasTextDisplay()) + { + S << " Attribute Value Pointer : "; + dumper.Dump(AttributeTextDisplay(i,j),S, sublevel); + } + S << endl; + } + } + } + } + S << endl; } diff --git a/src/IGESDefs/IGESDefs_AttributeDef.hxx b/src/IGESDefs/IGESDefs_AttributeDef.hxx index 0dafcae8ad..dfcb7fa906 100644 --- a/src/IGESDefs/IGESDefs_AttributeDef.hxx +++ b/src/IGESDefs/IGESDefs_AttributeDef.hxx @@ -17,27 +17,12 @@ #ifndef _IGESDefs_AttributeDef_HeaderFile #define _IGESDefs_AttributeDef_HeaderFile -#include -#include - -#include -#include -#include #include -#include -#include class TCollection_HAsciiString; +class TColStd_HArray1OfInteger; +class TColStd_HArray1OfTransient; class IGESDefs_HArray1OfHArray1OfTextDisplayTemplate; -class Standard_DimensionMismatch; -class Standard_OutOfRange; -class Standard_NullObject; class IGESGraph_TextDisplayTemplate; -class Standard_Transient; -class IGESData_IGESEntity; - - -class IGESDefs_AttributeDef; -DEFINE_STANDARD_HANDLE(IGESDefs_AttributeDef, IGESData_IGESEntity) //! defines IGES Attribute Table Definition Entity, //! Type <322> Form [0, 1, 2] in package IGESDefs. @@ -46,24 +31,27 @@ DEFINE_STANDARD_HANDLE(IGESDefs_AttributeDef, IGESData_IGESEntity) //! or a single row of attributes. class IGESDefs_AttributeDef : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 322; } - - Standard_EXPORT IGESDefs_AttributeDef(); - - Standard_EXPORT void Init (const Handle(TCollection_HAsciiString)& aName, const Standard_Integer aListType, const Handle(TColStd_HArray1OfInteger)& attrTypes, const Handle(TColStd_HArray1OfInteger)& attrValueDataTypes, const Handle(TColStd_HArray1OfInteger)& attrValueCounts, const Handle(TColStd_HArray1OfTransient)& attrValues, const Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate)& attrValuePointers); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return myForm; } + + IGESDefs_AttributeDef(const Standard_Integer theForm) + : myForm(theForm), + theListType(0) + {} //! Returns True if a Table Name is defined - Standard_EXPORT Standard_Boolean HasTableName() const; - + Standard_Boolean HasTableName() const { return (!theName.IsNull()); } + //! returns the Attribute Table name, or comment //! (default = null, no name : seeHasTableName) - Standard_EXPORT Handle(TCollection_HAsciiString) TableName() const; - + const Handle(TCollection_HAsciiString) & TableName() const { return theName; } + //! returns the Attribute List Type - Standard_EXPORT Standard_Integer ListType() const; - + Standard_Integer ListType() const { return theListType; } + //! returns the Number of Attributes Standard_EXPORT Standard_Integer NbAttributes() const; @@ -80,11 +68,11 @@ public: Standard_EXPORT Standard_Integer AttributeValueCount (const Standard_Integer num) const; //! returns false if Values are defined (i.e. for Form = 1 or 2) - Standard_EXPORT Standard_Boolean HasValues() const; - + Standard_Boolean HasValues() const { return (!theAttrValues.IsNull()); } + //! returns false if TextDisplays are defined (i.e. for Form = 2) - Standard_EXPORT Standard_Boolean HasTextDisplay() const; - + Standard_Boolean HasTextDisplay() const { return (!theAttrValuePointers.IsNull()); } + Standard_EXPORT Handle(IGESGraph_TextDisplayTemplate) AttributeTextDisplay (const Standard_Integer AttrNum, const Standard_Integer PointerNum) const; //! Returns the List of Attributes , as a Transient. @@ -114,19 +102,23 @@ public: //! Error if Indices out of Range, or no Value defined, or not a Logical Standard_EXPORT Standard_Boolean AttributeAsLogical (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator& iter) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESDefs_AttributeDef,IGESData_IGESEntity) - -protected: - - + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; -private: + DEFINE_STANDARD_RTTIEXT(IGESDefs_AttributeDef,IGESData_IGESEntity) + private: + Standard_Integer myForm; Handle(TCollection_HAsciiString) theName; Standard_Integer theListType; Handle(TColStd_HArray1OfInteger) theAttrTypes; @@ -134,14 +126,6 @@ private: Handle(TColStd_HArray1OfInteger) theAttrValueCounts; Handle(TColStd_HArray1OfTransient) theAttrValues; Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate) theAttrValuePointers; - - }; - - - - - - #endif // _IGESDefs_AttributeDef_HeaderFile diff --git a/src/IGESDefs/IGESDefs_AttributeTable.cxx b/src/IGESDefs/IGESDefs_AttributeTable.cxx index 31a39944ed..5cd698b69d 100644 --- a/src/IGESDefs/IGESDefs_AttributeTable.cxx +++ b/src/IGESDefs/IGESDefs_AttributeTable.cxx @@ -25,109 +25,271 @@ #include #include #include -#include -#include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_AttributeTable,IGESData_IGESEntity) -// ATTENTION ATTENTION : L Appellation "ROW" n est pas reconduite en l etat -// Le Numero d Attribut est donne en 1er (donc, en colonne du HArray2 et non -// en ligne), le numero de Colonne en 2e (donc, comme un numero de Ligne) -IGESDefs_AttributeTable::IGESDefs_AttributeTable () { } - - - void IGESDefs_AttributeTable::Init - (const Handle(TColStd_HArray2OfTransient)& attributes) -{ - if (attributes->LowerCol() != 1 || attributes->LowerRow() != 1) - Standard_DimensionMismatch::Raise("IGESDefs_AttributeTable : Init"); - theAttributes = attributes; - - Standard_Integer fn = FormNumber(); - if (attributes->UpperCol() > 1) fn = 1; - else if (fn < 0 || fn > 1) fn = 0; - InitTypeAndForm(422,fn); -// FormNumber : 0 SingleRow, 1 MultipleRows (can be reduced to one ...) -} - - void IGESDefs_AttributeTable::SetDefinition - (const Handle(IGESDefs_AttributeDef)& def) +void IGESDefs_AttributeTable::SetDefinition (const Handle(IGESDefs_AttributeDef)& def) { InitMisc (def,LabelDisplay(),LineWeightNumber()); } - Handle(IGESDefs_AttributeDef) IGESDefs_AttributeTable::Definition () const +Handle(IGESDefs_AttributeDef) IGESDefs_AttributeTable::Definition () const { return GetCasted(IGESDefs_AttributeDef,Structure()); } - - Standard_Integer IGESDefs_AttributeTable::NbRows () const +Standard_Integer IGESDefs_AttributeTable::NbRows () const { - return theAttributes->UpperCol(); + return myAttributes->UpperCol(); } - Standard_Integer IGESDefs_AttributeTable::NbAttributes () const +Standard_Integer IGESDefs_AttributeTable::NbAttributes () const { - return theAttributes->UpperRow(); + return myAttributes->UpperRow(); } - Standard_Integer IGESDefs_AttributeTable::DataType - (const Standard_Integer Atnum) const +Standard_Integer IGESDefs_AttributeTable::DataType (const Standard_Integer Atnum) const { return Definition()->AttributeType(Atnum); } - Standard_Integer IGESDefs_AttributeTable::ValueCount - (const Standard_Integer Atnum) const +Standard_Integer IGESDefs_AttributeTable::ValueCount (const Standard_Integer Atnum) const { return Definition()->AttributeValueCount(Atnum); } - Handle(Standard_Transient) IGESDefs_AttributeTable::AttributeList - (const Standard_Integer Atnum, const Standard_Integer Rownum) const +Handle(Standard_Transient) IGESDefs_AttributeTable::AttributeList (const Standard_Integer Atnum, const Standard_Integer Rownum) const { - return theAttributes->Value(Atnum,Rownum); + return myAttributes->Value(Atnum,Rownum); } - Standard_Integer IGESDefs_AttributeTable::AttributeAsInteger - (const Standard_Integer Atnum, const Standard_Integer Rownum, - const Standard_Integer Valuenum) const +Standard_Integer IGESDefs_AttributeTable::AttributeAsInteger (const Standard_Integer Atnum, const Standard_Integer Rownum, const Standard_Integer Valuenum) const { - return GetCasted(TColStd_HArray1OfInteger,theAttributes->Value(Atnum,Rownum)) - ->Value(Valuenum); + return GetCasted(TColStd_HArray1OfInteger,myAttributes->Value(Atnum,Rownum))->Value(Valuenum); } - Standard_Real IGESDefs_AttributeTable::AttributeAsReal - (const Standard_Integer Atnum, const Standard_Integer Rownum, - const Standard_Integer Valuenum) const +Standard_Real IGESDefs_AttributeTable::AttributeAsReal (const Standard_Integer Atnum, const Standard_Integer Rownum, const Standard_Integer Valuenum) const { - return GetCasted(TColStd_HArray1OfReal,theAttributes->Value(Atnum,Rownum)) - ->Value(Valuenum); + return GetCasted(TColStd_HArray1OfReal,myAttributes->Value(Atnum,Rownum))->Value(Valuenum); } - Handle(TCollection_HAsciiString) IGESDefs_AttributeTable::AttributeAsString - (const Standard_Integer Atnum, const Standard_Integer Rownum, - const Standard_Integer Valuenum) const +Handle(TCollection_HAsciiString) IGESDefs_AttributeTable::AttributeAsString (const Standard_Integer Atnum, const Standard_Integer Rownum, const Standard_Integer Valuenum) const { - return GetCasted(Interface_HArray1OfHAsciiString,theAttributes->Value(Atnum,Rownum)) - ->Value(Valuenum); + return GetCasted(Interface_HArray1OfHAsciiString,myAttributes->Value(Atnum,Rownum))->Value(Valuenum); } - Handle(IGESData_IGESEntity) IGESDefs_AttributeTable::AttributeAsEntity - (const Standard_Integer Atnum, const Standard_Integer Rownum, - const Standard_Integer Valuenum) const +Handle(IGESData_IGESEntity) IGESDefs_AttributeTable::AttributeAsEntity (const Standard_Integer Atnum, const Standard_Integer Rownum, const Standard_Integer Valuenum) const { - return GetCasted(IGESData_HArray1OfIGESEntity,theAttributes->Value(Atnum,Rownum)) - ->Value(Valuenum); + return GetCasted(IGESData_HArray1OfIGESEntity,myAttributes->Value(Atnum,Rownum))->Value(Valuenum); } - Standard_Boolean IGESDefs_AttributeTable::AttributeAsLogical - (const Standard_Integer Atnum, const Standard_Integer Rownum, - const Standard_Integer Valuenum) const +Standard_Boolean IGESDefs_AttributeTable::AttributeAsLogical (const Standard_Integer Atnum, const Standard_Integer Rownum, const Standard_Integer Valuenum) const { return (AttributeAsInteger(Atnum,Rownum,Valuenum) != 0); // raccourci } + +void IGESDefs_AttributeTable::OwnRead (IGESFile_Reader &theReader) +{ + Handle(IGESDefs_AttributeDef) ab = Definition(); // formerly loaded + if (ab.IsNull()) { + theReader.AddFail("No Attribute Definition as Structure"); + return; + } + + const Standard_Integer na = ab->NbAttributes(); + + Standard_Integer j, nr = 1; + if (myForm == 1) + if (theReader.ReadInteger(nr,"No. of rows") == IGESFile_Reader::ParamError) nr = 0; + + if (na > 0 && nr > 0) + myAttributes = new TColStd_HArray2OfTransient(1,na,1,nr); + + // AttributeDef repeated once (Form 0) or times (Form 1) + for (Standard_Integer k = 1; k <= nr; k ++) + { + for (Standard_Integer i = 1; i <= na; i ++) + { + const Standard_Integer avc = ab->AttributeValueCount(i); + const Standard_Integer atype = ab->AttributeValueDataType(i); + switch (atype) + { + case 0 : + for (j = 1; j <= avc; j ++) + theReader.ReadAny(); + break; + case 1 : { + Handle(TColStd_HArray1OfInteger) attrInt = new TColStd_HArray1OfInteger(1,avc); + myAttributes->SetValue(i,k,attrInt); + for (j = 1; j <= avc; j ++) + theReader.ReadInteger(attrInt->ChangeValue(j),"Value"); + } + break; + case 2 : { + Handle(TColStd_HArray1OfReal) attrReal = new TColStd_HArray1OfReal(1,avc); + myAttributes->SetValue(i,k,attrReal); + for (j = 1; j <= avc; j ++) + theReader.ReadReal(attrReal->ChangeValue(j),"Value"); + } + break; + case 3 : { + Handle(Interface_HArray1OfHAsciiString) attrStr = new Interface_HArray1OfHAsciiString(1,avc); + myAttributes->SetValue(i,k,attrStr); + for (j = 1; j <= avc; j ++) + theReader.ReadText(attrStr->ChangeValue(j),"Value"); + } + break; + case 4 : { + Handle(IGESData_HArray1OfIGESEntity) attrEnt = new IGESData_HArray1OfIGESEntity(1,avc); + myAttributes->SetValue(i,k,attrEnt); + for (j = 1; j <= avc; j ++) + theReader.ReadPointer(attrEnt->ChangeValue(j),"Value"); + } + break; + case 5 : + for (j = 1; j <= avc; j ++) + theReader.ReadAny(); + break; + case 6 : { // Here item takes value 0 or 1 + Handle(TColStd_HArray1OfInteger) attrInt = new TColStd_HArray1OfInteger(1,avc); + myAttributes->SetValue(i,k,attrInt); + for (j = 1; j <= avc; j ++) + theReader.ReadInteger(attrInt->ChangeValue(j),"Value"); + } + break; + default : break; + } + } + } +} + +void IGESDefs_AttributeTable::OwnWrite (IGESData_IGESWriter& IW) const +{ + Handle(IGESDefs_AttributeDef) ab = Definition(); + + const Standard_Integer nr = NbRows(); + const Standard_Integer na = NbAttributes(); + if (myForm == 1) IW.Send(nr); + for (Standard_Integer k = 1; k <= nr; k ++) + { + for (Standard_Integer i = 1; i <= na; i ++) + { + const Standard_Integer count = ab->AttributeValueCount(i); + for (Standard_Integer j = 1;j <= count; j++) + { + switch(ab->AttributeValueDataType(i)) + { + case 0 : IW.SendVoid(); break; + case 1 : IW.Send(AttributeAsInteger(i,k,j)); break; + case 2 : IW.Send(AttributeAsReal (i,k,j)); break; + case 3 : IW.Send(AttributeAsString (i,k,j)); break; + case 4 : IW.Send(AttributeAsEntity (i,k,j)); break; + case 5 : IW.SendVoid(); break; + case 6 : IW.SendBoolean(AttributeAsLogical(i,k,j)); break; + default : break; + } + } + } + } +} + +void IGESDefs_AttributeTable::OwnShared (Interface_EntityIterator& iter) const +{ + Handle(IGESDefs_AttributeDef) ab = Definition(); + const Standard_Integer na = NbAttributes(); + const Standard_Integer nr = NbRows(); + for (Standard_Integer k = 1; k <= nr; k ++) + { + for (Standard_Integer i = 1; i <= na; i ++) + { + if (ab->AttributeValueDataType(i) != 4) continue; + const Standard_Integer avc = ab->AttributeValueCount(i); + for (Standard_Integer j = 1; j <= avc; j ++) + iter.GetOneItem(AttributeAsEntity(i,k,j)); + } + } +} + +IGESData_DirChecker IGESDefs_AttributeTable::DirChecker () const +{ + IGESData_DirChecker DC(422,0,1); + DC.Structure(IGESData_DefReference); + DC.GraphicsIgnored(); + DC.BlankStatusIgnored(); + DC.HierarchyStatusIgnored(); + return DC; +} + +void IGESDefs_AttributeTable::OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &ach) const +{ + if (Definition().IsNull()) { + if (!Structure().IsNull()) + ach->AddFail("Structure in Directory Entry is not an Attribute Definition Table"); + else + ach->AddFail("No Attribute Definition defined"); + } + if (myForm == 0 && NbRows() != 1) + ach->AddFail("Form 0 with several Rows"); + if (NbAttributes() != Definition()->NbAttributes()) + ach->AddFail("Mismatch between Definition (Structure) and Content"); +} + +void IGESDefs_AttributeTable::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESDefs_AttributeTable" << endl; + + Handle(IGESDefs_AttributeDef) ab = Definition(); + + const Standard_Integer na = NbAttributes(); + const Standard_Integer nr = NbRows(); + if (myForm == 1) + S << "Number of Rows (i.e. complete sets of Attributes) : " << nr << endl; + else S << "One set of Attributes" << endl; + S << "Number of defined Attributes : " << na << endl; + if (level <= 4) S << + " [ structure : see Structure in Directory Entry; content : level > 4 ]" <AttributeValueCount(i); + S << "[At.no."<AttributeValueDataType(i)) { + case 0 : S << " (Void) "; break; + case 1 : S << " Integer"; break; + case 2 : S << " Real "; break; + case 3 : S << " String "; break; + case 4 : S << " Entity "; break; + case 5 : S << " (Not used)"; break; + case 6 : S << " Logical"; break; + default : break; + } + S << " :"; + for (Standard_Integer j = 1;j <= avc; j++) { + S << " "; + switch(ab->AttributeValueDataType(i)) { + case 1 : S << AttributeAsInteger(i,k,j); break; + case 2 : S << AttributeAsReal (i,k,j); break; + case 3 : IGESData_DumpString(S,AttributeAsString (i,k,j)); break; + case 4 : dumper.Dump(AttributeAsEntity (i,k,j),S,level-5); break; + case 6 : S << (AttributeAsLogical(i,k,j) ? "True" : "False"); break; + default : break; + } + } + S << endl; + } + } + S << endl; +} diff --git a/src/IGESDefs/IGESDefs_AttributeTable.hxx b/src/IGESDefs/IGESDefs_AttributeTable.hxx index a830114849..3dfd48faea 100644 --- a/src/IGESDefs/IGESDefs_AttributeTable.hxx +++ b/src/IGESDefs/IGESDefs_AttributeTable.hxx @@ -17,24 +17,11 @@ #ifndef _IGESDefs_AttributeTable_HeaderFile #define _IGESDefs_AttributeTable_HeaderFile -#include -#include - -#include #include -#include -#include -#include -class Standard_OutOfRange; -class Standard_NullObject; -class IGESDefs_AttributeDef; -class Standard_Transient; class TCollection_HAsciiString; -class IGESData_IGESEntity; - +class TColStd_HArray2OfTransient; +class IGESDefs_AttributeDef; -class IGESDefs_AttributeTable; -DEFINE_STANDARD_HANDLE(IGESDefs_AttributeTable, IGESData_IGESEntity) //! defines IGES Attribute Table, Type <422> Form <0, 1> //! in package IGESDefs @@ -43,11 +30,15 @@ DEFINE_STANDARD_HANDLE(IGESDefs_AttributeTable, IGESData_IGESEntity) //! or dependent or pointed at by other Entities. class IGESDefs_AttributeTable : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 422; } - - Standard_EXPORT IGESDefs_AttributeTable(); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return myForm; } + + IGESDefs_AttributeTable(const Standard_Integer theForm) + : myForm(theForm) + {} //! This method is used to set the fields of the class //! AttributeTable @@ -102,28 +93,24 @@ public: //! Error if Indices out of Range, or no Value defined, or not a Logical Standard_EXPORT Standard_Boolean AttributeAsLogical (const Standard_Integer AtNum, const Standard_Integer Rownum, const Standard_Integer ValNum) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator& iter) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESDefs_AttributeTable,IGESData_IGESEntity) - -protected: - - - - -private: + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; - Handle(TColStd_HArray2OfTransient) theAttributes; + DEFINE_STANDARD_RTTIEXT(IGESDefs_AttributeTable,IGESData_IGESEntity) + private: + Standard_Integer myForm; + Handle(TColStd_HArray2OfTransient) myAttributes; }; - - - - - - #endif // _IGESDefs_AttributeTable_HeaderFile diff --git a/src/IGESDefs/IGESDefs_GeneralModule.cxx b/src/IGESDefs/IGESDefs_GeneralModule.cxx index 2f053e01cc..bfb10096ca 100644 --- a/src/IGESDefs/IGESDefs_GeneralModule.cxx +++ b/src/IGESDefs/IGESDefs_GeneralModule.cxx @@ -21,13 +21,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -38,137 +31,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_GeneralModule,IGESData_GeneralModule) - void IGESDefs_GeneralModule::OwnSharedCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - Interface_EntityIterator& iter) const -{ - switch (CN) { - case 2 : { - DeclareAndCast(IGESDefs_AttributeDef,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolAttributeDef tool; - tool.OwnShared(anent,iter); - } - break; - case 3 : { - DeclareAndCast(IGESDefs_AttributeTable,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolAttributeTable tool; - tool.OwnShared(anent,iter); - } - break; - case 4 : { - DeclareAndCast(IGESDefs_GenericData,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolGenericData tool; - tool.OwnShared(anent,iter); - } - break; - default : break; - } -} - - - IGESData_DirChecker IGESDefs_GeneralModule::DirChecker - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESDefs_AssociativityDef,anent,ent); - if (anent.IsNull()) break; - IGESDefs_ToolAssociativityDef tool; - return tool.DirChecker(anent); - } - case 2 : { - DeclareAndCast(IGESDefs_AttributeDef,anent,ent); - if (anent.IsNull()) break; - IGESDefs_ToolAttributeDef tool; - return tool.DirChecker(anent); - } - case 3 : { - DeclareAndCast(IGESDefs_AttributeTable,anent,ent); - if (anent.IsNull()) break; - IGESDefs_ToolAttributeTable tool; - return tool.DirChecker(anent); - } - case 4 : { - DeclareAndCast(IGESDefs_GenericData,anent,ent); - if (anent.IsNull()) break; - IGESDefs_ToolGenericData tool; - return tool.DirChecker(anent); - } - case 5 : { - DeclareAndCast(IGESDefs_MacroDef,anent,ent); - if (anent.IsNull()) break; - IGESDefs_ToolMacroDef tool; - return tool.DirChecker(anent); - } - case 6 : { - DeclareAndCast(IGESDefs_TabularData,anent,ent); - if (anent.IsNull()) break; - IGESDefs_ToolTabularData tool; - return tool.DirChecker(anent); - } - case 7 : { - DeclareAndCast(IGESDefs_UnitsData,anent,ent); - if (anent.IsNull()) break; - IGESDefs_ToolUnitsData tool; - return tool.DirChecker(anent); - } - default : break; - } - return IGESData_DirChecker(); // by default, no specific criterium -} - - - void IGESDefs_GeneralModule::OwnCheckCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const -{ - switch (CN) { - case 2 : { - DeclareAndCast(IGESDefs_AttributeDef,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolAttributeDef tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 3 : { - DeclareAndCast(IGESDefs_AttributeTable,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolAttributeTable tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 4 : { - DeclareAndCast(IGESDefs_GenericData,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolGenericData tool; - tool.OwnCheck(anent,shares,ach); - } - break; - default : break; - } -} - - - Standard_Boolean IGESDefs_GeneralModule::NewVoid - (const Standard_Integer CN, Handle(Standard_Transient)& ent) const -{ - switch (CN) { - case 1 : ent = new IGESDefs_AssociativityDef; break; - case 2 : ent = new IGESDefs_AttributeDef; break; - case 3 : ent = new IGESDefs_AttributeTable; break; - case 4 : ent = new IGESDefs_GenericData; break; - case 5 : ent = new IGESDefs_MacroDef; break; - case 6 : ent = new IGESDefs_TabularData; break; - case 7 : ent = new IGESDefs_UnitsData; break; - default : return Standard_False; // by default, Failure on Recognize - } - return Standard_True; -} - - Standard_Integer IGESDefs_GeneralModule::CategoryNumber (const Standard_Integer /*CN*/, const Handle(Standard_Transient)& /*ent*/, const Interface_ShareTool& ) const diff --git a/src/IGESDefs/IGESDefs_GeneralModule.hxx b/src/IGESDefs/IGESDefs_GeneralModule.hxx index 6506314ef0..f01b61b73e 100644 --- a/src/IGESDefs/IGESDefs_GeneralModule.hxx +++ b/src/IGESDefs/IGESDefs_GeneralModule.hxx @@ -32,21 +32,6 @@ class IGESDefs_GeneralModule : public IGESData_GeneralModule //! Creates a GeneralModule from IGESDefs and puts it into GeneralLib IGESDefs_GeneralModule() {} - //! Lists the Entities shared by a given IGESEntity , from - //! its specific parameters : specific for each type - Standard_EXPORT void OwnSharedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - - //! Returns a DirChecker, specific for each type of Entity - //! (identified by its Case Number) : this DirChecker defines - //! constraints which must be respected by the DirectoryPart - Standard_EXPORT IGESData_DirChecker DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - - //! Performs Specific Semantic Check for each type of Entity - Standard_EXPORT void OwnCheckCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE; - - //! Specific creation of a new void entity - Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE; - //! Returns a category number which characterizes an entity //! Auxiliary for all Standard_EXPORT virtual Standard_Integer CategoryNumber (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares) const Standard_OVERRIDE; diff --git a/src/IGESDefs/IGESDefs_GenericData.cxx b/src/IGESDefs/IGESDefs_GenericData.cxx index acd83e9f6b..8f0779041c 100644 --- a/src/IGESDefs/IGESDefs_GenericData.cxx +++ b/src/IGESDefs/IGESDefs_GenericData.cxx @@ -13,10 +13,6 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- -// rln 11.05.2000 BUC60660 - #include #include #include @@ -25,90 +21,217 @@ #include #include #include -#include -#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_GenericData,IGESData_IGESEntity) -IGESDefs_GenericData::IGESDefs_GenericData () { } +Standard_Integer IGESDefs_GenericData::NbTypeValuePairs () const +{ + return myTypes->Length(); +} + +Standard_Integer IGESDefs_GenericData::Type (const Standard_Integer Index) const +{ + return myTypes->Value(Index); +} +Handle(Standard_Transient) IGESDefs_GenericData::Value (const Standard_Integer Index) const +{ + return myValues->Value(Index); +} - void IGESDefs_GenericData::Init - (const Standard_Integer nbPropVal, - const Handle(TCollection_HAsciiString)& aName, - const Handle(TColStd_HArray1OfInteger)& allTypes, - const Handle(TColStd_HArray1OfTransient)& allValues) +Standard_Integer IGESDefs_GenericData::ValueAsInteger (const Standard_Integer Index) const { - // rln May 11, 2000 BUC60660 - // Number of TYPE/VALUE pairs is 0 and arrays are null handles, - // this caused exception - if ( !allTypes.IsNull() && !allValues.IsNull() && - (allValues->Lower() != 1 || allTypes->Lower() != 1 || - allTypes->Length() != allValues->Length() ) ) - Standard_DimensionMismatch::Raise("IGESDefs_GenericData: Init"); - theNbPropertyValues = nbPropVal; - theName = aName; - theTypes = allTypes; - theValues = allValues; - InitTypeAndForm(406,27); + return GetCasted(TColStd_HArray1OfInteger,myValues->Value(Index))->Value(1); } - Standard_Integer IGESDefs_GenericData::NbPropertyValues () const +Standard_Real IGESDefs_GenericData::ValueAsReal (const Standard_Integer Index) const { -// return 2 * theTypes->Length() + 2; - return theNbPropertyValues; + return GetCasted(TColStd_HArray1OfReal,myValues->Value(Index))->Value(1); } - Handle(TCollection_HAsciiString) IGESDefs_GenericData::Name () const +Handle(TCollection_HAsciiString) IGESDefs_GenericData::ValueAsString (const Standard_Integer Index) const { - return theName; + return GetCasted(TCollection_HAsciiString,myValues->Value(Index)); } - Standard_Integer IGESDefs_GenericData::NbTypeValuePairs () const +Handle(IGESData_IGESEntity) IGESDefs_GenericData::ValueAsEntity (const Standard_Integer Index) const { - return theTypes->Length(); + return GetCasted(IGESData_IGESEntity,myValues->Value(Index)); } - Standard_Integer IGESDefs_GenericData::Type (const Standard_Integer Index) const +Standard_Boolean IGESDefs_GenericData::ValueAsLogical (const Standard_Integer Index) const { - return theTypes->Value(Index); + return (GetCasted(TColStd_HArray1OfInteger,myValues->Value(Index))->Value(1) != 0); } - Handle(Standard_Transient) IGESDefs_GenericData::Value - (const Standard_Integer Index) const +void IGESDefs_GenericData::OwnRead (IGESFile_Reader &theReader) { - return theValues->Value(Index); + theReader.ReadInteger(myNbPropertyValues,"Number of property values"); + theReader.ReadText(myName,"Property Name"); + + Standard_Integer num = 0; + theReader.ReadInteger(num,"Number of TYPE/VALUEs"); + if (num > 0) + { + myTypes = new TColStd_HArray1OfInteger(1, num); + myValues = new TColStd_HArray1OfTransient(1, num); + + for ( Standard_Integer i = 1; i <= num; i++ ) + { + Standard_Integer tempTyp; + theReader.ReadInteger(tempTyp,"Type code"); + myTypes->SetValue(i, tempTyp); + switch (tempTyp) + { + case 0: theReader.ReadAny(); break; + case 1: // Integer + { + Handle(TColStd_HArray1OfInteger) tempObj = new TColStd_HArray1OfInteger(1,1); + if (theReader.ReadInteger(tempObj->ChangeFirst(),"Integer value") == IGESFile_Reader::ParamOK) + myValues->SetValue(i, tempObj); + } + break; + case 2: // Real + { + Handle(TColStd_HArray1OfReal) tempObj = new TColStd_HArray1OfReal(1,1); + if (theReader.ReadReal(tempObj->ChangeFirst(),"Real value") == IGESFile_Reader::ParamOK) + myValues->SetValue(i, tempObj); + } + break; + case 3: // Character string + { + Handle(TCollection_HAsciiString) tempObj; + if (theReader.ReadText(tempObj,"String value") == IGESFile_Reader::ParamOK) + myValues->SetValue(i, tempObj); + } + break; + case 4: // Pointer + { + Interface_Pointer tempEntity; + if (theReader.ReadPointer(tempEntity,"Entity value") == IGESFile_Reader::ParamOK) + myValues->SetValue(i, tempEntity); + } + break; + case 5: theReader.ReadAny(); + break; + case 6: // Logical + { + Handle(TColStd_HArray1OfInteger) tempObj = new TColStd_HArray1OfInteger(1,1); + Standard_Boolean tempBool; + if (theReader.ReadBoolean(tempBool,"Boolean value")) { + tempObj->SetValue(1, (tempBool ? 1 : 0)); + myValues->SetValue(i, tempObj); + } + } + break; + } + } + } + else theReader.AddFail("Number of TYPE/VALUEs: Not Positive"); } - Standard_Integer IGESDefs_GenericData::ValueAsInteger - (const Standard_Integer Index) const +void IGESDefs_GenericData::OwnWrite (IGESData_IGESWriter& IW) const { - return GetCasted(TColStd_HArray1OfInteger,theValues->Value(Index))->Value(1); + IW.Send(myNbPropertyValues); + IW.Send(myName); + const Standard_Integer num = NbTypeValuePairs(); + IW.Send(num); + for ( Standard_Integer i = 1; i <= num; i++ ) + { + const Standard_Integer typ = Type(i); + IW.Send(typ); + switch (typ) + { + case 0 : IW.SendVoid(); break; + case 1 : IW.Send(ValueAsInteger(i)); break; + case 2 : IW.Send(ValueAsReal(i)); break; + case 3 : IW.Send(ValueAsString(i)); break; + case 4 : IW.Send(ValueAsEntity(i)); break; + case 5 : IW.SendVoid(); break; + case 6 : IW.SendBoolean(ValueAsLogical(i)); break; + default : break; + } + } } - Standard_Real IGESDefs_GenericData::ValueAsReal - (const Standard_Integer Index) const +void IGESDefs_GenericData::OwnShared (Interface_EntityIterator& iter) const { - return GetCasted(TColStd_HArray1OfReal,theValues->Value(Index))->Value(1); + const Standard_Integer num = NbTypeValuePairs(); + for ( Standard_Integer i = 1; i <= num; i++ ) + { + if (Type(i) == 4) + iter.GetOneItem(ValueAsEntity(i)); + } } - Handle(TCollection_HAsciiString) IGESDefs_GenericData::ValueAsString - (const Standard_Integer Index) const +IGESData_DirChecker IGESDefs_GenericData::DirChecker () const { - return GetCasted(TCollection_HAsciiString,theValues->Value(Index)); + IGESData_DirChecker DC(406, 27); + DC.Structure(IGESData_DefVoid); + DC.GraphicsIgnored(); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.SubordinateStatusRequired(1); + DC.UseFlagRequired(2); + DC.HierarchyStatusIgnored(); + return DC; } - Handle(IGESData_IGESEntity) IGESDefs_GenericData::ValueAsEntity - (const Standard_Integer Index) const +void IGESDefs_GenericData::OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &ach) const { - return GetCasted(IGESData_IGESEntity,theValues->Value(Index)); + if (myNbPropertyValues != NbTypeValuePairs()*2 + 2) + ach->AddFail("Nb. of Property Values not consistent with Nb. of Type/value Pairs"); } - Standard_Boolean IGESDefs_GenericData::ValueAsLogical - (const Standard_Integer Index) const +void IGESDefs_GenericData::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const { - return (GetCasted(TColStd_HArray1OfInteger,theValues->Value(Index))->Value(1) - != 0); + S << "IGESDefs_GenericData" << endl; + S << "Number of property values : " << myNbPropertyValues << endl; + S << "Property Name : "; + IGESData_DumpString(S,myName); + S << endl; + switch (level) + { + case 4: + S << "Types : " << endl; + S << "Values : Count = " << NbTypeValuePairs() << endl; + S << " [ as level > 4 for content ]" << endl; + break; + case 5: + case 6: + { + Standard_Integer i, num; + S << "Types & Values : " << endl; + for ( num = NbTypeValuePairs(), i = 1; i <= num; i++ ) + { + S << "[" << i << "]: "; + S << "Type : " << Type(i); + switch (Type(i)) { + case 0 : S << " (Void)"; break; + case 1 : S << " Integer, Value : " << ValueAsInteger(i); break; + case 2 : S << " Real , Value : " << ValueAsReal(i); break; + case 3 : S << " String , Value : "; IGESData_DumpString(S,ValueAsString(i)); break; + case 4 : S << " Entity , Value : "; dumper.Dump(ValueAsEntity(i),S,level-1); break; + case 5 : S << " (Not used)"; break; + case 6 : S << " Logical, Value : " << (ValueAsLogical(i) ? "True" : "False"); break; + default : break; + } + S << endl; + } + } + } + S << endl; } diff --git a/src/IGESDefs/IGESDefs_GenericData.hxx b/src/IGESDefs/IGESDefs_GenericData.hxx index a42b6f91d4..8686c77c94 100644 --- a/src/IGESDefs/IGESDefs_GenericData.hxx +++ b/src/IGESDefs/IGESDefs_GenericData.hxx @@ -17,25 +17,11 @@ #ifndef _IGESDefs_GenericData_HeaderFile #define _IGESDefs_GenericData_HeaderFile -#include -#include - -#include -#include -#include #include -#include -#include class TCollection_HAsciiString; -class Standard_DimensionMismatch; -class Standard_OutOfRange; -class Standard_NullObject; -class Standard_Transient; -class IGESData_IGESEntity; - +class TColStd_HArray1OfInteger; +class TColStd_HArray1OfTransient; -class IGESDefs_GenericData; -DEFINE_STANDARD_HANDLE(IGESDefs_GenericData, IGESData_IGESEntity) //! defines IGES Generic Data, Type <406> Form <27> //! in package IGESDefs @@ -47,12 +33,16 @@ DEFINE_STANDARD_HANDLE(IGESDefs_GenericData, IGESData_IGESEntity) //! instances of this property. class IGESDefs_GenericData : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 27; } + + IGESDefs_GenericData() + : myNbPropertyValues(0) + {} - - Standard_EXPORT IGESDefs_GenericData(); - //! This method is used to set the fields of the class //! GenericData //! - nbPropVal : Number of property values @@ -62,11 +52,11 @@ public: Standard_EXPORT void Init (const Standard_Integer nbPropVal, const Handle(TCollection_HAsciiString)& aName, const Handle(TColStd_HArray1OfInteger)& allTypes, const Handle(TColStd_HArray1OfTransient)& allValues); //! returns the number of property values - Standard_EXPORT Standard_Integer NbPropertyValues() const; - + Standard_Integer NbPropertyValues() const { return myNbPropertyValues; } + //! returns property name - Standard_EXPORT Handle(TCollection_HAsciiString) Name() const; - + const Handle(TCollection_HAsciiString) & Name() const { return myName; } + //! returns the number of TYPE/VALUE pairs Standard_EXPORT Standard_Integer NbTypeValuePairs() const; @@ -99,31 +89,26 @@ public: //! Error if Index out of Range, or not a Logical Standard_EXPORT Standard_Boolean ValueAsLogical (const Standard_Integer ValueNum) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator& iter) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESDefs_GenericData,IGESData_IGESEntity) - -protected: - - - - -private: + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; - Standard_Integer theNbPropertyValues; - Handle(TCollection_HAsciiString) theName; - Handle(TColStd_HArray1OfInteger) theTypes; - Handle(TColStd_HArray1OfTransient) theValues; + DEFINE_STANDARD_RTTIEXT(IGESDefs_GenericData,IGESData_IGESEntity) + private: + Standard_Integer myNbPropertyValues; + Handle(TCollection_HAsciiString) myName; + Handle(TColStd_HArray1OfInteger) myTypes; + Handle(TColStd_HArray1OfTransient) myValues; }; - - - - - - #endif // _IGESDefs_GenericData_HeaderFile diff --git a/src/IGESDefs/IGESDefs_HArray1OfTabularData.hxx b/src/IGESDefs/IGESDefs_HArray1OfTabularData.hxx index 2e4f16ff10..3f9ddec2db 100644 --- a/src/IGESDefs/IGESDefs_HArray1OfTabularData.hxx +++ b/src/IGESDefs/IGESDefs_HArray1OfTabularData.hxx @@ -17,11 +17,9 @@ #ifndef IGESDefs_HArray1OfTabularData_HeaderFile #define IGESDefs_HArray1OfTabularData_HeaderFile -#include #include #include DEFINE_HARRAY1(IGESDefs_HArray1OfTabularData, IGESDefs_Array1OfTabularData) - #endif diff --git a/src/IGESDefs/IGESDefs_MacroDef.cxx b/src/IGESDefs/IGESDefs_MacroDef.cxx index 6047c5c09d..39e3f53ade 100644 --- a/src/IGESDefs/IGESDefs_MacroDef.cxx +++ b/src/IGESDefs/IGESDefs_MacroDef.cxx @@ -19,50 +19,86 @@ #include #include #include -#include #include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_MacroDef,IGESData_IGESEntity) -IGESDefs_MacroDef::IGESDefs_MacroDef () { } - - void IGESDefs_MacroDef::Init - (const Handle(TCollection_HAsciiString)& macro, - const Standard_Integer entityTypeID, - const Handle(Interface_HArray1OfHAsciiString)& langStatements, - const Handle(TCollection_HAsciiString)& endMacro) +Standard_Integer IGESDefs_MacroDef::NbStatements () const { - if (langStatements->Lower() != 1) - Standard_DimensionMismatch::Raise("IGESDefs_MacroDef : Init"); - theMACRO = macro; - theEntityTypeID = entityTypeID; - theLangStatements = langStatements; - theENDMACRO = endMacro; - InitTypeAndForm(306,0); + return myLangStatements->Length(); } - Standard_Integer IGESDefs_MacroDef::NbStatements () const +const Handle(TCollection_HAsciiString) & IGESDefs_MacroDef::LanguageStatement (const Standard_Integer StatNum) const { - return theLangStatements->Length(); + return myLangStatements->Value(StatNum); } - Handle(TCollection_HAsciiString) IGESDefs_MacroDef::MACRO () const -{ - return theMACRO; +void IGESDefs_MacroDef::OwnRead (IGESFile_Reader &theReader) +{ + theReader.ReadText(myMACRO,"MACRO"); + theReader.ReadInteger(myEntityTypeID,"Entity Type ID"); + + NCollection_Sequence seq; + Handle(TCollection_HAsciiString) langStat; + + while (theReader.HasData()) + if (theReader.ReadText(langStat,"Language Statement") == IGESFile_Reader::ParamOK) + seq.Append(langStat); + + const Standard_Integer nbval = seq.Length(); + if (nbval > 1) + { + myLangStatements = new Interface_HArray1OfHAsciiString(1, nbval-1); + for (Standard_Integer i = 1; i < nbval; i++) + myLangStatements->SetValue(i,seq.Value(i)); + } + else theReader.AddFail("Number of Lang. Stats. : Not Positive"); + + if (nbval > 0) + myENDMACRO = seq.Last(); } - Standard_Integer IGESDefs_MacroDef::EntityTypeID () const -{ - return theEntityTypeID; +void IGESDefs_MacroDef::OwnWrite (IGESData_IGESWriter& IW) const +{ + IW.Send(myMACRO); + IW.Send(myEntityTypeID); + const Standard_Integer upper = NbStatements(); + for (Standard_Integer i = 1; i <= upper; i++) + IW.Send(LanguageStatement(i)); + IW.Send(myENDMACRO); } - Handle(TCollection_HAsciiString) IGESDefs_MacroDef::LanguageStatement - (const Standard_Integer StatNum) const -{ - return theLangStatements->Value(StatNum); +IGESData_DirChecker IGESDefs_MacroDef::DirChecker () const +{ + IGESData_DirChecker DC (306, 0); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.SubordinateStatusRequired(0); + DC.UseFlagRequired(2); + DC.HierarchyStatusIgnored(); + return DC; } - Handle(TCollection_HAsciiString) IGESDefs_MacroDef::ENDMACRO () const -{ - return theENDMACRO; +void IGESDefs_MacroDef::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESDefs_MacroDef" << endl; + S << "MACRO : "; + IGESData_DumpString(S,myMACRO); + S << endl; + S << "Entity Type ID : " << myEntityTypeID << endl; + S << "Language Statement : "; + IGESData_DumpStrings(S,level,1,NbStatements(),LanguageStatement); + S << "END MACRO : "; + IGESData_DumpString(S,myENDMACRO); + S << endl; } diff --git a/src/IGESDefs/IGESDefs_MacroDef.hxx b/src/IGESDefs/IGESDefs_MacroDef.hxx index afaecc4197..2f84398c25 100644 --- a/src/IGESDefs/IGESDefs_MacroDef.hxx +++ b/src/IGESDefs/IGESDefs_MacroDef.hxx @@ -17,18 +17,10 @@ #ifndef _IGESDefs_MacroDef_HeaderFile #define _IGESDefs_MacroDef_HeaderFile -#include -#include - -#include -#include #include class TCollection_HAsciiString; -class Standard_OutOfRange; - +class Interface_HArray1OfHAsciiString; -class IGESDefs_MacroDef; -DEFINE_STANDARD_HANDLE(IGESDefs_MacroDef, IGESData_IGESEntity) //! defines IGES Macro Definition Entity, Type <306> Form <0> //! in package IGESDefs @@ -37,11 +29,15 @@ DEFINE_STANDARD_HANDLE(IGESDefs_MacroDef, IGESData_IGESEntity) //! by means of MACRO class instance entity. class IGESDefs_MacroDef : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 306; } - - Standard_EXPORT IGESDefs_MacroDef(); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 0; } + + IGESDefs_MacroDef() + : myEntityTypeID(0) + {} //! This method is used to set the fields of the class //! MacroDef @@ -55,41 +51,32 @@ public: Standard_EXPORT Standard_Integer NbStatements() const; //! returns the MACRO(Literal) - Standard_EXPORT Handle(TCollection_HAsciiString) MACRO() const; - + const Handle(TCollection_HAsciiString) & MACRO() const { return myMACRO; } + //! returns the Entity Type ID - Standard_EXPORT Standard_Integer EntityTypeID() const; - - Standard_EXPORT Handle(TCollection_HAsciiString) LanguageStatement (const Standard_Integer StatNum) const; + Standard_Integer EntityTypeID() const { return myEntityTypeID; } + + Standard_EXPORT const Handle(TCollection_HAsciiString) & LanguageStatement (const Standard_Integer StatNum) const; //! returns the ENDM(Literal) - Standard_EXPORT Handle(TCollection_HAsciiString) ENDMACRO() const; + const Handle(TCollection_HAsciiString) & ENDMACRO() const { return myENDMACRO; } + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESDefs_MacroDef,IGESData_IGESEntity) -protected: - - - - -private: - - - Handle(TCollection_HAsciiString) theMACRO; - Standard_Integer theEntityTypeID; - Handle(Interface_HArray1OfHAsciiString) theLangStatements; - Handle(TCollection_HAsciiString) theENDMACRO; - + private: + Handle(TCollection_HAsciiString) myMACRO; + Standard_Integer myEntityTypeID; + Handle(Interface_HArray1OfHAsciiString) myLangStatements; + Handle(TCollection_HAsciiString) myENDMACRO; }; - - - - - - #endif // _IGESDefs_MacroDef_HeaderFile diff --git a/src/IGESDefs/IGESDefs_ReadWriteModule.cxx b/src/IGESDefs/IGESDefs_ReadWriteModule.cxx deleted file mode 100644 index 744bce0a8e..0000000000 --- a/src/IGESDefs/IGESDefs_ReadWriteModule.cxx +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_ReadWriteModule,IGESData_ReadWriteModule) - - - Standard_Integer IGESDefs_ReadWriteModule::CaseIGES - (const Standard_Integer typenum, const Standard_Integer formnum) const -{ - switch (typenum) { - case 302 : return 1; - case 306 : return 5; - case 316 : return 7; - case 322 : return 2; - case 406 : - switch (formnum) { - case 11 : return 6; - case 27 : return 4; - default : break; - } - break; - case 422 : return 3; - default : break; - } - return 0; -} - - - void IGESDefs_ReadWriteModule::ReadOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESDefs_AssociativityDef,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolAssociativityDef tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 2 : { - DeclareAndCast(IGESDefs_AttributeDef,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolAttributeDef tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 3 : { - DeclareAndCast(IGESDefs_AttributeTable,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolAttributeTable tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 4 : { - DeclareAndCast(IGESDefs_GenericData,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolGenericData tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 5 : { - DeclareAndCast(IGESDefs_MacroDef,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolMacroDef tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 6 : { - DeclareAndCast(IGESDefs_TabularData,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolTabularData tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 7 : { - DeclareAndCast(IGESDefs_UnitsData,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolUnitsData tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - default : break; - } -} - - - void IGESDefs_ReadWriteModule::WriteOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - IGESData_IGESWriter& IW) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESDefs_AssociativityDef,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolAssociativityDef tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 2 : { - DeclareAndCast(IGESDefs_AttributeDef,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolAttributeDef tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 3 : { - DeclareAndCast(IGESDefs_AttributeTable,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolAttributeTable tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 4 : { - DeclareAndCast(IGESDefs_GenericData,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolGenericData tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 5 : { - DeclareAndCast(IGESDefs_MacroDef,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolMacroDef tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 6 : { - DeclareAndCast(IGESDefs_TabularData,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolTabularData tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 7 : { - DeclareAndCast(IGESDefs_UnitsData,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolUnitsData tool; - tool.WriteOwnParams(anent,IW); - } - break; - default : break; - } -} diff --git a/src/IGESDefs/IGESDefs_ReadWriteModule.hxx b/src/IGESDefs/IGESDefs_ReadWriteModule.hxx deleted file mode 100644 index 455faae6e3..0000000000 --- a/src/IGESDefs/IGESDefs_ReadWriteModule.hxx +++ /dev/null @@ -1,52 +0,0 @@ -// Created on: 1993-09-06 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDefs_ReadWriteModule_HeaderFile -#define _IGESDefs_ReadWriteModule_HeaderFile - -#include -class IGESData_IGESEntity; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; - - -class IGESDefs_ReadWriteModule; -DEFINE_STANDARD_HANDLE(IGESDefs_ReadWriteModule, IGESData_ReadWriteModule) - -//! Defines Defs File Access Module for IGESDefs (specific parts) -//! Specific actions concern : Read and Write Own Parameters of -//! an IGESEntity. -class IGESDefs_ReadWriteModule : public IGESData_ReadWriteModule -{ - public: - - //! Creates a ReadWriteModule & puts it into ReaderLib & WriterLib - IGESDefs_ReadWriteModule() {} - - //! Defines Case Numbers for Entities of IGESDefs - Standard_EXPORT Standard_Integer CaseIGES (const Standard_Integer typenum, const Standard_Integer formnum) const Standard_OVERRIDE; - - //! Reads own parameters from file for an Entity of IGESDefs - Standard_EXPORT void ReadOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const Standard_OVERRIDE; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, IGESData_IGESWriter& IW) const Standard_OVERRIDE; - - DEFINE_STANDARD_RTTIEXT(IGESDefs_ReadWriteModule,IGESData_ReadWriteModule) -}; - -#endif // _IGESDefs_ReadWriteModule_HeaderFile diff --git a/src/IGESDefs/IGESDefs_SpecificModule.cxx b/src/IGESDefs/IGESDefs_SpecificModule.cxx deleted file mode 100644 index 537d2f92c5..0000000000 --- a/src/IGESDefs/IGESDefs_SpecificModule.cxx +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_SpecificModule,IGESData_SpecificModule) - -// Each Module is attached to a Protocol : it must interprete Case Numbers -// (arguments of various methods) in accordance to values returned by -// the method TypeNumber from this Protocol -IGESDefs_SpecificModule::IGESDefs_SpecificModule() { } - - - void IGESDefs_SpecificModule::OwnDump - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, - const Standard_Integer own) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESDefs_AssociativityDef,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolAssociativityDef tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 2 : { - DeclareAndCast(IGESDefs_AttributeDef,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolAttributeDef tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 3 : { - DeclareAndCast(IGESDefs_AttributeTable,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolAttributeTable tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 4 : { - DeclareAndCast(IGESDefs_GenericData,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolGenericData tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 5 : { - DeclareAndCast(IGESDefs_MacroDef,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolMacroDef tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 6 : { - DeclareAndCast(IGESDefs_TabularData,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolTabularData tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 7 : { - DeclareAndCast(IGESDefs_UnitsData,anent,ent); - if (anent.IsNull()) return; - IGESDefs_ToolUnitsData tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - default : break; - } -} diff --git a/src/IGESDefs/IGESDefs_SpecificModule.hxx b/src/IGESDefs/IGESDefs_SpecificModule.hxx deleted file mode 100644 index 68dc1a57ab..0000000000 --- a/src/IGESDefs/IGESDefs_SpecificModule.hxx +++ /dev/null @@ -1,69 +0,0 @@ -// Created on: 1993-09-07 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDefs_SpecificModule_HeaderFile -#define _IGESDefs_SpecificModule_HeaderFile - -#include -#include - -#include -#include -class IGESData_IGESEntity; -class IGESData_IGESDumper; -class Message_Messenger; - - -class IGESDefs_SpecificModule; -DEFINE_STANDARD_HANDLE(IGESDefs_SpecificModule, IGESData_SpecificModule) - -//! Defines Services attached to IGES Entities : Dump, for IGESDefs -class IGESDefs_SpecificModule : public IGESData_SpecificModule -{ - -public: - - - //! Creates a SpecificModule from IGESDefs & puts it into SpecificLib - Standard_EXPORT IGESDefs_SpecificModule(); - - //! Specific Dump (own parameters) for IGESDefs - Standard_EXPORT void OwnDump (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IGESDefs_SpecificModule,IGESData_SpecificModule) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IGESDefs_SpecificModule_HeaderFile diff --git a/src/IGESDefs/IGESDefs_TabularData.cxx b/src/IGESDefs/IGESDefs_TabularData.cxx index 0cc27e55d9..ac26cfea0c 100644 --- a/src/IGESDefs/IGESDefs_TabularData.cxx +++ b/src/IGESDefs/IGESDefs_TabularData.cxx @@ -16,118 +16,169 @@ //-------------------------------------------------------------------- //-------------------------------------------------------------------- // UNFINISHED -// The last field (theDependentValues) not resolved. Queried to mdtv +// The last field (myDependentValues) not resolved. Queried to mdtv #include #include #include #include #include +#include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_TabularData,IGESData_IGESEntity) -IGESDefs_TabularData::IGESDefs_TabularData () { } - - - void IGESDefs_TabularData::Init - (const Standard_Integer nbProps, - const Standard_Integer propType, -/* const Standard_Integer nbDeps, */ -/* const Standard_Integer nbIndeps, */ - const Handle(TColStd_HArray1OfInteger)& typesInd, - const Handle(TColStd_HArray1OfInteger)& nbValuesInd, - const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesInd, - const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesDep) -{ - Standard_Integer num = typesInd->Length(); - if (typesInd->Lower() != 1 || - nbValuesInd->Lower() != 1 || nbValuesInd->Length() != num || - valuesInd->Lower() != 1 || valuesInd->Length() != num || - valuesDep->Lower() != 1 ) - Standard_DimensionMismatch::Raise("IGESDefs_TabularData : Init"); - theNbPropertyValues = nbProps; - thePropertyType = propType; -/* theNbDependents = nbDeps; */ -/* theNbIndependents = nbIndeps; */ - theTypeOfIndependentVariables = typesInd; - theNbValues = nbValuesInd; - theIndependentValues = valuesInd; - theDependentValues = valuesDep; - InitTypeAndForm(406,11); -} - - Standard_Integer IGESDefs_TabularData::NbPropertyValues () const +Standard_Integer IGESDefs_TabularData::NbDependents () const { - return theNbPropertyValues; + return myDependentValues->Length(); } - Standard_Integer IGESDefs_TabularData::ComputedNbPropertyValues () const +Standard_Integer IGESDefs_TabularData::NbIndependents () const { - return theNbPropertyValues; // pas malin ... a ameliorer + return myTypeOfIndependentVariables->Length(); } - Standard_Boolean IGESDefs_TabularData::OwnCorrect () +Standard_Integer IGESDefs_TabularData::TypeOfIndependents (const Standard_Integer num) const { - Standard_Integer newnb = ComputedNbPropertyValues(); - if (newnb == theNbPropertyValues) return Standard_False; - theNbPropertyValues = newnb; - return Standard_True; + return myTypeOfIndependentVariables->Value(num); } - - Standard_Integer IGESDefs_TabularData::PropertyType () const +Standard_Integer IGESDefs_TabularData::NbValues (const Standard_Integer num) const { - return thePropertyType; + return myNbValues->Value(num); } - Standard_Integer IGESDefs_TabularData::NbDependents () const +Standard_Real IGESDefs_TabularData::IndependentValue (const Standard_Integer variablenum, const Standard_Integer valuenum) const { - return theDependentValues->Length(); + return (myIndependentValues->Value(variablenum))->Value(valuenum); } - Standard_Integer IGESDefs_TabularData::NbIndependents () const +Handle(TColStd_HArray1OfReal) IGESDefs_TabularData::DependentValues (const Standard_Integer num) const { - return theTypeOfIndependentVariables->Length(); + return myDependentValues->Value(num); } - Standard_Integer IGESDefs_TabularData::TypeOfIndependents - (const Standard_Integer num) const +// UNFINISHED +// Array limits not sure. +Standard_Real IGESDefs_TabularData::DependentValue (const Standard_Integer /*variablenum*/, + const Standard_Integer /*valuenum*/) const { - return theTypeOfIndependentVariables->Value(num); + Standard_Real val = 0.; + return val; } - Standard_Integer IGESDefs_TabularData::NbValues (const Standard_Integer num) const +void IGESDefs_TabularData::OwnRead (IGESFile_Reader &theReader) { - return theNbValues->Value(num); + theReader.ReadInteger(myNbPropertyValues,"Number of Property values"); + theReader.ReadInteger(myPropertyType,"Property type"); + + Standard_Integer nbDeps = 0; + theReader.ReadInteger(nbDeps,"No. of dependent variables"); + if (nbDeps > 0) + myDependentValues = new IGESBasic_HArray1OfHArray1OfReal(1, nbDeps); + + Standard_Integer i, nbIndeps = 0; + theReader.ReadInteger(nbIndeps,"No. of Independent variables"); + if (nbIndeps > 0) + { + myTypeOfIndependentVariables = new TColStd_HArray1OfInteger(1, nbIndeps); + myNbValues = new TColStd_HArray1OfInteger(1, nbIndeps); + myIndependentValues = new IGESBasic_HArray1OfHArray1OfReal(1, nbIndeps); + + theReader.ReadInteger(myTypeOfIndependentVariables->ChangeFirst(),nbIndeps,"Type of independent variables"); + theReader.ReadInteger(myNbValues->ChangeFirst(),nbIndeps,"No. of values of independent variables"); + + for (i=1; i<=nbIndeps; i++) + { + const Standard_Integer nb = myNbValues->Value(i); + if (nb > 0) + { + Handle(TColStd_HArray1OfReal) tarr = new TColStd_HArray1OfReal(1, nb); + for (Standard_Integer j=1; j<= nb; j++) + theReader.ReadReal(tarr->ChangeValue(j),"Value of independent variable"); + myIndependentValues->SetValue(i, tarr); + } + } + } + +// ?? for (i=1; i<=nbDeps; i++) { } +// Dependents : definition pas limpide, on accumule tout sur un seul +// HArray1OfReal, mis en 1re position du HArray1OfHArray1OfReal +// On y met tous les flottants qui restent + while (theReader.HasData()) + theReader.ReadAny(); + theReader.AddWarning("Don't know exactly how to read dependant values ..."); } - Standard_Real IGESDefs_TabularData::IndependentValue - (const Standard_Integer variablenum, const Standard_Integer valuenum) const +void IGESDefs_TabularData::OwnWrite (IGESData_IGESWriter& IW) const { - return (theIndependentValues->Value(variablenum))->Value(valuenum); + Standard_Integer i, nbIndeps = NbIndependents(); + Standard_Integer j, nbDeps = NbDependents(); + IW.Send(NbPropertyValues()); + IW.Send(PropertyType()); + IW.Send(nbDeps); + IW.Send(nbIndeps); + for (i=1; i<=nbIndeps; i++) + IW.Send(TypeOfIndependents(i)); + for (i=1; i<=nbIndeps; i++) + IW.Send(NbValues(i)); + for (i=1; i<=nbIndeps; i++) + for (j=1; j<=NbValues(i); j++) + IW.Send(IndependentValue(i,j)); + // UNFINISHED + if (nbDeps == 0) return; + Handle(TColStd_HArray1OfReal) deps = DependentValues(1); + for (i = 1; i <= deps->Length(); i ++) IW.Send(deps->Value(i)); } - Handle(TColStd_HArray1OfReal) IGESDefs_TabularData::DependentValues - (const Standard_Integer num) const +IGESData_DirChecker IGESDefs_TabularData::DirChecker () const { - return theDependentValues->Value(num); + IGESData_DirChecker DC(406, 11); + DC.Structure (IGESData_DefVoid); + DC.LineFont (IGESData_DefVoid); + DC.LineWeight (IGESData_DefVoid); + DC.Color (IGESData_DefVoid); + + DC.BlankStatusIgnored (); + DC.UseFlagIgnored (); + DC.HierarchyStatusIgnored (); + return DC; } -// UNFINISHED -// Array limits not sure. -Standard_Real IGESDefs_TabularData::DependentValue (const Standard_Integer /*variablenum*/, - const Standard_Integer /*valuenum*/) const +void IGESDefs_TabularData::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer level) const { - Standard_Real val = 0.; -#if 0 - Standard_Integer sum = 0; - for (Standard_Integer i = 1; i < variablenum; i++) - { - sum += theNbValues->Value(i); + Standard_Integer nbIndeps = NbIndependents(); + Standard_Integer nbDeps = NbDependents(); + + S << "IGESDefs_TabularData" << endl; + S << "No. of property values : " << NbPropertyValues() << endl; + S << "Property type : " << PropertyType() << endl; + S << "No. of Dependent variables : " << nbDeps << endl; + S << "No. of Independent variables : " << nbIndeps << endl; + S << "Type of independent variables : "; + IGESData_DumpVals(S,level,1,nbIndeps,TypeOfIndependents); + S << endl << "Number of values of independent variables : "; + IGESData_DumpVals(S,level,1,nbIndeps,NbValues); +// ?? JAGGED ?? + S << endl << "Values of the independent variable : "; + if (level < 5) S << " [ask level > 4]"; + else { + for (Standard_Integer ind = 1; ind <= nbIndeps; ind ++) { + S << endl << "[" << ind << "]:"; + Standard_Integer nbi = NbValues(ind); + for (Standard_Integer iv = 1; iv <= nbi; iv ++) + S << " " << IndependentValue(ind,iv); } - sum += valuenum; - val = theDependentValues->Value(sum); -#endif - return val; + } +// IGESData_DumpVals(S,level,1,nbIndeps,IndependentValue); + S << endl << "Values of the dependent variable : "; +// IGESData_DumpVals(S,level,1,nbDeps,DependentValue); + S << " TO BE DONE"; + S << endl; } diff --git a/src/IGESDefs/IGESDefs_TabularData.hxx b/src/IGESDefs/IGESDefs_TabularData.hxx index c4557ada76..11b1e68e9f 100644 --- a/src/IGESDefs/IGESDefs_TabularData.hxx +++ b/src/IGESDefs/IGESDefs_TabularData.hxx @@ -17,22 +17,11 @@ #ifndef _IGESDefs_TabularData_HeaderFile #define _IGESDefs_TabularData_HeaderFile -#include -#include - -#include -#include #include -#include -#include -#include +class TColStd_HArray1OfInteger; +class TColStd_HArray1OfReal; class IGESBasic_HArray1OfHArray1OfReal; -class Standard_DimensionMismatch; -class Standard_OutOfRange; - -class IGESDefs_TabularData; -DEFINE_STANDARD_HANDLE(IGESDefs_TabularData, IGESData_IGESEntity) //! Defines IGES Tabular Data, Type <406> Form <11>, //! in package IGESDefs @@ -40,11 +29,16 @@ DEFINE_STANDARD_HANDLE(IGESDefs_TabularData, IGESData_IGESEntity) //! point form data. class IGESDefs_TabularData : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } - - Standard_EXPORT IGESDefs_TabularData(); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 11; } + + IGESDefs_TabularData() + : myNbPropertyValues(0), + myPropertyType(0) + {} //! This method is used to set the fields of the class //! TabularData @@ -55,21 +49,17 @@ public: //! - valuesInd : Values of independent variables //! - valuesDep : Values of dependent variables //! raises exception if lengths of typeInd and nbValuesInd are not same - Standard_EXPORT void Init (const Standard_Integer nbProps, const Standard_Integer propType, const Handle(TColStd_HArray1OfInteger)& typesInd, const Handle(TColStd_HArray1OfInteger)& nbValuesInd, const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesInd, const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesDep); + //Standard_EXPORT void Init (const Standard_Integer nbProps, const Standard_Integer propType, const Handle(TColStd_HArray1OfInteger)& typesInd, const Handle(TColStd_HArray1OfInteger)& nbValuesInd, const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesInd, const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesDep); //! returns the number of property values (recorded) - Standard_EXPORT Standard_Integer NbPropertyValues() const; - + Standard_Integer NbPropertyValues() const { return myNbPropertyValues; } + //! determines the number of property values required - Standard_EXPORT Standard_Integer ComputedNbPropertyValues() const; - - //! checks, and correct as necessary, the number of property - //! values. Returns True if corrected, False if already OK - Standard_EXPORT Standard_Boolean OwnCorrect(); - + Standard_Integer ComputedNbPropertyValues() const { return myNbPropertyValues; } + //! returns the property type - Standard_EXPORT Standard_Integer PropertyType() const; - + Standard_Integer PropertyType() const { return myPropertyType; } + //! returns the number of dependent variables Standard_EXPORT Standard_Integer NbDependents() const; @@ -90,33 +80,24 @@ public: Standard_EXPORT Standard_Real DependentValue (const Standard_Integer variablenum, const Standard_Integer valuenum) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESDefs_TabularData,IGESData_IGESEntity) -protected: - - - - -private: - - - Standard_Integer theNbPropertyValues; - Standard_Integer thePropertyType; - Handle(TColStd_HArray1OfInteger) theTypeOfIndependentVariables; - Handle(TColStd_HArray1OfInteger) theNbValues; - Handle(IGESBasic_HArray1OfHArray1OfReal) theIndependentValues; - Handle(IGESBasic_HArray1OfHArray1OfReal) theDependentValues; - + private: + Standard_Integer myNbPropertyValues; + Standard_Integer myPropertyType; + Handle(TColStd_HArray1OfInteger) myTypeOfIndependentVariables; + Handle(TColStd_HArray1OfInteger) myNbValues; + Handle(IGESBasic_HArray1OfHArray1OfReal) myIndependentValues; + Handle(IGESBasic_HArray1OfHArray1OfReal) myDependentValues; }; - - - - - - #endif // _IGESDefs_TabularData_HeaderFile diff --git a/src/IGESDefs/IGESDefs_ToolAssociativityDef.cxx b/src/IGESDefs/IGESDefs_ToolAssociativityDef.cxx deleted file mode 100644 index 5c02092029..0000000000 --- a/src/IGESDefs/IGESDefs_ToolAssociativityDef.cxx +++ /dev/null @@ -1,162 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDefs_ToolAssociativityDef::ReadOwnParams - (const Handle(IGESDefs_AssociativityDef)& ent, - const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Handle(TColStd_HArray1OfInteger) requirements; - Handle(TColStd_HArray1OfInteger) orders; - Handle(TColStd_HArray1OfInteger) numItems; - Handle(IGESBasic_HArray1OfHArray1OfInteger) items; - Standard_Integer nbval; - - Standard_Boolean st = PR.ReadInteger(PR.Current(), "No. of Class definitions", nbval); - if (st && nbval > 0) - { - requirements = new TColStd_HArray1OfInteger(1, nbval); - orders = new TColStd_HArray1OfInteger(1, nbval); - numItems = new TColStd_HArray1OfInteger(1, nbval); - items = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval); - } - else PR.AddFail("No. of Class definitions: Not Positive"); - - if ( ! requirements.IsNull()) - for (Standard_Integer i = 1; i <= nbval; i++) - { - Standard_Integer requirement; - Standard_Integer order; - Standard_Integer numItem; - Handle(TColStd_HArray1OfInteger) item; - - //st = PR.ReadInteger(PR.Current(), "Back Pointer Requirement", requirement); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Back Pointer Requirement", requirement)) - requirements->SetValue(i, requirement); - - //st = PR.ReadInteger(PR.Current(), "Ordered/Unordered Class", order); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Ordered/Unordered Class", order)) - orders->SetValue(i, order); - - //st = PR.ReadInteger(PR.Current(),"No. of items per entry", numItem); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(),"No. of items per entry", numItem)) { - Standard_Integer temp; - numItems->SetValue(i, numItem); - item = new TColStd_HArray1OfInteger(1, numItem); - for (Standard_Integer j = 1; j <= numItem; j++) - { - //Standard_Integer temp; //szv#4:S4163:12Mar99 moved out of for - //st = PR.ReadInteger(PR.Current(), "Item", temp); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Item", temp)) - item->SetValue(j, temp); - } - items->SetValue(i, item); - } - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(requirements, orders, numItems, items); -} - -void IGESDefs_ToolAssociativityDef::WriteOwnParams - (const Handle(IGESDefs_AssociativityDef)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer upper = ent->NbClassDefs(); - IW.Send(upper); - for (Standard_Integer i = 1; i <= upper; i++) { - IW.Send(ent->BackPointerReq(i)); - IW.Send(ent->ClassOrder(i)); - IW.Send(ent->NbItemsPerClass(i)); - Standard_Integer items = ent->NbItemsPerClass(i); - for (Standard_Integer j = 1; j <= items; j++) - IW.Send(ent->Item(i,j)); - } -} - -IGESData_DirChecker IGESDefs_ToolAssociativityDef::DirChecker - (const Handle(IGESDefs_AssociativityDef)& /* ent */ ) const -{ - IGESData_DirChecker DC (302, 5001, 9999); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.SubordinateStatusRequired(0); - DC.UseFlagRequired(2); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESDefs_ToolAssociativityDef::OwnDump - (const Handle(IGESDefs_AssociativityDef)& ent, const IGESData_IGESDumper& /* dumper */, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESDefs_AssociativityDef" << endl; - S << "Number of Class Definitions : " << ent->NbClassDefs() << endl; - S << "Back Pointer Requirement : " << endl; - S << "Ordered / Unordered Class : " << endl; - S << "Number Of Items per Entry : " << endl; - S << "Items : " << endl; - IGESData_DumpVals(S,-level,1, ent->NbClassDefs(),ent->BackPointerReq); - S << endl; - if (level > 4) - { -// Warning : Item is a JAGGED Array - Standard_Integer upper = ent->NbClassDefs(); - for (Standard_Integer i = 1; i <= upper; i ++) { - S << "[" << i << "]: " << endl; - S << "Back Pointer Requirement : " << ent->BackPointerReq(i) << " "; - if (ent->IsBackPointerReq(i)) S << "(Yes) "; - else S << "(No) "; - S << " Ordered/Unordered Class : " << ent->ClassOrder(i) << " "; - if (ent->IsOrdered(i)) S << "(Yes)" <NbItemsPerClass(i); - if (level < 6) { - S << " [ask level > 5 for more]" << endl; - continue; - } - S << endl << " ["; - for (Standard_Integer j = 1; j <= ent->NbItemsPerClass(i); j ++) - S << " " << ent->Item(i,j); - S << "]" << endl; - } - } - S << endl; -} - diff --git a/src/IGESDefs/IGESDefs_ToolAssociativityDef.hxx b/src/IGESDefs/IGESDefs_ToolAssociativityDef.hxx deleted file mode 100644 index b729d9f077..0000000000 --- a/src/IGESDefs/IGESDefs_ToolAssociativityDef.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDefs_ToolAssociativityDef_HeaderFile -#define _IGESDefs_ToolAssociativityDef_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDefs_AssociativityDef; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a AssociativityDef. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDefs_ToolAssociativityDef -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolAssociativityDef, ready to work - IGESDefs_ToolAssociativityDef() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_AssociativityDef)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_AssociativityDef)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_AssociativityDef)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDefs_AssociativityDef)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDefs_ToolAssociativityDef_HeaderFile diff --git a/src/IGESDefs/IGESDefs_ToolAttributeDef.cxx b/src/IGESDefs/IGESDefs_ToolAttributeDef.cxx deleted file mode 100644 index d10b01dce0..0000000000 --- a/src/IGESDefs/IGESDefs_ToolAttributeDef.cxx +++ /dev/null @@ -1,402 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -void IGESDefs_ToolAttributeDef::ReadOwnParams - (const Handle(IGESDefs_AttributeDef)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Handle(TCollection_HAsciiString) aName; - Standard_Integer aListType; - Handle(TColStd_HArray1OfInteger) attrTypes; - Handle(TColStd_HArray1OfInteger) attrValueDataTypes; - Handle(TColStd_HArray1OfInteger) attrValueCounts; - Handle(TColStd_HArray1OfTransient) attrValues; - Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate) attrValuePointers; - Standard_Integer nbval; - Standard_Integer fn = ent->FormNumber(); - - if (PR.DefinedElseSkip()) - PR.ReadText(PR.Current(), "Attribute Table Name", aName); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadInteger(PR.Current(), "Attribute List Type", aListType); //szv#4:S4163:12Mar99 `st=` not needed - - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Attributes", nbval); - if (st && nbval > 0) - { - attrTypes = new TColStd_HArray1OfInteger(1, nbval); - attrValueDataTypes = new TColStd_HArray1OfInteger(1, nbval); - attrValueCounts = new TColStd_HArray1OfInteger(1, nbval); - if (fn > 0) attrValues = - new TColStd_HArray1OfTransient(1, nbval); - if (fn > 1) attrValuePointers = - new IGESDefs_HArray1OfHArray1OfTextDisplayTemplate(1, nbval); - } - else PR.AddFail("Number of Attributes: Not Positive"); - - if ( ! attrTypes.IsNull()) - for (Standard_Integer i = 1; i <= nbval; i++) - { - Standard_Integer attrType; - Standard_Integer attrValueDataType; - Standard_Integer avc; -// Value according type - Handle(IGESGraph_HArray1OfTextDisplayTemplate) attrValuePointer; - - //st = PR.ReadInteger(PR.Current(), "Attribute Type", attrType); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Attribute Type", attrType)) - attrTypes->SetValue(i, attrType); - - st = PR.ReadInteger(PR.Current(),"Attribute Data Type",attrValueDataType); - if (st) attrValueDataTypes->SetValue(i, attrValueDataType); - - if (PR.DefinedElseSkip()) - st = PR.ReadInteger (PR.Current(),"Attribute Value Count",avc); - else avc = 1; - - if (st) { - attrValueCounts->SetValue(i, avc); - if (fn > 1) attrValuePointer = - new IGESGraph_HArray1OfTextDisplayTemplate(1, avc); - } - - if (! attrValues.IsNull()) - if (fn > 0) - { - Handle(TColStd_HArray1OfInteger) attrInt; - Handle(TColStd_HArray1OfReal) attrReal; - Handle(Interface_HArray1OfHAsciiString) attrStr; - Handle(IGESData_HArray1OfIGESEntity) attrEnt; - switch (attrValueDataType) { - case 1 : attrInt = new TColStd_HArray1OfInteger (1,avc); - attrValues->SetValue(i,attrInt); break; - case 2 : attrReal = new TColStd_HArray1OfReal (1,avc); - attrValues->SetValue(i,attrReal); break; - case 3 : attrStr = new Interface_HArray1OfHAsciiString(1,avc); - attrValues->SetValue(i,attrStr); break; - case 4 : attrEnt = new IGESData_HArray1OfIGESEntity (1,avc); - attrValues->SetValue(i,attrEnt); break; - case 6 : attrInt = new TColStd_HArray1OfInteger (1,avc); - attrValues->SetValue(i,attrInt); break; - default : break; - } - for (Standard_Integer j = 1; j <= avc; j++) - { - switch(attrValueDataType) - { - case 0: - { - PR.SetCurrentNumber(PR.CurrentNumber() + 1); // passer -//// attrValue->SetValue(j, NULL); par defaut - break; - } - case 1: - { - Standard_Integer temp; - //st = PR.ReadInteger(PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Attribute Value", temp)) - attrInt->SetValue(j, temp); - } - break; - case 2: - { - Standard_Real temp; - //st = PR.ReadReal(PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Attribute Value", temp)) - attrReal->SetValue(j, temp); - } - break; - case 3: - { - Handle(TCollection_HAsciiString) temp; - //st = PR.ReadText(PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadText(PR.Current(), "Attribute Value", temp)) - attrStr->SetValue(j, temp); - } - break; - case 4: - { - Handle(IGESData_IGESEntity) temp; - //st = PR.ReadEntity(IR, PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR, PR.Current(), "Attribute Value", temp)) - attrEnt->SetValue(j, temp); - } - break; - case 5: - PR.SetCurrentNumber(PR.CurrentNumber() + 1); // skip - break; - case 6: - { - Standard_Boolean temp; - //st = PR.ReadBoolean(PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadBoolean(PR.Current(), "Attribute Value", temp)) - attrInt->SetValue(j, (temp ? 1 : 0)); - } - break; - } - if (fn == 2) - { - Handle(IGESGraph_TextDisplayTemplate) tempText; - //st = PR.ReadEntity(IR,PR.Current(),"Attribute Val. Pointer", - //STANDARD_TYPE(IGESGraph_TextDisplayTemplate), tempText); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR,PR.Current(),"Attribute Val. Pointer", - STANDARD_TYPE(IGESGraph_TextDisplayTemplate), tempText)) - attrValuePointer->SetValue(j, tempText); - } - } - if (fn == 2) - attrValuePointers->SetValue(i, attrValuePointer); - } - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init - (aName, aListType, attrTypes, attrValueDataTypes, attrValueCounts, - attrValues, attrValuePointers); -} - -void IGESDefs_ToolAttributeDef::WriteOwnParams - (const Handle(IGESDefs_AttributeDef)& ent, IGESData_IGESWriter& IW) const -{ - if (ent->HasTableName()) IW.Send(ent->TableName()); - else IW.SendVoid(); - IW.Send(ent->ListType()); - Standard_Integer upper = ent->NbAttributes(); - IW.Send(upper); - - for (Standard_Integer i = 1; i <= upper; i++) - { - Standard_Integer check = ent->AttributeValueDataType(i); - Standard_Integer count = ent->AttributeValueCount(i); - IW.Send(ent->AttributeType(i)); - IW.Send(check); - IW.Send(count); - if (ent->FormNumber() > 0) - { - for (Standard_Integer j = 1; j <= count; j++) - { - switch (check) { - case 0 : IW.SendVoid(); break; - case 1 : IW.Send(ent->AttributeAsInteger(i,j)); break; - case 2 : IW.Send(ent->AttributeAsReal(i,j)); break; - case 3 : IW.Send(ent->AttributeAsString(i,j)); break; - case 4 : IW.Send(ent->AttributeAsEntity(i,j)); break; - case 5 : IW.SendVoid(); break; - case 6 : IW.SendBoolean(ent->AttributeAsLogical(i,j)); break; - default : break; - } - if ( ent->FormNumber() == 2) - IW.Send(ent->AttributeTextDisplay(i,j)); - } - } - } -} - -void IGESDefs_ToolAttributeDef::OwnShared - (const Handle(IGESDefs_AttributeDef)& ent, Interface_EntityIterator& iter) const -{ - Standard_Integer upper = ent->NbAttributes(); - for (Standard_Integer i = 1; i <= upper; i++) - { - Standard_Integer check = ent->AttributeValueDataType(i); - Standard_Integer count = ent->AttributeValueCount(i); - if (ent->FormNumber() > 0) - { - for (Standard_Integer j = 1; j <= count; j++) - { - if ( check == 4 ) iter.GetOneItem(ent->AttributeAsEntity(i,j)); - if ( ent->FormNumber() == 2) - iter.GetOneItem(ent->AttributeTextDisplay(i,j)); - } - } - } -} - -IGESData_DirChecker IGESDefs_ToolAttributeDef::DirChecker - (const Handle(IGESDefs_AttributeDef)& /* ent */ ) const -{ - IGESData_DirChecker DC (322, 0, 2); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefAny); - DC.LineWeight(IGESData_DefValue); - DC.Color(IGESData_DefAny); - DC.BlankStatusIgnored(); - DC.SubordinateStatusRequired(0); - DC.UseFlagRequired(2); - DC.GraphicsIgnored(1); - return DC; -} - -void IGESDefs_ToolAttributeDef::OwnCheck - (const Handle(IGESDefs_AttributeDef)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - Standard_Integer nb = ent->NbAttributes(); - Standard_Integer fn = ent->FormNumber(); - for (Standard_Integer i = 1; i <= nb; i ++) { - char mess[80]; - if (ent->AttributeType(i) < 0 || ent->AttributeType(i) > 9999) { - sprintf(mess,"Attribute Type n0.%d not in <0 - 9999>", ent->AttributeType(i)); - ach->AddFail(mess); - } - Standard_Integer aty = ent->AttributeValueDataType(i); - if (aty < 0 || aty > 6) { - sprintf(mess,"Attribute Value Data Type n0.%d not in <0 - 6>", aty); - ach->AddFail(mess); - } - if (ent->AttributeValueCount(i) <= 0) continue; - Handle(Standard_Transient) list = ent->AttributeList(i); - if (fn > 0 && ent.IsNull()) { - if (aty == 0 || aty == 5) continue; - sprintf(mess,"Form Number > 0 and Attribute Value List n0.%d undefined", aty); - ach->AddFail(mess); - continue; - } - else if (fn == 0) continue; - mess[0] = '\0'; - switch (aty) { - case 1 : if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfInteger))) - sprintf(mess,"Attribute List n0.%d (Integers) badly defined", aty); - break; - case 2 : if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfReal))) - sprintf(mess,"Attribute List n0.%d (Reals) badly defined", aty); - break; - case 3 : if (!list->IsKind(STANDARD_TYPE(Interface_HArray1OfHAsciiString))) - sprintf(mess,"Attribute List n0.%d (Strings) badly defined", aty); - break; - case 4 : if (!list->IsKind(STANDARD_TYPE(IGESData_HArray1OfIGESEntity))) - sprintf(mess,"Attribute List n0.%d (IGES Pointers) badly defined", aty); - break; - case 6 : if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfInteger))) - sprintf(mess,"Attribute List n0.%d (Logicals i.e. Integers) badly defined", aty); - break; - default : break; - } - if (mess[0] != '\0') ach->AddFail(mess); - } -} - - -void IGESDefs_ToolAttributeDef::OwnDump - (const Handle(IGESDefs_AttributeDef)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer sublevel = (level > 4) ? 1 : 0; - - S << "IGESDefs_AttributeDef" << endl; - S << "Attribute Table Name: "; - IGESData_DumpString(S,ent->TableName()); - S << endl; - S << "Attribute List Type : " << ent->ListType() << endl; - S << "Number of Attributes : " << ent->NbAttributes() << endl; - S << "Attribute Types : " << endl; - S << "Attribute Value Data Types : " << endl; - S << "Attribute Value Counts : " << endl; - if (ent->HasValues()) S << "Attribute Values : " << endl; - if (ent->HasTextDisplay()) S << "Attribute Value Entities : " << endl; - IGESData_DumpVals(S,-level,1, ent->NbAttributes(),ent->AttributeType); - S << endl; - if (level > 4) - { - Standard_Integer upper = ent->NbAttributes(); - for (Standard_Integer i = 1; i <= upper ; i ++) - { - Standard_Integer avc = ent->AttributeValueCount(i); - Standard_Integer typ = ent->AttributeValueDataType(i); - S << "[" << i << "]: "; - S << "Attribute Type : " << ent->AttributeType(i) << " "; - S << "Value Data Type : " << typ; - switch (typ) { - case 0 : S << " (Void)"; break; - case 1 : S << " : Integer "; break; - case 2 : S << " : Real "; break; - case 3 : S << " : String "; break; - case 4 : S << " : Entity "; break; - case 5 : S << " (Not Used)"; break; - case 6 : S << " : Logical "; break; - default : break; - } - S << " Count : " << avc << endl; - if (ent->HasValues()) - { - if (level <= 5) { - S << " [ content (Values) : ask level > 5 ]" << endl; - continue; - } - for (Standard_Integer j = 1; j <= avc; j ++) - { - S << "[" << j << "]: "; - switch(ent->AttributeValueDataType(i)) - { - case 0: S << "(Void) "; - break; - case 1: S << ent->AttributeAsInteger(i,j); - break; - case 2: S << ent->AttributeAsReal(i,j); - break; - case 3: IGESData_DumpString(S,ent->AttributeAsString(i,j)); - break; - case 4: dumper.Dump(ent->AttributeAsEntity(i,j),S,level-5); - break; - case 5: S << "(Not Used)"; - break; - case 6: - S << ( ent->AttributeAsLogical(i,j) ? "True" : "False"); - break; - default : break; - } - if (ent->HasTextDisplay()) - { - S << " Attribute Value Pointer : "; - dumper.Dump (ent->AttributeTextDisplay(i,j),S, sublevel); - } - S << endl; - } - } - } - } - S << endl; -} diff --git a/src/IGESDefs/IGESDefs_ToolAttributeDef.hxx b/src/IGESDefs/IGESDefs_ToolAttributeDef.hxx deleted file mode 100644 index a40a145be9..0000000000 --- a/src/IGESDefs/IGESDefs_ToolAttributeDef.hxx +++ /dev/null @@ -1,70 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDefs_ToolAttributeDef_HeaderFile -#define _IGESDefs_ToolAttributeDef_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDefs_AttributeDef; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a AttributeDef. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDefs_ToolAttributeDef -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolAttributeDef, ready to work - IGESDefs_ToolAttributeDef() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_AttributeDef)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_AttributeDef)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a AttributeDef , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESDefs_AttributeDef)& ent, Interface_EntityIterator& iter) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_AttributeDef)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESDefs_AttributeDef)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDefs_AttributeDef)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDefs_ToolAttributeDef_HeaderFile diff --git a/src/IGESDefs/IGESDefs_ToolAttributeTable.cxx b/src/IGESDefs/IGESDefs_ToolAttributeTable.cxx deleted file mode 100644 index 1bd3bf92fc..0000000000 --- a/src/IGESDefs/IGESDefs_ToolAttributeTable.cxx +++ /dev/null @@ -1,270 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDefs_ToolAttributeTable::ReadOwnParams - (const Handle(IGESDefs_AttributeTable)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - Standard_Integer nr = 1; - Standard_Integer j; - Standard_Boolean st = Standard_True; - - Handle(IGESDefs_AttributeDef) ab = ent->Definition(); // formerly loaded - Handle(TColStd_HArray2OfTransient) list2; - if (ab.IsNull()) { - PR.AddFail("No Attribute Definition as Structure"); - return; - } - Standard_Integer na = ab->NbAttributes(); - - if (ent->FormNumber() == 1) - st = PR.ReadInteger(PR.Current(),"No. of rows",nr); - if (st) list2 = new TColStd_HArray2OfTransient(1,na,1,nr); - -// AttributeDef repeated once (Form 0) or times (Form 1) - for (Standard_Integer k = 1; k <= nr; k ++) - { - for (Standard_Integer i = 1; i <= na; i ++) - { - Standard_Integer avc = ab->AttributeValueCount(i); - Standard_Integer atype = ab->AttributeValueDataType(i); - switch (atype) - { - case 0 : - for (j = 1; j <= avc; j ++) - PR.SetCurrentNumber(PR.CurrentNumber() + 1); // skip - break; - case 1 : { - Handle(TColStd_HArray1OfInteger) attrInt = new TColStd_HArray1OfInteger(1,avc); - list2->SetValue(i,k,attrInt); - Standard_Integer item; - for (j = 1; j <= avc; j ++) { - //st = PR.ReadInteger(PR.Current(),"Value",item); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(),"Value",item)) - attrInt->SetValue(j,item); - } - } - break; - case 2 : { - Handle(TColStd_HArray1OfReal) attrReal = new TColStd_HArray1OfReal(1,avc); - list2->SetValue(i,k,attrReal); - Standard_Real item; - for (j = 1; j <= avc; j ++) { - //st = PR.ReadReal(PR.Current(),"Value",item); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(),"Value",item)) - attrReal->SetValue(j,item); - } - } - break; - case 3 : { - Handle(Interface_HArray1OfHAsciiString) attrStr = new Interface_HArray1OfHAsciiString(1,avc); - list2->SetValue(i,k,attrStr); - Handle(TCollection_HAsciiString) item; - for (j = 1; j <= avc; j ++) { - //st = PR.ReadText(PR.Current(),"Value",item); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadText(PR.Current(),"Value",item)) - attrStr->SetValue(j,item); - } - } - break; - case 4 : { - Handle(IGESData_HArray1OfIGESEntity) attrEnt = new IGESData_HArray1OfIGESEntity(1,avc); - list2->SetValue(i,k,attrEnt); - Handle(IGESData_IGESEntity) item; - for (j = 1; j <= avc; j ++) { - //st = PR.ReadEntity(IR,PR.Current(),"Value",item); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR,PR.Current(),"Value",item)) - attrEnt->SetValue(j,item); - } - } - break; - case 5 : - for (j = 1; j <= avc; j ++) - PR.SetCurrentNumber(PR.CurrentNumber() + 1); // skip - break; - case 6 : { // Here item takes value 0 or 1 - Handle(TColStd_HArray1OfInteger) attrInt = new TColStd_HArray1OfInteger(1,avc); - list2->SetValue(i,k,attrInt); - Standard_Integer item; - for (j = 1; j <= avc; j ++) { - //st = PR.ReadInteger(PR.Current(),"Value",item); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(),"Value",item)) - attrInt->SetValue(j,item); - } - } - break; - default : break; - } - } - } - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(list2); -} - -void IGESDefs_ToolAttributeTable::WriteOwnParams - (const Handle(IGESDefs_AttributeTable)& ent, IGESData_IGESWriter& IW) const -{ - Handle(IGESDefs_AttributeDef) ab = ent->Definition(); - - Standard_Integer nr = ent->NbRows(); - Standard_Integer na = ent->NbAttributes(); - if (ent->FormNumber() == 1) IW.Send(nr); - for (Standard_Integer k = 1; k <= nr; k ++) - { - for (Standard_Integer i = 1; i <= na; i ++) - { - Standard_Integer count = ab->AttributeValueCount(i); - for (Standard_Integer j = 1;j <= count; j++) - { - switch(ab->AttributeValueDataType(i)) - { - case 0 : IW.SendVoid(); break; - case 1 : IW.Send(ent->AttributeAsInteger(i,k,j)); break; - case 2 : IW.Send(ent->AttributeAsReal (i,k,j)); break; - case 3 : IW.Send(ent->AttributeAsString (i,k,j)); break; - case 4 : IW.Send(ent->AttributeAsEntity (i,k,j)); break; - case 5 : IW.SendVoid(); break; - case 6 : IW.SendBoolean(ent->AttributeAsLogical(i,k,j)); break; - default : break; - } - } - } - } -} - -void IGESDefs_ToolAttributeTable::OwnShared - (const Handle(IGESDefs_AttributeTable)& ent, Interface_EntityIterator& iter) const -{ - Handle(IGESDefs_AttributeDef) ab = ent->Definition(); - Standard_Integer na = ent->NbAttributes(); - Standard_Integer nr = ent->NbRows(); - for (Standard_Integer k = 1; k <= nr; k ++) - { - for (Standard_Integer i = 1; i <= na; i ++) - { - if (ab->AttributeValueDataType(i) != 4) continue; - Standard_Integer avc = ab->AttributeValueCount(i); - for (Standard_Integer j = 1; j <= avc; j ++) - iter.GetOneItem(ent->AttributeAsEntity(i,k,j)); - } - } -} - -IGESData_DirChecker IGESDefs_ToolAttributeTable::DirChecker - (const Handle(IGESDefs_AttributeTable)& /* ent */ ) const -{ - IGESData_DirChecker DC(422,0,1); - DC.Structure(IGESData_DefReference); - DC.GraphicsIgnored(); - DC.BlankStatusIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESDefs_ToolAttributeTable::OwnCheck - (const Handle(IGESDefs_AttributeTable)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if (ent->Definition().IsNull()) { - if (ent->HasStructure()) ach->AddFail - ("Structure in Directory Entry is not an Attribute Definition Table"); - else ach->AddFail("No Attribute Definition defined"); - } - if (ent->FormNumber() == 0 && ent->NbRows() != 1) - ach->AddFail("Form 0 with several Rows"); - if (ent->NbAttributes() != ent->Definition()->NbAttributes()) - ach->AddFail("Mismatch between Definition (Structure) and Content"); -} - -void IGESDefs_ToolAttributeTable::OwnDump - (const Handle(IGESDefs_AttributeTable)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESDefs_AttributeTable" << endl; - - Handle(IGESDefs_AttributeDef) ab = ent->Definition(); - - Standard_Integer na = ent->NbAttributes(); - Standard_Integer nr = ent->NbRows(); - if (ent->FormNumber() == 1) - S << "Number of Rows (i.e. complete sets of Attributes) : " << nr << endl; - else S << "One set of Attributes" << endl; - S << "Number of defined Attributes : " << na << endl; - if (level <= 4) S << - " [ structure : see Structure in Directory Entry; content : level > 4 ]" <AttributeValueCount(i); - S << "[At.no."<AttributeValueDataType(i)) { - case 0 : S << " (Void) "; break; - case 1 : S << " Integer"; break; - case 2 : S << " Real "; break; - case 3 : S << " String "; break; - case 4 : S << " Entity "; break; - case 5 : S << " (Not used)"; break; - case 6 : S << " Logical"; break; - default : break; - } - S << " :"; - for (Standard_Integer j = 1;j <= avc; j++) { - S << " "; - switch(ab->AttributeValueDataType(i)) { - case 1 : S << ent->AttributeAsInteger(i,k,j); break; - case 2 : S << ent->AttributeAsReal (i,k,j); break; - case 3 : IGESData_DumpString(S,ent->AttributeAsString (i,k,j)); - break; - case 4 : dumper.Dump(ent->AttributeAsEntity (i,k,j),S,level-5); - break; - case 6 : S << (ent->AttributeAsLogical(i,k,j) ? "True" : "False"); - break; - default : break; - } - } - S << endl; - } - } - S << endl; -} diff --git a/src/IGESDefs/IGESDefs_ToolAttributeTable.hxx b/src/IGESDefs/IGESDefs_ToolAttributeTable.hxx deleted file mode 100644 index 8533362e97..0000000000 --- a/src/IGESDefs/IGESDefs_ToolAttributeTable.hxx +++ /dev/null @@ -1,70 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDefs_ToolAttributeTable_HeaderFile -#define _IGESDefs_ToolAttributeTable_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDefs_AttributeTable; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a AttributeTable. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDefs_ToolAttributeTable -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolAttributeTable, ready to work - IGESDefs_ToolAttributeTable() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_AttributeTable)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_AttributeTable)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a AttributeTable , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESDefs_AttributeTable)& ent, Interface_EntityIterator& iter) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_AttributeTable)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESDefs_AttributeTable)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDefs_AttributeTable)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDefs_ToolAttributeTable_HeaderFile diff --git a/src/IGESDefs/IGESDefs_ToolGenericData.cxx b/src/IGESDefs/IGESDefs_ToolGenericData.cxx deleted file mode 100644 index 0c2007ba1c..0000000000 --- a/src/IGESDefs/IGESDefs_ToolGenericData.cxx +++ /dev/null @@ -1,234 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDefs_ToolGenericData::ReadOwnParams - (const Handle(IGESDefs_GenericData)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Standard_Integer i, num; - Standard_Integer tempNbPropVal; - Handle(TCollection_HAsciiString) tempName; - Handle(TColStd_HArray1OfInteger) tempTypes; - Handle(TColStd_HArray1OfTransient) tempValues; - - PR.ReadInteger(PR.Current(), "Number of property values", tempNbPropVal); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadText(PR.Current(), "Property Name", tempName); //szv#4:S4163:12Mar99 `st=` not needed - - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of TYPE/VALUEs", num); - if (st && num > 0) - { - tempTypes = new TColStd_HArray1OfInteger(1, num); - tempValues = new TColStd_HArray1OfTransient(1, num); - } - else PR.AddFail("Number of TYPE/VALUEs: Not Positive"); - - if (!tempTypes.IsNull() && !tempValues.IsNull()) - for ( i = 1; i <= num; i++ ) - { - Standard_Integer tempTyp; - PR.ReadInteger(PR.Current(), "Type code", tempTyp); //szv#4:S4163:12Mar99 `st=` not needed - tempTypes->SetValue(i, tempTyp); - switch (tempTyp) - { - case 0: // No value - PR.SetCurrentNumber(PR.CurrentNumber()+1); - break; - case 1: // Integer - { - Handle(TColStd_HArray1OfInteger) tempObj; - //st = PR.ReadInts(PR.CurrentList(1), "Integer value", tempObj); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInts(PR.CurrentList(1), "Integer value", tempObj)) - tempValues->SetValue(i, tempObj); - } - break; - case 2: // Real - { - Handle(TColStd_HArray1OfReal) tempObj; - //st = PR.ReadReals(PR.CurrentList(1), "Real value", tempObj); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReals(PR.CurrentList(1), "Real value", tempObj)) - tempValues->SetValue(i, tempObj); - } - break; - case 3: // Character string - { - Handle(TCollection_HAsciiString) tempObj; - //st = PR.ReadText(PR.Current(), "String value", tempObj); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadText(PR.Current(), "String value", tempObj)) - tempValues->SetValue(i, tempObj); - } - break; - case 4: // Pointer - { - Handle(IGESData_IGESEntity) tempEntity; - //st = PR.ReadEntity(IR, PR.Current(), "Entity value", tempEntity); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR, PR.Current(), "Entity value", tempEntity)) - tempValues->SetValue(i, tempEntity); - } - break; - case 5: // Not used - PR.SetCurrentNumber(PR.CurrentNumber()+1); - break; - case 6: // Logical - { - Handle(TColStd_HArray1OfInteger) tempObj = new TColStd_HArray1OfInteger(1, 1); - Standard_Boolean tempBool; - //st = PR.ReadBoolean(PR.Current(), "Boolean value", tempBool); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadBoolean(PR.Current(), "Boolean value", tempBool)) { - tempObj->SetValue(1, (tempBool ? 1 : 0)); - tempValues->SetValue(i, tempObj); - } - } - break; - } - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init (tempNbPropVal, tempName, tempTypes, tempValues); -} - -void IGESDefs_ToolGenericData::WriteOwnParams - (const Handle(IGESDefs_GenericData)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer i, num; - IW.Send(ent->NbPropertyValues()); - IW.Send(ent->Name()); - IW.Send(ent->NbTypeValuePairs()); - for ( num = ent->NbTypeValuePairs(), i = 1; i <= num; i++ ) - { - IW.Send(ent->Type(i)); - switch (ent->Type(i)) - { - case 0 : IW.SendVoid(); break; - case 1 : IW.Send(ent->ValueAsInteger(i)); break; - case 2 : IW.Send(ent->ValueAsReal(i)); break; - case 3 : IW.Send(ent->ValueAsString(i)); break; - case 4 : IW.Send(ent->ValueAsEntity(i)); break; - case 5 : IW.SendVoid(); break; - case 6 : IW.SendBoolean(ent->ValueAsLogical(i)); break; - default : break; - } - } -} - -void IGESDefs_ToolGenericData::OwnShared - (const Handle(IGESDefs_GenericData)& ent, Interface_EntityIterator& iter) const -{ - Standard_Integer i, num; - for ( num = ent->NbTypeValuePairs(), i = 1; i <= num; i++ ) - { - if (ent->Type(i) == 4) - iter.GetOneItem(ent->ValueAsEntity(i)); - } -} - -IGESData_DirChecker IGESDefs_ToolGenericData::DirChecker - (const Handle(IGESDefs_GenericData)& /* ent */ ) const -{ - IGESData_DirChecker DC(406, 27); - DC.Structure(IGESData_DefVoid); - DC.GraphicsIgnored(); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.SubordinateStatusRequired(1); - DC.UseFlagRequired(2); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESDefs_ToolGenericData::OwnCheck - (const Handle(IGESDefs_GenericData)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if (ent->NbPropertyValues() != ent->NbTypeValuePairs()*2 + 2) - ach->AddFail("Nb. of Property Values not consistent with Nb. of Type/value Pairs"); -} - -void IGESDefs_ToolGenericData::OwnDump - (const Handle(IGESDefs_GenericData)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESDefs_GenericData" << endl; - S << "Number of property values : " << ent->NbPropertyValues() << endl; - S << "Property Name : "; - IGESData_DumpString(S,ent->Name()); - S << endl; - switch (level) - { - case 4: - S << "Types : " << endl; - S << "Values : Count = " << ent->NbTypeValuePairs() << endl; - S << " [ as level > 4 for content ]" << endl; - break; - case 5: - case 6: - { - Standard_Integer i, num; - S << "Types & Values : " << endl; - for ( num = ent->NbTypeValuePairs(), i = 1; i <= num; i++ ) - { - S << "[" << i << "]: "; - S << "Type : " << ent->Type(i); - switch (ent->Type(i)) { - case 0 : S << " (Void)"; break; - case 1 : S << " Integer, Value : " << ent->ValueAsInteger(i); - break; - case 2 : S << " Real , Value : " << ent->ValueAsReal(i); - break; - case 3 : S << " String , Value : "; - IGESData_DumpString(S,ent->ValueAsString(i)); break; - case 4 : S << " Entity , Value : "; - dumper.Dump(ent->ValueAsEntity(i),S,level-1); break; - case 5 : S << " (Not used)"; break; - case 6 : S << " Logical, Value : " - << (ent->ValueAsLogical(i) ? "True" : "False"); break; - default : break; - } - S << endl; - } - } - } - S << endl; -} diff --git a/src/IGESDefs/IGESDefs_ToolGenericData.hxx b/src/IGESDefs/IGESDefs_ToolGenericData.hxx deleted file mode 100644 index f8c68d99ea..0000000000 --- a/src/IGESDefs/IGESDefs_ToolGenericData.hxx +++ /dev/null @@ -1,70 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDefs_ToolGenericData_HeaderFile -#define _IGESDefs_ToolGenericData_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDefs_GenericData; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a GenericData. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDefs_ToolGenericData -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolGenericData, ready to work - IGESDefs_ToolGenericData() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_GenericData)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_GenericData)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a GenericData , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESDefs_GenericData)& ent, Interface_EntityIterator& iter) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_GenericData)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESDefs_GenericData)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDefs_GenericData)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDefs_ToolGenericData_HeaderFile diff --git a/src/IGESDefs/IGESDefs_ToolMacroDef.cxx b/src/IGESDefs/IGESDefs_ToolMacroDef.cxx deleted file mode 100644 index f4e254238b..0000000000 --- a/src/IGESDefs/IGESDefs_ToolMacroDef.cxx +++ /dev/null @@ -1,121 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDefs_ToolMacroDef::ReadOwnParams - (const Handle(IGESDefs_MacroDef)& ent, - const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - Handle(TCollection_HAsciiString) macro; - Standard_Integer entityTypeID; - Handle(Interface_HArray1OfHAsciiString) langStatements; - Handle(TCollection_HAsciiString) endMacro; - - PR.ReadText(PR.Current(), "MACRO", macro); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadInteger(PR.Current(), "Entity Type ID", entityTypeID); //szv#4:S4163:12Mar99 `st=` not needed - - Standard_Integer tempCurrent = PR.CurrentNumber(); - // Counting the no. of language statements. - Standard_Integer nbval; // svv Jan 10 2000 : porting on DEC - for (nbval = 0; PR.CurrentNumber() != PR.NbParams(); - nbval++, PR.SetCurrentNumber(PR.CurrentNumber() + 1)); - - PR.SetCurrentNumber(tempCurrent); - if (nbval > 0) langStatements = - new Interface_HArray1OfHAsciiString(1, nbval); - else PR.AddFail("Number of Lang. Stats. : Not Positive"); - - if (! langStatements.IsNull()) - { - for (Standard_Integer i = 1; i <= nbval; i++) - { - Handle(TCollection_HAsciiString) langStat; - //st = PR.ReadText(PR.Current(), "Language Statement", langStat); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadText(PR.Current(), "Language Statement", langStat)) - langStatements->SetValue(i, langStat); - } - } - - PR.ReadText(PR.Current(), "END MACRO", endMacro); //szv#4:S4163:12Mar99 `st=` not needed - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init (macro, entityTypeID, langStatements, endMacro); -} - -void IGESDefs_ToolMacroDef::WriteOwnParams - (const Handle(IGESDefs_MacroDef)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->MACRO()); - IW.Send(ent->EntityTypeID()); - Standard_Integer upper = ent->NbStatements(); - for (Standard_Integer i = 1; i <= upper; i++) - IW.Send(ent->LanguageStatement(i)); - IW.Send(ent->ENDMACRO()); -} - -IGESData_DirChecker IGESDefs_ToolMacroDef::DirChecker - (const Handle(IGESDefs_MacroDef)& /* ent */ ) const -{ - IGESData_DirChecker DC (306, 0); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.SubordinateStatusRequired(0); - DC.UseFlagRequired(2); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESDefs_ToolMacroDef::OwnDump - (const Handle(IGESDefs_MacroDef)& ent, const IGESData_IGESDumper& /* dumper */, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESDefs_MacroDef" << endl; - S << "MACRO : "; - IGESData_DumpString(S,ent->MACRO()); - S << endl; - S << "Entity Type ID : " << ent->EntityTypeID() << endl; - S << "Language Statement : "; - IGESData_DumpStrings(S ,level,1, ent->NbStatements(),ent->LanguageStatement); - S << "END MACRO : "; - IGESData_DumpString(S,ent->ENDMACRO()); - S << endl; -} diff --git a/src/IGESDefs/IGESDefs_ToolMacroDef.hxx b/src/IGESDefs/IGESDefs_ToolMacroDef.hxx deleted file mode 100644 index d0576c6404..0000000000 --- a/src/IGESDefs/IGESDefs_ToolMacroDef.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDefs_ToolMacroDef_HeaderFile -#define _IGESDefs_ToolMacroDef_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDefs_MacroDef; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a MacroDef. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDefs_ToolMacroDef -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolMacroDef, ready to work - IGESDefs_ToolMacroDef() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_MacroDef)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_MacroDef)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_MacroDef)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDefs_MacroDef)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDefs_ToolMacroDef_HeaderFile diff --git a/src/IGESDefs/IGESDefs_ToolTabularData.cxx b/src/IGESDefs/IGESDefs_ToolTabularData.cxx deleted file mode 100644 index 4bb9f07a1d..0000000000 --- a/src/IGESDefs/IGESDefs_ToolTabularData.cxx +++ /dev/null @@ -1,203 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- -// UNFINISHED -// The last field (ent->DependentValues()) not resolved. Queried to mdtv - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDefs_ToolTabularData::ReadOwnParams - (const Handle(IGESDefs_TabularData)& ent, - const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const -{ - Standard_Integer nbProps; - Standard_Integer propType; - Standard_Integer nbDeps; - Standard_Integer nbIndeps; - Handle(TColStd_HArray1OfInteger) typesInd; - Handle(TColStd_HArray1OfInteger) nbValuesInd; - Handle(IGESBasic_HArray1OfHArray1OfReal) valuesInd; - Handle(IGESBasic_HArray1OfHArray1OfReal) valuesDep; - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Standard_Integer i; - - PR.ReadInteger(PR.Current(), "Number of Property values", nbProps); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadInteger(PR.Current(), "Property type", propType); //szv#4:S4163:12Mar99 `st=` not needed - - Standard_Boolean st = PR.ReadInteger(PR.Current(), "No. of dependent variables", nbDeps); - if (st && nbDeps > 0) - valuesDep = new IGESBasic_HArray1OfHArray1OfReal(1, nbDeps); - - st = PR.ReadInteger(PR.Current(), "No. of Independent variables", nbIndeps); - if (st && nbIndeps > 0) - { - valuesInd = new IGESBasic_HArray1OfHArray1OfReal(1, nbIndeps); - typesInd = new TColStd_HArray1OfInteger(1, nbIndeps); - nbValuesInd = new TColStd_HArray1OfInteger(1, nbIndeps); - } - - PR.ReadInts(PR.CurrentList(nbIndeps), - "Type of independent variables", typesInd); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadInts(PR.CurrentList(nbIndeps), - "No. of values of independent variables", nbValuesInd); //szv#4:S4163:12Mar99 `st=` not needed - - for (i=1; i<=nbIndeps; i++) - { - Handle(TColStd_HArray1OfReal) tarr; - Standard_Integer nb = nbValuesInd->Value(i), j; - if (nb > 0 ) - { - tarr = new TColStd_HArray1OfReal(1, nb); - for (j=1; j<= nb; j++) - { - Standard_Real treal; - PR.ReadReal(PR.Current(), "Value of independent variable", - treal); //szv#4:S4163:12Mar99 `st=` not needed - tarr->SetValue(j, treal); - } - } - valuesInd->SetValue(i, tarr); - } -// ?? for (i=1; i<=nbDeps; i++) { } -// Dependents : definition pas limpide, on accumule tout sur un seul -// HArray1OfReal, mis en 1re position du HArray1OfHArray1OfReal -// On y met tous les flottants qui restent - Standard_Integer curnum = PR.CurrentNumber(); - Standard_Integer nbpars = PR.NbParams(); - Standard_Integer nbd = 0; - for (i = curnum; i <= nbpars; i ++) { - if (PR.ParamType(i) != Interface_ParamReal) break; - nbd = i - curnum + 1; - } - Handle(TColStd_HArray1OfReal) somedeps; - if (nbd > 0) somedeps = new TColStd_HArray1OfReal(1,nbd); - for (i = 1; i <= nbd; i ++) { - Standard_Real treal; - PR.ReadReal(PR.Current(), "Value of dependent variable", treal); //szv#4:S4163:12Mar99 `st=` not needed - somedeps->SetValue(i, treal); - } - if (nbDeps > 0) valuesDep->SetValue(1,somedeps); - else PR.AddWarning("Some Real remain while no dependent vakue is defined"); - - nbProps = PR.CurrentNumber() - 2; -/* for (;;) { - curnum = PR.CurrentNumber(); - if (curnum > PR.NbParams()) break; - if (PR.ParamType(curnum) != Interface_ParamReal) break; - PR.SetCurrentNumber (curnum+1); - } */ - PR.AddWarning("Don't know exactly how to read dependant values ..."); -// ?? a eclaircir - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init (nbProps, propType, typesInd, nbValuesInd, valuesInd, valuesDep); -} - -void IGESDefs_ToolTabularData::WriteOwnParams - (const Handle(IGESDefs_TabularData)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer i, nbIndeps = ent->NbIndependents(); - Standard_Integer j, nbDeps = ent->NbDependents(); - IW.Send(ent->NbPropertyValues()); - IW.Send(ent->PropertyType()); - IW.Send(nbDeps); - IW.Send(nbIndeps); - for (i=1; i<=nbIndeps; i++) - IW.Send(ent->TypeOfIndependents(i)); - for (i=1; i<=nbIndeps; i++) - IW.Send(ent->NbValues(i)); - for (i=1; i<=nbIndeps; i++) - for (j=1; j<=ent->NbValues(i); j++) - IW.Send(ent->IndependentValue(i,j)); - // UNFINISHED - if (nbDeps == 0) return; - Handle(TColStd_HArray1OfReal) deps = ent->DependentValues(1); - for (i = 1; i <= deps->Length(); i ++) IW.Send(deps->Value(i)); - /* - for (i=1; i<=nbDeps; i++) - for (j=1; j<= .. ->Value(i); j++) - IW.Send(ent->DependentValue(i,j)); - */ -} - -IGESData_DirChecker IGESDefs_ToolTabularData::DirChecker - (const Handle(IGESDefs_TabularData)& /* ent */ ) const -{ - IGESData_DirChecker DC(406, 11); - DC.Structure (IGESData_DefVoid); - DC.LineFont (IGESData_DefVoid); - DC.LineWeight (IGESData_DefVoid); - DC.Color (IGESData_DefVoid); - - DC.BlankStatusIgnored (); - DC.UseFlagIgnored (); - DC.HierarchyStatusIgnored (); - return DC; -} - -void IGESDefs_ToolTabularData::OwnDump - (const Handle(IGESDefs_TabularData)& ent, const IGESData_IGESDumper& /* dumper */, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer nbIndeps = ent->NbIndependents(); //szv#4:S4163:12Mar99 i unused - Standard_Integer nbDeps = ent->NbDependents(); - - S << "IGESDefs_TabularData" << endl; - S << "No. of property values : " << ent->NbPropertyValues() << endl; - S << "Property type : " << ent->PropertyType() << endl; - S << "No. of Dependent variables : " << nbDeps << endl; - S << "No. of Independent variables : " << nbIndeps << endl; - S << "Type of independent variables : "; - IGESData_DumpVals(S ,level,1, nbIndeps,ent->TypeOfIndependents); - S << endl << "Number of values of independent variables : "; - IGESData_DumpVals(S ,level,1, nbIndeps,ent->NbValues); -// ?? JAGGED ?? - S << endl << "Values of the independent variable : "; - if (level < 5) S << " [ask level > 4]"; - else { - for (Standard_Integer ind = 1; ind <= nbIndeps; ind ++) { - S << endl << "[" << ind << "]:"; - Standard_Integer nbi = ent->NbValues(ind); - for (Standard_Integer iv = 1; iv <= nbi; iv ++) - S << " " << ent->IndependentValue(ind,iv); - } - } -// IGESData_DumpVals(S ,level,1, nbIndeps,ent->IndependentValue); - S << endl << "Values of the dependent variable : "; -// IGESData_DumpVals(S ,level,1, nbDeps,ent->DependentValue); - S << " TO BE DONE"; - S << endl; -} diff --git a/src/IGESDefs/IGESDefs_ToolTabularData.hxx b/src/IGESDefs/IGESDefs_ToolTabularData.hxx deleted file mode 100644 index e511e2cee8..0000000000 --- a/src/IGESDefs/IGESDefs_ToolTabularData.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDefs_ToolTabularData_HeaderFile -#define _IGESDefs_ToolTabularData_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDefs_TabularData; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a TabularData. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDefs_ToolTabularData -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolTabularData, ready to work - IGESDefs_ToolTabularData() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_TabularData)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_TabularData)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_TabularData)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDefs_TabularData)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDefs_ToolTabularData_HeaderFile diff --git a/src/IGESDefs/IGESDefs_ToolUnitsData.cxx b/src/IGESDefs/IGESDefs_ToolUnitsData.cxx deleted file mode 100644 index d619fe3832..0000000000 --- a/src/IGESDefs/IGESDefs_ToolUnitsData.cxx +++ /dev/null @@ -1,139 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDefs_ToolUnitsData::ReadOwnParams - (const Handle(IGESDefs_UnitsData)& ent, - const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - - Standard_Integer nbval; - Handle(Interface_HArray1OfHAsciiString) unitTypes; - Handle(Interface_HArray1OfHAsciiString) unitValues; - Handle(TColStd_HArray1OfReal) unitScales; - - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Units", nbval); - if (st && nbval > 0) - { - unitTypes = new Interface_HArray1OfHAsciiString(1, nbval); - unitValues = new Interface_HArray1OfHAsciiString(1, nbval); - unitScales = new TColStd_HArray1OfReal(1, nbval); - } - else PR.AddFail("Number of Units: Less than or Equal or zero"); - - if (! unitTypes.IsNull()) - for (Standard_Integer i = 1; i <= nbval; i++) - { - Handle(TCollection_HAsciiString) unitType; - Handle(TCollection_HAsciiString) unitValue; - Standard_Real unitScale; - - //st = PR.ReadText(PR.Current(), "Type of Unit", unitType); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadText(PR.Current(), "Type of Unit", unitType)) - unitTypes->SetValue(i, unitType); - - //st = PR.ReadText(PR.Current(), "Value of Unit", unitValue); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadText(PR.Current(), "Value of Unit", unitValue)) - unitValues->SetValue(i, unitValue); - - //st = PR.ReadReal(PR.Current(), "Scale of Unit", unitScale); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Scale of Unit", unitScale)) - unitScales->SetValue(i, unitScale); - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(unitTypes, unitValues, unitScales); -} - -void IGESDefs_ToolUnitsData::WriteOwnParams - (const Handle(IGESDefs_UnitsData)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer upper = ent->NbUnits(); - IW.Send(upper); - - for (Standard_Integer i = 1; i <= upper; i++) - { - IW.Send(ent->UnitType(i)); - IW.Send(ent->UnitValue(i)); - IW.Send(ent->ScaleFactor(i)); - } -} - -IGESData_DirChecker IGESDefs_ToolUnitsData::DirChecker - (const Handle(IGESDefs_UnitsData)& /* ent */ ) const -{ - IGESData_DirChecker DC (316, 0); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.SubordinateStatusRequired(0); - DC.UseFlagRequired(2); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESDefs_ToolUnitsData::OwnDump - (const Handle(IGESDefs_UnitsData)& ent, const IGESData_IGESDumper& /* dumper */, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESDefs_UnitsData" << endl; - S << "Number of Units : " << ent->NbUnits() << endl; - S << "Type of Unit : " << endl; - S << "Value of Unit : " << endl; - S << "Scale Factor : " << endl; - IGESData_DumpStrings(S,-level,1, ent->NbUnits(),ent->UnitType); - S << endl; - if (level > 4) - { - S << "Details of the Units" << endl; - Standard_Integer upper = ent->NbUnits(); - for (Standard_Integer i = 1; i <= upper; i++) - { - S << "[" << i << "] Type : "; - IGESData_DumpString(S,ent->UnitType(i)); - S << endl; - S << " Value : "; - IGESData_DumpString(S,ent->UnitValue(i)); - S << endl; - S << " ScaleFactor: " << ent->ScaleFactor(i) << endl; - } - } - S << endl; -} diff --git a/src/IGESDefs/IGESDefs_ToolUnitsData.hxx b/src/IGESDefs/IGESDefs_ToolUnitsData.hxx deleted file mode 100644 index a9dd157bc8..0000000000 --- a/src/IGESDefs/IGESDefs_ToolUnitsData.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDefs_ToolUnitsData_HeaderFile -#define _IGESDefs_ToolUnitsData_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDefs_UnitsData; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a UnitsData. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDefs_ToolUnitsData -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolUnitsData, ready to work - IGESDefs_ToolUnitsData() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_UnitsData)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_UnitsData)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_UnitsData)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDefs_UnitsData)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDefs_ToolUnitsData_HeaderFile diff --git a/src/IGESDefs/IGESDefs_UnitsData.cxx b/src/IGESDefs/IGESDefs_UnitsData.cxx index 0200222e0f..1aeff795cb 100644 --- a/src/IGESDefs/IGESDefs_UnitsData.cxx +++ b/src/IGESDefs/IGESDefs_UnitsData.cxx @@ -19,49 +19,107 @@ #include #include #include -#include #include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_UnitsData,IGESData_IGESEntity) -IGESDefs_UnitsData::IGESDefs_UnitsData () { } - - - void IGESDefs_UnitsData::Init - (const Handle(Interface_HArray1OfHAsciiString)& unitTypes, - const Handle(Interface_HArray1OfHAsciiString)& unitValues, - const Handle(TColStd_HArray1OfReal)& unitScales) -{ - Standard_Integer length = unitTypes->Length(); - if ( unitTypes->Lower() != 1 || - (unitValues->Lower() != 1 || unitValues->Length() != length) || - (unitScales->Lower() != 1 || unitScales->Length() != length) ) - Standard_DimensionMismatch::Raise("IGESDefs_UnitsData : Init"); - theUnitTypes = unitTypes; - theUnitValues = unitValues; - theUnitScales = unitScales; - InitTypeAndForm(316,0); -} - - Standard_Integer IGESDefs_UnitsData::NbUnits () const +Standard_Integer IGESDefs_UnitsData::NbUnits () const { return theUnitTypes->Length(); } - Handle(TCollection_HAsciiString) IGESDefs_UnitsData::UnitType - (const Standard_Integer UnitNum) const +const Handle(TCollection_HAsciiString) & IGESDefs_UnitsData::UnitType (const Standard_Integer UnitNum) const { return theUnitTypes->Value(UnitNum); } - Handle(TCollection_HAsciiString) IGESDefs_UnitsData::UnitValue - (const Standard_Integer UnitNum) const +const Handle(TCollection_HAsciiString) & IGESDefs_UnitsData::UnitValue (const Standard_Integer UnitNum) const { return theUnitValues->Value(UnitNum); } - Standard_Real IGESDefs_UnitsData::ScaleFactor - (const Standard_Integer UnitNum) const +Standard_Real IGESDefs_UnitsData::ScaleFactor (const Standard_Integer UnitNum) const { return theUnitScales->Value(UnitNum); } + +void IGESDefs_UnitsData::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer nbval = 0; + PR.ReadInteger(nbval,"Number of Units"); + if (nbval > 0) + { + theUnitTypes = new Interface_HArray1OfHAsciiString(1, nbval); + theUnitValues = new Interface_HArray1OfHAsciiString(1, nbval); + theUnitScales = new TColStd_HArray1OfReal(1, nbval); + + for (Standard_Integer i = 1; i <= nbval; i++) + { + PR.ReadText(theUnitTypes->ChangeValue(i),"Type of Unit"); + PR.ReadText(theUnitValues->ChangeValue(i),"Value of Unit"); + PR.ReadReal(theUnitScales->ChangeValue(i),"Scale of Unit"); + } + } + else PR.AddFail("Number of Units: Less than or Equal or zero"); +} + +void IGESDefs_UnitsData::OwnWrite (IGESData_IGESWriter& IW) const +{ + Standard_Integer upper = NbUnits(); + IW.Send(upper); + + for (Standard_Integer i = 1; i <= upper; i++) + { + IW.Send(UnitType(i)); + IW.Send(UnitValue(i)); + IW.Send(ScaleFactor(i)); + } +} + +IGESData_DirChecker IGESDefs_UnitsData::DirChecker () const +{ + IGESData_DirChecker DC (316, 0); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.SubordinateStatusRequired(0); + DC.UseFlagRequired(2); + DC.HierarchyStatusIgnored(); + return DC; +} + +void IGESDefs_UnitsData::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESDefs_UnitsData" << endl; + S << "Number of Units : " << NbUnits() << endl; + S << "Type of Unit : " << endl; + S << "Value of Unit : " << endl; + S << "Scale Factor : " << endl; + IGESData_DumpStrings(S,-level,1,NbUnits(),UnitType); + S << endl; + if (level > 4) + { + S << "Details of the Units" << endl; + Standard_Integer upper = NbUnits(); + for (Standard_Integer i = 1; i <= upper; i++) + { + S << "[" << i << "] Type : "; + IGESData_DumpString(S,UnitType(i)); + S << endl; + S << " Value : "; + IGESData_DumpString(S,UnitValue(i)); + S << endl; + S << " ScaleFactor: " << ScaleFactor(i) << endl; + } + } + S << endl; +} diff --git a/src/IGESDefs/IGESDefs_UnitsData.hxx b/src/IGESDefs/IGESDefs_UnitsData.hxx index 8d8fe73747..9ff275da94 100644 --- a/src/IGESDefs/IGESDefs_UnitsData.hxx +++ b/src/IGESDefs/IGESDefs_UnitsData.hxx @@ -17,17 +17,10 @@ #ifndef _IGESDefs_UnitsData_HeaderFile #define _IGESDefs_UnitsData_HeaderFile -#include -#include - #include -#include #include -#include -#include -class Standard_DimensionMismatch; -class Standard_OutOfRange; class TCollection_HAsciiString; +class TColStd_HArray1OfReal; class IGESDefs_UnitsData; @@ -38,11 +31,13 @@ DEFINE_STANDARD_HANDLE(IGESDefs_UnitsData, IGESData_IGESEntity) //! This class stores data about a model's fundamental units. class IGESDefs_UnitsData : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 316; } - - Standard_EXPORT IGESDefs_UnitsData(); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 0; } + + IGESDefs_UnitsData() {} //! This method is used to set the fields of the class //! UnitsData @@ -51,48 +46,39 @@ public: //! - unitScales : Multiplicative Scale Factors //! raises exception if lengths of unitTypes, unitValues and //! unitScale are not same - Standard_EXPORT void Init (const Handle(Interface_HArray1OfHAsciiString)& unitTypes, const Handle(Interface_HArray1OfHAsciiString)& unitValues, const Handle(TColStd_HArray1OfReal)& unitScales); + //Standard_EXPORT void Init (const Handle(Interface_HArray1OfHAsciiString)& unitTypes, const Handle(Interface_HArray1OfHAsciiString)& unitValues, const Handle(TColStd_HArray1OfReal)& unitScales); //! returns the Number of units defined by this entity Standard_EXPORT Standard_Integer NbUnits() const; //! returns the Type of the UnitNum'th unit being defined //! raises exception if UnitNum <= 0 or UnitNum > NbUnits() - Standard_EXPORT Handle(TCollection_HAsciiString) UnitType (const Standard_Integer UnitNum) const; + Standard_EXPORT const Handle(TCollection_HAsciiString) & UnitType (const Standard_Integer UnitNum) const; //! returns the Units of the UnitNum'th unit being defined //! raises exception if UnitNum <= 0 or UnitNum > NbUnits() - Standard_EXPORT Handle(TCollection_HAsciiString) UnitValue (const Standard_Integer UnitNum) const; + Standard_EXPORT const Handle(TCollection_HAsciiString) & UnitValue (const Standard_Integer UnitNum) const; //! returns the multiplicative scale factor to be apllied to the //! UnitNum'th unit being defined //! raises exception if UnitNum <= 0 or UnitNum > NbUnits() Standard_EXPORT Standard_Real ScaleFactor (const Standard_Integer UnitNum) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESDefs_UnitsData,IGESData_IGESEntity) -protected: - - - - -private: - + private: Handle(Interface_HArray1OfHAsciiString) theUnitTypes; Handle(Interface_HArray1OfHAsciiString) theUnitValues; Handle(TColStd_HArray1OfReal) theUnitScales; - - }; - - - - - - #endif // _IGESDefs_UnitsData_HeaderFile diff --git a/src/IGESDimen/FILES b/src/IGESDimen/FILES index db0640394d..a7f5728f9b 100644 --- a/src/IGESDimen/FILES +++ b/src/IGESDimen/FILES @@ -48,14 +48,10 @@ IGESDimen_Protocol.cxx IGESDimen_Protocol.hxx IGESDimen_RadiusDimension.cxx IGESDimen_RadiusDimension.hxx -IGESDimen_ReadWriteModule.cxx -IGESDimen_ReadWriteModule.hxx IGESDimen_Section.cxx IGESDimen_Section.hxx IGESDimen_SectionedArea.cxx IGESDimen_SectionedArea.hxx -IGESDimen_SpecificModule.cxx -IGESDimen_SpecificModule.hxx IGESDimen_ToolAngularDimension.cxx IGESDimen_ToolAngularDimension.hxx IGESDimen_ToolBasicDimension.cxx diff --git a/src/IGESDimen/IGESDimen.cxx b/src/IGESDimen/IGESDimen.cxx index 39109099e3..2536bca55d 100644 --- a/src/IGESDimen/IGESDimen.cxx +++ b/src/IGESDimen/IGESDimen.cxx @@ -12,17 +12,12 @@ // commercial license or contractual agreement. -#include -#include #include #include #include -#include -#include #include #include #include -#include /*void IGESDimen::Init () @@ -38,9 +33,6 @@ const Handle(IGESDimen_Protocol) & IGESDimen::Protocol () if (protocol.IsNull()) { protocol = new IGESDimen_Protocol; Interface_GeneralLib::SetGlobal (new IGESDimen_GeneralModule, protocol); - Interface_ReaderLib::SetGlobal (new IGESDimen_ReadWriteModule,protocol); - IGESData_WriterLib::SetGlobal (new IGESDimen_ReadWriteModule,protocol); - IGESData_SpecificLib::SetGlobal (new IGESDimen_SpecificModule, protocol); } return protocol; } diff --git a/src/IGESDimen/IGESDimen_Array1OfGeneralNote.hxx b/src/IGESDimen/IGESDimen_Array1OfGeneralNote.hxx index a5b1a6aabd..7d363e2a5a 100644 --- a/src/IGESDimen/IGESDimen_Array1OfGeneralNote.hxx +++ b/src/IGESDimen/IGESDimen_Array1OfGeneralNote.hxx @@ -17,10 +17,10 @@ #ifndef IGESDimen_Array1OfGeneralNote_HeaderFile #define IGESDimen_Array1OfGeneralNote_HeaderFile +#include #include #include -typedef NCollection_Array1 IGESDimen_Array1OfGeneralNote; - +typedef NCollection_Array1> IGESDimen_Array1OfGeneralNote; #endif diff --git a/src/IGESDimen/IGESDimen_Array1OfLeaderArrow.hxx b/src/IGESDimen/IGESDimen_Array1OfLeaderArrow.hxx index f1268a0cc9..0d9fe14098 100644 --- a/src/IGESDimen/IGESDimen_Array1OfLeaderArrow.hxx +++ b/src/IGESDimen/IGESDimen_Array1OfLeaderArrow.hxx @@ -17,10 +17,10 @@ #ifndef IGESDimen_Array1OfLeaderArrow_HeaderFile #define IGESDimen_Array1OfLeaderArrow_HeaderFile -#include +#include #include +#include -typedef NCollection_Array1 IGESDimen_Array1OfLeaderArrow; - +typedef NCollection_Array1> IGESDimen_Array1OfLeaderArrow; #endif diff --git a/src/IGESDimen/IGESDimen_GeneralModule.cxx b/src/IGESDimen/IGESDimen_GeneralModule.cxx index a796c9e397..827bba0bf2 100644 --- a/src/IGESDimen/IGESDimen_GeneralModule.cxx +++ b/src/IGESDimen/IGESDimen_GeneralModule.cxx @@ -70,121 +70,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESDimen_GeneralModule,IGESData_GeneralModule) - void IGESDimen_GeneralModule::OwnSharedCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - Interface_EntityIterator& iter) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESDimen_AngularDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolAngularDimension tool; - tool.OwnShared(anent,iter); - } - break; - case 4 : { - DeclareAndCast(IGESDimen_CurveDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolCurveDimension tool; - tool.OwnShared(anent,iter); - } - break; - case 5 : { - DeclareAndCast(IGESDimen_DiameterDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDiameterDimension tool; - tool.OwnShared(anent,iter); - } - break; - case 9 : { - DeclareAndCast(IGESDimen_DimensionedGeometry,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionedGeometry tool; - tool.OwnShared(anent,iter); - } - break; - case 10 : { - DeclareAndCast(IGESDimen_FlagNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolFlagNote tool; - tool.OwnShared(anent,iter); - } - break; - case 11 : { - DeclareAndCast(IGESDimen_GeneralLabel,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralLabel tool; - tool.OwnShared(anent,iter); - } - break; - case 12 : { - DeclareAndCast(IGESDimen_GeneralNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralNote tool; - tool.OwnShared(anent,iter); - } - break; - case 13 : { - DeclareAndCast(IGESDimen_GeneralSymbol,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralSymbol tool; - tool.OwnShared(anent,iter); - } - break; - case 15 : { - DeclareAndCast(IGESDimen_LinearDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolLinearDimension tool; - tool.OwnShared(anent,iter); - } - break; - case 16 : { - DeclareAndCast(IGESDimen_NewDimensionedGeometry,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolNewDimensionedGeometry tool; - tool.OwnShared(anent,iter); - } - break; - case 17 : { - DeclareAndCast(IGESDimen_NewGeneralNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolNewGeneralNote tool; - tool.OwnShared(anent,iter); - } - break; - case 18 : { - DeclareAndCast(IGESDimen_OrdinateDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolOrdinateDimension tool; - tool.OwnShared(anent,iter); - } - break; - case 19 : { - DeclareAndCast(IGESDimen_PointDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolPointDimension tool; - tool.OwnShared(anent,iter); - } - break; - case 20 : { - DeclareAndCast(IGESDimen_RadiusDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolRadiusDimension tool; - tool.OwnShared(anent,iter); - } - break; - case 22 : { - DeclareAndCast(IGESDimen_SectionedArea,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolSectionedArea tool; - tool.OwnShared(anent,iter); - } - break; - default : break; - } -} - - IGESData_DirChecker IGESDimen_GeneralModule::DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const { @@ -333,163 +218,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESDimen_GeneralModule,IGESData_GeneralModule) } - void IGESDimen_GeneralModule::OwnCheckCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const -{ - switch (CN) { - case 2 : { - DeclareAndCast(IGESDimen_BasicDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolBasicDimension tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 3 : { - DeclareAndCast(IGESDimen_CenterLine,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolCenterLine tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 4 : { - DeclareAndCast(IGESDimen_CurveDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolCurveDimension tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 6 : { - DeclareAndCast(IGESDimen_DimensionDisplayData,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionDisplayData tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 7 : { - DeclareAndCast(IGESDimen_DimensionTolerance,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionTolerance tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 8 : { - DeclareAndCast(IGESDimen_DimensionUnits,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionUnits tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 9 : { - DeclareAndCast(IGESDimen_DimensionedGeometry,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionedGeometry tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 11 : { - DeclareAndCast(IGESDimen_GeneralLabel,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralLabel tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 12 : { - DeclareAndCast(IGESDimen_GeneralNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralNote tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 13 : { - DeclareAndCast(IGESDimen_GeneralSymbol,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralSymbol tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 16 : { - DeclareAndCast(IGESDimen_NewDimensionedGeometry,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolNewDimensionedGeometry tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 17 : { - DeclareAndCast(IGESDimen_NewGeneralNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolNewGeneralNote tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 18 : { - DeclareAndCast(IGESDimen_OrdinateDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolOrdinateDimension tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 20 : { - DeclareAndCast(IGESDimen_RadiusDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolRadiusDimension tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 21 : { - DeclareAndCast(IGESDimen_Section,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolSection tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 23 : { - DeclareAndCast(IGESDimen_WitnessLine,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolWitnessLine tool; - tool.OwnCheck(anent,shares,ach); - } - break; - default : break; - } -} - - - Standard_Boolean IGESDimen_GeneralModule::NewVoid - (const Standard_Integer CN, Handle(Standard_Transient)& ent) const -{ - switch (CN) { - case 1 : ent = new IGESDimen_AngularDimension; break; - case 2 : ent = new IGESDimen_BasicDimension; break; - case 3 : ent = new IGESDimen_CenterLine; break; - case 4 : ent = new IGESDimen_CurveDimension; break; - case 5 : ent = new IGESDimen_DiameterDimension; break; - case 6 : ent = new IGESDimen_DimensionDisplayData; break; - case 7 : ent = new IGESDimen_DimensionTolerance; break; - case 8 : ent = new IGESDimen_DimensionUnits; break; - case 9 : ent = new IGESDimen_DimensionedGeometry; break; - case 10 : ent = new IGESDimen_FlagNote; break; - case 11 : ent = new IGESDimen_GeneralLabel; break; - case 12 : ent = new IGESDimen_GeneralNote; break; - case 13 : ent = new IGESDimen_GeneralSymbol; break; - case 14 : ent = new IGESDimen_LeaderArrow; break; - case 15 : ent = new IGESDimen_LinearDimension; break; - case 16 : ent = new IGESDimen_NewDimensionedGeometry; break; - case 17 : ent = new IGESDimen_NewGeneralNote; break; - case 18 : ent = new IGESDimen_OrdinateDimension; break; - case 19 : ent = new IGESDimen_PointDimension; break; - case 20 : ent = new IGESDimen_RadiusDimension; break; - case 21 : ent = new IGESDimen_Section; break; - case 22 : ent = new IGESDimen_SectionedArea; break; - case 23 : ent = new IGESDimen_WitnessLine; break; - default : return Standard_False; // by default, Failure on Recognize - } - return Standard_True; -} - - - - Standard_Integer IGESDimen_GeneralModule::CategoryNumber (const Standard_Integer /*CN*/, const Handle(Standard_Transient)& , const Interface_ShareTool& ) const diff --git a/src/IGESDimen/IGESDimen_GeneralModule.hxx b/src/IGESDimen/IGESDimen_GeneralModule.hxx index f4f1e8277b..d3877450c1 100644 --- a/src/IGESDimen/IGESDimen_GeneralModule.hxx +++ b/src/IGESDimen/IGESDimen_GeneralModule.hxx @@ -32,21 +32,11 @@ class IGESDimen_GeneralModule : public IGESData_GeneralModule //! Creates a GeneralModule from IGESDimen and puts it into GeneralLib IGESDimen_GeneralModule() {} - //! Lists the Entities shared by a given IGESEntity , from - //! its specific parameters : specific for each type - Standard_EXPORT void OwnSharedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - //! Returns a DirChecker, specific for each type of Entity //! (identified by its Case Number) : this DirChecker defines //! constraints which must be respected by the DirectoryPart Standard_EXPORT IGESData_DirChecker DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - //! Performs Specific Semantic Check for each type of Entity - Standard_EXPORT void OwnCheckCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE; - - //! Specific creation of a new void entity - Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE; - //! Returns a category number which characterizes an entity //! Drawing for all Standard_EXPORT virtual Standard_Integer CategoryNumber (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares) const Standard_OVERRIDE; diff --git a/src/IGESDimen/IGESDimen_HArray1OfGeneralNote.hxx b/src/IGESDimen/IGESDimen_HArray1OfGeneralNote.hxx index b749b61295..01dd21e458 100644 --- a/src/IGESDimen/IGESDimen_HArray1OfGeneralNote.hxx +++ b/src/IGESDimen/IGESDimen_HArray1OfGeneralNote.hxx @@ -17,11 +17,9 @@ #ifndef IGESDimen_HArray1OfGeneralNote_HeaderFile #define IGESDimen_HArray1OfGeneralNote_HeaderFile -#include #include #include DEFINE_HARRAY1(IGESDimen_HArray1OfGeneralNote, IGESDimen_Array1OfGeneralNote) - #endif diff --git a/src/IGESDimen/IGESDimen_HArray1OfLeaderArrow.hxx b/src/IGESDimen/IGESDimen_HArray1OfLeaderArrow.hxx index 9dafba8a25..d78a4633e9 100644 --- a/src/IGESDimen/IGESDimen_HArray1OfLeaderArrow.hxx +++ b/src/IGESDimen/IGESDimen_HArray1OfLeaderArrow.hxx @@ -17,11 +17,9 @@ #ifndef IGESDimen_HArray1OfLeaderArrow_HeaderFile #define IGESDimen_HArray1OfLeaderArrow_HeaderFile -#include #include #include DEFINE_HARRAY1(IGESDimen_HArray1OfLeaderArrow, IGESDimen_Array1OfLeaderArrow) - #endif diff --git a/src/IGESDimen/IGESDimen_RadiusDimension.cxx b/src/IGESDimen/IGESDimen_RadiusDimension.cxx index 45dc4bd92e..a86977d08b 100644 --- a/src/IGESDimen/IGESDimen_RadiusDimension.cxx +++ b/src/IGESDimen/IGESDimen_RadiusDimension.cxx @@ -40,8 +40,7 @@ IGESDimen_RadiusDimension::IGESDimen_RadiusDimension () { } theLeaderArrow = anArrow; theCenter = arcCenter; theLeader2 = anotherArrow; - if (!anotherArrow.IsNull()) InitTypeAndForm(222, 1); // 1 admet aussi Null - else InitTypeAndForm(222,FormNumber()); + InitTypeAndForm(222, (anotherArrow.IsNull()? FormNumber() : 1)); // 1 admet aussi Null } void IGESDimen_RadiusDimension::InitForm (const Standard_Integer form) diff --git a/src/IGESDimen/IGESDimen_ReadWriteModule.cxx b/src/IGESDimen/IGESDimen_ReadWriteModule.cxx deleted file mode 100644 index b3e0ec9d64..0000000000 --- a/src/IGESDimen/IGESDimen_ReadWriteModule.cxx +++ /dev/null @@ -1,462 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESDimen_ReadWriteModule,IGESData_ReadWriteModule) - -// Each Module is attached to a Protocol : it must interprete Case Numbers -// (arguments of various methods) in accordance to values returned by -// the method TypeNumber from this Protocol -IGESDimen_ReadWriteModule::IGESDimen_ReadWriteModule () { } - - - Standard_Integer IGESDimen_ReadWriteModule::CaseIGES - (const Standard_Integer typenum, const Standard_Integer formnum) const -{ - switch (typenum) { - case 106 : - if (formnum == 20 || formnum == 21) return 3; - else if (formnum > 30 && formnum < 40) return 21; - else if (formnum == 40) return 23; - break; - case 202 : return 1; - case 204 : return 4; - case 206 : return 5; - case 208 : return 10; - case 210 : return 11; - case 212 : return 12; - case 213 : return 17; - case 214 : return 14; - case 216 : return 15; - case 218 : return 18; - case 220 : return 19; - case 222 : return 20; - case 228 : return 13; - case 230 : return 22; - case 402 : - switch (formnum) { - case 13 : return 9; - case 21 : return 16; - default : break; - } - break; - case 406 : - switch (formnum) { - case 28 : return 8; - case 29 : return 7; - case 30 : return 6; - case 31 : return 2; - default : break; - } - break; - default : break; - } - return 0; -} - - - void IGESDimen_ReadWriteModule::ReadOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESDimen_AngularDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolAngularDimension tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 2 : { - DeclareAndCast(IGESDimen_BasicDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolBasicDimension tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 3 : { - DeclareAndCast(IGESDimen_CenterLine,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolCenterLine tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 4 : { - DeclareAndCast(IGESDimen_CurveDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolCurveDimension tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 5 : { - DeclareAndCast(IGESDimen_DiameterDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDiameterDimension tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 6 : { - DeclareAndCast(IGESDimen_DimensionDisplayData,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionDisplayData tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 7 : { - DeclareAndCast(IGESDimen_DimensionTolerance,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionTolerance tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 8 : { - DeclareAndCast(IGESDimen_DimensionUnits,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionUnits tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 9 : { - DeclareAndCast(IGESDimen_DimensionedGeometry,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionedGeometry tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 10 : { - DeclareAndCast(IGESDimen_FlagNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolFlagNote tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 11 : { - DeclareAndCast(IGESDimen_GeneralLabel,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralLabel tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 12 : { - DeclareAndCast(IGESDimen_GeneralNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralNote tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 13 : { - DeclareAndCast(IGESDimen_GeneralSymbol,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralSymbol tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 14 : { - DeclareAndCast(IGESDimen_LeaderArrow,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolLeaderArrow tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 15 : { - DeclareAndCast(IGESDimen_LinearDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolLinearDimension tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 16 : { - DeclareAndCast(IGESDimen_NewDimensionedGeometry,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolNewDimensionedGeometry tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 17 : { - DeclareAndCast(IGESDimen_NewGeneralNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolNewGeneralNote tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 18 : { - DeclareAndCast(IGESDimen_OrdinateDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolOrdinateDimension tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 19 : { - DeclareAndCast(IGESDimen_PointDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolPointDimension tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 20 : { - DeclareAndCast(IGESDimen_RadiusDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolRadiusDimension tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 21 : { - DeclareAndCast(IGESDimen_Section,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolSection tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 22 : { - DeclareAndCast(IGESDimen_SectionedArea,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolSectionedArea tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 23 : { - DeclareAndCast(IGESDimen_WitnessLine,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolWitnessLine tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - default : break; - } -} - - - void IGESDimen_ReadWriteModule::WriteOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - IGESData_IGESWriter& IW) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESDimen_AngularDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolAngularDimension tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 2 : { - DeclareAndCast(IGESDimen_BasicDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolBasicDimension tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 3 : { - DeclareAndCast(IGESDimen_CenterLine,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolCenterLine tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 4 : { - DeclareAndCast(IGESDimen_CurveDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolCurveDimension tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 5 : { - DeclareAndCast(IGESDimen_DiameterDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDiameterDimension tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 6 : { - DeclareAndCast(IGESDimen_DimensionDisplayData,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionDisplayData tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 7 : { - DeclareAndCast(IGESDimen_DimensionTolerance,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionTolerance tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 8 : { - DeclareAndCast(IGESDimen_DimensionUnits,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionUnits tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 9 : { - DeclareAndCast(IGESDimen_DimensionedGeometry,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionedGeometry tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 10 : { - DeclareAndCast(IGESDimen_FlagNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolFlagNote tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 11 : { - DeclareAndCast(IGESDimen_GeneralLabel,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralLabel tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 12 : { - DeclareAndCast(IGESDimen_GeneralNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralNote tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 13 : { - DeclareAndCast(IGESDimen_GeneralSymbol,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralSymbol tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 14 : { - DeclareAndCast(IGESDimen_LeaderArrow,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolLeaderArrow tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 15 : { - DeclareAndCast(IGESDimen_LinearDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolLinearDimension tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 16 : { - DeclareAndCast(IGESDimen_NewDimensionedGeometry,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolNewDimensionedGeometry tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 17 : { - DeclareAndCast(IGESDimen_NewGeneralNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolNewGeneralNote tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 18 : { - DeclareAndCast(IGESDimen_OrdinateDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolOrdinateDimension tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 19 : { - DeclareAndCast(IGESDimen_PointDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolPointDimension tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 20 : { - DeclareAndCast(IGESDimen_RadiusDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolRadiusDimension tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 21 : { - DeclareAndCast(IGESDimen_Section,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolSection tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 22 : { - DeclareAndCast(IGESDimen_SectionedArea,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolSectionedArea tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 23 : { - DeclareAndCast(IGESDimen_WitnessLine,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolWitnessLine tool; - tool.WriteOwnParams(anent,IW); - } - break; - default : break; - } -} diff --git a/src/IGESDimen/IGESDimen_ReadWriteModule.hxx b/src/IGESDimen/IGESDimen_ReadWriteModule.hxx deleted file mode 100644 index 3d27774cac..0000000000 --- a/src/IGESDimen/IGESDimen_ReadWriteModule.hxx +++ /dev/null @@ -1,79 +0,0 @@ -// Created on: 1993-09-06 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDimen_ReadWriteModule_HeaderFile -#define _IGESDimen_ReadWriteModule_HeaderFile - -#include -#include - -#include -#include -class Standard_DomainError; -class IGESData_IGESEntity; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; - - -class IGESDimen_ReadWriteModule; -DEFINE_STANDARD_HANDLE(IGESDimen_ReadWriteModule, IGESData_ReadWriteModule) - -//! Defines Dimen File Access Module for IGESDimen (specific parts) -//! Specific actions concern : Read and Write Own Parameters of -//! an IGESEntity -class IGESDimen_ReadWriteModule : public IGESData_ReadWriteModule -{ - -public: - - - //! Creates a ReadWriteModule & puts it into ReaderLib & WriterLib - Standard_EXPORT IGESDimen_ReadWriteModule(); - - //! Defines Case Numbers for Entities of IGESDimen - Standard_EXPORT Standard_Integer CaseIGES (const Standard_Integer typenum, const Standard_Integer formnum) const Standard_OVERRIDE; - - //! Reads own parameters from file for an Entity of IGESDimen - Standard_EXPORT void ReadOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const Standard_OVERRIDE; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, IGESData_IGESWriter& IW) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IGESDimen_ReadWriteModule,IGESData_ReadWriteModule) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IGESDimen_ReadWriteModule_HeaderFile diff --git a/src/IGESDimen/IGESDimen_SpecificModule.cxx b/src/IGESDimen/IGESDimen_SpecificModule.cxx deleted file mode 100644 index 9dd3484b9e..0000000000 --- a/src/IGESDimen/IGESDimen_SpecificModule.cxx +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESDimen_SpecificModule,IGESData_SpecificModule) - -// Each Module is attached to a Protocol : it must interprete Case Numbers -// (arguments of various methods) in accordance to values returned by -// the method TypeNumber from this Protocol -IGESDimen_SpecificModule::IGESDimen_SpecificModule() { } - - - void IGESDimen_SpecificModule::OwnDump - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, - const Standard_Integer own) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESDimen_AngularDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolAngularDimension tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 2 : { - DeclareAndCast(IGESDimen_BasicDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolBasicDimension tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 3 : { - DeclareAndCast(IGESDimen_CenterLine,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolCenterLine tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 4 : { - DeclareAndCast(IGESDimen_CurveDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolCurveDimension tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 5 : { - DeclareAndCast(IGESDimen_DiameterDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDiameterDimension tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 6 : { - DeclareAndCast(IGESDimen_DimensionDisplayData,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionDisplayData tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 7 : { - DeclareAndCast(IGESDimen_DimensionTolerance,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionTolerance tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 8 : { - DeclareAndCast(IGESDimen_DimensionUnits,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionUnits tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 9 : { - DeclareAndCast(IGESDimen_DimensionedGeometry,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolDimensionedGeometry tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 10 : { - DeclareAndCast(IGESDimen_FlagNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolFlagNote tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 11 : { - DeclareAndCast(IGESDimen_GeneralLabel,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralLabel tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 12 : { - DeclareAndCast(IGESDimen_GeneralNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralNote tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 13 : { - DeclareAndCast(IGESDimen_GeneralSymbol,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolGeneralSymbol tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 14 : { - DeclareAndCast(IGESDimen_LeaderArrow,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolLeaderArrow tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 15 : { - DeclareAndCast(IGESDimen_LinearDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolLinearDimension tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 16 : { - DeclareAndCast(IGESDimen_NewDimensionedGeometry,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolNewDimensionedGeometry tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 17 : { - DeclareAndCast(IGESDimen_NewGeneralNote,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolNewGeneralNote tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 18 : { - DeclareAndCast(IGESDimen_OrdinateDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolOrdinateDimension tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 19 : { - DeclareAndCast(IGESDimen_PointDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolPointDimension tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 20 : { - DeclareAndCast(IGESDimen_RadiusDimension,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolRadiusDimension tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 21 : { - DeclareAndCast(IGESDimen_Section,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolSection tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 22 : { - DeclareAndCast(IGESDimen_SectionedArea,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolSectionedArea tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 23 : { - DeclareAndCast(IGESDimen_WitnessLine,anent,ent); - if (anent.IsNull()) return; - IGESDimen_ToolWitnessLine tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - default : break; - } -} - - - Standard_Boolean IGESDimen_SpecificModule::OwnCorrect - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const -{ -// Applies only on some types - switch (CN) { - case 2 : { - DeclareAndCast(IGESDimen_BasicDimension,anent,ent); - if (anent.IsNull()) break; - IGESDimen_ToolBasicDimension tool; - return tool.OwnCorrect(anent); - } - case 3 : { - DeclareAndCast(IGESDimen_CenterLine,anent,ent); - if (anent.IsNull()) break; - IGESDimen_ToolCenterLine tool; - return tool.OwnCorrect(anent); - } - case 6 : { - DeclareAndCast(IGESDimen_DimensionDisplayData,anent,ent); - if (anent.IsNull()) break; - IGESDimen_ToolDimensionDisplayData tool; - return tool.OwnCorrect(anent); - } - case 7 : { - DeclareAndCast(IGESDimen_DimensionTolerance,anent,ent); - if (anent.IsNull()) break; - IGESDimen_ToolDimensionTolerance tool; - return tool.OwnCorrect(anent); - } - case 8 : { - DeclareAndCast(IGESDimen_DimensionUnits,anent,ent); - if (anent.IsNull()) break; - IGESDimen_ToolDimensionUnits tool; - return tool.OwnCorrect(anent); - } - case 9 : { - DeclareAndCast(IGESDimen_DimensionedGeometry,anent,ent); - if (anent.IsNull()) break; - IGESDimen_ToolDimensionedGeometry tool; - return tool.OwnCorrect(anent); - } - case 16 : { - DeclareAndCast(IGESDimen_NewDimensionedGeometry,anent,ent); - if (anent.IsNull()) break; - IGESDimen_ToolNewDimensionedGeometry tool; - return tool.OwnCorrect(anent); - } - case 21 : { - DeclareAndCast(IGESDimen_Section,anent,ent); - if (anent.IsNull()) break; - IGESDimen_ToolSection tool; - return tool.OwnCorrect(anent); - } - case 23 : { - DeclareAndCast(IGESDimen_WitnessLine,anent,ent); - if (anent.IsNull()) break; - IGESDimen_ToolWitnessLine tool; - return tool.OwnCorrect(anent); - } - default : break; - } - return Standard_False; -} diff --git a/src/IGESDimen/IGESDimen_SpecificModule.hxx b/src/IGESDimen/IGESDimen_SpecificModule.hxx deleted file mode 100644 index 29bdd57da1..0000000000 --- a/src/IGESDimen/IGESDimen_SpecificModule.hxx +++ /dev/null @@ -1,77 +0,0 @@ -// Created on: 1993-09-07 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDimen_SpecificModule_HeaderFile -#define _IGESDimen_SpecificModule_HeaderFile - -#include -#include - -#include -#include -#include -class IGESData_IGESEntity; -class IGESData_IGESDumper; -class Message_Messenger; - - -class IGESDimen_SpecificModule; -DEFINE_STANDARD_HANDLE(IGESDimen_SpecificModule, IGESData_SpecificModule) - -//! Defines Services attached to IGES Entities : -//! Dump & OwnCorrect, for IGESDimen -class IGESDimen_SpecificModule : public IGESData_SpecificModule -{ - -public: - - - //! Creates a SpecificModule from IGESDimen & puts it into SpecificLib - Standard_EXPORT IGESDimen_SpecificModule(); - - //! Specific Dump (own parameters) for IGESDimen - Standard_EXPORT void OwnDump (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const Standard_OVERRIDE; - - //! Performs non-ambiguous Corrections on Entities which support - //! them (BasicDimension,CenterLine,DimensionDisplayData, - //! DimensionTolerance,DimensionUnits,DimensionedGeometry, - //! NewDimensionedGeometry,Section,WitnessLine) - Standard_EXPORT virtual Standard_Boolean OwnCorrect (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IGESDimen_SpecificModule,IGESData_SpecificModule) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IGESDimen_SpecificModule_HeaderFile diff --git a/src/IGESDimen/IGESDimen_ToolAngularDimension.cxx b/src/IGESDimen/IGESDimen_ToolAngularDimension.cxx index 906b11394f..e7fd4ac9ff 100644 --- a/src/IGESDimen/IGESDimen_ToolAngularDimension.cxx +++ b/src/IGESDimen/IGESDimen_ToolAngularDimension.cxx @@ -52,24 +52,13 @@ void IGESDimen_ToolAngularDimension::ReadOwnParams Handle(IGESDimen_LeaderArrow) firstLeader; Handle(IGESDimen_LeaderArrow) secondLeader; - PR.ReadEntity(IR, PR.Current(), "General Note Entity", - STANDARD_TYPE(IGESDimen_GeneralNote), note); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity (IR, PR.Current(), "First Witness Entity", - STANDARD_TYPE(IGESDimen_WitnessLine), firstWitness, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity (IR,PR.Current(),"Second Witness Entity", - STANDARD_TYPE(IGESDimen_WitnessLine), secondWitness, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadXY(PR.CurrentList(1, 2), "Vertex Point Co-ords", vertex); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadReal(PR.Current(), "Radius of Leader arcs", radius); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "First Leader Entity", - STANDARD_TYPE(IGESDimen_LeaderArrow), firstLeader); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(),"Second Leader Entity", - STANDARD_TYPE(IGESDimen_LeaderArrow), secondLeader); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "General Note Entity", STANDARD_TYPE(IGESDimen_GeneralNote), note); + PR.ReadEntity(IR, "First Witness Entity", STANDARD_TYPE(IGESDimen_WitnessLine), firstWitness, Standard_True); + PR.ReadEntity(IR, "Second Witness Entity", STANDARD_TYPE(IGESDimen_WitnessLine), secondWitness, Standard_True); + PR.ReadXY(vertex,"Vertex Point Co-ords"); + PR.ReadReal(radius,"Radius of Leader arcs"); + PR.ReadEntity(IR, "First Leader Entity", STANDARD_TYPE(IGESDimen_LeaderArrow), firstLeader); + PR.ReadEntity(IR, "Second Leader Entity", STANDARD_TYPE(IGESDimen_LeaderArrow), secondLeader); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init diff --git a/src/IGESDimen/IGESDimen_ToolBasicDimension.cxx b/src/IGESDimen/IGESDimen_ToolBasicDimension.cxx index a6188a31c0..84948e01ea 100644 --- a/src/IGESDimen/IGESDimen_ToolBasicDimension.cxx +++ b/src/IGESDimen/IGESDimen_ToolBasicDimension.cxx @@ -38,18 +38,17 @@ void IGESDimen_ToolBasicDimension::ReadOwnParams (const Handle(IGESDimen_BasicDimension)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Integer nbPropVal; gp_XY templl; gp_XY templr; gp_XY tempur; gp_XY tempul; - PR.ReadInteger(PR.Current(),"Number of Property Values",nbPropVal); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadXY(PR.CurrentList(1, 2),"Lower Left Corner", templl); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadXY(PR.CurrentList(1, 2),"Lower Right Corner", templr); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadXY(PR.CurrentList(1, 2),"Upper Right Corner", tempur); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadXY(PR.CurrentList(1, 2),"Upper Left Corner", tempul); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(nbPropVal,"Number of Property Values"); + PR.ReadXY(templl,"Lower Left Corner"); + PR.ReadXY(templr,"Lower Right Corner"); + PR.ReadXY(tempur,"Upper Right Corner"); + PR.ReadXY(tempul,"Upper Left Corner"); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(nbPropVal, templl, templr, tempur, tempul); diff --git a/src/IGESDimen/IGESDimen_ToolCenterLine.cxx b/src/IGESDimen/IGESDimen_ToolCenterLine.cxx index 88af0f39bf..9a28148977 100644 --- a/src/IGESDimen/IGESDimen_ToolCenterLine.cxx +++ b/src/IGESDimen/IGESDimen_ToolCenterLine.cxx @@ -41,28 +41,23 @@ void IGESDimen_ToolCenterLine::ReadOwnParams (const Handle(IGESDimen_CenterLine)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer datatype; Standard_Real zDisplacement; Standard_Integer nbval; Handle(TColgp_HArray1OfXY) dataPoints; - PR.ReadInteger(PR.Current(), "Interpretation Flag", datatype); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(datatype,"Interpretation Flag"); - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of data points", nbval); + Standard_Boolean st = PR.ReadInteger(nbval,"Number of data points"); if (st && nbval > 0) dataPoints = new TColgp_HArray1OfXY(1, nbval); else PR.AddFail("Number of data points: Not Positive"); - PR.ReadReal(PR.Current(), "Common Z Displacement", zDisplacement); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(zDisplacement,"Common Z Displacement"); if (! dataPoints.IsNull()) for (Standard_Integer i = 1; i <= nbval; i++) { - gp_XY tempXY; - //st = PR.ReadXY(PR.CurrentList(1, 2), "Data Points", tempXY); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadXY(PR.CurrentList(1, 2), "Data Points", tempXY)) - dataPoints->SetValue(i, tempXY); + PR.ReadXY(dataPoints->ChangeValue(i),"Data Points"); } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); diff --git a/src/IGESDimen/IGESDimen_ToolCurveDimension.cxx b/src/IGESDimen/IGESDimen_ToolCurveDimension.cxx index 097f6fb57e..a4b089920e 100644 --- a/src/IGESDimen/IGESDimen_ToolCurveDimension.cxx +++ b/src/IGESDimen/IGESDimen_ToolCurveDimension.cxx @@ -51,25 +51,13 @@ void IGESDimen_ToolCurveDimension::ReadOwnParams Handle(IGESDimen_WitnessLine) firstWitness; Handle(IGESDimen_WitnessLine) secondWitness; - PR.ReadEntity(IR, PR.Current(), "General Note Entity", - STANDARD_TYPE(IGESDimen_GeneralNote), note); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "First Curve Entity", firstCurve); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR,PR.Current(),"Second Curve Entity", - secondCurve,Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "First Leader Entity", - STANDARD_TYPE(IGESDimen_LeaderArrow), firstLeader); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(),"Second Leader Entity", - STANDARD_TYPE(IGESDimen_LeaderArrow), secondLeader); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity (IR, PR.Current(), "First Witness Entity", - STANDARD_TYPE(IGESDimen_WitnessLine), firstWitness, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity (IR,PR.Current(),"Second Witness Entity", - STANDARD_TYPE(IGESDimen_WitnessLine), secondWitness, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "General Note Entity", STANDARD_TYPE(IGESDimen_GeneralNote), note); + PR.ReadEntity(IR, "First Curve Entity", firstCurve); + PR.ReadEntity(IR, "Second Curve Entity", secondCurve, Standard_True); + PR.ReadEntity(IR, "First Leader Entity", STANDARD_TYPE(IGESDimen_LeaderArrow), firstLeader); + PR.ReadEntity(IR, "Second Leader Entity", STANDARD_TYPE(IGESDimen_LeaderArrow), secondLeader); + PR.ReadEntity(IR, "First Witness Entity", STANDARD_TYPE(IGESDimen_WitnessLine), firstWitness, Standard_True); + PR.ReadEntity(IR, "Second Witness Entity", STANDARD_TYPE(IGESDimen_WitnessLine), secondWitness, Standard_True); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init diff --git a/src/IGESDimen/IGESDimen_ToolDiameterDimension.cxx b/src/IGESDimen/IGESDimen_ToolDiameterDimension.cxx index 640b534d3f..59277090ca 100644 --- a/src/IGESDimen/IGESDimen_ToolDiameterDimension.cxx +++ b/src/IGESDimen/IGESDimen_ToolDiameterDimension.cxx @@ -46,16 +46,10 @@ void IGESDimen_ToolDiameterDimension::ReadOwnParams Handle(IGESDimen_LeaderArrow) secondLeader; gp_XY center; - PR.ReadEntity(IR, PR.Current(), "General Note Entity", - STANDARD_TYPE(IGESDimen_GeneralNote), note); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "First Leader Entity", - STANDARD_TYPE(IGESDimen_LeaderArrow), firstLeader); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity (IR,PR.Current(),"Second Leader Entity", - STANDARD_TYPE(IGESDimen_LeaderArrow), secondLeader, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadXY(PR.CurrentList(1, 2), "Arc Center Co-ords", center); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "General Note Entity", STANDARD_TYPE(IGESDimen_GeneralNote), note); + PR.ReadEntity(IR, "First Leader Entity", STANDARD_TYPE(IGESDimen_LeaderArrow), firstLeader); + PR.ReadEntity(IR, "Second Leader Entity", STANDARD_TYPE(IGESDimen_LeaderArrow), secondLeader, Standard_True); + PR.ReadXY(center,"Arc Center Co-ords"); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(note, firstLeader, secondLeader, center); diff --git a/src/IGESDimen/IGESDimen_ToolDimensionDisplayData.cxx b/src/IGESDimen/IGESDimen_ToolDimensionDisplayData.cxx index a1b54266a6..bd2785200c 100644 --- a/src/IGESDimen/IGESDimen_ToolDimensionDisplayData.cxx +++ b/src/IGESDimen/IGESDimen_ToolDimensionDisplayData.cxx @@ -56,39 +56,36 @@ void IGESDimen_ToolDimensionDisplayData::ReadOwnParams Handle(TColStd_HArray1OfInteger) tempStartInd; Handle(TColStd_HArray1OfInteger) tempEndInd; - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(),"Number of Properties",tempNbProps); - PR.ReadInteger(PR.Current(),"Dimension Type", tempDimType); - PR.ReadInteger(PR.Current(),"Label Position", tempLabelPos); + PR.ReadInteger(tempNbProps,"Number of Properties"); + PR.ReadInteger(tempDimType,"Dimension Type"); + PR.ReadInteger(tempLabelPos,"Label Position"); if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(),"Character Set", tempCharSet); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempCharSet,"Character Set"); else tempCharSet = 1; - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadText(PR.Current(),"L String", tempLString); - PR.ReadInteger(PR.Current(),"Decimal Symbol",tempDeciSymb); + PR.ReadText("L String", tempLString); + PR.ReadInteger(tempDeciSymb,"Decimal Symbol"); if (PR.DefinedElseSkip()) - PR.ReadReal(PR.Current(),"Witness Line Angle",tempWitLineAng); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(tempWitLineAng,"Witness Line Angle"); else tempWitLineAng = M_PI / 2; - PR.ReadInteger(PR.Current(),"Text Alignment",tempTextAlign); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempTextAlign,"Text Alignment"); if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(),"Text Level",tempTextLevel); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempTextLevel,"Text Level"); else tempTextLevel = 0; if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(),"Text Place",tempTextPlace); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempTextPlace,"Text Place"); else tempTextPlace = 0; - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(),"ArrowHeadOrientation",tempArrHeadOrient); - PR.ReadReal(PR.Current(),"Initial Value",tempInitVal); + PR.ReadInteger(tempArrHeadOrient,"ArrowHeadOrientation"); + PR.ReadReal(tempInitVal,"Initial Value"); Standard_Integer tempnbval; - Standard_Boolean st = PR.ReadInteger( PR.Current(), "No. of supplementary notes", tempnbval); + Standard_Boolean st = PR.ReadInteger(tempnbval,"No. of supplementary notes"); if (st && tempnbval > 0) { tempSuppleNotes = new TColStd_HArray1OfInteger(1,tempnbval); @@ -97,14 +94,11 @@ void IGESDimen_ToolDimensionDisplayData::ReadOwnParams for (Standard_Integer i = 1; i <= tempnbval; i++) { Standard_Integer anote,astart,anend; - //st = PR.ReadInteger(PR.Current(), "Supplementary Notes", anote); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Supplementary Notes", anote)) + if (PR.ReadInteger(anote,"Supplementary Notes")) tempSuppleNotes->SetValue(i,anote); - //st = PR.ReadInteger(PR.Current(),"Start Index", astart); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(),"Start Index", astart)) + if (PR.ReadInteger(astart,"Start Index")) tempStartInd->SetValue(i,astart); - //st = PR.ReadInteger(PR.Current(),"End Index",anend); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(),"End Index",anend)) + if (PR.ReadInteger(anend,"End Index")) tempEndInd->SetValue(i,anend); } } diff --git a/src/IGESDimen/IGESDimen_ToolDimensionTolerance.cxx b/src/IGESDimen/IGESDimen_ToolDimensionTolerance.cxx index 24a9499a40..deafa6bcfe 100644 --- a/src/IGESDimen/IGESDimen_ToolDimensionTolerance.cxx +++ b/src/IGESDimen/IGESDimen_ToolDimensionTolerance.cxx @@ -35,7 +35,6 @@ void IGESDimen_ToolDimensionTolerance::ReadOwnParams (const Handle(IGESDimen_DimensionTolerance)& ent, const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Integer tempNbProps; Standard_Integer tempSecondTolFlag; Standard_Integer tempTolTyp; @@ -47,25 +46,22 @@ void IGESDimen_ToolDimensionTolerance::ReadOwnParams Standard_Integer tempPrecision; if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Number of properties", tempNbProps); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempNbProps,"Number of properties"); else tempNbProps = 8; - PR.ReadInteger(PR.Current(), "Secondary Tolerance Flag", - tempSecondTolFlag); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(), "Tolerance Type", tempTolTyp); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempSecondTolFlag,"Secondary Tolerance Flag"); + PR.ReadInteger(tempTolTyp,"Tolerance Type"); if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Tolerance Placement Flag", - tempTolPlaceFlag); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempTolPlaceFlag,"Tolerance Placement Flag"); else tempTolPlaceFlag = 2; - PR.ReadReal(PR.Current(), "Upper Tolerance", tempUpperTol); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadReal(PR.Current(), "Lower Tolerance", tempLowerTol); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadBoolean(PR.Current(), "Sign Suppression Flag", - tempSignSupFlag); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(), "Fraction Flag", tempFracFlag); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(), "Precision", tempPrecision); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(tempUpperTol,"Upper Tolerance"); + PR.ReadReal(tempLowerTol,"Lower Tolerance"); + PR.ReadBoolean("Sign Suppression Flag", tempSignSupFlag); + PR.ReadInteger(tempFracFlag,"Fraction Flag"); + PR.ReadInteger(tempPrecision,"Precision"); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init diff --git a/src/IGESDimen/IGESDimen_ToolDimensionUnits.cxx b/src/IGESDimen/IGESDimen_ToolDimensionUnits.cxx index bdc0afc434..e2c9e1477b 100644 --- a/src/IGESDimen/IGESDimen_ToolDimensionUnits.cxx +++ b/src/IGESDimen/IGESDimen_ToolDimensionUnits.cxx @@ -38,7 +38,6 @@ void IGESDimen_ToolDimensionUnits::ReadOwnParams (const Handle(IGESDimen_DimensionUnits)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Integer tempNbProps; Standard_Integer tempSecondDimenPos; Standard_Integer tempUnitsIndic; @@ -48,21 +47,20 @@ void IGESDimen_ToolDimensionUnits::ReadOwnParams Handle(TCollection_HAsciiString) tempFormatString; if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Number of Properties", tempNbProps); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempNbProps,"Number of Properties"); else tempNbProps = 6; - PR.ReadInteger(PR.Current(), "Secondary Dimension Position", - tempSecondDimenPos); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(), "Units Indicator", tempUnitsIndic); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempSecondDimenPos,"Secondary Dimension Position"); + PR.ReadInteger(tempUnitsIndic,"Units Indicator"); if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Character Set", tempCharSet); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempCharSet,"Character Set"); else tempCharSet = 1; - PR.ReadText(PR.Current(), "Format String", tempFormatString); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(), "Fraction Flag", tempFracFlag); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(), "Precision", tempPrecision); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadText("Format String", tempFormatString); + PR.ReadInteger(tempFracFlag,"Fraction Flag"); + PR.ReadInteger(tempPrecision,"Precision"); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init diff --git a/src/IGESDimen/IGESDimen_ToolDimensionedGeometry.cxx b/src/IGESDimen/IGESDimen_ToolDimensionedGeometry.cxx index fd44edd537..e7aee60b62 100644 --- a/src/IGESDimen/IGESDimen_ToolDimensionedGeometry.cxx +++ b/src/IGESDimen/IGESDimen_ToolDimensionedGeometry.cxx @@ -39,32 +39,18 @@ void IGESDimen_ToolDimensionedGeometry::ReadOwnParams (const Handle(IGESDimen_DimensionedGeometry)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Integer tempNbDimen; Handle(IGESData_IGESEntity) aDimEntity; Standard_Integer nbgeom = 0; Handle(IGESData_HArray1OfIGESEntity) GeomEntities; - PR.ReadInteger(PR.Current(),"Number of Dimensions",tempNbDimen); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadInteger(PR.Current(),"number of entities",nbgeom); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR,PR.Current(),"Dimension Entity",aDimEntity); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempNbDimen,"Number of Dimensions"); + PR.ReadInteger(nbgeom,"number of entities"); + PR.ReadEntity(IR,"Dimension Entity",aDimEntity); if (nbgeom > 0) - PR.ReadEnts (IR,PR.CurrentList(nbgeom), - "Geometry Entities",GeomEntities); //szv#4:S4163:12Mar99 `st=` not needed -/* - { - GeomEntities = new IGESData_HArray1OfIGESEntity(1,nbgeom); - for (Standard_Integer i = 1; i <= nbgeom; i++) - { - Handle(IGESData_IGESEntity) anentity; - st = PR.ReadEntity(IR,PR.Current(),"Geometry Entity",anentity); - if (st) GeomEntities->SetValue(i,anentity); - } - } -*/ + PR.ReadEnts (IR,PR.CurrentList(nbgeom), "Geometry Entities",GeomEntities); + DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init ( tempNbDimen, aDimEntity, GeomEntities); } diff --git a/src/IGESDimen/IGESDimen_ToolFlagNote.cxx b/src/IGESDimen/IGESDimen_ToolFlagNote.cxx index aafddc2d56..dc010448ac 100644 --- a/src/IGESDimen/IGESDimen_ToolFlagNote.cxx +++ b/src/IGESDimen/IGESDimen_ToolFlagNote.cxx @@ -47,14 +47,11 @@ void IGESDimen_ToolFlagNote::ReadOwnParams Standard_Integer nbval; Handle(IGESDimen_HArray1OfLeaderArrow) leaders; - PR.ReadXYZ (PR.CurrentList(1, 3), "Lower Left Corner Co-ords", lowerLeft); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadXYZ(lowerLeft,"Lower Left Corner Co-ords"); + PR.ReadReal(angle,"Rotation Angle"); + PR.ReadEntity(IR, "General Note Entity",STANDARD_TYPE(IGESDimen_GeneralNote), note); - PR.ReadReal(PR.Current(), "Rotation Angle", angle); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "General Note Entity", - STANDARD_TYPE(IGESDimen_GeneralNote), note); //szv#4:S4163:12Mar99 `st=` not needed - - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Leaders", nbval); + Standard_Boolean st = PR.ReadInteger(nbval,"Number of Leaders"); if (st && nbval > 0) { leaders = new IGESDimen_HArray1OfLeaderArrow(1, nbval); @@ -62,9 +59,7 @@ void IGESDimen_ToolFlagNote::ReadOwnParams for (Standard_Integer i = 1; i <= nbval; i++) { Handle(IGESDimen_LeaderArrow) anentity; - //st = PR.ReadEntity(IR, PR.Current(), "Leaders", - //STANDARD_TYPE(IGESDimen_LeaderArrow), anentity); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR, PR.Current(), "Leaders", STANDARD_TYPE(IGESDimen_LeaderArrow), anentity)) + if (PR.ReadEntity(IR, "Leaders", STANDARD_TYPE(IGESDimen_LeaderArrow), anentity)) leaders->SetValue(i, anentity); } } diff --git a/src/IGESDimen/IGESDimen_ToolGeneralLabel.cxx b/src/IGESDimen/IGESDimen_ToolGeneralLabel.cxx index 7c580dd6f1..24ec82a1cb 100644 --- a/src/IGESDimen/IGESDimen_ToolGeneralLabel.cxx +++ b/src/IGESDimen/IGESDimen_ToolGeneralLabel.cxx @@ -40,16 +40,13 @@ void IGESDimen_ToolGeneralLabel::ReadOwnParams (const Handle(IGESDimen_GeneralLabel)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Handle(IGESDimen_GeneralNote) note; Standard_Integer nbval; Handle(IGESDimen_HArray1OfLeaderArrow) leaders; - PR.ReadEntity(IR, PR.Current(), "General Note Entity", - STANDARD_TYPE(IGESDimen_GeneralNote),note); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "General Note Entity", STANDARD_TYPE(IGESDimen_GeneralNote), note); - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Leaders", nbval); + Standard_Boolean st = PR.ReadInteger(nbval,"Number of Leaders"); if (st && nbval > 0) leaders = new IGESDimen_HArray1OfLeaderArrow(1, nbval); else PR.AddFail("Number of Leaders: Not Positive"); @@ -58,9 +55,7 @@ void IGESDimen_ToolGeneralLabel::ReadOwnParams for (Standard_Integer i = 1; i <= nbval; i++) { Handle(IGESDimen_LeaderArrow) anentity; - //st = PR.ReadEntity(IR, PR.Current(), "Leaders", - //STANDARD_TYPE(IGESDimen_LeaderArrow), anentity); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR, PR.Current(), "Leaders", STANDARD_TYPE(IGESDimen_LeaderArrow), anentity)) + if (PR.ReadEntity(IR, "Leaders", STANDARD_TYPE(IGESDimen_LeaderArrow), anentity)) leaders->SetValue(i, anentity); } diff --git a/src/IGESDimen/IGESDimen_ToolGeneralNote.cxx b/src/IGESDimen/IGESDimen_ToolGeneralNote.cxx index ebb4f8ac05..667ee11772 100644 --- a/src/IGESDimen/IGESDimen_ToolGeneralNote.cxx +++ b/src/IGESDimen/IGESDimen_ToolGeneralNote.cxx @@ -47,8 +47,6 @@ void IGESDimen_ToolGeneralNote::ReadOwnParams (const Handle(IGESDimen_GeneralNote)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Standard_Integer nbval; Handle(TColStd_HArray1OfInteger) nbChars; Handle(TColStd_HArray1OfReal) boxWidths; @@ -62,7 +60,7 @@ void IGESDimen_ToolGeneralNote::ReadOwnParams Handle(TColgp_HArray1OfXYZ) startPoints; Handle(Interface_HArray1OfHAsciiString) texts; - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Text Strings", nbval); + Standard_Boolean st = PR.ReadInteger(nbval,"Number of Text Strings"); if (st && nbval > 0) { nbChars = new TColStd_HArray1OfInteger(1, nbval); boxWidths = new TColStd_HArray1OfReal(1, nbval); @@ -95,23 +93,20 @@ void IGESDimen_ToolGeneralNote::ReadOwnParams gp_XYZ startPoint; Handle(TCollection_HAsciiString) text; - //st = PR.ReadInteger(PR.Current(), "Number of Characters", nbChar); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Number of Characters", nbChar)) + if (PR.ReadInteger(nbChar,"Number of Characters")) nbChars->SetValue(i, nbChar); - //st = PR.ReadReal(PR.Current(), "Box Width", boxWidth); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Box Width", boxWidth)) + if (PR.ReadReal(boxWidth,"Box Width")) boxWidths->SetValue(i, boxWidth); - //st = PR.ReadReal(PR.Current(), "Box Height", boxHeight); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Box Height", boxHeight)) + if (PR.ReadReal(boxHeight,"Box Height")) boxHeights->SetValue(i, boxHeight); Standard_Integer curnum = PR.CurrentNumber(); if (PR.DefinedElseSkip()) { // Reading fontCode(Integer, must be positive) - PR.ReadInteger (PR.Current(), "Font Code", fontCode); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(fontCode,"Font Code"); // Reading fontEnt(TextFontDef) ? if (fontCode < 0) { fontEntity = GetCasted(IGESGraph_TextFontDef,PR.ParamEntity (IR,curnum)); @@ -128,31 +123,25 @@ void IGESDimen_ToolGeneralNote::ReadOwnParams if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Slant Angle", slantAngle); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Slant Angle", slantAngle)) + if (PR.ReadReal(slantAngle,"Slant Angle")) slantAngles->SetValue(i, slantAngle); } else slantAngles->SetValue(i, M_PI/2); - //st = PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle)) + if (PR.ReadReal(rotationAngle,"Rotation Angle")) rotationAngles->SetValue(i, rotationAngle); - //st = PR.ReadInteger(PR.Current(), "Mirror Flag", mirrorFlag); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Mirror Flag", mirrorFlag)) + if (PR.ReadInteger(mirrorFlag,"Mirror Flag")) mirrorFlags->SetValue(i, mirrorFlag); - //st = PR.ReadInteger(PR.Current(), "Rotate Flag", rotateFlag); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Rotate Flag", rotateFlag)) + if (PR.ReadInteger(rotateFlag,"Rotate Flag")) rotateFlags->SetValue(i, rotateFlag); - //st = PR.ReadXYZ(PR.CurrentList(1, 3), "Start Point", startPoint); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadXYZ(PR.CurrentList(1, 3), "Start Point", startPoint)) + if (PR.ReadXYZ(startPoint,"Start Point")) startPoints->SetValue(i, startPoint); - //st = PR.ReadText(PR.Current(), "Text String", text); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadText(PR.Current(), "Text String", text)) + if (PR.ReadText("Text String", text)) texts->SetValue(i, text); } } diff --git a/src/IGESDimen/IGESDimen_ToolGeneralSymbol.cxx b/src/IGESDimen/IGESDimen_ToolGeneralSymbol.cxx index 8c6f963d12..2ccc7169d6 100644 --- a/src/IGESDimen/IGESDimen_ToolGeneralSymbol.cxx +++ b/src/IGESDimen/IGESDimen_ToolGeneralSymbol.cxx @@ -51,36 +51,24 @@ void IGESDimen_ToolGeneralSymbol::ReadOwnParams if ((ent->FormNumber() == 0) && (!PR.IsParamEntity(PR.CurrentNumber()))) PR.SetCurrentNumber(PR.CurrentNumber()+1); else - PR.ReadEntity(IR, PR.Current(), "General Note Entity", - STANDARD_TYPE(IGESDimen_GeneralNote), tempNote); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "General Note Entity", STANDARD_TYPE(IGESDimen_GeneralNote), tempNote); - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Geometries", num); + Standard_Boolean st = PR.ReadInteger(num,"Number of Geometries"); if (!st || num <= 0) PR.AddFail("Number of Geometries: Not Positive"); if (num > 0) { - PR.ReadEnts (IR,PR.CurrentList(num),"Geometry Entities",tempGeoms); //szv#4:S4163:12Mar99 `st=` not needed -/* - tempGeoms = new IGESData_HArray1OfIGESEntity(1, num); - for ( i = 1; i <= num; i++) - { - Handle(IGESData_IGESEntity) tempEnt; - st = PR.ReadEntity(IR, PR.Current(), "Geometry Entity", tempEnt); - if (st) tempGeoms->SetValue(i, tempEnt); - } -*/ + PR.ReadEnts (IR,PR.CurrentList(num),"Geometry Entities",tempGeoms); } else { return; } - st = PR.ReadInteger(PR.Current(), "Number of Leaders", num); + st = PR.ReadInteger(num,"Number of Leaders"); if (st && num > 0) tempLeaders = new IGESDimen_HArray1OfLeaderArrow(1, num); else if (num < 0) PR.AddFail("Number of Leaders: Less than zero"); if (!tempLeaders.IsNull()) for ( i = 1; i <= num; i++) { Handle(IGESDimen_LeaderArrow) tempEnt; - //st = PR.ReadEntity(IR, PR.Current(), "Leader Entity", - //STANDARD_TYPE(IGESDimen_LeaderArrow), tempEnt); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR, PR.Current(), "Leader Entity", STANDARD_TYPE(IGESDimen_LeaderArrow), tempEnt)) + if (PR.ReadEntity(IR, "Leader Entity", STANDARD_TYPE(IGESDimen_LeaderArrow), tempEnt)) tempLeaders->SetValue(i, tempEnt); } diff --git a/src/IGESDimen/IGESDimen_ToolLeaderArrow.cxx b/src/IGESDimen/IGESDimen_ToolLeaderArrow.cxx index 2890d8d631..44817db6c2 100644 --- a/src/IGESDimen/IGESDimen_ToolLeaderArrow.cxx +++ b/src/IGESDimen/IGESDimen_ToolLeaderArrow.cxx @@ -40,8 +40,6 @@ void IGESDimen_ToolLeaderArrow::ReadOwnParams (const Handle(IGESDimen_LeaderArrow)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Standard_Real arrowHeadHeight; Standard_Real arrowHeadWidth; Standard_Real zDepth; @@ -49,25 +47,21 @@ void IGESDimen_ToolLeaderArrow::ReadOwnParams Handle(TColgp_HArray1OfXY) segmentTails; Standard_Integer nbval; - Standard_Boolean st = PR.ReadInteger( PR.Current(), "Count of Segments", nbval); + Standard_Boolean st = PR.ReadInteger(nbval,"Count of Segments"); if (st && nbval > 0) segmentTails = new TColgp_HArray1OfXY(1,nbval); else PR.AddFail("Count of Segments: Not Positive"); - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadReal(PR.Current(), "Arrow Head Height", arrowHeadHeight); - PR.ReadReal(PR.Current(), "Arrow Head Width", arrowHeadWidth); - PR.ReadReal(PR.Current(), "Z Depth", zDepth); - PR.ReadXY(PR.CurrentList(1, 2), "Arrow Head Position", arrowHead); + PR.ReadReal(arrowHeadHeight,"Arrow Head Height"); + PR.ReadReal(arrowHeadWidth,"Arrow Head Width"); + PR.ReadReal(zDepth,"Z Depth"); + PR.ReadXY(arrowHead,"Arrow Head Position"); if (! segmentTails.IsNull()) { for (Standard_Integer i = 1; i <= nbval; i++) { - gp_XY tempXY; - //st = PR.ReadXY(PR.CurrentList(1, 2), "Segment Co-ords.", tempXY); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadXY(PR.CurrentList(1, 2), "Segment Co-ords.", tempXY)) - segmentTails->SetValue(i, tempXY); + PR.ReadXY(segmentTails->ChangeValue(i),"Segment Co-ords."); } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init (arrowHeadHeight, arrowHeadWidth, zDepth, arrowHead, segmentTails); diff --git a/src/IGESDimen/IGESDimen_ToolLinearDimension.cxx b/src/IGESDimen/IGESDimen_ToolLinearDimension.cxx index 87f1643b35..c7526f16e5 100644 --- a/src/IGESDimen/IGESDimen_ToolLinearDimension.cxx +++ b/src/IGESDimen/IGESDimen_ToolLinearDimension.cxx @@ -39,32 +39,20 @@ void IGESDimen_ToolLinearDimension::ReadOwnParams (const Handle(IGESDimen_LinearDimension)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Handle(IGESDimen_GeneralNote) note; Handle(IGESDimen_LeaderArrow) firstLeader; Handle(IGESDimen_LeaderArrow) secondLeader; Handle(IGESDimen_WitnessLine) firstWitness; Handle(IGESDimen_WitnessLine) secondWitness; - PR.ReadEntity(IR, PR.Current(), "General Note Entity", - STANDARD_TYPE(IGESDimen_GeneralNote),note); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "First Leader Entity", - STANDARD_TYPE(IGESDimen_LeaderArrow), firstLeader); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(),"Second Leader Entity", - STANDARD_TYPE(IGESDimen_LeaderArrow), secondLeader); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "First Witness Entity", - STANDARD_TYPE(IGESDimen_WitnessLine), firstWitness, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR,PR.Current(),"Second Witness Entity", - STANDARD_TYPE(IGESDimen_WitnessLine), secondWitness, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "General Note Entity", STANDARD_TYPE(IGESDimen_GeneralNote), note); + PR.ReadEntity(IR, "First Leader Entity", STANDARD_TYPE(IGESDimen_LeaderArrow), firstLeader); + PR.ReadEntity(IR, "Second Leader Entity", STANDARD_TYPE(IGESDimen_LeaderArrow), secondLeader); + PR.ReadEntity(IR, "First Witness Entity", STANDARD_TYPE(IGESDimen_WitnessLine), firstWitness, Standard_True); + PR.ReadEntity(IR, "Second Witness Entity", STANDARD_TYPE(IGESDimen_WitnessLine), secondWitness, Standard_True); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init (note, firstLeader, secondLeader, firstWitness, secondWitness); - } void IGESDimen_ToolLinearDimension::WriteOwnParams diff --git a/src/IGESDimen/IGESDimen_ToolNewDimensionedGeometry.cxx b/src/IGESDimen/IGESDimen_ToolNewDimensionedGeometry.cxx index d3ef3b8d4d..3281805b8e 100644 --- a/src/IGESDimen/IGESDimen_ToolNewDimensionedGeometry.cxx +++ b/src/IGESDimen/IGESDimen_ToolNewDimensionedGeometry.cxx @@ -44,7 +44,6 @@ void IGESDimen_ToolNewDimensionedGeometry::ReadOwnParams (const Handle(IGESDimen_NewDimensionedGeometry)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down Standard_Integer i, num; Standard_Integer tempNbDimens; Standard_Integer tempDimOrientFlag; @@ -55,11 +54,11 @@ void IGESDimen_ToolNewDimensionedGeometry::ReadOwnParams Handle(TColgp_HArray1OfXYZ) tempPoints; if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Number of Dimensions", tempNbDimens); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempNbDimens,"Number of Dimensions"); else tempNbDimens = 1; - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Geometries", num); + Standard_Boolean st = PR.ReadInteger(num,"Number of Geometries"); if (st && num > 0) { tempGeomEnts = new IGESData_HArray1OfIGESEntity(1, num); @@ -68,26 +67,19 @@ void IGESDimen_ToolNewDimensionedGeometry::ReadOwnParams } else PR.AddFail("Number of Geometries: Not Positive"); - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadEntity(IR, PR.Current(), "Dimension Entity", tempDimen); - PR.ReadInteger(PR.Current(), "Dimension Orientation Flag", tempDimOrientFlag); - PR.ReadReal(PR.Current(), "Angle Value", tempAngle); + PR.ReadEntity(IR, "Dimension Entity", tempDimen); + PR.ReadInteger(tempDimOrientFlag,"Dimension Orientation Flag"); + PR.ReadReal(tempAngle,"Angle Value"); if (!tempGeomEnts.IsNull()) for ( i = 1; i <= num; i++) { Handle(IGESData_IGESEntity) tempEnt; - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadEntity(IR, PR.Current(), "Geometry Entity", tempEnt, (i == num)); // The last one may be Null + PR.ReadEntity(IR, "Geometry Entity", tempEnt, (i == num)); // The last one may be Null tempGeomEnts->SetValue(i, tempEnt); - Standard_Integer tempInt; - PR.ReadInteger(PR.Current(), "Dimension Location Flag", tempInt); //szv#4:S4163:12Mar99 `st=` not needed - tempDimLocFlags->SetValue(i, tempInt); - - gp_XYZ tempPnt; - PR.ReadXYZ(PR.CurrentList(1, 3), "Point", tempPnt); //szv#4:S4163:12Mar99 `st=` not needed - tempPoints->SetValue(i, tempPnt); + PR.ReadInteger(tempDimLocFlags->ChangeValue(i),"Dimension Location Flag"); + PR.ReadXYZ(tempPoints->ChangeValue(i),"Point"); } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); diff --git a/src/IGESDimen/IGESDimen_ToolNewGeneralNote.cxx b/src/IGESDimen/IGESDimen_ToolNewGeneralNote.cxx index da16711eec..5c7b9f6378 100644 --- a/src/IGESDimen/IGESDimen_ToolNewGeneralNote.cxx +++ b/src/IGESDimen/IGESDimen_ToolNewGeneralNote.cxx @@ -76,16 +76,15 @@ void IGESDimen_ToolNewGeneralNote::ReadOwnParams Handle(TColgp_HArray1OfXYZ) startPoints; Handle(Interface_HArray1OfHAsciiString) texts; - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadReal(PR.Current(), "Text Width", width); - PR.ReadReal(PR.Current(), "Text Height", height); - PR.ReadInteger(PR.Current(), "Justification Code", justifyCode); - PR.ReadXYZ(PR.CurrentList(1, 3), "Area Location Point", areaLoc); - PR.ReadReal(PR.Current(), "Area Rotation Angle", areaRotationAngle); - PR.ReadXYZ(PR.CurrentList(1, 3), "Base Line Position", baseLinePos); - PR.ReadReal(PR.Current(),"NormalInterline Spacing",normalInterlineSpace); - - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Text Strings", nbval); + PR.ReadReal(width,"Text Width"); + PR.ReadReal(height,"Text Height"); + PR.ReadInteger(justifyCode,"Justification Code"); + PR.ReadXYZ(areaLoc,"Area Location Point"); + PR.ReadReal(areaRotationAngle,"Area Rotation Angle"); + PR.ReadXYZ(baseLinePos,"Base Line Position"); + PR.ReadReal(normalInterlineSpace,"NormalInterline Spacing"); + + Standard_Boolean st = PR.ReadInteger(nbval,"Number of Text Strings"); if (st && nbval > 0) { charDisplays = new TColStd_HArray1OfInteger(1, nbval); @@ -133,55 +132,44 @@ void IGESDimen_ToolNewGeneralNote::ReadOwnParams gp_XYZ startPoint; Handle(TCollection_HAsciiString) text; - //st = PR.ReadInteger(PR.Current(), "Character Display",charDisplay); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Character Display",charDisplay)) + if (PR.ReadInteger(charDisplay,"Character Display")) charDisplays->SetValue(i, charDisplay); - //st = PR.ReadReal(PR.Current(), "Character Width", charWidth); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Character Width", charWidth)) + if (PR.ReadReal(charWidth,"Character Width")) charWidths->SetValue(i, charWidth); - //st = PR.ReadReal(PR.Current(), "Character Height", charHeight); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Character Height", charHeight)) + if (PR.ReadReal(charHeight,"Character Height")) charHeights->SetValue(i, charHeight); - //st = PR.ReadReal(PR.Current(), "Inter-character space", interCharSpace); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Inter-character space", interCharSpace)) + if (PR.ReadReal(interCharSpace,"Inter-character space")) interCharSpaces->SetValue(i, interCharSpace); - //st = PR.ReadReal(PR.Current(), "Interline space", interlineSpace); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Interline space", interlineSpace)) + if (PR.ReadReal(interlineSpace,"Interline space")) interlineSpaces->SetValue(i, interlineSpace); - //st = PR.ReadInteger(PR.Current(), "Font Style", fontStyle); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Font Style", fontStyle)) + if (PR.ReadInteger(fontStyle,"Font Style")) fontStyles->SetValue(i, fontStyle); - //st = PR.ReadReal(PR.Current(), "Character Angle", charAngle); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Character Angle", charAngle)) + if (PR.ReadReal(charAngle,"Character Angle")) charAngles->SetValue(i, charAngle); - //st = PR.ReadText(PR.Current(),"Control Code String", controlCodeString); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadText(PR.Current(),"Control Code String", controlCodeString)) + if (PR.ReadText("Control Code String", controlCodeString)) controlCodeStrings->SetValue(i, controlCodeString); - //st = PR.ReadInteger(PR.Current(), "Number of Characters", nbChar); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Number of Characters", nbChar)) + if (PR.ReadInteger(nbChar,"Number of Characters")) nbChars->SetValue(i, nbChar); - //st = PR.ReadReal(PR.Current(), "Box Width", boxWidth); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Box Width", boxWidth)) + if (PR.ReadReal(boxWidth,"Box Width")) boxWidths->SetValue(i, boxWidth); - //st = PR.ReadReal(PR.Current(), "Box Height", boxHeight); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Box Height", boxHeight)) + if (PR.ReadReal(boxHeight,"Box Height")) boxHeights->SetValue(i, boxHeight); Standard_Integer curnum = PR.CurrentNumber(); if (PR.DefinedElseSkip()) { // Reading fontCode(Integer, must be positive) - PR.ReadInteger(PR.Current(), "Character Set Interpretation Code",charSetCode); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(charSetCode,"Character Set Interpretation Code"); // Reading charSetEnt if (charSetCode < 0) { charSetEntity = PR.ParamEntity (IR,curnum); @@ -199,31 +187,25 @@ void IGESDimen_ToolNewGeneralNote::ReadOwnParams if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Slant Angle", slantAngle); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Slant Angle", slantAngle)) + if (PR.ReadReal(slantAngle,"Slant Angle")) slantAngles->SetValue(i, slantAngle); } else slantAngles->SetValue(i, M_PI/2); - //st = PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle)) + if (PR.ReadReal(rotationAngle,"Rotation Angle")) rotationAngles->SetValue(i, rotationAngle); - //st = PR.ReadInteger(PR.Current(), "Mirror Flag", mirrorFlag); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Mirror Flag", mirrorFlag)) + if (PR.ReadInteger(mirrorFlag,"Mirror Flag")) mirrorFlags->SetValue(i, mirrorFlag); - //st = PR.ReadInteger(PR.Current(), "Rotate Flag", rotateFlag); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Rotate Flag", rotateFlag)) + if (PR.ReadInteger(rotateFlag,"Rotate Flag")) rotateFlags->SetValue(i, rotateFlag); - //st = PR.ReadXYZ(PR.CurrentList(1, 3), "Start Point", startPoint); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadXYZ(PR.CurrentList(1, 3), "Start Point", startPoint)) + if (PR.ReadXYZ(startPoint,"Start Point")) startPoints->SetValue(i, startPoint); - //st = PR.ReadText(PR.Current(), "Text String", text); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadText(PR.Current(), "Text String", text)) + if (PR.ReadText("Text String", text)) texts->SetValue(i, text); } diff --git a/src/IGESDimen/IGESDimen_ToolOrdinateDimension.cxx b/src/IGESDimen/IGESDimen_ToolOrdinateDimension.cxx index 4b475950a8..d4c75e7d93 100644 --- a/src/IGESDimen/IGESDimen_ToolOrdinateDimension.cxx +++ b/src/IGESDimen/IGESDimen_ToolOrdinateDimension.cxx @@ -44,13 +44,12 @@ void IGESDimen_ToolOrdinateDimension::ReadOwnParams Handle(IGESDimen_LeaderArrow) leadArr; Standard_Boolean isLine=Standard_False; - PR.ReadEntity(IR,PR.Current(),"General Note", - STANDARD_TYPE(IGESDimen_GeneralNote),tempNote); + PR.ReadEntity(IR,"General Note",STANDARD_TYPE(IGESDimen_GeneralNote),tempNote); if (theEnt->FormNumber() == 0) { Handle(IGESData_IGESEntity) ent; - if (!PR.ReadEntity(IR,PR.Current(),"Line or Leader", ent)) { } // WARNING : Two possible Types allowed : + if (!PR.ReadEntity(IR,"Line or Leader", ent)) { } // WARNING : Two possible Types allowed : else if (ent->IsKind(STANDARD_TYPE(IGESDimen_WitnessLine))) { witLine = GetCasted(IGESDimen_WitnessLine,ent); @@ -65,10 +64,8 @@ void IGESDimen_ToolOrdinateDimension::ReadOwnParams } else { - PR.ReadEntity(IR, PR.Current(), "Line", - STANDARD_TYPE(IGESDimen_WitnessLine), witLine); - PR.ReadEntity(IR, PR.Current(), "Leader", - STANDARD_TYPE(IGESDimen_LeaderArrow), leadArr); + PR.ReadEntity(IR, "Line", STANDARD_TYPE(IGESDimen_WitnessLine), witLine); + PR.ReadEntity(IR, "Leader", STANDARD_TYPE(IGESDimen_LeaderArrow), leadArr); } DirChecker(theEnt).CheckTypeAndForm(PR.CCheck(), theEnt); diff --git a/src/IGESDimen/IGESDimen_ToolPointDimension.cxx b/src/IGESDimen/IGESDimen_ToolPointDimension.cxx index b07f744c1d..11312cae1f 100644 --- a/src/IGESDimen/IGESDimen_ToolPointDimension.cxx +++ b/src/IGESDimen/IGESDimen_ToolPointDimension.cxx @@ -42,16 +42,12 @@ void IGESDimen_ToolPointDimension::ReadOwnParams Handle(IGESDimen_GeneralNote) tempNote; Handle(IGESDimen_LeaderArrow) leadArr; Handle(IGESData_IGESEntity) tempGeom; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadEntity(IR, PR.Current(), "General Note", - STANDARD_TYPE(IGESDimen_GeneralNote), tempNote); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Leader", - STANDARD_TYPE(IGESDimen_LeaderArrow), leadArr); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "General Note", STANDARD_TYPE(IGESDimen_GeneralNote), tempNote); + PR.ReadEntity(IR, "Leader", STANDARD_TYPE(IGESDimen_LeaderArrow), leadArr); if (PR.IsParamEntity(PR.CurrentNumber())) - PR.ReadEntity(IR, PR.Current(), "Enclosing entity", tempGeom); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Enclosing entity", tempGeom); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(tempNote, leadArr, tempGeom); diff --git a/src/IGESDimen/IGESDimen_ToolRadiusDimension.cxx b/src/IGESDimen/IGESDimen_ToolRadiusDimension.cxx index 90db73774d..c2b235756b 100644 --- a/src/IGESDimen/IGESDimen_ToolRadiusDimension.cxx +++ b/src/IGESDimen/IGESDimen_ToolRadiusDimension.cxx @@ -45,19 +45,14 @@ void IGESDimen_ToolRadiusDimension::ReadOwnParams Handle(IGESDimen_LeaderArrow) leadArr; gp_XY arcCenter; Handle(IGESDimen_LeaderArrow) leadArr2; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadEntity(IR, PR.Current(), "General Note", - STANDARD_TYPE(IGESDimen_GeneralNote), tempNote); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Leader arrow", - STANDARD_TYPE(IGESDimen_LeaderArrow), leadArr); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadXY(PR.CurrentList(1, 2), "Arc center", arcCenter); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "General Note", STANDARD_TYPE(IGESDimen_GeneralNote), tempNote); + PR.ReadEntity(IR, "Leader arrow", STANDARD_TYPE(IGESDimen_LeaderArrow), leadArr); + PR.ReadXY(arcCenter,"Arc center"); if (ent->FormNumber() == 1) - PR.ReadEntity(IR, PR.Current(), "Leader arrow 2", - STANDARD_TYPE(IGESDimen_LeaderArrow), leadArr2, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Leader arrow 2", + STANDARD_TYPE(IGESDimen_LeaderArrow), leadArr2, Standard_True); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(tempNote, leadArr, arcCenter, leadArr2); diff --git a/src/IGESDimen/IGESDimen_ToolSection.cxx b/src/IGESDimen/IGESDimen_ToolSection.cxx index f0099a3a36..233ebde992 100644 --- a/src/IGESDimen/IGESDimen_ToolSection.cxx +++ b/src/IGESDimen/IGESDimen_ToolSection.cxx @@ -41,28 +41,24 @@ void IGESDimen_ToolSection::ReadOwnParams (const Handle(IGESDimen_Section)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Standard_Integer datatype; Standard_Real zDisplacement; Standard_Integer nbval; Handle(TColgp_HArray1OfXY) dataPoints; - PR.ReadInteger(PR.Current(), "Interpretation Flag", datatype); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(datatype,"Interpretation Flag"); - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of data points", nbval); + Standard_Boolean st = PR.ReadInteger(nbval,"Number of data points"); if (st && nbval > 0) dataPoints = new TColgp_HArray1OfXY(1, nbval); else PR.AddFail("Number of data points: Not Positive"); - PR.ReadReal(PR.Current(), "Common Z Displacement", zDisplacement); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(zDisplacement,"Common Z Displacement"); if (! dataPoints.IsNull()) for (Standard_Integer i = 1; i <= nbval; i++) { - gp_XY tempXY; - PR.ReadXY(PR.CurrentList(1, 2), "Data Points", tempXY); //szv#4:S4163:12Mar99 `st=` not needed - dataPoints->SetValue(i, tempXY); + PR.ReadXY(dataPoints->ChangeValue(i),"Data Points"); } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); diff --git a/src/IGESDimen/IGESDimen_ToolSectionedArea.cxx b/src/IGESDimen/IGESDimen_ToolSectionedArea.cxx index 0b64ae9799..305eb4c00b 100644 --- a/src/IGESDimen/IGESDimen_ToolSectionedArea.cxx +++ b/src/IGESDimen/IGESDimen_ToolSectionedArea.cxx @@ -47,32 +47,20 @@ void IGESDimen_ToolSectionedArea::ReadOwnParams Standard_Real tempDistance, tempAngle; Handle(IGESData_HArray1OfIGESEntity) tempIslands; Handle(IGESData_IGESEntity) anent; - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadEntity(IR, PR.Current(), "Exterior curve", extCurve, (ent->FormNumber() == 1)); - PR.ReadInteger(PR.Current(), "Fill pattern", tempPattern); - PR.ReadXYZ(PR.CurrentList(1, 3), "Passing point", passPnt); - PR.ReadReal(PR.Current(), "Distance between lines", tempDistance); + PR.ReadEntity(IR, "Exterior curve", extCurve, (ent->FormNumber() == 1)); + PR.ReadInteger(tempPattern,"Fill pattern"); + PR.ReadXYZ(passPnt,"Passing point"); + PR.ReadReal(tempDistance,"Distance between lines"); if (PR.DefinedElseSkip()) - PR.ReadReal(PR.Current(), "Angle between line and X axis", tempAngle); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(tempAngle,"Angle between line and X axis"); else tempAngle = M_PI / 4.0; - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of island curves", nbislands); + Standard_Boolean st = PR.ReadInteger(nbislands,"Number of island curves"); if (st && nbislands > 0) - PR.ReadEnts (IR,PR.CurrentList(nbislands),"Island curves",tempIslands); //szv#4:S4163:12Mar99 `st=` not needed -/* - { - tempIslands = new IGESData_HArray1OfIGESEntity(1, nbislands); - for (Standard_Integer i=1; i<=nbislands; i++) - { - st = PR.ReadEntity(IR, PR.Current(), "Island curves", anent); - if (st) tempIslands->SetValue(i, anent); - } - } -*/ + PR.ReadEnts (IR,PR.CurrentList(nbislands),"Island curves",tempIslands); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init diff --git a/src/IGESDimen/IGESDimen_ToolWitnessLine.cxx b/src/IGESDimen/IGESDimen_ToolWitnessLine.cxx index c68e76b203..fd9f62c280 100644 --- a/src/IGESDimen/IGESDimen_ToolWitnessLine.cxx +++ b/src/IGESDimen/IGESDimen_ToolWitnessLine.cxx @@ -41,28 +41,24 @@ void IGESDimen_ToolWitnessLine::ReadOwnParams (const Handle(IGESDimen_WitnessLine)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Standard_Integer datatype; Standard_Real zDisplacement; Standard_Integer nbval; Handle(TColgp_HArray1OfXY) dataPoints; - PR.ReadInteger(PR.Current(), "Interpretation Flag", datatype); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(datatype,"Interpretation Flag"); - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of data points", nbval); + Standard_Boolean st = PR.ReadInteger(nbval,"Number of data points"); if (st && nbval > 0) dataPoints = new TColgp_HArray1OfXY(1, nbval); else PR.AddFail("Number of data points: Not Positive"); - PR.ReadReal(PR.Current(), "Common Z Displacement", zDisplacement); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(zDisplacement,"Common Z Displacement"); if (! dataPoints.IsNull()) for (Standard_Integer i = 1; i <= nbval; i++) { - gp_XY tempXY; - PR.ReadXY(PR.CurrentList(1, 2), "Data Points", tempXY); //szv#4:S4163:12Mar99 `st=` not needed - dataPoints->SetValue(i, tempXY); + PR.ReadXY(dataPoints->ChangeValue(i),"Data Points"); } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); diff --git a/src/IGESDraw/FILES b/src/IGESDraw/FILES index edce766753..d849b32027 100644 --- a/src/IGESDraw/FILES +++ b/src/IGESDraw/FILES @@ -26,38 +26,10 @@ IGESDraw_Planar.cxx IGESDraw_Planar.hxx IGESDraw_Protocol.cxx IGESDraw_Protocol.hxx -IGESDraw_ReadWriteModule.cxx -IGESDraw_ReadWriteModule.hxx IGESDraw_RectArraySubfigure.cxx IGESDraw_RectArraySubfigure.hxx IGESDraw_SegmentedViewsVisible.cxx IGESDraw_SegmentedViewsVisible.hxx -IGESDraw_SpecificModule.cxx -IGESDraw_SpecificModule.hxx -IGESDraw_ToolCircArraySubfigure.cxx -IGESDraw_ToolCircArraySubfigure.hxx -IGESDraw_ToolConnectPoint.cxx -IGESDraw_ToolConnectPoint.hxx -IGESDraw_ToolDrawing.cxx -IGESDraw_ToolDrawing.hxx -IGESDraw_ToolDrawingWithRotation.cxx -IGESDraw_ToolDrawingWithRotation.hxx -IGESDraw_ToolLabelDisplay.cxx -IGESDraw_ToolLabelDisplay.hxx -IGESDraw_ToolNetworkSubfigure.cxx -IGESDraw_ToolNetworkSubfigure.hxx -IGESDraw_ToolNetworkSubfigureDef.cxx -IGESDraw_ToolNetworkSubfigureDef.hxx -IGESDraw_ToolPerspectiveView.cxx -IGESDraw_ToolPerspectiveView.hxx -IGESDraw_ToolPlanar.cxx -IGESDraw_ToolPlanar.hxx -IGESDraw_ToolRectArraySubfigure.cxx -IGESDraw_ToolRectArraySubfigure.hxx -IGESDraw_ToolSegmentedViewsVisible.cxx -IGESDraw_ToolSegmentedViewsVisible.hxx -IGESDraw_ToolView.cxx -IGESDraw_ToolView.hxx IGESDraw_ToolViewsVisible.cxx IGESDraw_ToolViewsVisible.hxx IGESDraw_ToolViewsVisibleWithAttr.cxx diff --git a/src/IGESDraw/IGESDraw.cxx b/src/IGESDraw/IGESDraw.cxx index 9e2bb6b93e..d3d665da84 100644 --- a/src/IGESDraw/IGESDraw.cxx +++ b/src/IGESDraw/IGESDraw.cxx @@ -12,16 +12,11 @@ // commercial license or contractual agreement. -#include -#include #include #include #include #include -#include -#include #include -#include /*void IGESDraw::Init () @@ -36,9 +31,6 @@ const Handle(IGESDraw_Protocol) & IGESDraw::Protocol () if (protocol.IsNull()) { protocol = new IGESDraw_Protocol; Interface_GeneralLib::SetGlobal (new IGESDraw_GeneralModule, protocol); - Interface_ReaderLib::SetGlobal (new IGESDraw_ReadWriteModule,protocol); - IGESData_WriterLib::SetGlobal (new IGESDraw_ReadWriteModule,protocol); - IGESData_SpecificLib::SetGlobal (new IGESDraw_SpecificModule, protocol); } return protocol; } diff --git a/src/IGESDraw/IGESDraw_Array1OfConnectPoint.hxx b/src/IGESDraw/IGESDraw_Array1OfConnectPoint.hxx index 6344a91450..c6e35e9322 100644 --- a/src/IGESDraw/IGESDraw_Array1OfConnectPoint.hxx +++ b/src/IGESDraw/IGESDraw_Array1OfConnectPoint.hxx @@ -17,10 +17,10 @@ #ifndef IGESDraw_Array1OfConnectPoint_HeaderFile #define IGESDraw_Array1OfConnectPoint_HeaderFile +#include #include #include -typedef NCollection_Array1 IGESDraw_Array1OfConnectPoint; - +typedef NCollection_Array1> IGESDraw_Array1OfConnectPoint; #endif diff --git a/src/IGESDraw/IGESDraw_Array1OfViewKindEntity.hxx b/src/IGESDraw/IGESDraw_Array1OfViewKindEntity.hxx index a6e6f7b35c..a64b4d34ae 100644 --- a/src/IGESDraw/IGESDraw_Array1OfViewKindEntity.hxx +++ b/src/IGESDraw/IGESDraw_Array1OfViewKindEntity.hxx @@ -17,10 +17,10 @@ #ifndef IGESDraw_Array1OfViewKindEntity_HeaderFile #define IGESDraw_Array1OfViewKindEntity_HeaderFile -#include +#include #include +#include -typedef NCollection_Array1 IGESDraw_Array1OfViewKindEntity; - +typedef NCollection_Array1> IGESDraw_Array1OfViewKindEntity; #endif diff --git a/src/IGESDraw/IGESDraw_CircArraySubfigure.cxx b/src/IGESDraw/IGESDraw_CircArraySubfigure.cxx index e57bcbc060..36d3e2598a 100644 --- a/src/IGESDraw/IGESDraw_CircArraySubfigure.cxx +++ b/src/IGESDraw/IGESDraw_CircArraySubfigure.cxx @@ -18,123 +18,129 @@ #include #include -#include -#include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_CircArraySubfigure,IGESData_IGESEntity) -IGESDraw_CircArraySubfigure::IGESDraw_CircArraySubfigure () { } - - - void IGESDraw_CircArraySubfigure::Init - (const Handle(IGESData_IGESEntity)& aBase, - const Standard_Integer aNumLocs, - const gp_XYZ& aCenter, - const Standard_Real aRadius, - const Standard_Real aStAngle, - const Standard_Real aDelAngle, - const Standard_Integer aFlag, - const Handle(TColStd_HArray1OfInteger)& allNumPos) -{ - if (!allNumPos.IsNull()) - if (allNumPos->Lower() != 1) - Standard_DimensionMismatch::Raise("IGESDraw_CircArraySubfigure : Init"); - theBaseEntity = aBase; - theNbLocations = aNumLocs; - theCenter = aCenter; - theRadius = aRadius; - theStartAngle = aStAngle; - theDeltaAngle = aDelAngle; - theDoDontFlag = aFlag != 0; - thePositions = allNumPos; - InitTypeAndForm(414,0); -} - - Handle(IGESData_IGESEntity) IGESDraw_CircArraySubfigure::BaseEntity () const -{ - return theBaseEntity; -} - - Standard_Integer IGESDraw_CircArraySubfigure::NbLocations () const -{ - return theNbLocations; -} - - gp_Pnt IGESDraw_CircArraySubfigure::CenterPoint () const +gp_Pnt IGESDraw_CircArraySubfigure::CenterPoint () const { - gp_Pnt tempCenterPoint(theCenter); + gp_Pnt tempCenterPoint(myCenter); return tempCenterPoint; } - gp_Pnt IGESDraw_CircArraySubfigure::TransformedCenterPoint () const +gp_Pnt IGESDraw_CircArraySubfigure::TransformedCenterPoint () const { - gp_XYZ tempCenterPoint = theCenter; + gp_XYZ tempCenterPoint = myCenter; if (HasTransf()) Location().Transforms(tempCenterPoint); gp_Pnt tempRes(tempCenterPoint); return tempRes; } - Standard_Real IGESDraw_CircArraySubfigure::CircleRadius () const +Standard_Integer IGESDraw_CircArraySubfigure::ListCount () const { - return theRadius; + return ( myPositions.IsNull() ? 0 : myPositions->Length() ); } - Standard_Real IGESDraw_CircArraySubfigure::StartAngle () const +Standard_Boolean IGESDraw_CircArraySubfigure::PositionNum (const Standard_Integer Index) const { - return theStartAngle; -} + // Method : If myPositions array length is Zero return myDoDontFlag; + // else Search Index in to the Array. If 'Index' found in the + // array return myDoDontFlag else return !myDoDontFlag. - Standard_Real IGESDraw_CircArraySubfigure::DeltaAngle () const -{ - return theDeltaAngle; + if (myPositions.IsNull()) + return (myDoDontFlag != 0); + + const Standard_Integer up = myPositions->Upper(); + for (Standard_Integer i = 1; i <= up; i++) + if (myPositions->Value(i) == Index) + return (myDoDontFlag != 0); + + return (myDoDontFlag == 0); } - Standard_Boolean IGESDraw_CircArraySubfigure::DisplayFlag () const +Standard_Integer IGESDraw_CircArraySubfigure::ListPosition (const Standard_Integer Index) const { - return (thePositions.IsNull()); - // if LC == 0 then there is no allocation made for thePositions array - // i.e., thePositions == Null Handle + return myPositions->Value(Index); + // raise OutOfRange from Standard if Index is out-of-bound + // Exception NoSuchObject will be raised if myPositions == Null Handle } - Standard_Integer IGESDraw_CircArraySubfigure::ListCount () const +void IGESDraw_CircArraySubfigure::OwnRead (IGESFile_Reader &theReader) { - return ( thePositions.IsNull() ? 0 : thePositions->Length() ); - // Return 0 if HArray1 thePositions is NULL Handle + theReader.ReadPointer(myBaseEntity,"Base Entity"); + theReader.ReadInteger(myNbLocations,"Number Of Instance Locations"); + theReader.ReadXYZ(myCenter,"Imaginary Circle Center Coordinate"); + theReader.ReadReal(myRadius,"Radius Of Imaginary Circle"); + theReader.ReadReal(myStartAngle,"Start Angle in Radians"); + theReader.ReadReal(myDeltaAngle,"Delta Angle in Radians"); + + Standard_Integer tempListCount = 0; + theReader.ReadInteger(tempListCount,"DO-DONT List Count"); + if (tempListCount > 0) + myPositions = new TColStd_HArray1OfInteger(1, tempListCount); + else if (tempListCount < 0) + theReader.AddFail("DO-DONT List Count : Less than Zero"); + + theReader.ReadInteger(myDoDontFlag,"DO-DONT Flag"); + + // Read the HArray1 only if its Length was read without any Error + if (tempListCount > 0) { + for (Standard_Integer i = 1; i <= tempListCount; i++) + theReader.ReadInteger(myPositions->ChangeValue(i),"Number Of Position To Process"); + } } - Standard_Boolean IGESDraw_CircArraySubfigure::DoDontFlag () const +void IGESDraw_CircArraySubfigure::OwnWrite (IGESData_IGESWriter &IW) const { - return theDoDontFlag; + IW.Send(myBaseEntity); + IW.Send(myNbLocations); + IW.Send(myCenter.X()); + IW.Send(myCenter.Y()); + IW.Send(myCenter.Z()); + IW.Send(myRadius); + IW.Send(myStartAngle); + IW.Send(myDeltaAngle); + const Standard_Integer up = ListCount(); + IW.Send(up); + IW.SendBoolean(DoDontFlag()); + // Send the HArray1 only if it is not empty (i.e. Null) + for (Standard_Integer i = 1; i <= up; i++) + IW.Send(ListPosition(i)); } - Standard_Boolean IGESDraw_CircArraySubfigure::PositionNum - (const Standard_Integer Index) const +IGESData_DirChecker IGESDraw_CircArraySubfigure::DirChecker () const { - // Method : If thePositions array length is Zero return theDoDontFlag; - // else Search Index in to the Array. If 'Index' found in the - // array return theDoDontFlag else return !theDoDontFlag. - - if (thePositions.IsNull()) return theDoDontFlag; - - else { - Standard_Integer I; - Standard_Integer up = thePositions->Upper(); - for (I = 1; I <= up; I ++) { - if (thePositions->Value(I) == Index) return theDoDontFlag; - } - return (! theDoDontFlag); - } + IGESData_DirChecker DC(414, 0); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefAny); + DC.LineWeight(IGESData_DefValue); + DC.Color(IGESData_DefAny); + DC.GraphicsIgnored(1); + return DC; } - Standard_Integer IGESDraw_CircArraySubfigure::ListPosition - (const Standard_Integer Index) const +void IGESDraw_CircArraySubfigure::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const { - return thePositions->Value(Index); - // raise OutOfRange from Standard if Index is out-of-bound - // Exception NoSuchObject will be raised if thePositions == Null Handle + const Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1; + S << "IGESDraw_CircArraySubfigure" << endl; + S << "Base Entity : "; + dumper.Dump(myBaseEntity,S,tempSubLevel); + S << endl; + S << "Total Number Of Possible Instance Locations : " << myNbLocations << endl; + S << "Imaginary Circle. Radius : " << myRadius << " Center : "; + IGESData_DumpXYZL(S,level,myCenter,Location()); S << endl; + S << "Start Angle (in radians) : " << myStartAngle << " "; + S << "Delta Angle (in radians) : " << myDeltaAngle << endl; + S << "Do-Dont Flag : "; + S << (DoDontFlag()? "Dont" : "Do") << endl; + S << "The Do-Dont List : "; + IGESData_DumpVals(S,level,1,ListCount(),ListPosition); + S << endl; } diff --git a/src/IGESDraw/IGESDraw_CircArraySubfigure.hxx b/src/IGESDraw/IGESDraw_CircArraySubfigure.hxx index 80cf0a2d58..92a3f1ccb8 100644 --- a/src/IGESDraw/IGESDraw_CircArraySubfigure.hxx +++ b/src/IGESDraw/IGESDraw_CircArraySubfigure.hxx @@ -17,23 +17,10 @@ #ifndef _IGESDraw_CircArraySubfigure_HeaderFile #define _IGESDraw_CircArraySubfigure_HeaderFile -#include -#include - -#include -#include -#include -#include #include -#include -class IGESData_IGESEntity; -class Standard_OutOfRange; -class gp_XYZ; -class gp_Pnt; - +#include +class TColStd_HArray1OfInteger; -class IGESDraw_CircArraySubfigure; -DEFINE_STANDARD_HANDLE(IGESDraw_CircArraySubfigure, IGESData_IGESEntity) //! Defines IGES Circular Array Subfigure Instance Entity, //! Type <414> Form Number <0> in package IGESDraw @@ -43,31 +30,20 @@ DEFINE_STANDARD_HANDLE(IGESDraw_CircArraySubfigure, IGESData_IGESEntity) //! whose center and radius are specified class IGESDraw_CircArraySubfigure : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 414; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 0; } + + IGESDraw_CircArraySubfigure() {} - - Standard_EXPORT IGESDraw_CircArraySubfigure(); - - //! This method is used to set the fields of the class - //! CircArraySubfigure - //! - aBase : Base entity - //! - aNumLocs : Total number of possible instance locations - //! - aCenter : Coordinates of Center of imaginary circle - //! - aRadius : Radius of imaginary circle - //! - aStAngle : Start angle in radians - //! - aDelAngle : Delta angle in radians - //! - aFlag : DO-DON'T flag to control which portion to - //! display - //! - allNumPos : All position to be or not to be processed - Standard_EXPORT void Init (const Handle(IGESData_IGESEntity)& aBase, const Standard_Integer aNumLocs, const gp_XYZ& aCenter, const Standard_Real aRadius, const Standard_Real aStAngle, const Standard_Real aDelAngle, const Standard_Integer aFlag, const Handle(TColStd_HArray1OfInteger)& allNumPos); - //! returns the base entity, copies of which are produced - Standard_EXPORT Handle(IGESData_IGESEntity) BaseEntity() const; - + const Handle(IGESData_IGESEntity) & BaseEntity() const { return myBaseEntity; } + //! returns total number of possible instance locations - Standard_EXPORT Standard_Integer NbLocations() const; - + Standard_Integer NbLocations() const { return myNbLocations; } + //! returns the center of the imaginary circle Standard_EXPORT gp_Pnt CenterPoint() const; @@ -75,24 +51,29 @@ public: Standard_EXPORT gp_Pnt TransformedCenterPoint() const; //! returns the radius of the imaginary circle - Standard_EXPORT Standard_Real CircleRadius() const; - + Standard_Real CircleRadius() const { return myRadius; } + //! returns the start angle in radians - Standard_EXPORT Standard_Real StartAngle() const; - + Standard_Real StartAngle() const { return myStartAngle; } + //! returns the delta angle in radians - Standard_EXPORT Standard_Real DeltaAngle() const; - + Standard_Real DeltaAngle() const { return myDeltaAngle; } + //! returns 0 if all elements to be displayed Standard_EXPORT Standard_Integer ListCount() const; //! returns True if (ListCount = 0) all elements are to be displayed - Standard_EXPORT Standard_Boolean DisplayFlag() const; - + Standard_Boolean DisplayFlag() const + { + return (myPositions.IsNull()); + // if LC == 0 then there is no allocation made for thePositions array + // i.e., thePositions == Null Handle + } + //! returns 0 if half or fewer of the elements of the array are defined //! 1 if half or more of the elements are defined - Standard_EXPORT Standard_Boolean DoDontFlag() const; - + Standard_Boolean DoDontFlag() const { return (myDoDontFlag != 0); } + //! returns whether Index is to be processed (DO) //! or not to be processed(DON'T) //! if (ListCount = 0) return theDoDontFlag @@ -103,35 +84,26 @@ public: //! raises exception if Index <= 0 or Index > ListCount(). Standard_EXPORT Standard_Integer ListPosition (const Standard_Integer Index) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; - + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESDraw_CircArraySubfigure,IGESData_IGESEntity) -protected: - - - - -private: - - - Handle(IGESData_IGESEntity) theBaseEntity; - Standard_Integer theNbLocations; - gp_XYZ theCenter; - Standard_Real theRadius; - Standard_Real theStartAngle; - Standard_Real theDeltaAngle; - Standard_Boolean theDoDontFlag; - Handle(TColStd_HArray1OfInteger) thePositions; - + private: + Interface_Pointer myBaseEntity; + Standard_Integer myNbLocations; + gp_XYZ myCenter; + Standard_Real myRadius; + Standard_Real myStartAngle; + Standard_Real myDeltaAngle; + Standard_Integer myDoDontFlag; + Handle(TColStd_HArray1OfInteger) myPositions; }; - - - - - - #endif // _IGESDraw_CircArraySubfigure_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ConnectPoint.cxx b/src/IGESDraw/IGESDraw_ConnectPoint.cxx index 138a5922b8..b3d7b27f37 100644 --- a/src/IGESDraw/IGESDraw_ConnectPoint.cxx +++ b/src/IGESDraw/IGESDraw_ConnectPoint.cxx @@ -18,54 +18,26 @@ #include #include -#include -#include #include #include -#include #include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_ConnectPoint,IGESData_IGESEntity) -IGESDraw_ConnectPoint::IGESDraw_ConnectPoint () { } - - - void IGESDraw_ConnectPoint::Init - (const gp_XYZ& aPoint, - const Handle(IGESData_IGESEntity)& aDisplaySymbol, - const Standard_Integer aTypeFlag, - const Standard_Integer aFunctionFlag, - const Handle(TCollection_HAsciiString)& aFunctionIdentifier, - const Handle(IGESGraph_TextDisplayTemplate)& anIdentifierTemplate, - const Handle(TCollection_HAsciiString)& aFunctionName, - const Handle(IGESGraph_TextDisplayTemplate)& aFunctionTemplate, - const Standard_Integer aPointIdentifier, - const Standard_Integer aFunctionCode, - const Standard_Integer aSwapFlag, - const Handle(IGESData_IGESEntity)& anOwnerSubfigure) -{ - thePoint = aPoint; - theDisplaySymbol = aDisplaySymbol; - theTypeFlag = aTypeFlag; - theFunctionFlag = aFunctionFlag; - theFunctionIdentifier = aFunctionIdentifier; - theIdentifierTemplate = anIdentifierTemplate; - theFunctionName = aFunctionName; - theFunctionTemplate = aFunctionTemplate; - thePointIdentifier = aPointIdentifier; - theFunctionCode = aFunctionCode; - theSwapFlag = aSwapFlag != 0; - theOwnerSubfigure = anOwnerSubfigure; - InitTypeAndForm(132,0); -} - - gp_Pnt IGESDraw_ConnectPoint::Point () const +gp_Pnt IGESDraw_ConnectPoint::Point () const { gp_Pnt tempPoint(thePoint); return tempPoint; } - gp_Pnt IGESDraw_ConnectPoint::TransformedPoint () const +gp_Pnt IGESDraw_ConnectPoint::TransformedPoint () const { gp_XYZ tempPoint = thePoint; if (HasTransf()) Location().Transforms(tempPoint); @@ -74,80 +46,117 @@ IGESDraw_ConnectPoint::IGESDraw_ConnectPoint () { } return (tempRes); } - Standard_Boolean IGESDraw_ConnectPoint::HasDisplaySymbol () const -{ - return (! theDisplaySymbol.IsNull()); -} - - Handle(IGESData_IGESEntity) IGESDraw_ConnectPoint::DisplaySymbol () const -{ - return theDisplaySymbol; -} - - Standard_Integer IGESDraw_ConnectPoint::TypeFlag () const -{ - return theTypeFlag; -} - - Standard_Integer IGESDraw_ConnectPoint::FunctionFlag () const -{ - return theFunctionFlag; -} - - Handle(TCollection_HAsciiString) IGESDraw_ConnectPoint::FunctionIdentifier - () const -{ - return theFunctionIdentifier; -} - - Standard_Boolean IGESDraw_ConnectPoint::HasIdentifierTemplate () const -{ - return (! theIdentifierTemplate.IsNull()); -} - - Handle(IGESGraph_TextDisplayTemplate) - IGESDraw_ConnectPoint::IdentifierTemplate () const -{ - return theIdentifierTemplate; -} - - Handle(TCollection_HAsciiString) IGESDraw_ConnectPoint::FunctionName () const -{ - return theFunctionName; -} - - Standard_Boolean IGESDraw_ConnectPoint::HasFunctionTemplate () const -{ - return (! theFunctionTemplate.IsNull()); -} - - Handle(IGESGraph_TextDisplayTemplate) - IGESDraw_ConnectPoint::FunctionTemplate () const -{ - return theFunctionTemplate; -} - - Standard_Integer IGESDraw_ConnectPoint::PointIdentifier () const -{ - return thePointIdentifier; -} - - Standard_Integer IGESDraw_ConnectPoint::FunctionCode () const -{ - return theFunctionCode; -} - - Standard_Boolean IGESDraw_ConnectPoint::SwapFlag () const -{ - return theSwapFlag; -} - - Standard_Boolean IGESDraw_ConnectPoint::HasOwnerSubfigure () const -{ - return (! theOwnerSubfigure.IsNull()); -} - - Handle(IGESData_IGESEntity) IGESDraw_ConnectPoint::OwnerSubfigure () const -{ - return theOwnerSubfigure; +void IGESDraw_ConnectPoint::OwnRead (IGESFile_Reader &PR) +{ + Handle(IGESData_IGESEntity) tempOwnerSubfigure; + + PR.ReadXYZ(thePoint,"Connect Point Coordinate"); + PR.ReadPointer(theDisplaySymbol,"Display Symbol Geometry Entity",Standard_True); + PR.ReadInteger(theTypeFlag,"Type Flag"); + PR.ReadInteger(theFunctionFlag,"Function Flag"); + PR.ReadText(theFunctionIdentifier,"Function Identifier"); + PR.ReadPointer(theIdentifierTemplate,"Text Display Identifier Template",Standard_True); + PR.ReadText(theFunctionName,"Connect Point Function Name"); + PR.ReadPointer(theFunctionTemplate,"Text Display Function Template",Standard_True); + PR.ReadInteger(thePointIdentifier,"Unique Connect Point Identifier"); + PR.ReadInteger(theFunctionCode,"Connect Point Function Code"); + + theSwapFlag = 0; // default + PR.ReadInteger(theSwapFlag,"Swap Flag"); + + PR.ReadPointer(theOwnerSubfigure,"Owner Network Subfigure Entity",Standard_True); +} + +void IGESDraw_ConnectPoint::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(thePoint.X()); + IW.Send(thePoint.Y()); + IW.Send(thePoint.Z()); + IW.Send(theDisplaySymbol); + IW.Send(theTypeFlag); + IW.Send(theFunctionFlag); + IW.Send(theFunctionIdentifier); + IW.Send(theIdentifierTemplate); + IW.Send(theFunctionName); + IW.Send(theFunctionTemplate); + IW.Send(thePointIdentifier); + IW.Send(theFunctionCode); + IW.SendBoolean(SwapFlag()); + IW.Send(theOwnerSubfigure); +} + +void IGESDraw_ConnectPoint::OwnShared (Interface_EntityIterator &theIter) const +{ + theIter.GetOneItem(theDisplaySymbol); + theIter.GetOneItem(theIdentifierTemplate); + theIter.GetOneItem(theFunctionTemplate); + theIter.GetOneItem(theOwnerSubfigure); +} + +IGESData_DirChecker IGESDraw_ConnectPoint::DirChecker () const +{ + IGESData_DirChecker DC(132, 0); + DC.Structure(IGESData_DefVoid); + DC.Color(IGESData_DefAny); + DC.UseFlagRequired(4); + if (!theDisplaySymbol.IsNull()) { + DC.LineFont(IGESData_DefAny); + DC.LineWeight(IGESData_DefAny); + } + else { + // Note : If ent->DisplaySymbol() is NULL Handle; ignore Line Font, Weight + // and Hierarchy Status + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.HierarchyStatusIgnored(); + } + return DC; +} + +void IGESDraw_ConnectPoint::OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &ach) const +{ + if ((theTypeFlag < 0) || (theTypeFlag > 9999) || + ((theTypeFlag > 2) && (theTypeFlag < 101)) || + ((theTypeFlag > 104) && (theTypeFlag < 201)) || + ((theTypeFlag > 203) && (theTypeFlag < 5001))) + ach->AddFail("TypeFlag has Invalid value"); + + if ((theFunctionFlag < 0) || (theFunctionFlag > 2)) + ach->AddFail("FunctionFlag has Invalid value"); + + if ((theFunctionCode < 0) || (theFunctionCode > 9999) || + ((theFunctionCode > 49) && (theFunctionCode < 98)) || + ((theFunctionCode > 99) && (theFunctionCode < 5001))) + ach->AddFail("FunctionCode has Invalid value"); + + if ((theSwapFlag != 0) && (theSwapFlag != 1)) + ach->AddFail("SwapFlag has Invalid value"); +} + +void IGESDraw_ConnectPoint::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + const Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1; + S << "IGESDraw_ConnectPoint" << endl; + S << "Connection Point Coordinate : "; + IGESData_DumpXYZL(S,level,thePoint,Location()); + S << "Display Symbol Geometry Entity : "; + dumper.Dump(theDisplaySymbol,S,tempSubLevel); + S << endl; + S << "Type Flag : " << theTypeFlag << " " + << "Function Flag : " << theFunctionFlag << endl; + S << "Function Identifier : "; + IGESData_DumpString(S,theFunctionIdentifier); + S << endl << "Text Display Template Entity for CID : "; + dumper.Dump(theIdentifierTemplate,S,tempSubLevel); + S << endl << "Function Name : "; + IGESData_DumpString(S,theFunctionName); + S << endl << "Text Display Template Entity for CFN : "; + dumper.Dump(theFunctionTemplate,S,tempSubLevel); + S << endl; + S << "Point Identifier : " << thePointIdentifier << endl + << "Function Code : " << theFunctionCode + << "Swap Flag : " << ( SwapFlag() ? "True" : "False" ) << endl; + S << "Owner Subfigure Entity : "; + dumper.Dump(theOwnerSubfigure,S,tempSubLevel); + S << endl; } diff --git a/src/IGESDraw/IGESDraw_ConnectPoint.hxx b/src/IGESDraw/IGESDraw_ConnectPoint.hxx index f28547f4f3..5af6d18f4d 100644 --- a/src/IGESDraw/IGESDraw_ConnectPoint.hxx +++ b/src/IGESDraw/IGESDraw_ConnectPoint.hxx @@ -17,23 +17,13 @@ #ifndef _IGESDraw_ConnectPoint_HeaderFile #define _IGESDraw_ConnectPoint_HeaderFile -#include -#include - -#include -#include #include -#include -class IGESData_IGESEntity; +#include class TCollection_HAsciiString; class IGESGraph_TextDisplayTemplate; -class gp_XYZ; class gp_Pnt; -class IGESDraw_ConnectPoint; -DEFINE_STANDARD_HANDLE(IGESDraw_ConnectPoint, IGESData_IGESEntity) - //! defines IGESConnectPoint, Type <132> Form Number <0> //! in package IGESDraw //! @@ -43,27 +33,13 @@ DEFINE_STANDARD_HANDLE(IGESDraw_ConnectPoint, IGESData_IGESEntity) //! Associative Instance, or it may stand alone. class IGESDraw_ConnectPoint : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 132; } - - Standard_EXPORT IGESDraw_ConnectPoint(); - - //! This method is used to set the fields of the class - //! ConnectPoint - //! - aPoint : A Coordinate point - //! - aDisplaySymbol : Display symbol Geometry - //! - aTypeFlag : Type of the connection - //! - aFunctionFlag : Function flag for the connection - //! - aFunctionIdentifier : Connection Point Function Identifier - //! - anIdentifierTemplate : Connection Point Function Template - //! - aFunctionName : Connection Point Function Name - //! - aFunctionTemplate : Connection Point Function Template - //! - aPointIdentifier : Unique Connect Point Identifier - //! - aFunctionCode : Connect Point Function Code - //! - aSwapFlag : Connect Point Swap Flag - //! - anOwnerSubfigure : Pointer to the "Owner" Entity - Standard_EXPORT void Init (const gp_XYZ& aPoint, const Handle(IGESData_IGESEntity)& aDisplaySymbol, const Standard_Integer aTypeFlag, const Standard_Integer aFunctionFlag, const Handle(TCollection_HAsciiString)& aFunctionIdentifier, const Handle(IGESGraph_TextDisplayTemplate)& anIdentifierTemplate, const Handle(TCollection_HAsciiString)& aFunctionName, const Handle(IGESGraph_TextDisplayTemplate)& aFunctionTemplate, const Standard_Integer aPointIdentifier, const Standard_Integer aFunctionCode, const Standard_Integer aSwapFlag, const Handle(IGESData_IGESEntity)& anOwnerSubfigure); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 0; } + + IGESDraw_ConnectPoint() {} //! returns the coordinate of the connection point Standard_EXPORT gp_Pnt Point() const; @@ -73,12 +49,12 @@ public: //! returns True if Display symbol is specified //! else returns False - Standard_EXPORT Standard_Boolean HasDisplaySymbol() const; - + Standard_Boolean HasDisplaySymbol() const { return (! theDisplaySymbol.IsNull()); } + //! if display symbol specified returns display symbol geometric entity //! else returns NULL Handle - Standard_EXPORT Handle(IGESData_IGESEntity) DisplaySymbol() const; - + const Handle(IGESData_IGESEntity) & DisplaySymbol() const { return theDisplaySymbol; } + //! return value specifies a particular type of connection : //! Type Flag = 0 : Not Specified(default) //! 1 : Nonspecific logical point of connection @@ -91,91 +67,86 @@ public: //! 202 : Physical PWA blind pin //! 203 : Physical PWA thru-pin //! 5001-9999 : Implementor defined. - Standard_EXPORT Standard_Integer TypeFlag() const; - + Standard_Integer TypeFlag() const { return theTypeFlag; } + //! returns Function Code that specifies a particular function for the //! ECO576 connection : //! e.g., Function Flag = 0 : Unspecified(default) //! = 1 : Electrical Signal //! = 2 : Fluid flow Signal - Standard_EXPORT Standard_Integer FunctionFlag() const; - + Standard_Integer FunctionFlag() const { return theFunctionFlag; } + //! return HAsciiString identifying Pin Number or Nozzle Label etc. - Standard_EXPORT Handle(TCollection_HAsciiString) FunctionIdentifier() const; - + const Handle(TCollection_HAsciiString) & FunctionIdentifier() const { return theFunctionIdentifier; } + //! returns True if Text Display Template is specified for Identifier //! else returns False - Standard_EXPORT Standard_Boolean HasIdentifierTemplate() const; - + Standard_Boolean HasIdentifierTemplate() const { return (! theIdentifierTemplate.IsNull()); } + //! if Text Display Template for the Function Identifier is defined, //! returns TestDisplayTemplate //! else returns NULL Handle - Standard_EXPORT Handle(IGESGraph_TextDisplayTemplate) IdentifierTemplate() const; - + const Handle(IGESGraph_TextDisplayTemplate) & IdentifierTemplate() const { return theIdentifierTemplate; } + //! returns Connection Point Function Name - Standard_EXPORT Handle(TCollection_HAsciiString) FunctionName() const; - + const Handle(TCollection_HAsciiString) & FunctionName() const { return theFunctionName; } + //! returns True if Text Display Template is specified for Function Name //! else returns False - Standard_EXPORT Standard_Boolean HasFunctionTemplate() const; - + Standard_Boolean HasFunctionTemplate() const { return (! theFunctionTemplate.IsNull()); } + //! if Text Display Template for the Function Name is defined, //! returns TestDisplayTemplate //! else returns NULL Handle - Standard_EXPORT Handle(IGESGraph_TextDisplayTemplate) FunctionTemplate() const; - + const Handle(IGESGraph_TextDisplayTemplate) & FunctionTemplate() const { return theFunctionTemplate; } + //! returns the Unique Connect Point Identifier - Standard_EXPORT Standard_Integer PointIdentifier() const; - + Standard_Integer PointIdentifier() const { return thePointIdentifier; } + //! returns the Connect Point Function Code - Standard_EXPORT Standard_Integer FunctionCode() const; - + Standard_Integer FunctionCode() const { return theFunctionCode; } + //! return value = 0 : Connect point may be swapped(default) //! = 1 : Connect point may not be swapped - Standard_EXPORT Standard_Boolean SwapFlag() const; - + Standard_Boolean SwapFlag() const { return (theSwapFlag != 0); } + //! returns True if Network Subfigure Instance/Definition Entity //! is specified //! else returns False - Standard_EXPORT Standard_Boolean HasOwnerSubfigure() const; - + Standard_Boolean HasOwnerSubfigure() const { return (! theOwnerSubfigure.IsNull()); } + //! returns "owner" Network Subfigure Instance Entity, //! or Network Subfigure Definition Entity, or NULL Handle. - Standard_EXPORT Handle(IGESData_IGESEntity) OwnerSubfigure() const; - - + const Handle(IGESData_IGESEntity) & OwnerSubfigure() const { return theOwnerSubfigure; } + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESDraw_ConnectPoint,IGESData_IGESEntity) - -protected: + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; -private: + DEFINE_STANDARD_RTTIEXT(IGESDraw_ConnectPoint,IGESData_IGESEntity) + private: gp_XYZ thePoint; - Handle(IGESData_IGESEntity) theDisplaySymbol; + Interface_Pointer theDisplaySymbol; Standard_Integer theTypeFlag; Standard_Integer theFunctionFlag; Handle(TCollection_HAsciiString) theFunctionIdentifier; - Handle(IGESGraph_TextDisplayTemplate) theIdentifierTemplate; + Interface_Pointer theIdentifierTemplate; Handle(TCollection_HAsciiString) theFunctionName; - Handle(IGESGraph_TextDisplayTemplate) theFunctionTemplate; + Interface_Pointer theFunctionTemplate; Standard_Integer thePointIdentifier; Standard_Integer theFunctionCode; - Standard_Boolean theSwapFlag; - Handle(IGESData_IGESEntity) theOwnerSubfigure; - - + Standard_Integer theSwapFlag; + Interface_Pointer theOwnerSubfigure; }; - - - - - - #endif // _IGESDraw_ConnectPoint_HeaderFile diff --git a/src/IGESDraw/IGESDraw_Drawing.cxx b/src/IGESDraw/IGESDraw_Drawing.cxx index dcf1cd64f4..92cd893e2c 100644 --- a/src/IGESDraw/IGESDraw_Drawing.cxx +++ b/src/IGESDraw/IGESDraw_Drawing.cxx @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -27,66 +26,42 @@ #include #include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_Drawing,IGESData_IGESEntity) -IGESDraw_Drawing::IGESDraw_Drawing () { } - - - void IGESDraw_Drawing::Init - (const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews, - const Handle(TColgp_HArray1OfXY)& allViewOrigins, - const Handle(IGESData_HArray1OfIGESEntity)& allAnnotations) -{ - if (!allViews.IsNull()) { - Standard_Integer Len = allViews->Length(); - Standard_Boolean Flag = ( allViewOrigins->Length() == Len ); - if (!Flag || allViews->Lower() != 1 || allViewOrigins->Lower() != 1) - Standard_DimensionMismatch::Raise("IGESDraw_Drawing : Init"); - } - if (!allAnnotations.IsNull()) - if (allAnnotations->Lower() != 1) Standard_DimensionMismatch::Raise - ("IGESDraw_Drawing : Init"); - - theViews = allViews; - theViewOrigins = allViewOrigins; - theAnnotations = allAnnotations; - InitTypeAndForm(404,0); -} - - Standard_Integer IGESDraw_Drawing::NbViews () const +Standard_Integer IGESDraw_Drawing::NbViews () const { return (theViews.IsNull() ? 0 : theViews->Length()); } - Handle(IGESData_ViewKindEntity) IGESDraw_Drawing::ViewItem - (const Standard_Integer ViewIndex) const +const Handle(IGESData_ViewKindEntity) & IGESDraw_Drawing::ViewItem (const Standard_Integer ViewIndex) const { return theViews->Value(ViewIndex); } - gp_Pnt2d IGESDraw_Drawing::ViewOrigin - (const Standard_Integer TViewIndex) const +gp_Pnt2d IGESDraw_Drawing::ViewOrigin (const Standard_Integer TViewIndex) const { return (gp_Pnt2d (theViewOrigins->Value(TViewIndex)) ); } - Standard_Integer IGESDraw_Drawing::NbAnnotations () const +Standard_Integer IGESDraw_Drawing::NbAnnotations () const { return (theAnnotations.IsNull() ? 0 : theAnnotations->Length() ); } - Handle(IGESData_IGESEntity) IGESDraw_Drawing::Annotation - (const Standard_Integer AnnotationIndex) const +const Handle(IGESData_IGESEntity) & IGESDraw_Drawing::Annotation (const Standard_Integer AnnotationIndex) const { - return ( theAnnotations->Value(AnnotationIndex) ); + return theAnnotations->Value(AnnotationIndex); } - gp_XY IGESDraw_Drawing::ViewToDrawing - (const Standard_Integer NumView, const gp_XYZ& ViewCoords) const +gp_XY IGESDraw_Drawing::ViewToDrawing (const Standard_Integer NumView, const gp_XYZ& ViewCoords) const { gp_XY thisOrigin = theViewOrigins->Value(NumView); Standard_Real XOrigin = thisOrigin.X(); @@ -114,8 +89,7 @@ IGESDraw_Drawing::IGESDraw_Drawing () { } return ( gp_XY(XD, YD) ); } - - Standard_Boolean IGESDraw_Drawing::DrawingUnit (Standard_Real& val) const +Standard_Boolean IGESDraw_Drawing::DrawingUnit (Standard_Real& val) const { val = 0.; Handle(Standard_Type) typunit = STANDARD_TYPE(IGESGraph_DrawingUnits); @@ -126,8 +100,7 @@ IGESDraw_Drawing::IGESDraw_Drawing () { } return Standard_True; } - Standard_Boolean IGESDraw_Drawing::DrawingSize - (Standard_Real& X, Standard_Real& Y) const +Standard_Boolean IGESDraw_Drawing::DrawingSize (Standard_Real& X, Standard_Real& Y) const { X = Y = 0.; Handle(Standard_Type) typsize = STANDARD_TYPE(IGESGraph_DrawingSize); @@ -137,3 +110,136 @@ IGESDraw_Drawing::IGESDraw_Drawing () { } X = size->XSize(); Y = size->YSize(); return Standard_True; } + +void IGESDraw_Drawing::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer nbval = 0; + PR.ReadInteger(nbval,"Count of array of view entities"); + if (nbval > 0) + { + theViews = new IGESDraw_HArray1OfViewKindEntity(1, nbval); + theViewOrigins = new TColgp_HArray1OfXY(1, nbval); + for (Standard_Integer i = 1; i <= nbval; i++) + { + PR.ReadPointer(theViews->ChangeValue(i),"View Entity",Standard_True); + PR.ReadXY(theViewOrigins->ChangeValue(i),"array viewOrigins"); + } + } + else if (nbval < 0) + PR.AddFail("Count of view entities : Less than zero"); + + nbval = 0; + PR.ReadInteger(nbval,"Count of array of Annotation entities"); + if (nbval > 0) + { + theAnnotations = new IGESData_HArray1OfIGESEntity(1, nbval); + for (Standard_Integer i = 1; i <= nbval; i++) + { + PR.ReadPointer(theAnnotations->ChangeValue(i),"View Entity"); + } + } + else if (nbval < 0) + PR.AddFail("Count of Annotation entities : Less than zero"); +} + +void IGESDraw_Drawing::OwnWrite (IGESData_IGESWriter &IW) const +{ + Standard_Integer Up = NbViews(); + IW.Send( Up ); + Standard_Integer i; + for ( i = 1; i <= Up; i++) + { + IW.Send( ViewItem(i) ); + IW.Send( ViewOrigin(i).X() ); + IW.Send( ViewOrigin(i).Y() ); + } + + Up = NbAnnotations(); + IW.Send( Up ); + for ( i = 1; i <= Up; i++) + IW.Send( Annotation(i) ); +} + +void IGESDraw_Drawing::OwnShared (Interface_EntityIterator &iter) const +{ + Standard_Integer Up = NbViews(); + Standard_Integer i; + for ( i = 1; i <= Up; i++) + iter.GetOneItem( ViewItem(i) ); + + Up = NbAnnotations(); + for ( i = 1; i <= Up; i++) + iter.GetOneItem( Annotation(i) ); +} + +IGESData_DirChecker IGESDraw_Drawing::DirChecker () const +{ + IGESData_DirChecker DC (404, 0); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.SubordinateStatusRequired(0); + DC.UseFlagRequired(1); + DC.HierarchyStatusIgnored(); + return DC; +} + +void IGESDraw_Drawing::OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &ach) const +{ + Standard_Boolean ianul = Standard_False; + Standard_Integer i, nb = NbViews(); + for (i = 1; i <= nb; i ++) { + const Handle(IGESData_ViewKindEntity) &tempView = ViewItem(i); + if (tempView.IsNull()) ianul = Standard_True; + else if (tempView->TypeNumber() == 0) ianul = Standard_True; + if (ianul) { + ach->AddWarning ("At least one View is Null"); + break; + } + } + nb = NbAnnotations(); + for (i = 1; i <= nb; i ++) { + const Handle(IGESData_IGESEntity) &ann = Annotation(i); + if (ann.IsNull()) ianul = Standard_True; + else if (ann->TypeNumber() == 0) ianul = Standard_True; + if (ianul) { + ach->AddWarning ("At least one Annotation is Null"); + break; + } + } +} + +void IGESDraw_Drawing::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + const Standard_Integer sublevel = (level <= 4) ? 0 : 1; + S << "IGESDraw_Drawing" << endl; + S << "View Entities : " << endl + << "Transformed View Origins : "; + S << "Count = " << NbViews(); + switch (level) + { + case 4 : S << " [ ask level > 4 for content ]" << endl; + break; // Nothing to be dumped here + case 5 : // Presently level 5 and 6 have the same Dump + S << endl; + case 6 : + { + const Standard_Integer up = NbViews(); + for (Standard_Integer I = 1; I <= up; I++) + { + S << endl << "[" << I << "] "; + S << "View Entity : "; + dumper.Dump(ViewItem(I),S,sublevel); + S << endl; + S << "Transformed View Origin : "; + IGESData_DumpXY(S,ViewOrigin(I)); + } + } + break; + } + S << endl << "Annotation Entities : "; + IGESData_DumpEntities(S,dumper,level,1,NbAnnotations(),Annotation); + S << endl; +} diff --git a/src/IGESDraw/IGESDraw_Drawing.hxx b/src/IGESDraw/IGESDraw_Drawing.hxx index d51a4313d5..8b1170eb50 100644 --- a/src/IGESDraw/IGESDraw_Drawing.hxx +++ b/src/IGESDraw/IGESDraw_Drawing.hxx @@ -17,28 +17,16 @@ #ifndef _IGESDraw_Drawing_HeaderFile #define _IGESDraw_Drawing_HeaderFile -#include -#include - #include #include #include #include -#include -#include -#include -class Standard_DimensionMismatch; -class Standard_OutOfRange; class IGESData_ViewKindEntity; class gp_Pnt2d; -class IGESData_IGESEntity; class gp_XY; class gp_XYZ; -class IGESDraw_Drawing; -DEFINE_STANDARD_HANDLE(IGESDraw_Drawing, IGESData_IGESEntity) - //! defines IGESDrawing, Type <404> Form <0> //! in package IGESDraw //! @@ -47,27 +35,20 @@ DEFINE_STANDARD_HANDLE(IGESDraw_Drawing, IGESData_IGESEntity) //! constitute a single representation of a part class IGESDraw_Drawing : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 404; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 0; } + + IGESDraw_Drawing() {} - - Standard_EXPORT IGESDraw_Drawing(); - - //! This method is used to set the fields of the class - //! Drawing - //! - allViews : Pointers to DEs of View entities - //! - allViewOrigins : Origin coordinates of transformed Views - //! - allAnnotations : Pointers to DEs of Annotation entities - //! raises exception if Lengths of allViews and allViewOrigins are - //! not same. - Standard_EXPORT void Init (const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews, const Handle(TColgp_HArray1OfXY)& allViewOrigins, const Handle(IGESData_HArray1OfIGESEntity)& allAnnotations); - //! returns the number of view pointers in Standard_EXPORT Standard_Integer NbViews() const; //! returns the ViewKindEntity indicated by ViewIndex //! raises an exception if ViewIndex <= 0 or ViewIndex > NbViews(). - Standard_EXPORT Handle(IGESData_ViewKindEntity) ViewItem (const Standard_Integer ViewIndex) const; + Standard_EXPORT const Handle(IGESData_ViewKindEntity) & ViewItem (const Standard_Integer ViewIndex) const; //! returns the Drawing space coordinates of the origin of the //! Transformed view indicated by TViewIndex @@ -81,7 +62,7 @@ public: //! AnnotationIndex //! raises an exception if AnnotationIndex <= 0 or //! AnnotationIndex > NbAnnotations(). - Standard_EXPORT Handle(IGESData_IGESEntity) Annotation (const Standard_Integer AnnotationIndex) const; + Standard_EXPORT const Handle(IGESData_IGESEntity) & Annotation (const Standard_Integer AnnotationIndex) const; Standard_EXPORT gp_XY ViewToDrawing (const Standard_Integer NumView, const gp_XYZ& ViewCoords) const; @@ -97,30 +78,25 @@ public: //! unit to consider is then the model unit in GlobalSection Standard_EXPORT Standard_Boolean DrawingSize (Standard_Real& X, Standard_Real& Y) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESDraw_Drawing,IGESData_IGESEntity) - -protected: - - + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; -private: + DEFINE_STANDARD_RTTIEXT(IGESDraw_Drawing,IGESData_IGESEntity) + private: Handle(IGESDraw_HArray1OfViewKindEntity) theViews; Handle(TColgp_HArray1OfXY) theViewOrigins; Handle(IGESData_HArray1OfIGESEntity) theAnnotations; - - }; - - - - - - #endif // _IGESDraw_Drawing_HeaderFile diff --git a/src/IGESDraw/IGESDraw_DrawingWithRotation.cxx b/src/IGESDraw/IGESDraw_DrawingWithRotation.cxx index 217a9d112d..fdfd2226ee 100644 --- a/src/IGESDraw/IGESDraw_DrawingWithRotation.cxx +++ b/src/IGESDraw/IGESDraw_DrawingWithRotation.cxx @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -27,74 +26,47 @@ #include #include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_DrawingWithRotation,IGESData_IGESEntity) -IGESDraw_DrawingWithRotation::IGESDraw_DrawingWithRotation () { } - - - void IGESDraw_DrawingWithRotation::Init - (const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews, - const Handle(TColgp_HArray1OfXY)& allViewOrigins, - const Handle(TColStd_HArray1OfReal)& allOrientationAngles, - const Handle(IGESData_HArray1OfIGESEntity)& allAnnotations) -{ - Standard_Integer Len = allViews->Length(); - if ( allViews->Lower() != 1 || - (allViewOrigins->Lower() != 1 || allViewOrigins->Length() != Len) || - (allOrientationAngles->Lower() != 1 || allOrientationAngles->Length() != Len) ) - Standard_DimensionMismatch::Raise - ("IGESDraw_DrawingWithRotation : Init"); - if (!allAnnotations.IsNull()) - if (allAnnotations->Lower() != 1) Standard_DimensionMismatch::Raise - ("IGESDraw_DrawingWithRotation : Init"); - - theViews = allViews; - theViewOrigins = allViewOrigins; - theOrientationAngles = allOrientationAngles; - theAnnotations = allAnnotations; - InitTypeAndForm(404,1); -} - - Standard_Integer IGESDraw_DrawingWithRotation::NbViews () const +Standard_Integer IGESDraw_DrawingWithRotation::NbViews () const { return (theViews->Length()); } - Handle(IGESData_ViewKindEntity) IGESDraw_DrawingWithRotation::ViewItem - (const Standard_Integer Index) const +const Handle(IGESData_ViewKindEntity) & IGESDraw_DrawingWithRotation::ViewItem (const Standard_Integer Index) const { - return (theViews->Value(Index)); + return theViews->Value(Index); } - gp_Pnt2d IGESDraw_DrawingWithRotation::ViewOrigin - (const Standard_Integer Index) const +gp_Pnt2d IGESDraw_DrawingWithRotation::ViewOrigin (const Standard_Integer Index) const { return ( gp_Pnt2d (theViewOrigins->Value(Index)) ); } - Standard_Real IGESDraw_DrawingWithRotation::OrientationAngle - (const Standard_Integer Index) const +Standard_Real IGESDraw_DrawingWithRotation::OrientationAngle (const Standard_Integer Index) const { - return ( theOrientationAngles->Value(Index) ); + return theOrientationAngles->Value(Index); } - Standard_Integer IGESDraw_DrawingWithRotation::NbAnnotations () const +Standard_Integer IGESDraw_DrawingWithRotation::NbAnnotations () const { return (theAnnotations.IsNull() ? 0 : theAnnotations->Length() ); } - Handle(IGESData_IGESEntity) IGESDraw_DrawingWithRotation::Annotation - (const Standard_Integer Index) const +const Handle(IGESData_IGESEntity) & IGESDraw_DrawingWithRotation::Annotation (const Standard_Integer Index) const { return ( theAnnotations->Value(Index) ); } - gp_XY IGESDraw_DrawingWithRotation::ViewToDrawing - (const Standard_Integer NumView, const gp_XYZ& ViewCoords) const +gp_XY IGESDraw_DrawingWithRotation::ViewToDrawing (const Standard_Integer NumView, const gp_XYZ& ViewCoords) const { gp_XY thisOrigin = theViewOrigins->Value(NumView); Standard_Real XOrigin = thisOrigin.X(); @@ -126,9 +98,7 @@ IGESDraw_DrawingWithRotation::IGESDraw_DrawingWithRotation () { } return ( gp_XY(XD, YD) ); } - - Standard_Boolean IGESDraw_DrawingWithRotation::DrawingUnit - (Standard_Real& val) const +Standard_Boolean IGESDraw_DrawingWithRotation::DrawingUnit (Standard_Real& val) const { val = 0.; Handle(Standard_Type) typunit = STANDARD_TYPE(IGESGraph_DrawingUnits); @@ -139,8 +109,7 @@ IGESDraw_DrawingWithRotation::IGESDraw_DrawingWithRotation () { } return Standard_True; } - Standard_Boolean IGESDraw_DrawingWithRotation::DrawingSize - (Standard_Real& X, Standard_Real& Y) const +Standard_Boolean IGESDraw_DrawingWithRotation::DrawingSize (Standard_Real& X, Standard_Real& Y) const { X = Y = 0.; Handle(Standard_Type) typsize = STANDARD_TYPE(IGESGraph_DrawingSize); @@ -150,3 +119,136 @@ IGESDraw_DrawingWithRotation::IGESDraw_DrawingWithRotation () { } X = size->XSize(); Y = size->YSize(); return Standard_True; } + +void IGESDraw_DrawingWithRotation::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer nbval = 0; + PR.ReadInteger(nbval,"count of array views"); + if (nbval > 0) + { + theViews = new IGESDraw_HArray1OfViewKindEntity(1, nbval); + theViewOrigins = new TColgp_HArray1OfXY(1, nbval); + theOrientationAngles = new TColStd_HArray1OfReal(1, nbval); + + for (Standard_Integer i = 1; i <= nbval; i++) + { + PR.ReadPointer(theViews->ChangeValue(i),"Instance of views",Standard_True); + PR.ReadXY(theViewOrigins->ChangeValue(i),"array viewOrigins"); + + Standard_Real tempOrient = 0.; + PR.ReadReal(tempOrient,"array viewOrigins"); + theOrientationAngles->SetValue(i, tempOrient); + } + } + else if (nbval <= 0) + PR.AddFail("Count of view entities : Not Positive"); + + nbval = 0; + PR.ReadInteger(nbval,"Count of array of Annotation entities"); + if (nbval > 0) + { + theAnnotations = new IGESData_HArray1OfIGESEntity(1, nbval); + for (Standard_Integer i = 1; i <= nbval; i++) + { + PR.ReadPointer(theAnnotations->ChangeValue(i),"View Entity"); + } + } + else if (nbval < 0) + PR.AddFail("Count of Annotation entities : Less than zero"); +} + +void IGESDraw_DrawingWithRotation::OwnWrite (IGESData_IGESWriter &IW) const +{ + Standard_Integer Up = NbViews(); + IW.Send( Up ); + Standard_Integer i; + for ( i = 1; i <= Up; i++) + { + IW.Send( ViewItem(i) ); + IW.Send( ViewOrigin(i).X() ); + IW.Send( ViewOrigin(i).Y() ); + IW.Send( OrientationAngle(i) ); + } + + Up = NbAnnotations(); + IW.Send( Up ); + for ( i = 1; i <= Up; i++) + IW.Send( Annotation(i) ); +} + +void IGESDraw_DrawingWithRotation::OwnShared (Interface_EntityIterator &iter) const +{ + Standard_Integer Up = NbViews(); + Standard_Integer i; + for ( i = 1; i <= Up; i++) + iter.GetOneItem( ViewItem(i) ); + Up = NbAnnotations(); + for ( i = 1; i <= Up; i++) + iter.GetOneItem( Annotation(i) ); +} + +IGESData_DirChecker IGESDraw_DrawingWithRotation::DirChecker () const +{ + IGESData_DirChecker DC (404, 1); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.SubordinateStatusRequired(0); + DC.UseFlagRequired(1); + DC.HierarchyStatusIgnored(); + return DC; +} + +void IGESDraw_DrawingWithRotation::OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &ach) const +{ + Standard_Boolean ianul = Standard_False; + Standard_Integer i, nb = NbViews(); + for (i = 1; i <= nb; i ++) { + Handle(IGESData_ViewKindEntity) tempView = ViewItem(i); + if (tempView.IsNull()) ianul = Standard_True; + else if (tempView->TypeNumber() == 0) ianul = Standard_True; + if (ianul) { + ach->AddWarning ("At least one View is Null"); + break; + } + } + nb = NbAnnotations(); + for (i = 1; i <= nb; i ++) { + Handle(IGESData_IGESEntity) ann = Annotation(i); + if (ann.IsNull()) ianul = Standard_True; + else if (ann->TypeNumber() == 0) ianul = Standard_True; + if (ianul) { + ach->AddWarning ("At least one Annotation is Null"); + break; + } + } +} + +void IGESDraw_DrawingWithRotation::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + const Standard_Integer sublevel = (level <= 4) ? 0 : 1; + S << "IGESDraw_DrawingWithRotation" << endl; + S << "View Entities : " << endl + << "Transformed View Origins : " << endl + << "Orientation Angles : "; + S << "Count = " << NbViews() << endl; + if (level > 4) // Level = 4 : no Dump. Level = 5 & 6 have same Dump + { + const Standard_Integer up = NbViews(); + for (Standard_Integer I = 1; I <= up; I++) + { + S << "[" << I << "]:" << endl; + S << "View Entity : "; + dumper.Dump (ViewItem(I),S,sublevel); + S << endl; + S << "Transformed View Origin : "; + IGESData_DumpXY(S,ViewOrigin(I)); + S << " Orientation Angle : " << OrientationAngle(I) << endl; + } + } + S << "Annotation Entities : "; + IGESData_DumpEntities(S,dumper,level,1,NbAnnotations(),Annotation); + S << endl; +} diff --git a/src/IGESDraw/IGESDraw_DrawingWithRotation.hxx b/src/IGESDraw/IGESDraw_DrawingWithRotation.hxx index 7faac4c0fb..8ba423d6ea 100644 --- a/src/IGESDraw/IGESDraw_DrawingWithRotation.hxx +++ b/src/IGESDraw/IGESDraw_DrawingWithRotation.hxx @@ -17,29 +17,17 @@ #ifndef _IGESDraw_DrawingWithRotation_HeaderFile #define _IGESDraw_DrawingWithRotation_HeaderFile -#include -#include - #include #include #include #include #include -#include -#include -#include -class Standard_DimensionMismatch; -class Standard_OutOfRange; class IGESData_ViewKindEntity; class gp_Pnt2d; -class IGESData_IGESEntity; class gp_XY; class gp_XYZ; -class IGESDraw_DrawingWithRotation; -DEFINE_STANDARD_HANDLE(IGESDraw_DrawingWithRotation, IGESData_IGESEntity) - //! defines IGESDrawingWithRotation, Type <404> Form <1> //! in package IGESDraw //! @@ -47,28 +35,20 @@ DEFINE_STANDARD_HANDLE(IGESDraw_DrawingWithRotation, IGESData_IGESEntity) //! scaling, between the view and drawing coordinate systems class IGESDraw_DrawingWithRotation : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 404; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 1; } + + IGESDraw_DrawingWithRotation() {} - - Standard_EXPORT IGESDraw_DrawingWithRotation(); - - //! This method is used to set the fields of the class - //! DrawingWithRotation - //! - allViews : Pointers to View entities - //! - allViewOrigins : Origin coords of transformed views - //! - allOrientationAngles : Orientation angles of transformed views - //! - allAnnotations : Pointers to Annotation entities - //! raises exception if Lengths of allViews, allViewOrigins and - //! allOrientationAngles are not same. - Standard_EXPORT void Init (const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews, const Handle(TColgp_HArray1OfXY)& allViewOrigins, const Handle(TColStd_HArray1OfReal)& allOrientationAngles, const Handle(IGESData_HArray1OfIGESEntity)& allAnnotations); - //! returns the number of view pointers in Standard_EXPORT Standard_Integer NbViews() const; //! returns the View entity indicated by Index //! raises an exception if Index <= 0 or Index > NbViews(). - Standard_EXPORT Handle(IGESData_ViewKindEntity) ViewItem (const Standard_Integer Index) const; + Standard_EXPORT const Handle(IGESData_ViewKindEntity) & ViewItem (const Standard_Integer Index) const; //! returns the Drawing space coordinates of the origin of the //! Transformed view indicated by Index @@ -85,7 +65,7 @@ public: //! returns the Annotation entity in this Drawing, indicated by Index //! raises an exception if Index <= 0 or Index > NbAnnotations(). - Standard_EXPORT Handle(IGESData_IGESEntity) Annotation (const Standard_Integer Index) const; + Standard_EXPORT const Handle(IGESData_IGESEntity) & Annotation (const Standard_Integer Index) const; Standard_EXPORT gp_XY ViewToDrawing (const Standard_Integer NumView, const gp_XYZ& ViewCoords) const; @@ -101,31 +81,26 @@ public: //! unit to consider is then the model unit in GlobalSection Standard_EXPORT Standard_Boolean DrawingSize (Standard_Real& X, Standard_Real& Y) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESDraw_DrawingWithRotation,IGESData_IGESEntity) - -protected: - - + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; -private: + DEFINE_STANDARD_RTTIEXT(IGESDraw_DrawingWithRotation,IGESData_IGESEntity) + private: Handle(IGESDraw_HArray1OfViewKindEntity) theViews; Handle(TColgp_HArray1OfXY) theViewOrigins; Handle(TColStd_HArray1OfReal) theOrientationAngles; Handle(IGESData_HArray1OfIGESEntity) theAnnotations; - - }; - - - - - - #endif // _IGESDraw_DrawingWithRotation_HeaderFile diff --git a/src/IGESDraw/IGESDraw_GeneralModule.cxx b/src/IGESDraw/IGESDraw_GeneralModule.cxx index 85fc57a468..d22ae8d422 100644 --- a/src/IGESDraw/IGESDraw_GeneralModule.cxx +++ b/src/IGESDraw/IGESDraw_GeneralModule.cxx @@ -26,18 +26,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -52,198 +40,10 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_GeneralModule,IGESData_GeneralModule) - void IGESDraw_GeneralModule::OwnSharedCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - Interface_EntityIterator& iter) const -{ - switch (CN) { - case 2 : { - DeclareAndCast(IGESDraw_ConnectPoint,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolConnectPoint tool; - tool.OwnShared(anent,iter); - } - break; - case 3 : { - DeclareAndCast(IGESDraw_Drawing,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolDrawing tool; - tool.OwnShared(anent,iter); - } - break; - case 4 : { - DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolDrawingWithRotation tool; - tool.OwnShared(anent,iter); - } - break; - case 5 : { - DeclareAndCast(IGESDraw_LabelDisplay,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolLabelDisplay tool; - tool.OwnShared(anent,iter); - } - break; - case 6 : { - DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolNetworkSubfigure tool; - tool.OwnShared(anent,iter); - } - break; - case 7 : { - DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolNetworkSubfigureDef tool; - tool.OwnShared(anent,iter); - } - break; - case 9 : { - DeclareAndCast(IGESDraw_Planar,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolPlanar tool; - tool.OwnShared(anent,iter); - } - break; - case 10 : { - DeclareAndCast(IGESDraw_RectArraySubfigure,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolRectArraySubfigure tool; - tool.OwnShared(anent,iter); - } - break; - case 11 : { - DeclareAndCast(IGESDraw_SegmentedViewsVisible,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolSegmentedViewsVisible tool; - tool.OwnShared(anent,iter); - } - break; - case 12 : { - DeclareAndCast(IGESDraw_View,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolView tool; - tool.OwnShared(anent,iter); - } - break; - case 13 : { - DeclareAndCast(IGESDraw_ViewsVisible,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolViewsVisible tool; - tool.OwnShared(anent,iter); - } - break; - case 14 : { - DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolViewsVisibleWithAttr tool; - tool.OwnShared(anent,iter); - } - break; - default : break; - } -} - - void IGESDraw_GeneralModule::OwnImpliedCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - Interface_EntityIterator& iter) const -{ - switch (CN ) { - case 13 : { - DeclareAndCast(IGESDraw_ViewsVisible,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolViewsVisible tool; - tool.OwnImplied(anent,iter); - } - case 14 : { - DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolViewsVisibleWithAttr tool; - tool.OwnImplied(anent,iter); - } - default : break; - } -} - - - IGESData_DirChecker IGESDraw_GeneralModule::DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const { switch (CN) { - case 1 : { - DeclareAndCast(IGESDraw_CircArraySubfigure,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolCircArraySubfigure tool; - return tool.DirChecker(anent); - } - case 2 : { - DeclareAndCast(IGESDraw_ConnectPoint,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolConnectPoint tool; - return tool.DirChecker(anent); - } - case 3 : { - DeclareAndCast(IGESDraw_Drawing,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolDrawing tool; - return tool.DirChecker(anent); - } - case 4 : { - DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolDrawingWithRotation tool; - return tool.DirChecker(anent); - } - case 5 : { - DeclareAndCast(IGESDraw_LabelDisplay,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolLabelDisplay tool; - return tool.DirChecker(anent); - } - case 6 : { - DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolNetworkSubfigure tool; - return tool.DirChecker(anent); - } - case 7 : { - DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolNetworkSubfigureDef tool; - return tool.DirChecker(anent); - } - case 8 : { - DeclareAndCast(IGESDraw_PerspectiveView,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolPerspectiveView tool; - return tool.DirChecker(anent); - } - case 9 : { - DeclareAndCast(IGESDraw_Planar,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolPlanar tool; - return tool.DirChecker(anent); - } - case 10 : { - DeclareAndCast(IGESDraw_RectArraySubfigure,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolRectArraySubfigure tool; - return tool.DirChecker(anent); - } - case 11 : { - DeclareAndCast(IGESDraw_SegmentedViewsVisible,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolSegmentedViewsVisible tool; - return tool.DirChecker(anent); - } - case 12 : { - DeclareAndCast(IGESDraw_View,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolView tool; - return tool.DirChecker(anent); - } case 13 : { DeclareAndCast(IGESDraw_ViewsVisible,anent,ent); if (anent.IsNull()) break; @@ -262,110 +62,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_GeneralModule,IGESData_GeneralModule) } - void IGESDraw_GeneralModule::OwnCheckCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const -{ - switch (CN) { - case 2 : { - DeclareAndCast(IGESDraw_ConnectPoint,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolConnectPoint tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 3 : { - DeclareAndCast(IGESDraw_Drawing,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolDrawing tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 4 : { - DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolDrawingWithRotation tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 6 : { - DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolNetworkSubfigure tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 7 : { - DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolNetworkSubfigureDef tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 8 : { - DeclareAndCast(IGESDraw_PerspectiveView,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolPerspectiveView tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 9 : { - DeclareAndCast(IGESDraw_Planar,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolPlanar tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 12 : { - DeclareAndCast(IGESDraw_View,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolView tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 13 : { - DeclareAndCast(IGESDraw_ViewsVisible,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolViewsVisible tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 14 : { - DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolViewsVisibleWithAttr tool; - tool.OwnCheck(anent,shares,ach); - } - break; - default : break; - } -} - - - Standard_Boolean IGESDraw_GeneralModule::NewVoid - (const Standard_Integer CN, Handle(Standard_Transient)& ent) const -{ - switch (CN) { - case 1 : ent = new IGESDraw_CircArraySubfigure; break; - case 2 : ent = new IGESDraw_ConnectPoint; break; - case 3 : ent = new IGESDraw_Drawing; break; - case 4 : ent = new IGESDraw_DrawingWithRotation; break; - case 5 : ent = new IGESDraw_LabelDisplay; break; - case 6 : ent = new IGESDraw_NetworkSubfigure; break; - case 7 : ent = new IGESDraw_NetworkSubfigureDef; break; - case 8 : ent = new IGESDraw_PerspectiveView; break; - case 9 : ent = new IGESDraw_Planar; break; - case 10 : ent = new IGESDraw_RectArraySubfigure; break; - case 11 : ent = new IGESDraw_SegmentedViewsVisible; break; - case 12 : ent = new IGESDraw_View; break; - case 13 : ent = new IGESDraw_ViewsVisible; break; - case 14 : ent = new IGESDraw_ViewsVisibleWithAttr; break; - default : return Standard_False; // by default, Failure on Recognize - } - return Standard_True; -} - - Standard_Integer IGESDraw_GeneralModule::CategoryNumber (const Standard_Integer CN, const Handle(Standard_Transient)& , const Interface_ShareTool& ) const diff --git a/src/IGESDraw/IGESDraw_GeneralModule.hxx b/src/IGESDraw/IGESDraw_GeneralModule.hxx index 0e0ea16c2d..92ea7cb937 100644 --- a/src/IGESDraw/IGESDraw_GeneralModule.hxx +++ b/src/IGESDraw/IGESDraw_GeneralModule.hxx @@ -32,25 +32,11 @@ class IGESDraw_GeneralModule : public IGESData_GeneralModule //! Creates a GeneralModule from IGESDraw and puts it into GeneralLib IGESDraw_GeneralModule() {} - //! Lists the Entities shared by a given IGESEntity , from - //! its specific parameters : specific for each type - Standard_EXPORT void OwnSharedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - - //! Specific list of Entities implied by an IGESEntity (in - //! addition to Associativities). Redefined for ViewsVisible ... - Standard_EXPORT virtual void OwnImpliedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - //! Returns a DirChecker, specific for each type of Entity //! (identified by its Case Number) : this DirChecker defines //! constraints which must be respected by the DirectoryPart Standard_EXPORT IGESData_DirChecker DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - //! Performs Specific Semantic Check for each type of Entity - Standard_EXPORT void OwnCheckCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE; - - //! Specific creation of a new void entity - Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE; - //! Returns a category number which characterizes an entity //! Planar : Auxiliary //! Subfigures and ConnectPoint : Structure diff --git a/src/IGESDraw/IGESDraw_HArray1OfConnectPoint.hxx b/src/IGESDraw/IGESDraw_HArray1OfConnectPoint.hxx index 3007941ae2..da3b6d7526 100644 --- a/src/IGESDraw/IGESDraw_HArray1OfConnectPoint.hxx +++ b/src/IGESDraw/IGESDraw_HArray1OfConnectPoint.hxx @@ -17,11 +17,9 @@ #ifndef IGESDraw_HArray1OfConnectPoint_HeaderFile #define IGESDraw_HArray1OfConnectPoint_HeaderFile -#include #include #include DEFINE_HARRAY1(IGESDraw_HArray1OfConnectPoint, IGESDraw_Array1OfConnectPoint) - #endif diff --git a/src/IGESDraw/IGESDraw_HArray1OfViewKindEntity.hxx b/src/IGESDraw/IGESDraw_HArray1OfViewKindEntity.hxx index 4718c7a311..163c4efd96 100644 --- a/src/IGESDraw/IGESDraw_HArray1OfViewKindEntity.hxx +++ b/src/IGESDraw/IGESDraw_HArray1OfViewKindEntity.hxx @@ -17,11 +17,9 @@ #ifndef IGESDraw_HArray1OfViewKindEntity_HeaderFile #define IGESDraw_HArray1OfViewKindEntity_HeaderFile -#include #include #include DEFINE_HARRAY1(IGESDraw_HArray1OfViewKindEntity, IGESDraw_Array1OfViewKindEntity) - #endif diff --git a/src/IGESDraw/IGESDraw_LabelDisplay.cxx b/src/IGESDraw/IGESDraw_LabelDisplay.cxx index ce2dece75c..78b207c589 100644 --- a/src/IGESDraw/IGESDraw_LabelDisplay.cxx +++ b/src/IGESDraw/IGESDraw_LabelDisplay.cxx @@ -17,81 +17,53 @@ //-------------------------------------------------------------------- #include -#include #include #include #include #include #include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_LabelDisplay,IGESData_LabelDisplayEntity) -IGESDraw_LabelDisplay::IGESDraw_LabelDisplay () { } - - void IGESDraw_LabelDisplay::Init - (const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews, - const Handle(TColgp_HArray1OfXYZ)& allTextLocations, - const Handle(IGESDimen_HArray1OfLeaderArrow)& allLeaderEntities, - const Handle(TColStd_HArray1OfInteger)& allLabelLevels, - const Handle(IGESData_HArray1OfIGESEntity)& allDisplayedEntities) -{ - Standard_Integer Ln = allViews->Length(); - if ( allViews->Lower() != 1 || - (allTextLocations->Lower() != 1 || allTextLocations->Length() != Ln) || - (allLeaderEntities->Lower() != 1 || allLeaderEntities->Length() != Ln) || - (allLabelLevels->Lower() != 1 || allLabelLevels->Length() != Ln) || - (allDisplayedEntities->Lower() != 1 || allDisplayedEntities->Length() != Ln)) - Standard_DimensionMismatch::Raise("IGESDraw_LabelDisplay : Init"); - - theViews = allViews; - theTextLocations = allTextLocations; - theLeaderEntities = allLeaderEntities; - theLabelLevels = allLabelLevels; - theDisplayedEntities = allDisplayedEntities; - InitTypeAndForm(402,5); -} - - Standard_Integer IGESDraw_LabelDisplay::NbLabels () const +Standard_Integer IGESDraw_LabelDisplay::NbLabels () const { return (theViews->Length()); } - Handle(IGESData_ViewKindEntity) IGESDraw_LabelDisplay::ViewItem - (const Standard_Integer ViewIndex) const +const Handle(IGESData_ViewKindEntity) & IGESDraw_LabelDisplay::ViewItem (const Standard_Integer ViewIndex) const { - return (theViews->Value(ViewIndex)); + return theViews->Value(ViewIndex); } - gp_Pnt IGESDraw_LabelDisplay::TextLocation - (const Standard_Integer ViewIndex) const +gp_Pnt IGESDraw_LabelDisplay::TextLocation (const Standard_Integer ViewIndex) const { return ( gp_Pnt (theTextLocations->Value(ViewIndex)) ); } - Handle(IGESDimen_LeaderArrow) IGESDraw_LabelDisplay::LeaderEntity - (const Standard_Integer ViewIndex) const +const Handle(IGESDimen_LeaderArrow) & IGESDraw_LabelDisplay::LeaderEntity (const Standard_Integer ViewIndex) const { - return (theLeaderEntities->Value(ViewIndex)); + return theLeaderEntities->Value(ViewIndex); } - Standard_Integer IGESDraw_LabelDisplay::LabelLevel - (const Standard_Integer ViewIndex) const +Standard_Integer IGESDraw_LabelDisplay::LabelLevel (const Standard_Integer ViewIndex) const { - return (theLabelLevels->Value(ViewIndex)); + return theLabelLevels->Value(ViewIndex); } - Handle(IGESData_IGESEntity) IGESDraw_LabelDisplay::DisplayedEntity - (const Standard_Integer EntityIndex) const +const Handle(IGESData_IGESEntity) & IGESDraw_LabelDisplay::DisplayedEntity (const Standard_Integer EntityIndex) const { - return (theDisplayedEntities->Value(EntityIndex)); + return theDisplayedEntities->Value(EntityIndex); } - gp_Pnt IGESDraw_LabelDisplay::TransformedTextLocation - (const Standard_Integer ViewIndex) const +gp_Pnt IGESDraw_LabelDisplay::TransformedTextLocation (const Standard_Integer ViewIndex) const { gp_XYZ retXYZ; gp_XYZ tempXYZ = theTextLocations->Value(ViewIndex); @@ -109,3 +81,101 @@ IGESDraw_LabelDisplay::IGESDraw_LabelDisplay () { } } return ( gp_Pnt(retXYZ) ); } + +void IGESDraw_LabelDisplay::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer nbval = 0; + PR.ReadInteger(nbval,"No. of Label placements"); + if (nbval > 0) + { + theViews = new IGESDraw_HArray1OfViewKindEntity(1, nbval); + theTextLocations = new TColgp_HArray1OfXYZ(1, nbval); + theLeaderEntities = new IGESDimen_HArray1OfLeaderArrow(1, nbval); + theLabelLevels = new TColStd_HArray1OfInteger(1, nbval); + theDisplayedEntities = new IGESData_HArray1OfIGESEntity(1, nbval); + + Handle(IGESData_ViewKindEntity) tempView; + Handle(IGESDimen_LeaderArrow) tempLeaderArrow; + Handle(IGESData_IGESEntity) tempDisplayedEntity; + + for (Standard_Integer i = 1; i <= nbval; i++) + { + PR.ReadPointer(theViews->ChangeValue(i),"Instance of views"); + PR.ReadXYZ(theTextLocations->ChangeValue(i),"array textLocations"); + PR.ReadPointer(theLeaderEntities->ChangeValue(i),"Instance of LeaderArrow"); + PR.ReadInteger(theLabelLevels->ChangeValue(i),"array labelLevels"); + PR.ReadPointer(theDisplayedEntities->ChangeValue(i),"displayedEntities entity"); + } + } + else PR.AddFail("No. of Label placements : Not Positive"); +} + +void IGESDraw_LabelDisplay::OwnWrite (IGESData_IGESWriter &IW) const +{ + Standard_Integer Up = NbLabels(); + IW.Send( Up ); + for ( Standard_Integer i = 1; i <= Up; i++) + { + IW.Send( ViewItem(i) ); + IW.Send( TextLocation(i).X() ); + IW.Send( TextLocation(i).Y() ); + IW.Send( TextLocation(i).Z() ); + IW.Send( LeaderEntity(i) ); + IW.Send( LabelLevel(i) ); + IW.Send( DisplayedEntity(i) ); + } +} + +void IGESDraw_LabelDisplay::OwnShared (Interface_EntityIterator &iter) const +{ + Standard_Integer Up = NbLabels(); + for ( Standard_Integer i = 1; i <= Up; i++) + { + iter.GetOneItem( ViewItem(i) ); + iter.GetOneItem( LeaderEntity(i) ); + iter.GetOneItem( DisplayedEntity(i) ); + } +} + +IGESData_DirChecker IGESDraw_LabelDisplay::DirChecker () const +{ + IGESData_DirChecker DC (402, 5); + DC.Structure(IGESData_DefVoid); + DC.HierarchyStatusIgnored(); + DC.BlankStatusIgnored(); + return DC; +} + +void IGESDraw_LabelDisplay::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + const Standard_Integer sublevel = (level <= 4) ? 0 : 1; + S << "IGESDraw_LabelDisplay" << endl; + S << "View Entities : " << endl + << "Text Locations : " << endl + << "Leader Entities : " << endl + << "Label Level Numbers : " << endl + << "Displayed Entities : "; + S << "Count = " << NbLabels() << endl; + if (level > 4) // Level = 4 : no Dump. Level = 5 & 6 : same Dump + { + const Standard_Integer up = NbLabels(); + for (Standard_Integer I = 1; I <= up; I ++) + { + S << "[" << I << "]:" << endl; + S << "View Entity : "; + dumper.Dump (ViewItem(I),S,sublevel); + S << endl; + S << "Text Location in View : "; + IGESData_DumpXYZL(S,level,TextLocation(I),Location()); + S << " Leader Entity in View : "; + dumper.Dump(LeaderEntity(I),S,sublevel); + S << endl; + S << "Entity Label Level Number : "; + S << LabelLevel(I) << " "; + S << "Displayed Entity : "; + dumper.Dump(DisplayedEntity(I),S,sublevel); + S << endl; + } + } + S << endl; +} diff --git a/src/IGESDraw/IGESDraw_LabelDisplay.hxx b/src/IGESDraw/IGESDraw_LabelDisplay.hxx index 6f3c2bca83..c223beb143 100644 --- a/src/IGESDraw/IGESDraw_LabelDisplay.hxx +++ b/src/IGESDraw/IGESDraw_LabelDisplay.hxx @@ -17,26 +17,16 @@ #ifndef _IGESDraw_LabelDisplay_HeaderFile #define _IGESDraw_LabelDisplay_HeaderFile -#include -#include - #include #include #include #include #include #include -#include -class Standard_DimensionMismatch; -class Standard_OutOfRange; class IGESData_ViewKindEntity; class gp_Pnt; class IGESDimen_LeaderArrow; -class IGESData_IGESEntity; - -class IGESDraw_LabelDisplay; -DEFINE_STANDARD_HANDLE(IGESDraw_LabelDisplay, IGESData_LabelDisplayEntity) //! defines IGESLabelDisplay, Type <402> Form <5> //! in package IGESDraw @@ -45,30 +35,20 @@ DEFINE_STANDARD_HANDLE(IGESDraw_LabelDisplay, IGESData_LabelDisplayEntity) //! entity labels of an entity class IGESDraw_LabelDisplay : public IGESData_LabelDisplayEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 402; } - - Standard_EXPORT IGESDraw_LabelDisplay(); - - //! This method is used to set the fields of the class - //! LabelDisplay - //! - allViews : Pointers to View Entities - //! - allTextLocations : Coordinates of text locations in the views - //! - allLeaderEntities : Pointers to Leader Entities in the views - //! - allLabelLevels : Entity label level numbers in the views - //! - allDisplayedEntities : Pointers to the entities being displayed - //! raises exception if Lengths of allViews, allTextLocations, - //! allLeaderEntities, allLabelLevels and allDisplayedEntities are - //! not same. - Standard_EXPORT void Init (const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews, const Handle(TColgp_HArray1OfXYZ)& allTextLocations, const Handle(IGESDimen_HArray1OfLeaderArrow)& allLeaderEntities, const Handle(TColStd_HArray1OfInteger)& allLabelLevels, const Handle(IGESData_HArray1OfIGESEntity)& allDisplayedEntities); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 5; } + + IGESDraw_LabelDisplay() {} //! returns the number of label placements in Standard_EXPORT Standard_Integer NbLabels() const; //! returns the View entity indicated by ViewIndex //! raises an exception if ViewIndex <= 0 or ViewIndex > NbLabels(). - Standard_EXPORT Handle(IGESData_ViewKindEntity) ViewItem (const Standard_Integer ViewIndex) const; + Standard_EXPORT const Handle(IGESData_ViewKindEntity) & ViewItem (const Standard_Integer ViewIndex) const; //! returns the 3d-Point coordinates of the text location, in the //! view indicated by ViewIndex @@ -77,7 +57,7 @@ public: //! returns the Leader entity in the view indicated by ViewIndex //! raises an exception if ViewIndex <= 0 or ViewIndex > NbLabels(). - Standard_EXPORT Handle(IGESDimen_LeaderArrow) LeaderEntity (const Standard_Integer ViewIndex) const; + Standard_EXPORT const Handle(IGESDimen_LeaderArrow) & LeaderEntity (const Standard_Integer ViewIndex) const; //! returns the Entity label level number in the view indicated //! by ViewIndex @@ -86,39 +66,32 @@ public: //! returns the entity indicated by EntityIndex //! raises an exception if EntityIndex <= 0 or EntityIndex > NbLabels(). - Standard_EXPORT Handle(IGESData_IGESEntity) DisplayedEntity (const Standard_Integer EntityIndex) const; + Standard_EXPORT const Handle(IGESData_IGESEntity) & DisplayedEntity (const Standard_Integer EntityIndex) const; //! returns the transformed 3d-Point coordinates of the text //! location, in the view indicated by ViewIndex //! raises an exception if ViewIndex <= 0 or ViewIndex > NbLabels(). Standard_EXPORT gp_Pnt TransformedTextLocation (const Standard_Integer ViewIndex) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESDraw_LabelDisplay,IGESData_LabelDisplayEntity) - -protected: - - - + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; -private: + DEFINE_STANDARD_RTTIEXT(IGESDraw_LabelDisplay,IGESData_LabelDisplayEntity) + private: Handle(IGESDraw_HArray1OfViewKindEntity) theViews; Handle(TColgp_HArray1OfXYZ) theTextLocations; Handle(IGESDimen_HArray1OfLeaderArrow) theLeaderEntities; Handle(TColStd_HArray1OfInteger) theLabelLevels; Handle(IGESData_HArray1OfIGESEntity) theDisplayedEntities; - - }; - - - - - - #endif // _IGESDraw_LabelDisplay_HeaderFile diff --git a/src/IGESDraw/IGESDraw_NetworkSubfigure.cxx b/src/IGESDraw/IGESDraw_NetworkSubfigure.cxx index 1c12260f44..714cf0512c 100644 --- a/src/IGESDraw/IGESDraw_NetworkSubfigure.cxx +++ b/src/IGESDraw/IGESDraw_NetworkSubfigure.cxx @@ -22,89 +22,137 @@ #include #include #include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_NetworkSubfigure,IGESData_IGESEntity) -IGESDraw_NetworkSubfigure::IGESDraw_NetworkSubfigure () { } - - void IGESDraw_NetworkSubfigure::Init - (const Handle(IGESDraw_NetworkSubfigureDef)& aDefinition, - const gp_XYZ& aTranslation, - const gp_XYZ& aScaleFactor, - const Standard_Integer aTypeFlag, - const Handle(TCollection_HAsciiString)& aDesignator, - const Handle(IGESGraph_TextDisplayTemplate)& aTemplate, - const Handle(IGESDraw_HArray1OfConnectPoint)& allConnectPoints) +gp_XYZ IGESDraw_NetworkSubfigure::TransformedTranslation () const { - if (!allConnectPoints.IsNull()) - if (allConnectPoints->Lower() != 1) - Standard_DimensionMismatch::Raise("IGESDraw_NetworkSubfigure : Init"); - theSubfigureDefinition = aDefinition; - theTranslation = aTranslation; - theScaleFactor = aScaleFactor; - theTypeFlag = aTypeFlag; - theDesignator = aDesignator; - theDesignatorTemplate = aTemplate; - theConnectPoints = allConnectPoints; - InitTypeAndForm(420,0); + gp_XYZ TempXYZ = theTranslation; + if (HasTransf()) Location().Transforms(TempXYZ); + return ( TempXYZ ); } - Handle(IGESDraw_NetworkSubfigureDef) - IGESDraw_NetworkSubfigure::SubfigureDefinition () const +Standard_Integer IGESDraw_NetworkSubfigure::NbConnectPoints () const { - return theSubfigureDefinition; + return (theConnectPoints.IsNull() ? 0 : theConnectPoints->Length() ); } - gp_XYZ IGESDraw_NetworkSubfigure::Translation () const +const Handle(IGESDraw_ConnectPoint) & IGESDraw_NetworkSubfigure::ConnectPoint (const Standard_Integer Index) const { - return theTranslation; + return theConnectPoints->Value(Index); } - gp_XYZ IGESDraw_NetworkSubfigure::TransformedTranslation () const +void IGESDraw_NetworkSubfigure::OwnRead (IGESFile_Reader &PR) { - gp_XYZ TempXYZ = theTranslation; - if (HasTransf()) Location().Transforms(TempXYZ); - return ( TempXYZ ); -} + PR.ReadPointer(theSubfigureDefinition,"Instance of NetworkSubfigureDef"); + PR.ReadXYZ(theTranslation,"Translation data"); - gp_XYZ IGESDraw_NetworkSubfigure::ScaleFactors () const -{ - return theScaleFactor; -} + Standard_Real scaleX = 1.0; // Default Value + PR.ReadReal(scaleX,"Scale factors(X)"); - Standard_Integer IGESDraw_NetworkSubfigure::TypeFlag () const -{ - return theTypeFlag; + Standard_Real scaleY = scaleX; // Default Value + PR.ReadReal(scaleY,"Scale factors(Y)"); + + Standard_Real scaleZ = scaleX; // Default Value + PR.ReadReal(scaleZ,"Scale factors(Z)"); + + theScaleFactor.SetCoord(scaleX, scaleY, scaleZ); + + theTypeFlag = 0; // Default Value + PR.ReadInteger(theTypeFlag,"Type flag"); + + if (PR.ReadText(theDesignator,"Primary reference designator") == IGESFile_Reader::ParamEmpty) + PR.AddWarning("Primary reference designator : Null definition"); + + PR.ReadPointer(theDesignatorTemplate,"Instance of TextDisplayTemplate",Standard_True); + + Standard_Integer nbval = 0; + PR.ReadInteger(nbval,"Count of Connect Points"); + if (nbval > 0) + { + // Reading connectPoints(HArray1OfConnectPoint) + theConnectPoints = new IGESDraw_HArray1OfConnectPoint(1, nbval); + for (Standard_Integer i = 1; i <= nbval; i++) + PR.ReadPointer(theConnectPoints->ChangeValue(i),"ConnectPoint entity",Standard_True); + } + else if (nbval < 0) + PR.AddFail ("Count of Connect point entities : Less than Zero"); } - Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigure::ReferenceDesignator - () const +void IGESDraw_NetworkSubfigure::OwnWrite (IGESData_IGESWriter &IW) const { - return theDesignator; + IW.Send( theSubfigureDefinition ); + IW.Send( theTranslation.X() ); + IW.Send( theTranslation.Y() ); + IW.Send( theTranslation.Z() ); + IW.Send( theScaleFactor.X() ); + IW.Send( theScaleFactor.Y() ); + IW.Send( theScaleFactor.Z() ); + IW.Send( theTypeFlag ); + IW.Send( theDesignator ); + IW.Send( theDesignatorTemplate ); + + const Standard_Integer Up = NbConnectPoints(); + IW.Send( Up ); + for ( Standard_Integer i = 1; i <= Up; i++) + IW.Send( ConnectPoint(i) ); } - Standard_Boolean IGESDraw_NetworkSubfigure::HasDesignatorTemplate () const +void IGESDraw_NetworkSubfigure::OwnShared (Interface_EntityIterator &iter) const { - return (! theDesignatorTemplate.IsNull() ); + iter.GetOneItem( theSubfigureDefinition ); + iter.GetOneItem( theDesignatorTemplate ); + const Standard_Integer Up = NbConnectPoints(); + for ( Standard_Integer i = 1; i <= Up; i++) + iter.GetOneItem( ConnectPoint(i) ); } - Handle(IGESGraph_TextDisplayTemplate) - IGESDraw_NetworkSubfigure::DesignatorTemplate () const -{ - return theDesignatorTemplate; +IGESData_DirChecker IGESDraw_NetworkSubfigure::DirChecker () const +{ + IGESData_DirChecker DC (420, 0); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefAny); + DC.LineWeight(IGESData_DefValue); + DC.Color(IGESData_DefAny); + return DC; } - Standard_Integer IGESDraw_NetworkSubfigure::NbConnectPoints () const +void IGESDraw_NetworkSubfigure::OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &ach) const { - return (theConnectPoints.IsNull() ? 0 : theConnectPoints->Length() ); + if ( theTypeFlag != 0 && + theTypeFlag != 1 && + theTypeFlag != 2 ) + ach->AddFail("Type Flag : Value != 0/1/2"); + if (NbConnectPoints() != SubfigureDefinition()->NbPointEntities()) + ach->AddFail("Count of associated Connect Points inconsistent with Definition"); + if (theDesignator.IsNull()) + ach->AddFail("Primary Reference Designator : not defined"); } - Handle(IGESDraw_ConnectPoint) IGESDraw_NetworkSubfigure::ConnectPoint - (const Standard_Integer Index) const +void IGESDraw_NetworkSubfigure::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const { - return ( theConnectPoints->Value(Index) ); + const Standard_Integer sublevel = (level <= 4) ? 0 : 1; + S << "IGESDraw_NetworkSubfigure" << endl; + S << "Network Subfigure Definition Entity : "; + dumper.Dump(theSubfigureDefinition,S,sublevel); + S << endl << "Translation Data : "; + IGESData_DumpXYZL(S,level,theTranslation,Location()); + S << endl << "Scale Factors : "; + IGESData_DumpXYZ(S,theScaleFactor); + S << endl << "Type Flag : " << theTypeFlag << endl; + S << "Primary Reference Designator : "; + IGESData_DumpString(S,theDesignator); + S << endl << "Text Display Template Entity : "; + dumper.Dump(theDesignatorTemplate,S,sublevel); + S << endl << "Connect Points : "; + IGESData_DumpEntities(S,dumper,level,1,NbConnectPoints(),ConnectPoint); + S << endl; } diff --git a/src/IGESDraw/IGESDraw_NetworkSubfigure.hxx b/src/IGESDraw/IGESDraw_NetworkSubfigure.hxx index 388ab51e9a..ec53f98776 100644 --- a/src/IGESDraw/IGESDraw_NetworkSubfigure.hxx +++ b/src/IGESDraw/IGESDraw_NetworkSubfigure.hxx @@ -17,25 +17,15 @@ #ifndef _IGESDraw_NetworkSubfigure_HeaderFile #define _IGESDraw_NetworkSubfigure_HeaderFile -#include -#include - #include -#include #include #include -#include class IGESDraw_NetworkSubfigureDef; class TCollection_HAsciiString; class IGESGraph_TextDisplayTemplate; -class Standard_OutOfRange; -class gp_XYZ; class IGESDraw_ConnectPoint; -class IGESDraw_NetworkSubfigure; -DEFINE_STANDARD_HANDLE(IGESDraw_NetworkSubfigure, IGESData_IGESEntity) - //! defines IGES Network Subfigure Instance Entity, //! Type <420> Form Number <0> in package IGESDraw //! @@ -43,92 +33,76 @@ DEFINE_STANDARD_HANDLE(IGESDraw_NetworkSubfigure, IGESData_IGESEntity) //! Definition Entity (Type 320, Form 0). class IGESDraw_NetworkSubfigure : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 420; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 0; } + + IGESDraw_NetworkSubfigure() {} - - Standard_EXPORT IGESDraw_NetworkSubfigure(); - - //! This method is used to set the fields of the class - //! NetworkSubfigure - //! - aDefinition : Network Subfigure Definition Entity - //! - aTranslation : Translation data relative to the model - //! space or the definition space - //! - aScaleFactor : Scale factors in the definition space - //! - aTypeFlag : Type flag - //! - aDesignator : Primary reference designator - //! - aTemplate : Primary reference designator Text - //! display Template Entity - //! - allConnectPoints : Associated Connect Point Entities - Standard_EXPORT void Init (const Handle(IGESDraw_NetworkSubfigureDef)& aDefinition, const gp_XYZ& aTranslation, const gp_XYZ& aScaleFactor, const Standard_Integer aTypeFlag, const Handle(TCollection_HAsciiString)& aDesignator, const Handle(IGESGraph_TextDisplayTemplate)& aTemplate, const Handle(IGESDraw_HArray1OfConnectPoint)& allConnectPoints); - //! returns Network Subfigure Definition Entity specified by this entity - Standard_EXPORT Handle(IGESDraw_NetworkSubfigureDef) SubfigureDefinition() const; - + const Handle(IGESDraw_NetworkSubfigureDef) & SubfigureDefinition() const { return theSubfigureDefinition; } + //! returns Translation Data relative to either model space or to //! the definition space of a referring entity - Standard_EXPORT gp_XYZ Translation() const; - + const gp_XYZ & Translation() const { return theTranslation; } + //! returns the Transformed Translation Data relative to either model //! space or to the definition space of a referring entity Standard_EXPORT gp_XYZ TransformedTranslation() const; //! returns Scale factor in definition space(x, y, z axes) - Standard_EXPORT gp_XYZ ScaleFactors() const; - + const gp_XYZ & ScaleFactors() const { return theScaleFactor; } + //! returns Type Flag which implements the distinction between Logical //! design and Physical design data,and is required if both are present. //! Type Flag = 0 : Not specified (default) //! = 1 : Logical //! = 2 : Physical - Standard_EXPORT Standard_Integer TypeFlag() const; - + Standard_Integer TypeFlag() const { return theTypeFlag; } + //! returns the primary reference designator - Standard_EXPORT Handle(TCollection_HAsciiString) ReferenceDesignator() const; - + const Handle(TCollection_HAsciiString) & ReferenceDesignator() const { return theDesignator; } + //! returns True if Text Display Template Entity is specified, //! else False - Standard_EXPORT Standard_Boolean HasDesignatorTemplate() const; - + Standard_Boolean HasDesignatorTemplate() const { return (! theDesignatorTemplate.IsNull() ); } + //! returns primary reference designator Text Display Template Entity, //! or null. If null, no Text Display Template Entity specified - Standard_EXPORT Handle(IGESGraph_TextDisplayTemplate) DesignatorTemplate() const; - + const Handle(IGESGraph_TextDisplayTemplate) & DesignatorTemplate() const { return theDesignatorTemplate; } + //! returns the number of associated Connect Point Entities Standard_EXPORT Standard_Integer NbConnectPoints() const; //! returns the Index'th associated Connect point Entity //! raises exception if Index <= 0 or Index > NbConnectPoints() - Standard_EXPORT Handle(IGESDraw_ConnectPoint) ConnectPoint (const Standard_Integer Index) const; - - + Standard_EXPORT const Handle(IGESDraw_ConnectPoint) & ConnectPoint (const Standard_Integer Index) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESDraw_NetworkSubfigure,IGESData_IGESEntity) - -protected: + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; -private: + DEFINE_STANDARD_RTTIEXT(IGESDraw_NetworkSubfigure,IGESData_IGESEntity) + private: - Handle(IGESDraw_NetworkSubfigureDef) theSubfigureDefinition; + Interface_Pointer theSubfigureDefinition; gp_XYZ theTranslation; gp_XYZ theScaleFactor; Standard_Integer theTypeFlag; Handle(TCollection_HAsciiString) theDesignator; - Handle(IGESGraph_TextDisplayTemplate) theDesignatorTemplate; + Interface_Pointer theDesignatorTemplate; Handle(IGESDraw_HArray1OfConnectPoint) theConnectPoints; - - }; - - - - - - #endif // _IGESDraw_NetworkSubfigure_HeaderFile diff --git a/src/IGESDraw/IGESDraw_NetworkSubfigureDef.cxx b/src/IGESDraw/IGESDraw_NetworkSubfigureDef.cxx index 42a319966a..f558cc9aac 100644 --- a/src/IGESDraw/IGESDraw_NetworkSubfigureDef.cxx +++ b/src/IGESDraw/IGESDraw_NetworkSubfigureDef.cxx @@ -16,102 +16,146 @@ //-------------------------------------------------------------------- //-------------------------------------------------------------------- -#include #include #include #include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_NetworkSubfigureDef,IGESData_IGESEntity) -IGESDraw_NetworkSubfigureDef::IGESDraw_NetworkSubfigureDef () { } - - - void IGESDraw_NetworkSubfigureDef::Init - (const Standard_Integer aDepth, - const Handle(TCollection_HAsciiString)& aName, - const Handle(IGESData_HArray1OfIGESEntity)& allEntities, - const Standard_Integer aTypeFlag, - const Handle(TCollection_HAsciiString)& aDesignator, - const Handle(IGESGraph_TextDisplayTemplate)& aTemplate, - const Handle(IGESDraw_HArray1OfConnectPoint)& allPointEntities) -{ - if (!allPointEntities.IsNull()) - if (allPointEntities->Lower() != 1 || allEntities->Lower() != 1) - Standard_DimensionMismatch::Raise("IGESDraw_NetworkSubfigureDef : Init"); - theDepth = aDepth; - theName = aName; - theEntities = allEntities; - theTypeFlag = aTypeFlag; - theDesignator = aDesignator; - theDesignatorTemplate = aTemplate; - thePointEntities = allPointEntities; - InitTypeAndForm(320,0); -} - - Standard_Integer IGESDraw_NetworkSubfigureDef::Depth () const +Standard_Integer IGESDraw_NetworkSubfigureDef::NbEntities () const { - return theDepth; + return theEntities->Length(); } - Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigureDef::Name () const +const Handle(IGESData_IGESEntity) & IGESDraw_NetworkSubfigureDef::Entity (const Standard_Integer Index) const { - return theName; + return theEntities->Value(Index); + // if Index is out of bound HArray1 will raise OutOfRange exception } - Standard_Integer IGESDraw_NetworkSubfigureDef::NbEntities () const +Standard_Integer IGESDraw_NetworkSubfigureDef::NbPointEntities () const { - return theEntities->Length(); + return (thePointEntities.IsNull() ? 0 : thePointEntities->Length()); } - Handle(IGESData_IGESEntity) IGESDraw_NetworkSubfigureDef::Entity - (const Standard_Integer Index) const +Standard_Boolean IGESDraw_NetworkSubfigureDef::HasPointEntity (const Standard_Integer Index) const { - return theEntities->Value(Index); + if (thePointEntities.IsNull()) return Standard_False; + return (! thePointEntities->Value(Index).IsNull()); // if Index is out of bound HArray1 will raise OutOfRange exception } - Standard_Integer IGESDraw_NetworkSubfigureDef::TypeFlag () const +const Handle(IGESDraw_ConnectPoint) & IGESDraw_NetworkSubfigureDef::PointEntity (const Standard_Integer Index) const { - return theTypeFlag; + return thePointEntities->Value(Index); + // if Index is out of bound HArray1 will raise OutOfRange exception } - Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigureDef::Designator - () const +void IGESDraw_NetworkSubfigureDef::OwnRead (IGESFile_Reader &PR) { - return theDesignator; + PR.ReadInteger(theDepth,"Depth Of Subfigure"); + PR.ReadText(theName,"Subfigure Name"); + + Standard_Integer tempNbEntities1 = 0; + PR.ReadInteger(tempNbEntities1,"Number Of Child Entities"); + if (tempNbEntities1 > 0) + { + theEntities = new IGESData_HArray1OfIGESEntity (1, tempNbEntities1); + for (Standard_Integer i = 1; i <= tempNbEntities1; i++) + PR.ReadPointer(theEntities->ChangeValue(i),"Child Entity"); + } + else if (tempNbEntities1 < 0) + PR.AddFail("Number Of Child Entities : Not Positive"); + + PR.ReadInteger(theTypeFlag,"Type Flag"); + + if (PR.ReadText(theDesignator,"Primary Reference Designator") == IGESFile_Reader::ParamEmpty) + PR.AddWarning("Primary Reference Designator : Null"); + + PR.ReadPointer(theDesignatorTemplate,"Primary Reference Designator",Standard_True); + + Standard_Integer tempNbEntities2 = 0; + PR.ReadInteger(tempNbEntities2,"Number Of Connect Points"); + if (tempNbEntities2 > 0) + { + thePointEntities = new IGESDraw_HArray1OfConnectPoint (1, tempNbEntities2); + for (Standard_Integer i = 1; i <= tempNbEntities2; i++) + PR.ReadPointer(thePointEntities->ChangeValue(i),"Associated Connect Point Entity",Standard_True); + } + else if (tempNbEntities2 < 0) + PR.AddFail("Number Of Connect Points : Less Than Zero"); } - Standard_Boolean IGESDraw_NetworkSubfigureDef::HasDesignatorTemplate () const +void IGESDraw_NetworkSubfigureDef::OwnWrite (IGESData_IGESWriter &IW) const { - return (! theDesignatorTemplate.IsNull()); + IW.Send(theDepth); + IW.Send(theName); + Standard_Integer I, up = NbEntities(); + IW.Send(up); + for (I = 1; I <= up; I++) + IW.Send(Entity(I)); + IW.Send(theTypeFlag); + IW.Send(theDesignator); + IW.Send(theDesignatorTemplate); + up = NbPointEntities(); + IW.Send(up); + for (I = 1; I <= up; I++) + IW.Send(PointEntity(I)); } - Handle(IGESGraph_TextDisplayTemplate) - IGESDraw_NetworkSubfigureDef::DesignatorTemplate () const +void IGESDraw_NetworkSubfigureDef::OwnShared (Interface_EntityIterator &iter) const { - return theDesignatorTemplate; + Standard_Integer I, up = NbEntities(); + for (I = 1; I <= up; I++) + iter.GetOneItem(Entity(I)); + up = NbPointEntities(); + for (I = 1; I <= up; I++) + iter.GetOneItem(PointEntity(I)); } - Standard_Integer IGESDraw_NetworkSubfigureDef::NbPointEntities () const +IGESData_DirChecker IGESDraw_NetworkSubfigureDef::DirChecker () const { - return (thePointEntities.IsNull() ? 0 : thePointEntities->Length()); + IGESData_DirChecker DC(320, 0); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefAny); + DC.LineWeight(IGESData_DefValue); + DC.BlankStatusIgnored(); + DC.UseFlagRequired(2); + DC.GraphicsIgnored(1); + return DC; } - Standard_Boolean IGESDraw_NetworkSubfigureDef::HasPointEntity - (const Standard_Integer Index) const +void IGESDraw_NetworkSubfigureDef::OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &ach) const { - if (thePointEntities.IsNull()) return Standard_False; - return (! thePointEntities->Value(Index).IsNull()); - // if Index is out of bound HArray1 will raise OutOfRange exception + if ((theTypeFlag < 0) || (theTypeFlag > 2)) + ach->AddFail("TypeFlag has Invalid value"); + if (theDesignator.IsNull()) + ach->AddFail("Primary Reference Designator : not defined"); } - Handle(IGESDraw_ConnectPoint) IGESDraw_NetworkSubfigureDef::PointEntity - (const Standard_Integer Index) const +void IGESDraw_NetworkSubfigureDef::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const { - return thePointEntities->Value(Index); - // if Index is out of bound HArray1 will raise OutOfRange exception + const Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1; + S << "IGESDraw_NetworkSubfigureDef" << endl; + S << "Depth Of Subfigure(Nesting) : " << theDepth << endl; + S << "Name Of Subfigure : "; + IGESData_DumpString(S,theName); + S << endl << "Associated Entities : "; + IGESData_DumpEntities(S,dumper,level,1,NbEntities(),Entity); + S << endl << "Type Flag : " << theTypeFlag << endl; + S << "Primary Reference Designator : "; + IGESData_DumpString(S,theDesignator); + S << endl << "Text Display Template Entity : "; + dumper.Dump(theDesignatorTemplate,S,tempSubLevel); + S << endl << "Connect Point Entities : "; + IGESData_DumpEntities(S,dumper,level,1,NbPointEntities(),PointEntity); + S << endl; } diff --git a/src/IGESDraw/IGESDraw_NetworkSubfigureDef.hxx b/src/IGESDraw/IGESDraw_NetworkSubfigureDef.hxx index 503370f64b..b6d6f3ffb7 100644 --- a/src/IGESDraw/IGESDraw_NetworkSubfigureDef.hxx +++ b/src/IGESDraw/IGESDraw_NetworkSubfigureDef.hxx @@ -17,24 +17,14 @@ #ifndef _IGESDraw_NetworkSubfigureDef_HeaderFile #define _IGESDraw_NetworkSubfigureDef_HeaderFile -#include -#include - -#include #include #include #include -#include class TCollection_HAsciiString; class IGESGraph_TextDisplayTemplate; -class Standard_OutOfRange; -class IGESData_IGESEntity; class IGESDraw_ConnectPoint; -class IGESDraw_NetworkSubfigureDef; -DEFINE_STANDARD_HANDLE(IGESDraw_NetworkSubfigureDef, IGESData_IGESEntity) - //! defines IGESNetworkSubfigureDef, //! Type <320> Form Number <0> in package IGESDraw //! @@ -49,36 +39,23 @@ DEFINE_STANDARD_HANDLE(IGESDraw_NetworkSubfigureDef, IGESData_IGESEntity) //! the instance must be indicated by a null(zero) pointer. class IGESDraw_NetworkSubfigureDef : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 320; } - - Standard_EXPORT IGESDraw_NetworkSubfigureDef(); - - //! This method is used to set fields of the class - //! NetworkSubfigureDef - //! - aDepth : Depth of Subfigure - //! (indicating the amount of nesting) - //! - aName : Subfigure Name - //! - allEntities : Associated subfigures Entities exclusive - //! of primary reference designator and - //! Control Points. - //! - aTypeFlag : Type flag determines which Entity - //! belongs in which design - //! (Logical design or Physical design) - //! - aDesignator : Designator HAsciiString and its Template - //! - allPointEntities : Associated Connect Point Entities - Standard_EXPORT void Init (const Standard_Integer aDepth, const Handle(TCollection_HAsciiString)& aName, const Handle(IGESData_HArray1OfIGESEntity)& allEntities, const Standard_Integer aTypeFlag, const Handle(TCollection_HAsciiString)& aDesignator, const Handle(IGESGraph_TextDisplayTemplate)& aTemplate, const Handle(IGESDraw_HArray1OfConnectPoint)& allPointEntities); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 0; } + + IGESDraw_NetworkSubfigureDef() {} //! returns Depth of Subfigure(indication the amount of nesting) //! Note : The Depth is inclusive of both Network Subfigure Definition //! Entity and the Ordinary Subfigure Definition Entity. //! Thus, the two may be nested. - Standard_EXPORT Standard_Integer Depth() const; - + Standard_Integer Depth() const { return theDepth; } + //! returns the Subfigure Name - Standard_EXPORT Handle(TCollection_HAsciiString) Name() const; - + const Handle(TCollection_HAsciiString) & Name() const { return theName; } + //! returns Number of Associated(child) entries in subfigure exclusive //! of primary reference designator and Control Points Standard_EXPORT Standard_Integer NbEntities() const; @@ -86,24 +63,24 @@ public: //! returns the Index'th IGESEntity in subfigure exclusive of primary //! reference designator and Control Points //! raises exception if Index <=0 or Index > NbEntities() - Standard_EXPORT Handle(IGESData_IGESEntity) Entity (const Standard_Integer Index) const; + Standard_EXPORT const Handle(IGESData_IGESEntity) & Entity (const Standard_Integer Index) const; //! return value = 0 : Not Specified //! = 1 : Logical design //! = 2 : Physical design - Standard_EXPORT Standard_Integer TypeFlag() const; - + Standard_Integer TypeFlag() const { return theTypeFlag; } + //! returns Primary Reference Designator - Standard_EXPORT Handle(TCollection_HAsciiString) Designator() const; - + const Handle(TCollection_HAsciiString) & Designator() const { return theDesignator; } + //! returns True if Text Display Template is specified for //! primary designator else returns False - Standard_EXPORT Standard_Boolean HasDesignatorTemplate() const; - + Standard_Boolean HasDesignatorTemplate() const { return (! theDesignatorTemplate.IsNull()); } + //! if Text Display Template specified then return TextDisplayTemplate //! else return NULL Handle - Standard_EXPORT Handle(IGESGraph_TextDisplayTemplate) DesignatorTemplate() const; - + const Handle(IGESGraph_TextDisplayTemplate) & DesignatorTemplate() const { return theDesignatorTemplate; } + //! returns the Number Of Associated(child) Connect Point Entities Standard_EXPORT Standard_Integer NbPointEntities() const; @@ -114,36 +91,31 @@ public: //! returns the Index'th Associated Connect Point Entity //! raises exception if Index <= 0 or Index > NbPointEntities() - Standard_EXPORT Handle(IGESDraw_ConnectPoint) PointEntity (const Standard_Integer Index) const; - - - + Standard_EXPORT const Handle(IGESDraw_ConnectPoint) & PointEntity (const Standard_Integer Index) const; - DEFINE_STANDARD_RTTIEXT(IGESDraw_NetworkSubfigureDef,IGESData_IGESEntity) + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; -protected: + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; -private: + DEFINE_STANDARD_RTTIEXT(IGESDraw_NetworkSubfigureDef,IGESData_IGESEntity) + private: Standard_Integer theDepth; Handle(TCollection_HAsciiString) theName; Handle(IGESData_HArray1OfIGESEntity) theEntities; Standard_Integer theTypeFlag; Handle(TCollection_HAsciiString) theDesignator; - Handle(IGESGraph_TextDisplayTemplate) theDesignatorTemplate; + Interface_Pointer theDesignatorTemplate; Handle(IGESDraw_HArray1OfConnectPoint) thePointEntities; - - }; - - - - - - #endif // _IGESDraw_NetworkSubfigureDef_HeaderFile diff --git a/src/IGESDraw/IGESDraw_PerspectiveView.cxx b/src/IGESDraw/IGESDraw_PerspectiveView.cxx index 2210330705..80fcb0e66c 100644 --- a/src/IGESDraw/IGESDraw_PerspectiveView.cxx +++ b/src/IGESDraw/IGESDraw_PerspectiveView.cxx @@ -23,135 +23,182 @@ #include #include #include -#include #include -#include -#include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_PerspectiveView,IGESData_ViewKindEntity) -IGESDraw_PerspectiveView::IGESDraw_PerspectiveView () { } - - -// This class inherits from IGESData_ViewKindEntity - - void IGESDraw_PerspectiveView::Init - (const Standard_Integer aViewNumber, - const Standard_Real aScaleFactor, - const gp_XYZ& aViewNormalVector, - const gp_XYZ& aViewReferencePoint, - const gp_XYZ& aCenterOfProjection, - const gp_XYZ& aViewUpVector, - const Standard_Real aViewPlaneDistance, - const gp_XY& aTopLeft, - const gp_XY& aBottomRight, - const Standard_Integer aDepthClip, - const Standard_Real aBackPlaneDistance, - const Standard_Real aFrontPlaneDistance) -{ - theViewNumber = aViewNumber; - theScaleFactor = aScaleFactor; - theViewNormalVector = aViewNormalVector; - theViewReferencePoint = aViewReferencePoint; - theCenterOfProjection = aCenterOfProjection; - theViewUpVector = aViewUpVector; - theViewPlaneDistance = aViewPlaneDistance; - theTopLeft = aTopLeft; - theBottomRight = aBottomRight; - theDepthClip = aDepthClip; - theBackPlaneDistance = aBackPlaneDistance; - theFrontPlaneDistance = aFrontPlaneDistance; - InitTypeAndForm(410,1); -} - - Standard_Boolean IGESDraw_PerspectiveView::IsSingle () const +Standard_Boolean IGESDraw_PerspectiveView::IsSingle () const { return Standard_True; } - Standard_Integer IGESDraw_PerspectiveView::NbViews () const -{ return 1; } - - Handle(IGESData_ViewKindEntity) IGESDraw_PerspectiveView::ViewItem - (const Standard_Integer) const -{ return Handle(IGESData_ViewKindEntity)::DownCast (This()); } - - - Standard_Integer IGESDraw_PerspectiveView::ViewNumber () const +Standard_Integer IGESDraw_PerspectiveView::NbViews () const { - return theViewNumber; + return 1; } - Standard_Real IGESDraw_PerspectiveView::ScaleFactor () const +Handle(IGESData_ViewKindEntity) IGESDraw_PerspectiveView::ViewItem (const Standard_Integer) const { - return theScaleFactor; + return Handle(IGESData_ViewKindEntity)(this); } - gp_Vec IGESDraw_PerspectiveView::ViewNormalVector () const +gp_Vec IGESDraw_PerspectiveView::ViewNormalVector () const { gp_Vec tempRes(theViewNormalVector); return tempRes; } - gp_Pnt IGESDraw_PerspectiveView::ViewReferencePoint () const +gp_Pnt IGESDraw_PerspectiveView::ViewReferencePoint () const { gp_Pnt tempRes(theViewReferencePoint); return tempRes; } - gp_Pnt IGESDraw_PerspectiveView::CenterOfProjection () const +gp_Pnt IGESDraw_PerspectiveView::CenterOfProjection () const { gp_Pnt tempRes(theCenterOfProjection); return tempRes; } - gp_Vec IGESDraw_PerspectiveView::ViewUpVector () const +gp_Vec IGESDraw_PerspectiveView::ViewUpVector () const { gp_Vec tempRes(theViewUpVector); return tempRes; } - Standard_Real IGESDraw_PerspectiveView::ViewPlaneDistance () const -{ - return theViewPlaneDistance; -} - - gp_Pnt2d IGESDraw_PerspectiveView::TopLeft () const +gp_Pnt2d IGESDraw_PerspectiveView::TopLeft () const { gp_Pnt2d tempRes(theTopLeft); return tempRes; } - gp_Pnt2d IGESDraw_PerspectiveView::BottomRight () const +gp_Pnt2d IGESDraw_PerspectiveView::BottomRight () const { gp_Pnt2d tempRes(theBottomRight); return tempRes; } - Standard_Integer IGESDraw_PerspectiveView::DepthClip () const -{ - return theDepthClip; -} - - Standard_Real IGESDraw_PerspectiveView::BackPlaneDistance () const -{ - return theBackPlaneDistance; -} - - Standard_Real IGESDraw_PerspectiveView::FrontPlaneDistance () const -{ - return theFrontPlaneDistance; -} - - Handle(IGESData_TransfEntity) IGESDraw_PerspectiveView::ViewMatrix () const -{ - return (Transf()); -} - - gp_XYZ IGESDraw_PerspectiveView::ModelToView - (const gp_XYZ& coords) const +gp_XYZ IGESDraw_PerspectiveView::ModelToView (const gp_XYZ& coords) const { gp_XYZ tempCoords = coords; Location().Transforms(tempCoords); return (tempCoords); } + +void IGESDraw_PerspectiveView::OwnRead (IGESFile_Reader &PR) +{ + PR.ReadInteger(theViewNumber,"View Number"); + PR.ReadReal(theScaleFactor,"Scale Number"); + PR.ReadXYZ(theViewNormalVector,"View Plane Normal Vector"); + PR.ReadXYZ(theViewReferencePoint,"View Reference Point"); + PR.ReadXYZ(theCenterOfProjection,"Center Of Projection"); + PR.ReadXYZ(theViewUpVector,"View Up Vector"); + PR.ReadReal(theViewPlaneDistance,"View Plane Distance"); + + Standard_Real r = 0.; + PR.ReadReal(r,"Left Side Of Clipping Window"); + theTopLeft.SetX(r); + + r = 0.; + PR.ReadReal(r,"Right Side Of Clipping Window"); + theBottomRight.SetX(r); + + r = 0.; + PR.ReadReal(r,"Bottom Of Clipping Window"); + theBottomRight.SetY(r); + + r = 0.; + PR.ReadReal(r,"Top Of Clipping Window"); + theTopLeft.SetY(r); + + PR.ReadInteger(theDepthClip,"Depth Clipping Indicator"); + PR.ReadReal(theBackPlaneDistance,"Back Plane Distance"); + PR.ReadReal(theFrontPlaneDistance,"Front Plane Distance"); +} + +void IGESDraw_PerspectiveView::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(theViewNumber); + IW.Send(theScaleFactor); + IW.Send(theViewNormalVector.X()); + IW.Send(theViewNormalVector.Y()); + IW.Send(theViewNormalVector.Z()); + IW.Send(theViewReferencePoint.X()); + IW.Send(theViewReferencePoint.Y()); + IW.Send(theViewReferencePoint.Z()); + IW.Send(theCenterOfProjection.X()); + IW.Send(theCenterOfProjection.Y()); + IW.Send(theCenterOfProjection.Z()); + IW.Send(theViewUpVector.X()); + IW.Send(theViewUpVector.Y()); + IW.Send(theViewUpVector.Z()); + IW.Send(theViewPlaneDistance); + IW.Send(theTopLeft.X()); + IW.Send(theBottomRight.X()); + IW.Send(theBottomRight.Y()); + IW.Send(theTopLeft.Y()); + IW.Send(theDepthClip); + IW.Send(theBackPlaneDistance); + IW.Send(theFrontPlaneDistance); +} + +IGESData_DirChecker IGESDraw_PerspectiveView::DirChecker () const +{ + IGESData_DirChecker DC(410, 1); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagRequired(1); + DC.HierarchyStatusIgnored(); + return DC; +} + +void IGESDraw_PerspectiveView::OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &ach) const +{ + if ((theDepthClip < 0) || (theDepthClip > 3)) + ach->AddFail("DepthClip has invalid value"); + if (HasTransf()) { + if (Transf()->FormNumber() != 0) + ach->AddFail("Associated Matrix has not Form Number 0"); + } +} + +void IGESDraw_PerspectiveView::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESDraw_PerspectiveView" << endl; + S << "View Number : " << theViewNumber << " "; + S << "Scale Factor : " << theScaleFactor << endl; + S << "View Plane Normal Vector : "; + IGESData_DumpXYZL(S,level,theViewNormalVector,Location()); + S << endl << "View Reference Point : "; + IGESData_DumpXYZL(S,level,theViewReferencePoint,Location()); + S << endl << "Center Of Projection : "; + IGESData_DumpXYZL(S,level,theCenterOfProjection,Location()); + S << endl << "View Up Vector : "; + IGESData_DumpXYZL(S,level,theViewUpVector,Location()); + S << endl << "View Plane Distance : " << theViewPlaneDistance << endl; + S << "Left Side Of Clipping Window : " << theTopLeft.X() << endl; + S << "Right Side Of Clipping Window : " << theBottomRight.X() << endl; + S << "Bottom Side Of Clipping Window : " << theBottomRight.Y() << endl; + S << "Top Side Of Clipping Window : " << theTopLeft.Y() << endl; + S << "Depth Clipping : " << theDepthClip; + switch (theDepthClip) { + case 0 : S << " (No Depth Clipping)" << endl; break; + case 1 : S << " (Back Clipping Plane ON)" << endl; break; + case 2 : S << " (Front Clipping Plane ON)" << endl; break; + case 3 : S << " (Front and Back Clipping Planes ON)" << endl; break; + default : S << " (Invalid Value)" << endl; break; + } + S << "Back Plane Distance : " << theBackPlaneDistance << " "; + S << "Front Plane Distance : " << theFrontPlaneDistance << endl; + S << endl; +} diff --git a/src/IGESDraw/IGESDraw_PerspectiveView.hxx b/src/IGESDraw/IGESDraw_PerspectiveView.hxx index b6f2ed66e0..c067896d01 100644 --- a/src/IGESDraw/IGESDraw_PerspectiveView.hxx +++ b/src/IGESDraw/IGESDraw_PerspectiveView.hxx @@ -17,28 +17,15 @@ #ifndef _IGESDraw_PerspectiveView_HeaderFile #define _IGESDraw_PerspectiveView_HeaderFile -#include -#include - -#include -#include #include #include #include -#include -class Standard_OutOfRange; -class gp_XYZ; -class gp_XY; -class IGESData_ViewKindEntity; class gp_Vec; class gp_Pnt; class gp_Pnt2d; class IGESData_TransfEntity; -class IGESDraw_PerspectiveView; -DEFINE_STANDARD_HANDLE(IGESDraw_PerspectiveView, IGESData_ViewKindEntity) - //! defines IGESPerspectiveView, Type <410> Form <1> //! in package IGESDraw //! @@ -55,43 +42,29 @@ DEFINE_STANDARD_HANDLE(IGESDraw_PerspectiveView, IGESData_ViewKindEntity) //! through the view plane. class IGESDraw_PerspectiveView : public IGESData_ViewKindEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 410; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 1; } + + IGESDraw_PerspectiveView() {} - - Standard_EXPORT IGESDraw_PerspectiveView(); - - //! This method is used to set the fields of the class - //! PerspectiveView - //! - aViewNumber : The desired view - //! - aScaleFactor : Scale factor - //! - aViewNormalVector : View plane normal vector (model space) - //! - aViewReferencePoint : View reference point (model space) - //! - aCenterOfProjection : Center Of Projection (model space) - //! - aViewUpVector : View up vector (model space) - //! - aViewPlaneDistance : View plane distance (model space) - //! - aTopLeft : Top-left point of clipping window - //! - aBottomRight : Bottom-right point of clipping window - //! - aDepthClip : Depth clipping indicator - //! - aBackPlaneDistance : Distance of back clipping plane - //! - aFrontPlaneDistance : Distance of front clipping plane - Standard_EXPORT void Init (const Standard_Integer aViewNumber, const Standard_Real aScaleFactor, const gp_XYZ& aViewNormalVector, const gp_XYZ& aViewReferencePoint, const gp_XYZ& aCenterOfProjection, const gp_XYZ& aViewUpVector, const Standard_Real aViewPlaneDistance, const gp_XY& aTopLeft, const gp_XY& aBottomRight, const Standard_Integer aDepthClip, const Standard_Real aBackPlaneDistance, const Standard_Real aFrontPlaneDistance); - //! Returns True (for a single view) - Standard_EXPORT Standard_Boolean IsSingle() const Standard_OVERRIDE; + Standard_EXPORT virtual Standard_Boolean IsSingle() const Standard_OVERRIDE; //! Returns 1 (single view) - Standard_EXPORT Standard_Integer NbViews() const Standard_OVERRIDE; + Standard_EXPORT virtual Standard_Integer NbViews() const Standard_OVERRIDE; //! For a single view, returns whatever - Standard_EXPORT Handle(IGESData_ViewKindEntity) ViewItem (const Standard_Integer num) const Standard_OVERRIDE; + Standard_EXPORT virtual Handle(IGESData_ViewKindEntity) ViewItem (const Standard_Integer num) const Standard_OVERRIDE; //! returns the view number associated with - Standard_EXPORT Standard_Integer ViewNumber() const; - + Standard_Integer ViewNumber() const { return theViewNumber; } + //! returns the scale factor associated with - Standard_EXPORT Standard_Real ScaleFactor() const; - + Standard_Real ScaleFactor() const { return theScaleFactor; } + //! returns the View plane normal vector (model space) Standard_EXPORT gp_Vec ViewNormalVector() const; @@ -105,8 +78,8 @@ public: Standard_EXPORT gp_Vec ViewUpVector() const; //! returns the View plane distance (model space) - Standard_EXPORT Standard_Real ViewPlaneDistance() const; - + Standard_Real ViewPlaneDistance() const { return theViewPlaneDistance; } + //! returns the top left point of the clipping window Standard_EXPORT gp_Pnt2d TopLeft() const; @@ -118,35 +91,36 @@ public: //! 1 = Back clipping plane ON //! 2 = Front clipping plane ON //! 3 = Back and front clipping planes ON - Standard_EXPORT Standard_Integer DepthClip() const; - + Standard_Integer DepthClip() const { return theDepthClip; } + //! returns the View coordinate denoting the location of //! the back clipping plane - Standard_EXPORT Standard_Real BackPlaneDistance() const; - + Standard_Real BackPlaneDistance() const { return theBackPlaneDistance; } + //! returns the View coordinate denoting the location of //! the front clipping plane - Standard_EXPORT Standard_Real FrontPlaneDistance() const; - + Standard_Real FrontPlaneDistance() const { return theFrontPlaneDistance; } + //! returns the Transformation Matrix - Standard_EXPORT Handle(IGESData_TransfEntity) ViewMatrix() const; - + Handle(IGESData_TransfEntity) ViewMatrix() const { return Transf(); } + //! returns XYX from the Model space to the View space by //! applying the View Matrix Standard_EXPORT gp_XYZ ModelToView (const gp_XYZ& coords) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &) const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESDraw_PerspectiveView,IGESData_ViewKindEntity) - -protected: - - - + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; -private: + DEFINE_STANDARD_RTTIEXT(IGESDraw_PerspectiveView,IGESData_ViewKindEntity) + private: Standard_Integer theViewNumber; Standard_Real theScaleFactor; @@ -160,14 +134,6 @@ private: Standard_Integer theDepthClip; Standard_Real theBackPlaneDistance; Standard_Real theFrontPlaneDistance; - - }; - - - - - - #endif // _IGESDraw_PerspectiveView_HeaderFile diff --git a/src/IGESDraw/IGESDraw_Planar.cxx b/src/IGESDraw/IGESDraw_Planar.cxx index 6b71a6a8ae..207bd67034 100644 --- a/src/IGESDraw/IGESDraw_Planar.cxx +++ b/src/IGESDraw/IGESDraw_Planar.cxx @@ -16,55 +16,93 @@ //-------------------------------------------------------------------- //-------------------------------------------------------------------- -#include #include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_Planar,IGESData_IGESEntity) -IGESDraw_Planar::IGESDraw_Planar () { } - +Standard_Integer IGESDraw_Planar::NbEntities () const +{ + return ( theEntities.IsNull()? 0 : theEntities->Length() ); +} - void IGESDraw_Planar::Init - (const Standard_Integer nbMats, - const Handle(IGESGeom_TransformationMatrix)& aTransformationMatrix, - const Handle(IGESData_HArray1OfIGESEntity)& allEntities) +const Handle(IGESData_IGESEntity) & IGESDraw_Planar::Entity (const Standard_Integer EntityIndex) const { - if (!allEntities.IsNull()) - if (allEntities->Lower() != 1) - Standard_DimensionMismatch::Raise("IGESDraw_Planar : Init"); - theNbMatrices = nbMats; - theTransformationMatrix = aTransformationMatrix; - theEntities = allEntities; - InitTypeAndForm(402,16); + return theEntities->Value(EntityIndex); } +void IGESDraw_Planar::OwnRead (IGESFile_Reader &PR) +{ + theNbMatrices = 1; + PR.ReadInteger(theNbMatrices,"No. of Transformation matrices"); + if ( theNbMatrices != 1 ) + PR.AddFail("No. of Transformation matrices != 1"); - Standard_Integer IGESDraw_Planar::NbMatrices () const -{ - return theNbMatrices; + Standard_Integer nbval = 0; + PR.ReadInteger(nbval,"No. of Entities in this plane"); + if (nbval <= 0) PR.AddFail ("No. of Entities in this plane : Not Positive"); + + // Reading transformationMatrix(Instance of TransformationMatrix or Null) + PR.ReadPointer(theTransformationMatrix,"Instance of TransformationMatrix",Standard_True); + + if (nbval > 0) + { + theEntities = new IGESData_HArray1OfIGESEntity(1, nbval); + for (Standard_Integer i = 1; i <= nbval; i++) + PR.ReadPointer(theEntities->ChangeValue(i),"Plane entity"); + } } - Standard_Integer IGESDraw_Planar::NbEntities () const -{ - return ( theEntities.IsNull()? 0 : theEntities->Length() ); +void IGESDraw_Planar::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send( theNbMatrices ); + Standard_Integer Up = NbEntities(); + IW.Send( Up ); + IW.Send( theTransformationMatrix ); + for ( Standard_Integer i = 1; i <= Up; i++) + IW.Send( Entity(i) ); } - Standard_Boolean IGESDraw_Planar::IsIdentityMatrix () const +void IGESDraw_Planar::OwnShared (Interface_EntityIterator &iter) const { - return ( theTransformationMatrix.IsNull() ); + Standard_Integer Up = NbEntities(); + iter.GetOneItem( theTransformationMatrix ); + for ( Standard_Integer i = 1; i <= Up; i++) + iter.GetOneItem( Entity(i) ); } - Handle(IGESGeom_TransformationMatrix) IGESDraw_Planar::TransformMatrix () const -{ - return theTransformationMatrix; +IGESData_DirChecker IGESDraw_Planar::DirChecker () const +{ + IGESData_DirChecker DC (402, 16); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagRequired(5); + DC.HierarchyStatusIgnored(); + return DC; } - Handle(IGESData_IGESEntity) IGESDraw_Planar::Entity - (const Standard_Integer EntityIndex) const +void IGESDraw_Planar::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const { - return (theEntities->Value(EntityIndex)); + const Standard_Integer sublevel = (level <= 4) ? 0 : 1; + S << "IGESDraw_Planar" << endl; + S << "No. of Transformation Matrices : " << theNbMatrices << " "; + S << "i.e. : "; + if ( theTransformationMatrix.IsNull() ) + S << "Null Handle"; + else + theTransformationMatrix->OwnDump(dumper,S,sublevel); + S << endl; + S << "Array of Entities on the specified plane : "; + IGESData_DumpEntities(S,dumper,level,1,NbEntities(),Entity); + S << endl; } diff --git a/src/IGESDraw/IGESDraw_Planar.hxx b/src/IGESDraw/IGESDraw_Planar.hxx index c77a7996cb..2cd5344949 100644 --- a/src/IGESDraw/IGESDraw_Planar.hxx +++ b/src/IGESDraw/IGESDraw_Planar.hxx @@ -17,20 +17,10 @@ #ifndef _IGESDraw_Planar_HeaderFile #define _IGESDraw_Planar_HeaderFile -#include -#include - -#include #include #include -#include class IGESGeom_TransformationMatrix; -class Standard_OutOfRange; -class IGESData_IGESEntity; - -class IGESDraw_Planar; -DEFINE_STANDARD_HANDLE(IGESDraw_Planar, IGESData_IGESEntity) //! defines IGESPlanar, Type <402> Form <16> //! in package IGESDraw @@ -39,62 +29,51 @@ DEFINE_STANDARD_HANDLE(IGESDraw_Planar, IGESData_IGESEntity) //! entities may be geometric, annotative, and/or structural. class IGESDraw_Planar : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 402; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 16; } + + IGESDraw_Planar() {} - - Standard_EXPORT IGESDraw_Planar(); - - //! This method is used to set the fields of the class Planar - //! - nbMats : Number of Transformation matrices - //! - aTransformationMatrix : Pointer to the Transformation matrix - //! - allEntities : Pointers to the entities specified - Standard_EXPORT void Init (const Standard_Integer nbMats, const Handle(IGESGeom_TransformationMatrix)& aTransformationMatrix, const Handle(IGESData_HArray1OfIGESEntity)& allEntities); - //! returns the number of Transformation matrices in - Standard_EXPORT Standard_Integer NbMatrices() const; - + Standard_Integer NbMatrices() const { return theNbMatrices; } + //! returns the number of Entities in the plane pointed to by this //! associativity Standard_EXPORT Standard_Integer NbEntities() const; //! returns True if TransformationMatrix is Identity Matrix, //! i.e:- No Matrix defined. - Standard_EXPORT Standard_Boolean IsIdentityMatrix() const; - + Standard_Boolean IsIdentityMatrix() const { return ( theTransformationMatrix.IsNull() ); } + //! returns the Transformation matrix moving data from the XY plane //! into space or zero - Standard_EXPORT Handle(IGESGeom_TransformationMatrix) TransformMatrix() const; - + const Handle(IGESGeom_TransformationMatrix) & TransformMatrix() const { return theTransformationMatrix; } + //! returns the Entity on the specified plane, indicated by EntityIndex //! raises an exception if EntityIndex <= 0 or //! EntityIndex > NbEntities() - Standard_EXPORT Handle(IGESData_IGESEntity) Entity (const Standard_Integer EntityIndex) const; - + Standard_EXPORT const Handle(IGESData_IGESEntity) & Entity (const Standard_Integer EntityIndex) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator &) const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESDraw_Planar,IGESData_IGESEntity) - -protected: - - + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; -private: + DEFINE_STANDARD_RTTIEXT(IGESDraw_Planar,IGESData_IGESEntity) + private: Standard_Integer theNbMatrices; - Handle(IGESGeom_TransformationMatrix) theTransformationMatrix; + Interface_Pointer theTransformationMatrix; Handle(IGESData_HArray1OfIGESEntity) theEntities; - - }; - - - - - - #endif // _IGESDraw_Planar_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ReadWriteModule.cxx b/src/IGESDraw/IGESDraw_ReadWriteModule.cxx deleted file mode 100644 index c34ae1cc1a..0000000000 --- a/src/IGESDraw/IGESDraw_ReadWriteModule.cxx +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_ReadWriteModule,IGESData_ReadWriteModule) - -// Each Module is attached to a Protocol : it must interprete Case Numbers -// (arguments of various methods) in accordance to values returned by -// the method TypeNumber from this Protocol -IGESDraw_ReadWriteModule::IGESDraw_ReadWriteModule () { } - - - Standard_Integer IGESDraw_ReadWriteModule::CaseIGES - (const Standard_Integer typenum, const Standard_Integer formnum) const -{ - switch (typenum) { - case 132 : return 2; - case 320 : return 7; - case 402 : - switch (formnum) { - case 3 : return 13; - case 4 : return 14; - case 5 : return 5; - case 16 : return 9; - case 19 : return 11; - default : break; - } - break; - case 404 : return formnum+3; // 0->3 1->4 - case 410 : - if (formnum == 0) return 12; - else if (formnum == 1) return 8; - break; - case 412 : return 10; - case 414 : return 1; - case 420 : return 6; - default : break; - } - return 0; -} - - - void IGESDraw_ReadWriteModule::ReadOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESDraw_CircArraySubfigure,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolCircArraySubfigure tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 2 : { - DeclareAndCast(IGESDraw_ConnectPoint,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolConnectPoint tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 3 : { - DeclareAndCast(IGESDraw_Drawing,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolDrawing tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 4 : { - DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolDrawingWithRotation tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 5 : { - DeclareAndCast(IGESDraw_LabelDisplay,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolLabelDisplay tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 6 : { - DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolNetworkSubfigure tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 7 : { - DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolNetworkSubfigureDef tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 8 : { - DeclareAndCast(IGESDraw_PerspectiveView,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolPerspectiveView tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 9 : { - DeclareAndCast(IGESDraw_Planar,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolPlanar tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 10 : { - DeclareAndCast(IGESDraw_RectArraySubfigure,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolRectArraySubfigure tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 11 : { - DeclareAndCast(IGESDraw_SegmentedViewsVisible,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolSegmentedViewsVisible tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 12 : { - DeclareAndCast(IGESDraw_View,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolView tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 13 : { - DeclareAndCast(IGESDraw_ViewsVisible,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolViewsVisible tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 14 : { - DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolViewsVisibleWithAttr tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - default : break; - } -} - - - void IGESDraw_ReadWriteModule::WriteOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - IGESData_IGESWriter& IW) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESDraw_CircArraySubfigure,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolCircArraySubfigure tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 2 : { - DeclareAndCast(IGESDraw_ConnectPoint,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolConnectPoint tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 3 : { - DeclareAndCast(IGESDraw_Drawing,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolDrawing tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 4 : { - DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolDrawingWithRotation tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 5 : { - DeclareAndCast(IGESDraw_LabelDisplay,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolLabelDisplay tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 6 : { - DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolNetworkSubfigure tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 7 : { - DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolNetworkSubfigureDef tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 8 : { - DeclareAndCast(IGESDraw_PerspectiveView,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolPerspectiveView tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 9 : { - DeclareAndCast(IGESDraw_Planar,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolPlanar tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 10 : { - DeclareAndCast(IGESDraw_RectArraySubfigure,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolRectArraySubfigure tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 11 : { - DeclareAndCast(IGESDraw_SegmentedViewsVisible,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolSegmentedViewsVisible tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 12 : { - DeclareAndCast(IGESDraw_View,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolView tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 13 : { - DeclareAndCast(IGESDraw_ViewsVisible,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolViewsVisible tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 14 : { - DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolViewsVisibleWithAttr tool; - tool.WriteOwnParams(anent,IW); - } - break; - default : break; - } -} diff --git a/src/IGESDraw/IGESDraw_ReadWriteModule.hxx b/src/IGESDraw/IGESDraw_ReadWriteModule.hxx deleted file mode 100644 index 38a1c6034d..0000000000 --- a/src/IGESDraw/IGESDraw_ReadWriteModule.hxx +++ /dev/null @@ -1,79 +0,0 @@ -// Created on: 1993-09-06 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_ReadWriteModule_HeaderFile -#define _IGESDraw_ReadWriteModule_HeaderFile - -#include -#include - -#include -#include -class Standard_DomainError; -class IGESData_IGESEntity; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; - - -class IGESDraw_ReadWriteModule; -DEFINE_STANDARD_HANDLE(IGESDraw_ReadWriteModule, IGESData_ReadWriteModule) - -//! Defines Draw File Access Module for IGESDraw (specific parts) -//! Specific actions concern : Read and Write Own Parameters of -//! an IGESEntity. -class IGESDraw_ReadWriteModule : public IGESData_ReadWriteModule -{ - -public: - - - //! Creates a ReadWriteModule & puts it into ReaderLib & WriterLib - Standard_EXPORT IGESDraw_ReadWriteModule(); - - //! Defines Case Numbers for Entities of IGESDraw - Standard_EXPORT Standard_Integer CaseIGES (const Standard_Integer typenum, const Standard_Integer formnum) const Standard_OVERRIDE; - - //! Reads own parameters from file for an Entity of IGESDraw - Standard_EXPORT void ReadOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const Standard_OVERRIDE; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, IGESData_IGESWriter& IW) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IGESDraw_ReadWriteModule,IGESData_ReadWriteModule) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IGESDraw_ReadWriteModule_HeaderFile diff --git a/src/IGESDraw/IGESDraw_RectArraySubfigure.cxx b/src/IGESDraw/IGESDraw_RectArraySubfigure.cxx index 46b61aafbe..e2ee3344db 100644 --- a/src/IGESDraw/IGESDraw_RectArraySubfigure.cxx +++ b/src/IGESDraw/IGESDraw_RectArraySubfigure.cxx @@ -19,62 +19,24 @@ #include #include #include -#include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_RectArraySubfigure,IGESData_IGESEntity) -IGESDraw_RectArraySubfigure::IGESDraw_RectArraySubfigure () { } - - - void IGESDraw_RectArraySubfigure::Init - (const Handle(IGESData_IGESEntity)& aBase, - const Standard_Real aScale, - const gp_XYZ& aCorner, - const Standard_Integer nbCols, - const Standard_Integer nbRows, - const Standard_Real hDisp, - const Standard_Real vtDisp, - const Standard_Real rotationAngle, - const Standard_Integer doDont, - const Handle(TColStd_HArray1OfInteger)& allNumPos) -{ - if (!allNumPos.IsNull()) - if (allNumPos->Lower() != 1) - Standard_DimensionMismatch::Raise("IGESDraw_RectArraySubfigure : Init"); - theBaseEntity = aBase; - theScaleFactor = aScale; - theLowerLeftCorner = aCorner; - theNbColumns = nbCols; - theNbRows = nbRows; - theColumnSeparation = hDisp; - theRowSeparation = vtDisp; - theRotationAngle = rotationAngle; - theDoDontFlag = doDont != 0; - thePositions = allNumPos; - InitTypeAndForm(412,0); -} - - Handle(IGESData_IGESEntity) IGESDraw_RectArraySubfigure::BaseEntity () const -{ - return theBaseEntity; -} - - Standard_Real IGESDraw_RectArraySubfigure::ScaleFactor () const -{ - return theScaleFactor; -} - - gp_Pnt IGESDraw_RectArraySubfigure::LowerLeftCorner () const +gp_Pnt IGESDraw_RectArraySubfigure::LowerLeftCorner () const { gp_Pnt tempLowerLeftCorner(theLowerLeftCorner); return tempLowerLeftCorner; } - gp_Pnt IGESDraw_RectArraySubfigure::TransformedLowerLeftCorner () const +gp_Pnt IGESDraw_RectArraySubfigure::TransformedLowerLeftCorner () const { gp_XYZ tempLowerLeftCorner = theLowerLeftCorner; if (HasTransf()) Location().Transforms(tempLowerLeftCorner); @@ -83,49 +45,13 @@ IGESDraw_RectArraySubfigure::IGESDraw_RectArraySubfigure () { } return (tempRes); } - Standard_Integer IGESDraw_RectArraySubfigure::NbColumns () const -{ - return theNbColumns; -} - - Standard_Integer IGESDraw_RectArraySubfigure::NbRows () const -{ - return theNbRows; -} - - Standard_Real IGESDraw_RectArraySubfigure::ColumnSeparation () const -{ - return theColumnSeparation; -} - - Standard_Real IGESDraw_RectArraySubfigure::RowSeparation () const -{ - return theRowSeparation; -} - - Standard_Real IGESDraw_RectArraySubfigure::RotationAngle () const -{ - return theRotationAngle; -} - - Standard_Boolean IGESDraw_RectArraySubfigure::DisplayFlag () const -{ - return (thePositions.IsNull()); -} - - Standard_Integer IGESDraw_RectArraySubfigure::ListCount () const +Standard_Integer IGESDraw_RectArraySubfigure::ListCount () const { return ( thePositions.IsNull() ? 0 : thePositions->Length() ); // Return 0 if HArray1 thePositions is NULL Handle } - Standard_Boolean IGESDraw_RectArraySubfigure::DoDontFlag () const -{ - return (theDoDontFlag); -} - - Standard_Boolean IGESDraw_RectArraySubfigure::PositionNum - (const Standard_Integer Index) const +Standard_Boolean IGESDraw_RectArraySubfigure::PositionNum (const Standard_Integer Index) const { // Method : If thePositions array length is Zero return theDoDontFlag; // else Search Index in to the Array. If 'Index' found in the @@ -141,10 +67,96 @@ IGESDraw_RectArraySubfigure::IGESDraw_RectArraySubfigure () { } return (! theDoDontFlag); } - Standard_Integer IGESDraw_RectArraySubfigure::ListPosition - (const Standard_Integer Index) const +Standard_Integer IGESDraw_RectArraySubfigure::ListPosition (const Standard_Integer Index) const { return thePositions->Value(Index); // raise OutOfRange from Standard if Index is out-of-bound // Exception NoSuchObject will be raised if thePositions == Null Handle } + +void IGESDraw_RectArraySubfigure::OwnRead (IGESFile_Reader &PR) +{ + PR.ReadPointer(theBaseEntity,"Base Entity"); + + theScaleFactor = 1.0; // Setting to default value of 1.0 + PR.ReadReal(theScaleFactor,"Scale Factor"); + + PR.ReadXYZ(theLowerLeftCorner,"Lower Left Coordinate Of Array"); + PR.ReadInteger(theNbColumns,"Number Of Columns"); + PR.ReadInteger(theNbRows,"Number Of Rows"); + PR.ReadReal(theColumnSeparation,"Horizontal Distance Between Columns"); + PR.ReadReal(theRowSeparation,"Vertical Distance Between Rows"); + PR.ReadReal(theRotationAngle,"Rotation Angle"); + + Standard_Integer tempListCount = 0; + PR.ReadInteger(tempListCount,"DO-DONT List Count"); + if (tempListCount > 0) + thePositions = new TColStd_HArray1OfInteger (1, tempListCount); + else if (tempListCount < 0) + PR.AddFail("DO-DONT List Count : Less than Zero"); + + Standard_Integer tempDoDontFlag = 0; + PR.ReadInteger(tempDoDontFlag,"DO-DONT Flag"); + theDoDontFlag = (tempDoDontFlag != 0); + + if (tempListCount > 0) { + for (Standard_Integer i = 1; i <= tempListCount; i++) + PR.ReadInteger(thePositions->ChangeValue(i),"Number Of Position To Process"); + } +} + +void IGESDraw_RectArraySubfigure::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(theBaseEntity); + IW.Send(theScaleFactor); + IW.Send(theLowerLeftCorner.X()); + IW.Send(theLowerLeftCorner.Y()); + IW.Send(theLowerLeftCorner.Z()); + IW.Send(theNbColumns); + IW.Send(theNbRows); + IW.Send(theColumnSeparation); + IW.Send(theRowSeparation); + IW.Send(theRotationAngle); + const Standard_Integer up = ListCount(); + IW.Send(up); + IW.SendBoolean(DoDontFlag()); + for (Standard_Integer i = 1; i <= up; i++) + IW.Send(ListPosition(i)); +} + +void IGESDraw_RectArraySubfigure::OwnShared (Interface_EntityIterator &iter) const +{ + iter.GetOneItem(theBaseEntity); +} + +IGESData_DirChecker IGESDraw_RectArraySubfigure::DirChecker () const +{ + IGESData_DirChecker DC(412, 0); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefAny); + DC.LineWeight(IGESData_DefValue); + DC.Color(IGESData_DefAny); + DC.GraphicsIgnored(1); + return DC; +} + +void IGESDraw_RectArraySubfigure::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + const Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1; + S << "IGESDraw_RectArraySubfigure" << endl; + S << "Base Entity : "; + dumper.Dump(theBaseEntity,S,tempSubLevel); + S << endl; + S << "Scale Factor : " << theScaleFactor << " "; + S << "Lower Left Corner Of Array : "; + IGESData_DumpXYZL(S,level,theLowerLeftCorner,gp_GTrsf()); // no location + S << "Number Of Columns : " << theNbColumns << " "; + S << "Number Of Rows : " << theNbRows << endl; + S << "Horizontal Distance Between Columns : " << theColumnSeparation << endl; + S << "Vertical Distance Between Rows : " << theRowSeparation << endl; + S << "Rotation Angle (in radians) : " << theRotationAngle << endl; + S << "Do-Dont Flag : " << (theDoDontFlag? "(1)Dont " : "(0)Do "); + S << "Do-Dont List : "; + IGESData_DumpVals(S,level,1,ListCount(),ListPosition); + S << endl; +} diff --git a/src/IGESDraw/IGESDraw_RectArraySubfigure.hxx b/src/IGESDraw/IGESDraw_RectArraySubfigure.hxx index ca3e087888..79b0fb645d 100644 --- a/src/IGESDraw/IGESDraw_RectArraySubfigure.hxx +++ b/src/IGESDraw/IGESDraw_RectArraySubfigure.hxx @@ -17,58 +17,32 @@ #ifndef _IGESDraw_RectArraySubfigure_HeaderFile #define _IGESDraw_RectArraySubfigure_HeaderFile -#include -#include - -#include #include -#include #include #include -#include -class IGESData_IGESEntity; -class Standard_OutOfRange; -class gp_XYZ; class gp_Pnt; -class IGESDraw_RectArraySubfigure; -DEFINE_STANDARD_HANDLE(IGESDraw_RectArraySubfigure, IGESData_IGESEntity) - //! Defines IGES Rectangular Array Subfigure Instance Entity, //! Type <412> Form Number <0> in package IGESDraw //! Used to produce copies of object called the base entity, //! arranging them in equally spaced rows and columns class IGESDraw_RectArraySubfigure : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 412; } - - Standard_EXPORT IGESDraw_RectArraySubfigure(); - - //! This method is used to set the fields of the class - //! RectArraySubfigure - //! - aBase : a base entity which is replicated - //! - aScale : Scale Factor - //! - aCorner : lower left hand corner for the entire array - //! - nbCols : Number of columns of the array - //! - nbRows : Number of rows of the array - //! - hDisp : Column separations - //! - vtDisp : Row separation - //! - rotationAngle : Rotation angle specified in radians - //! - allDont : DO-DON'T flag to control which portion - //! to display - //! - allNumPos : List of positions to be or not to be - //! displayed - Standard_EXPORT void Init (const Handle(IGESData_IGESEntity)& aBase, const Standard_Real aScale, const gp_XYZ& aCorner, const Standard_Integer nbCols, const Standard_Integer nbRows, const Standard_Real hDisp, const Standard_Real vtDisp, const Standard_Real rotationAngle, const Standard_Integer doDont, const Handle(TColStd_HArray1OfInteger)& allNumPos); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 0; } + + IGESDraw_RectArraySubfigure() {} //! returns the base entity, copies of which are produced - Standard_EXPORT Handle(IGESData_IGESEntity) BaseEntity() const; - + const Handle(IGESData_IGESEntity) & BaseEntity() const { return theBaseEntity; } + //! returns the scale factor - Standard_EXPORT Standard_Real ScaleFactor() const; - + Standard_Real ScaleFactor() const { return theScaleFactor; } + //! returns coordinates of lower left hand corner for the entire array Standard_EXPORT gp_Pnt LowerLeftCorner() const; @@ -76,30 +50,30 @@ public: Standard_EXPORT gp_Pnt TransformedLowerLeftCorner() const; //! returns number of columns in the array - Standard_EXPORT Standard_Integer NbColumns() const; - + Standard_Integer NbColumns() const { return theNbColumns; } + //! returns number of rows in the array - Standard_EXPORT Standard_Integer NbRows() const; - + Standard_Integer NbRows() const { return theNbRows; } + //! returns horizontal distance between columns - Standard_EXPORT Standard_Real ColumnSeparation() const; - + Standard_Real ColumnSeparation() const { return theColumnSeparation; } + //! returns vertical distance between rows - Standard_EXPORT Standard_Real RowSeparation() const; - + Standard_Real RowSeparation() const { return theRowSeparation; } + //! returns rotation angle in radians - Standard_EXPORT Standard_Real RotationAngle() const; - + Standard_Real RotationAngle() const { return theRotationAngle; } + //! returns True if (ListCount = 0) i.e., all elements to be displayed - Standard_EXPORT Standard_Boolean DisplayFlag() const; - + Standard_Boolean DisplayFlag() const { return (thePositions.IsNull()); } + //! returns 0 if all replicated entities to be displayed Standard_EXPORT Standard_Integer ListCount() const; //! returns 0 if half or fewer of the elements of the array are defined //! 1 if half or more of the elements are defined - Standard_EXPORT Standard_Boolean DoDontFlag() const; - + Standard_Boolean DoDontFlag() const { return theDoDontFlag; } + //! returns whether Index is to be processed (DO) //! or not to be processed(DON'T) //! if (ListCount = 0) return theDoDontFlag @@ -109,20 +83,21 @@ public: //! raises exception if Index <= 0 or Index > ListCount() Standard_EXPORT Standard_Integer ListPosition (const Standard_Integer Index) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESDraw_RectArraySubfigure,IGESData_IGESEntity) - -protected: - - - + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; -private: + DEFINE_STANDARD_RTTIEXT(IGESDraw_RectArraySubfigure,IGESData_IGESEntity) + private: - Handle(IGESData_IGESEntity) theBaseEntity; + Interface_Pointer theBaseEntity; Standard_Real theScaleFactor; gp_XYZ theLowerLeftCorner; Standard_Integer theNbColumns; @@ -132,14 +107,6 @@ private: Standard_Real theRotationAngle; Standard_Boolean theDoDontFlag; Handle(TColStd_HArray1OfInteger) thePositions; - - }; - - - - - - #endif // _IGESDraw_RectArraySubfigure_HeaderFile diff --git a/src/IGESDraw/IGESDraw_SegmentedViewsVisible.cxx b/src/IGESDraw/IGESDraw_SegmentedViewsVisible.cxx index db1ec2e734..d9e8aa1fd1 100644 --- a/src/IGESDraw/IGESDraw_SegmentedViewsVisible.cxx +++ b/src/IGESDraw/IGESDraw_SegmentedViewsVisible.cxx @@ -17,122 +17,233 @@ //-------------------------------------------------------------------- #include -#include #include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_SegmentedViewsVisible,IGESData_ViewKindEntity) -IGESDraw_SegmentedViewsVisible::IGESDraw_SegmentedViewsVisible () { } - - - void IGESDraw_SegmentedViewsVisible::Init - (const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews, - const Handle(TColStd_HArray1OfReal)& allBreakpointParameters, - const Handle(TColStd_HArray1OfInteger)& allDisplayFlags, - const Handle(TColStd_HArray1OfInteger)& allColorValues, - const Handle(IGESGraph_HArray1OfColor)& allColorDefinitions, - const Handle(TColStd_HArray1OfInteger)& allLineFontValues, - const Handle(IGESBasic_HArray1OfLineFontEntity)& allLineFontDefinitions, - const Handle(TColStd_HArray1OfInteger)& allLineWeights) -{ - Standard_Integer Len = allViews->Length(); - if ( allViews->Lower() != 1 || - (allBreakpointParameters->Lower() != 1 || allBreakpointParameters->Length() != Len) || - (allDisplayFlags->Lower() != 1 || allDisplayFlags->Length() != Len) || - (allColorValues->Lower() != 1 || allColorValues->Length() != Len) || - (allColorDefinitions->Lower() != 1 || allColorDefinitions->Length() != Len) || - (allLineFontValues->Lower() != 1 || allLineFontValues->Length() != Len) || - (allLineFontDefinitions->Lower() != 1 || allLineFontDefinitions->Length() != Len) || - (allLineWeights->Lower() != 1 || allLineWeights->Length() != Len) ) - Standard_DimensionMismatch::Raise("IGESDraw_SegmentedViewsVisible : Init"); - - theViews = allViews; - theBreakpointParameters = allBreakpointParameters; - theDisplayFlags = allDisplayFlags; - theColorValues = allColorValues; - theColorDefinitions = allColorDefinitions; - theLineFontValues = allLineFontValues; - theLineFontDefinitions = allLineFontDefinitions; - theLineWeights = allLineWeights; - InitTypeAndForm(402,19); -} - - Standard_Boolean IGESDraw_SegmentedViewsVisible::IsSingle () const +Standard_Boolean IGESDraw_SegmentedViewsVisible::IsSingle () const { return Standard_False; } - Standard_Integer IGESDraw_SegmentedViewsVisible::NbViews () const +Standard_Integer IGESDraw_SegmentedViewsVisible::NbViews () const { return theViews->Length(); } - Standard_Integer IGESDraw_SegmentedViewsVisible::NbSegmentBlocks () const +Standard_Integer IGESDraw_SegmentedViewsVisible::NbSegmentBlocks () const { return theViews->Length(); } - Handle(IGESData_ViewKindEntity) IGESDraw_SegmentedViewsVisible::ViewItem - (const Standard_Integer ViewIndex) const +Handle(IGESData_ViewKindEntity) IGESDraw_SegmentedViewsVisible::ViewItem (const Standard_Integer ViewIndex) const { return theViews->Value(ViewIndex); } - Standard_Real IGESDraw_SegmentedViewsVisible::BreakpointParameter - (const Standard_Integer BreakpointIndex) const +Standard_Real IGESDraw_SegmentedViewsVisible::BreakpointParameter (const Standard_Integer BreakpointIndex) const { return theBreakpointParameters->Value(BreakpointIndex); } - Standard_Integer IGESDraw_SegmentedViewsVisible::DisplayFlag - (const Standard_Integer FlagIndex) const +Standard_Integer IGESDraw_SegmentedViewsVisible::DisplayFlag (const Standard_Integer FlagIndex) const { return theDisplayFlags->Value(FlagIndex); } - Standard_Boolean IGESDraw_SegmentedViewsVisible::IsColorDefinition - (const Standard_Integer ColorIndex) const +Standard_Boolean IGESDraw_SegmentedViewsVisible::IsColorDefinition (const Standard_Integer ColorIndex) const { return ( !theColorDefinitions->Value(ColorIndex).IsNull() ); } - Standard_Integer IGESDraw_SegmentedViewsVisible::ColorValue - (const Standard_Integer ColorIndex) const +Standard_Integer IGESDraw_SegmentedViewsVisible::ColorValue (const Standard_Integer ColorIndex) const { return theColorValues->Value(ColorIndex); } - Handle(IGESGraph_Color) IGESDraw_SegmentedViewsVisible::ColorDefinition - (const Standard_Integer ColorIndex) const +Handle(IGESGraph_Color) IGESDraw_SegmentedViewsVisible::ColorDefinition (const Standard_Integer ColorIndex) const { return theColorDefinitions->Value(ColorIndex); } - Standard_Boolean IGESDraw_SegmentedViewsVisible::IsFontDefinition - (const Standard_Integer FontIndex) const +Standard_Boolean IGESDraw_SegmentedViewsVisible::IsFontDefinition (const Standard_Integer FontIndex) const { return ( !theLineFontDefinitions->Value(FontIndex).IsNull() ); } - Standard_Integer IGESDraw_SegmentedViewsVisible::LineFontValue - (const Standard_Integer FontIndex) const +Standard_Integer IGESDraw_SegmentedViewsVisible::LineFontValue (const Standard_Integer FontIndex) const { return theLineFontValues->Value(FontIndex); } - Handle(IGESData_LineFontEntity) - IGESDraw_SegmentedViewsVisible::LineFontDefinition - (const Standard_Integer FontIndex) const +Handle(IGESData_LineFontEntity) IGESDraw_SegmentedViewsVisible::LineFontDefinition (const Standard_Integer FontIndex) const { return theLineFontDefinitions->Value(FontIndex); } - Standard_Integer IGESDraw_SegmentedViewsVisible::LineWeightItem - (const Standard_Integer WeightIndex) const +Standard_Integer IGESDraw_SegmentedViewsVisible::LineWeightItem (const Standard_Integer WeightIndex) const { return theLineWeights->Value(WeightIndex); } + +void IGESDraw_SegmentedViewsVisible::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer nbval = 0; + PR.ReadInteger(nbval,"No. of View/segment blocks"); + if (nbval > 0) + { + theViews = new IGESDraw_HArray1OfViewKindEntity(1, nbval); + theBreakpointParameters = new TColStd_HArray1OfReal(1, nbval); + theDisplayFlags = new TColStd_HArray1OfInteger(1, nbval); + theColorValues = new TColStd_HArray1OfInteger(1, nbval); + theColorDefinitions = new IGESGraph_HArray1OfColor(1, nbval); + theLineFontValues = new TColStd_HArray1OfInteger(1, nbval); + theLineFontDefinitions = new IGESBasic_HArray1OfLineFontEntity(1, nbval); + theLineWeights = new TColStd_HArray1OfInteger(1, nbval); + + for (Standard_Integer i = 1; i <= nbval; i++) + { + PR.ReadPointer(theViews->ChangeValue(i),"Instance of views"); + PR.ReadReal(theBreakpointParameters->ChangeValue(i),"array breakpointParameters"); + PR.ReadInteger(theDisplayFlags->ChangeValue(i),"array displayFlags"); + + Standard_Integer tempValue = 0; + PR.ReadInteger(tempValue,"array colorValues"); + if (tempValue < 0) { + tempValue = -1; + PR.GetPointer(theColorDefinitions->ChangeValue(i),-tempValue); + } + theColorValues->SetValue(i, tempValue); + + tempValue = 0; + PR.ReadInteger(tempValue,"array lineFontValues"); + if (tempValue < 0) { + tempValue = -1; + PR.GetPointer(theLineFontDefinitions->ChangeValue(i),-tempValue); + } + theLineFontValues->SetValue(i, tempValue); + + PR.ReadInteger(theLineWeights->ChangeValue(i),"array lineWeights"); + } + } + else + PR.AddFail("No. of View/segment blocks : Not Positive"); +} + +void IGESDraw_SegmentedViewsVisible::OwnWrite (IGESData_IGESWriter &IW) const +{ + const Standard_Integer Up = NbSegmentBlocks(); + IW.Send( Up ); + for ( Standard_Integer i = 1; i <= Up; i++) + { + IW.Send( ViewItem(i) ); + IW.Send( BreakpointParameter(i) ); + IW.Send( DisplayFlag(i) ); + + if (IsColorDefinition(i)) + IW.Send( ColorDefinition(i), Standard_True ); // negative + else + IW.Send( ColorValue(i) ); + + if (IsFontDefinition(i)) + IW.Send( LineFontDefinition(i), Standard_True ); // negative + else + IW.Send( LineFontValue(i) ); + + IW.Send( LineWeightItem(i) ); + } +} + +void IGESDraw_SegmentedViewsVisible::OwnShared (Interface_EntityIterator &iter) const +{ + const Standard_Integer Up = NbSegmentBlocks(); + for ( Standard_Integer i = 1; i <= Up; i++) + { + iter.GetOneItem( ViewItem(i) ); + if (IsColorDefinition(i)) + iter.GetOneItem( ColorDefinition(i) ); + if (!IsFontDefinition(i)) + iter.GetOneItem( LineFontDefinition(i) ); + } +} + +IGESData_DirChecker IGESDraw_SegmentedViewsVisible::DirChecker () const +{ + IGESData_DirChecker DC (402, 19); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.SubordinateStatusRequired(0); + DC.UseFlagRequired(1); + DC.HierarchyStatusIgnored(); + return DC; +} + +void IGESDraw_SegmentedViewsVisible::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + const Standard_Integer sublevel = (level <= 4) ? 0 : 1; + S << "IGESDraw_SegmentedViewsVisible" << endl; + S << "View Entities : " << endl + << "Breakpoint parameters : " << endl + << "Display flags : " << endl + << "Color Values : " << endl + << "Color Definitions : " << endl + << "LineFont Values : " << endl + << "LineFont Definitions : " << endl + << "Line Weights : " << endl; + S << "Count Of Blocks = " << NbSegmentBlocks() << endl; + switch (level) + { + case 4 : S << " [ for content, ask level > 4 ]" << endl; + break; // Nothing to be dumped here + case 5 : // Presently level 5 and 6 have the same Dump + case 6 : + { + Standard_Integer I; + Standard_Integer up = NbSegmentBlocks(); + for (I = 1; I <= up; I++) + { + S << "[" << I << "]:" << endl; + S << "View Entity : "; + dumper.Dump (ViewItem(I),S, sublevel); + S << endl; + S << "Breakpoint parameter : " << BreakpointParameter(I)< -#include - #include #include #include #include #include #include -#include -#include -#include -class Standard_DimensionMismatch; -class Standard_OutOfRange; -class IGESData_ViewKindEntity; class IGESGraph_Color; class IGESData_LineFontEntity; -class IGESDraw_SegmentedViewsVisible; -DEFINE_STANDARD_HANDLE(IGESDraw_SegmentedViewsVisible, IGESData_ViewKindEntity) - //! defines IGESSegmentedViewsVisible, Type <402> Form <19> //! in package IGESDraw //! @@ -46,27 +34,13 @@ DEFINE_STANDARD_HANDLE(IGESDraw_SegmentedViewsVisible, IGESData_ViewKindEntity) //! segments of curves in a given view class IGESDraw_SegmentedViewsVisible : public IGESData_ViewKindEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 402; } - - Standard_EXPORT IGESDraw_SegmentedViewsVisible(); - - //! This method is used to set the fields of the class - //! SegmentedViewsVisible - //! - allViews : Pointers to View Entities - //! - allBreakpointParameters : Parameters of breakpoints - //! - allDisplayFlags : Display flags - //! - allColorValues : Color Values - //! - allColorDefinitions : Color Definitions - //! - allLineFontValues : LineFont values - //! - allLineFontDefinitions : LineFont Definitions - //! - allLineWeights : Line weights - //! raises exception if Lengths of allViews, allBreakpointParameters, - //! allDisplayFlags, allColorValues, allColorDefinitions, - //! allLineFontValues, allLineFontDefinitions and allLineWeights - //! are not same. - Standard_EXPORT void Init (const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews, const Handle(TColStd_HArray1OfReal)& allBreakpointParameters, const Handle(TColStd_HArray1OfInteger)& allDisplayFlags, const Handle(TColStd_HArray1OfInteger)& allColorValues, const Handle(IGESGraph_HArray1OfColor)& allColorDefinitions, const Handle(TColStd_HArray1OfInteger)& allLineFontValues, const Handle(IGESBasic_HArray1OfLineFontEntity)& allLineFontDefinitions, const Handle(TColStd_HArray1OfInteger)& allLineWeights); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 19; } + + IGESDraw_SegmentedViewsVisible() {} //! Returns False (for a complex view) Standard_EXPORT Standard_Boolean IsSingle() const Standard_OVERRIDE; @@ -131,18 +105,19 @@ public: //! WeightIndex > NbSegmentBlocks(). Standard_EXPORT Standard_Integer LineWeightItem (const Standard_Integer WeightIndex) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESDraw_SegmentedViewsVisible,IGESData_ViewKindEntity) - -protected: - - - + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; -private: + DEFINE_STANDARD_RTTIEXT(IGESDraw_SegmentedViewsVisible,IGESData_ViewKindEntity) + private: Handle(IGESDraw_HArray1OfViewKindEntity) theViews; Handle(TColStd_HArray1OfReal) theBreakpointParameters; @@ -152,14 +127,6 @@ private: Handle(TColStd_HArray1OfInteger) theLineFontValues; Handle(IGESBasic_HArray1OfLineFontEntity) theLineFontDefinitions; Handle(TColStd_HArray1OfInteger) theLineWeights; - - }; - - - - - - #endif // _IGESDraw_SegmentedViewsVisible_HeaderFile diff --git a/src/IGESDraw/IGESDraw_SpecificModule.cxx b/src/IGESDraw/IGESDraw_SpecificModule.cxx deleted file mode 100644 index 7621d9ad96..0000000000 --- a/src/IGESDraw/IGESDraw_SpecificModule.cxx +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_SpecificModule,IGESData_SpecificModule) - -// Each Module is attached to a Protocol : it must interprete Case Numbers -// (arguments of various methods) in accordance to values returned by -// the method TypeNumber from this Protocol -IGESDraw_SpecificModule::IGESDraw_SpecificModule() { } - - - void IGESDraw_SpecificModule::OwnDump - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, - const Standard_Integer own) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESDraw_CircArraySubfigure,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolCircArraySubfigure tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 2 : { - DeclareAndCast(IGESDraw_ConnectPoint,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolConnectPoint tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 3 : { - DeclareAndCast(IGESDraw_Drawing,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolDrawing tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 4 : { - DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolDrawingWithRotation tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 5 : { - DeclareAndCast(IGESDraw_LabelDisplay,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolLabelDisplay tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 6 : { - DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolNetworkSubfigure tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 7 : { - DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolNetworkSubfigureDef tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 8 : { - DeclareAndCast(IGESDraw_PerspectiveView,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolPerspectiveView tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 9 : { - DeclareAndCast(IGESDraw_Planar,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolPlanar tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 10 : { - DeclareAndCast(IGESDraw_RectArraySubfigure,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolRectArraySubfigure tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 11 : { - DeclareAndCast(IGESDraw_SegmentedViewsVisible,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolSegmentedViewsVisible tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 12 : { - DeclareAndCast(IGESDraw_View,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolView tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 13 : { - DeclareAndCast(IGESDraw_ViewsVisible,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolViewsVisible tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 14 : { - DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent); - if (anent.IsNull()) return; - IGESDraw_ToolViewsVisibleWithAttr tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - default : break; - } -} - - - Standard_Boolean IGESDraw_SpecificModule::OwnCorrect - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const -{ -// Applies only on some types - switch (CN) { - case 3 : { - DeclareAndCast(IGESDraw_Drawing,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolDrawing tool; - return tool.OwnCorrect(anent); - } - case 4 : { - DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolDrawingWithRotation tool; - return tool.OwnCorrect(anent); - } - case 9 : { - DeclareAndCast(IGESDraw_Planar,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolPlanar tool; - return tool.OwnCorrect(anent); - } - case 13 : { - DeclareAndCast(IGESDraw_ViewsVisible,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolViewsVisible tool; - return tool.OwnCorrect(anent); - } - case 14 : { - DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent); - if (anent.IsNull()) break; - IGESDraw_ToolViewsVisibleWithAttr tool; - return tool.OwnCorrect(anent); - } - default : break; - } - return Standard_False; -} diff --git a/src/IGESDraw/IGESDraw_SpecificModule.hxx b/src/IGESDraw/IGESDraw_SpecificModule.hxx deleted file mode 100644 index ea95d6eb68..0000000000 --- a/src/IGESDraw/IGESDraw_SpecificModule.hxx +++ /dev/null @@ -1,75 +0,0 @@ -// Created on: 1993-09-07 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_SpecificModule_HeaderFile -#define _IGESDraw_SpecificModule_HeaderFile - -#include -#include - -#include -#include -#include -class IGESData_IGESEntity; -class IGESData_IGESDumper; -class Message_Messenger; - - -class IGESDraw_SpecificModule; -DEFINE_STANDARD_HANDLE(IGESDraw_SpecificModule, IGESData_SpecificModule) - -//! Defines Services attached to IGES Entities : -//! Dump & OwnCorrect, for IGESDraw -class IGESDraw_SpecificModule : public IGESData_SpecificModule -{ - -public: - - - //! Creates a SpecificModule from IGESDraw & puts it into SpecificLib - Standard_EXPORT IGESDraw_SpecificModule(); - - //! Specific Dump (own parameters) for IGESDraw - Standard_EXPORT void OwnDump (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const Standard_OVERRIDE; - - //! Performs non-ambiguous Corrections on Entities which support - //! them (Planar) - Standard_EXPORT virtual Standard_Boolean OwnCorrect (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IGESDraw_SpecificModule,IGESData_SpecificModule) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IGESDraw_SpecificModule_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ToolCircArraySubfigure.cxx b/src/IGESDraw/IGESDraw_ToolCircArraySubfigure.cxx deleted file mode 100644 index 99cb324999..0000000000 --- a/src/IGESDraw/IGESDraw_ToolCircArraySubfigure.cxx +++ /dev/null @@ -1,144 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDraw_ToolCircArraySubfigure::ReadOwnParams - (const Handle(IGESDraw_CircArraySubfigure)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - gp_XYZ tempCenter; - Handle(IGESData_IGESEntity) tempBase; - Standard_Real tempRadius, tempStAngle, tempDelAngle; - Standard_Integer tempNumLocs, tempFlag, tempListCount; - Handle(TColStd_HArray1OfInteger) tempNumPos; - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadEntity(IR, PR.Current(), "Base Entity", tempBase); - PR.ReadInteger(PR.Current(), "Number Of Instance Locations", tempNumLocs); - PR.ReadXYZ(PR.CurrentList(1, 3), "Imaginary Circle Center Coordinate", tempCenter); - PR.ReadReal(PR.Current(), "Radius Of Imaginary Circle", tempRadius); - PR.ReadReal(PR.Current(), "Start Angle in Radians", tempStAngle); - PR.ReadReal(PR.Current(), "Delta Angle in Radians", tempDelAngle); - - //st = PR.ReadInteger(PR.Current(), "DO-DONT List Count", tempListCount); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "DO-DONT List Count", tempListCount)) { - // Initialise HArray1 only if there is no error reading its Length - if (tempListCount > 0) - tempNumPos = new TColStd_HArray1OfInteger(1, tempListCount); - else if (tempListCount < 0) - PR.AddFail("DO-DONT List Count : Less than Zero"); - } - - PR.ReadInteger(PR.Current(), "DO-DONT Flag", tempFlag); //szv#4:S4163:12Mar99 `st=` not needed - - // Read the HArray1 only if its Length was read without any Error - if (! tempNumPos.IsNull()) { - Standard_Integer I; - for (I = 1; I <= tempListCount; I++) { - Standard_Integer tempPosition; - //st = PR.ReadInteger(PR.Current(), "Number Of Position To Process", - //tempPosition); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Number Of Position To Process", tempPosition)) - tempNumPos->SetValue(I, tempPosition); - } - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init - (tempBase, tempNumLocs, tempCenter, tempRadius, - tempStAngle,tempDelAngle, tempFlag, tempNumPos); -} - -void IGESDraw_ToolCircArraySubfigure::WriteOwnParams - (const Handle(IGESDraw_CircArraySubfigure)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->BaseEntity()); - IW.Send(ent->NbLocations()); - IW.Send(ent->CenterPoint().X()); - IW.Send(ent->CenterPoint().Y()); - IW.Send(ent->CenterPoint().Z()); - IW.Send(ent->CircleRadius()); - IW.Send(ent->StartAngle()); - IW.Send(ent->DeltaAngle()); - IW.Send(ent->ListCount()); - IW.SendBoolean(ent->DoDontFlag()); - // Send the HArray1 only if it is not empty (i.e. Null) - Standard_Integer I; - Standard_Integer up = ent->ListCount(); - for (I = 1; I <= up; I++) - IW.Send(ent->ListPosition(I)); -} - -IGESData_DirChecker IGESDraw_ToolCircArraySubfigure::DirChecker - (const Handle(IGESDraw_CircArraySubfigure)& /*ent*/) const -{ - IGESData_DirChecker DC(414, 0); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefAny); - DC.LineWeight(IGESData_DefValue); - DC.Color(IGESData_DefAny); - DC.GraphicsIgnored(1); - - return DC; -} - -void IGESDraw_ToolCircArraySubfigure::OwnDump - (const Handle(IGESDraw_CircArraySubfigure)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1; - - S << "IGESDraw_CircArraySubfigure" << endl; - - S << "Base Entity : "; - dumper.Dump(ent->BaseEntity(),S, tempSubLevel); - S << endl; - S << "Total Number Of Possible Instance Locations : " << ent->NbLocations() - << endl; - S << "Imaginary Circle. Radius : " << ent->CircleRadius() << " Center : "; - IGESData_DumpXYZL(S, level, ent->CenterPoint(), ent->Location()); S << endl; - S << "Start Angle (in radians) : " << ent->StartAngle() << " "; - S << "Delta Angle (in radians) : " << ent->DeltaAngle() << endl; - S << "Do-Dont Flag : "; - if (ent->DoDontFlag()) S << "Dont" << endl; - else S << "Do" << endl; - S << "The Do-Dont List : "; - IGESData_DumpVals(S ,level,1, ent->ListCount(),ent->ListPosition); - S << endl; -} diff --git a/src/IGESDraw/IGESDraw_ToolCircArraySubfigure.hxx b/src/IGESDraw/IGESDraw_ToolCircArraySubfigure.hxx deleted file mode 100644 index b63eda7eb5..0000000000 --- a/src/IGESDraw/IGESDraw_ToolCircArraySubfigure.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_ToolCircArraySubfigure_HeaderFile -#define _IGESDraw_ToolCircArraySubfigure_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDraw_CircArraySubfigure; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a CircArraySubfigure. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDraw_ToolCircArraySubfigure -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolCircArraySubfigure, ready to work - IGESDraw_ToolCircArraySubfigure() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDraw_CircArraySubfigure)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDraw_CircArraySubfigure)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_CircArraySubfigure)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDraw_CircArraySubfigure)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDraw_ToolCircArraySubfigure_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ToolConnectPoint.cxx b/src/IGESDraw/IGESDraw_ToolConnectPoint.cxx deleted file mode 100644 index df95b0459d..0000000000 --- a/src/IGESDraw/IGESDraw_ToolConnectPoint.cxx +++ /dev/null @@ -1,202 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDraw_ToolConnectPoint::ReadOwnParams - (const Handle(IGESDraw_ConnectPoint)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - gp_XYZ tempPoint; - Standard_Integer tempTypeFlag, tempFunctionFlag; - Standard_Integer tempPointIdentifier, tempFunctionCode, tempSwapFlag; - Handle(IGESData_IGESEntity) tempDisplaySymbol, tempOwnerSubfigure; - Handle(TCollection_HAsciiString) tempFunctionIdentifier, tempFunctionName; - Handle(IGESGraph_TextDisplayTemplate) tempFunctionTemplate; - Handle(IGESGraph_TextDisplayTemplate) tempIdentifierTemplate; - - PR.ReadXYZ(PR.CurrentList(1, 3), "Connect Point Coordinate", tempPoint); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Display Symbol Geometry Entity", - tempDisplaySymbol,Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadInteger(PR.Current(), "Type Flag", tempTypeFlag); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadInteger(PR.Current(), "Function Flag", tempFunctionFlag); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadText(PR.Current(), "Function Identifier", - tempFunctionIdentifier); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Text Display Identifier Template", - STANDARD_TYPE(IGESGraph_TextDisplayTemplate), tempIdentifierTemplate, - Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadText(PR.Current(), "Connect Point Function Name", - tempFunctionName); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Text Display Function Template", - STANDARD_TYPE(IGESGraph_TextDisplayTemplate), tempFunctionTemplate, - Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadInteger(PR.Current(), "Unique Connect Point Identifier", - tempPointIdentifier); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadInteger(PR.Current(), "Connect Point Function Code", - tempFunctionCode); //szv#4:S4163:12Mar99 `st=` not needed - - if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Swap Flag", tempSwapFlag); //szv#4:S4163:12Mar99 `st=` not needed - else tempSwapFlag = 0; // default - - PR.ReadEntity(IR, PR.Current(), "Owner Network Subfigure Entity", - tempOwnerSubfigure,Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init - (tempPoint, tempDisplaySymbol, tempTypeFlag, tempFunctionFlag, - tempFunctionIdentifier, tempIdentifierTemplate, tempFunctionName, - tempFunctionTemplate, tempPointIdentifier, tempFunctionCode, - tempSwapFlag, tempOwnerSubfigure); -} - -void IGESDraw_ToolConnectPoint::WriteOwnParams - (const Handle(IGESDraw_ConnectPoint)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->Point().X()); - IW.Send(ent->Point().Y()); - IW.Send(ent->Point().Z()); - IW.Send(ent->DisplaySymbol()); - IW.Send(ent->TypeFlag()); - IW.Send(ent->FunctionFlag()); - IW.Send(ent->FunctionIdentifier()); - IW.Send(ent->IdentifierTemplate()); - IW.Send(ent->FunctionName()); - IW.Send(ent->FunctionTemplate()); - IW.Send(ent->PointIdentifier()); - IW.Send(ent->FunctionCode()); - IW.SendBoolean(ent->SwapFlag()); - IW.Send(ent->OwnerSubfigure()); -} - -void IGESDraw_ToolConnectPoint::OwnShared - (const Handle(IGESDraw_ConnectPoint)& ent, Interface_EntityIterator& iter) const -{ - iter.GetOneItem(ent->DisplaySymbol()); - iter.GetOneItem(ent->IdentifierTemplate()); - iter.GetOneItem(ent->FunctionTemplate()); - iter.GetOneItem(ent->OwnerSubfigure()); -} - -IGESData_DirChecker IGESDraw_ToolConnectPoint::DirChecker - (const Handle(IGESDraw_ConnectPoint)& ent ) const -{ - IGESData_DirChecker DC(132, 0); - DC.Structure(IGESData_DefVoid); - DC.Color(IGESData_DefAny); - DC.UseFlagRequired(4); - if (!ent->DisplaySymbol().IsNull()) { - DC.LineFont(IGESData_DefAny); - DC.LineWeight(IGESData_DefAny); - } - else { - // Note : If ent->DisplaySymbol() is NULL Handle; ignore Line Font, Weight - // and Hierarchy Status - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.HierarchyStatusIgnored(); - } - - return DC; -} - -void IGESDraw_ToolConnectPoint::OwnCheck - (const Handle(IGESDraw_ConnectPoint)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if ((ent->TypeFlag() < 0) || (ent->TypeFlag() > 9999) || - ((ent->TypeFlag() > 2) && (ent->TypeFlag() < 101)) || - ((ent->TypeFlag() > 104) && (ent->TypeFlag() < 201)) || - ((ent->TypeFlag() > 203) && (ent->TypeFlag() < 5001))) - ach->AddFail("TypeFlag has Invalid value"); - - if ((ent->FunctionFlag() < 0) || (ent->FunctionFlag() > 2)) - ach->AddFail("FunctionFlag has Invalid value"); - - if ((ent->FunctionCode() < 0) || (ent->FunctionCode() > 9999) || - ((ent->FunctionCode() > 49) && (ent->FunctionCode() < 98)) || - ((ent->FunctionCode() > 99) && (ent->FunctionCode() < 5001))) - ach->AddFail("FunctionCode has Invalid value"); - - //if ((ent->SwapFlag() < 0) || (ent->SwapFlag() > 1)) //szv#4:S4163:12Mar99 SGI warns - if ((ent->SwapFlag() != 0) && (ent->SwapFlag() != 1)) - ach->AddFail("SwapFlag has Invalid value"); -} - -void IGESDraw_ToolConnectPoint::OwnDump - (const Handle(IGESDraw_ConnectPoint)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1; - - S << "IGESDraw_ConnectPoint" << endl; - - S << "Connection Point Coordinate : "; - IGESData_DumpXYZL(S, level, ent->Point(), ent->Location()); - S << "Display Symbol Geometry Entity : "; - dumper.Dump(ent->DisplaySymbol(),S, tempSubLevel); - S << endl; - S << "Type Flag : " << ent->TypeFlag() << " " - << "Function Flag : " << ent->FunctionFlag() << endl; - S << "Function Identifier : "; - IGESData_DumpString(S,ent->FunctionIdentifier()); - S << endl << "Text Display Template Entity for CID : "; - dumper.Dump(ent->IdentifierTemplate(),S, tempSubLevel); - S << endl << "Function Name : "; - IGESData_DumpString(S,ent->FunctionName()); - S << endl << "Text Display Template Entity for CFN : "; - dumper.Dump(ent->FunctionTemplate(),S, tempSubLevel); - S << endl; - S << "Point Identifier : " << ent->PointIdentifier() << endl - << "Function Code : " << ent->FunctionCode() - << "Swap Flag : " << ( ent->SwapFlag() ? "True" : "False" ) << endl; - S << "Owner Subfigure Entity : "; - dumper.Dump(ent->OwnerSubfigure(),S, tempSubLevel); - S << endl; -} diff --git a/src/IGESDraw/IGESDraw_ToolConnectPoint.hxx b/src/IGESDraw/IGESDraw_ToolConnectPoint.hxx deleted file mode 100644 index 934ca4eaa3..0000000000 --- a/src/IGESDraw/IGESDraw_ToolConnectPoint.hxx +++ /dev/null @@ -1,70 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_ToolConnectPoint_HeaderFile -#define _IGESDraw_ToolConnectPoint_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDraw_ConnectPoint; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a ConnectPoint. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDraw_ToolConnectPoint -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolConnectPoint, ready to work - IGESDraw_ToolConnectPoint() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDraw_ConnectPoint)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDraw_ConnectPoint)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a ConnectPoint , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESDraw_ConnectPoint)& ent, Interface_EntityIterator& iter) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_ConnectPoint)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESDraw_ConnectPoint)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDraw_ConnectPoint)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDraw_ToolConnectPoint_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ToolDrawing.cxx b/src/IGESDraw/IGESDraw_ToolDrawing.cxx deleted file mode 100644 index 9463346ed9..0000000000 --- a/src/IGESDraw/IGESDraw_ToolDrawing.cxx +++ /dev/null @@ -1,257 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDraw_ToolDrawing::ReadOwnParams - (const Handle(IGESDraw_Drawing)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Standard_Integer nbval; - - Handle(IGESDraw_HArray1OfViewKindEntity) views; - Handle(TColgp_HArray1OfXY) viewOrigins; - Handle(IGESData_HArray1OfIGESEntity) annotations; - - // Reading nbval(No. of View pointers) - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Count of array of view entities", nbval); - if (st && nbval > 0) - { - views = new IGESDraw_HArray1OfViewKindEntity(1, nbval); - viewOrigins = new TColgp_HArray1OfXY(1, nbval); - - Handle(IGESData_ViewKindEntity) tempView; - gp_XY tempXY; - - for (Standard_Integer i = 1; i <= nbval; i++) - { - // Reading views(HArray1OfView) - //st = PR.ReadEntity (IR, PR.Current(), "View Entity", - //STANDARD_TYPE(IGESData_ViewKindEntity), tempView,Standard_True); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity (IR, PR.Current(), "View Entity", - STANDARD_TYPE(IGESData_ViewKindEntity), tempView,Standard_True)) - views->SetValue(i, tempView); - - // Reading viewOrigins(HArray1OfXY) - //st = PR.ReadXY(PR.CurrentList(1, 2), "array viewOrigins", tempXY); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadXY(PR.CurrentList(1, 2), "array viewOrigins", tempXY)) - viewOrigins->SetValue(i, tempXY); - } - } - else if (nbval < 0) PR.AddFail("Count of view entities : Less than zero"); - - // Reading nbval(No. of Annotation Entities) - //st = PR.ReadInteger(PR.Current(),"Count of array of Annotation entities", nbval); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(),"Count of array of Annotation entities", nbval)) { - if ( nbval > 0 ) - PR.ReadEnts (IR,PR.CurrentList(nbval), "Annotation Entities", annotations); //szv#4:S4163:12Mar99 `st=` not needed -/* - { - // Reading annotations(HArray1OfIGESEntity) - annotations = new IGESData_HArray1OfIGESEntity(1, nbval); - Handle(IGESData_IGESEntity) tempAnnotation; - for (Standard_Integer i = 1; i <= nbval; i++) - { - st = PR.ReadEntity - (IR, PR.Current(), "annotation entity", tempAnnotation,Standard_True); - if (st) annotations->SetValue(i, tempAnnotation); - } - } -*/ - else if (nbval < 0) PR.AddFail - ("Count of Annotation entities : Less than zero"); - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(views, viewOrigins, annotations); -} - -void IGESDraw_ToolDrawing::WriteOwnParams - (const Handle(IGESDraw_Drawing)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer Up = ent->NbViews(); - IW.Send( Up ); - Standard_Integer i; // svv Jan 10 2000 : porting on DEC - for ( i = 1; i <= Up; i++) - { - IW.Send( ent->ViewItem(i) ); - IW.Send( (ent->ViewOrigin(i)).X() ); - IW.Send( (ent->ViewOrigin(i)).Y() ); - } - - Up = ent->NbAnnotations(); - IW.Send( Up ); - for ( i = 1; i <= Up; i++) - IW.Send( ent->Annotation(i) ); -} - -void IGESDraw_ToolDrawing::OwnShared - (const Handle(IGESDraw_Drawing)& ent, Interface_EntityIterator& iter) const -{ - Standard_Integer Up = ent->NbViews(); - Standard_Integer i; // svv Jan 10 2000 : porting on DEC - for ( i = 1; i <= Up; i++) - iter.GetOneItem( ent->ViewItem(i) ); - - Up = ent->NbAnnotations(); - for ( i = 1; i <= Up; i++) - iter.GetOneItem( ent->Annotation(i) ); -} - -Standard_Boolean IGESDraw_ToolDrawing::OwnCorrect - (const Handle(IGESDraw_Drawing)& ent ) const -{ -// Vues vides : les supprimer - Standard_Integer i, nb = ent->NbViews(); - Standard_Integer nbtrue = nb; - for (i = 1; i <= nb; i ++) { - Handle(IGESData_ViewKindEntity) val = ent->ViewItem(i); - if (val.IsNull()) nbtrue --; - else if (val->TypeNumber() == 0) nbtrue --; - } - if (nbtrue == nb) return Standard_False; - Handle(IGESDraw_HArray1OfViewKindEntity) views; - Handle(TColgp_HArray1OfXY) viewOrigins; - if (nbtrue > 0) { - views = new IGESDraw_HArray1OfViewKindEntity (1, nbtrue); - viewOrigins = new TColgp_HArray1OfXY(1, nbtrue); - } - nbtrue = 0; - for (i = 1; i <= nb; i ++) { - Handle(IGESData_ViewKindEntity) val = ent->ViewItem(i); - if (val.IsNull()) continue; - else if (val->TypeNumber() == 0) continue; - nbtrue ++; - views->SetValue (nbtrue,val); - viewOrigins->SetValue(nbtrue, ent->ViewOrigin(i).XY() ); - } - -// Ne pas oublier les annotations ... - Standard_Integer nbanot = ent->NbAnnotations(); - Handle(IGESData_HArray1OfIGESEntity) annotations = - new IGESData_HArray1OfIGESEntity(1, nbanot); - for (i = 1; i <= nbanot; i ++) annotations->SetValue (i,ent->Annotation(i)); - - ent->Init(views, viewOrigins, annotations); - return Standard_True; -} - -IGESData_DirChecker IGESDraw_ToolDrawing::DirChecker - (const Handle(IGESDraw_Drawing)& /*ent*/) const -{ - IGESData_DirChecker DC (404, 0); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.SubordinateStatusRequired(0); - DC.UseFlagRequired(1); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESDraw_ToolDrawing::OwnCheck - (const Handle(IGESDraw_Drawing)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - Standard_Boolean ianul = Standard_False; - Standard_Integer i, nb = ent->NbViews(); - for (i = 1; i <= nb; i ++) { - Handle(IGESData_ViewKindEntity) tempView = ent->ViewItem(i); - if (tempView.IsNull()) ianul = Standard_True; - else if (tempView->TypeNumber() == 0) ianul = Standard_True; - if (ianul) { - ach->AddWarning ("At least one View is Null"); - break; - } - } - nb = ent->NbAnnotations(); - for (i = 1; i <= nb; i ++) { - Handle(IGESData_IGESEntity) ann = ent->Annotation(i); - if (ann.IsNull()) ianul = Standard_True; - else if (ann->TypeNumber() == 0) ianul = Standard_True; - if (ianul) { - ach->AddWarning ("At least one Annotation is Null"); - break; - } - } -} - -void IGESDraw_ToolDrawing::OwnDump - (const Handle(IGESDraw_Drawing)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer sublevel = (level <= 4) ? 0 : 1; - - S << "IGESDraw_Drawing" << endl; - - S << "View Entities : " << endl - << "Transformed View Origins : "; - S << "Count = " << ent->NbViews(); - switch (level) - { - case 4 : S << " [ ask level > 4 for content ]" << endl; - break; // Nothing to be dumped here - case 5 : // Presently level 5 and 6 have the same Dump - S << endl; - case 6 : - { - Standard_Integer I; - Standard_Integer up = ent->NbViews(); - for (I = 1; I <= up; I++) - { - S << endl << "[" << I << "] "; - S << "View Entity : "; - dumper.Dump (ent->ViewItem(I),S, sublevel); - S << endl; - S << "Transformed View Origin : "; - IGESData_DumpXY(S, ent->ViewOrigin(I)); - } - } - break; - } - S << endl << "Annotation Entities : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbAnnotations(),ent->Annotation); - S << endl; -} diff --git a/src/IGESDraw/IGESDraw_ToolDrawing.hxx b/src/IGESDraw/IGESDraw_ToolDrawing.hxx deleted file mode 100644 index e28b0cc573..0000000000 --- a/src/IGESDraw/IGESDraw_ToolDrawing.hxx +++ /dev/null @@ -1,75 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_ToolDrawing_HeaderFile -#define _IGESDraw_ToolDrawing_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESDraw_Drawing; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a Drawing. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDraw_ToolDrawing -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolDrawing, ready to work - IGESDraw_ToolDrawing() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDraw_Drawing)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDraw_Drawing)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a Drawing , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESDraw_Drawing)& ent, Interface_EntityIterator& iter) const; - - //! Sets automatic unambiguous Correction on a Drawing - //! (Null Views are removed from list) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESDraw_Drawing)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_Drawing)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESDraw_Drawing)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDraw_Drawing)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDraw_ToolDrawing_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ToolDrawingWithRotation.cxx b/src/IGESDraw/IGESDraw_ToolDrawingWithRotation.cxx deleted file mode 100644 index 06d4611ea6..0000000000 --- a/src/IGESDraw/IGESDraw_ToolDrawingWithRotation.cxx +++ /dev/null @@ -1,269 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDraw_ToolDrawingWithRotation::ReadOwnParams - (const Handle(IGESDraw_DrawingWithRotation)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Standard_Integer nbval; - - Handle(IGESDraw_HArray1OfViewKindEntity) views; - Handle(TColgp_HArray1OfXY) viewOrigins; - Handle(TColStd_HArray1OfReal) orientationAngles; - Handle(IGESData_HArray1OfIGESEntity) annotations; - - // Reading nbval(Count of Array Views) - Standard_Boolean st = PR.ReadInteger(PR.Current(), "count of array views", nbval); - if (st && nbval > 0) - { - views = new IGESDraw_HArray1OfViewKindEntity(1, nbval); - viewOrigins = new TColgp_HArray1OfXY(1, nbval); - orientationAngles = new TColStd_HArray1OfReal(1, nbval); - - Handle(IGESData_ViewKindEntity) tempView; - gp_XY tempXY; - Standard_Real tempOrient; - - for (Standard_Integer i = 1; i <= nbval; i++) - { - // Reading views(HArray1OfView) - //st = PR.ReadEntity (IR, PR.Current(), "Instance of views", - //STANDARD_TYPE(IGESData_ViewKindEntity), tempView,Standard_True); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity (IR, PR.Current(), "Instance of views", - STANDARD_TYPE(IGESData_ViewKindEntity), tempView,Standard_True)) - views->SetValue(i, tempView); - - // Reading viewOrigins(HArray1OfXY) - //st = PR.ReadXY(PR.CurrentList(1, 2), "array viewOrigins", tempXY); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadXY(PR.CurrentList(1, 2), "array viewOrigins", tempXY)) - viewOrigins->SetValue(i, tempXY); - - if (PR.DefinedElseSkip()) - { - // Reading orientationAngles(HArray1OfReal) - //st = PR.ReadReal(PR.Current(), "array viewOrigins", tempOrient); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "array viewOrigins", tempOrient)) - orientationAngles->SetValue(i, tempOrient); - } - else orientationAngles->SetValue(i, 0.0); // Default Value - } - } - else if (nbval <= 0) - PR.AddFail("Count of view entities : Not Positive"); - - // Reading nbval(No. of Annotation Entities) - //st = PR.ReadInteger(PR.Current(), "Count of array of Annotation entities", nbval); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Count of array of Annotation entities", nbval)) { - if ( nbval > 0 ) - PR.ReadEnts (IR,PR.CurrentList(nbval), "Annotation Entities", annotations); //szv#4:S4163:12Mar99 `st=` not needed -/* - { - // Reading annotations(HArray1OfIGESEntity) - annotations = new IGESData_HArray1OfIGESEntity(1, nbval); - Handle(IGESData_IGESEntity) tempAnnotation; - for (Standard_Integer i = 1; i <= nbval; i++) - { - st = PR.ReadEntity - (IR, PR.Current(), "annotation entity", tempAnnotation,Standard_True); - if (st) annotations->SetValue(i, tempAnnotation); - } - } -*/ - else if (nbval < 0) - PR.AddFail("Count of Annotation entities : Less than zero"); - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init (views, viewOrigins, orientationAngles, annotations); -} - -void IGESDraw_ToolDrawingWithRotation::WriteOwnParams - (const Handle(IGESDraw_DrawingWithRotation)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer Up = ent->NbViews(); - IW.Send( Up ); - Standard_Integer i; // svv Jan 10 2000 : porting on DEC - for ( i = 1; i <= Up; i++) - { - IW.Send( ent->ViewItem(i) ); - IW.Send( (ent->ViewOrigin(i)).X() ); - IW.Send( (ent->ViewOrigin(i)).Y() ); - IW.Send( ent->OrientationAngle(i) ); - } - - Up = ent->NbAnnotations(); - IW.Send( Up ); - for ( i = 1; i <= Up; i++) - IW.Send( ent->Annotation(i) ); -} - -void IGESDraw_ToolDrawingWithRotation::OwnShared - (const Handle(IGESDraw_DrawingWithRotation)& ent, Interface_EntityIterator& iter) const -{ - Standard_Integer Up = ent->NbViews(); - Standard_Integer i; // svv Jan 10 2000 : porting on DEC - for ( i = 1; i <= Up; i++) - iter.GetOneItem( ent->ViewItem(i) ); - Up = ent->NbAnnotations(); - for ( i = 1; i <= Up; i++) - iter.GetOneItem( ent->Annotation(i) ); -} - -Standard_Boolean IGESDraw_ToolDrawingWithRotation::OwnCorrect - (const Handle(IGESDraw_DrawingWithRotation)& ent ) const -{ -// Vues vides : les supprimer - Standard_Integer i, nb = ent->NbViews(); - Standard_Integer nbtrue = nb; - for (i = 1; i <= nb; i ++) { - Handle(IGESData_ViewKindEntity) val = ent->ViewItem(i); - if (val.IsNull()) nbtrue --; - else if (val->TypeNumber() == 0) nbtrue --; - } - if (nbtrue == nb) return Standard_False; - Handle(IGESDraw_HArray1OfViewKindEntity) views; - Handle(TColgp_HArray1OfXY) viewOrigins; - Handle(TColStd_HArray1OfReal) orientationAngles; - if (nbtrue > 0) { - views = new IGESDraw_HArray1OfViewKindEntity (1, nbtrue); - viewOrigins = new TColgp_HArray1OfXY(1, nbtrue); - orientationAngles = new TColStd_HArray1OfReal(1, nbtrue); - } - nbtrue = 0; - for (i = 1; i <= nb; i ++) { - Handle(IGESData_ViewKindEntity) val = ent->ViewItem(i); - if (val.IsNull()) continue; - else if (val->TypeNumber() == 0) continue; - nbtrue ++; - views->SetValue (nbtrue,val); - viewOrigins->SetValue (nbtrue, ent->ViewOrigin(i).XY() ); - orientationAngles->SetValue (nbtrue,ent->OrientationAngle(i)); - } - -// Ne pas oublier les annotations ... - Standard_Integer nbanot = ent->NbAnnotations(); - Handle(IGESData_HArray1OfIGESEntity) annotations = - new IGESData_HArray1OfIGESEntity(1, nbanot); - for (i = 1; i <= nbanot; i ++) annotations->SetValue (i,ent->Annotation(i)); - - ent->Init(views, viewOrigins,orientationAngles, annotations); - return Standard_True; -} - -IGESData_DirChecker IGESDraw_ToolDrawingWithRotation::DirChecker - (const Handle(IGESDraw_DrawingWithRotation)& /*ent*/) const -{ - IGESData_DirChecker DC (404, 1); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.SubordinateStatusRequired(0); - DC.UseFlagRequired(1); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESDraw_ToolDrawingWithRotation::OwnCheck - (const Handle(IGESDraw_DrawingWithRotation)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - Standard_Boolean ianul = Standard_False; - Standard_Integer i, nb = ent->NbViews(); - for (i = 1; i <= nb; i ++) { - Handle(IGESData_ViewKindEntity) tempView = ent->ViewItem(i); - if (tempView.IsNull()) ianul = Standard_True; - else if (tempView->TypeNumber() == 0) ianul = Standard_True; - if (ianul) { - ach->AddWarning ("At least one View is Null"); - break; - } - } - nb = ent->NbAnnotations(); - for (i = 1; i <= nb; i ++) { - Handle(IGESData_IGESEntity) ann = ent->Annotation(i); - if (ann.IsNull()) ianul = Standard_True; - else if (ann->TypeNumber() == 0) ianul = Standard_True; - if (ianul) { - ach->AddWarning ("At least one Annotation is Null"); - break; - } - } -} - -void IGESDraw_ToolDrawingWithRotation::OwnDump - (const Handle(IGESDraw_DrawingWithRotation)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer sublevel = (level <= 4) ? 0 : 1; - - S << "IGESDraw_DrawingWithRotation" << endl; - - S << "View Entities : " << endl - << "Transformed View Origins : " << endl - << "Orientation Angles : "; - S << "Count = " << ent->NbViews() << endl; - - if (level > 4) // Level = 4 : no Dump. Level = 5 & 6 have same Dump - { - Standard_Integer I; - Standard_Integer up = ent->NbViews(); - for (I = 1; I <= up; I++) - { - S << "[" << I << "]:" << endl; - S << "View Entity : "; - dumper.Dump (ent->ViewItem(I),S, sublevel); - S << endl; - S << "Transformed View Origin : "; - IGESData_DumpXY(S, ent->ViewOrigin(I)); - S << " Orientation Angle : " << ent->OrientationAngle(I) << endl; - } - } - S << "Annotation Entities : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbAnnotations(),ent->Annotation); - S << endl; -} diff --git a/src/IGESDraw/IGESDraw_ToolDrawingWithRotation.hxx b/src/IGESDraw/IGESDraw_ToolDrawingWithRotation.hxx deleted file mode 100644 index 71f7b6251d..0000000000 --- a/src/IGESDraw/IGESDraw_ToolDrawingWithRotation.hxx +++ /dev/null @@ -1,75 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_ToolDrawingWithRotation_HeaderFile -#define _IGESDraw_ToolDrawingWithRotation_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESDraw_DrawingWithRotation; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a DrawingWithRotation. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDraw_ToolDrawingWithRotation -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolDrawingWithRotation, ready to work - IGESDraw_ToolDrawingWithRotation() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDraw_DrawingWithRotation)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDraw_DrawingWithRotation)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a DrawingWithRotation , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESDraw_DrawingWithRotation)& ent, Interface_EntityIterator& iter) const; - - //! Sets automatic unambiguous Correction on a DrawingWithRotation - //! (Null Views are removed from list) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESDraw_DrawingWithRotation)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_DrawingWithRotation)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESDraw_DrawingWithRotation)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDraw_DrawingWithRotation)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDraw_ToolDrawingWithRotation_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ToolLabelDisplay.cxx b/src/IGESDraw/IGESDraw_ToolLabelDisplay.cxx deleted file mode 100644 index ecfc406d48..0000000000 --- a/src/IGESDraw/IGESDraw_ToolLabelDisplay.cxx +++ /dev/null @@ -1,192 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDraw_ToolLabelDisplay::ReadOwnParams - (const Handle(IGESDraw_LabelDisplay)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Standard_Integer nbval; - - Handle(IGESDraw_HArray1OfViewKindEntity) views; - Handle(TColgp_HArray1OfXYZ) textLocations; - Handle(IGESDimen_HArray1OfLeaderArrow) leaderEntities; - Handle(TColStd_HArray1OfInteger) labelLevels; - Handle(IGESData_HArray1OfIGESEntity) displayedEntities; - - // Reading nbval(No. of Label placements) - Standard_Boolean st = PR.ReadInteger(PR.Current(), "No. of Label placements", nbval); - if (st && nbval > 0) - { - views = new IGESDraw_HArray1OfViewKindEntity(1, nbval); - textLocations = new TColgp_HArray1OfXYZ(1, nbval); - leaderEntities = new IGESDimen_HArray1OfLeaderArrow(1, nbval); - labelLevels = new TColStd_HArray1OfInteger(1, nbval); - displayedEntities = new IGESData_HArray1OfIGESEntity(1, nbval); - - Handle(IGESData_ViewKindEntity) tempView; - gp_XYZ tempXYZ; - Handle(IGESDimen_LeaderArrow) tempLeaderArrow; - Standard_Integer tempLabel; - Handle(IGESData_IGESEntity) tempDisplayedEntity; - - for (Standard_Integer i = 1; i <= nbval; i++) - { - // Reading views(HArray1OfView) - //st = PR.ReadEntity (IR, PR.Current(), "Instance of views", - //STANDARD_TYPE(IGESData_ViewKindEntity), tempView); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity (IR, PR.Current(), "Instance of views", - STANDARD_TYPE(IGESData_ViewKindEntity), tempView)) - views->SetValue(i, tempView); - - // Reading textLocations(HArray1OfXYZ) - //st = PR.ReadXYZ(PR.CurrentList(1, 3), "array textLocations", tempXYZ); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadXYZ(PR.CurrentList(1, 3), "array textLocations", tempXYZ)) - textLocations->SetValue(i, tempXYZ); - - // Reading leaderEntities(HArray1OfLeaderArrow) - //st = PR.ReadEntity (IR, PR.Current(), "Instance of LeaderArrow", - //STANDARD_TYPE(IGESDimen_LeaderArrow), tempLeaderArrow); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity (IR, PR.Current(), "Instance of LeaderArrow", - STANDARD_TYPE(IGESDimen_LeaderArrow), tempLeaderArrow)) - leaderEntities->SetValue(i, tempLeaderArrow); - - // Reading labelLevels(HArray1OfInteger) - //st = PR.ReadInteger(PR.Current(), "array labelLevels", tempLabel); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "array labelLevels", tempLabel)) - labelLevels->SetValue(i, tempLabel); - - // Reading displayedEntities(HArray1OfIGESEntity) - //st = PR.ReadEntity (IR, PR.Current(), "displayedEntities entity", - //tempDisplayedEntity); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity (IR, PR.Current(), "displayedEntities entity", tempDisplayedEntity)) - displayedEntities->SetValue(i, tempDisplayedEntity); - } - } - else PR.AddFail("No. of Label placements : Not Positive"); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init - (views, textLocations, leaderEntities, labelLevels, displayedEntities); -} - -void IGESDraw_ToolLabelDisplay::WriteOwnParams - (const Handle(IGESDraw_LabelDisplay)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer Up = ent->NbLabels(); - IW.Send( Up ); - for ( Standard_Integer i = 1; i <= Up; i++) - { - IW.Send( ent->ViewItem(i) ); - IW.Send( (ent->TextLocation(i)).X() ); - IW.Send( (ent->TextLocation(i)).Y() ); - IW.Send( (ent->TextLocation(i)).Z() ); - IW.Send( ent->LeaderEntity(i) ); - IW.Send( ent->LabelLevel(i) ); - IW.Send( ent->DisplayedEntity(i) ); - } -} - -void IGESDraw_ToolLabelDisplay::OwnShared - (const Handle(IGESDraw_LabelDisplay)& ent, Interface_EntityIterator& iter) const -{ - Standard_Integer Up = ent->NbLabels(); - for ( Standard_Integer i = 1; i <= Up; i++) - { - iter.GetOneItem( ent->ViewItem(i) ); - iter.GetOneItem( ent->LeaderEntity(i) ); - iter.GetOneItem( ent->DisplayedEntity(i) ); - } -} - -IGESData_DirChecker IGESDraw_ToolLabelDisplay::DirChecker - (const Handle(IGESDraw_LabelDisplay)& /*ent*/) const -{ - IGESData_DirChecker DC (402, 5); - DC.Structure(IGESData_DefVoid); - DC.HierarchyStatusIgnored(); - DC.BlankStatusIgnored(); - return DC; -} - -void IGESDraw_ToolLabelDisplay::OwnDump - (const Handle(IGESDraw_LabelDisplay)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer sublevel = (level <= 4) ? 0 : 1; - - S << "IGESDraw_LabelDisplay" << endl; - - S << "View Entities : " << endl - << "Text Locations : " << endl - << "Leader Entities : " << endl - << "Label Level Numbers : " << endl - << "Displayed Entities : "; - S << "Count = " << ent->NbLabels() << endl; - if (level > 4) // Level = 4 : no Dump. Level = 5 & 6 : same Dump - { - Standard_Integer I; - Standard_Integer up = ent->NbLabels(); - for (I = 1; I <= up; I ++) - { - S << "[" << I << "]:" << endl; - S << "View Entity : "; - dumper.Dump (ent->ViewItem(I),S, sublevel); - S << endl; - S << "Text Location in View : "; - IGESData_DumpXYZL(S,level, ent->TextLocation(I), ent->Location()); - S << " Leader Entity in View : "; - dumper.Dump (ent->LeaderEntity(I),S, sublevel); - S << endl; - S << "Entity Label Level Number : "; - S << ent->LabelLevel(I) << " "; - S << "Displayed Entity : "; - dumper.Dump (ent->DisplayedEntity(I),S, sublevel); - S << endl; - } - } - S << endl; -} diff --git a/src/IGESDraw/IGESDraw_ToolLabelDisplay.hxx b/src/IGESDraw/IGESDraw_ToolLabelDisplay.hxx deleted file mode 100644 index 06bee03f72..0000000000 --- a/src/IGESDraw/IGESDraw_ToolLabelDisplay.hxx +++ /dev/null @@ -1,67 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_ToolLabelDisplay_HeaderFile -#define _IGESDraw_ToolLabelDisplay_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDraw_LabelDisplay; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a LabelDisplay. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDraw_ToolLabelDisplay -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolLabelDisplay, ready to work - IGESDraw_ToolLabelDisplay() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDraw_LabelDisplay)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDraw_LabelDisplay)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a LabelDisplay , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESDraw_LabelDisplay)& ent, Interface_EntityIterator& iter) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_LabelDisplay)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDraw_LabelDisplay)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDraw_ToolLabelDisplay_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ToolNetworkSubfigure.cxx b/src/IGESDraw/IGESDraw_ToolNetworkSubfigure.cxx deleted file mode 100644 index 6bc4f6c1ee..0000000000 --- a/src/IGESDraw/IGESDraw_ToolNetworkSubfigure.cxx +++ /dev/null @@ -1,208 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDraw_ToolNetworkSubfigure::ReadOwnParams - (const Handle(IGESDraw_NetworkSubfigure)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer nbval; - - Handle(IGESDraw_NetworkSubfigureDef) definition; - gp_XYZ translation; - gp_XYZ scale; - Standard_Integer typeflag; - Handle(TCollection_HAsciiString) designator; - Handle(IGESGraph_TextDisplayTemplate) textTemplate; - Handle(IGESDraw_HArray1OfConnectPoint) connectPoints; - - Standard_Real scaleX; - Standard_Real scaleY; - Standard_Real scaleZ; - - // Reading definition(Instance of NetworkSubfigureDef) - PR.ReadEntity(IR, PR.Current(), "Instance of NetworkSubfigureDef", - STANDARD_TYPE(IGESDraw_NetworkSubfigureDef), definition); //szv#4:S4163:12Mar99 `st=` not needed - - // Reading translation(XYZ) - PR.ReadXYZ( PR.CurrentList(1, 3), "Translation data", translation); //szv#4:S4163:12Mar99 `st=` not needed - - // Reading scale(XYZ) - if (PR.DefinedElseSkip()) // Reading scale(X) - PR.ReadReal(PR.Current(), "Scale factors(X)", scaleX); //szv#4:S4163:12Mar99 `st=` not needed - else - scaleX = 1.0; // Default Value - - if (PR.DefinedElseSkip()) // Reading scale(Y) - PR.ReadReal(PR.Current(), "Scale factors(Y)", scaleY); //szv#4:S4163:12Mar99 `st=` not needed - else - scaleY = scaleX; // Default Value - - if (PR.DefinedElseSkip()) // Reading scale(Z) - PR.ReadReal(PR.Current(), "Scale factors(Z)", scaleZ); //szv#4:S4163:12Mar99 `st=` not needed - else - scaleZ = scaleX; // Default Value - - scale.SetCoord(scaleX, scaleY, scaleZ); - - if (PR.DefinedElseSkip()) // Reading typeflag(Integer) - PR.ReadInteger(PR.Current(), "Type flag", typeflag); //szv#4:S4163:12Mar99 `st=` not needed - else - typeflag = 0; // Default Value - - // Reading designator(String) - if (PR.DefinedElseSkip()) - PR.ReadText(PR.Current(), "Primary reference designator", designator); //szv#4:S4163:12Mar99 `st=` not needed - else PR.AddWarning("Primary reference designator : Null definition"); - - // Reading textTemplate(Instance of TextDisplayTemplate or Null) - Standard_Boolean st = PR.ReadEntity(IR, PR.Current(), "Instance of TextDisplayTemplate", - STANDARD_TYPE(IGESGraph_TextDisplayTemplate), textTemplate, - Standard_True); - - // Reading nbval(Integer) - if (PR.DefinedElseSkip()) - st = PR.ReadInteger(PR.Current(),"Count of Connect Points", nbval); //szv#4:S4163:12Mar99 `st=` not needed - else nbval = 0; - if (st && nbval > 0) - { - // Reading connectPoints(HArray1OfConnectPoint) - connectPoints = new IGESDraw_HArray1OfConnectPoint(1, nbval); - Handle(IGESDraw_ConnectPoint) tempConnectPoint; - for (Standard_Integer i = 1; i <= nbval; i++) - { - //st = PR.ReadEntity(IR, PR.Current(), "ConnectPoint entity", - //STANDARD_TYPE(IGESDraw_ConnectPoint),tempConnectPoint, - //Standard_True); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR, PR.Current(), "ConnectPoint entity", - STANDARD_TYPE(IGESDraw_ConnectPoint),tempConnectPoint, Standard_True)) - connectPoints->SetValue(i, tempConnectPoint); - } - } - else if (nbval < 0) - PR.AddFail ("Count of Connect point entities : Less than Zero"); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init - (definition, translation, scale, typeflag, - designator, textTemplate, connectPoints); -} - -void IGESDraw_ToolNetworkSubfigure::WriteOwnParams - (const Handle(IGESDraw_NetworkSubfigure)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send( ent->SubfigureDefinition() ); - IW.Send( ent->Translation().X() ); - IW.Send( ent->Translation().Y() ); - IW.Send( ent->Translation().Z() ); - IW.Send( ent->ScaleFactors().X() ); - IW.Send( ent->ScaleFactors().Y() ); - IW.Send( ent->ScaleFactors().Z() ); - IW.Send( ent->TypeFlag() ); - IW.Send( ent->ReferenceDesignator() ); - - IW.Send( ent->DesignatorTemplate() ); - - IW.Send( ent->NbConnectPoints() ); - - Standard_Integer Up = ent->NbConnectPoints(); - for ( Standard_Integer i = 1; i <= Up; i++) - IW.Send( ent->ConnectPoint(i) ); -} - -void IGESDraw_ToolNetworkSubfigure::OwnShared - (const Handle(IGESDraw_NetworkSubfigure)& ent, Interface_EntityIterator& iter) const -{ - iter.GetOneItem( ent->SubfigureDefinition() ); - iter.GetOneItem( ent->DesignatorTemplate() ); - Standard_Integer Up = ent->NbConnectPoints(); - for ( Standard_Integer i = 1; i <= Up; i++) - iter.GetOneItem( ent->ConnectPoint(i) ); -} - -IGESData_DirChecker IGESDraw_ToolNetworkSubfigure::DirChecker - (const Handle(IGESDraw_NetworkSubfigure)& /*ent*/) const -{ - IGESData_DirChecker DC (420, 0); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefAny); - DC.LineWeight(IGESData_DefValue); - DC.Color(IGESData_DefAny); - return DC; -} - -void IGESDraw_ToolNetworkSubfigure::OwnCheck - (const Handle(IGESDraw_NetworkSubfigure)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if ( ent->TypeFlag() != 0 && - ent->TypeFlag() != 1 && - ent->TypeFlag() != 2 ) - ach->AddFail("Type Flag : Value != 0/1/2"); - if (ent->NbConnectPoints() != ent->SubfigureDefinition()->NbPointEntities()) - ach->AddFail("Count of associated Connect Points inconsistent with Definition"); - if (ent->ReferenceDesignator().IsNull()) - ach->AddFail("Primary Reference Designator : not defined"); -} - -void IGESDraw_ToolNetworkSubfigure::OwnDump - (const Handle(IGESDraw_NetworkSubfigure)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer sublevel = (level <= 4) ? 0 : 1; - - S << "IGESDraw_NetworkSubfigure" << endl; - - S << "Network Subfigure Definition Entity : "; - dumper.Dump(ent->SubfigureDefinition(),S, sublevel); - S << endl << "Translation Data : "; - IGESData_DumpXYZL(S,level, ent->Translation(), ent->Location()); - S << endl << "Scale Factors : "; - IGESData_DumpXYZ(S, ent->ScaleFactors()); - S << endl << "Type Flag : " << ent->TypeFlag() << endl; - S << "Primary Reference Designator : "; - IGESData_DumpString(S,ent->ReferenceDesignator()); - S << endl << "Text Display Template Entity : "; - dumper.Dump(ent->DesignatorTemplate(),S, sublevel); - S << endl << "Connect Points : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbConnectPoints(),ent->ConnectPoint); - S << endl; -} diff --git a/src/IGESDraw/IGESDraw_ToolNetworkSubfigure.hxx b/src/IGESDraw/IGESDraw_ToolNetworkSubfigure.hxx deleted file mode 100644 index a00a81497e..0000000000 --- a/src/IGESDraw/IGESDraw_ToolNetworkSubfigure.hxx +++ /dev/null @@ -1,70 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_ToolNetworkSubfigure_HeaderFile -#define _IGESDraw_ToolNetworkSubfigure_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDraw_NetworkSubfigure; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a NetworkSubfigure. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDraw_ToolNetworkSubfigure -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolNetworkSubfigure, ready to work - IGESDraw_ToolNetworkSubfigure() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDraw_NetworkSubfigure)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDraw_NetworkSubfigure)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a NetworkSubfigure , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESDraw_NetworkSubfigure)& ent, Interface_EntityIterator& iter) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_NetworkSubfigure)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESDraw_NetworkSubfigure)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDraw_NetworkSubfigure)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDraw_ToolNetworkSubfigure_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ToolNetworkSubfigureDef.cxx b/src/IGESDraw/IGESDraw_ToolNetworkSubfigureDef.cxx deleted file mode 100644 index f41d856fda..0000000000 --- a/src/IGESDraw/IGESDraw_ToolNetworkSubfigureDef.cxx +++ /dev/null @@ -1,197 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDraw_ToolNetworkSubfigureDef::ReadOwnParams - (const Handle(IGESDraw_NetworkSubfigureDef)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - Standard_Integer tempDepth, tempNbEntities1, tempTypeFlag, tempNbEntities2; - Handle(TCollection_HAsciiString) tempName, tempDesignator; - Handle(IGESGraph_TextDisplayTemplate) tempTemplate; - Handle(IGESData_HArray1OfIGESEntity) tempEntities; - Handle(IGESDraw_HArray1OfConnectPoint) tempPointEntities; - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(), "Depth Of Subfigure", tempDepth); - PR.ReadText(PR.Current(), "Subfigure Name", tempName); - - //st = PR.ReadInteger(PR.Current(), "Number Of Child Entities", tempNbEntities1); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Number Of Child Entities", tempNbEntities1)) { - // Initialize HArray1 only if there is no error reading its Length - if (tempNbEntities1 < 0) - PR.AddFail("Number Of Child Entities : Not Positive"); - else if (tempNbEntities1 > 0) - PR.ReadEnts(IR,PR.CurrentList(tempNbEntities1),"Child Entities",tempEntities); //szv#4:S4163:12Mar99 `st=` not needed -// tempEntities = new IGESData_HArray1OfIGESEntity (1,tempNbEntities1); - } - - // Read the HArray1 only if its Length was read without any Error -/* - if (! tempEntities.IsNull()) { - Handle(IGESData_IGESEntity) tempEntity1; - Standard_Integer I; - for (I = 1; I <= tempNbEntities1; I++) { - st = PR.ReadEntity(IR, PR.Current(), "Associated Entity", - tempEntity1); - if (st) tempEntities->SetValue(I, tempEntity1); - } - } -*/ - PR.ReadInteger(PR.Current(), "Type Flag", tempTypeFlag); //szv#4:S4163:12Mar99 `st=` not needed - - if (PR.DefinedElseSkip()) - PR.ReadText(PR.Current(), "Primary Reference Designator", tempDesignator); //szv#4:S4163:12Mar99 `st=` not needed - else PR.AddWarning("Primary Reference Designator : Null"); - - Standard_Boolean st = PR.ReadEntity(IR, PR.Current(), "Primary Reference Designator", - STANDARD_TYPE(IGESGraph_TextDisplayTemplate), tempTemplate, - Standard_True); - - if (PR.DefinedElseSkip()) - st = PR.ReadInteger(PR.Current(), "Number Of Connect Points", tempNbEntities2); - else tempNbEntities2 = 0; - if (st) { - // Initialise HArray1 only if there is no error reading its Length - if (tempNbEntities2 < 0) - PR.AddFail("Number Of Connect Points : Less Than Zero"); - else if (tempNbEntities2 > 0) tempPointEntities = - new IGESDraw_HArray1OfConnectPoint (1, tempNbEntities2); - } - - // Read the HArray1 only if its Length was read without any Error - if (! tempPointEntities.IsNull()) { - Handle(IGESDraw_ConnectPoint) tempConnectPoint; - Standard_Integer I; - for (I = 1; I <= tempNbEntities2; I++) { - //st = PR.ReadEntity(IR, PR.Current(),"Associated Connect Point Entity", - //STANDARD_TYPE(IGESDraw_ConnectPoint), tempConnectPoint, - //Standard_True); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR, PR.Current(),"Associated Connect Point Entity", - STANDARD_TYPE(IGESDraw_ConnectPoint), tempConnectPoint, Standard_True)) - tempPointEntities->SetValue(I, tempConnectPoint); - } - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init - (tempDepth, tempName, tempEntities, tempTypeFlag, tempDesignator, - tempTemplate, tempPointEntities); -} - -void IGESDraw_ToolNetworkSubfigureDef::WriteOwnParams - (const Handle(IGESDraw_NetworkSubfigureDef)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer up = ent->NbEntities(); - IW.Send(ent->Depth()); - IW.Send(ent->Name()); - IW.Send(up); - Standard_Integer I; - for (I = 1; I <= up; I++) - IW.Send(ent->Entity(I)); - IW.Send(ent->TypeFlag()); - IW.Send(ent->Designator()); - IW.Send(ent->DesignatorTemplate()); - up = ent->NbPointEntities(); - IW.Send(up); - for (I = 1; I <= up; I++) - IW.Send(ent->PointEntity(I)); -} - -void IGESDraw_ToolNetworkSubfigureDef::OwnShared - (const Handle(IGESDraw_NetworkSubfigureDef)& ent, Interface_EntityIterator& iter) const -{ - Standard_Integer I; - Standard_Integer up = ent->NbEntities(); - for (I = 1; I <= up; I++) - iter.GetOneItem(ent->Entity(I)); - up = ent->NbPointEntities(); - for (I = 1; I <= up; I++) - iter.GetOneItem(ent->PointEntity(I)); -} - -IGESData_DirChecker IGESDraw_ToolNetworkSubfigureDef::DirChecker - (const Handle(IGESDraw_NetworkSubfigureDef)& /*ent*/) const -{ - IGESData_DirChecker DC(320, 0); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefAny); - DC.LineWeight(IGESData_DefValue); - DC.BlankStatusIgnored(); - DC.UseFlagRequired(2); - DC.GraphicsIgnored(1); - - return DC; -} - -void IGESDraw_ToolNetworkSubfigureDef::OwnCheck - (const Handle(IGESDraw_NetworkSubfigureDef)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if ((ent->TypeFlag() < 0) || (ent->TypeFlag() > 2)) - ach->AddFail("TypeFlag has Invalid value"); - if (ent->Designator().IsNull()) - ach->AddFail("Primary Reference Designator : not defined"); -} - -void IGESDraw_ToolNetworkSubfigureDef::OwnDump - (const Handle(IGESDraw_NetworkSubfigureDef)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1; - - S << "IGESDraw_NetworkSubfigureDef" << endl; - - S << "Depth Of Subfigure(Nesting) : " << ent->Depth() << endl; - S << "Name Of Subfigure : "; - IGESData_DumpString(S,ent->Name()); - S << endl << "Associated Entities : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbEntities(),ent->Entity); - S << endl << "Type Flag : " << ent->TypeFlag() << endl; - S << "Primary Reference Designator : "; - IGESData_DumpString(S,ent->Designator()); - S << endl << "Text Display Template Entity : "; - dumper.Dump(ent->DesignatorTemplate(),S, tempSubLevel); - S << endl << "Connect Point Entities : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbPointEntities(),ent->PointEntity); - S << endl; -} diff --git a/src/IGESDraw/IGESDraw_ToolNetworkSubfigureDef.hxx b/src/IGESDraw/IGESDraw_ToolNetworkSubfigureDef.hxx deleted file mode 100644 index ea8d0bcded..0000000000 --- a/src/IGESDraw/IGESDraw_ToolNetworkSubfigureDef.hxx +++ /dev/null @@ -1,70 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_ToolNetworkSubfigureDef_HeaderFile -#define _IGESDraw_ToolNetworkSubfigureDef_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDraw_NetworkSubfigureDef; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a NetworkSubfigureDef. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDraw_ToolNetworkSubfigureDef -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolNetworkSubfigureDef, ready to work - IGESDraw_ToolNetworkSubfigureDef() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDraw_NetworkSubfigureDef)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDraw_NetworkSubfigureDef)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a NetworkSubfigureDef , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESDraw_NetworkSubfigureDef)& ent, Interface_EntityIterator& iter) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_NetworkSubfigureDef)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESDraw_NetworkSubfigureDef)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDraw_NetworkSubfigureDef)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDraw_ToolNetworkSubfigureDef_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ToolPerspectiveView.cxx b/src/IGESDraw/IGESDraw_ToolPerspectiveView.cxx deleted file mode 100644 index 7f6732d541..0000000000 --- a/src/IGESDraw/IGESDraw_ToolPerspectiveView.cxx +++ /dev/null @@ -1,180 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDraw_ToolPerspectiveView::ReadOwnParams - (const Handle(IGESDraw_PerspectiveView)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - gp_XY tempTopLeft, tempBottomRight; - Standard_Real tempLeft, tempRight, tempTop, tempBottom; - gp_XYZ tempCenterOfProjection, tempViewUpVector; - gp_XYZ tempViewNormalVector, tempViewReferencePoint; - Standard_Integer tempViewNumber, tempDepthClip; - Standard_Real tempScaleFactor, tempViewPlaneDistance; - Standard_Real tempBackPlaneDistance, tempFrontPlaneDistance; - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(), "View Number", tempViewNumber); - PR.ReadReal(PR.Current(), "Scale Number", tempScaleFactor); - PR.ReadXYZ(PR.CurrentList(1, 3), "View Plane Normal Vector", tempViewNormalVector); - PR.ReadXYZ(PR.CurrentList(1, 3), "View Reference Point", tempViewReferencePoint); - PR.ReadXYZ(PR.CurrentList(1, 3), "Center Of Projection", tempCenterOfProjection); - PR.ReadXYZ(PR.CurrentList(1, 3), "View Up Vector", tempViewUpVector); - PR.ReadReal(PR.Current(), "View Plane Distance", tempViewPlaneDistance); - - //st = PR.ReadReal(PR.Current(), "Left Side Of Clipping Window", tempLeft); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Left Side Of Clipping Window", tempLeft)) - tempTopLeft.SetX(tempLeft); - - //st = PR.ReadReal(PR.Current(), "Right Side Of Clipping Window", tempRight); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Right Side Of Clipping Window", tempRight)) - tempBottomRight.SetX(tempRight); - - //st = PR.ReadReal(PR.Current(), "Bottom Of Clipping Window", tempBottom); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Bottom Of Clipping Window", tempBottom)) - tempBottomRight.SetY(tempBottom); - - //st = PR.ReadReal(PR.Current(), "Top Of Clipping Window", tempTop); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Top Of Clipping Window", tempTop)) - tempTopLeft.SetY(tempTop); - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadInteger(PR.Current(), "Depth Clipping Indicator", tempDepthClip); - PR.ReadReal(PR.Current(), "Back Plane Distance", tempBackPlaneDistance); - PR.ReadReal(PR.Current(), "Front Plane Distance", tempFrontPlaneDistance); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init - (tempViewNumber, tempScaleFactor, tempViewNormalVector, - tempViewReferencePoint, tempCenterOfProjection, tempViewUpVector, - tempViewPlaneDistance, tempTopLeft, tempBottomRight, tempDepthClip, - tempBackPlaneDistance, tempFrontPlaneDistance); -} - -void IGESDraw_ToolPerspectiveView::WriteOwnParams - (const Handle(IGESDraw_PerspectiveView)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->ViewNumber()); - IW.Send(ent->ScaleFactor()); - IW.Send(ent->ViewNormalVector().X()); - IW.Send(ent->ViewNormalVector().Y()); - IW.Send(ent->ViewNormalVector().Z()); - IW.Send(ent->ViewReferencePoint().X()); - IW.Send(ent->ViewReferencePoint().Y()); - IW.Send(ent->ViewReferencePoint().Z()); - IW.Send(ent->CenterOfProjection().X()); - IW.Send(ent->CenterOfProjection().Y()); - IW.Send(ent->CenterOfProjection().Z()); - IW.Send(ent->ViewUpVector().X()); - IW.Send(ent->ViewUpVector().Y()); - IW.Send(ent->ViewUpVector().Z()); - IW.Send(ent->ViewPlaneDistance()); - IW.Send(ent->TopLeft().X()); - IW.Send(ent->BottomRight().X()); - IW.Send(ent->BottomRight().Y()); - IW.Send(ent->TopLeft().Y()); - IW.Send(ent->DepthClip()); - IW.Send(ent->BackPlaneDistance()); - IW.Send(ent->FrontPlaneDistance()); -} - - -IGESData_DirChecker IGESDraw_ToolPerspectiveView::DirChecker - (const Handle(IGESDraw_PerspectiveView)& /*ent*/) const -{ - IGESData_DirChecker DC(410, 1); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagRequired(1); - DC.HierarchyStatusIgnored(); - - return DC; -} - -void IGESDraw_ToolPerspectiveView::OwnCheck - (const Handle(IGESDraw_PerspectiveView)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if ((ent->DepthClip() < 0) || (ent->DepthClip() > 3)) - ach->AddFail("DepthClip has invalid value"); - if (ent->HasTransf()) { - if (ent->Transf()->FormNumber() != 0) - ach->AddFail("Associated Matrix has not Form Number 0"); - } -} - -void IGESDraw_ToolPerspectiveView::OwnDump - (const Handle(IGESDraw_PerspectiveView)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESDraw_PerspectiveView" << endl; - - S << "View Number : " << ent->ViewNumber() << " "; - S << "Scale Factor : " << ent->ScaleFactor() << endl; - S << "View Plane Normal Vector : "; - IGESData_DumpXYZL(S,level, ent->ViewNormalVector(), ent->Location()); - S << endl << "View Reference Point : "; - IGESData_DumpXYZL(S,level, ent->ViewReferencePoint() , ent->Location()); - S << endl << "Center Of Projection : "; - IGESData_DumpXYZL(S,level, ent->CenterOfProjection() , ent->Location()); - S << endl << "View Up Vector : "; - IGESData_DumpXYZL(S,level, ent->ViewUpVector() , ent->Location()); - S << endl << "View Plane Distance : " << ent->ViewPlaneDistance()<TopLeft().X() << endl; - S << "Right Side Of Clipping Window : " << ent->BottomRight().X() << endl; - S << "Bottom Side Of Clipping Window : " << ent->BottomRight().Y() << endl; - S << "Top Side Of Clipping Window : " << ent->TopLeft().Y() << endl; - S << "Depth Clipping : " << ent->DepthClip(); - switch (ent->DepthClip()) { - case 0 : S << " (No Depth Clipping)" << endl; break; - case 1 : S << " (Back Clipping Plane ON)" << endl; break; - case 2 : S << " (Front Clipping Plane ON)" << endl; break; - case 3 : S << " (Front and Back Clipping Planes ON)" << endl; break; - default : S << " (Invalid Value)" << endl; break; - } - S << "Back Plane Distance : " << ent->BackPlaneDistance() << " "; - S << "Front Plane Distance : " << ent->FrontPlaneDistance() << endl; - S << endl; -} diff --git a/src/IGESDraw/IGESDraw_ToolPerspectiveView.hxx b/src/IGESDraw/IGESDraw_ToolPerspectiveView.hxx deleted file mode 100644 index b3cc0663f2..0000000000 --- a/src/IGESDraw/IGESDraw_ToolPerspectiveView.hxx +++ /dev/null @@ -1,66 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_ToolPerspectiveView_HeaderFile -#define _IGESDraw_ToolPerspectiveView_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDraw_PerspectiveView; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a PerspectiveView. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDraw_ToolPerspectiveView -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolPerspectiveView, ready to work - IGESDraw_ToolPerspectiveView() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDraw_PerspectiveView)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDraw_PerspectiveView)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_PerspectiveView)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESDraw_PerspectiveView)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDraw_PerspectiveView)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDraw_ToolPerspectiveView_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ToolPlanar.cxx b/src/IGESDraw/IGESDraw_ToolPlanar.cxx deleted file mode 100644 index c8e626c232..0000000000 --- a/src/IGESDraw/IGESDraw_ToolPlanar.cxx +++ /dev/null @@ -1,160 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDraw_ToolPlanar::ReadOwnParams - (const Handle(IGESDraw_Planar)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - Standard_Boolean st; - Standard_Integer nbval; - - Standard_Integer nbMatrices; - Handle(IGESGeom_TransformationMatrix) transformationMatrix; - Handle(IGESData_HArray1OfIGESEntity) entities; - - // Reading nbMatrices(Integer) - st = PR.ReadInteger(PR.Current(), "No. of Transformation matrices", nbMatrices); - if ( nbMatrices != 1 ) - PR.AddFail("No. of Transformation matrices != 1"); - - // Reading nbval(Integer) - st = PR.ReadInteger(PR.Current(), "No. of Entities in this plane", nbval); - if (!st) nbval = 0; //szv#4:S4163:12Mar99 was bug: `nbval == 0` - if (nbval <= 0) PR.AddFail ("No. of Entities in this plane : Not Positive"); - - // Reading transformationMatrix(Instance of TransformationMatrix or Null) - st = PR.ReadEntity(IR,PR.Current(), "Instance of TransformationMatrix", - STANDARD_TYPE(IGESGeom_TransformationMatrix), transformationMatrix, - Standard_True); - - if (nbval > 0) - st = PR.ReadEnts (IR, PR.CurrentList(nbval), "Planar Entities", entities); -/* - { - entities = new IGESData_HArray1OfIGESEntity(1, nbval); - // Reading entities(HArray1OfIGESEntity) - Handle(IGESData_IGESEntity) tempEntity; - for (Standard_Integer i = 1; i <= nbval; i++) - { - st = PR.ReadEntity(IR, PR.Current(), "Plane entity", tempEntity); - if (st) entities->SetValue(i, tempEntity); - } - } -*/ - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(nbMatrices,transformationMatrix, entities); -} - -void IGESDraw_ToolPlanar::WriteOwnParams - (const Handle(IGESDraw_Planar)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer Up = ent->NbEntities(); - IW.Send( ent->NbMatrices() ); - IW.Send( Up ); - - IW.Send( ent->TransformMatrix() ); - - for ( Standard_Integer i = 1; i <= Up; i++) - IW.Send( ent->Entity(i) ); -} - -void IGESDraw_ToolPlanar::OwnShared - (const Handle(IGESDraw_Planar)& ent, Interface_EntityIterator& iter) const -{ - Standard_Integer Up = ent->NbEntities(); - iter.GetOneItem( ent->TransformMatrix() ); - for ( Standard_Integer i = 1; i <= Up; i++) - iter.GetOneItem( ent->Entity(i) ); -} - -Standard_Boolean IGESDraw_ToolPlanar::OwnCorrect - (const Handle(IGESDraw_Planar)& ent) const -{ - if (ent->NbMatrices() == 1) return Standard_False; -// Forcer NbMNatrices a 1 -> Reconstruire - Standard_Integer nb = ent->NbEntities(); - Handle(IGESData_HArray1OfIGESEntity) ents = - new IGESData_HArray1OfIGESEntity(1,nb); - for (Standard_Integer i = 1; i <= nb; i ++) - ents->SetValue(i,ent->Entity(i)); - ent->Init (1,ent->TransformMatrix(),ents); - return Standard_True; -} - -IGESData_DirChecker IGESDraw_ToolPlanar::DirChecker - (const Handle(IGESDraw_Planar)& /*ent*/) const -{ - IGESData_DirChecker DC (402, 16); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagRequired(5); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESDraw_ToolPlanar::OwnCheck - (const Handle(IGESDraw_Planar)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if ( ent->NbMatrices() != 1 ) - ach->AddFail("No. of Transformation matrices : Value != 1"); -} - -void IGESDraw_ToolPlanar::OwnDump - (const Handle(IGESDraw_Planar)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer sublevel = (level <= 4) ? 0 : 1; - - S << "IGESDraw_Planar" << endl; - - S << "No. of Transformation Matrices : " << ent->NbMatrices() << " "; - S << "i.e. : "; - if ( ent->TransformMatrix().IsNull() ) - S << "Null Handle"; - else - dumper.OwnDump (ent->TransformMatrix(),S, sublevel); - S << endl; - S << "Array of Entities on the specified plane : "; - IGESData_DumpEntities(S,dumper ,level,1, ent->NbEntities(),ent->Entity); - S << endl; -} diff --git a/src/IGESDraw/IGESDraw_ToolPlanar.hxx b/src/IGESDraw/IGESDraw_ToolPlanar.hxx deleted file mode 100644 index 1db1b7f87c..0000000000 --- a/src/IGESDraw/IGESDraw_ToolPlanar.hxx +++ /dev/null @@ -1,75 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_ToolPlanar_HeaderFile -#define _IGESDraw_ToolPlanar_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESDraw_Planar; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a Planar. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDraw_ToolPlanar -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolPlanar, ready to work - IGESDraw_ToolPlanar() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDraw_Planar)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDraw_Planar)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a Planar , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESDraw_Planar)& ent, Interface_EntityIterator& iter) const; - - //! Sets automatic unambiguous Correction on a Planar - //! (NbMatrices forced to 1) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESDraw_Planar)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_Planar)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESDraw_Planar)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDraw_Planar)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDraw_ToolPlanar_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ToolRectArraySubfigure.cxx b/src/IGESDraw/IGESDraw_ToolRectArraySubfigure.cxx deleted file mode 100644 index 4325b912b7..0000000000 --- a/src/IGESDraw/IGESDraw_ToolRectArraySubfigure.cxx +++ /dev/null @@ -1,163 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDraw_ToolRectArraySubfigure::ReadOwnParams - (const Handle(IGESDraw_RectArraySubfigure)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - gp_XYZ tempLowerLeftCorner; - Standard_Real tempScaleFactor; - Handle(IGESData_IGESEntity) tempBaseEntity; - Handle(TColStd_HArray1OfInteger) tempPositions; - Standard_Real tempColumnSeparation, tempRowSeparation, tempRotationAngle; - Standard_Integer tempNbColumns, tempNbRows, tempDoDontFlag, tempListCount; - - PR.ReadEntity(IR, PR.Current(), "Base Entity", tempBaseEntity); //szv#4:S4163:12Mar99 `st=` not needed - - if (PR.DefinedElseSkip()) - PR.ReadReal(PR.Current(), "Scale Factor", tempScaleFactor); //szv#4:S4163:12Mar99 `st=` not needed - else - tempScaleFactor = 1.0; // Setting to default value of 1.0 - - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadXYZ(PR.CurrentList(1, 3), "Lower Left Coordinate Of Array", tempLowerLeftCorner); - PR.ReadInteger(PR.Current(), "Number Of Columns", tempNbColumns); - PR.ReadInteger(PR.Current(), "Number Of Rows", tempNbRows); - PR.ReadReal(PR.Current(), "Horizontal Distance Between Columns", tempColumnSeparation); - PR.ReadReal(PR.Current(), "Vertical Distance Between Rows", tempRowSeparation); - PR.ReadReal(PR.Current(), "Rotation Angle", tempRotationAngle); - - //st = PR.ReadInteger(PR.Current(), "DO-DONT List Count", tempListCount); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "DO-DONT List Count", tempListCount)) { - // Initialise HArray1 only if there is no error reading its Length - if (tempListCount > 0) - tempPositions = new TColStd_HArray1OfInteger (1, tempListCount); - else if (tempListCount < 0) - PR.AddFail("DO-DONT List Count : Less than Zero"); - } - - PR.ReadInteger(PR.Current(), "DO-DONT Flag", tempDoDontFlag); //szv#4:S4163:12Mar99 `st=` not needed - - // Read the HArray1 only if its Length was read without any Error - if (! tempPositions.IsNull()) { - Standard_Integer I; - for (I = 1; I <= tempListCount; I++) { - Standard_Integer tempPos; - //st = PR.ReadInteger(PR.Current(), "Number Of Position To Process", - //tempPos); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Number Of Position To Process", tempPos)) - tempPositions->SetValue(I, tempPos); - } - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init - (tempBaseEntity, tempScaleFactor, tempLowerLeftCorner, - tempNbColumns, tempNbRows, tempColumnSeparation, tempRowSeparation, - tempRotationAngle, tempDoDontFlag, tempPositions); -} - -void IGESDraw_ToolRectArraySubfigure::WriteOwnParams - (const Handle(IGESDraw_RectArraySubfigure)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->BaseEntity()); - IW.Send(ent->ScaleFactor()); - IW.Send(ent->LowerLeftCorner().X()); - IW.Send(ent->LowerLeftCorner().Y()); - IW.Send(ent->LowerLeftCorner().Z()); - IW.Send(ent->NbColumns()); - IW.Send(ent->NbRows()); - IW.Send(ent->ColumnSeparation()); - IW.Send(ent->RowSeparation()); - IW.Send(ent->RotationAngle()); - IW.Send(ent->ListCount()); - IW.SendBoolean(ent->DoDontFlag()); - Standard_Integer I; - Standard_Integer up = ent->ListCount(); - for (I = 1; I <= up; I++) - IW.Send(ent->ListPosition(I)); -} - -void IGESDraw_ToolRectArraySubfigure::OwnShared - (const Handle(IGESDraw_RectArraySubfigure)& ent, Interface_EntityIterator& iter) const -{ - iter.GetOneItem(ent->BaseEntity()); -} - -IGESData_DirChecker IGESDraw_ToolRectArraySubfigure::DirChecker - (const Handle(IGESDraw_RectArraySubfigure)& /*ent*/) const -{ - IGESData_DirChecker DC(412, 0); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefAny); - DC.LineWeight(IGESData_DefValue); - DC.Color(IGESData_DefAny); - DC.GraphicsIgnored(1); - - return DC; -} - -void IGESDraw_ToolRectArraySubfigure::OwnDump - (const Handle(IGESDraw_RectArraySubfigure)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1; - - S << "IGESDraw_RectArraySubfigure" << endl; - - S << "Base Entity : "; - dumper.Dump(ent->BaseEntity(),S, tempSubLevel); - S << endl; - S << "Scale Factor : " << ent->ScaleFactor() << " "; - S << "Lower Left Corner Of Array : "; - IGESData_DumpXYZL(S,level, ent->LowerLeftCorner(),gp_GTrsf()); // no location - S << "Number Of Columns : " << ent->NbColumns() << " "; - S << "Number Of Rows : " << ent->NbRows() << endl; - S << "Horizontal Distance Between Columns : " << ent->ColumnSeparation()<RowSeparation() <RotationAngle() <DoDontFlag()) S << "(1)Dont "; - else S << "(0)Do "; - S << "Do-Dont List : "; - IGESData_DumpVals(S ,level,1, ent->ListCount(),ent->ListPosition); - S << endl; -} diff --git a/src/IGESDraw/IGESDraw_ToolRectArraySubfigure.hxx b/src/IGESDraw/IGESDraw_ToolRectArraySubfigure.hxx deleted file mode 100644 index ec3c111080..0000000000 --- a/src/IGESDraw/IGESDraw_ToolRectArraySubfigure.hxx +++ /dev/null @@ -1,67 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_ToolRectArraySubfigure_HeaderFile -#define _IGESDraw_ToolRectArraySubfigure_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDraw_RectArraySubfigure; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a RectArraySubfigure. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDraw_ToolRectArraySubfigure -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolRectArraySubfigure, ready to work - IGESDraw_ToolRectArraySubfigure() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDraw_RectArraySubfigure)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDraw_RectArraySubfigure)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a RectArraySubfigure , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESDraw_RectArraySubfigure)& ent, Interface_EntityIterator& iter) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_RectArraySubfigure)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDraw_RectArraySubfigure)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDraw_ToolRectArraySubfigure_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ToolSegmentedViewsVisible.cxx b/src/IGESDraw/IGESDraw_ToolSegmentedViewsVisible.cxx deleted file mode 100644 index 05f2bef04c..0000000000 --- a/src/IGESDraw/IGESDraw_ToolSegmentedViewsVisible.cxx +++ /dev/null @@ -1,257 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDraw_ToolSegmentedViewsVisible::ReadOwnParams - (const Handle(IGESDraw_SegmentedViewsVisible)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Standard_Integer nbval; - - Handle(IGESDraw_HArray1OfViewKindEntity) views; - Handle(TColStd_HArray1OfReal) breakpointParameters; - Handle(TColStd_HArray1OfInteger) displayFlags; - Handle(TColStd_HArray1OfInteger) colorValues; - Handle(IGESGraph_HArray1OfColor) colorDefinitions; - Handle(TColStd_HArray1OfInteger) lineFontValues; - Handle(IGESBasic_HArray1OfLineFontEntity) lineFontDefinitions; - Handle(TColStd_HArray1OfInteger) lineWeights; - - // Reading nbval(Integer) - Standard_Boolean st = PR.ReadInteger( PR.Current(), "No. of View/segment blocks", nbval ); - if (st && nbval > 0) { - views = new IGESDraw_HArray1OfViewKindEntity(1, nbval); - breakpointParameters = new TColStd_HArray1OfReal(1, nbval); - displayFlags = new TColStd_HArray1OfInteger(1, nbval); - colorValues = new TColStd_HArray1OfInteger(1, nbval); - colorDefinitions = new IGESGraph_HArray1OfColor(1, nbval); - lineFontValues = new TColStd_HArray1OfInteger(1, nbval); - lineFontDefinitions = new IGESBasic_HArray1OfLineFontEntity(1, nbval); - lineWeights = new TColStd_HArray1OfInteger(1, nbval); - - Handle(IGESData_ViewKindEntity) tempView; - Standard_Real tempBreak; - Standard_Integer tempDisplay; - Standard_Integer tempColorValue; - Handle(IGESGraph_Color) tempColorDef; - Standard_Integer tempLineFontValue; - Handle(IGESData_LineFontEntity) tempLineFontDef; - Standard_Integer tempLine; - - for (Standard_Integer i = 1; i <= nbval; i++) - { - // Reading views(HArray1OfView) - //st = PR.ReadEntity( IR, PR.Current(), "Instance of views", - //STANDARD_TYPE(IGESData_ViewKindEntity), tempView ); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR, PR.Current(), "Instance of views", - STANDARD_TYPE(IGESData_ViewKindEntity), tempView)) - views->SetValue(i, tempView); - - // Reading breakpointParameters(HArray1OfReal) - //st = PR.ReadReal(PR.Current(), "array breakpointParameters", tempBreak ); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "array breakpointParameters", tempBreak )) - breakpointParameters->SetValue(i, tempBreak); - - // Reading displayFlags(HArray1OfInteger) - //st = PR.ReadInteger( PR.Current(), "array displayFlags", tempDisplay ); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger( PR.Current(), "array displayFlags", tempDisplay )) - displayFlags->SetValue(i, tempDisplay); - - Standard_Integer curnum = PR.CurrentNumber(); - - // Reading Color : Value (>0) or Definition (<0 = D.E. Pointer) - PR.ReadInteger( PR.Current(), "array colorValues", tempColorValue); //szv#4:S4163:12Mar99 `st=` not needed - if (tempColorValue < 0) { - colorValues->SetValue(i, -1); - tempColorDef = GetCasted(IGESGraph_Color,PR.ParamEntity(IR,curnum)); - if (tempColorDef.IsNull()) PR.AddFail - ("A Color Definition Entity is incorrect"); - else colorDefinitions->SetValue(i, tempColorDef); - } - else - colorValues->SetValue(i, tempColorValue); - - curnum = PR.CurrentNumber(); - // Reading Line Font : Value (>0) or Definition (<0 = D.E. Pointer) - PR.ReadInteger( PR.Current(), "array lineFontValues", tempLineFontValue ); //szv#4:S4163:12Mar99 `st=` not needed - if (tempLineFontValue < 0 ) { - lineFontValues->SetValue(i, -1); - tempLineFontDef = GetCasted(IGESData_LineFontEntity, - PR.ParamEntity(IR,curnum)); - if (tempLineFontDef.IsNull()) PR.AddFail - ("A Line Font Definition Entity is incorrect"); - lineFontDefinitions->SetValue(i,tempLineFontDef); - } - else - lineFontValues->SetValue(i, tempLineFontValue); - - // Reading lineWeights(HArray1OfInteger) - //st = PR.ReadInteger( PR.Current(), "array lineWeights", tempLine ); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger( PR.Current(), "array lineWeights", tempLine )) - lineWeights->SetValue(i, tempLine); - } - } - else - PR.AddFail("No. of View/segment blocks : Not Positive"); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init - (views, breakpointParameters, displayFlags,colorValues, colorDefinitions, - lineFontValues, lineFontDefinitions, lineWeights); -} - -void IGESDraw_ToolSegmentedViewsVisible::WriteOwnParams - (const Handle(IGESDraw_SegmentedViewsVisible)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer Up = ent->NbSegmentBlocks(); - IW.Send( Up ); - for ( Standard_Integer i = 1; i <= Up; i++) - { - IW.Send( ent->ViewItem(i) ); - IW.Send( ent->BreakpointParameter(i) ); - IW.Send( ent->DisplayFlag(i) ); - - if (ent->IsColorDefinition(i)) - IW.Send( ent->ColorDefinition(i), Standard_True ); // negative - else - IW.Send( ent->ColorValue(i) ); - - if (ent->IsFontDefinition(i)) - IW.Send( ent->LineFontDefinition(i), Standard_True ); // negative - else - IW.Send( ent->LineFontValue(i) ); - - IW.Send( ent->LineWeightItem(i) ); - } -} - -void IGESDraw_ToolSegmentedViewsVisible::OwnShared - (const Handle(IGESDraw_SegmentedViewsVisible)& ent, Interface_EntityIterator& iter) const -{ - Standard_Integer Up = ent->NbSegmentBlocks(); - for ( Standard_Integer i = 1; i <= Up; i++) - { - iter.GetOneItem( ent->ViewItem(i) ); - if (ent->IsColorDefinition(i)) - iter.GetOneItem( ent->ColorDefinition(i) ); - if (!ent->IsFontDefinition(i)) - iter.GetOneItem( ent->LineFontDefinition(i) ); - } -} - -IGESData_DirChecker IGESDraw_ToolSegmentedViewsVisible::DirChecker - (const Handle(IGESDraw_SegmentedViewsVisible)& /*ent*/) const -{ - IGESData_DirChecker DC (402, 19); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.SubordinateStatusRequired(0); - DC.UseFlagRequired(1); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESDraw_ToolSegmentedViewsVisible::OwnDump - (const Handle(IGESDraw_SegmentedViewsVisible)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer sublevel = (level <= 4) ? 0 : 1; - - S << "IGESDraw_SegmentedViewsVisible" << endl; - - S << "View Entities : " << endl - << "Breakpoint parameters : " << endl - << "Display flags : " << endl - << "Color Values : " << endl - << "Color Definitions : " << endl - << "LineFont Values : " << endl - << "LineFont Definitions : " << endl - << "Line Weights : " << endl; - S << "Count Of Blocks = " << ent->NbSegmentBlocks() << endl; - switch (level) - { - case 4 : S << " [ for content, ask level > 4 ]" << endl; - break; // Nothing to be dumped here - case 5 : // Presently level 5 and 6 have the same Dump - case 6 : - { - Standard_Integer I; - Standard_Integer up = ent->NbSegmentBlocks(); - for (I = 1; I <= up; I++) - { - S << "[" << I << "]:" << endl; - S << "View Entity : "; - dumper.Dump (ent->ViewItem(I),S, sublevel); - S << endl; - S << "Breakpoint parameter : " <BreakpointParameter(I)<DisplayFlag(I) << endl; - if ( (ent->ColorDefinition(I)).IsNull() ) - { - S << "Color Value : "; - S << ent->ColorValue(I); - } - else - { - S << "Color Definition : "; - dumper.Dump (ent->ColorDefinition(I),S, sublevel); - } - S << endl; - if ( (ent->LineFontDefinition(I)).IsNull() ) - { - S << "LineFont Value : " << ent->LineFontValue(I); - } - else - { - S << "LineFont Definition : "; - dumper.Dump (ent->LineFontDefinition(I),S, sublevel); - } - S << endl; - S << "Line Weight : " << ent->LineWeightItem(I) << endl; - } - } - break; - } - S << endl; -} diff --git a/src/IGESDraw/IGESDraw_ToolSegmentedViewsVisible.hxx b/src/IGESDraw/IGESDraw_ToolSegmentedViewsVisible.hxx deleted file mode 100644 index 7942978f65..0000000000 --- a/src/IGESDraw/IGESDraw_ToolSegmentedViewsVisible.hxx +++ /dev/null @@ -1,67 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_ToolSegmentedViewsVisible_HeaderFile -#define _IGESDraw_ToolSegmentedViewsVisible_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDraw_SegmentedViewsVisible; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a SegmentedViewsVisible. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDraw_ToolSegmentedViewsVisible -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolSegmentedViewsVisible, ready to work - IGESDraw_ToolSegmentedViewsVisible() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDraw_SegmentedViewsVisible)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDraw_SegmentedViewsVisible)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a SegmentedViewsVisible , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESDraw_SegmentedViewsVisible)& ent, Interface_EntityIterator& iter) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_SegmentedViewsVisible)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDraw_SegmentedViewsVisible)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDraw_ToolSegmentedViewsVisible_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ToolView.cxx b/src/IGESDraw/IGESDraw_ToolView.cxx deleted file mode 100644 index fce2fd67ce..0000000000 --- a/src/IGESDraw/IGESDraw_ToolView.cxx +++ /dev/null @@ -1,150 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESDraw_ToolView::ReadOwnParams - (const Handle(IGESDraw_View)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - Standard_Integer tempViewNumber; - Standard_Real tempScaleFactor; - Handle(IGESGeom_Plane) tempLeftPlane, tempTopPlane, tempRightPlane; - Handle(IGESGeom_Plane) tempBottomPlane, tempBackPlane, tempFrontPlane; - - PR.ReadInteger(PR.Current(), "View Number", tempViewNumber); //szv#4:S4163:12Mar99 `st=` not needed - - if (PR.DefinedElseSkip()) - PR.ReadReal(PR.Current(), "Scale Factor", tempScaleFactor); //szv#4:S4163:12Mar99 `st=` not needed - else - tempScaleFactor = 1.0; // Setting to default value of 1.0 - - PR.ReadEntity(IR, PR.Current(), "Left Side Of View Volume", - STANDARD_TYPE(IGESGeom_Plane), tempLeftPlane, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Top Side Of View Volume", - STANDARD_TYPE(IGESGeom_Plane), tempTopPlane, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Right Side Of View Volume", - STANDARD_TYPE(IGESGeom_Plane), tempRightPlane, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Bottom Side Of View Volume", - STANDARD_TYPE(IGESGeom_Plane), tempBottomPlane, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Back Side Of View Volume", - STANDARD_TYPE(IGESGeom_Plane), tempBackPlane, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Front Side Of View Volume", - STANDARD_TYPE(IGESGeom_Plane), tempFrontPlane, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init - (tempViewNumber, tempScaleFactor, tempLeftPlane, tempTopPlane, - tempRightPlane, tempBottomPlane, tempBackPlane, tempFrontPlane); -} - -void IGESDraw_ToolView::WriteOwnParams - (const Handle(IGESDraw_View)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->ViewNumber()); - IW.Send(ent->ScaleFactor()); - IW.Send(ent->LeftPlane()); - IW.Send(ent->TopPlane()); - IW.Send(ent->RightPlane()); - IW.Send(ent->BottomPlane()); - IW.Send(ent->BackPlane()); - IW.Send(ent->FrontPlane()); -} - -void IGESDraw_ToolView::OwnShared - (const Handle(IGESDraw_View)& ent, Interface_EntityIterator& iter) const -{ - iter.GetOneItem(ent->LeftPlane()); - iter.GetOneItem(ent->TopPlane()); - iter.GetOneItem(ent->RightPlane()); - iter.GetOneItem(ent->BottomPlane()); - iter.GetOneItem(ent->BackPlane()); - iter.GetOneItem(ent->FrontPlane()); -} - -IGESData_DirChecker IGESDraw_ToolView::DirChecker - (const Handle(IGESDraw_View)& /*ent*/) const -{ - IGESData_DirChecker DC(410, 0); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagRequired(1); - DC.HierarchyStatusIgnored(); - - return DC; -} - -void IGESDraw_ToolView::OwnCheck - (const Handle(IGESDraw_View)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if (ent->HasTransf()) { - if (ent->Transf()->FormNumber() != 0) - ach->AddFail("Associated Matrix has not Form Number 0"); - } -} - -void IGESDraw_ToolView::OwnDump - (const Handle(IGESDraw_View)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1; - - S << "IGESDraw_View" << endl; - - S << "View Number : " << ent->ViewNumber() << endl; - S << "Scale Factor : " << ent->ScaleFactor() << endl; - S << "Left Plane Of View Volume : "; - dumper.Dump(ent->LeftPlane(),S, tempSubLevel); S << endl; - S << "Top Plane Of View Volume : "; - dumper.Dump(ent->TopPlane(),S, tempSubLevel); S << endl; - S << "Right Plane Of View Volume : "; - dumper.Dump(ent->RightPlane(),S, tempSubLevel); S << endl; - S << "Bottom Plane Of View Volume : "; - dumper.Dump(ent->BottomPlane(),S, tempSubLevel); S << endl; - S << "Back Plane Of View Volume : "; - dumper.Dump(ent->BackPlane(),S, tempSubLevel); S << endl; - S << "Front Plane Of View Volume : "; - dumper.Dump(ent->FrontPlane(),S, tempSubLevel); S << endl; -} diff --git a/src/IGESDraw/IGESDraw_ToolView.hxx b/src/IGESDraw/IGESDraw_ToolView.hxx deleted file mode 100644 index f5112cc7fe..0000000000 --- a/src/IGESDraw/IGESDraw_ToolView.hxx +++ /dev/null @@ -1,70 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESDraw_ToolView_HeaderFile -#define _IGESDraw_ToolView_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESDraw_View; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a View. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESDraw_ToolView -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolView, ready to work - IGESDraw_ToolView() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESDraw_View)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESDraw_View)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a View , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESDraw_View)& ent, Interface_EntityIterator& iter) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_View)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESDraw_View)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESDraw_View)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESDraw_ToolView_HeaderFile diff --git a/src/IGESDraw/IGESDraw_ToolViewsVisible.cxx b/src/IGESDraw/IGESDraw_ToolViewsVisible.cxx index c88744f93f..592c00711b 100644 --- a/src/IGESDraw/IGESDraw_ToolViewsVisible.cxx +++ b/src/IGESDraw/IGESDraw_ToolViewsVisible.cxx @@ -42,15 +42,11 @@ void IGESDraw_ToolViewsVisible::ReadOwnParams (const Handle(IGESDraw_ViewsVisible)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer tempNbViewsVisible, tempNbDisplayedEntities; Handle(IGESDraw_HArray1OfViewKindEntity) tempViewEntities; Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntity; - //st = PR.ReadInteger(PR.Current(), "Number Of Views Visible", - //tempNbViewsVisible); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Number Of Views Visible", tempNbViewsVisible)) { + if (PR.ReadInteger(tempNbViewsVisible,"Number Of Views Visible")) { // Initialise HArray1 only if there is no error reading its Length if (tempNbViewsVisible <= 0) PR.AddFail("Number Of Views Visible : Not Positive"); @@ -58,8 +54,7 @@ void IGESDraw_ToolViewsVisible::ReadOwnParams } if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Number of Entities Displayed", - tempNbDisplayedEntities); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempNbDisplayedEntities,"Number of Entities Displayed"); else { tempNbDisplayedEntities = 0; PR.AddWarning("Number of Entities Displayed : undefined, set to Zero"); @@ -74,10 +69,7 @@ void IGESDraw_ToolViewsVisible::ReadOwnParams Standard_Integer I; for (I = 1; I <= tempNbViewsVisible; I++) { Handle(IGESData_ViewKindEntity) tempViewEntity1; - //st = PR.ReadEntity(IR, PR.Current(), "View Entity", - //STANDARD_TYPE(IGESData_ViewKindEntity), tempViewEntity1); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR, PR.Current(), "View Entity", - STANDARD_TYPE(IGESData_ViewKindEntity), tempViewEntity1)) + if (PR.ReadEntity(IR, "View Entity", STANDARD_TYPE(IGESData_ViewKindEntity), tempViewEntity1)) tempViewEntities->SetValue(I, tempViewEntity1); } } @@ -86,18 +78,6 @@ void IGESDraw_ToolViewsVisible::ReadOwnParams if (tempNbDisplayedEntities > 0) { PR.ReadEnts (IR,PR.CurrentList(tempNbDisplayedEntities), "Displayed Entities",tempDisplayEntity); //szv#4:S4163:12Mar99 `st=` not needed -/* - tempDisplayEntity = - new IGESData_HArray1OfIGESEntity (1, tempNbDisplayedEntities); - - Handle(IGESData_IGESEntity) tempEntity2; - Standard_Integer I; - for (I = 1; I <= tempNbDisplayedEntities; I++) { - st = PR.ReadEntity(IR, PR.Current(), "Displayed Entity", - tempEntity2); - if (st) tempDisplayEntity->SetValue(I, tempEntity2); - } -*/ } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); @@ -129,15 +109,6 @@ void IGESDraw_ToolViewsVisible::OwnShared // Displayed -> Implied } -void IGESDraw_ToolViewsVisible::OwnImplied - (const Handle(IGESDraw_ViewsVisible)& ent, Interface_EntityIterator& iter) const -{ - Standard_Integer I,up; - up = ent->NbDisplayedEntities(); - for (I = 1; I <= up; I++) - iter.GetOneItem(ent->DisplayedEntity(I)); -} - IGESData_DirChecker IGESDraw_ToolViewsVisible::DirChecker (const Handle(IGESDraw_ViewsVisible)& /*ent*/) const diff --git a/src/IGESDraw/IGESDraw_ToolViewsVisible.hxx b/src/IGESDraw/IGESDraw_ToolViewsVisible.hxx index eb1255bd9a..daffec719f 100644 --- a/src/IGESDraw/IGESDraw_ToolViewsVisible.hxx +++ b/src/IGESDraw/IGESDraw_ToolViewsVisible.hxx @@ -58,10 +58,6 @@ class IGESDraw_ToolViewsVisible //! its specific (own) parameters shared not implied (the Views) Standard_EXPORT void OwnShared (const Handle(IGESDraw_ViewsVisible)& ent, Interface_EntityIterator& iter) const; - //! Lists the Entities shared by a ViewsVisible , from - //! its specific (own) implied parameters : the Displayed Entities - Standard_EXPORT void OwnImplied (const Handle(IGESDraw_ViewsVisible)& ent, Interface_EntityIterator& iter) const; - //! Returns specific DirChecker Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_ViewsVisible)& ent) const; diff --git a/src/IGESDraw/IGESDraw_ToolViewsVisibleWithAttr.cxx b/src/IGESDraw/IGESDraw_ToolViewsVisibleWithAttr.cxx index f63e6d8931..8c51e3b939 100644 --- a/src/IGESDraw/IGESDraw_ToolViewsVisibleWithAttr.cxx +++ b/src/IGESDraw/IGESDraw_ToolViewsVisibleWithAttr.cxx @@ -58,8 +58,7 @@ void IGESDraw_ToolViewsVisibleWithAttr::ReadOwnParams Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntities; Handle(IGESBasic_HArray1OfLineFontEntity) tempLineDefinitions; - //st = PR.ReadInteger(PR.Current(), "Number Of Blocks", tempNbBlocks); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Number Of Blocks", tempNbBlocks)) { + if (PR.ReadInteger(tempNbBlocks,"Number Of Blocks")) { // Initialise HArray1 only if there is no error reading its Length if (tempNbBlocks <= 0) PR.AddFail("Number Of Blocks : Not Positive"); @@ -74,8 +73,7 @@ void IGESDraw_ToolViewsVisibleWithAttr::ReadOwnParams } if (PR.DefinedElseSkip()) - PR.ReadInteger(PR.Current(), "Number of Entities Displayed", - tempNbEntity); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempNbEntity,"Number of Entities Displayed"); else { tempNbEntity = 0; PR.AddWarning("Number of Entities Displayed : undefined, set to Zero"); @@ -97,21 +95,14 @@ void IGESDraw_ToolViewsVisibleWithAttr::ReadOwnParams Handle(IGESGraph_Color) tempColorDef; Standard_Integer tempLineWeightValue; - //st = PR.ReadEntity(IR, PR.Current(), "View Entity", - //STANDARD_TYPE(IGESData_ViewKindEntity), tempView); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR, PR.Current(), "View Entity", - STANDARD_TYPE(IGESData_ViewKindEntity), tempView)) + if (PR.ReadEntity(IR, "View Entity", STANDARD_TYPE(IGESData_ViewKindEntity), tempView)) tempViewEntities->SetValue(I, tempView); - //st = PR.ReadInteger(PR.Current(), "Line Font Value", tempLineFont); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Line Font Value", tempLineFont)) + if (PR.ReadInteger(tempLineFont,"Line Font Value")) tempLineFonts->SetValue(I, tempLineFont); - //st = PR.ReadEntity(IR, PR.Current(), "Line Font Definition", - //STANDARD_TYPE(IGESData_LineFontEntity), - //tempEntity1, Standard_True); //szv#4:S4163:12Mar99 moved in if if (tempLineFont == 0 && - PR.ReadEntity(IR, PR.Current(), "Line Font Definition", + PR.ReadEntity(IR, "Line Font Definition", STANDARD_TYPE(IGESData_LineFontEntity), tempEntity1, Standard_True)) tempLineDefinitions->SetValue(I, tempEntity1); @@ -119,7 +110,7 @@ void IGESDraw_ToolViewsVisibleWithAttr::ReadOwnParams Standard_Integer curnum = PR.CurrentNumber(); // Reading Color : Value (>0) or Definition (<0 = D.E. Pointer) if (PR.DefinedElseSkip()) - PR.ReadInteger( PR.Current(), "Color Value", tempColorValue); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(tempColorValue,"Color Value"); else { tempColorValue = 0; PR.AddWarning ("Color Value : undefined, set to Zero"); @@ -134,9 +125,7 @@ void IGESDraw_ToolViewsVisibleWithAttr::ReadOwnParams else tempColorValues->SetValue(I, tempColorValue); - //st = PR.ReadInteger(PR.Current(), "Line Weight Value", - //tempLineWeightValue); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Line Weight Value", tempLineWeightValue)) + if (PR.ReadInteger(tempLineWeightValue,"Line Weight Value")) tempLineWeights->SetValue(I, tempLineWeightValue); } } @@ -145,15 +134,6 @@ void IGESDraw_ToolViewsVisibleWithAttr::ReadOwnParams if (tempNbEntity > 0) { PR.ReadEnts (IR,PR.CurrentList(tempNbEntity), "Displayed Entities",tempDisplayEntities); //szv#4:S4163:12Mar99 `st=` not needed -/* - tempDisplayEntities = new IGESData_HArray1OfIGESEntity (1, tempNbEntity); - Standard_Integer I; - for (I = 1; I <= tempNbEntity; I++) { - Handle(IGESData_IGESEntity) tempEntity3; - st = PR.ReadEntity(IR, PR.Current(), "Entity", tempEntity3); - if (st) tempDisplayEntities->SetValue(I, tempEntity3); - } -*/ } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); @@ -201,15 +181,6 @@ void IGESDraw_ToolViewsVisibleWithAttr::OwnShared // Displayed -> Implied } -void IGESDraw_ToolViewsVisibleWithAttr::OwnImplied - (const Handle(IGESDraw_ViewsVisibleWithAttr)& ent, Interface_EntityIterator& iter) const -{ - Standard_Integer I,up; - up = ent->NbDisplayedEntities(); - for (I = 1; I <= up; I++) - iter.GetOneItem(ent->DisplayedEntity(I)); -} - IGESData_DirChecker IGESDraw_ToolViewsVisibleWithAttr::DirChecker (const Handle(IGESDraw_ViewsVisibleWithAttr)& /*ent*/) const diff --git a/src/IGESDraw/IGESDraw_ToolViewsVisibleWithAttr.hxx b/src/IGESDraw/IGESDraw_ToolViewsVisibleWithAttr.hxx index 07a2caf1fc..86e7750070 100644 --- a/src/IGESDraw/IGESDraw_ToolViewsVisibleWithAttr.hxx +++ b/src/IGESDraw/IGESDraw_ToolViewsVisibleWithAttr.hxx @@ -59,10 +59,6 @@ class IGESDraw_ToolViewsVisibleWithAttr //! the Displayed Entities Standard_EXPORT void OwnShared (const Handle(IGESDraw_ViewsVisibleWithAttr)& ent, Interface_EntityIterator& iter) const; - //! Lists the Entities shared by a ViewsVisible , from - //! its specific (own) implied parameters : the Displayed Entities - Standard_EXPORT void OwnImplied (const Handle(IGESDraw_ViewsVisibleWithAttr)& ent, Interface_EntityIterator& iter) const; - //! Returns specific DirChecker Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDraw_ViewsVisibleWithAttr)& ent) const; diff --git a/src/IGESDraw/IGESDraw_View.cxx b/src/IGESDraw/IGESDraw_View.cxx index 98cd91d852..2a3d384888 100644 --- a/src/IGESDraw/IGESDraw_View.cxx +++ b/src/IGESDraw/IGESDraw_View.cxx @@ -19,132 +19,106 @@ #include #include #include -#include #include #include -#include -#include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_View,IGESData_ViewKindEntity) -IGESDraw_View::IGESDraw_View () { } - - -// This class inherits from IGESData_ViewKindEntity - - void IGESDraw_View::Init - (const Standard_Integer aViewNum, - const Standard_Real aScale, - const Handle(IGESGeom_Plane)& aLeftPlane, - const Handle(IGESGeom_Plane)& aTopPlane, - const Handle(IGESGeom_Plane)& aRightPlane, - const Handle(IGESGeom_Plane)& aBottomPlane, - const Handle(IGESGeom_Plane)& aBackPlane, - const Handle(IGESGeom_Plane)& aFrontPlane) -{ - theViewNumber = aViewNum; - theScaleFactor = aScale; - theLeftPlane = aLeftPlane; - theTopPlane = aTopPlane; - theRightPlane = aRightPlane; - theBottomPlane = aBottomPlane; - theBackPlane = aBackPlane; - theFrontPlane = aFrontPlane; - InitTypeAndForm(410,0); -} - - Standard_Boolean IGESDraw_View::IsSingle () const +Standard_Boolean IGESDraw_View::IsSingle () const { return Standard_True; - // Redefined to return TRUE } - Standard_Integer IGESDraw_View::NbViews () const -{ return 1; } - - Handle(IGESData_ViewKindEntity) IGESDraw_View::ViewItem - (const Standard_Integer) const -{ return Handle(IGESData_ViewKindEntity)::DownCast (This()); } - - - Standard_Integer IGESDraw_View::ViewNumber () const +Standard_Integer IGESDraw_View::NbViews () const { - return theViewNumber; + return 1; } - Standard_Real IGESDraw_View::ScaleFactor () const +Handle(IGESData_ViewKindEntity) IGESDraw_View::ViewItem (const Standard_Integer) const { - return theScaleFactor; + return Handle(IGESData_ViewKindEntity)(this); } - Standard_Boolean IGESDraw_View::HasLeftPlane () const +gp_XYZ IGESDraw_View::ModelToView (const gp_XYZ& coords) const { - return (! theLeftPlane.IsNull()); -} - - Handle(IGESGeom_Plane) IGESDraw_View::LeftPlane () const -{ - return theLeftPlane; -} - - Standard_Boolean IGESDraw_View::HasTopPlane () const -{ - return (! theTopPlane.IsNull()); -} - - Handle(IGESGeom_Plane) IGESDraw_View::TopPlane () const -{ - return theTopPlane; -} - - Standard_Boolean IGESDraw_View::HasRightPlane () const -{ - return (! theRightPlane.IsNull()); -} - - Handle(IGESGeom_Plane) IGESDraw_View::RightPlane () const -{ - return theRightPlane; -} - - Standard_Boolean IGESDraw_View::HasBottomPlane () const -{ - return (! theBottomPlane.IsNull()); + gp_XYZ tempCoords = coords; + Location().Transforms(tempCoords); + return (tempCoords); } - Handle(IGESGeom_Plane) IGESDraw_View::BottomPlane () const +void IGESDraw_View::OwnRead (IGESFile_Reader &PR) { - return theBottomPlane; -} + PR.ReadInteger(theViewNumber,"View Number"); - Standard_Boolean IGESDraw_View::HasBackPlane () const -{ - return (! theBackPlane.IsNull()); -} + theScaleFactor = 1.0; // Setting to default value of 1.0 + PR.ReadReal(theScaleFactor,"Scale Factor"); - Handle(IGESGeom_Plane) IGESDraw_View::BackPlane () const -{ - return theBackPlane; + PR.ReadPointer(theLeftPlane,"Left Side Of View Volume",Standard_True); + PR.ReadPointer(theTopPlane,"Top Side Of View Volume",Standard_True); + PR.ReadPointer(theRightPlane,"Right Side Of View Volume",Standard_True); + PR.ReadPointer(theBottomPlane,"Bottom Side Of View Volume",Standard_True); + PR.ReadPointer(theBackPlane,"Back Side Of View Volume",Standard_True); + PR.ReadPointer(theFrontPlane,"Front Side Of View Volume",Standard_True); } - Standard_Boolean IGESDraw_View::HasFrontPlane () const +void IGESDraw_View::OwnWrite (IGESData_IGESWriter &IW) const { - return (! theFrontPlane.IsNull()); + IW.Send(theViewNumber); + IW.Send(theScaleFactor); + IW.Send(theLeftPlane); + IW.Send(theTopPlane); + IW.Send(theRightPlane); + IW.Send(theBottomPlane); + IW.Send(theBackPlane); + IW.Send(theFrontPlane); } - Handle(IGESGeom_Plane) IGESDraw_View::FrontPlane () const +void IGESDraw_View::OwnShared (Interface_EntityIterator &iter) const { - return theFrontPlane; + iter.GetOneItem(theLeftPlane); + iter.GetOneItem(theTopPlane); + iter.GetOneItem(theRightPlane); + iter.GetOneItem(theBottomPlane); + iter.GetOneItem(theBackPlane); + iter.GetOneItem(theFrontPlane); } - Handle(IGESData_TransfEntity) IGESDraw_View::ViewMatrix () const +IGESData_DirChecker IGESDraw_View::DirChecker () const { - return (Transf()); + IGESData_DirChecker DC(410, 0); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagRequired(1); + DC.HierarchyStatusIgnored(); + return DC; } - gp_XYZ IGESDraw_View::ModelToView (const gp_XYZ& coords) const +void IGESDraw_View::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const { - gp_XYZ tempCoords = coords; - Location().Transforms(tempCoords); - return (tempCoords); + const Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1; + S << "IGESDraw_View" << endl; + S << "View Number : " << theViewNumber << endl; + S << "Scale Factor : " << theScaleFactor << endl; + S << "Left Plane Of View Volume : "; + dumper.Dump(theLeftPlane,S,tempSubLevel); S << endl; + S << "Top Plane Of View Volume : "; + dumper.Dump(theTopPlane,S,tempSubLevel); S << endl; + S << "Right Plane Of View Volume : "; + dumper.Dump(theRightPlane,S,tempSubLevel); S << endl; + S << "Bottom Plane Of View Volume : "; + dumper.Dump(theBottomPlane,S,tempSubLevel); S << endl; + S << "Back Plane Of View Volume : "; + dumper.Dump(theBackPlane,S,tempSubLevel); S << endl; + S << "Front Plane Of View Volume : "; + dumper.Dump(theFrontPlane,S,tempSubLevel); S << endl; } diff --git a/src/IGESDraw/IGESDraw_View.hxx b/src/IGESDraw/IGESDraw_View.hxx index 615221d3dc..3e04ff1817 100644 --- a/src/IGESDraw/IGESDraw_View.hxx +++ b/src/IGESDraw/IGESDraw_View.hxx @@ -17,23 +17,13 @@ #ifndef _IGESDraw_View_HeaderFile #define _IGESDraw_View_HeaderFile -#include -#include - -#include -#include #include -#include class IGESGeom_Plane; -class Standard_OutOfRange; class IGESData_ViewKindEntity; class IGESData_TransfEntity; class gp_XYZ; -class IGESDraw_View; -DEFINE_STANDARD_HANDLE(IGESDraw_View, IGESData_ViewKindEntity) - //! defines IGES View Entity, Type <410> Form <0> //! in package IGESDraw //! @@ -44,110 +34,94 @@ DEFINE_STANDARD_HANDLE(IGESDraw_View, IGESData_ViewKindEntity) //! view volume. class IGESDraw_View : public IGESData_ViewKindEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 410; } - - Standard_EXPORT IGESDraw_View(); - - //! This method is used to set fields of the class View - //! - aViewNum : View number - //! - aScale : Scale factor - //! - aLeftPlane : Left plane of view volume - //! - aTopPlane : Top plane of view volume - //! - aRightPlane : Right plane of view volume - //! - aBottomPlane : Bottom plane of view volume - //! - aBackPlane : Back plane of view volume - //! - aFrontPlane : Front plane of view volume - Standard_EXPORT void Init (const Standard_Integer aViewNum, const Standard_Real aScale, const Handle(IGESGeom_Plane)& aLeftPlane, const Handle(IGESGeom_Plane)& aTopPlane, const Handle(IGESGeom_Plane)& aRightPlane, const Handle(IGESGeom_Plane)& aBottomPlane, const Handle(IGESGeom_Plane)& aBackPlane, const Handle(IGESGeom_Plane)& aFrontPlane); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 0; } + + IGESDraw_View() {} //! Returns True (for a single view) - Standard_EXPORT Standard_Boolean IsSingle() const Standard_OVERRIDE; + Standard_EXPORT virtual Standard_Boolean IsSingle() const Standard_OVERRIDE; //! Returns 1 (single view) - Standard_EXPORT Standard_Integer NbViews() const Standard_OVERRIDE; + Standard_EXPORT virtual Standard_Integer NbViews() const Standard_OVERRIDE; //! For a single view, returns whatever - Standard_EXPORT Handle(IGESData_ViewKindEntity) ViewItem (const Standard_Integer num) const Standard_OVERRIDE; + Standard_EXPORT virtual Handle(IGESData_ViewKindEntity) ViewItem (const Standard_Integer num) const Standard_OVERRIDE; //! returns integer number identifying view orientation - Standard_EXPORT Standard_Integer ViewNumber() const; - + Standard_Integer ViewNumber() const { return theViewNumber; } + //! returns the scale factor(Default = 1.0) - Standard_EXPORT Standard_Real ScaleFactor() const; - + Standard_Real ScaleFactor() const { return theScaleFactor; } + //! returns False if left side of view volume is not present - Standard_EXPORT Standard_Boolean HasLeftPlane() const; - + Standard_Boolean HasLeftPlane() const { return (! theLeftPlane.IsNull()); } + //! returns the left side of view volume, or null handle - Standard_EXPORT Handle(IGESGeom_Plane) LeftPlane() const; - + const Handle(IGESGeom_Plane) & LeftPlane() const { return theLeftPlane; } + //! returns False if top of view volume is not present - Standard_EXPORT Standard_Boolean HasTopPlane() const; - + Standard_Boolean HasTopPlane() const { return (! theTopPlane.IsNull()); } + //! returns the top of view volume, or null handle - Standard_EXPORT Handle(IGESGeom_Plane) TopPlane() const; - + const Handle(IGESGeom_Plane) & TopPlane() const { return theTopPlane; } + //! returns False if right side of view volume is not present - Standard_EXPORT Standard_Boolean HasRightPlane() const; - + Standard_Boolean HasRightPlane() const { return (! theRightPlane.IsNull()); } + //! returns the right side of view volume, or null handle - Standard_EXPORT Handle(IGESGeom_Plane) RightPlane() const; - + const Handle(IGESGeom_Plane) & RightPlane() const { return theRightPlane; } + //! returns False if bottom of view volume is not present - Standard_EXPORT Standard_Boolean HasBottomPlane() const; - + Standard_Boolean HasBottomPlane() const { return (! theBottomPlane.IsNull()); } + //! returns the bottom of view volume, or null handle - Standard_EXPORT Handle(IGESGeom_Plane) BottomPlane() const; - + const Handle(IGESGeom_Plane) & BottomPlane() const { return theBottomPlane; } + //! returns False if back of view volume is not present - Standard_EXPORT Standard_Boolean HasBackPlane() const; - + Standard_Boolean HasBackPlane() const { return (! theBackPlane.IsNull()); } + //! returns the back of view volume, or null handle - Standard_EXPORT Handle(IGESGeom_Plane) BackPlane() const; - + const Handle(IGESGeom_Plane) & BackPlane() const { return theBackPlane; } + //! returns False if front of view volume is not present - Standard_EXPORT Standard_Boolean HasFrontPlane() const; - + Standard_Boolean HasFrontPlane() const { return (! theFrontPlane.IsNull()); } + //! returns the front of view volume, or null handle - Standard_EXPORT Handle(IGESGeom_Plane) FrontPlane() const; - + const Handle(IGESGeom_Plane) & FrontPlane() const { return theFrontPlane; } + //! returns the Transformation Matrix - Standard_EXPORT Handle(IGESData_TransfEntity) ViewMatrix() const; + Handle(IGESData_TransfEntity) ViewMatrix() const { return (Transf()); } //! returns XYZ from the Model space to the View space by //! applying the View Matrix Standard_EXPORT gp_XYZ ModelToView (const gp_XYZ& coords) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESDraw_View,IGESData_ViewKindEntity) - -protected: - - - + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; -private: + DEFINE_STANDARD_RTTIEXT(IGESDraw_View,IGESData_ViewKindEntity) + private: Standard_Integer theViewNumber; Standard_Real theScaleFactor; - Handle(IGESGeom_Plane) theLeftPlane; - Handle(IGESGeom_Plane) theTopPlane; - Handle(IGESGeom_Plane) theRightPlane; - Handle(IGESGeom_Plane) theBottomPlane; - Handle(IGESGeom_Plane) theBackPlane; - Handle(IGESGeom_Plane) theFrontPlane; - - + Interface_Pointer theLeftPlane; + Interface_Pointer theTopPlane; + Interface_Pointer theRightPlane; + Interface_Pointer theBottomPlane; + Interface_Pointer theBackPlane; + Interface_Pointer theFrontPlane; }; - - - - - - #endif // _IGESDraw_View_HeaderFile diff --git a/src/IGESFile/FILES b/src/IGESFile/FILES index 4821b8c570..985fd0f23e 100755 --- a/src/IGESFile/FILES +++ b/src/IGESFile/FILES @@ -1,6 +1,6 @@ +IGESFile_Reader.cxx +IGESFile_Reader.hxx analiges.c -IGESFile_Read.cxx -IGESFile_Read.hxx igesread.c igesread.h liriges.c diff --git a/src/IGESFile/IGESFile_Buffer.cxx b/src/IGESFile/IGESFile_Buffer.cxx new file mode 100644 index 0000000000..c38870b3ea --- /dev/null +++ b/src/IGESFile/IGESFile_Buffer.cxx @@ -0,0 +1,76 @@ +// Created: 2016-12-19 +// Created by: Sergey ZERCHANINOV +// Copyright (c) 2016 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#include + +#include +#include + + +IMPLEMENT_STANDARD_RTTIEXT(IGESFile_Buffer,NCollection_Buffer) + +// The size of a memory block +static const Standard_Size gBufferBlockSize = 512; +// The default allocator for memory blocks +static const Handle(NCollection_BaseAllocator) gBufferBlockAllocator(new NCollection_AlignedAllocator(16)); + +//======================================================================= +//function : Read +//purpose : +//======================================================================= + +IGESFile_Buffer::IGESFile_Buffer() +: NCollection_Buffer(gBufferBlockAllocator,gBufferBlockSize), + myLength(0) +{} + + +//======================================================================= +//function : ReadLine +//purpose : +//======================================================================= + +const Standard_Byte* IGESFile_Buffer::AddLine(const Standard_Character *theBuffer, const Standard_Size theLength) +{ + // Enlarge the buffer + const Standard_Size aNewLength = myLength+theLength; + while (mySize < aNewLength) + if (!Enlarge()) + return NULL; + // Read data from the stream + Standard_Byte* aStart = &myData[myLength]; + memcpy(aStart,theBuffer,theLength); + myLength = aNewLength-1; + return aStart; +} + + +//======================================================================= +//function : Enlarge +//purpose : +//======================================================================= + +bool IGESFile_Buffer::Enlarge() +{ + const Standard_Size aNewSize = mySize+gBufferBlockSize; + Standard_Byte *aData = (Standard_Byte*)myAllocator->Allocate(aNewSize); + if (aData == NULL) + return false; + memcpy (aData, myData, mySize); + Free(); + mySize = aNewSize; + myData = aData; + return true; +} diff --git a/src/IGESFile/IGESFile_Buffer.hxx b/src/IGESFile/IGESFile_Buffer.hxx new file mode 100644 index 0000000000..935c7f5c87 --- /dev/null +++ b/src/IGESFile/IGESFile_Buffer.hxx @@ -0,0 +1,59 @@ +// Created: 2016-12-19 +// Created by: Sergey ZERCHANINOV +// Copyright (c) 2016 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _Handle_IGESFile_Buffer_HeaderFile +#define _Handle_IGESFile_Buffer_HeaderFile + +#include + +class IGESFile_Buffer; +DEFINE_STANDARD_HANDLE(IGESFile_Buffer,NCollection_Buffer) + +#endif + +#ifndef _IGESFile_Buffer_HeaderFile +#define _IGESFile_Buffer_HeaderFile + +#include +#include +#include + +//! Data buffer for ACIS reading +class IGESFile_Buffer : public NCollection_Buffer +{ + public: + + //! Default constructor + Standard_EXPORT IGESFile_Buffer(); + + //! Reads a string + Standard_EXPORT const Standard_Byte* AddLine(const Standard_Character *theBuffer, const Standard_Size theLength); + + //! Clears the buffer + void Clear() { myLength = 0; } + + //! Returns the current length of data + Standard_Size Length() const { return myLength; } + + DEFINE_STANDARD_RTTIEXT(IGESFile_Buffer,NCollection_Buffer) + + protected: + + Standard_EXPORT bool Enlarge(); + + Standard_Size myLength; //! Current length of data +}; + +#endif diff --git a/src/IGESFile/IGESFile_Read.cxx b/src/IGESFile/IGESFile_Read.cxx deleted file mode 100644 index 750354e483..0000000000 --- a/src/IGESFile/IGESFile_Read.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -// dce 21.01.99 : move of general message to IGESToBRep_Reader - -#include -// declarations des programmes C de base : -#include -#include -#include -#include -#include - -#include -#include -// Pour traiter les exceptions : -#include -#include - -// definition de base, a inclure pour utiliser -#include - -#include "igesread.h" - -//#define VERIFPRINT - -// MGE 16/06/98 -// To use Msg class -#include - -// decoupage interne pour faciliter les recuperations d erreurs -static Standard_Integer recupne,recupnp; // pour affichage en cas de pepin -static Handle(Interface_Check)& checkread() -{ - static Handle(Interface_Check) chrd = new Interface_Check; - return chrd; -} - -static void IGESFile_ReadHeader (const Handle(IGESData_IGESReaderData)& IR); -static void IGESFile_ReadContent (const Handle(IGESData_IGESReaderData)& IR); -void IGESFile_Check (int mode,Message_Msg& amsg); - -// Correspondance entre types igesread et types Interface_ParamFile ... -static Interface_ParamType LesTypes[10]; - -Standard_Integer IGESFile_Read - (char* nomfic, - const Handle(IGESData_IGESModel)& amodel, - const Handle(IGESData_Protocol)& protocol, - const Standard_Boolean modefnes) -{ - //==================================== - Message_Msg Msg1 = Message_Msg("XSTEP_1"); - Message_Msg Msg15 = Message_Msg("XSTEP_15"); - //==================================== - - char* ficnom = nomfic; // ficnom ? - int lesect[6]; - - // Sending of message : Beginning of the reading - IGESFile_Check(2, Msg1); - - checkread()->Clear(); - int result = igesread(ficnom,lesect,modefnes); - - if (result != 0) return result; - -// Chargement des resultats dans un IGESReader - - LesTypes[ArgVide] = Interface_ParamVoid; - LesTypes[ArgQuid] = Interface_ParamMisc; - LesTypes[ArgChar] = Interface_ParamText; - LesTypes[ArgInt] = Interface_ParamInteger; - LesTypes[ArgSign] = Interface_ParamInteger; - LesTypes[ArgReal] = Interface_ParamReal; - LesTypes[ArgExp ] = Interface_ParamMisc; // exposant pas termine - LesTypes[ArgRexp] = Interface_ParamReal; // exposant complet - LesTypes[ArgMexp] = Interface_ParamEnum; // exposant mais pas de point - - - int nbparts, nbparams; - iges_stats(&nbparts,&nbparams); // et fait les Initialisations necessaires - Handle(IGESData_IGESReaderData) IR = -// new IGESData_IGESReaderData (nbparts, nbparams); - new IGESData_IGESReaderData((lesect[3]+1)/2, nbparams); - { - { - try { - OCC_CATCH_SIGNALS - IGESFile_ReadHeader(IR); - } // fin essai 1 (global) - catch (Standard_Failure) { - // Sending of message : Internal error during the header reading - Message_Msg Msg11 = Message_Msg("XSTEP_11"); - IGESFile_Check (1,Msg11); - } - } - - { - try { - OCC_CATCH_SIGNALS - if (nbparts > 0) IGESFile_ReadContent(IR); - - // Sending of message : Loaded data - } // fin essai 2 (entites) - catch (Standard_Failure) { - // Sending of message : Internal error during the content reading - if (recupnp == 0) { - Message_Msg Msg13 = Message_Msg("XSTEP_13"); - Msg13.Arg(recupne); - IGESFile_Check(1,Msg13); - } - else { - Message_Msg Msg14 = Message_Msg("XSTEP_14"); - Msg14.Arg(recupne); - Msg14.Arg(recupnp); - IGESFile_Check(1, Msg14); - } - } - } - } - - Standard_Integer nbr = IR->NbRecords(); - // Sending of message : Number of total loaded entities - Msg15.Arg(nbr); - IGESFile_Check(2, Msg15); - iges_finfile(1); - IGESData_IGESReaderTool IT (IR,protocol); - IT.Prepare(); - - // Sending of message : Loading of Model : Beginning - IT.LoadModel(amodel); - if (amodel->Protocol().IsNull()) amodel->SetProtocol (protocol); - iges_finfile(2); - - // A present, le check - // Nb warning in global section. - Standard_Integer nbWarn = checkread()->NbWarnings(), nbFail = checkread()->NbFails(); - const Handle(Interface_Check)& oldglob = amodel->GlobalCheck(); - if (nbWarn + nbFail > 0) { - checkread()->GetMessages (oldglob); - amodel->SetGlobalCheck (checkread()); - } - - checkread()->Trace(0,1); - - return 0; -} - - -// Decoupage interne - - void IGESFile_ReadHeader (const Handle(IGESData_IGESReaderData)& IR) -{ - Standard_Integer l=0; //szv#4:S4163:12Mar99 i,j,k not needed - char* parval; - int typarg; - // d abord les start lines (commentaires) - //szv#4:S4163:12Mar99 optimized -/* - while ( (j = iges_lirparam(&typarg,&parval)) != 0) { - k = -1; - for (Standard_Integer j = 72; j >= 0; j --) { - if (parval[j] > 32) { k = j; break; } - } - parval[k+1] = '\0'; - if (k >= 0 || l > 0) IR->AddStartLine (parval); - l ++; - } - // puis la Global Section - iges_setglobal(); - while ( (i = iges_lirparam(&typarg,&parval)) != 0) { - IR->AddGlobal(LesTypes[typarg],parval); - } -*/ - while (iges_lirparam(&typarg,&parval) != 0) { - Standard_Integer j; // svv Jan11 2000 : porting on DEC - for (j = 72; j >= 0; j--) - if (parval[j] > 32) break; - parval[j+1] = '\0'; - if (j >= 0 || l > 0) IR->AddStartLine (parval); - l++; - } - // puis la Global Section - iges_setglobal(); - while (iges_lirparam(&typarg,&parval) != 0) IR->AddGlobal(LesTypes[typarg],parval); - IR->SetGlobalSection(); -} - - void IGESFile_ReadContent (const Handle(IGESData_IGESReaderData)& IR) -{ - char *res1, *res2, *nom, *num; char* parval; - int *v; int typarg; - int nbparam; - - - Standard_Integer nn=0; - int ns; //szv#4:S4163:12Mar99 i unused - while ( (ns = iges_lirpart(&v,&res1,&res2,&nom,&num,&nbparam)) != 0) { - nn++; - recupnp = 0; - recupne = (ns+1)/2; // numero entite -// if(recupne > IR->NbEntities()) { -// iges_nextpart(); -// continue; -// } - IR->SetDirPart(recupne, - v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10], - v[11],v[12],v[13],v[14],v[15],v[16],res1,res2,nom,num); - while (iges_lirparam(&typarg,&parval) != 0) { //szv#4:S4163:12Mar99 `i=` not needed - recupnp ++; - if (typarg == ArgInt || typarg == ArgSign) { - Standard_Integer nument = atoi(parval); - if (nument < 0) nument = -nument; - if (nument & 1) nument = (nument+1)/2; - else nument = 0; - IR->AddParam(recupne,parval,LesTypes[typarg],nument); - } - else IR->AddParam(recupne,parval,LesTypes[typarg]); - } - IR->InitParams(recupne); - iges_nextpart(); - } -} - - -void IGESFile_Check (int mode,Message_Msg& amsg) -{ - // MGE 20/07/98 - switch (mode) - { - case 0 : checkread()->SendFail (amsg); break; - case 1 : checkread()->SendWarning (amsg); break; - case 2 : checkread()->SendMsg (amsg);break; - default : checkread()->SendMsg (amsg); - } - //checkread().Trace(3,-1); -} - -void IGESFile_Check2 (int mode,char * code, int num, char * str) -{ - // MGE 20/07/98 - Message_Msg amsg (code); - amsg.Arg(num); - amsg.Arg(str); - - switch (mode) - { - case 0 : checkread()->SendFail (amsg); break; - case 1 : checkread()->SendWarning (amsg); break; - case 2 : checkread()->SendMsg (amsg); break; - default : checkread()->SendMsg (amsg); - } - //checkread().Trace(3,-1); -} - - -void IGESFile_Check3 (int mode,char * code) -{ - // MGE 20/07/98 - Message_Msg amsg (code); - switch (mode) - { - case 0 : checkread()->SendFail (amsg); break; - case 1 : checkread()->SendWarning (amsg); break; - case 2 : checkread()->SendMsg (amsg); break; - default : checkread()->SendMsg (amsg); - } - //checkread().Trace(3,-1); -} diff --git a/src/IGESFile/IGESFile_Read.hxx b/src/IGESFile/IGESFile_Read.hxx deleted file mode 100644 index b5478e7540..0000000000 --- a/src/IGESFile/IGESFile_Read.hxx +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -// Include a utiliser pour appeler IGESFile_Read - - -#ifndef IGESFile_Read_HeaderFile -#define IGESFile_Read_HeaderFile - -#include -#include - -Standard_EXPORT Standard_Integer IGESFile_Read - (char* nomfic, - const Handle(IGESData_IGESModel)& amodel, - const Handle(IGESData_Protocol)& protocol, - const Standard_Boolean modefnes = Standard_False); - -#endif diff --git a/src/IGESFile/IGESFile_Reader.cxx b/src/IGESFile/IGESFile_Reader.cxx new file mode 100644 index 0000000000..050fdf5344 --- /dev/null +++ b/src/IGESFile/IGESFile_Reader.cxx @@ -0,0 +1,820 @@ +// Copyright (c) 2016 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +//======================================================================= +//function : Constructor +//purpose : +//======================================================================= + +IGESFile_Reader::IGESFile_Reader (const Handle(IGESData_Protocol)& theProtocol) +: myProtocol(theProtocol), + myFile(NULL), + myCurrentLine(0), + mySectionCode(0) +{ + for (int i = 0; i < sizeof(mySectionLine); i++) mySectionLine[i] = 0; +} + +//======================================================================= +//function : Read +//purpose : +//======================================================================= + +Standard_Integer IGESFile_Reader::Read (const Standard_CString theFileName) +{ + Standard_Size i, aLength; + + myCurrentLine = 0; + mySectionCode = 0; + for (i = 0; i < sizeof(mySectionLine); i++) mySectionLine[i] = 0; + + myModel = new IGESData_IGESModel; + + if (myModel->Protocol().IsNull()) myModel->SetProtocol(myProtocol); + + myCheck = new Interface_Check; + + myFile = stdin; + if (theFileName[0] != '\0') + myFile = OSD_OpenFile(theFileName,"r"); + if (myFile == NULL) return -1; // File could not be opened + + Standard_Character aBuffer[100]; + for (i = 0; i < sizeof(aBuffer); i++) aBuffer[i] = 0; + + Standard_Integer aStatus, aDirLine = 0; + while ((aStatus = ReadLine(aBuffer,aLength)) > 0) + { + // Process a line + switch (mySectionCode) + { + case 1: // Start Section + { + // Skip ending spaces + Standard_Integer j = 71; + for (; j >= 0; j--) + if (aBuffer[j] > 32) break; + aBuffer[j+1] = '\0'; + // Add a start section line + if (j >= 0 || myModel->StartSection()->Length() > 0) + myModel->StartSection()->Append(new TCollection_HAsciiString(aBuffer)); + break; + } + case 2: // Header (Global Section) + { + myBuffer->AddLine(aBuffer,aLength); + break; + } + case 3: // Directory + { + switch (aDirLine) + { + case 0: + { + ParseHeader(); + // Then proceed to adding the first directory line + } + case 1: + { + myBuffer->AddLine(aBuffer,aLength); + aDirLine = 2; + break; + } + case 2: + { + myBuffer->AddLine(aBuffer,aLength); + ParseDirectory(); + aDirLine = 1; + break; + } + default: break; + } + break; + } + case 4: // Parameters + { + // TODO!!!! + break; + } + } + } + + // Sending of message : No Terminal Section + if (mySectionLine[5] == 0) + { + Message_Msg amsg("XSTEP_20"); + myCheck->SendWarning(amsg); + } + + fclose (myFile); + + /* + LoadModel(amodel); + + if (amodel->Protocol().IsNull()) amodel->SetProtocol (myProtocol); + + // A present, le check + // Nb warning in global section. + Standard_Integer nbWarn = checkread()->NbWarnings(), nbFail = checkread()->NbFails(); + if (nbWarn + nbFail > 0) { + const Handle(Interface_Check)& oldglob = amodel->GlobalCheck(); + checkread()->GetMessages (oldglob); + amodel->SetGlobalCheck (checkread()); + } + + checkread()->Trace(0,1); + + iges_finfile(2);*/ + + return 0; +} + +//======================================================================= +//function : LoadModel +//purpose : +//======================================================================= + +void IGESFile_Reader::LoadModel () +{ + /* + //s1:thelist = thereader->Params(0); + + Standard_Integer numr; + Standard_Integer thenbreps = 0, thenbrep0 = 0; + Handle(TColStd_HArray1OfTransient) thereports; + + for (numr = myData->FindNextRecord(0); numr > 0; + numr = myData->FindNextRecord(numr)) + { + Handle(Standard_Transient) newent = myProtocol->NewEntity(myData->DirPart(numr).Type()); + + if (newent.IsNull()) { + newent = myProtocol->UnknownEntity(); + if (thereports.IsNull()) + thereports = new TColStd_HArray1OfTransient (1,myData->NbRecords()); + thenbreps ++; thenbrep0 ++; + thereports->SetValue (numr,new Interface_ReportEntity(newent)); + } + myData->BindEntity (numr,newent); + } + + //==================================== + const Handle(Message_Messenger) &TF = Message::DefaultMessenger(); //this->Messenger(); + //==================================== + + Handle(Interface_Check) ach = new Interface_Check; + +// .. Demarrage : Lecture du Header .. + + // .. Lecture des Entites .. + + amodel->Reservate (myData->NbEntities()); + + numr = myData->FindNextRecord(0); + + Standard_Integer num = numr; + while (num > 0) + { + Standard_Integer ierr = 0; // erreur sur analyse d une entite + Handle(Standard_Transient) anent; + try + { + OCC_CATCH_SIGNALS + for (num = numr; num > 0; num = myData->FindNextRecord(num)) + { + numr = num; + + // Lecture sous protection contre crash + // (fait aussi AddEntity mais pas SetReportEntity) + Handle(Standard_Transient) anent = myData->BoundEntity(num); + Handle(Interface_Check) ach = new Interface_Check(anent); + Handle(Interface_ReportEntity) rep; // entite Report, s il y a lieu + Standard_Integer irep = 0; + if (thenbrep0 > 0) { + rep = Handle(Interface_ReportEntity)::DownCast(thereports->Value(num)); + if (!rep.IsNull()) { irep = num; ach = rep->Check(); } + } + + // .. Chargement proprement dit : Specifique de la Norme .. + thechk = ach; + thecnum = num; + + DeclareAndCast(IGESData_IGESEntity,ent,anent); + ent->Clear(); + ent->OwnRead(*this); + + // .. Ajout dans le modele de l entite telle quelle .. + // ATTENTION, ReportEntity traitee en bloc apres les Load + amodel->AddEntity(anent); + + // Erreur ou Correction : On cree une ReportEntity qui memorise le Check, + // l Entite, et en cas d Erreur une UndefinedEntity pour les Parametres + + // On exploite ici le flag IsLoadError : s il a ete defini (a vrai ou faux) + // il a priorite sur les fails du check. Sinon, ce sont les fails qui parlent + + Standard_Integer nbf = ach->NbFails(); + Standard_Integer nbw = ach->NbWarnings(); + if (nbf + nbw > 0) + { + amodel->NbEntities(); + rep = new Interface_ReportEntity(ach,anent); + if (irep == 0) + { + if (thereports.IsNull()) + thereports = new TColStd_HArray1OfTransient (1,myData->NbRecords()); + irep = num; + thenbreps ++; + } + thereports->SetValue(irep,rep); + } + + // Rechargement ? si oui, dans une UnknownEntity fournie par le protocole + if (nbf > 0) { + Handle(Standard_Transient) undef = myProtocol->UnknownEntity(); + GetCasted(IGESData_IGESEntity,undef)->OwnRead(*this); + rep->SetContent(undef); + } + + // .. Fin Lecture .. + if (anent.IsNull()) { + // Sending of message : Number of ignored Null Entities + Message_Msg Msg21("XSTEP_21"); + Msg21.Arg(amodel->NbEntities()); + TF->Send (Msg21, Message_Info); + continue; + } + // LoadedEntity fait AddEntity MAIS PAS SetReport (en bloc a la fin) + + } // ---- fin boucle sur entites + numr = 0; // plus rien + } // ---- fin du try, le catch suit + + // En cas d erreur NON PREVUE par l analyse, recuperation par defaut + // Attention : la recuperation peut elle-meme planter ... (cf ierr) + catch (Standard_Failure) { + // Au passage suivant, on attaquera le record suivant + numr = myData->FindNextRecord(num); //:g9 abv 28 May 98: tr8_as2_ug.stp - infinite cycle: (0); + + Handle(Standard_Failure) afail = Standard_Failure::Caught(); +#ifdef _WIN32 + if (afail.IsNull() || afail->IsKind(STANDARD_TYPE(OSD_Exception))) ierr = 2; +#else + if (afail.IsNull() || afail->IsKind(STANDARD_TYPE(OSD_Signal))) ierr = 2; +#endif + anent = myData->BoundEntity(num); + if (anent.IsNull()) { + // Sending of message : Number of ignored Null Entities + Message_Msg Msg21("XSTEP_21"); + Msg21.Arg(amodel->NbEntities()+1); + TF->Send (Msg21, Message_Info); + continue; + } + ach = new Interface_Check(anent); + //: abv 03 Apr 00: trj3_s1-tc-214.stp: generate a message on exception + Message_Msg Msg278("XSTEP_278"); + Msg278.Arg(amodel->StringLabel(anent)); + ach->SendFail (Msg278); + + if (ierr == 2) { + // Sending of message : reading of entity failed + Message_Msg Msg22("XSTEP_22"); + Msg22.Arg(amodel->StringLabel(anent)); + TF->Send (Msg22, Message_Info); + return; + } + + if (!ierr) { + ierr = 1; + // ce qui serait bien ici serait de recuperer le texte de l erreur pour ach ... + // Sending of message : recovered entity + Message_Msg Msg23("XSTEP_23"); + Msg23.Arg(num); + TF->Send (Msg23, Message_Info); + + // Finalement, on charge une Entite Inconnue + thenbreps ++; + Handle(Interface_ReportEntity) rep = new Interface_ReportEntity(ach,anent); + Handle(Standard_Transient) undef = myProtocol->UnknownEntity(); + GetCasted(IGESData_IGESEntity,undef)->OwnRead(*this); + rep->SetContent(undef); + + if (thereports.IsNull()) + thereports = new TColStd_HArray1OfTransient (1,myData->NbRecords()); + + thenbreps ++; + thereports->SetValue (num,rep); + amodel->AddEntity (anent); // pas fait par LoadedEntity ... + } + else { + // Sending of message : reading of entity failed + Message_Msg Msg22("XSTEP_22"); + Msg22.Arg(amodel->StringLabel(anent)); + TF->Send (Msg22, Message_Info); + // On garde telle quelle : pas d analyse fichier supplementaire, + // Mais la phase preliminaire eventuelle est conservee + // (en particulier, on garde trace du Type lu du fichier, etc...) + } + } // ----- fin complete du try/catch + } // ----- fin du while + +// .. Ajout des Reports, silya + if (!thereports.IsNull()) { + // Sending of message : report + Message_Msg Msg24("XSTEP_24"); + Msg24.Arg(thenbreps); + TF->Send (Msg24, Message_Info); + amodel->Reservate (-thenbreps-10); + thenbreps = thereports->Upper(); + for (Standard_Integer nr = 1; nr <= thenbreps; nr ++) { + if (thereports->Value(nr).IsNull()) continue; + Handle(Standard_Transient) anent = myData->BoundEntity (nr); + Handle(Interface_ReportEntity) rep = + Handle(Interface_ReportEntity)::DownCast(thereports->Value(nr)); + amodel->SetReportEntity (-amodel->Number(anent),rep); + } + } + */ +} + + +IGESFile_Reader::ParamStatus IGESFile_Reader::ReadInteger (Standard_Integer &theVal, const Standard_CString theMsg) +{ + const Standard_Character *aBuffer = (const Standard_Character *)myBuffer->ChangeData(); + + while (aBuffer[myCurrentPos] == ' ' || aBuffer[myCurrentPos] == '\t') myCurrentPos++; + + if (aBuffer[myCurrentPos] == myHeader.Separator()) { + myCurrentPos++; + return ParamEmpty; + } + + if (aBuffer[myCurrentPos] == myHeader.EndMark()) + return ParamEmpty; + + char *endptr; + const long int aVal = (Standard_Integer)strtol(&aBuffer[myCurrentPos],&endptr,10); + const Standard_Size len = endptr - &aBuffer[myCurrentPos]; + myCurrentPos += len; + + while (aBuffer[myCurrentPos] == ' ' || aBuffer[myCurrentPos] == '\t') myCurrentPos++; + + if (aBuffer[myCurrentPos] == myHeader.Separator()) { + myCurrentPos++; + theVal = (Standard_Integer)aVal; + return ParamOK; + } + + if (aBuffer[myCurrentPos] == myHeader.EndMark()) { + theVal = (Standard_Integer)aVal; + return ParamOK; + } + + return ParamError; +} + + +IGESFile_Reader::ParamStatus IGESFile_Reader::ReadReal (Standard_Real &theVal, const Standard_CString theMsg) +{ + const Standard_Character *aBuffer = (const Standard_Character *)myBuffer->ChangeData(); + + while (aBuffer[myCurrentPos] == ' ' || aBuffer[myCurrentPos] == '\t') myCurrentPos++; + + if (aBuffer[myCurrentPos] == myHeader.Separator()) { + myCurrentPos++; + return ParamEmpty; + } + + if (aBuffer[myCurrentPos] == myHeader.EndMark()) + return ParamEmpty; + + char *endptr; + const double aVal = (Standard_Real)strtod(&aBuffer[myCurrentPos],&endptr); + const Standard_Size len = endptr - &aBuffer[myCurrentPos]; + myCurrentPos += len; + + while (aBuffer[myCurrentPos] == ' ' || aBuffer[myCurrentPos] == '\t') myCurrentPos++; + + if (aBuffer[myCurrentPos] == myHeader.Separator()) { + myCurrentPos++; + theVal = (Standard_Real)aVal; + return ParamOK; + } + + if (aBuffer[myCurrentPos] == myHeader.EndMark()) { + theVal = (Standard_Real)aVal; + return ParamOK; + } + + return ParamError; +} + + +IGESFile_Reader::ParamStatus IGESFile_Reader::ReadString (TCollection_AsciiString &theVal, const Standard_CString theMsg) +{ + const Standard_Character *aBuffer = (const Standard_Character *)myBuffer->ChangeData(); + + while (aBuffer[myCurrentPos] == ' ' || aBuffer[myCurrentPos] == '\t') myCurrentPos++; + + if (aBuffer[myCurrentPos] == myHeader.Separator()) { + myCurrentPos++; + return ParamEmpty; + } + + if (aBuffer[myCurrentPos] == myHeader.EndMark()) + return ParamEmpty; + + char *endptr; + const long int aLength = strtol(&aBuffer[myCurrentPos],&endptr,10); + const Standard_Size len = endptr - &aBuffer[myCurrentPos]; + myCurrentPos += len; + + if (aBuffer[myCurrentPos] != 'H' || aBuffer[myCurrentPos] != 'h') + return ParamError; + + myCurrentPos++; + + // Read characters + // TODO!!! + + if (aBuffer[myCurrentPos] == myHeader.Separator()) { + myCurrentPos++; + return ParamOK; + } + + if (aBuffer[myCurrentPos] == myHeader.EndMark()) + return ParamOK; + + return ParamError; +} + + +Standard_Integer IGESFile_Reader::ReadLine (Standard_Character *theBuffer, Standard_Size &theLength) +{ + static const char sects[] = " SGDPT "; + + Standard_Integer i, section_code, section_line; + + for (;;) + { + section_code = section_line = 0; + + if (mySectionLine[mySectionCode] == 0) + theBuffer[72] = theBuffer[79] = ' '; + + myCurrentLine++; + + theBuffer[0] = '\0'; + + while ( fgets(theBuffer,2,myFile) && ( theBuffer[0] == '\r' || theBuffer[0] == '\n' ) ) + {} + + if (!fgets(&theBuffer[1],80,myFile)) + return 0; + + if (mySectionLine[mySectionCode] == 0 && theBuffer[72] != 'S' && theBuffer[79] == ' ') + { + // CASE OF FNES : Skip the first line + theBuffer[0] = '\0'; + + while ( fgets(theBuffer,2,myFile) && ( theBuffer[0] == '\r' || theBuffer[0] == '\n' ) ) + {} + + if (!fgets(&theBuffer[1],80,myFile)) + return 0; + } + + if (feof(myFile)) + return 0; + + {//0x1A is END_OF_FILE for OS DOS and WINDOWS. For other OS we set this rule forcefully. + char *fc = strchr(theBuffer, 0x1A); + if(fc != 0) + { + fc[0] = '\0'; + return 0; + } + } + + if (theBuffer[0] == '\0' || theBuffer[0] == '\n' || theBuffer[0] == '\r') + continue; + + if (sscanf(&theBuffer[73],"%d",§ion_line) != 0) + { + switch (theBuffer[72]) + { + case 'S' : section_code = 1; break; + case 'G' : section_code = 2; break; + case 'D' : section_code = 3; break; + case 'P' : section_code = 4; break; + case 'T' : section_code = 5; break; + default : + // the column 72 is empty, try to check the neighbour + if (strlen(theBuffer) == 80 && (theBuffer[79] == '\n' || theBuffer[79] == '\r') && (theBuffer[0] >= '0' && theBuffer[0] <= '9')) + { + // check if the case of losted + for (i = 1; theBuffer[i] >= '0' && theBuffer[i] <= '9'; i++); + if (theBuffer[i]=='D' || theBuffer[i]=='d') { + for (i = 79; i > 0; i--) + theBuffer[i] = theBuffer[i-1]; + theBuffer[0]='.'; + switch (theBuffer[72]) + { + case 'S' : section_code = 1; break; + case 'G' : section_code = 2; break; + case 'D' : section_code = 3; break; + case 'P' : section_code = 4; break; + case 'T' : section_code = 5; break; + default :; + } + } + } + } + if (section_code > 0) + { + theBuffer[72] = '\0'; + theLength = 72; + if (section_code >= mySectionCode) break; + } + } + + if (section_code == 0) + { + // the line does not conform to standard, try to read it (if there are some missing spaces) + // find the number end + const int len = (int)strlen(theBuffer); + i = len; + while ((theBuffer[i] == '\0' || theBuffer[i] == '\n' || theBuffer[i] == '\r' || theBuffer[i] == ' ') && i > 0) + i--; + if (i != len) + theBuffer[i + 1] = '\0'; + // find the number start + while (theBuffer[i] >= '0' && theBuffer[i] <= '9' && i > 0) + i--; + + if (sscanf(&theBuffer[i + 1],"%d",§ion_line) != 0) + { + // find type of line + while (theBuffer[i] == ' ' && i > 0) + i--; + switch (theBuffer[i]) + { + case 'S' : section_code = 1; break; + case 'G' : section_code = 2; break; + case 'D' : section_code = 3; break; + case 'P' : section_code = 4; break; + case 'T' : section_code = 5; break; + default :; + } + if (section_code > 0) + { + theBuffer[i] = '\0'; + theLength = i; + if (section_code >= mySectionCode) break; + } + } + } + + // Sending of message : Syntax error + char str[2]; + str[1] = '\0'; + str[0] = sects[mySectionCode]; + Message_Msg amsg("XSTEP_18"); + amsg.Arg(myCurrentLine); + amsg.Arg(str); + myCheck->SendFail(amsg); + + if (mySectionCode == 0) return -1; + + mySectionLine[mySectionCode]++; + } + + mySectionCode = section_code; + mySectionLine[mySectionCode]++; + + if (section_line != mySectionLine[mySectionCode]) + { + // Sending of message : Syntax error + char str[2]; + str[1] = '\0'; + str[0] = sects[mySectionCode]; + Message_Msg amsg("XSTEP_19"); + amsg.Arg(myCurrentLine); + amsg.Arg(str); + myCheck->SendFail(amsg); + } + + return section_code; +} + + +Standard_Boolean IGESFile_Reader::ParseHeader () +{ + myCurrentPos = 0; + + // Set default delimiters + myHeader.SetSeparator(','); + myHeader.SetEndMark(';'); + + Standard_Integer ival; + Standard_Real rval; + TCollection_AsciiString sval; + + // Parameter Delimiter Character + switch (ReadString(sval)) { + case ParamOK: myHeader.SetSeparator(sval.ToCString()[0]); break; + case ParamEmpty: myHeader.SetSeparator(','); break; + default: return Standard_False; + } + // Record Delimiter + switch (ReadString(sval)) { + case ParamOK: myHeader.SetEndMark(sval.ToCString()[0]); break; + case ParamEmpty: myHeader.SetEndMark(';'); break; + default: return Standard_False; + } + // Product Identification From Sender + switch (ReadString(sval)) { + case ParamOK: myHeader.SetSendName(new TCollection_HAsciiString(sval)); break; + case ParamEmpty: myHeader.SetSendName(NULL); break; + default: return Standard_False; + } + // File Name + switch (ReadString(sval)) { + case ParamOK: myHeader.SetFileName(new TCollection_HAsciiString(sval)); break; + case ParamEmpty: myHeader.SetFileName(NULL); break; + default: return Standard_False; + } + // Native System ID + switch (ReadString(sval)) { + case ParamOK: myHeader.SetSystemId(new TCollection_HAsciiString(sval)); break; + case ParamEmpty: myHeader.SetSystemId(NULL); break; + default: return Standard_False; + } + // Preprocessor Version + switch (ReadString(sval)) { + case ParamOK: myHeader.SetInterfaceVersion(new TCollection_HAsciiString(sval)); break; + case ParamEmpty: myHeader.SetInterfaceVersion(NULL); break; + default: return Standard_False; + } + // Number of Binary Bits for Integer Representation + switch (ReadInteger(ival)) { + case ParamOK: myHeader.SetIntegerBits(ival); break; + //case ParamEmpty: myHeader.SetIntegerBits(32); break; + default: return Standard_False; + } + + switch (ReadInteger(ival)) { + case ParamOK: myHeader.SetMaxPower10Single(ival); break; + //case ParamEmpty: myHeader.SetMaxPower10Single(38); break; + default: return Standard_False; + } + + switch (ReadInteger(ival)) { + case ParamOK: myHeader.SetMaxDigitsSingle(ival); break; + //case ParamEmpty: myHeader.SetMaxDigitsSingle(6); break; + default: return Standard_False; + } + + switch (ReadInteger(ival)) { + case ParamOK: myHeader.SetMaxPower10Double(ival); break; + //case ParamEmpty: myHeader.SetMaxPower10Double(308); break; + default: return Standard_False; + } + + switch (ReadInteger(ival)) { + case ParamOK: myHeader.SetMaxDigitsDouble(ival); break; + //case ParamEmpty: myHeader.SetMaxDigitsDouble(15); break; + default: return Standard_False; + } + + switch (ReadString(sval)) { + case ParamOK: myHeader.SetReceiveName(new TCollection_HAsciiString(sval)); break; + case ParamEmpty: myHeader.SetReceiveName(myHeader.SendName()); break; + default: return Standard_False; + } + + switch (ReadReal(rval)) { + case ParamOK: myHeader.SetScale(rval); break; + case ParamEmpty: myHeader.SetScale(1.); break; + default: return Standard_False; + } + + switch (ReadInteger(ival)) { + case ParamOK: myHeader.SetUnitFlag(ival); break; + case ParamEmpty: myHeader.SetUnitFlag(1); break; + default: return Standard_False; + } + + switch (ReadString(sval)) { + case ParamOK: myHeader.SetUnitName(new TCollection_HAsciiString(sval)); break; + case ParamEmpty: myHeader.SetUnitName(new TCollection_HAsciiString("IN")); break; + default: return Standard_False; + } + + switch (ReadInteger(ival)) { + case ParamOK: myHeader.SetLineWeightGrad(ival); break; + case ParamEmpty: myHeader.SetLineWeightGrad(1); break; + default: return Standard_False; + } + + switch (ReadReal(rval)) { + case ParamOK: myHeader.SetMaxLineWeight(rval); break; + //case ParamEmpty: myHeader.SetMaxLineWeight(0.); break; + default: return Standard_False; + } + + switch (ReadString(sval)) { + case ParamOK: myHeader.SetDate(new TCollection_HAsciiString(sval)); break; + //case ParamEmpty: myHeader.SetDate(NULL); break; + default: return Standard_False; + } + + switch (ReadReal(rval)) { + case ParamOK: myHeader.SetResolution(rval); break; + //case ParamEmpty: myHeader.SetResolution(0.); break; + default: return Standard_False; + } + + switch (ReadReal(rval)) { + case ParamOK: myHeader.SetMaxCoord(rval); break; //hasMaxCoord = Standard_True; + //case ParamEmpty: myHeader.SetMaxCoord(0.); break; + default: return Standard_False; + } + + switch (ReadString(sval)) { + case ParamOK: myHeader.SetAuthorName(new TCollection_HAsciiString(sval)); break; + case ParamEmpty: myHeader.SetAuthorName(NULL); break; + default: return Standard_False; + } + + switch (ReadString(sval)) { + case ParamOK: myHeader.SetCompanyName(new TCollection_HAsciiString(sval)); break; + case ParamEmpty: myHeader.SetCompanyName(NULL); break; + default: return Standard_False; + } + + switch (ReadInteger(ival)) { + case ParamOK: myHeader.SetIGESVersion(ival); break; + case ParamEmpty: myHeader.SetIGESVersion(11); break; //3? + default: return Standard_False; + } + + switch (ReadInteger(ival)) { + case ParamOK: myHeader.SetDraftingStandard(ival); break; + case ParamEmpty: myHeader.SetDraftingStandard(0); break; + default: return Standard_False; + } + + //theLastChangeDate.Nullify(); // nouveaute 5.1 (peut etre absente) + //theAppliProtocol.Nullify(); // nouveaute 5.3 (peut etre absente) + + //:45 by abv 11.12.97: if UnitFlag is not defined in the file, + // restore it from UnitName. Repris par CKY 13-FEV-1998 + if ( myHeader.UnitFlag() == 0 || myHeader.UnitFlag() == 3 ) { + const Standard_Integer corrected = myHeader.UnitName().IsNull()? 1 : IGESData::UnitNameFlag(myHeader.UnitName()->ToCString()); + if (corrected > 0) myHeader.SetUnitFlag(corrected); + else if (myHeader.UnitFlag() == 3) { + Message_Msg Msg49 ("XSTEP_49"); + myCheck->SendWarning (Msg49); + } + else { + Message_Msg Msg48 ("XSTEP_48"); + myCheck->SendFail (Msg48); + } + } + + myModel->SetGlobalSection(myHeader); + + /* themaxweight = gs.MaxLineWeight(); + thegradweight = gs.LineWeightGrad(); + if (thegradweight > 0) + { themaxweight = themaxweight/thegradweight; thegradweight = 1; } + thedefweight = myData->DefaultLineWeight();*/ + + return Standard_True; +} diff --git a/src/IGESFile/IGESFile_Reader.hxx b/src/IGESFile/IGESFile_Reader.hxx new file mode 100644 index 0000000000..c11ff86ec5 --- /dev/null +++ b/src/IGESFile/IGESFile_Reader.hxx @@ -0,0 +1,127 @@ +// Created on: 2016-12-15 +// Created by: Sergey ZERCHANINOV +// Copyright (c) 2016 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _IGESFile_Reader_HeaderFile +#define _IGESFile_Reader_HeaderFile + +#include +#include +#include + +#include +class TCollection_AsciiString; +class TCollection_HAsciiString; +class gp_XY; +class gp_XYZ; +class Interface_Check; +class Interface_PointerBase; +class IGESData_Protocol; +class IGESData_IGESModel; +class IGESFile_Buffer; + +class IGESFile_Reader +{ + public: + + enum ParamStatus + { + ParamOK, + ParamEmpty, + ParamError + }; + + public: + + DEFINE_STANDARD_ALLOC + + //! Constructor + Standard_EXPORT IGESFile_Reader (const Handle(IGESData_Protocol)& theProtocol); + + //! ... + Standard_EXPORT Standard_Boolean HasData () const; + + //! ... + Standard_EXPORT Standard_Integer Read (const Standard_CString theFileName); + + //! Reads an integer value + Standard_EXPORT ParamStatus ReadBoolean (Standard_Boolean &theVal, const Standard_CString theMsg = NULL); + + //! Reads an integer value + ParamStatus ReadInteger (Standard_Integer &theVal, const Standard_CString theMsg = NULL) { return ReadInteger(theVal,1,theMsg); } + + //! Reads an array of integer values + Standard_EXPORT ParamStatus ReadInteger (Standard_Integer &theVal, const Standard_Integer theNum, const Standard_CString theMsg = NULL); + + //! Reads a double value + ParamStatus ReadReal (Standard_Real &theVal, const Standard_CString theMsg = NULL) { return ReadReal(theVal,1,theMsg); } + + //! Reads an array of double values + Standard_EXPORT ParamStatus ReadReal (Standard_Real &theVal, const Standard_Integer theNum, const Standard_CString theMsg = NULL); + + //! Reads an XYZ value + Standard_EXPORT ParamStatus ReadXY (gp_XY &theVal, const Standard_CString theMsg = NULL); + + //! Reads an XYZ value + Standard_EXPORT ParamStatus ReadXYZ (gp_XYZ &theVal, const Standard_CString theMsg = NULL); + + //! ... + Standard_EXPORT ParamStatus ReadString (TCollection_AsciiString &theVal, const Standard_CString theMsg = NULL); + + //! ... + Standard_EXPORT ParamStatus ReadText (Handle(TCollection_HAsciiString) &theVal, const Standard_CString theMsg = NULL); + + //! ... + Standard_EXPORT ParamStatus ReadPointer (Interface_PointerBase &thePointer, const Standard_CString theMsg = NULL); + + //! Skips a parameter + Standard_EXPORT ParamStatus ReadAny (const Standard_CString theMsg = NULL); + + //! ... + Standard_EXPORT ParamStatus GetPointer (Interface_PointerBase &thePointer, const Standard_Integer theIndex); + + //! ... + const Handle(IGESData_IGESModel) & Model () { return myModel; } + + Standard_EXPORT void AddWarning (const Standard_CString afail, const Standard_CString bfail = ""); + + Standard_EXPORT void AddFail (const Standard_CString afail, const Standard_CString bfail = ""); + + private: + + Standard_EXPORT Standard_Integer ReadLine (Standard_Character *theBuffer, Standard_Size &theLength); + + Standard_EXPORT Standard_Boolean ParseHeader (); + + Standard_EXPORT Standard_Boolean ParseDirectory (); + + //! ... + Standard_EXPORT void LoadModel (); + + Handle(IGESData_Protocol) myProtocol; + Handle(IGESData_IGESModel) myModel; + Handle(Interface_Check) myCheck; + + FILE* myFile; + Standard_Integer myCurrentLine; + Standard_Integer mySectionCode; + Standard_Integer mySectionLine[6]; + + Handle(IGESFile_Buffer) myBuffer; + Standard_Size myCurrentPos; + + IGESData_GlobalSection myHeader; +}; + +#endif // _IGESFile_Reader_HeaderFile diff --git a/src/IGESFile/analiges.c b/src/IGESFile/analiges.c index ea1f22270b..d34b701774 100644 --- a/src/IGESFile/analiges.c +++ b/src/IGESFile/analiges.c @@ -17,7 +17,6 @@ #include "igesread.h" void iges_newparam(int typarg,int longval, char *parval); -void iges_newpart(int numsec); void iges_curpart(int dnum); void iges_addparam(int longval, char* parval); @@ -35,85 +34,6 @@ void iges_addparam(int longval, char* parval); a savoir declarations + curp */ /* #define VERIFPRINT */ -/* Lecture section D - Chaque entite tient sur deux lignes - - Dstat demarre a zero "on lit une nouvelle entite" - et bascule avec un "deuxieme ligne de l'entite" -*/ - - -static int bases[] = - { 1,10,100,1000,10000,100000,1000000, 10000000,100000000,1000000000 }; - -/* DECODAGE : parce que scanf ne fait pas vraiment ce qu'il faut */ -/* Utilitaire decodant un nombre en format fixe dans une ligne - Il part de "depuis" inclus (debut ligne = 0) et prend "tant" caracteres - Valeur lue en retour de fonction */ -static int IGES_decode (char* ligne, int depuis, int tant) -{ - int val = 0; int i; - int depart = depuis+tant-1; - for (i = 0; i < tant; i ++) { - char uncar = ligne[depart-i]; - if (uncar == ' ') break; - else if (uncar == '+') continue; - else if (uncar == '-') val = -val; - else if (uncar != '0') val += (uncar - 48)*bases[i]; - } - return val; -} - -/* Recopie d'une chaine de caracteres de longueur fixe (close par \0) */ -void IGES_copstr(char *ligne, int depuis, int tant, char* dans) -{ - int i; - for (i = 0; i < tant; i ++) { dans[i] = ligne[depuis+i]; } - dans[tant] = '\0'; -} - -/* Analyse section D */ -void iges_Dsect (int *Dstat, int numsec, char* ligne) -{ - struct dirpart *curp; - if (*Dstat == 0) { - iges_newpart(numsec); - curp = iges_get_curp(); - curp->typ = IGES_decode(ligne, 0,8); - curp->poi = IGES_decode(ligne, 8,8); - curp->pdef = IGES_decode(ligne,16,8); - curp->tra = IGES_decode(ligne,24,8); - curp->niv = IGES_decode(ligne,32,8); - curp->vue = IGES_decode(ligne,40,8); - curp->trf = IGES_decode(ligne,48,8); - curp->aff = IGES_decode(ligne,56,8); - curp->blk = IGES_decode(ligne,64,2); - curp->sub = IGES_decode(ligne,66,2); - curp->use = IGES_decode(ligne,68,2); - curp->her = IGES_decode(ligne,70,2); -#ifdef VERIFPRINT - printf("Entite %d : type %d ->P %d\n",numsec,typ,poi); -#endif - *Dstat = 1; - } else if (*Dstat == 1) { - curp = iges_get_curp(); - curp->typ2 = IGES_decode(ligne, 0,8); - curp->epa = IGES_decode(ligne, 8,8); - curp->col = IGES_decode(ligne,16,8); - curp->nbl = IGES_decode(ligne,24,8); - curp->form = IGES_decode(ligne,32,8); - IGES_copstr (ligne,40,8,curp->res1); - IGES_copstr (ligne,48,8,curp->res2); - IGES_copstr (ligne,56,8,curp->nom); - IGES_copstr (ligne,64,8,curp->num); -#ifdef VERIFPRINT - printf("Entite %d : type %d (redite) form %d\n",numsec,typ2,form); -#endif - *Dstat = 0; - } -} - - /* Lecture section P : preanalyse Extraction du numero D et troncature a 64 caracteres */ diff --git a/src/IGESFile/igesread.c b/src/IGESFile/igesread.c deleted file mode 100644 index f923514982..0000000000 --- a/src/IGESFile/igesread.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - Copyright (c) 1999-2014 OPEN CASCADE SAS - - This file is part of Open CASCADE Technology software library. - - This library is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License version 2.1 as published - by the Free Software Foundation, with special exception defined in the file - OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT - distribution for complete text of the license and disclaimer of any warranty. - - Alternatively, this file may be used under the terms of Open CASCADE - commercial license or contractual agreement. -*/ - -/* Regroupement des sources "C" pour compilation */ -#include -#include "igesread.h" -#include - -/* -void IGESFile_Check21 (int mode,char * code, int num, char * str); -*/ -void IGESFile_Check3 (int mode,char * code); -void IGESFile_Check2 (int mode,char * code, int num, char * str); - -/* #include "structiges.c" ... fait par analiges qui en a l'usage ... */ -void iges_initfile(); -int iges_lire (FILE* lefic, int *numsec, char ligne[100], int modefnes); -void iges_newparam(int typarg,int longval, char *parval); -void iges_param(int *Pstat,char *ligne,char c_separ,char c_fin,int lonlin); -void iges_Dsect (int *Dstat,int numsec,char* ligne); -void iges_Psect(int numsec,char ligne[80]); - - - -/* Routine de lecture generale d'un fichier IGES - Assure l'enchainement des appels necessaires - Il en resulte un ensemble de donnees (struct C) interrogeables par - routines ad hoc (cf igesread.h qui les recapitule pour appel par C++) - - Retourne : 0 si OK, 1 si fichier pas pu etre ouvert - */ - - -/* MGE 16/06/98*/ -/* To use strcpy*/ -/*#include */ -/* To use Msg class */ -/*#include */ - -static char sects [] = " SGDPT "; - - -int igesread (char* nomfic, int lesect[6], int modefnes) -{ - /* MGE 16/06/98 */ - - FILE* lefic; char ligne[100]; int numsec, numl; int i; int i0;int j; - char str[2]; - - int Dstat = 0; int Pstat = 0; char c_separ = ','; char c_fin = ';'; - iges_initfile(); - lefic = stdin; i0 = numsec = 0; numl = 0; - if (nomfic[0] != '\0') - lefic = OSD_OpenFile(nomfic,"r"); - if (lefic == NULL) return -1; /* fichier pas pu etre ouvert */ - for (i = 1; i < 6; i++) lesect[i] = 0; - for (j = 0; j < 100; j++) ligne[j] = 0; - for(;;) { - numl ++; - i = iges_lire(lefic,&numsec,ligne,modefnes); - if (i <= 0 || i < i0) { - if (i == 0) break; - /* Sending of message : Syntax error */ - { - str[1] = '\0'; - str[0] = sects[i0]; - IGESFile_Check2 (0,"XSTEP_18",numl,str); /* //gka 15 Sep 98: str instead of sects[i0]); */ - } - - if (i0 == 0) return -1; - lesect[i0] ++; - continue; - } - lesect[i] ++; i0 = i; - if (numsec != lesect[i]) { - /* Sending of message : Syntax error */ - str[1] = '\0'; - str[0] = sects[i0]; - IGESFile_Check2 (0,"XSTEP_19",numl,str); /* //gka 15 Sep 98: str instead of sects[i0]); */ - } - - if (i == 1) { /* Start Section (comm.) */ - ligne[72] = '\0'; - iges_newparam (0,72,ligne); - } - if (i == 2) { /* Header (Global sect) */ - iges_setglobal(); - for (;;) { - if (lesect[i] == 1) { /* Separation specifique */ - int n0 = 0; - if (ligne[0] != ',') { c_separ = ligne[2]; n0 = 3; } - if (ligne[n0+1] != c_separ) { c_fin = ligne[n0+3]; } - } - iges_param(&Pstat,ligne,c_separ,c_fin,72); - if (Pstat != 2) break; - } - } - if (i == 3) iges_Dsect(&Dstat,numsec,ligne); /* Directory (Dsect) */ - if (i == 4) { /* Parametres (Psect) */ - iges_Psect(numsec,ligne); - for (;;) { - iges_param(&Pstat,ligne,c_separ,c_fin,64); - if (Pstat != 2) break; - } - } - } - - /* Sending of message : No Terminal Section */ - if (lesect[5] == 0) { - IGESFile_Check3 (1, "XSTEP_20"); - //return -1; - } - - - fclose (lefic); - - return 0; -} diff --git a/src/IGESFile/igesread.h b/src/IGESFile/igesread.h index 4890bee8e3..18e47a061a 100644 --- a/src/IGESFile/igesread.h +++ b/src/IGESFile/igesread.h @@ -44,13 +44,11 @@ extern "C" { void iges_nextpart (); int iges_lirparam (int* typarg,char* *parval); void iges_finfile (int mode); - struct dirpart *iges_get_curp (void); void iges_initfile(); int iges_lire (FILE* lefic, int *numsec, char ligne[100], int modefnes); void iges_newparam(int typarg,int longval, char *parval); void iges_param(int *Pstat,char *ligne,char c_separ,char c_fin,int lonlin); - void iges_Dsect (int *Dstat,int numsec,char* ligne); void iges_Psect(int numsec,char ligne[80]); /* MGE 20/07/98 */ diff --git a/src/IGESFile/liriges.c b/src/IGESFile/liriges.c index 8aa063add8..2d33f2dec9 100644 --- a/src/IGESFile/liriges.c +++ b/src/IGESFile/liriges.c @@ -13,6 +13,7 @@ commercial license or contractual agreement. */ +#if 0 #include "igesread.h" #include /* Routine de base de lecture d'un fichier IGES @@ -30,19 +31,34 @@ Cas d erreur : ligne fausse des le debut -> abandon. Sinon tacher d enjamber */ -static int iges_fautrelire = 0; int iges_lire (FILE* lefic, int *numsec, char ligne[100], int modefnes) -/*int iges_lire (lefic,numsec,ligne,modefnes)*/ -/*FILE* lefic; int *numsec; char ligne[100]; int modefnes;*/ { int i,result; char typesec; -/* int length;*/ - if (iges_fautrelire == 0) - { - if (*numsec == 0) - ligne[72] = ligne[79] = ' '; - ligne[0] = '\0'; + if (*numsec == 0) + ligne[72] = ligne[79] = ' '; + + ligne[0] = '\0'; + if(modefnes) + { + if (fgets(ligne,99,lefic) == NULL) // kept for compatibility with fnes + return 0; + } + else + { + // PTV: 21.03.2002 it is neccessary for files that have only `\r` but no `\n` + // examle file is 919-001-T02-04-CP-VL.iges + while ( fgets ( ligne, 2, lefic ) && ( ligne[0] == '\r' || ligne[0] == '\n' ) ) + {} + + if (fgets(&ligne[1],80,lefic) == NULL) + return 0; + } + + if (*numsec == 0 && ligne[72] != 'S' && ligne[79] == ' ') + {/* ON A DU FNES : Sauter la 1re ligne */ + ligne[0] = '\0'; + if(modefnes) { if (fgets(ligne,99,lefic) == NULL) /*for kept compatibility with fnes*/ @@ -50,40 +66,18 @@ int iges_lire (FILE* lefic, int *numsec, char ligne[100], int modefnes) } else { - /* PTV: 21.03.2002 it is neccessary for files that have only `\r` but no `\n` - examle file is 919-001-T02-04-CP-VL.iges */ while ( fgets ( ligne, 2, lefic ) && ( ligne[0] == '\r' || ligne[0] == '\n' ) ) { } - if (fgets(&ligne[1],80,lefic) == NULL) return 0; } - - if (*numsec == 0 && ligne[72] != 'S' && ligne[79] == ' ') - {/* ON A DU FNES : Sauter la 1re ligne */ - ligne[0] = '\0'; - - if(modefnes) - { - if (fgets(ligne,99,lefic) == NULL) /*for kept compatibility with fnes*/ - return 0; - } - else - { - while ( fgets ( ligne, 2, lefic ) && ( ligne[0] == '\r' || ligne[0] == '\n' ) ) - { - } - if (fgets(&ligne[1],80,lefic) == NULL) - return 0; - } - } + } - if ((ligne[0] & 128) && modefnes) - { - for (i = 0; i < 80; i ++) - ligne[i] = (char)(ligne[i] ^ (150 + (i & 3))); - } + if ((ligne[0] & 128) && modefnes) + { + for (i = 0; i < 80; i ++) + ligne[i] = (char)(ligne[i] ^ (150 + (i & 3))); } if (feof(lefic)) @@ -98,7 +92,6 @@ int iges_lire (FILE* lefic, int *numsec, char ligne[100], int modefnes) } } - iges_fautrelire = 0; if (ligne[0] == '\0' || ligne[0] == '\n' || ligne[0] == '\r') return iges_lire(lefic,numsec,ligne,modefnes); /* 0 */ @@ -163,8 +156,4 @@ int iges_lire (FILE* lefic, int *numsec, char ligne[100], int modefnes) } return -1; } - -/* Pour commander la relecture sur place */ - -void iges_arelire() -{ iges_fautrelire = 1; } +#endif diff --git a/src/IGESFile/structiges.c b/src/IGESFile/structiges.c index 721d9dae09..572b1ce372 100644 --- a/src/IGESFile/structiges.c +++ b/src/IGESFile/structiges.c @@ -33,10 +33,10 @@ static struct parlist *header; /* Entete du fichier IGES */ /* Declaration d'une portion de Directory IGES */ static struct dirpart *curp; -struct dirpart *iges_get_curp (void) +/*struct dirpart *iges_get_curp (void) { return curp; -} +}*/ /* Declaration d'un parametre IGES (Psect) */ static struct oneparam { @@ -137,7 +137,7 @@ void iges_setglobal() /* Definition et Selection d'un nouveau dirpart */ -void iges_newpart(int numsec) +/*unused:void iges_newpart(int numsec) { if (curpage->used >= Maxparts) { struct dirpage* newpage; @@ -151,7 +151,7 @@ void iges_newpart(int numsec) curp->numpart = numsec; curlist->nbparam = 0; curlist->first = curlist->last = NULL; curpage->used ++; nbparts ++; -} +}*/ /* Selection du dirpart dnum, correspond a numsec en Psect */ @@ -195,7 +195,6 @@ void iges_newparam (int typarg, int longval, char *parval) char *newval; if (curlist == NULL) return; /* non defini : abandon */ newval = iges_newchar(parval,longval); -/* curparam = (struct oneparam*) malloc ( sizeof(struct oneparam) ); */ if (oneparpage->used > Maxpar) { struct parpage* newparpage; newparpage = (struct parpage*) malloc ( sizeof(struct parpage) ); diff --git a/src/IGESGeom/FILES b/src/IGESGeom/FILES index defc19ceba..82aa2895ff 100644 --- a/src/IGESGeom/FILES +++ b/src/IGESGeom/FILES @@ -42,12 +42,8 @@ IGESGeom_Point.cxx IGESGeom_Point.hxx IGESGeom_Protocol.cxx IGESGeom_Protocol.hxx -IGESGeom_ReadWriteModule.cxx -IGESGeom_ReadWriteModule.hxx IGESGeom_RuledSurface.cxx IGESGeom_RuledSurface.hxx -IGESGeom_SpecificModule.cxx -IGESGeom_SpecificModule.hxx IGESGeom_SplineCurve.cxx IGESGeom_SplineCurve.hxx IGESGeom_SplineSurface.cxx diff --git a/src/IGESGeom/IGESGeom.cxx b/src/IGESGeom/IGESGeom.cxx index e764a6a94a..c537078f58 100644 --- a/src/IGESGeom/IGESGeom.cxx +++ b/src/IGESGeom/IGESGeom.cxx @@ -13,15 +13,10 @@ #include -#include -#include #include #include #include -#include -#include #include -#include /*void IGESGeom::Init () @@ -36,9 +31,6 @@ const Handle(IGESGeom_Protocol) & IGESGeom::Protocol () if (protocol.IsNull()) { protocol = new IGESGeom_Protocol; Interface_GeneralLib::SetGlobal (new IGESGeom_GeneralModule, protocol); - Interface_ReaderLib::SetGlobal (new IGESGeom_ReadWriteModule,protocol); - IGESData_WriterLib::SetGlobal (new IGESGeom_ReadWriteModule,protocol); - IGESData_SpecificLib::SetGlobal (new IGESGeom_SpecificModule, protocol); } return protocol; } diff --git a/src/IGESGeom/IGESGeom_GeneralModule.cxx b/src/IGESGeom/IGESGeom_GeneralModule.cxx index abd008d5f7..66be099858 100644 --- a/src/IGESGeom/IGESGeom_GeneralModule.cxx +++ b/src/IGESGeom/IGESGeom_GeneralModule.cxx @@ -70,107 +70,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESGeom_GeneralModule,IGESData_GeneralModule) - void IGESGeom_GeneralModule::OwnSharedCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - Interface_EntityIterator& iter) const -{ - switch (CN) { - case 3 : { - DeclareAndCast(IGESGeom_Boundary,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBoundary tool; - tool.OwnShared(anent,iter); - } - break; - case 4 : { - DeclareAndCast(IGESGeom_BoundedSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBoundedSurface tool; - tool.OwnShared(anent,iter); - } - break; - case 6 : { - DeclareAndCast(IGESGeom_CompositeCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCompositeCurve tool; - tool.OwnShared(anent,iter); - } - break; - case 9 : { - DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCurveOnSurface tool; - tool.OwnShared(anent,iter); - } - break; - case 11 : { - DeclareAndCast(IGESGeom_Flash,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolFlash tool; - tool.OwnShared(anent,iter); - } - break; - case 13 : { - DeclareAndCast(IGESGeom_OffsetCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolOffsetCurve tool; - tool.OwnShared(anent,iter); - } - break; - case 14 : { - DeclareAndCast(IGESGeom_OffsetSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolOffsetSurface tool; - tool.OwnShared(anent,iter); - } - break; - case 15 : { - DeclareAndCast(IGESGeom_Plane,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolPlane tool; - tool.OwnShared(anent,iter); - } - break; - case 16 : { - DeclareAndCast(IGESGeom_Point,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolPoint tool; - tool.OwnShared(anent,iter); - } - break; - case 17 : { - DeclareAndCast(IGESGeom_RuledSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolRuledSurface tool; - tool.OwnShared(anent,iter); - } - break; - case 20 : { - DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolSurfaceOfRevolution tool; - tool.OwnShared(anent,iter); - } - break; - case 21 : { - DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolTabulatedCylinder tool; - tool.OwnShared(anent,iter); - } - break; - case 23 : { - DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolTrimmedSurface tool; - tool.OwnShared(anent,iter); - } - break; - default : break; - } -} - - IGESData_DirChecker IGESGeom_GeneralModule::DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const { @@ -319,154 +218,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESGeom_GeneralModule,IGESData_GeneralModule) } - void IGESGeom_GeneralModule::OwnCheckCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESGeom_BSplineCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBSplineCurve tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 2 : { - DeclareAndCast(IGESGeom_BSplineSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBSplineSurface tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 3 : { - DeclareAndCast(IGESGeom_Boundary,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBoundary tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 4 : { - DeclareAndCast(IGESGeom_BoundedSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBoundedSurface tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 7 : { - DeclareAndCast(IGESGeom_ConicArc,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolConicArc tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 8 : { - DeclareAndCast(IGESGeom_CopiousData,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCopiousData tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 9 : { - DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCurveOnSurface tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 10 : { - DeclareAndCast(IGESGeom_Direction,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolDirection tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 11 : { - DeclareAndCast(IGESGeom_Flash,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolFlash tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 13 : { - DeclareAndCast(IGESGeom_OffsetCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolOffsetCurve tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 15 : { - DeclareAndCast(IGESGeom_Plane,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolPlane tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 18 : { - DeclareAndCast(IGESGeom_SplineCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolSplineCurve tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 19 : { - DeclareAndCast(IGESGeom_SplineSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolSplineSurface tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 22 : { - DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolTransformationMatrix tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 23 : { - DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolTrimmedSurface tool; - tool.OwnCheck(anent,shares,ach); - } - break; - default : break; - } -} - - - Standard_Boolean IGESGeom_GeneralModule::NewVoid - (const Standard_Integer CN, Handle(Standard_Transient)& ent) const -{ - switch (CN) { - case 1 : ent = new IGESGeom_BSplineCurve; break; - case 2 : ent = new IGESGeom_BSplineSurface; break; - case 3 : ent = new IGESGeom_Boundary; break; - case 4 : ent = new IGESGeom_BoundedSurface; break; - case 5 : ent = new IGESGeom_CircularArc; break; - case 6 : ent = new IGESGeom_CompositeCurve; break; - case 7 : ent = new IGESGeom_ConicArc; break; - case 8 : ent = new IGESGeom_CopiousData; break; - case 9 : ent = new IGESGeom_CurveOnSurface; break; - case 10 : ent = new IGESGeom_Direction; break; - case 11 : ent = new IGESGeom_Flash; break; - case 12 : ent = new IGESGeom_Line; break; - case 13 : ent = new IGESGeom_OffsetCurve; break; - case 14 : ent = new IGESGeom_OffsetSurface; break; - case 15 : ent = new IGESGeom_Plane; break; - case 16 : ent = new IGESGeom_Point; break; - case 17 : ent = new IGESGeom_RuledSurface; break; - case 18 : ent = new IGESGeom_SplineCurve; break; - case 19 : ent = new IGESGeom_SplineSurface; break; - case 20 : ent = new IGESGeom_SurfaceOfRevolution; break; - case 21 : ent = new IGESGeom_TabulatedCylinder; break; - case 22 : ent = new IGESGeom_TransformationMatrix; break; - case 23 : ent = new IGESGeom_TrimmedSurface; break; - default : return Standard_False; // by default, Failure on Recognize - } - return Standard_True; -} - - Standard_Integer IGESGeom_GeneralModule::CategoryNumber (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& ) const diff --git a/src/IGESGeom/IGESGeom_GeneralModule.hxx b/src/IGESGeom/IGESGeom_GeneralModule.hxx index 7bb109c356..fc810e9c8e 100644 --- a/src/IGESGeom/IGESGeom_GeneralModule.hxx +++ b/src/IGESGeom/IGESGeom_GeneralModule.hxx @@ -32,21 +32,11 @@ class IGESGeom_GeneralModule : public IGESData_GeneralModule //! Creates a GeneralModule from IGESGeom and puts it into GeneralLib IGESGeom_GeneralModule() {} - //! Lists the Entities shared by a given IGESEntity , from - //! its specific parameters : specific for each type - Standard_EXPORT void OwnSharedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - //! Returns a DirChecker, specific for each type of Entity //! (identified by its Case Number) : this DirChecker defines //! constraints which must be respected by the DirectoryPart Standard_EXPORT IGESData_DirChecker DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - //! Performs Specific Semantic Check for each type of Entity - Standard_EXPORT void OwnCheckCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE; - - //! Specific creation of a new void entity - Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE; - //! Returns a category number which characterizes an entity //! Shape for all, but Drawing for : //! Flash; Point with a symbol; Plane with a symbol diff --git a/src/IGESGeom/IGESGeom_ReadWriteModule.cxx b/src/IGESGeom/IGESGeom_ReadWriteModule.cxx deleted file mode 100644 index d99d7c61f9..0000000000 --- a/src/IGESGeom/IGESGeom_ReadWriteModule.cxx +++ /dev/null @@ -1,451 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESGeom_ReadWriteModule,IGESData_ReadWriteModule) - -// Each Module is attached to a Protocol : it must interprete Case Numbers -// (arguments of various methods) in accordance to values returned by -// the method TypeNumber from this Protocol -IGESGeom_ReadWriteModule::IGESGeom_ReadWriteModule () { } - - - Standard_Integer IGESGeom_ReadWriteModule::CaseIGES - (const Standard_Integer typenum, const Standard_Integer formnum) const -{ - switch (typenum) { - case 100 : return 5; - case 102 : return 6; - case 104 : return 7; - case 106 : if (formnum < 20 || formnum > 40) return 8; - break; - case 108 : return 15; - case 110 : return 12; - case 112 : return 18; - case 114 : return 19; - case 116 : return 16; - case 118 : return 17; - case 120 : return 20; - case 122 : return 21; - case 123 : return 10; - case 124 : return 22; - case 125 : return 11; - case 126 : return 1; - case 128 : return 2; - case 130 : return 13; - case 140 : return 14; - case 141 : return 3; - case 142 : return 9; - case 143 : return 4; - case 144 : return 23; - default : break; - } - return 0; -} - - - void IGESGeom_ReadWriteModule::ReadOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESGeom_BSplineCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBSplineCurve tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 2 : { - DeclareAndCast(IGESGeom_BSplineSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBSplineSurface tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 3 : { - DeclareAndCast(IGESGeom_Boundary,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBoundary tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 4 : { - DeclareAndCast(IGESGeom_BoundedSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBoundedSurface tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 5 : { - DeclareAndCast(IGESGeom_CircularArc,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCircularArc tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 6 : { - DeclareAndCast(IGESGeom_CompositeCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCompositeCurve tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 7 : { - DeclareAndCast(IGESGeom_ConicArc,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolConicArc tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 8 : { - DeclareAndCast(IGESGeom_CopiousData,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCopiousData tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 9 : { - DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCurveOnSurface tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 10 : { - DeclareAndCast(IGESGeom_Direction,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolDirection tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 11 : { - DeclareAndCast(IGESGeom_Flash,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolFlash tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 12 : { - DeclareAndCast(IGESGeom_Line,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolLine tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 13 : { - DeclareAndCast(IGESGeom_OffsetCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolOffsetCurve tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 14 : { - DeclareAndCast(IGESGeom_OffsetSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolOffsetSurface tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 15 : { - DeclareAndCast(IGESGeom_Plane,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolPlane tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 16 : { - DeclareAndCast(IGESGeom_Point,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolPoint tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 17 : { - DeclareAndCast(IGESGeom_RuledSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolRuledSurface tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 18 : { - DeclareAndCast(IGESGeom_SplineCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolSplineCurve tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 19 : { - DeclareAndCast(IGESGeom_SplineSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolSplineSurface tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 20 : { - DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolSurfaceOfRevolution tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 21 : { - DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolTabulatedCylinder tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 22 : { - DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolTransformationMatrix tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 23 : { - DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolTrimmedSurface tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - default : break; - } -} - - - void IGESGeom_ReadWriteModule::WriteOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - IGESData_IGESWriter& IW) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESGeom_BSplineCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBSplineCurve tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 2 : { - DeclareAndCast(IGESGeom_BSplineSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBSplineSurface tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 3 : { - DeclareAndCast(IGESGeom_Boundary,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBoundary tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 4 : { - DeclareAndCast(IGESGeom_BoundedSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBoundedSurface tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 5 : { - DeclareAndCast(IGESGeom_CircularArc,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCircularArc tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 6 : { - DeclareAndCast(IGESGeom_CompositeCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCompositeCurve tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 7 : { - DeclareAndCast(IGESGeom_ConicArc,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolConicArc tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 8 : { - DeclareAndCast(IGESGeom_CopiousData,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCopiousData tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 9 : { - DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCurveOnSurface tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 10 : { - DeclareAndCast(IGESGeom_Direction,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolDirection tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 11 : { - DeclareAndCast(IGESGeom_Flash,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolFlash tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 12 : { - DeclareAndCast(IGESGeom_Line,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolLine tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 13 : { - DeclareAndCast(IGESGeom_OffsetCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolOffsetCurve tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 14 : { - DeclareAndCast(IGESGeom_OffsetSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolOffsetSurface tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 15 : { - DeclareAndCast(IGESGeom_Plane,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolPlane tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 16 : { - DeclareAndCast(IGESGeom_Point,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolPoint tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 17 : { - DeclareAndCast(IGESGeom_RuledSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolRuledSurface tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 18 : { - DeclareAndCast(IGESGeom_SplineCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolSplineCurve tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 19 : { - DeclareAndCast(IGESGeom_SplineSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolSplineSurface tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 20 : { - DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolSurfaceOfRevolution tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 21 : { - DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolTabulatedCylinder tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 22 : { - DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolTransformationMatrix tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 23 : { - DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolTrimmedSurface tool; - tool.WriteOwnParams(anent,IW); - } - break; - default : break; - } -} diff --git a/src/IGESGeom/IGESGeom_ReadWriteModule.hxx b/src/IGESGeom/IGESGeom_ReadWriteModule.hxx deleted file mode 100644 index 2e03a7158a..0000000000 --- a/src/IGESGeom/IGESGeom_ReadWriteModule.hxx +++ /dev/null @@ -1,79 +0,0 @@ -// Created on: 1993-09-06 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGeom_ReadWriteModule_HeaderFile -#define _IGESGeom_ReadWriteModule_HeaderFile - -#include -#include - -#include -#include -class Standard_DomainError; -class IGESData_IGESEntity; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; - - -class IGESGeom_ReadWriteModule; -DEFINE_STANDARD_HANDLE(IGESGeom_ReadWriteModule, IGESData_ReadWriteModule) - -//! Defines Geom File Access Module for IGESGeom (specific parts) -//! Specific actions concern : Read and Write Own Parameters of -//! an IGESEntity. -class IGESGeom_ReadWriteModule : public IGESData_ReadWriteModule -{ - -public: - - - //! Creates a ReadWriteModule & puts it into ReaderLib & WriterLib - Standard_EXPORT IGESGeom_ReadWriteModule(); - - //! Defines Case Numbers for Entities of IGESGeom - Standard_EXPORT Standard_Integer CaseIGES (const Standard_Integer typenum, const Standard_Integer formnum) const Standard_OVERRIDE; - - //! Reads own parameters from file for an Entity of IGESGeom - Standard_EXPORT void ReadOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const Standard_OVERRIDE; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, IGESData_IGESWriter& IW) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IGESGeom_ReadWriteModule,IGESData_ReadWriteModule) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IGESGeom_ReadWriteModule_HeaderFile diff --git a/src/IGESGeom/IGESGeom_SpecificModule.cxx b/src/IGESGeom/IGESGeom_SpecificModule.cxx deleted file mode 100644 index 33657da16c..0000000000 --- a/src/IGESGeom/IGESGeom_SpecificModule.cxx +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESGeom_SpecificModule,IGESData_SpecificModule) - - - void IGESGeom_SpecificModule::OwnDump - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, - const Standard_Integer own) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESGeom_BSplineCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBSplineCurve tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 2 : { - DeclareAndCast(IGESGeom_BSplineSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBSplineSurface tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 3 : { - DeclareAndCast(IGESGeom_Boundary,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBoundary tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 4 : { - DeclareAndCast(IGESGeom_BoundedSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolBoundedSurface tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 5 : { - DeclareAndCast(IGESGeom_CircularArc,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCircularArc tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 6 : { - DeclareAndCast(IGESGeom_CompositeCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCompositeCurve tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 7 : { - DeclareAndCast(IGESGeom_ConicArc,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolConicArc tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 8 : { - DeclareAndCast(IGESGeom_CopiousData,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCopiousData tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 9 : { - DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolCurveOnSurface tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 10 : { - DeclareAndCast(IGESGeom_Direction,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolDirection tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 11 : { - DeclareAndCast(IGESGeom_Flash,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolFlash tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 12 : { - DeclareAndCast(IGESGeom_Line,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolLine tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 13 : { - DeclareAndCast(IGESGeom_OffsetCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolOffsetCurve tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 14 : { - DeclareAndCast(IGESGeom_OffsetSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolOffsetSurface tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 15 : { - DeclareAndCast(IGESGeom_Plane,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolPlane tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 16 : { - DeclareAndCast(IGESGeom_Point,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolPoint tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 17 : { - DeclareAndCast(IGESGeom_RuledSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolRuledSurface tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 18 : { - DeclareAndCast(IGESGeom_SplineCurve,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolSplineCurve tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 19 : { - DeclareAndCast(IGESGeom_SplineSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolSplineSurface tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 20 : { - DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolSurfaceOfRevolution tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 21 : { - DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolTabulatedCylinder tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 22 : { - DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolTransformationMatrix tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 23 : { - DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent); - if (anent.IsNull()) return; - IGESGeom_ToolTrimmedSurface tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - default : break; - } -} - - - Standard_Boolean IGESGeom_SpecificModule::OwnCorrect - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const -{ -// Applies only on some types - switch (CN) { - case 3 : { - DeclareAndCast(IGESGeom_Boundary,anent,ent); - if (anent.IsNull()) break; - IGESGeom_ToolBoundary tool; - return tool.OwnCorrect(anent); - } - case 7 : { - DeclareAndCast(IGESGeom_ConicArc,anent,ent); - if (anent.IsNull()) break; - IGESGeom_ToolConicArc tool; - return tool.OwnCorrect(anent); - } - case 9 : { - DeclareAndCast(IGESGeom_Boundary,anent,ent); - if (anent.IsNull()) break; - IGESGeom_ToolBoundary tool; - return tool.OwnCorrect(anent); - } - case 11 : { - DeclareAndCast(IGESGeom_Flash,anent,ent); - if (anent.IsNull()) break; - IGESGeom_ToolFlash tool; - return tool.OwnCorrect(anent); - } - case 13 : { - DeclareAndCast(IGESGeom_OffsetCurve,anent,ent); - if (anent.IsNull()) break; - IGESGeom_ToolOffsetCurve tool; - return tool.OwnCorrect(anent); - } - case 22 : { - DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent); - if (anent.IsNull()) break; - IGESGeom_ToolTransformationMatrix tool; - return tool.OwnCorrect(anent); - } - default : break; - } - return Standard_False; -} diff --git a/src/IGESGeom/IGESGeom_SpecificModule.hxx b/src/IGESGeom/IGESGeom_SpecificModule.hxx deleted file mode 100644 index 7e1d261b7f..0000000000 --- a/src/IGESGeom/IGESGeom_SpecificModule.hxx +++ /dev/null @@ -1,53 +0,0 @@ -// Created on: 1993-09-07 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGeom_SpecificModule_HeaderFile -#define _IGESGeom_SpecificModule_HeaderFile - -#include -#include - -#include -#include -#include -class IGESData_IGESEntity; -class IGESData_IGESDumper; -class Message_Messenger; - - -class IGESGeom_SpecificModule; -DEFINE_STANDARD_HANDLE(IGESGeom_SpecificModule, IGESData_SpecificModule) - -//! Defines Services attached to IGES Entities : -//! Dump & OwnCorrect, for IGESGeom -class IGESGeom_SpecificModule : public IGESData_SpecificModule -{ - public: - - //! Creates a SpecificModule from IGESGeom & puts it into SpecificLib - IGESGeom_SpecificModule() {} - - //! Specific Dump (own parameters) for IGESGeom - Standard_EXPORT void OwnDump (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const Standard_OVERRIDE; - - //! Performs non-ambiguous Correction on Entities which support - //! them (Boundary,ConicArc,Flash,OffsetCurve,TransformationMatrix) - Standard_EXPORT virtual Standard_Boolean OwnCorrect (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - - DEFINE_STANDARD_RTTIEXT(IGESGeom_SpecificModule,IGESData_SpecificModule) -}; - -#endif // _IGESGeom_SpecificModule_HeaderFile diff --git a/src/IGESGeom/IGESGeom_ToolBSplineCurve.cxx b/src/IGESGeom/IGESGeom_ToolBSplineCurve.cxx index 72aafcd5c6..40ee01d679 100644 --- a/src/IGESGeom/IGESGeom_ToolBSplineCurve.cxx +++ b/src/IGESGeom/IGESGeom_ToolBSplineCurve.cxx @@ -65,23 +65,7 @@ void IGESGeom_ToolBSplineCurve::ReadOwnParams(const Handle(IGESGeom_BSplineCurve Handle(TColStd_HArray1OfReal) allWeights; Handle(TColgp_HArray1OfXYZ) allPoles; - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - - //st = PR.ReadInteger(PR.Current(), Msg97, anIndex); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadInteger(PR.Current(), "Upper Index Of Sum", anIndex); - - //szv#4:S4163:12Mar99 optimized - /*if (st && anIndex >= 0) { - allPoles = new TColgp_HArray1OfXYZ(0, anIndex); - // allWeights = new TColStd_HArray1OfReal(1, anIndex+1); done by ReadReals - } - - if (st && anIndex < 0) - { - PR.SendFail(Msg97); - anIndex = 0; - }*/ - if (PR.ReadInteger(PR.Current(), anIndex)) { + if (PR.ReadInteger(anIndex)) { if (anIndex < 0) { Message_Msg Msg97("XSTEP_97"); PR.SendFail(Msg97); @@ -89,7 +73,6 @@ void IGESGeom_ToolBSplineCurve::ReadOwnParams(const Handle(IGESGeom_BSplineCurve } else { allPoles = new TColgp_HArray1OfXYZ(0, anIndex); - // allWeights = new TColStd_HArray1OfReal(1, anIndex+1); done by ReadReals } } else{ @@ -97,88 +80,62 @@ void IGESGeom_ToolBSplineCurve::ReadOwnParams(const Handle(IGESGeom_BSplineCurve PR.SendFail(Msg97); } - //st = PR.ReadInteger(PR.Current(), Msg98, aDegree); //szv#4:S4163:12Mar99 moved in if -// if (st && ! allWeights.IsNull() ) done by ReadReals -// allKnots = new TColStd_HArray1OfReal(-aDegree, anIndex+1); - if (!PR.ReadInteger(PR.Current(), aDegree)){ - aDegree = 0; //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadInteger(aDegree)){ + aDegree = 0; Message_Msg Msg98("XSTEP_98"); PR.SendFail(Msg98); } - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadBoolean(PR.Current(), Msg99, aPlanar); - PR.ReadBoolean(PR.Current(), Msg100, aClosed); - PR.ReadBoolean(PR.Current(), Msg101, aPolynomial); - PR.ReadBoolean(PR.Current(), Msg102, aPeriodic); - -//st = PR.ReadBoolean(PR.Current(), "Planar/Non Planar Flag", aPlanar); -//st = PR.ReadBoolean(PR.Current(), "Open/Closed Flag", aClosed); -//st = PR.ReadBoolean(PR.Current(), "Rational/Polynomial Flag", aPolynomial); -//st = PR.ReadBoolean(PR.Current(), "NonPeriodic/Periodic Flag", aPeriodic); + PR.ReadBoolean(Msg99, aPlanar); + PR.ReadBoolean(Msg100, aClosed); + PR.ReadBoolean(Msg101, aPolynomial); + PR.ReadBoolean(Msg102, aPeriodic); Standard_Integer nbKnots = anIndex + aDegree + 2; // Reading all the knot sequences - PR.ReadReals(PR.CurrentList(nbKnots), Msg103 , allKnots, -aDegree); //szv#4:S4163:12Mar99 `st=` not needed - -//st = PR.ReadReals -// (PR.CurrentList(nbKnots), "Knot sequence values", allKnots, -aDegree); + PR.ReadReals(PR.CurrentList(nbKnots), Msg103 , allKnots, -aDegree); if (! allPoles.IsNull() ) - { - Message_Msg Msg104("XSTEP_104"); - Message_Msg Msg105("XSTEP_105"); - PR.ReadReals(PR.CurrentList(anIndex+1), Msg104, allWeights,0); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadReals(PR.CurrentList(anIndex+1), "Weights", allWeights,0); - - for (Standard_Integer I = 0; I <= anIndex; I ++) - { - gp_XYZ tempPole; - //st = PR.ReadXYZ(PR.CurrentList(1, 3), Msg105, tempPole); //szv#4:S4163:12Mar99 moved down - //st = PR.ReadXYZ(PR.CurrentList(1, 3), "Control Points", tempPole); - if (PR.ReadXYZ(PR.CurrentList(1, 3), Msg105, tempPole)) allPoles->SetValue(I, tempPole); - } - } + { + Message_Msg Msg104("XSTEP_104"); + PR.ReadReals(PR.CurrentList(anIndex+1), Msg104, allWeights,0); + + for (Standard_Integer I = 0; I <= anIndex; I ++) + PR.ReadXYZ(allPoles->ChangeValue(I)); + } - if (!PR.ReadReal(PR.Current(), aUmin)){ + if (!PR.ReadReal(aUmin)){ Message_Msg Msg106("XSTEP_106"); PR.SendFail(Msg106); - } //szv#4:S4163:12Mar99 `st=` not needed - if (!PR.ReadReal(PR.Current(), aUmax)){ + } + if (!PR.ReadReal(aUmax)){ Message_Msg Msg107("XSTEP_107"); PR.SendFail(Msg107); - } //szv#4:S4163:12Mar99 `st=` not needed -/* - st = PR.ReadReal(PR.Current(), "Starting Parameter Value", aUmin); - st = PR.ReadReal(PR.Current(), "Ending Parameter Value", aUmax); -*/ + } Standard_Boolean st = Standard_False; if (PR.DefinedElseSkip()){ - st = PR.ReadReal(PR.Current(), normX); + st = PR.ReadReal(normX); if(!st){ Message_Msg Msg108("XSTEP_108"); PR.SendFail(Msg108); } } - //st = PR.ReadReal(PR.Current(), "Unit Normal X", normX); else normX = 0.; if (PR.DefinedElseSkip()){ - st = PR.ReadReal(PR.Current(), normY); + st = PR.ReadReal(normY); if(!st){ Message_Msg Msg108("XSTEP_108"); PR.SendFail(Msg108); } } - //st = PR.ReadReal(PR.Current(), "Unit Normal Y", normY); else normY = 0.; if (PR.DefinedElseSkip()){ - st = PR.ReadReal(PR.Current(), normZ); + st = PR.ReadReal(normZ); if(!st){ Message_Msg Msg108("XSTEP_108"); PR.SendFail(Msg108); } } - //st = PR.ReadReal(PR.Current(), "Unit Normal Z", normZ); else normZ = 0.; if (st) aNorm.SetCoord(normX,normY,normZ); diff --git a/src/IGESGeom/IGESGeom_ToolBSplineSurface.cxx b/src/IGESGeom/IGESGeom_ToolBSplineSurface.cxx index d01d961201..a6c1e0c995 100644 --- a/src/IGESGeom/IGESGeom_ToolBSplineSurface.cxx +++ b/src/IGESGeom/IGESGeom_ToolBSplineSurface.cxx @@ -62,70 +62,42 @@ void IGESGeom_ToolBSplineSurface::ReadOwnParams Standard_Boolean aCloseU, aCloseV, aPolynom, aPeriodU, aPeriodV; Standard_Real aUmin, aUmax, aVmin = 0., aVmax = 0.; Standard_Real tempVal; - gp_XYZ tempXYZ; Handle(TColStd_HArray1OfReal) allKnotsU; Handle(TColStd_HArray1OfReal) allKnotsV; Handle(TColStd_HArray2OfReal) allWeights; Handle(TColgp_HArray2OfXYZ) allPoles; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Boolean FlagindexU = PR.ReadInteger(PR.Current(), anIndexU); - - Standard_Boolean FlagindexV = PR.ReadInteger(PR.Current(), anIndexV); + Standard_Boolean FlagindexU = PR.ReadInteger(anIndexU); + Standard_Boolean FlagindexV = PR.ReadInteger(anIndexV); if (!FlagindexU || !FlagindexV){ Message_Msg Msg97("XSTEP_97"); PR.SendFail(Msg97); } - Standard_Boolean FlagdegU = PR.ReadInteger(PR.Current(), aDegU); - - Standard_Boolean FlagdegV = PR.ReadInteger(PR.Current(), aDegV); + Standard_Boolean FlagdegU = PR.ReadInteger(aDegU); + Standard_Boolean FlagdegV = PR.ReadInteger(aDegV); if (!FlagdegU || !FlagdegV){ Message_Msg Msg98("XSTEP_98"); PR.SendFail(Msg98); } - //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadBoolean(PR.Current(), Msg100,aCloseU); - PR.ReadBoolean(PR.Current(), Msg100,aCloseV); - PR.ReadBoolean(PR.Current(), Msg101, aPolynom); - PR.ReadBoolean(PR.Current(), Msg102, aPeriodU); - PR.ReadBoolean(PR.Current(), Msg102, aPeriodV); - -/* - Standard_Boolean FlagindexU = - PR.ReadInteger(PR.Current(), "Upper Index in U", anIndexU); - - Standard_Boolean FlagindexV = - PR.ReadInteger(PR.Current(), "Upper Index in V", anIndexV); - - Standard_Boolean FlagdegU = - PR.ReadInteger(PR.Current(), "Degree Of First Basis Functions", aDegU); + PR.ReadBoolean(Msg100,aCloseU); + PR.ReadBoolean(Msg100,aCloseV); + PR.ReadBoolean(Msg101, aPolynom); + PR.ReadBoolean(Msg102, aPeriodU); + PR.ReadBoolean(Msg102, aPeriodV); - Standard_Boolean FlagdegV = - PR.ReadInteger(PR.Current(), "Degree Of Second Basis Functions",aDegV); - - st = PR.ReadBoolean(PR.Current(), "Closed/Open flag in U Direction",aCloseU); - st = PR.ReadBoolean(PR.Current(), "Closed/Open flag in V Direction",aCloseV); - st = PR.ReadBoolean(PR.Current(), "Polynomial / Rational", aPolynom); - st = PR.ReadBoolean(PR.Current(), "Periodic flag in U direction", aPeriodU); - st = PR.ReadBoolean(PR.Current(), "Periodic flag in V direction", aPeriodV); -*/ if ( FlagdegU && FlagindexU ) { -// allKnotsU = new TColStd_HArray1OfReal(-aDegU, anIndexU+1); done by : Standard_Integer tempind = anIndexU+aDegU+2; PR.ReadReals(PR.CurrentList(tempind), Msg103, allKnotsU, -aDegU); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadReals(PR.CurrentList(tempind), "First knot sequence values", allKnotsU, -aDegU); } if ( FlagdegV && FlagindexV ) { -// allKnotsV = new TColStd_HArray1OfReal(-aDegV, anIndexV+1); done by : Standard_Integer tempind = anIndexV+aDegV+2; PR.ReadReals(PR.CurrentList(tempind), Msg103, allKnotsV, -aDegV); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadReals(PR.CurrentList(tempind), "Second knot sequence values", allKnotsV, -aDegV); } if ( FlagindexU && FlagindexV ) @@ -134,13 +106,10 @@ void IGESGeom_ToolBSplineSurface::ReadOwnParams allPoles = new TColgp_HArray2OfXYZ (0, anIndexU, 0, anIndexV); Standard_Boolean BadWeigth = Standard_False; - Message_Msg Msg105("XSTEP_105"); for (J = 0; J <= anIndexV; J ++) { for (I = 0; I <= anIndexU; I ++) { - //st = PR.ReadReal(PR.Current(), Msg104, tempVal); //szv#4:S4163:12Mar99 moved down - //st = PR.ReadReal(PR.Current(), "Weights", tempVal); - if (PR.ReadReal(PR.Current(), tempVal)) { + if (PR.ReadReal(tempVal)) { if(tempValSetValue(I, J, tempXYZ); + PR.ReadXYZ(allPoles->ChangeValue(I, J)); } } - //szv#4:S4163:12Mar99 `st=` not needed - /* PR.ReadReal(PR.Current(), Msg106, aUmin); - PR.ReadReal(PR.Current(), Msg107, aUmax); - PR.ReadReal(PR.Current(), Msg106, aVmin); - PR.ReadReal(PR.Current(), Msg107, aVmax); -*/ - if (!PR.ReadReal(PR.Current(), aUmin) || !PR.ReadReal(PR.Current(), aVmin)){ + if (!PR.ReadReal(aUmin) || !PR.ReadReal(aVmin)){ Message_Msg Msg106("XSTEP_106"); PR.SendFail(Msg106); } - if (!PR.ReadReal(PR.Current(), aUmax) || !PR.ReadReal(PR.Current(), aVmax)){ + if (!PR.ReadReal(aUmax) || !PR.ReadReal(aVmax)){ Message_Msg Msg107("XSTEP_107"); PR.SendFail(Msg107); } -/* - st = PR.ReadReal(PR.Current(), "Starting Value For U Direction", aUmin); - st = PR.ReadReal(PR.Current(), "Ending Value For U Direction", aUmax); - st = PR.ReadReal(PR.Current(), "Starting Value For V Direction", aVmin); - st = PR.ReadReal(PR.Current(), "Ending Value For U Direction", aVmax); -*/ // PROTECTION contre ANSYS 5.3 qui ecrit 3 flottants en plus ... Standard_Integer icur = PR.CurrentNumber(), imax = PR.NbParams(); Standard_Real bid; Standard_Integer pbfin = 0; - //st = Standard_True; //szv#4:S4163:12Mar99 not needed while (imax >= icur) { Interface_ParamType pt = PR.ParamType(icur); if (pt == Interface_ParamReal) { - if (!PR.ReadReal (PR.Current(),bid)){ - PR.SendFail(Msg159); - } //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadReal(bid)) { + PR.SendFail(Msg159); + } if (pbfin == 0) pbfin = 1; } else if (pt == Interface_ParamInteger || pt == Interface_ParamVoid) break; diff --git a/src/IGESGeom/IGESGeom_ToolBoundary.cxx b/src/IGESGeom/IGESGeom_ToolBoundary.cxx index 0b5b42c018..085f3f41e5 100644 --- a/src/IGESGeom/IGESGeom_ToolBoundary.cxx +++ b/src/IGESGeom/IGESGeom_ToolBoundary.cxx @@ -49,10 +49,7 @@ void IGESGeom_ToolBoundary::ReadOwnParams(const Handle(IGESGeom_Boundary)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - // MGE 30/07/98 - - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer num; //szv#4:S4163:12Mar99 j not needed, i moved down in `for` + Standard_Integer num; Standard_Integer tempType, tempPreference; Handle(IGESData_IGESEntity) tempSurface; Handle(TColStd_HArray1OfInteger) tempSenses; @@ -60,17 +57,16 @@ void IGESGeom_ToolBoundary::ReadOwnParams(const Handle(IGESGeom_Boundary)& ent, Handle(IGESBasic_HArray1OfHArray1OfIGESEntity) tempParameterCurves; IGESData_Status aStatus; - //szv#4:S4163:12Mar99 `st=` not needed - if (!PR.ReadInteger(PR.Current(), tempType)){ + if (!PR.ReadInteger(tempType)) { Message_Msg Msg122("XTSEP_122"); PR.SendFail(Msg122); } - if (!PR.ReadInteger(PR.Current(), tempPreference)){ + if (!PR.ReadInteger(tempPreference)) { Message_Msg Msg123("XTSEP_123"); PR.SendFail(Msg123); } - if (!PR.ReadEntity(IR, PR.Current(), aStatus, tempSurface)){ + if (!PR.ReadEntity(IR, aStatus, tempSurface)) { Message_Msg Msg124("XTSEP_124"); switch(aStatus) { case IGESData_ReferenceError: { @@ -88,7 +84,7 @@ void IGESGeom_ToolBoundary::ReadOwnParams(const Handle(IGESGeom_Boundary)& ent, } } - if (PR.ReadInteger(PR.Current(), num) && (num > 0)) { + if (PR.ReadInteger(num) && (num > 0)) { tempSenses = new TColStd_HArray1OfInteger(1, num); tempModelCurves = new IGESData_HArray1OfIGESEntity(1, num); tempParameterCurves = new IGESBasic_HArray1OfHArray1OfIGESEntity(1, num); @@ -99,12 +95,10 @@ void IGESGeom_ToolBoundary::ReadOwnParams(const Handle(IGESGeom_Boundary)& ent, } if (!tempSenses.IsNull() && !tempModelCurves.IsNull() && !tempParameterCurves.IsNull() ) { - for ( Standard_Integer i = 1; i <= num; i++ ) //szv#4:S4163:12Mar99 Standard_Integer moved in `for` + for ( Standard_Integer i = 1; i <= num; i++ ) { Handle(IGESData_IGESEntity) tempEnt; - //st = PR.ReadEntity(IR, PR.Current(), Msg127, tempEnt); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadEntity(IR, PR.Current(), "Model Space Curves", tempEnt); - if (PR.ReadEntity(IR, PR.Current(), aStatus, tempEnt)) + if (PR.ReadEntity(IR, aStatus, tempEnt)) tempModelCurves->SetValue(i, tempEnt); else { Message_Msg Msg127("XTSEP_127"); @@ -125,9 +119,7 @@ void IGESGeom_ToolBoundary::ReadOwnParams(const Handle(IGESGeom_Boundary)& ent, } Standard_Integer tempSense; - //st = PR.ReadInteger(PR.Current(), Msg128, tempSense); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadInteger(PR.Current(), "Orientation flags", tempSense); - if (PR.ReadInteger(PR.Current(), tempSense)) + if (PR.ReadInteger(tempSense)) tempSenses->SetValue(i, tempSense); else{ Message_Msg Msg128("XTSEP_128"); @@ -135,40 +127,11 @@ void IGESGeom_ToolBoundary::ReadOwnParams(const Handle(IGESGeom_Boundary)& ent, } Standard_Integer tempCount; - //st = PR.ReadInteger(PR.Current(), Msg129, tempCount); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadInteger(PR.Current(), "Count of Parameter Space Curves", tempCount); - //szv#4:S4163:12Mar99 optimized -/* - if (st && tempCount >= 0) - { - Handle(IGESData_HArray1OfIGESEntity) tempParCurves; - if (tempCount > 0) - st = PR.ReadEnts (IR,PR.CurrentList(tempCount), Msg130, tempParCurves); - //st = PR.ReadEnts (IR,PR.CurrentList(tempCount), "Parameter Space Curves", tempParCurves); -*/ -/* - { - tempParCurves = new - IGESData_HArray1OfIGESEntity(1, tempCount); - for ( j = 1; j <= tempCount; j++ ) { - Handle(IGESData_IGESEntity) tempEnt; - st = PR.ReadEntity(IR, PR.Current(), - "Parameter Space Curves", tempEnt); - if (st) tempParCurves->SetValue(j, tempEnt); - } - } -*/ -/* - tempParameterCurves->SetValue(i, tempParCurves); - } - if (st && tempCount < 0) - PR.SendFail(Msg129); -*/ - if (PR.ReadInteger(PR.Current(), tempCount) && (tempCount >= 0)) { + if (PR.ReadInteger(tempCount) && (tempCount >= 0)) { Handle(IGESData_HArray1OfIGESEntity) tempParCurves; if (tempCount > 0){ Message_Msg Msg130("XTSEP_130"); - PR.ReadEnts (IR,PR.CurrentList(tempCount), Msg130, tempParCurves); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEnts (IR,PR.CurrentList(tempCount), Msg130, tempParCurves); } tempParameterCurves->SetValue(i, tempParCurves); } diff --git a/src/IGESGeom/IGESGeom_ToolBoundedSurface.cxx b/src/IGESGeom/IGESGeom_ToolBoundedSurface.cxx index a22b63e52c..9e1ca6ba71 100644 --- a/src/IGESGeom/IGESGeom_ToolBoundedSurface.cxx +++ b/src/IGESGeom/IGESGeom_ToolBoundedSurface.cxx @@ -56,12 +56,11 @@ void IGESGeom_ToolBoundedSurface::ReadOwnParams(const Handle(IGESGeom_BoundedSur Handle(IGESGeom_HArray1OfBoundary) tempBounds; IGESData_Status aStatus; - //szv#4:S4163:12Mar99 `st=` not needed - if (!PR.ReadInteger(PR.Current(), tempType)){ + if (!PR.ReadInteger(tempType)) { Message_Msg Msg165("XTSEP_165"); PR.SendFail(Msg165); } - if (!PR.ReadEntity(IR, PR.Current(), aStatus, tempSurface)){ + if (!PR.ReadEntity(IR, aStatus, tempSurface)) { Message_Msg Msg166("XTSEP_166"); switch(aStatus) { case IGESData_ReferenceError: { @@ -78,17 +77,8 @@ void IGESGeom_ToolBoundedSurface::ReadOwnParams(const Handle(IGESGeom_BoundedSur } } } - //st = PR.ReadInteger(PR.Current(), Msg167, num); //szv#4:S4163:12Mar99 moved in if -/* - st = PR.ReadInteger(PR.Current(), "Bounded Surface Representation Type", tempType); - st = PR.ReadEntity(IR, PR.Current(), "Surface to be Bounded", tempSurface); - st = PR.ReadInteger(PR.Current(), "Number Of Boundary Entities", num); -*/ - - //szv#4:S4163:12Mar99 optimized - //if (st && num > 0) tempBounds = new IGESGeom_HArray1OfBoundary(1, num); - //if (st && num <= 0) PR.SendFail(Msg167); - if (PR.ReadInteger(PR.Current(), num) && (num > 0)) { + + if (PR.ReadInteger(num) && (num > 0)) { tempBounds = new IGESGeom_HArray1OfBoundary(1, num); } else{ @@ -100,9 +90,7 @@ void IGESGeom_ToolBoundedSurface::ReadOwnParams(const Handle(IGESGeom_BoundedSur for ( i = 1; i <= num; i++ ) { Handle(IGESData_IGESEntity) tempEnt; - //st = PR.ReadEntity(IR, PR.Current(), Msg168, tempEnt); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadEntity(IR, PR.Current(), "Boundary Entities", tempEnt); - if (PR.ReadEntity(IR, PR.Current(), aStatus, tempEnt)) + if (PR.ReadEntity(IR, aStatus, tempEnt)) tempBounds->SetValue(i, Handle(IGESGeom_Boundary)::DownCast (tempEnt)); else{ Message_Msg Msg168("XTSEP_168"); diff --git a/src/IGESGeom/IGESGeom_ToolCircularArc.cxx b/src/IGESGeom/IGESGeom_ToolCircularArc.cxx index 3f73c038dc..2cbb525f8e 100644 --- a/src/IGESGeom/IGESGeom_ToolCircularArc.cxx +++ b/src/IGESGeom/IGESGeom_ToolCircularArc.cxx @@ -42,37 +42,20 @@ void IGESGeom_ToolCircularArc::ReadOwnParams (const Handle(IGESGeom_CircularArc)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - // MGE 28/07/98 - // Building of messages - //===================================== - Message_Msg Msg76("XSTEP_76"); - Message_Msg Msg77("XSTEP_77"); - Message_Msg Msg78("XSTEP_78"); - //===================================== - Standard_Real aZT; gp_XY aCenter, aStart, anEnd; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed // MGE 28/07/98 - if (!PR.ReadReal(PR.Current(), aZT)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadReal(aZT)) { Message_Msg Msg75("XSTEP_75"); PR.SendFail(Msg75); } - PR.ReadXY(PR.CurrentList(1, 2), Msg76, aCenter); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadXY(PR.CurrentList(1, 2), Msg77, aStart); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadXY(PR.CurrentList(1, 2), Msg78, anEnd); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadXY(aCenter); + PR.ReadXY(aStart); + PR.ReadXY(anEnd); -/* - st = PR.ReadReal(PR.Current(), "Shift above z-plane", aZT); - st = PR.ReadXY(PR.CurrentList(1, 2), "Center Of Arc", aCenter); - st = PR.ReadXY(PR.CurrentList(1, 2), "Start Point Of Arc", aStart); - st = PR.ReadXY(PR.CurrentList(1, 2), "End Point Of Arc", anEnd); -*/ - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(aZT, aCenter, aStart, anEnd); - } void IGESGeom_ToolCircularArc::WriteOwnParams diff --git a/src/IGESGeom/IGESGeom_ToolCompositeCurve.cxx b/src/IGESGeom/IGESGeom_ToolCompositeCurve.cxx index edf84f5c24..b6f7d0dda0 100644 --- a/src/IGESGeom/IGESGeom_ToolCompositeCurve.cxx +++ b/src/IGESGeom/IGESGeom_ToolCompositeCurve.cxx @@ -40,21 +40,14 @@ void IGESGeom_ToolCompositeCurve::ReadOwnParams (const Handle(IGESGeom_CompositeCurve)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - // MGE 28/07/98 - // Building of messages - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down Handle(IGESData_HArray1OfIGESEntity) tempEntities; - Standard_Integer num; //szv#4:S4163:12Mar99 i not needed - - Standard_Boolean st = PR.ReadInteger(PR.Current(), num); - // st = PR.ReadInteger(PR.Current(), "Number of Components", num); + Standard_Integer num; + Standard_Boolean st = PR.ReadInteger(num); if (st && (num > 0)){ Message_Msg Msg80("XSTEP_80"); - PR.ReadEnts (IR,PR.CurrentList(num),Msg80,tempEntities); //szv#4:S4163:12Mar99 `st=` not needed - //else st = PR.ReadEnts (IR,PR.CurrentList(num),"List of Components",tempEntities); + PR.ReadEnts (IR,PR.CurrentList(num),Msg80,tempEntities); } - //if (st && num <= 0) PR.SendFail(Msg79); else{ Message_Msg Msg79("XSTEP_79"); PR.SendFail(Msg79); diff --git a/src/IGESGeom/IGESGeom_ToolConicArc.cxx b/src/IGESGeom/IGESGeom_ToolConicArc.cxx index 7a8e12d71a..bc387a719b 100644 --- a/src/IGESGeom/IGESGeom_ToolConicArc.cxx +++ b/src/IGESGeom/IGESGeom_ToolConicArc.cxx @@ -48,49 +48,23 @@ void IGESGeom_ToolConicArc::ReadOwnParams(const Handle(IGESGeom_ConicArc)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - // MGE 28/07/98 - // Building of messages - //====================================== - Message_Msg Msg83("XSTEP_83"); - Message_Msg Msg84("XSTEP_84"); - //====================================== - - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Real A, B = 0., C = 0., D = 0., E = 0., F = 0., ZT; gp_XY tempStart, tempEnd; - /* PR.ReadReal(PR.Current(), Msg81, A); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadReal(PR.Current(), Msg81, B); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadReal(PR.Current(), Msg81, C); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadReal(PR.Current(), Msg81, D); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadReal(PR.Current(), Msg81, E); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadReal(PR.Current(), Msg81, F); //szv#4:S4163:12Mar99 `st=` not needed - */ - if ((!PR.ReadReal(PR.Current(),A)) || (!PR.ReadReal(PR.Current(),B)) || - (!PR.ReadReal(PR.Current(),C)) || (!PR.ReadReal(PR.Current(),D)) || - (!PR.ReadReal(PR.Current(),E)) || (!PR.ReadReal(PR.Current(),F))){ + if ((!PR.ReadReal(A)) || (!PR.ReadReal(B)) || + (!PR.ReadReal(C)) || (!PR.ReadReal(D)) || + (!PR.ReadReal(E)) || (!PR.ReadReal(F))){ Message_Msg Msg81("XSTEP_81"); PR.SendFail(Msg81); } - if (!PR.ReadReal(PR.Current(), ZT)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadReal(ZT)) { Message_Msg Msg82("XSTEP_82"); PR.SendFail(Msg82); } - PR.ReadXY(PR.CurrentList(1, 2),Msg83, tempStart); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadXY(PR.CurrentList(1, 2), Msg84, tempEnd); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadXY(tempStart); + PR.ReadXY(tempEnd); -/* - st = PR.ReadReal(PR.Current(), "Conic Coefficient A", A); - st = PR.ReadReal(PR.Current(), "Conic Coefficient B", B); - st = PR.ReadReal(PR.Current(), "Conic Coefficient C", C); - st = PR.ReadReal(PR.Current(), "Conic Coefficient D", D); - st = PR.ReadReal(PR.Current(), "Conic Coefficient E", E); - st = PR.ReadReal(PR.Current(), "Conic Coefficient F", F); - st = PR.ReadReal(PR.Current(), "Z-plane shift", ZT); - st = PR.ReadXY(PR.CurrentList(1, 2), "Starting Point Of Arc", tempStart); - st = PR.ReadXY(PR.CurrentList(1, 2), "End Point Of Arc", tempEnd); -*/ DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(A, B, C, D, E, F, ZT, tempStart, tempEnd); } diff --git a/src/IGESGeom/IGESGeom_ToolCopiousData.cxx b/src/IGESGeom/IGESGeom_ToolCopiousData.cxx index 0005aa8438..1fe22607f8 100644 --- a/src/IGESGeom/IGESGeom_ToolCopiousData.cxx +++ b/src/IGESGeom/IGESGeom_ToolCopiousData.cxx @@ -45,25 +45,19 @@ void IGESGeom_ToolCopiousData::ReadOwnParams(const Handle(IGESGeom_CopiousData)& const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - // MGE 28/07/98 - // Building of messages - Standard_Integer aDataType, nbData; Standard_Real aZPlane = 0; Handle(TColStd_HArray1OfReal) allData; Standard_Integer upper; - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down Standard_Boolean data = Standard_False; - if (!PR.ReadInteger(PR.Current(), aDataType)){ //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadInteger(PR.Current(), "Data Type", aDataType); + if (!PR.ReadInteger(aDataType)) { Message_Msg Msg85("XSTEP_85"); PR.SendFail(Msg85); } - Standard_Boolean st = PR.ReadInteger(PR.Current(), nbData); - //st = PR.ReadInteger(PR.Current(), "Number of n-tuples", nbData); + Standard_Boolean st = PR.ReadInteger(nbData); if (st && (nbData > 0)) data = Standard_True; else { Message_Msg Msg86("XSTEP_86"); @@ -71,11 +65,10 @@ void IGESGeom_ToolCopiousData::ReadOwnParams(const Handle(IGESGeom_CopiousData)& } if (aDataType == 1){ - if (!PR.ReadReal(PR.Current(), aZPlane)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadReal(aZPlane)) { Message_Msg Msg87("XSTEP_87"); PR.SendFail(Msg87); } - //if (aDataType == 1) st = PR.ReadReal(PR.Current(), "Z Plane", aZPlane); } if ( data ) @@ -85,9 +78,7 @@ void IGESGeom_ToolCopiousData::ReadOwnParams(const Handle(IGESGeom_CopiousData)& else upper = 6*nbData; Message_Msg Msg88("XSTEP_88"); - //allData = new TColStd_HArray1OfReal(1, upper) then fill it : - PR.ReadReals(PR.CurrentList(upper),Msg88, allData); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadReals(PR.CurrentList(upper), "Tuples", allData); + PR.ReadReals(PR.CurrentList(upper),Msg88, allData); } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); diff --git a/src/IGESGeom/IGESGeom_ToolCurveOnSurface.cxx b/src/IGESGeom/IGESGeom_ToolCurveOnSurface.cxx index 456d89333f..7a72e180a1 100644 --- a/src/IGESGeom/IGESGeom_ToolCurveOnSurface.cxx +++ b/src/IGESGeom/IGESGeom_ToolCurveOnSurface.cxx @@ -53,13 +53,11 @@ void IGESGeom_ToolCurveOnSurface::ReadOwnParams Handle(IGESData_IGESEntity) aCurve3D; IGESData_Status aStatus; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - if (!PR.ReadInteger(PR.Current(), aMode)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadInteger(aMode)) { Message_Msg Msg276("XSTEP_276"); PR.SendFail(Msg276); } - if (!PR.ReadEntity(IR, PR.Current(),aStatus, aSurface)){ + if (!PR.ReadEntity(IR, aStatus, aSurface)) { Message_Msg Msg131("XSTEP_131"); switch(aStatus) { case IGESData_ReferenceError: { @@ -75,9 +73,9 @@ void IGESGeom_ToolCurveOnSurface::ReadOwnParams default:{ } } - } //szv#4:S4163:12Mar99 `st=` not needed + } - if (!PR.ReadEntity(IR, PR.Current(), aStatus, aCurveUV, Standard_True)){ + if (!PR.ReadEntity(IR, aStatus, aCurveUV, Standard_True)) { Message_Msg Msg132("XSTEP_132"); switch(aStatus) { case IGESData_ReferenceError: { @@ -93,8 +91,8 @@ void IGESGeom_ToolCurveOnSurface::ReadOwnParams default:{ } } - } //szv#4:S4163:12Mar99 `st=` not needed - if (!PR.ReadEntity(IR, PR.Current(), aStatus, aCurve3D, Standard_True)){; //szv#4:S4163:12Mar99 `st=` not needed + } + if (!PR.ReadEntity(IR, aStatus, aCurve3D, Standard_True)) {; Message_Msg Msg133("XSTEP_133"); switch(aStatus) { case IGESData_ReferenceError: { @@ -111,17 +109,10 @@ void IGESGeom_ToolCurveOnSurface::ReadOwnParams } } } - if (!PR.ReadInteger(PR.Current(), aPreference)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadInteger(aPreference)) { Message_Msg Msg277("XSTEP_277"); PR.SendFail(Msg277); } -/* - st = PR.ReadInteger(PR.Current(), "Creation mode of curve", aMode); - st = PR.ReadEntity(IR, PR.Current(), "Surface (on which curve lies)", aSurface); - st = PR.ReadEntity(IR, PR.Current(), "Curve UV", aCurveUV, Standard_True); - st = PR.ReadEntity(IR, PR.Current(), "Curve 3D", aCurve3D, Standard_True); - st = PR.ReadInteger(PR.Current(), "Preferred representation", aPreference); -*/ DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init (aMode, aSurface, aCurveUV, aCurve3D, aPreference); diff --git a/src/IGESGeom/IGESGeom_ToolDirection.cxx b/src/IGESGeom/IGESGeom_ToolDirection.cxx index 6be8171440..f9505acc89 100644 --- a/src/IGESGeom/IGESGeom_ToolDirection.cxx +++ b/src/IGESGeom/IGESGeom_ToolDirection.cxx @@ -42,19 +42,16 @@ void IGESGeom_ToolDirection::ReadOwnParams { gp_XYZ aDirection; gp_XY tmpXY; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Real tmpReal; - //st = PR.ReadXY(PR.CurrentList(1, 2), "Direction", tmpXY); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadXY(PR.CurrentList(1, 2), "Direction", tmpXY)) { + if (PR.ReadXY(tmpXY,"Direction")) { aDirection.SetX(tmpXY.X()); aDirection.SetY(tmpXY.Y()); } if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Direction", tmpReal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Direction", tmpReal)) + if (PR.ReadReal(tmpReal,"Direction")) aDirection.SetZ(tmpReal); } else diff --git a/src/IGESGeom/IGESGeom_ToolFlash.cxx b/src/IGESGeom/IGESGeom_ToolFlash.cxx index 172e93fc78..6e69635edc 100644 --- a/src/IGESGeom/IGESGeom_ToolFlash.cxx +++ b/src/IGESGeom/IGESGeom_ToolFlash.cxx @@ -46,34 +46,33 @@ void IGESGeom_ToolFlash::ReadOwnParams Handle(IGESData_IGESEntity) aReference; Standard_Integer fn = ent->FormNumber(); // for default cases - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed aDim1 = aDim2 = aRotation = 0.; // default values // Reading reference of flash - PR.ReadXY(PR.CurrentList(1, 2), "Reference of Flash", aPoint); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadXY(aPoint,"Reference of Flash"); // Reading first flash sizing parameter if (PR.DefinedElseSkip()) - PR.ReadReal(PR.Current(), "First Flash sizing parameter", aDim1); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(aDim1,"First Flash sizing parameter"); else if (fn > 0) PR.AddFail("Fist Flash sizing parameter : undefined"); // Reading second flash sizing parameter if (PR.DefinedElseSkip()) - PR.ReadReal(PR.Current(), "Second Flash sizing parameter", aDim2); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(aDim2,"Second Flash sizing parameter"); else { if (fn > 1) PR.AddFail("Second Flash sizing parameter : not defined"); } // Reading rotation of flash about reference point if (PR.DefinedElseSkip()) - PR.ReadReal(PR.Current(), "Rotation about ref. point", aRotation); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(aRotation,"Rotation about ref. point"); else { if (fn == 2 || fn == 4) PR.AddFail("Rotation about ref. point : not defined"); } if ( PR.IsParamEntity(PR.CurrentNumber()) ) // Reading the referenced entity - PR.ReadEntity(IR, PR.Current(), "Referenced entity", aReference); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Referenced entity", aReference); // "else" not necessary as this is the last field DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); diff --git a/src/IGESGeom/IGESGeom_ToolLine.cxx b/src/IGESGeom/IGESGeom_ToolLine.cxx index f3faa1c46d..5b7a910ae6 100644 --- a/src/IGESGeom/IGESGeom_ToolLine.cxx +++ b/src/IGESGeom/IGESGeom_ToolLine.cxx @@ -40,23 +40,11 @@ void IGESGeom_ToolLine::ReadOwnParams (const Handle(IGESGeom_Line)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - // MGE 29/07/98 - // Building of messages - //==================================== - Message_Msg Msg89("XSTEP_89"); - Message_Msg Msg90("XSTEP_90"); - //==================================== - gp_XYZ aStart, anEnd; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - PR.ReadXYZ(PR.CurrentList(1, 3),Msg89, aStart); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadXYZ(PR.CurrentList(1, 3), Msg90, anEnd); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadXYZ(aStart); + PR.ReadXYZ(anEnd); - /* st = PR.ReadXYZ(PR.CurrentList(1, 3), "Starting Point", aStart); - st = PR.ReadXYZ(PR.CurrentList(1, 3), "End Point", anEnd); - */ DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(aStart, anEnd); } diff --git a/src/IGESGeom/IGESGeom_ToolOffsetCurve.cxx b/src/IGESGeom/IGESGeom_ToolOffsetCurve.cxx index 7ff234b7b1..faa4764be3 100644 --- a/src/IGESGeom/IGESGeom_ToolOffsetCurve.cxx +++ b/src/IGESGeom/IGESGeom_ToolOffsetCurve.cxx @@ -49,12 +49,6 @@ void IGESGeom_ToolOffsetCurve::ReadOwnParams(const Handle(IGESGeom_OffsetCurve)& const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - // MGE 30/07/98 - // Building of messages - //======================================== - Message_Msg Msg121("XSTEP_121"); - //======================================== - Standard_Integer anOffsetType, aFunctionCoord, aTaperedOffsetType; Standard_Real offDistance1, offDistance2; Standard_Real arcLength1, arcLength2, anOffsetParam, anotherOffsetParam; @@ -62,10 +56,9 @@ void IGESGeom_ToolOffsetCurve::ReadOwnParams(const Handle(IGESGeom_OffsetCurve)& Handle(IGESData_IGESEntity) aBaseCurve; Handle(IGESData_IGESEntity) aFunction; IGESData_Status aStatus; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed // Reading the curve entity to be offset - if (!PR.ReadEntity(IR, PR.Current(), aStatus, aBaseCurve)){ + if (!PR.ReadEntity(IR, aStatus, aBaseCurve)) { Message_Msg Msg110("XSTEP_110"); switch(aStatus) { case IGESData_ReferenceError: { @@ -81,18 +74,16 @@ void IGESGeom_ToolOffsetCurve::ReadOwnParams(const Handle(IGESGeom_OffsetCurve)& default:{ } } - } //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadEntity(IR, PR.Current(), "Curve to be offset", aBaseCurve); + } // Reading the offset distance flag - if (!PR.ReadInteger(PR.Current(), anOffsetType)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadInteger(anOffsetType)) { Message_Msg Msg111("XSTEP_111"); PR.SendFail(Msg111); } - //st = PR.ReadInteger(PR.Current(), "Offset Distance Flag", anOffsetType); // Reading the curve entity describing the offset as a function, can be Null - if (!PR.ReadEntity(IR, PR.Current(), aStatus, aFunction, Standard_True)){ + if (!PR.ReadEntity(IR, aStatus, aFunction, Standard_True)) { Message_Msg Msg112("XSTEP_112"); switch(aStatus) { case IGESData_ReferenceError: { @@ -108,74 +99,61 @@ void IGESGeom_ToolOffsetCurve::ReadOwnParams(const Handle(IGESGeom_OffsetCurve)& default:{ } } - } //szv#4:S4163:12Mar99 `st=` not needed -/* - st = PR.ReadEntity(IR, PR.Current(), "Curve whose coordinate describes the offset", aFunction, Standard_True); -*/ + } // Reading the coordinate describing the offset as a function - if (!PR.ReadInteger(PR.Current(), aFunctionCoord)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadInteger(aFunctionCoord)) { Message_Msg Msg113("XSTEP_113"); PR.SendFail(Msg113); } - //st = PR.ReadInteger(PR.Current(), "Coordinate of the curve", aFunctionCoord); // Reading the tapered offset type flag - if (!PR.ReadInteger(PR.Current(), aTaperedOffsetType)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadInteger(aTaperedOffsetType)) { Message_Msg Msg114("XSTEP_114"); PR.SendFail(Msg114); } - //st = PR.ReadInteger(PR.Current(), "Tapered offset type flag", aTaperedOffsetType); // Reading the first offset distance - if (!PR.ReadReal(PR.Current(), offDistance1)){ + if (!PR.ReadReal(offDistance1)){ Message_Msg Msg115("XSTEP_115"); PR.SendFail(Msg115); - } //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadReal(PR.Current(), "First Offset distance", offDistance1); + } // Reading the arc length or parameter value of the first offset distance - if (!PR.ReadReal(PR.Current(), arcLength1)){ + if (!PR.ReadReal(arcLength1)){ Message_Msg Msg116("XSTEP_116"); PR.SendFail(Msg116); - } //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadReal(PR.Current(), "Arc length of first offset distance", arcLength1); + } // Reading the second offset distance - if (!PR.ReadReal(PR.Current(),offDistance2)){ + if (!PR.ReadReal(offDistance2)){ Message_Msg Msg117("XSTEP_117"); PR.SendFail(Msg117); - } //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadReal(PR.Current(), "Second Offset distance", offDistance2); + } // Reading the arc length or parameter value of the second offset distance - if (!PR.ReadReal(PR.Current(), arcLength2)){ + if (!PR.ReadReal(arcLength2)){ Message_Msg Msg118("XSTEP_118"); PR.SendFail(Msg118); - } //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadReal(PR.Current(), "Arc length of Second offset distance", arcLength2); + } // Reading the Unit vector normal to plane - PR.ReadXYZ (PR.CurrentList(1, 3), Msg121, aNormalVec); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadXYZ (PR.CurrentList(1, 3), "Unit vector normal to plane", aNormalVec); + PR.ReadXYZ(aNormalVec); // Reading the offset curve starting parameter value - if (!PR.ReadReal(PR.Current(), anOffsetParam)){ + if (!PR.ReadReal(anOffsetParam)){ Message_Msg Msg119("XSTEP_119"); PR.SendFail(Msg119); - } //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadReal(PR.Current(), "Starting parameter value of Offset curve", anOffsetParam); + } // Reading the offset curve ending parameter value - if (!PR.ReadReal(PR.Current(), anotherOffsetParam)){ + if (!PR.ReadReal(anotherOffsetParam)){ Message_Msg Msg120("XSTEP_120"); PR.SendFail(Msg120); - } //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadReal(PR.Current(), "Ending parameter value of Offset curve", anotherOffsetParam); + } // Reading the Unit vector normal to plane - PR.ReadXYZ (PR.CurrentList(1, 3), Msg121, aNormalVec); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadXYZ (PR.CurrentList(1, 3), "Unit vector normal to plane", aNormalVec); + PR.ReadXYZ(aNormalVec); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init diff --git a/src/IGESGeom/IGESGeom_ToolOffsetSurface.cxx b/src/IGESGeom/IGESGeom_ToolOffsetSurface.cxx index d047e1b87f..0db8504859 100644 --- a/src/IGESGeom/IGESGeom_ToolOffsetSurface.cxx +++ b/src/IGESGeom/IGESGeom_ToolOffsetSurface.cxx @@ -42,27 +42,20 @@ void IGESGeom_ToolOffsetSurface::ReadOwnParams (const Handle(IGESGeom_OffsetSurface)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - // MGE 31/07/98 - // Building of messages - //======================================== - Message_Msg Msg162("XSTEP_162"); - //======================================== - gp_XYZ anIndicator; Standard_Real aDistance; Handle(IGESData_IGESEntity) aSurface; IGESData_Status aStatus; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed // Reading the offset indicator - PR.ReadXYZ(PR.CurrentList(1, 3), Msg162, anIndicator); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadXYZ(anIndicator); // Reading the offset distance - if (!PR.ReadReal(PR.Current(), aDistance)){ + if (!PR.ReadReal(aDistance)){ Message_Msg Msg163("XSTEP_163"); PR.SendFail(Msg163); - } //szv#4:S4163:12Mar99 `st=` not needed + } // Reading the surface entity to be offset - if (!PR.ReadEntity(IR, PR.Current(), aStatus, aSurface)){ + if (!PR.ReadEntity(IR, aStatus, aSurface)) { Message_Msg Msg164("XSTEP_164"); switch(aStatus) { case IGESData_ReferenceError: { @@ -78,17 +71,7 @@ void IGESGeom_ToolOffsetSurface::ReadOwnParams default:{ } } - }//szv#4:S4163:12Mar99 `st=` not needed - - -/* - // Reading the offset indicator - st = PR.ReadXYZ(PR.CurrentList(1, 3), "Offset Indicator", anIndicator); - // Reading the offset distance - st = PR.ReadReal(PR.Current(), "The Offset Distance ", aDistance); - // Reading the surface entity to be offset - st = PR.ReadEntity(IR, PR.Current(), "Surface entity to be offset", aSurface); -*/ + } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(anIndicator, aDistance, aSurface); diff --git a/src/IGESGeom/IGESGeom_ToolPlane.cxx b/src/IGESGeom/IGESGeom_ToolPlane.cxx index 41f4b490a9..8970d0c7a3 100644 --- a/src/IGESGeom/IGESGeom_ToolPlane.cxx +++ b/src/IGESGeom/IGESGeom_ToolPlane.cxx @@ -55,26 +55,14 @@ void IGESGeom_ToolPlane::ReadOwnParams(const Handle(IGESGeom_Plane)& ent, Handle(IGESData_IGESEntity) aCurve; gp_XYZ attach (0.,0.,0.); IGESData_Status aStatus; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed -/* PR.ReadReal(PR.Current(), Msg135, A); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadReal(PR.Current(), Msg135, B); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadReal(PR.Current(), Msg135, C); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadReal(PR.Current(), Msg135, D); //szv#4:S4163:12Mar99 `st=` not needed -*/ - if ((!PR.ReadReal(PR.Current(),A)) || (!PR.ReadReal(PR.Current(),B)) || - (!PR.ReadReal(PR.Current(),C)) || (!PR.ReadReal(PR.Current(),D))){ + if ((!PR.ReadReal(A)) || (!PR.ReadReal(B)) || + (!PR.ReadReal(C)) || (!PR.ReadReal(D))){ Message_Msg Msg135("XSTEP_135"); PR.SendFail(Msg135); } -/* - st = PR.ReadReal(PR.Current(), "Coefficient Of Plane", A); - st = PR.ReadReal(PR.Current(), "Coefficient Of Plane", B); - st = PR.ReadReal(PR.Current(), "Coefficient Of Plane", C); - st = PR.ReadReal(PR.Current(), "Coefficient Of Plane", D); -*/ if (PR.IsParamDefined(PR.CurrentNumber())) { - if (!PR.ReadEntity(IR, PR.Current(), aStatus, aCurve,Standard_True)){ + if (!PR.ReadEntity(IR, aStatus, aCurve,Standard_True)) { Message_Msg Msg136("XSTEP_136"); switch(aStatus) { case IGESData_ReferenceError: { @@ -91,26 +79,17 @@ void IGESGeom_ToolPlane::ReadOwnParams(const Handle(IGESGeom_Plane)& ent, } } } - } //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadEntity(IR, PR.Current(), "Bounding Curve", aCurve,Standard_True); + } // en principe exige si FormNumber != 0 ... cf OwnCheck (Load accepte) if (PR.IsParamDefined(PR.CurrentNumber())) { - Message_Msg Msg139("XSTEP_139"); - - PR.ReadXYZ(PR.CurrentList(1, 3), Msg139, attach); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadXYZ(PR.CurrentList(1, 3), "Coord of DisplaySymbol", attach); + PR.ReadXYZ(attach); - if (!PR.ReadReal(PR.Current(), aSize)){ + if (!PR.ReadReal(aSize)){ Message_Msg Msg138("XSTEP_138"); PR.SendFail(Msg138); - } //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadReal(PR.Current(), "DisplaySymbol Size", aSize); - }// else { - /* for (int i = 1; i <= 4; i ++) st = PR.DefinedElseSkip(); - PR.AddWarning("Display Symbol not defined at all"); - */ - // } + } + } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(A, B, C, D, aCurve, attach, aSize); diff --git a/src/IGESGeom/IGESGeom_ToolPoint.cxx b/src/IGESGeom/IGESGeom_ToolPoint.cxx index 3633166704..2c66f7e405 100644 --- a/src/IGESGeom/IGESGeom_ToolPoint.cxx +++ b/src/IGESGeom/IGESGeom_ToolPoint.cxx @@ -42,23 +42,15 @@ void IGESGeom_ToolPoint::ReadOwnParams (const Handle(IGESGeom_Point)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - // MGE 28/07/98 - // Building of messages - //================================== - Message_Msg Msg73("XSTEP_73"); - //================================== - gp_XYZ aPoint; Handle(IGESBasic_SubfigureDef) aSymbol; IGESData_Status aStatus; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadXYZ(PR.CurrentList(1, 3), Msg73, aPoint); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadXYZ(PR.CurrentList(1, 3), "Point", aPoint); + PR.ReadXYZ(aPoint); if (PR.DefinedElseSkip()){ - if (!PR.ReadEntity(IR, PR.Current(), aStatus, - STANDARD_TYPE(IGESBasic_SubfigureDef), aSymbol, Standard_True)){ + if (!PR.ReadEntity(IR, aStatus, + STANDARD_TYPE(IGESBasic_SubfigureDef), aSymbol, Standard_True)) { Message_Msg Msg74("XSTEP_74"); switch(aStatus) { case IGESData_ReferenceError: { @@ -80,10 +72,7 @@ void IGESGeom_ToolPoint::ReadOwnParams } } } - //szv#4:S4163:12Mar99 `st=` not needed } - // st = PR.ReadEntity(IR, PR.Current(), "Display Symbol", -// STANDARD_TYPE(IGESBasic_SubfigureDef), aSymbol, Standard_True); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(aPoint, aSymbol); diff --git a/src/IGESGeom/IGESGeom_ToolRuledSurface.cxx b/src/IGESGeom/IGESGeom_ToolRuledSurface.cxx index bd4613acf2..27129ccf79 100644 --- a/src/IGESGeom/IGESGeom_ToolRuledSurface.cxx +++ b/src/IGESGeom/IGESGeom_ToolRuledSurface.cxx @@ -39,14 +39,11 @@ void IGESGeom_ToolRuledSurface::ReadOwnParams (const Handle(IGESGeom_RuledSurface)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - // MGE 31/07/98 - - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Integer aDirFlag, aDevFlag; Handle(IGESData_IGESEntity) aCurve, anotherCurve; IGESData_Status aStatus; - if (!PR.ReadEntity(IR, PR.Current(), aStatus, aCurve)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadEntity(IR, aStatus, aCurve)) { Message_Msg Msg148("XSTEP_148"); switch(aStatus) { case IGESData_ReferenceError: { @@ -63,7 +60,7 @@ void IGESGeom_ToolRuledSurface::ReadOwnParams } } } - if (!PR.ReadEntity(IR, PR.Current(), aStatus, anotherCurve)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadEntity(IR, aStatus, anotherCurve)) { Message_Msg Msg149("XSTEP_149"); switch(aStatus) { case IGESData_ReferenceError: { @@ -80,20 +77,14 @@ void IGESGeom_ToolRuledSurface::ReadOwnParams } } } - if (!PR.ReadInteger(PR.Current(), aDirFlag)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadInteger(aDirFlag)) { Message_Msg Msg150("XSTEP_150"); PR.SendFail(Msg150); } - if (!PR.ReadInteger(PR.Current(), aDevFlag)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadInteger(aDevFlag)) { Message_Msg Msg151("XSTEP_151"); PR.SendFail(Msg151); } -/* - st = PR.ReadEntity(IR, PR.Current(), "First Curve", aCurve); - st = PR.ReadEntity(IR, PR.Current(), "Second Curve", anotherCurve); - st = PR.ReadInteger(PR.Current(), "DirFlag", aDirFlag); - st = PR.ReadInteger(PR.Current(), "DevFlag ", aDevFlag); -*/ DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(aCurve, anotherCurve, aDirFlag, aDevFlag); } diff --git a/src/IGESGeom/IGESGeom_ToolSplineCurve.cxx b/src/IGESGeom/IGESGeom_ToolSplineCurve.cxx index 66fe800840..323f26a6bd 100644 --- a/src/IGESGeom/IGESGeom_ToolSplineCurve.cxx +++ b/src/IGESGeom/IGESGeom_ToolSplineCurve.cxx @@ -41,10 +41,6 @@ void IGESGeom_ToolSplineCurve::ReadOwnParams (const Handle(IGESGeom_SplineCurve)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - // MGE 29/07/98 - // Building of messages - - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Integer nbSegments; Standard_Integer aType, aDegree, nbDimensions;; Handle(TColStd_HArray1OfReal) allBreakPoints; @@ -55,28 +51,20 @@ void IGESGeom_ToolSplineCurve::ReadOwnParams Handle(TColStd_HArray1OfReal) allYvalues = new TColStd_HArray1OfReal(1, 4); Handle(TColStd_HArray1OfReal) allZvalues = new TColStd_HArray1OfReal(1, 4); - //szv#4:S4163:12Mar99 `st=` not needed - if (!PR.ReadInteger(PR.Current(), aType)){ + if (!PR.ReadInteger(aType)){ Message_Msg Msg91("XSTEP_91"); PR.SendFail(Msg91); } - if (!PR.ReadInteger(PR.Current(), aDegree)){ + if (!PR.ReadInteger(aDegree)){ Message_Msg Msg92("XSTEP_92"); PR.SendFail(Msg92); } - if (!PR.ReadInteger(PR.Current(), nbDimensions)){ + if (!PR.ReadInteger(nbDimensions)){ Message_Msg Msg93("XSTEP_93"); PR.SendFail(Msg93); } - //st = PR.ReadInteger(PR.Current(), Msg94, nbSegments); //szv#4:S4163:12Mar99 moved in if -/* - st = PR.ReadInteger(PR.Current(), "Spline Type", aType); - st = PR.ReadInteger(PR.Current(), "Degree Continuity", aDegree); - st = PR.ReadInteger(PR.Current(), "Number Of Dimensions", nbDimensions); - st = PR.ReadInteger(PR.Current(), "Number Of Segments", nbSegments); -*/ - if (PR.ReadInteger(PR.Current(), nbSegments)) { + if (PR.ReadInteger(nbSegments)) { if (nbSegments <= 0){ Message_Msg Msg94("XSTEP_94"); PR.SendFail(Msg94); @@ -89,10 +77,6 @@ void IGESGeom_ToolSplineCurve::ReadOwnParams } Message_Msg Msg95("XSTEP_95"); PR.ReadReals(PR.CurrentList(nbSegments + 1), Msg95, allBreakPoints); //szv#4:S4163:12Mar99 `st=` not needed -/* - st = PR.ReadReals(PR.CurrentList(nbSegments + 1), "Break Points", - allBreakPoints); -*/ } else{ Message_Msg Msg94("XSTEP_94"); @@ -106,21 +90,18 @@ void IGESGeom_ToolSplineCurve::ReadOwnParams Standard_Integer I; for (I = 1; I <= nbSegments; I++) { - //st = PR.ReadReals(PR.CurrentList(4),"X-Coordinate Polynomial",temp); //szv#4:S4163:12Mar99 moved in if if (PR.ReadReals(PR.CurrentList(4),"X-Coordinate Polynomial",temp)) { Standard_Integer J; for (J = 1; J <= 4; J++) allXPolynomials->SetValue(I, J, temp->Value(J)); } - //st = PR.ReadReals(PR.CurrentList(4),"Y-Coordinate Polynomial",temp); //szv#4:S4163:12Mar99 moved in if if (PR.ReadReals(PR.CurrentList(4),"Y-Coordinate Polynomial",temp)) { Standard_Integer J; for (J = 1; J <= 4; J++) allYPolynomials->SetValue(I, J, temp->Value(J)); } - //st = PR.ReadReals(PR.CurrentList(4),"Z-Coordinate Polynomial",temp); //szv#4:S4163:12Mar99 moved in if if (PR.ReadReals(PR.CurrentList(4),"Z-Coordinate Polynomial",temp)) { Standard_Integer J; for (J = 1; J <= 4; J++) @@ -129,21 +110,18 @@ void IGESGeom_ToolSplineCurve::ReadOwnParams } } - //st = PR.ReadReals(PR.CurrentList(4), "TerminatePoint X-Values", temp); //szv#4:S4163:12Mar99 moved in if if (PR.ReadReals(PR.CurrentList(4), "TerminatePoint X-Values", temp)) { Standard_Integer J; for (J = 1; J <= 4; J++) allXvalues->SetValue(J, temp->Value(J)); } - //st = PR.ReadReals(PR.CurrentList(4), "TerminatePoint Y-Values", temp); //szv#4:S4163:12Mar99 moved in if if (PR.ReadReals(PR.CurrentList(4), "TerminatePoint Y-Values", temp)) { Standard_Integer J; for (J = 1; J <= 4; J++) allYvalues->SetValue(J, temp->Value(J)); } - //st = PR.ReadReals(PR.CurrentList(4), "TerminatePoint Z-Values", temp); //szv#4:S4163:12Mar99 moved in if if (PR.ReadReals(PR.CurrentList(4), "TerminatePoint Z-Values", temp)) { Standard_Integer J; for (J = 1; J <= 4; J++) diff --git a/src/IGESGeom/IGESGeom_ToolSplineSurface.cxx b/src/IGESGeom/IGESGeom_ToolSplineSurface.cxx index eb6a783678..30f3d7c002 100644 --- a/src/IGESGeom/IGESGeom_ToolSplineSurface.cxx +++ b/src/IGESGeom/IGESGeom_ToolSplineSurface.cxx @@ -40,9 +40,6 @@ void IGESGeom_ToolSplineSurface::ReadOwnParams (const Handle(IGESGeom_SplineSurface)& ent, const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - - // MGE 30/07/98 - Standard_Integer aBoundaryType, aPatchType, allNbUSegments, allNbVSegments; Standard_Integer i, j, k; Standard_Boolean ubreak=Standard_False, vbreak=Standard_False; @@ -52,19 +49,15 @@ void IGESGeom_ToolSplineSurface::ReadOwnParams Handle(IGESBasic_HArray2OfHArray1OfReal) allYCoeffs; Handle(IGESBasic_HArray2OfHArray1OfReal) allZCoeffs; - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - - //szv#4:S4163:12Mar99 `st=` not needed - if (!PR.ReadInteger(PR.Current(), aBoundaryType)){ + if (!PR.ReadInteger(aBoundaryType)){ Message_Msg Msg140("XSTEP_140"); PR.SendFail(Msg140); } - if (!PR.ReadInteger(PR.Current(), aPatchType)){ + if (!PR.ReadInteger(aPatchType)){ Message_Msg Msg278("XSTEP_278"); PR.SendFail(Msg278); } - //st = PR.ReadInteger(PR.Current(), Msg141, allNbUSegments); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(),allNbUSegments)) { + if (PR.ReadInteger(allNbUSegments)) { ubreak = Standard_True; allUBreakPoints = new TColStd_HArray1OfReal(1, allNbUSegments+1); } @@ -73,9 +66,7 @@ void IGESGeom_ToolSplineSurface::ReadOwnParams PR.SendFail(Msg141); } - //st = PR.ReadInteger(PR.Current(), Msg142, allNbVSegments); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadInteger(PR.Current(), "Number Of V Segments", allNbVSegments); - if (PR.ReadInteger(PR.Current(),allNbVSegments)) { + if (PR.ReadInteger(allNbVSegments)) { vbreak = Standard_True; allVBreakPoints = new TColStd_HArray1OfReal(1, allNbVSegments+1); } @@ -87,14 +78,12 @@ void IGESGeom_ToolSplineSurface::ReadOwnParams if (!allUBreakPoints.IsNull()){ Message_Msg Msg143("XSTEP_143"); - PR.ReadReals(PR.CurrentList(allNbUSegments+1), Msg143, allUBreakPoints); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadReals(PR.CurrentList(allNbUSegments+1), "U Break Points", allUBreakPoints); + PR.ReadReals(PR.CurrentList(allNbUSegments+1), Msg143, allUBreakPoints); } if (!allVBreakPoints.IsNull()){ Message_Msg Msg144("XSTEP_144"); - PR.ReadReals(PR.CurrentList(allNbVSegments+1), Msg144, allVBreakPoints); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadReals(PR.CurrentList(allNbVSegments+1), "V Break Points", allVBreakPoints); + PR.ReadReals(PR.CurrentList(allNbVSegments+1), Msg144, allVBreakPoints); } if (ubreak && vbreak) @@ -104,7 +93,7 @@ void IGESGeom_ToolSplineSurface::ReadOwnParams allZCoeffs = new IGESBasic_HArray2OfHArray1OfReal(1, allNbUSegments, 1, allNbVSegments); } - Handle(TColStd_HArray1OfReal) Temp; // = new TColStd_HArray1OfReal(1, 16); + Handle(TColStd_HArray1OfReal) Temp; if (! allXCoeffs.IsNull()) { Standard_Boolean st; @@ -121,7 +110,6 @@ void IGESGeom_ToolSplineSurface::ReadOwnParams for (i = 1; i <= allNbUSegments; i++) { for (j = 1; j <= allNbVSegments; j++) { st = PR.ReadReals (PR.CurrentList(16),Msg145_X,Temp); - //st = PR.ReadReals (PR.CurrentList(16),"X Coefficient Of Patch",Temp); if (st && Temp->Length() == 16) allXCoeffs->SetValue(i,j,Temp); else { Message_Msg Msg147_X("XSTEP_147"); @@ -129,7 +117,6 @@ void IGESGeom_ToolSplineSurface::ReadOwnParams PR.SendFail (Msg147_X); } st = PR.ReadReals (PR.CurrentList(16),Msg145_Y,Temp); - //st = PR.ReadReals (PR.CurrentList(16),"Y Coefficient Of Patch",Temp); if (st && Temp->Length() == 16) allYCoeffs->SetValue(i, j, Temp); else { Message_Msg Msg147_Y("XSTEP_147"); @@ -137,7 +124,6 @@ void IGESGeom_ToolSplineSurface::ReadOwnParams PR.SendFail (Msg147_Y); } st = PR.ReadReals (PR.CurrentList(16),Msg145_Z,Temp); - //st = PR.ReadReals (PR.CurrentList(16),"Z Coefficient Of Patch",Temp); if (st && Temp->Length() == 16) allZCoeffs->SetValue(i, j, Temp); else if (i < allNbUSegments || j < allNbVSegments) { Message_Msg Msg147_Z("XSTEP_147"); @@ -150,12 +136,11 @@ void IGESGeom_ToolSplineSurface::ReadOwnParams Temp = new TColStd_HArray1OfReal (1,16); Temp->Init(0.); for (k = 1; k <= 16; k ++) { Standard_Real vl; - if (!PR.ReadReal (PR.Current(),vl)) { + if (!PR.ReadReal(vl)) { Message_Msg Msg146("XSTEP_146"); PR.SendFail(Msg146); break; } - //if (!PR.ReadReal (PR.Current(),"Z of very last patch",vl)) break; Temp->SetValue(k,vl); } allZCoeffs->SetValue(i, j, Temp); diff --git a/src/IGESGeom/IGESGeom_ToolSurfaceOfRevolution.cxx b/src/IGESGeom/IGESGeom_ToolSurfaceOfRevolution.cxx index 14b5babf99..692d4f3503 100644 --- a/src/IGESGeom/IGESGeom_ToolSurfaceOfRevolution.cxx +++ b/src/IGESGeom/IGESGeom_ToolSurfaceOfRevolution.cxx @@ -40,15 +40,12 @@ void IGESGeom_ToolSurfaceOfRevolution::ReadOwnParams (const Handle(IGESGeom_SurfaceOfRevolution)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - // MGE 31/07/98 - Handle(IGESGeom_Line) anAxis; Handle(IGESData_IGESEntity) aGeneratrix; Standard_Real aStartAngle, anEndAngle; IGESData_Status aStatus; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - if (!PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESGeom_Line), anAxis)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadEntity(IR, aStatus, STANDARD_TYPE(IGESGeom_Line), anAxis)) { Message_Msg Msg152("XSTEP_152"); switch(aStatus) { case IGESData_ReferenceError: { @@ -70,7 +67,7 @@ void IGESGeom_ToolSurfaceOfRevolution::ReadOwnParams } } } - if (!PR.ReadEntity(IR, PR.Current(), aStatus, aGeneratrix)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadEntity(IR, aStatus, aGeneratrix)) { Message_Msg Msg153("XSTEP_153"); switch(aStatus) { case IGESData_ReferenceError: { @@ -87,20 +84,14 @@ void IGESGeom_ToolSurfaceOfRevolution::ReadOwnParams } } } - if (!PR.ReadReal(PR.Current(), aStartAngle)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadReal(aStartAngle)) { Message_Msg Msg154("XSTEP_154"); PR.SendFail(Msg154); } - if (!PR.ReadReal(PR.Current(), anEndAngle)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadReal(anEndAngle)) { Message_Msg Msg155("XSTEP_155"); PR.SendFail(Msg155); } -/* - st = PR.ReadEntity(IR, PR.Current(), "Axis", STANDARD_TYPE(IGESGeom_Line), anAxis); - st = PR.ReadEntity(IR, PR.Current(), "Generatrix", aGeneratrix); - st = PR.ReadReal(PR.Current(), "StartAngle", aStartAngle); - st = PR.ReadReal(PR.Current(), "EndAngle", anEndAngle); -*/ DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(anAxis, aGeneratrix, aStartAngle, anEndAngle); } diff --git a/src/IGESGeom/IGESGeom_ToolTabulatedCylinder.cxx b/src/IGESGeom/IGESGeom_ToolTabulatedCylinder.cxx index 93377447fc..3477de3531 100644 --- a/src/IGESGeom/IGESGeom_ToolTabulatedCylinder.cxx +++ b/src/IGESGeom/IGESGeom_ToolTabulatedCylinder.cxx @@ -42,20 +42,12 @@ void IGESGeom_ToolTabulatedCylinder::ReadOwnParams (const Handle(IGESGeom_TabulatedCylinder)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - // MGE 31/07/98 - // Building of messages - //======================================== - Message_Msg Msg157("XSTEP_157"); - //======================================== - Handle(IGESData_IGESEntity) aDirectrix; gp_XYZ anEnd; IGESData_Status aStatus; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - // Reading the directrix curve entity - if (!PR.ReadEntity(IR, PR.Current(), aStatus, aDirectrix)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadEntity(IR, aStatus, aDirectrix)) { Message_Msg Msg156("XSTEP_156"); switch(aStatus) { case IGESData_ReferenceError: { @@ -72,11 +64,9 @@ void IGESGeom_ToolTabulatedCylinder::ReadOwnParams } } } - //st = PR.ReadEntity(IR, PR.Current(), "Directrix", aDirectrix); // Reading the terminate point of the generatrix - PR.ReadXYZ(PR.CurrentList(1, 3), Msg157, anEnd); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadXYZ(PR.CurrentList(1, 3), "Terminate Point", anEnd); + PR.ReadXYZ(anEnd); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(aDirectrix, anEnd); diff --git a/src/IGESGeom/IGESGeom_ToolTransformationMatrix.cxx b/src/IGESGeom/IGESGeom_ToolTransformationMatrix.cxx index 4bd70f9ea6..14dcefa234 100644 --- a/src/IGESGeom/IGESGeom_ToolTransformationMatrix.cxx +++ b/src/IGESGeom/IGESGeom_ToolTransformationMatrix.cxx @@ -44,21 +44,13 @@ void IGESGeom_ToolTransformationMatrix::ReadOwnParams (const Handle(IGESGeom_TransformationMatrix)& ent, const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const { - // MGE 03/08/98 - - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Real temp; Handle(TColStd_HArray2OfReal) aMatrix = new TColStd_HArray2OfReal(1,3,1,4); for (Standard_Integer I = 1; I <= 3; I++) { for (Standard_Integer J = 1; J <= 4; J++) { - //st = PR.ReadReal(PR.Current(), Msg215, temp); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadReal(PR.Current(), "Matrix Elements", temp); - if (PR.ReadReal(PR.Current(), temp)) - aMatrix->SetValue(I, J, temp); - else{ - Message_Msg Msg215("XSTEP_215"); - PR.SendFail(Msg215); + if (!PR.ReadReal(aMatrix->ChangeValue(I, J))) { + Message_Msg Msg215("XSTEP_215"); + PR.SendFail(Msg215); } } } diff --git a/src/IGESGeom/IGESGeom_ToolTrimmedSurface.cxx b/src/IGESGeom/IGESGeom_ToolTrimmedSurface.cxx index af5f34fd72..6dae16708f 100644 --- a/src/IGESGeom/IGESGeom_ToolTrimmedSurface.cxx +++ b/src/IGESGeom/IGESGeom_ToolTrimmedSurface.cxx @@ -60,8 +60,7 @@ void IGESGeom_ToolTrimmedSurface::ReadOwnParams Handle(IGESGeom_HArray1OfCurveOnSurface) anInner; IGESData_Status aStatus; - //szv#4:S4163:12Mar99 `st=` not needed - if (!PR.ReadEntity(IR, PR.Current(), aStatus, aSurface)){ + if (!PR.ReadEntity(IR, aStatus, aSurface)) { Message_Msg Msg169("XSTEP_169"); switch(aStatus) { case IGESData_ReferenceError: { @@ -78,18 +77,12 @@ void IGESGeom_ToolTrimmedSurface::ReadOwnParams } } } - if (!PR.ReadInteger(PR.Current(), aFlag)){ + if (!PR.ReadInteger(aFlag)){ Message_Msg Msg170("XSTEP_170"); PR.SendFail(Msg170); } - //st = PR.ReadInteger(PR.Current(), Msg171, count); //szv#4:S4163:12Mar99 moved in if -/* - st = PR.ReadEntity(IR, PR.Current(), "Surface to be trimmed", aSurface); - st = PR.ReadInteger(PR.Current(), "Outer boundary type", aFlag); - st = PR.ReadInteger(PR.Current(), "Number of inner boundary closed curves", count); -*/ - if (PR.ReadInteger(PR.Current(), count)) { + if (PR.ReadInteger(count)) { if (count < 0){ Message_Msg Msg171("XSTEP_171"); PR.SendFail (Msg171); @@ -102,8 +95,8 @@ void IGESGeom_ToolTrimmedSurface::ReadOwnParams PR.SendFail(Msg171); } - if (!PR.ReadEntity(IR, PR.Current(), aStatus, - STANDARD_TYPE(IGESGeom_CurveOnSurface), anOuter,Standard_True)){ + if (!PR.ReadEntity(IR, aStatus, + STANDARD_TYPE(IGESGeom_CurveOnSurface), anOuter,Standard_True)) { Message_Msg Msg172("XSTEP_172"); switch(aStatus) { case IGESData_ReferenceError: { @@ -132,12 +125,7 @@ void IGESGeom_ToolTrimmedSurface::ReadOwnParams Standard_Integer I; for (I = 1; I <= count; I++ ) { Handle(IGESGeom_CurveOnSurface) tempEnt; - //st = PR.ReadEntity(IR, PR.Current(), Msg173, - //STANDARD_TYPE(IGESGeom_CurveOnSurface), tempEnt); //szv#4:S4163:12Mar99 moved in if -/* st = PR.ReadEntity(IR, PR.Current(), "Inner boundary curves", - STANDARD_TYPE(IGESGeom_CurveOnSurface), tempEnt); -*/ - if (PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESGeom_CurveOnSurface), tempEnt)) + if (PR.ReadEntity(IR, aStatus, STANDARD_TYPE(IGESGeom_CurveOnSurface), tempEnt)) anInner->SetValue(I, tempEnt); else{ Message_Msg Msg173("XSTEP_173"); diff --git a/src/IGESGraph/FILES b/src/IGESGraph/FILES index ff62bfecf3..382bd15703 100644 --- a/src/IGESGraph/FILES +++ b/src/IGESGraph/FILES @@ -32,41 +32,9 @@ IGESGraph_Pick.cxx IGESGraph_Pick.hxx IGESGraph_Protocol.cxx IGESGraph_Protocol.hxx -IGESGraph_ReadWriteModule.cxx -IGESGraph_ReadWriteModule.hxx -IGESGraph_SpecificModule.cxx -IGESGraph_SpecificModule.hxx IGESGraph_TextDisplayTemplate.cxx IGESGraph_TextDisplayTemplate.hxx IGESGraph_TextFontDef.cxx IGESGraph_TextFontDef.hxx -IGESGraph_ToolColor.cxx -IGESGraph_ToolColor.hxx -IGESGraph_ToolDefinitionLevel.cxx -IGESGraph_ToolDefinitionLevel.hxx -IGESGraph_ToolDrawingSize.cxx -IGESGraph_ToolDrawingSize.hxx -IGESGraph_ToolDrawingUnits.cxx -IGESGraph_ToolDrawingUnits.hxx -IGESGraph_ToolHighLight.cxx -IGESGraph_ToolHighLight.hxx -IGESGraph_ToolIntercharacterSpacing.cxx -IGESGraph_ToolIntercharacterSpacing.hxx -IGESGraph_ToolLineFontDefPattern.cxx -IGESGraph_ToolLineFontDefPattern.hxx -IGESGraph_ToolLineFontDefTemplate.cxx -IGESGraph_ToolLineFontDefTemplate.hxx -IGESGraph_ToolLineFontPredefined.cxx -IGESGraph_ToolLineFontPredefined.hxx -IGESGraph_ToolNominalSize.cxx -IGESGraph_ToolNominalSize.hxx -IGESGraph_ToolPick.cxx -IGESGraph_ToolPick.hxx -IGESGraph_ToolTextDisplayTemplate.cxx -IGESGraph_ToolTextDisplayTemplate.hxx -IGESGraph_ToolTextFontDef.cxx -IGESGraph_ToolTextFontDef.hxx -IGESGraph_ToolUniformRectGrid.cxx -IGESGraph_ToolUniformRectGrid.hxx IGESGraph_UniformRectGrid.cxx IGESGraph_UniformRectGrid.hxx diff --git a/src/IGESGraph/IGESGraph.cxx b/src/IGESGraph/IGESGraph.cxx index 146f96571f..70315805ab 100644 --- a/src/IGESGraph/IGESGraph.cxx +++ b/src/IGESGraph/IGESGraph.cxx @@ -13,15 +13,10 @@ #include -#include -#include #include #include #include -#include -#include #include -#include /*void IGESGraph::Init () @@ -36,9 +31,6 @@ const Handle(IGESGraph_Protocol) & IGESGraph::Protocol () if (protocol.IsNull()) { protocol = new IGESGraph_Protocol; Interface_GeneralLib::SetGlobal (new IGESGraph_GeneralModule, protocol); - Interface_ReaderLib::SetGlobal (new IGESGraph_ReadWriteModule,protocol); - IGESData_WriterLib::SetGlobal (new IGESGraph_ReadWriteModule,protocol); - IGESData_SpecificLib::SetGlobal (new IGESGraph_SpecificModule, protocol); } return protocol; } diff --git a/src/IGESGraph/IGESGraph_Array1OfColor.hxx b/src/IGESGraph/IGESGraph_Array1OfColor.hxx index 77f56b3f2d..21402c44cd 100644 --- a/src/IGESGraph/IGESGraph_Array1OfColor.hxx +++ b/src/IGESGraph/IGESGraph_Array1OfColor.hxx @@ -17,10 +17,10 @@ #ifndef IGESGraph_Array1OfColor_HeaderFile #define IGESGraph_Array1OfColor_HeaderFile -#include +#include #include +#include -typedef NCollection_Array1 IGESGraph_Array1OfColor; - +typedef NCollection_Array1> IGESGraph_Array1OfColor; #endif diff --git a/src/IGESGraph/IGESGraph_Array1OfTextDisplayTemplate.hxx b/src/IGESGraph/IGESGraph_Array1OfTextDisplayTemplate.hxx index 956cd881d1..a06c26c9ac 100644 --- a/src/IGESGraph/IGESGraph_Array1OfTextDisplayTemplate.hxx +++ b/src/IGESGraph/IGESGraph_Array1OfTextDisplayTemplate.hxx @@ -17,10 +17,10 @@ #ifndef IGESGraph_Array1OfTextDisplayTemplate_HeaderFile #define IGESGraph_Array1OfTextDisplayTemplate_HeaderFile +#include #include #include -typedef NCollection_Array1 IGESGraph_Array1OfTextDisplayTemplate; - +typedef NCollection_Array1> IGESGraph_Array1OfTextDisplayTemplate; #endif diff --git a/src/IGESGraph/IGESGraph_Color.cxx b/src/IGESGraph/IGESGraph_Color.cxx index e23f0bcd79..d94c038cf8 100644 --- a/src/IGESGraph/IGESGraph_Color.cxx +++ b/src/IGESGraph/IGESGraph_Color.cxx @@ -17,66 +17,63 @@ //-------------------------------------------------------------------- #include -#include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_Color,IGESData_ColorEntity) -IGESGraph_Color::IGESGraph_Color () { } - - -// This class inherits from IGESData_ColorEntity - - void IGESGraph_Color::Init - (const Standard_Real red, - const Standard_Real green, - const Standard_Real blue, - const Handle(TCollection_HAsciiString)& aColorName) -{ - theRed = red; - theGreen = green; - theBlue = blue; - theColorName = aColorName; - InitTypeAndForm(314,0); -} - - void IGESGraph_Color::RGBIntensity - (Standard_Real& Red, Standard_Real& Green, Standard_Real& Blue) const +void IGESGraph_Color::HLSPercentage (Standard_Real& Hue, Standard_Real& Lightness, Standard_Real& Saturation) const { - Red = theRed; - Green = theGreen; - Blue = theBlue; + Hue = ((1.0 / (2.0 * M_PI)) * (ATan(((2 * myRed) - myGreen - myBlue) / (Sqrt(3) * (myGreen - myBlue))))); + Lightness = ((1.0 / 3.0) * (myRed + myGreen + myBlue)); + Saturation = (Sqrt((myRed * myRed ) + (myGreen * myGreen) + (myBlue * myBlue ) - (myRed * myGreen) - (myRed * myBlue ) - (myBlue * myGreen))); } - void IGESGraph_Color::CMYIntensity - (Standard_Real& Cyan, Standard_Real& Magenta, Standard_Real& Yellow) const +void IGESGraph_Color::OwnRead (IGESFile_Reader &PR) { - Cyan = 100.0 - theRed; - Magenta = 100.0 - theGreen; - Yellow = 100.0 - theBlue; + PR.ReadReal(myRed,"RED as % Of Full Intensity"); + PR.ReadReal(myGreen,"GREEN as % Of Full Intensity"); + PR.ReadReal(myBlue,"BLUE as % Of Full Intensity"); + PR.ReadText(myColorName,"Color Name"); } - void IGESGraph_Color::HLSPercentage - (Standard_Real& Hue, Standard_Real& Lightness, Standard_Real& Saturation) const +void IGESGraph_Color::OwnWrite (IGESData_IGESWriter& IW) const { - Hue = ((1.0 / (2.0 * M_PI)) * - (ATan(((2 * theRed) - theGreen - theBlue) / - (Sqrt(3) * (theGreen - theBlue))))); - Lightness = ((1.0 / 3.0) * (theRed + theGreen + theBlue)); - Saturation = (Sqrt((theRed * theRed ) + - (theGreen * theGreen) + - (theBlue * theBlue ) - - (theRed * theGreen) - - (theRed * theBlue ) - - (theBlue * theGreen))); + IW.Send(myRed); + IW.Send(myGreen); + IW.Send(myBlue); +// ATTENTION place a reserver (Null) silya des pointeurs additionnels + if (!myColorName.IsNull()) + IW.Send(myColorName); + else IW.SendVoid(); // placekeeper to be reserved for additional pointers } - Standard_Boolean IGESGraph_Color::HasColorName () const +IGESData_DirChecker IGESGraph_Color::DirChecker () const { - return (! theColorName.IsNull()); + IGESData_DirChecker DC(314, 0); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefAny); + DC.BlankStatusIgnored(); + DC.SubordinateStatusRequired(0); + DC.UseFlagRequired(2); + DC.HierarchyStatusIgnored(); + return DC; } - Handle(TCollection_HAsciiString) IGESGraph_Color::ColorName () const +void IGESGraph_Color::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const { - return theColorName; + S << "IGESGraph_Color" << endl; + S << "Red (in % Of Full Intensity) : " << myRed << endl; + S << "Green (in % Of Full Intensity) : " << myGreen << endl; + S << "Blue (in % Of Full Intensity) : " << myBlue << endl; + S << "Color Name : "; + IGESData_DumpString(S,myColorName); + S << endl; } diff --git a/src/IGESGraph/IGESGraph_Color.hxx b/src/IGESGraph/IGESGraph_Color.hxx index f41a955c74..cb42eb06eb 100644 --- a/src/IGESGraph/IGESGraph_Color.hxx +++ b/src/IGESGraph/IGESGraph_Color.hxx @@ -17,18 +17,10 @@ #ifndef _IGESGraph_Color_HeaderFile #define _IGESGraph_Color_HeaderFile -#include -#include - -#include #include -#include class TCollection_HAsciiString; -class IGESGraph_Color; -DEFINE_STANDARD_HANDLE(IGESGraph_Color, IGESData_ColorEntity) - //! defines IGESColor, Type <314> Form <0> //! in package IGESGraph //! @@ -38,58 +30,71 @@ DEFINE_STANDARD_HANDLE(IGESGraph_Color, IGESData_ColorEntity) //! intensity range. class IGESGraph_Color : public IGESData_ColorEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 314; } + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 0; } + + //! Default constructor + IGESGraph_Color() + : myRed(0.), + myGreen(0.), + myBlue(0.) + {} - Standard_EXPORT IGESGraph_Color(); - - //! This method is used to set the fields of the class Color + //! Constructor with parameters //! - red : Red color intensity (range 0.0 to 100.0) //! - green : Green color intensity (range 0.0 to 100.0) //! - blue : Blue color intensity (range 0.0 to 100.0) //! - aColorName : Name of the color (optional) - Standard_EXPORT void Init (const Standard_Real red, const Standard_Real green, const Standard_Real blue, const Handle(TCollection_HAsciiString)& aColorName); - - Standard_EXPORT void RGBIntensity (Standard_Real& Red, Standard_Real& Green, Standard_Real& Blue) const; + IGESGraph_Color(const Standard_Real R, const Standard_Real G, const Standard_Real B, const Handle(TCollection_HAsciiString) &theColorName) + : myRed(R), + myGreen(G), + myBlue(B), + myColorName(theColorName) + {} - Standard_EXPORT void CMYIntensity (Standard_Real& Cyan, Standard_Real& Magenta, Standard_Real& Yellow) const; + void RGBIntensity (Standard_Real& Red, Standard_Real& Green, Standard_Real& Blue) const + { + Red = myRed; + Green = myGreen; + Blue = myBlue; + } + + void CMYIntensity (Standard_Real& Cyan, Standard_Real& Magenta, Standard_Real& Yellow) const + { + Cyan = 100.0 - myRed; + Magenta = 100.0 - myGreen; + Yellow = 100.0 - myBlue; + } Standard_EXPORT void HLSPercentage (Standard_Real& Hue, Standard_Real& Lightness, Standard_Real& Saturation) const; //! returns True if optional character string is assigned, //! False otherwise. - Standard_EXPORT Standard_Boolean HasColorName() const; - + Standard_Boolean HasColorName() const { return (!myColorName.IsNull()); } + //! if HasColorName() is True returns the Verbal description of //! the Color. - Standard_EXPORT Handle(TCollection_HAsciiString) ColorName() const; + const Handle(TCollection_HAsciiString) & ColorName() const { return myColorName; } + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESGraph_Color,IGESData_ColorEntity) -protected: - - - - -private: - - - Standard_Real theRed; - Standard_Real theGreen; - Standard_Real theBlue; - Handle(TCollection_HAsciiString) theColorName; - + private: + Standard_Real myRed; + Standard_Real myGreen; + Standard_Real myBlue; + Handle(TCollection_HAsciiString) myColorName; }; - - - - - - #endif // _IGESGraph_Color_HeaderFile diff --git a/src/IGESGraph/IGESGraph_DefinitionLevel.cxx b/src/IGESGraph/IGESGraph_DefinitionLevel.cxx index 4e6304412f..35afb24a81 100644 --- a/src/IGESGraph/IGESGraph_DefinitionLevel.cxx +++ b/src/IGESGraph/IGESGraph_DefinitionLevel.cxx @@ -19,34 +19,67 @@ #include #include #include -#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_DefinitionLevel,IGESData_LevelListEntity) -IGESGraph_DefinitionLevel::IGESGraph_DefinitionLevel () { } - - - void IGESGraph_DefinitionLevel::Init - (const Handle(TColStd_HArray1OfInteger)& allLevelNumbers) +Standard_Integer IGESGraph_DefinitionLevel::NbPropertyValues () const { - if (allLevelNumbers->Lower() != 1) - Standard_DimensionMismatch::Raise("IGESGraph_DefinitionLevel : Init"); - theLevelNumbers = allLevelNumbers; - InitTypeAndForm(406,1); + return myLevelNumbers->Length(); } - Standard_Integer IGESGraph_DefinitionLevel::NbPropertyValues () const +Standard_Integer IGESGraph_DefinitionLevel::NbLevelNumbers () const { - return ( theLevelNumbers->Length() ); + return myLevelNumbers->Length(); } - Standard_Integer IGESGraph_DefinitionLevel::NbLevelNumbers () const +Standard_Integer IGESGraph_DefinitionLevel::LevelNumber (const Standard_Integer LevelIndex) const { - return ( theLevelNumbers->Length() ); + return myLevelNumbers->Value(LevelIndex); +} + +void IGESGraph_DefinitionLevel::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer nbval = 0; + PR.ReadInteger(nbval,"No. of Property Values"); + if (nbval > 0) + { + myLevelNumbers = new TColStd_HArray1OfInteger(1, nbval); + PR.ReadInteger(myLevelNumbers->ChangeFirst(),nbval,"array levelNumbers"); + } + else PR.AddFail("No. of Property Values : Not Positive"); +} + +void IGESGraph_DefinitionLevel::OwnWrite (IGESData_IGESWriter& IW) const +{ + const Standard_Integer Up = NbPropertyValues(); + IW.Send( Up ); + for ( Standard_Integer i = 1; i <= Up; i++) + IW.Send(LevelNumber(i) ); +} + +IGESData_DirChecker IGESGraph_DefinitionLevel::DirChecker () const +{ + IGESData_DirChecker DC (406, 1); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } - Standard_Integer IGESGraph_DefinitionLevel::LevelNumber - (const Standard_Integer LevelIndex) const +void IGESGraph_DefinitionLevel::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer level) const { - return ( theLevelNumbers->Value(LevelIndex) ); + S << "IGESGraph_DefinitionLevel" << endl; + S << "Level Numbers : "; + IGESData_DumpVals(S,level,1,NbPropertyValues(),LevelNumber); + S << endl; } diff --git a/src/IGESGraph/IGESGraph_DefinitionLevel.hxx b/src/IGESGraph/IGESGraph_DefinitionLevel.hxx index 3e9702f1d6..65e0071a49 100644 --- a/src/IGESGraph/IGESGraph_DefinitionLevel.hxx +++ b/src/IGESGraph/IGESGraph_DefinitionLevel.hxx @@ -17,17 +17,9 @@ #ifndef _IGESGraph_DefinitionLevel_HeaderFile #define _IGESGraph_DefinitionLevel_HeaderFile -#include -#include - -#include #include -#include -class Standard_OutOfRange; - +class TColStd_HArray1OfInteger; -class IGESGraph_DefinitionLevel; -DEFINE_STANDARD_HANDLE(IGESGraph_DefinitionLevel, IGESData_LevelListEntity) //! defines IGESDefinitionLevel, Type <406> Form <1> //! in package IGESGraph @@ -36,16 +28,13 @@ DEFINE_STANDARD_HANDLE(IGESGraph_DefinitionLevel, IGESData_LevelListEntity) //! defined class IGESGraph_DefinitionLevel : public IGESData_LevelListEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } - - Standard_EXPORT IGESGraph_DefinitionLevel(); - - //! This method is used to set the fields of the class - //! DefinitionLevel - //! - allLevelNumbers : Values of Level Numbers - Standard_EXPORT void Init (const Handle(TColStd_HArray1OfInteger)& allLevelNumbers); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 1; } + + IGESGraph_DefinitionLevel() {} //! returns the number of property values in Standard_EXPORT Standard_Integer NbPropertyValues() const; @@ -58,28 +47,19 @@ public: //! LevelIndex > NbPropertyValues Standard_EXPORT Standard_Integer LevelNumber (const Standard_Integer LevelIndex) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESGraph_DefinitionLevel,IGESData_LevelListEntity) -protected: - - - - -private: - - - Handle(TColStd_HArray1OfInteger) theLevelNumbers; - + private: + Handle(TColStd_HArray1OfInteger) myLevelNumbers; }; - - - - - - #endif // _IGESGraph_DefinitionLevel_HeaderFile diff --git a/src/IGESGraph/IGESGraph_DrawingSize.cxx b/src/IGESGraph/IGESGraph_DrawingSize.cxx index 4d6e572b45..74ad12a089 100644 --- a/src/IGESGraph/IGESGraph_DrawingSize.cxx +++ b/src/IGESGraph/IGESGraph_DrawingSize.cxx @@ -17,35 +17,51 @@ //-------------------------------------------------------------------- #include -#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_DrawingSize,IGESData_IGESEntity) -IGESGraph_DrawingSize::IGESGraph_DrawingSize () { } +void IGESGraph_DrawingSize::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer aNbPropertyValues = 0; + PR.ReadInteger(aNbPropertyValues,"No. of property values"); + if (aNbPropertyValues != 2) + PR.AddFail("No. of Property values : Value is not 2"); - - void IGESGraph_DrawingSize::Init - (const Standard_Integer nbProps, const Standard_Real aXSize, - const Standard_Real aYSize) -{ - theNbPropertyValues = nbProps; - theXSize = aXSize; - theYSize = aYSize; - InitTypeAndForm(406,16); + PR.ReadReal(myXSize,"Drawing extent along +ve XD axis"); + PR.ReadReal(myYSize,"Drawing extent along +ve YD axis"); } - - Standard_Integer IGESGraph_DrawingSize::NbPropertyValues () const -{ - return theNbPropertyValues; +void IGESGraph_DrawingSize::OwnWrite (IGESData_IGESWriter& IW) const +{ + IW.Send(2); + IW.Send(myXSize); + IW.Send(myYSize); } - Standard_Real IGESGraph_DrawingSize::XSize () const -{ - return theXSize; +IGESData_DirChecker IGESGraph_DrawingSize::DirChecker () const +{ + IGESData_DirChecker DC (406, 16); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } - Standard_Real IGESGraph_DrawingSize::YSize () const +void IGESGraph_DrawingSize::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const { - return theYSize; + S << "IGESGraph_DrawingSize" << endl; + S << "No. of property values : 2" << endl; + S << "Drawing extent along positive X-axis : " << myXSize << endl; + S << "Drawing extent along positive Y-axis : " << myYSize << endl; + S << endl; } diff --git a/src/IGESGraph/IGESGraph_DrawingSize.hxx b/src/IGESGraph/IGESGraph_DrawingSize.hxx index 23c030ed8a..5c9c50c89e 100644 --- a/src/IGESGraph/IGESGraph_DrawingSize.hxx +++ b/src/IGESGraph/IGESGraph_DrawingSize.hxx @@ -17,17 +17,9 @@ #ifndef _IGESGraph_DrawingSize_HeaderFile #define _IGESGraph_DrawingSize_HeaderFile -#include -#include - -#include -#include #include -class IGESGraph_DrawingSize; -DEFINE_STANDARD_HANDLE(IGESGraph_DrawingSize, IGESData_IGESEntity) - //! defines IGESDrawingSize, Type <406> Form <16> //! in package IGESGraph //! @@ -36,52 +28,37 @@ DEFINE_STANDARD_HANDLE(IGESGraph_DrawingSize, IGESData_IGESEntity) //! drawing space class IGESGraph_DrawingSize : public IGESData_IGESEntity { + public: -public: - - - Standard_EXPORT IGESGraph_DrawingSize(); - - //! This method is used to set the fields of the class - //! DrawingSize - //! - nbProps : Number of property values (NP = 2) - //! - aXSize : Extent of Drawing along positive XD axis - //! - aYSize : Extent of Drawing along positive YD axis - Standard_EXPORT void Init (const Standard_Integer nbProps, const Standard_Real aXSize, const Standard_Real aYSize); - - //! returns the number of property values in (NP = 2) - Standard_EXPORT Standard_Integer NbPropertyValues() const; - - //! returns the extent of Drawing along positive XD axis - Standard_EXPORT Standard_Real XSize() const; - - //! returns the extent of Drawing along positive YD axis - Standard_EXPORT Standard_Real YSize() const; - - - + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } - DEFINE_STANDARD_RTTIEXT(IGESGraph_DrawingSize,IGESData_IGESEntity) - -protected: + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 16; } + IGESGraph_DrawingSize() + : myXSize(0.), + myYSize(0.) + {} + //! returns the extent of Drawing along positive XD axis + Standard_Real XSize() const { return myXSize; } + //! returns the extent of Drawing along positive YD axis + Standard_Real YSize() const { return myYSize; } + + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; -private: + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; - Standard_Integer theNbPropertyValues; - Standard_Real theXSize; - Standard_Real theYSize; + DEFINE_STANDARD_RTTIEXT(IGESGraph_DrawingSize,IGESData_IGESEntity) + private: + Standard_Real myXSize; + Standard_Real myYSize; }; - - - - - - #endif // _IGESGraph_DrawingSize_HeaderFile diff --git a/src/IGESGraph/IGESGraph_DrawingUnits.cxx b/src/IGESGraph/IGESGraph_DrawingUnits.cxx index 8b591bc3f4..3b511e9048 100644 --- a/src/IGESGraph/IGESGraph_DrawingUnits.cxx +++ b/src/IGESGraph/IGESGraph_DrawingUnits.cxx @@ -17,42 +17,19 @@ //-------------------------------------------------------------------- #include -#include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_DrawingUnits,IGESData_IGESEntity) -IGESGraph_DrawingUnits::IGESGraph_DrawingUnits () { } - - - void IGESGraph_DrawingUnits::Init - (const Standard_Integer nbProps, const Standard_Integer aFlag, - const Handle(TCollection_HAsciiString)& anUnit) -{ - theNbPropertyValues = nbProps; - theFlag = aFlag; - theUnit = anUnit; - InitTypeAndForm(406,17); -} - - Standard_Integer IGESGraph_DrawingUnits::NbPropertyValues () const +Standard_Real IGESGraph_DrawingUnits::UnitValue () const { - return theNbPropertyValues; -} - - Standard_Integer IGESGraph_DrawingUnits::Flag () const -{ - return theFlag; -} - - Handle(TCollection_HAsciiString) IGESGraph_DrawingUnits::Unit () const -{ - return theUnit; -} - - Standard_Real IGESGraph_DrawingUnits::UnitValue () const -{ - switch (theFlag) { + switch (myFlag) { case 1 : return 0.0254; case 2 : return 0.001; case 3 : return 1.; @@ -68,3 +45,109 @@ IGESGraph_DrawingUnits::IGESGraph_DrawingUnits () { } } return 1.; } + +void IGESGraph_DrawingUnits::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer aNbPropertyValues = 0; + PR.ReadInteger(aNbPropertyValues,"No. of property values"); + if (aNbPropertyValues != 2) + PR.AddFail("No. of Property values : Value is not 2"); + + PR.ReadInteger(myFlag,"Units Flag"); + PR.ReadText(myUnit,"Units Name"); +} + +void IGESGraph_DrawingUnits::OwnWrite (IGESData_IGESWriter& IW) const +{ + IW.Send(2); + IW.Send(myFlag); + IW.Send(myUnit); +} + +IGESData_DirChecker IGESGraph_DrawingUnits::DirChecker () const +{ + IGESData_DirChecker DC (406, 17); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; +} + +void IGESGraph_DrawingUnits::OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &ach) const +{ + // Check Flag//Unit Name + if (myUnit.IsNull()) { + if (myFlag == 3) + ach->AddFail("Unit Flag = 3 (user def.) and Unit Name undefined"); + } + else { + Standard_CString unm = myUnit->ToCString(); + Standard_Boolean unok = Standard_True; + switch (myFlag) { + case 1 : unok = (!strcmp(unm,"IN") || !strcmp(unm,"INCH")); break; + case 2 : unok = !strcmp(unm,"MM"); break; + case 3 : unok = Standard_True; break; // nom libre + case 4 : unok = !strcmp(unm,"FT"); break; + case 5 : unok = !strcmp(unm,"MI"); break; + case 6 : unok = !strcmp(unm,"M"); break; + case 7 : unok = !strcmp(unm,"KM"); break; + case 8 : unok = !strcmp(unm,"MIL"); break; + case 9 : unok = !strcmp(unm,"UM"); break; + case 10 : unok = !strcmp(unm,"CM"); break; + case 11 : unok = !strcmp(unm,"UIN"); break; + default : ach->AddFail("Unit Flag not in range 1 - 11"); break; + } + if (!unok) ach->AddFail("Unit Flag & Name not accorded"); + } +} + +Standard_Boolean IGESGraph_DrawingUnits::OwnCorrect () +{ + // ya aussi les noms : Flag a priorite sur Unit + Handle(TCollection_HAsciiString) name; + Standard_CString unm = (myUnit.IsNull()? "" : myUnit->ToCString()); + switch (myFlag) { + case 1 : if (strcmp(unm,"IN") && strcmp(unm,"INCH")) + name = new TCollection_HAsciiString ("IN"); break; + case 2 : if (strcmp(unm,"MM")) + name = new TCollection_HAsciiString ("MM"); break; + case 3 : break; // nom libre + case 4 : if (strcmp(unm,"FT")) + name = new TCollection_HAsciiString ("FT"); break; + case 5 : if (strcmp(unm,"MI")) + name = new TCollection_HAsciiString ("MI"); break; + case 6 : if (strcmp(unm,"M")) + name = new TCollection_HAsciiString ("M"); break; + case 7 : if (strcmp(unm,"KM")) + name = new TCollection_HAsciiString ("KM"); break; + case 8 : if (strcmp(unm,"MIL")) + name = new TCollection_HAsciiString ("MIL"); break; + case 9 : if (strcmp(unm,"UM")) + name = new TCollection_HAsciiString ("UM"); break; + case 10 : if (strcmp(unm,"CM")) + name = new TCollection_HAsciiString ("CM"); break; + case 11 : if (strcmp(unm,"UIN")) + name = new TCollection_HAsciiString ("UIN"); break; + default : break; // on ne peut rien faire ... ? + } + if (!name.IsNull()) { + myUnit = name; + return Standard_True; + } + return Standard_False; +} + +void IGESGraph_DrawingUnits::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const +{ + S << "IGESGraph_DrawingUnits" << endl; + S << "No. of property values : 2" << endl; + S << " Units Flag : " << myFlag; + S << " Units Name : "; + IGESData_DumpString(S,myUnit); + S << " computed Value (in meters) : " << UnitValue(); + S << endl; +} diff --git a/src/IGESGraph/IGESGraph_DrawingUnits.hxx b/src/IGESGraph/IGESGraph_DrawingUnits.hxx index c1b75692d8..e5c5cd4532 100644 --- a/src/IGESGraph/IGESGraph_DrawingUnits.hxx +++ b/src/IGESGraph/IGESGraph_DrawingUnits.hxx @@ -17,18 +17,10 @@ #ifndef _IGESGraph_DrawingUnits_HeaderFile #define _IGESGraph_DrawingUnits_HeaderFile -#include -#include - -#include #include -#include class TCollection_HAsciiString; -class IGESGraph_DrawingUnits; -DEFINE_STANDARD_HANDLE(IGESGraph_DrawingUnits, IGESData_IGESEntity) - //! defines IGESDrawingUnits, Type <406> Form <17> //! in package IGESGraph //! @@ -36,56 +28,44 @@ DEFINE_STANDARD_HANDLE(IGESGraph_DrawingUnits, IGESData_IGESEntity) //! in the Drawing entity class IGESGraph_DrawingUnits : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 17; } + + IGESGraph_DrawingUnits() + : myFlag(1) + {} - - Standard_EXPORT IGESGraph_DrawingUnits(); - - //! This method is used to set the fields of the class - //! DrawingUnits - //! - nbProps : Number of property values (NP = 2) - //! - aFlag : DrawingUnits Flag - //! - aUnit : DrawingUnits Name - Standard_EXPORT void Init (const Standard_Integer nbProps, const Standard_Integer aFlag, const Handle(TCollection_HAsciiString)& aUnit); - - //! returns the number of property values in - Standard_EXPORT Standard_Integer NbPropertyValues() const; - //! returns the drawing space units of - Standard_EXPORT Standard_Integer Flag() const; - + Standard_Integer Flag() const { return myFlag; } + //! returns the name of the drawing space units of - Standard_EXPORT Handle(TCollection_HAsciiString) Unit() const; - + const Handle(TCollection_HAsciiString) & Unit() const { return myUnit; } + //! Computes the value of the unit, in meters, according Flag //! (same values as for GlobalSection from IGESData) Standard_EXPORT Standard_Real UnitValue() const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &) const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESGraph_DrawingUnits,IGESData_IGESEntity) - -protected: - - - - -private: + Standard_EXPORT virtual Standard_Boolean OwnCorrect () Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; - Standard_Integer theNbPropertyValues; - Standard_Integer theFlag; - Handle(TCollection_HAsciiString) theUnit; + DEFINE_STANDARD_RTTIEXT(IGESGraph_DrawingUnits,IGESData_IGESEntity) + private: + Standard_Integer myFlag; + Handle(TCollection_HAsciiString) myUnit; }; - - - - - - #endif // _IGESGraph_DrawingUnits_HeaderFile diff --git a/src/IGESGraph/IGESGraph_GeneralModule.cxx b/src/IGESGraph/IGESGraph_GeneralModule.cxx index 10affd49c0..7f9cfd3936 100644 --- a/src/IGESGraph/IGESGraph_GeneralModule.cxx +++ b/src/IGESGraph/IGESGraph_GeneralModule.cxx @@ -12,275 +12,11 @@ // commercial license or contractual agreement. -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_GeneralModule,IGESData_GeneralModule) - - void IGESGraph_GeneralModule::OwnSharedCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - Interface_EntityIterator& iter) const -{ - switch (CN) { - case 9 : { - DeclareAndCast(IGESGraph_LineFontDefTemplate,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolLineFontDefTemplate tool; - tool.OwnShared(anent,iter); - } - break; - case 12 : { - DeclareAndCast(IGESGraph_TextDisplayTemplate,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolTextDisplayTemplate tool; - tool.OwnShared(anent,iter); - } - break; - case 13 : { - DeclareAndCast(IGESGraph_TextFontDef,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolTextFontDef tool; - tool.OwnShared(anent,iter); - } - break; - default : break; - } -} - - - IGESData_DirChecker IGESGraph_GeneralModule::DirChecker - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESGraph_Color,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolColor tool; - return tool.DirChecker(anent); - } - case 2 : { - DeclareAndCast(IGESGraph_DefinitionLevel,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolDefinitionLevel tool; - return tool.DirChecker(anent); - } - case 3 : { - DeclareAndCast(IGESGraph_DrawingSize,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolDrawingSize tool; - return tool.DirChecker(anent); - } - case 4 : { - DeclareAndCast(IGESGraph_DrawingUnits,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolDrawingUnits tool; - return tool.DirChecker(anent); - } - case 5 : { - DeclareAndCast(IGESGraph_HighLight,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolHighLight tool; - return tool.DirChecker(anent); - } - case 6 : { - DeclareAndCast(IGESGraph_IntercharacterSpacing,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolIntercharacterSpacing tool; - return tool.DirChecker(anent); - } - case 7 : { - DeclareAndCast(IGESGraph_LineFontDefPattern,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolLineFontDefPattern tool; - return tool.DirChecker(anent); - } - case 8 : { - DeclareAndCast(IGESGraph_LineFontPredefined,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolLineFontPredefined tool; - return tool.DirChecker(anent); - } - case 9 : { - DeclareAndCast(IGESGraph_LineFontDefTemplate,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolLineFontDefTemplate tool; - return tool.DirChecker(anent); - } - case 10 : { - DeclareAndCast(IGESGraph_NominalSize,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolNominalSize tool; - return tool.DirChecker(anent); - } - case 11 : { - DeclareAndCast(IGESGraph_Pick,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolPick tool; - return tool.DirChecker(anent); - } - case 12 : { - DeclareAndCast(IGESGraph_TextDisplayTemplate,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolTextDisplayTemplate tool; - return tool.DirChecker(anent); - } - case 13 : { - DeclareAndCast(IGESGraph_TextFontDef,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolTextFontDef tool; - return tool.DirChecker(anent); - } - case 14 : { - DeclareAndCast(IGESGraph_UniformRectGrid,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolUniformRectGrid tool; - return tool.DirChecker(anent); - } - default : break; - } - return IGESData_DirChecker(); // by default, no specific criterium -} - - - void IGESGraph_GeneralModule::OwnCheckCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const -{ - switch (CN) { - case 3 : { - DeclareAndCast(IGESGraph_DrawingSize,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolDrawingSize tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 4 : { - DeclareAndCast(IGESGraph_DrawingUnits,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolDrawingUnits tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 5 : { - DeclareAndCast(IGESGraph_HighLight,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolHighLight tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 6 : { - DeclareAndCast(IGESGraph_IntercharacterSpacing,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolIntercharacterSpacing tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 7 : { - DeclareAndCast(IGESGraph_LineFontDefPattern,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolLineFontDefPattern tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 8 : { - DeclareAndCast(IGESGraph_LineFontPredefined,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolLineFontPredefined tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 9 : { - DeclareAndCast(IGESGraph_LineFontDefTemplate,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolLineFontDefTemplate tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 10 : { - DeclareAndCast(IGESGraph_NominalSize,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolNominalSize tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 11 : { - DeclareAndCast(IGESGraph_Pick,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolPick tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 14 : { - DeclareAndCast(IGESGraph_UniformRectGrid,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolUniformRectGrid tool; - tool.OwnCheck(anent,shares,ach); - } - break; - default : break; - } -} - - - Standard_Boolean IGESGraph_GeneralModule::NewVoid - (const Standard_Integer CN, Handle(Standard_Transient)& ent) const -{ - switch (CN) { - case 1 : ent = new IGESGraph_Color; break; - case 2 : ent = new IGESGraph_DefinitionLevel; break; - case 3 : ent = new IGESGraph_DrawingSize; break; - case 4 : ent = new IGESGraph_DrawingUnits; break; - case 5 : ent = new IGESGraph_HighLight; break; - case 6 : ent = new IGESGraph_IntercharacterSpacing; break; - case 7 : ent = new IGESGraph_LineFontDefPattern; break; - case 8 : ent = new IGESGraph_LineFontPredefined; break; - case 9 : ent = new IGESGraph_LineFontDefTemplate; break; - case 10 : ent = new IGESGraph_NominalSize; break; - case 11 : ent = new IGESGraph_Pick; break; - case 12 : ent = new IGESGraph_TextDisplayTemplate; break; - case 13 : ent = new IGESGraph_TextFontDef; break; - case 14 : ent = new IGESGraph_UniformRectGrid; break; - default : return Standard_False; // by default, Failure on Recognize - } - return Standard_True; -} - - Standard_Integer IGESGraph_GeneralModule::CategoryNumber (const Standard_Integer /*CN*/, const Handle(Standard_Transient)& , const Interface_ShareTool& ) const diff --git a/src/IGESGraph/IGESGraph_GeneralModule.hxx b/src/IGESGraph/IGESGraph_GeneralModule.hxx index c626f390b4..4e8f3f8958 100644 --- a/src/IGESGraph/IGESGraph_GeneralModule.hxx +++ b/src/IGESGraph/IGESGraph_GeneralModule.hxx @@ -32,21 +32,6 @@ class IGESGraph_GeneralModule : public IGESData_GeneralModule //! Creates a GeneralModule from IGESGraph and puts it into GeneralLib IGESGraph_GeneralModule() {} - //! Lists the Entities shared by a given IGESEntity , from - //! its specific parameters : specific for each type - Standard_EXPORT void OwnSharedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - - //! Returns a DirChecker, specific for each type of Entity - //! (identified by its Case Number) : this DirChecker defines - //! constraints which must be respected by the DirectoryPart - Standard_EXPORT IGESData_DirChecker DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - - //! Performs Specific Semantic Check for each type of Entity - Standard_EXPORT void OwnCheckCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE; - - //! Specific creation of a new void entity - Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE; - //! Returns a category number which characterizes an entity //! Drawing for all Standard_EXPORT virtual Standard_Integer CategoryNumber (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares) const Standard_OVERRIDE; diff --git a/src/IGESGraph/IGESGraph_HArray1OfColor.hxx b/src/IGESGraph/IGESGraph_HArray1OfColor.hxx index bd0f76576d..b15284c83a 100644 --- a/src/IGESGraph/IGESGraph_HArray1OfColor.hxx +++ b/src/IGESGraph/IGESGraph_HArray1OfColor.hxx @@ -17,11 +17,9 @@ #ifndef IGESGraph_HArray1OfColor_HeaderFile #define IGESGraph_HArray1OfColor_HeaderFile -#include #include #include DEFINE_HARRAY1(IGESGraph_HArray1OfColor, IGESGraph_Array1OfColor) - #endif diff --git a/src/IGESGraph/IGESGraph_HArray1OfTextDisplayTemplate.hxx b/src/IGESGraph/IGESGraph_HArray1OfTextDisplayTemplate.hxx index 913d5879d5..292364f7dc 100644 --- a/src/IGESGraph/IGESGraph_HArray1OfTextDisplayTemplate.hxx +++ b/src/IGESGraph/IGESGraph_HArray1OfTextDisplayTemplate.hxx @@ -17,11 +17,9 @@ #ifndef IGESGraph_HArray1OfTextDisplayTemplate_HeaderFile #define IGESGraph_HArray1OfTextDisplayTemplate_HeaderFile -#include #include #include DEFINE_HARRAY1(IGESGraph_HArray1OfTextDisplayTemplate, IGESGraph_Array1OfTextDisplayTemplate) - #endif diff --git a/src/IGESGraph/IGESGraph_HighLight.cxx b/src/IGESGraph/IGESGraph_HighLight.cxx index 82d7895c88..57e26aea93 100644 --- a/src/IGESGraph/IGESGraph_HighLight.cxx +++ b/src/IGESGraph/IGESGraph_HighLight.cxx @@ -17,32 +17,49 @@ //-------------------------------------------------------------------- #include -#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_HighLight,IGESData_IGESEntity) -IGESGraph_HighLight::IGESGraph_HighLight () { } +void IGESGraph_HighLight::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer aNbPropertyValues = 0; + PR.ReadInteger(aNbPropertyValues,"No. of property values"); + if (aNbPropertyValues != 1) + PR.AddFail("No. of Property values : Value is not 1"); - - void IGESGraph_HighLight::Init - (const Standard_Integer nbProps, const Standard_Integer aHighLightStatus) -{ - theNbPropertyValues = nbProps; - theHighLight = aHighLightStatus; - InitTypeAndForm(406,20); + myHighLight = 0; // Default Value + PR.ReadInteger(myHighLight,"Highlight flag"); } - Standard_Integer IGESGraph_HighLight::NbPropertyValues () const -{ - return theNbPropertyValues; +void IGESGraph_HighLight::OwnWrite (IGESData_IGESWriter& IW) const +{ + IW.Send(1); + IW.Send(myHighLight); } - Standard_Integer IGESGraph_HighLight::HighLightStatus () const -{ - return theHighLight; +IGESData_DirChecker IGESGraph_HighLight::DirChecker () const +{ + IGESData_DirChecker DC (406, 20); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } - Standard_Boolean IGESGraph_HighLight::IsHighLighted () const +void IGESGraph_HighLight::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const { - return (theHighLight != 0); + S << "IGESGraph_HighLight" << endl; + S << "No. of property values : 1" << endl; + S << "Highlight Status : " << myHighLight << endl; + S << endl; } diff --git a/src/IGESGraph/IGESGraph_HighLight.hxx b/src/IGESGraph/IGESGraph_HighLight.hxx index 84c1ed9aa9..50188bf6ff 100644 --- a/src/IGESGraph/IGESGraph_HighLight.hxx +++ b/src/IGESGraph/IGESGraph_HighLight.hxx @@ -35,51 +35,36 @@ DEFINE_STANDARD_HANDLE(IGESGraph_HighLight, IGESData_IGESEntity) //! displayed in some system dependent manner class IGESGraph_HighLight : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 20; } + + IGESGraph_HighLight() + : myHighLight(0) + {} - - Standard_EXPORT IGESGraph_HighLight(); - - //! This method is used to set the fields of the class - //! HighLight - //! - nbProps : Number of property values (NP = 1) - //! - aHighLightStatus : HighLight Flag - Standard_EXPORT void Init (const Standard_Integer nbProps, const Standard_Integer aHighLightStatus); - - //! returns the number of property values in - Standard_EXPORT Standard_Integer NbPropertyValues() const; - //! returns 0 if is not highlighted(default), //! 1 if is highlighted - Standard_EXPORT Standard_Integer HighLightStatus() const; - + Standard_Integer HighLightStatus() const { return myHighLight; } + //! returns True if entity is highlighted - Standard_EXPORT Standard_Boolean IsHighLighted() const; + Standard_Boolean IsHighLighted() const { return (myHighLight != 0); } + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESGraph_HighLight,IGESData_IGESEntity) -protected: - - - - -private: - - - Standard_Integer theNbPropertyValues; - Standard_Integer theHighLight; - + private: + Standard_Integer myHighLight; }; - - - - - - #endif // _IGESGraph_HighLight_HeaderFile diff --git a/src/IGESGraph/IGESGraph_IntercharacterSpacing.cxx b/src/IGESGraph/IGESGraph_IntercharacterSpacing.cxx index 4ef95ed832..b5c97f756a 100644 --- a/src/IGESGraph/IGESGraph_IntercharacterSpacing.cxx +++ b/src/IGESGraph/IGESGraph_IntercharacterSpacing.cxx @@ -17,26 +17,54 @@ //-------------------------------------------------------------------- #include -#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_IntercharacterSpacing,IGESData_IGESEntity) -IGESGraph_IntercharacterSpacing::IGESGraph_IntercharacterSpacing () { } +void IGESGraph_IntercharacterSpacing::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer aNbPropertyValues = 0; + PR.ReadInteger(aNbPropertyValues,"No. of property values"); + if (aNbPropertyValues != 1) + PR.AddFail("No. of Property values : Value is not 1"); - void IGESGraph_IntercharacterSpacing::Init - (const Standard_Integer nbProps, const Standard_Real anISpace) -{ - theNbPropertyValues = nbProps; - theISpace = anISpace; - InitTypeAndForm(406,18); + PR.ReadReal(myISpace,"Intercharacter space in % of text height"); +} + +void IGESGraph_IntercharacterSpacing::OwnWrite (IGESData_IGESWriter& IW) const +{ + IW.Send(1); + IW.Send(myISpace); +} + +IGESData_DirChecker IGESGraph_IntercharacterSpacing::DirChecker () const +{ + IGESData_DirChecker DC (406, 18); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } - Standard_Integer IGESGraph_IntercharacterSpacing::NbPropertyValues () const +void IGESGraph_IntercharacterSpacing::OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &ach) const { - return theNbPropertyValues; + if ((myISpace < 0.0) || (myISpace > 100.0)) + ach->AddFail("Intercharacter Space : Value not in the range [0-100]"); } - Standard_Real IGESGraph_IntercharacterSpacing::ISpace () const +void IGESGraph_IntercharacterSpacing::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const { - return theISpace; + S << "IGESGraph_IntercharacterSpacing" << endl; + S << "No. of property values : 1" << endl; + S << "Intercharacter space in % of text height : " << myISpace << endl; + S << endl; } diff --git a/src/IGESGraph/IGESGraph_IntercharacterSpacing.hxx b/src/IGESGraph/IGESGraph_IntercharacterSpacing.hxx index d874ec523b..2f5592bf1f 100644 --- a/src/IGESGraph/IGESGraph_IntercharacterSpacing.hxx +++ b/src/IGESGraph/IGESGraph_IntercharacterSpacing.hxx @@ -17,17 +17,9 @@ #ifndef _IGESGraph_IntercharacterSpacing_HeaderFile #define _IGESGraph_IntercharacterSpacing_HeaderFile -#include -#include - -#include -#include #include -class IGESGraph_IntercharacterSpacing; -DEFINE_STANDARD_HANDLE(IGESGraph_IntercharacterSpacing, IGESData_IGESEntity) - //! defines IGESIntercharacterSpacing, Type <406> Form <18> //! in package IGESGraph //! @@ -35,48 +27,35 @@ DEFINE_STANDARD_HANDLE(IGESGraph_IntercharacterSpacing, IGESData_IGESEntity) //! spacing is used class IGESGraph_IntercharacterSpacing : public IGESData_IGESEntity { + public: -public: - - - Standard_EXPORT IGESGraph_IntercharacterSpacing(); - - //! This method is used to set the fields of the class - //! IntercharacterSpacing - //! - nbProps : Number of property values (NP = 1) - //! - anISpace : Intercharacter spacing percentage - Standard_EXPORT void Init (const Standard_Integer nbProps, const Standard_Real anISpace); - - //! returns the number of property values in - Standard_EXPORT Standard_Integer NbPropertyValues() const; - - //! returns the Intercharacter Space of in percentage - //! of the text height (Range = 0..100) - Standard_EXPORT Standard_Real ISpace() const; - - + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 18; } - DEFINE_STANDARD_RTTIEXT(IGESGraph_IntercharacterSpacing,IGESData_IGESEntity) - -protected: + IGESGraph_IntercharacterSpacing() + : myISpace(0) + {} + //! returns the Intercharacter Space of in percentage + //! of the text height (Range = 0..100) + Standard_Real ISpace() const { return myISpace; } + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; -private: + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; - Standard_Integer theNbPropertyValues; - Standard_Real theISpace; + DEFINE_STANDARD_RTTIEXT(IGESGraph_IntercharacterSpacing,IGESData_IGESEntity) + private: + Standard_Real myISpace; }; - - - - - - #endif // _IGESGraph_IntercharacterSpacing_HeaderFile diff --git a/src/IGESGraph/IGESGraph_LineFontDefPattern.cxx b/src/IGESGraph/IGESGraph_LineFontDefPattern.cxx index d763a35b36..3d8921953c 100644 --- a/src/IGESGraph/IGESGraph_LineFontDefPattern.cxx +++ b/src/IGESGraph/IGESGraph_LineFontDefPattern.cxx @@ -17,62 +17,106 @@ //-------------------------------------------------------------------- #include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_LineFontDefPattern,IGESData_LineFontEntity) -IGESGraph_LineFontDefPattern::IGESGraph_LineFontDefPattern () { } - +Standard_Integer IGESGraph_LineFontDefPattern::NbSegments () const +{ + return mySegmentLengths->Length(); +} -// This class inherits from IGESData_LineFontEntity +Standard_Real IGESGraph_LineFontDefPattern::Length (const Standard_Integer Index) const +{ + return mySegmentLengths->Value(Index); +} - void IGESGraph_LineFontDefPattern::Init - (const Handle(TColStd_HArray1OfReal)& allSegLength, - const Handle(TCollection_HAsciiString)& aPattern) +Standard_Boolean IGESGraph_LineFontDefPattern::IsVisible (const Standard_Integer Index) const { - if (allSegLength->Lower() != 1) - Standard_DimensionMismatch::Raise("IGESGraph_LineFontDefPattern : Init"); - theSegmentLengths = allSegLength; - theDisplayPattern = aPattern; - InitTypeAndForm(304,2); + const Standard_Integer nbSegs = mySegmentLengths->Length(); + if (Index <= 0 || Index > nbSegs) + return Standard_False; + + // Get the Character out of String, which contains the required BIT + char tempStr[2]; + const Standard_Integer length = myDisplayPattern->Length(); + tempStr[0] = myDisplayPattern->Value(length - ((nbSegs - Index) / 4)); + tempStr[1] = 0; + const Standard_Integer tempVal = (Standard_Integer) strtol(tempStr, (char **)NULL, 16); + // Now get the BIT out of tempVal + Standard_Integer mask = 0x01; + mask <<= ((nbSegs - Index) % 4); + return ((tempVal & mask) != 0); } - Standard_Integer IGESGraph_LineFontDefPattern::NbSegments () const +void IGESGraph_LineFontDefPattern::OwnRead (IGESFile_Reader &PR) { - return theSegmentLengths->Length(); + Standard_Integer aNbSeg = 0; + PR.ReadInteger(aNbSeg,"Number of Visible-Blank Segments"); + if (aNbSeg > 0) + { + mySegmentLengths = new TColStd_HArray1OfReal(1, aNbSeg); + for (Standard_Integer i = 1; i <= aNbSeg; i++) + PR.ReadReal(mySegmentLengths->ChangeValue(i),"Length of Segment"); + } + else PR.AddFail("Number of Visible-Blank Segments : Not Positive"); + + PR.ReadText(myDisplayPattern,"Visible-Blank Display Pattern"); } - Standard_Real IGESGraph_LineFontDefPattern::Length - (const Standard_Integer Index) const +void IGESGraph_LineFontDefPattern::OwnWrite (IGESData_IGESWriter& IW) const { - return theSegmentLengths->Value(Index); - // if Index is out of bound HArray1 will raise OutOfRange exception + const Standard_Integer nb = mySegmentLengths->Length(); + IW.Send(nb); + for (Standard_Integer i = 1; i <= nb; i++) + IW.Send(mySegmentLengths->Value(i)); + IW.Send(myDisplayPattern); } - Handle(TCollection_HAsciiString) IGESGraph_LineFontDefPattern::DisplayPattern - () const +IGESData_DirChecker IGESGraph_LineFontDefPattern::DirChecker () const { - return theDisplayPattern; + IGESData_DirChecker DC(304, 2); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefValue); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.SubordinateStatusRequired(0); + DC.UseFlagRequired(2); + DC.HierarchyStatusIgnored(); + + return DC; } - Standard_Boolean IGESGraph_LineFontDefPattern::IsVisible - (const Standard_Integer Index) const +void IGESGraph_LineFontDefPattern::OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &ach) const { - Standard_Integer nbSegs = theSegmentLengths->Length(); - if (Index <= 0 || Index > nbSegs) return Standard_False; + if (RankLineFont() == 0) + ach->AddWarning("Line Font Rank is zero"); + else if (RankLineFont() < 1 || RankLineFont() > 5) + ach->AddWarning("Invalid Value As Line Font Rank(Valid Range 1 to 5)"); +} - // Get the Character out of String, which contains the required BIT - char tempStr[2]; - Standard_Integer length = theDisplayPattern->Length(); - tempStr[0] = theDisplayPattern->Value(length - ((nbSegs - Index) / 4)); - tempStr[1] = 0; - Standard_Integer tempVal = - (Standard_Integer) strtol(tempStr, (char **)NULL, 16); - // Now get the BIT out of tempVal - Standard_Integer mask = 0x01; - mask <<= ((nbSegs - Index) % 4); - return ((tempVal & mask) != 0); +void IGESGraph_LineFontDefPattern::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer level) const +{ + S << "IGESGraph_LineFontDefPattern" << endl; + S << "Visible-Blank Segments : "; + const Standard_Integer nb = mySegmentLengths->Length(); + IGESData_DumpVals(S,level,1,nb,Length); + S < 4) { + S << " -> Which Segments are Visible (the others are Blank) : " << endl; + for (Standard_Integer i = 1; i <= nb; i++) { + if (IsVisible(i)) S << " " << i; + } + S << endl; + } } diff --git a/src/IGESGraph/IGESGraph_LineFontDefPattern.hxx b/src/IGESGraph/IGESGraph_LineFontDefPattern.hxx index 59c2d2424f..d493cce062 100644 --- a/src/IGESGraph/IGESGraph_LineFontDefPattern.hxx +++ b/src/IGESGraph/IGESGraph_LineFontDefPattern.hxx @@ -17,20 +17,10 @@ #ifndef _IGESGraph_LineFontDefPattern_HeaderFile #define _IGESGraph_LineFontDefPattern_HeaderFile -#include -#include - -#include #include -#include -#include -#include class TCollection_HAsciiString; -class Standard_OutOfRange; - +class TColStd_HArray1OfReal; -class IGESGraph_LineFontDefPattern; -DEFINE_STANDARD_HANDLE(IGESGraph_LineFontDefPattern, IGESData_LineFontEntity) //! defines IGESLineFontDefPattern, Type <304> Form <2> //! in package IGESGraph @@ -41,17 +31,13 @@ DEFINE_STANDARD_HANDLE(IGESGraph_LineFontDefPattern, IGESData_LineFontEntity) //! according to the basic pattern. class IGESGraph_LineFontDefPattern : public IGESData_LineFontEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 304; } - - Standard_EXPORT IGESGraph_LineFontDefPattern(); - - //! This method is used to set the fields of the class - //! LineFontDefPattern - //! - allSegLength : Containing lengths of respective segments - //! - aPattern : HAsciiString indicating visible-blank segments - Standard_EXPORT void Init (const Handle(TColStd_HArray1OfReal)& allSegLength, const Handle(TCollection_HAsciiString)& aPattern); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 2; } + + IGESGraph_LineFontDefPattern() {} //! returns the number of segments in the visible-blank pattern Standard_EXPORT Standard_Integer NbSegments() const; @@ -67,8 +53,8 @@ public: //! segments 2, 3 and 5 are visible, whereas segments 1 and 4 are //! blank. The method returns "2H16" as the HAsciiString. //! Note: The bits are right justified. (16h = 10110) - Standard_EXPORT Handle(TCollection_HAsciiString) DisplayPattern() const; - + const Handle(TCollection_HAsciiString) & DisplayPattern() const { return myDisplayPattern; } + //! The Display Pattern is decrypted to //! return True if the Index'th basic pattern is Visible, //! False otherwise. @@ -76,29 +62,22 @@ public: //! False. Standard_EXPORT Standard_Boolean IsVisible (const Standard_Integer Index) const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &) const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESGraph_LineFontDefPattern,IGESData_LineFontEntity) - -protected: - - - - -private: - + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; - Handle(TColStd_HArray1OfReal) theSegmentLengths; - Handle(TCollection_HAsciiString) theDisplayPattern; + DEFINE_STANDARD_RTTIEXT(IGESGraph_LineFontDefPattern,IGESData_LineFontEntity) + private: + Handle(TColStd_HArray1OfReal) mySegmentLengths; + Handle(TCollection_HAsciiString) myDisplayPattern; }; - - - - - - #endif // _IGESGraph_LineFontDefPattern_HeaderFile diff --git a/src/IGESGraph/IGESGraph_LineFontDefTemplate.cxx b/src/IGESGraph/IGESGraph_LineFontDefTemplate.cxx index 6a03e393e1..10d6ae9f61 100644 --- a/src/IGESGraph/IGESGraph_LineFontDefTemplate.cxx +++ b/src/IGESGraph/IGESGraph_LineFontDefTemplate.cxx @@ -18,45 +18,68 @@ #include #include -#include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_LineFontDefTemplate,IGESData_LineFontEntity) -IGESGraph_LineFontDefTemplate::IGESGraph_LineFontDefTemplate () { } - - -// This class inherits from IGESData_LineFontEntity +void IGESGraph_LineFontDefTemplate::OwnRead (IGESFile_Reader &PR) +{ + PR.ReadInteger(myOrientation,"Template Orientation"); + PR.ReadPointer(myTemplateEntity,"Subfigure Definition Entity for Template Display"); + PR.ReadReal(myDistance,"Distance between successive Template"); + PR.ReadReal(myScale,"Scale Factor For Subfigure"); +} - void IGESGraph_LineFontDefTemplate::Init - (const Standard_Integer anOrientation, - const Handle(IGESBasic_SubfigureDef)& aTemplate, - const Standard_Real aDistance, - const Standard_Real aScale) +void IGESGraph_LineFontDefTemplate::OwnWrite (IGESData_IGESWriter &IW) const { - theOrientation = anOrientation; - theTemplateEntity = aTemplate; - theDistance = aDistance; - theScale = aScale; - InitTypeAndForm(304,1); + IW.Send(myOrientation); + IW.Send(myTemplateEntity); + IW.Send(myDistance); + IW.Send(myScale); } - Standard_Integer IGESGraph_LineFontDefTemplate::Orientation () const +void IGESGraph_LineFontDefTemplate::OwnShared (Interface_EntityIterator &theIter) const { - return theOrientation; + theIter.GetOneItem(myTemplateEntity); } - Handle(IGESBasic_SubfigureDef) IGESGraph_LineFontDefTemplate::TemplateEntity - () const +IGESData_DirChecker IGESGraph_LineFontDefTemplate::DirChecker () const { - return theTemplateEntity; + IGESData_DirChecker DC(304, 1); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefValue); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.SubordinateStatusRequired(0); + DC.UseFlagRequired(2); + DC.HierarchyStatusIgnored(); + return DC; } - Standard_Real IGESGraph_LineFontDefTemplate::Distance () const +void IGESGraph_LineFontDefTemplate::OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &ach) const { - return theDistance; + if (RankLineFont() == 0) + ach->AddWarning("Line Font Rank is zero"); + else if ((RankLineFont() < 1) || (RankLineFont() > 5)) + ach->AddWarning("Invalid Value As Line Font Rank"); } - Standard_Real IGESGraph_LineFontDefTemplate::Scale () const +void IGESGraph_LineFontDefTemplate::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const { - return theScale; + Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1; + S << "IGESGraph_LineFontDefTemplate" << endl; + S << "Orientation : " << myOrientation << endl; + S << "Subfigure Display Entity For Template Display : "; + dumper.Dump(myTemplateEntity,S,tempSubLevel); + S << endl; + S << "Length Between Successive Template Figure : " << myDistance << endl; + S << "Scale Factor for Subfigure : " << myScale << endl; + S << endl; } diff --git a/src/IGESGraph/IGESGraph_LineFontDefTemplate.hxx b/src/IGESGraph/IGESGraph_LineFontDefTemplate.hxx index 5e7284b22e..28faae4538 100644 --- a/src/IGESGraph/IGESGraph_LineFontDefTemplate.hxx +++ b/src/IGESGraph/IGESGraph_LineFontDefTemplate.hxx @@ -17,18 +17,10 @@ #ifndef _IGESGraph_LineFontDefTemplate_HeaderFile #define _IGESGraph_LineFontDefTemplate_HeaderFile -#include -#include - -#include -#include #include class IGESBasic_SubfigureDef; -class IGESGraph_LineFontDefTemplate; -DEFINE_STANDARD_HANDLE(IGESGraph_LineFontDefTemplate, IGESData_LineFontEntity) - //! defines IGESLineFontDefTemplate, Type <304> Form <1> //! in package IGESGraph //! @@ -38,21 +30,17 @@ DEFINE_STANDARD_HANDLE(IGESGraph_LineFontDefTemplate, IGESData_LineFontEntity) //! no visual purpose. class IGESGraph_LineFontDefTemplate : public IGESData_LineFontEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 304; } - - Standard_EXPORT IGESGraph_LineFontDefTemplate(); - - //! This method is used to set the fields of the class - //! LineFontDefTemplate - //! - anOrientation : Orientation of Template figure on - //! anchoring curve - //! - aTemplate : SubfigureDef entity used as Template figure - //! - aDistance : Distance between the neighbouring Template - //! figures - //! - aScale : Scale factor applied to the Template figure - Standard_EXPORT void Init (const Standard_Integer anOrientation, const Handle(IGESBasic_SubfigureDef)& aTemplate, const Standard_Real aDistance, const Standard_Real aScale); + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 1; } + + IGESGraph_LineFontDefTemplate() + : myOrientation(0), + myDistance(0.), + myScale(1.) + {} //! if return value = 0, Each Template display is oriented by aligning //! the axis of the SubfigureDef with the axis of @@ -63,44 +51,39 @@ public: //! incidence of the curve and the origin of //! subfigure. //! Similarly Z-axis is aligned. - Standard_EXPORT Standard_Integer Orientation() const; - + Standard_Integer Orientation() const { return myOrientation; } + //! returns SubfigureDef as the Entity used as Template figure. - Standard_EXPORT Handle(IGESBasic_SubfigureDef) TemplateEntity() const; - + const Handle(IGESBasic_SubfigureDef) & TemplateEntity() const { return myTemplateEntity; } + //! returns the Distance between any two Template figures on the //! anchoring curve. - Standard_EXPORT Standard_Real Distance() const; - + Standard_Real Distance() const { return myDistance; } + //! returns the Scaling factor applied to SubfigureDef to form //! Template figure. - Standard_EXPORT Standard_Real Scale() const; - - - - - DEFINE_STANDARD_RTTIEXT(IGESGraph_LineFontDefTemplate,IGESData_LineFontEntity) - -protected: + Standard_Real Scale() const { return myScale; } + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; -private: + Standard_EXPORT virtual void OwnCheck (const Interface_ShareTool &, Handle(Interface_Check) &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; - Standard_Integer theOrientation; - Handle(IGESBasic_SubfigureDef) theTemplateEntity; - Standard_Real theDistance; - Standard_Real theScale; + DEFINE_STANDARD_RTTIEXT(IGESGraph_LineFontDefTemplate,IGESData_LineFontEntity) + private: + Standard_Integer myOrientation; + Interface_Pointer myTemplateEntity; + Standard_Real myDistance; + Standard_Real myScale; }; - - - - - - #endif // _IGESGraph_LineFontDefTemplate_HeaderFile diff --git a/src/IGESGraph/IGESGraph_LineFontPredefined.cxx b/src/IGESGraph/IGESGraph_LineFontPredefined.cxx index 2d2d0e729e..5dd4a0966a 100644 --- a/src/IGESGraph/IGESGraph_LineFontPredefined.cxx +++ b/src/IGESGraph/IGESGraph_LineFontPredefined.cxx @@ -17,27 +17,48 @@ //-------------------------------------------------------------------- #include -#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_LineFontPredefined,IGESData_IGESEntity) -IGESGraph_LineFontPredefined::IGESGraph_LineFontPredefined () { } +void IGESGraph_LineFontPredefined::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer aNbPropertyValues = 0; + PR.ReadInteger(aNbPropertyValues,"No. of property values"); + if (aNbPropertyValues != 1) + PR.AddFail("No. of Property values : Value is not 1"); + PR.ReadInteger(myLineFontPatternCode,"Line Font Pattern Code"); +} - void IGESGraph_LineFontPredefined::Init - (const Standard_Integer nbProps, const Standard_Integer aLineFontPatternCode) -{ - theNbPropertyValues = nbProps; - theLineFontPatternCode = aLineFontPatternCode; - InitTypeAndForm(406,19); +void IGESGraph_LineFontPredefined::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(1); + IW.Send(myLineFontPatternCode); } - Standard_Integer IGESGraph_LineFontPredefined::NbPropertyValues () const -{ - return theNbPropertyValues; +IGESData_DirChecker IGESGraph_LineFontPredefined::DirChecker () const +{ + IGESData_DirChecker DC (406, 19); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } - Standard_Integer IGESGraph_LineFontPredefined::LineFontPatternCode () const +void IGESGraph_LineFontPredefined::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const { - return theLineFontPatternCode; + S << "IGESGraph_LineFontPredefined" << endl; + S << "No. of property values : 1" << endl; + S << "Line font pattern code : " << myLineFontPatternCode << endl; + S << endl; } diff --git a/src/IGESGraph/IGESGraph_LineFontPredefined.hxx b/src/IGESGraph/IGESGraph_LineFontPredefined.hxx index 2ab2019c05..65ae7ae067 100644 --- a/src/IGESGraph/IGESGraph_LineFontPredefined.hxx +++ b/src/IGESGraph/IGESGraph_LineFontPredefined.hxx @@ -17,16 +17,9 @@ #ifndef _IGESGraph_LineFontPredefined_HeaderFile #define _IGESGraph_LineFontPredefined_HeaderFile -#include -#include - -#include #include -class IGESGraph_LineFontPredefined; -DEFINE_STANDARD_HANDLE(IGESGraph_LineFontPredefined, IGESData_IGESEntity) - //! defines IGESLineFontPredefined, Type <406> Form <19> //! in package IGESGraph //! @@ -35,47 +28,32 @@ DEFINE_STANDARD_HANDLE(IGESGraph_LineFontPredefined, IGESData_IGESEntity) //! Directory Entry Field 4 class IGESGraph_LineFontPredefined : public IGESData_IGESEntity { + public: -public: - - - Standard_EXPORT IGESGraph_LineFontPredefined(); - - //! This method is used to set the fields of the class - //! LineFontPredefined - //! - nbProps : Number of property values (NP = 1) - //! - aLineFontPatternCode : Line Font Pattern Code - Standard_EXPORT void Init (const Standard_Integer nbProps, const Standard_Integer aLineFontPatternCode); - - //! returns the number of property values in - Standard_EXPORT Standard_Integer NbPropertyValues() const; - - //! returns the Line Font Pattern Code of - Standard_EXPORT Standard_Integer LineFontPatternCode() const; - - - + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } - DEFINE_STANDARD_RTTIEXT(IGESGraph_LineFontPredefined,IGESData_IGESEntity) - -protected: + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 19; } + IGESGraph_LineFontPredefined() + : myLineFontPatternCode(0) + {} + //! returns the Line Font Pattern Code of + Standard_Integer LineFontPatternCode() const { return myLineFontPatternCode; } + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; -private: + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; - Standard_Integer theNbPropertyValues; - Standard_Integer theLineFontPatternCode; + DEFINE_STANDARD_RTTIEXT(IGESGraph_LineFontPredefined,IGESData_IGESEntity) + private: + Standard_Integer myLineFontPatternCode; }; - - - - - - #endif // _IGESGraph_LineFontPredefined_HeaderFile diff --git a/src/IGESGraph/IGESGraph_NominalSize.cxx b/src/IGESGraph/IGESGraph_NominalSize.cxx index e80f120fc6..a5a2a8bfab 100644 --- a/src/IGESGraph/IGESGraph_NominalSize.cxx +++ b/src/IGESGraph/IGESGraph_NominalSize.cxx @@ -17,48 +17,62 @@ //-------------------------------------------------------------------- #include -#include #include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_NominalSize,IGESData_IGESEntity) -IGESGraph_NominalSize::IGESGraph_NominalSize () { } +void IGESGraph_NominalSize::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer aNbPropertyValues = 0; + PR.ReadInteger(aNbPropertyValues,"No. of property values"); + if ( (aNbPropertyValues != 2) && (aNbPropertyValues != 3) ) + PR.AddFail("No. of Property values : Value is not 2/3"); - - void IGESGraph_NominalSize::Init - (const Standard_Integer nbProps, - const Standard_Real aNominalSizeValue, - const Handle(TCollection_HAsciiString)& aNominalSizeName, - const Handle(TCollection_HAsciiString)& aStandardName) -{ - theNbPropertyValues = nbProps; - theNominalSizeValue = aNominalSizeValue; - theNominalSizeName = aNominalSizeName; - theStandardName = aStandardName; - InitTypeAndForm(406,13); -} - - Standard_Integer IGESGraph_NominalSize::NbPropertyValues () const -{ - return theNbPropertyValues; + PR.ReadReal(myNominalSizeValue,"Nominal size value"); + PR.ReadText(myNominalSizeName,"Nominal size name"); + if (aNbPropertyValues > 2) + PR.ReadText(myStandardName,"Name of relevant engg. standard"); } - Standard_Real IGESGraph_NominalSize::NominalSizeValue () const -{ - return theNominalSizeValue; +void IGESGraph_NominalSize::OwnWrite (IGESData_IGESWriter &IW) const +{ + const Standard_Integer aNbPropertyValues = myStandardName.IsNull()? 2 : 3; + IW.Send(aNbPropertyValues); + IW.Send(myNominalSizeValue); + IW.Send(myNominalSizeName); + if (aNbPropertyValues > 2) + IW.Send(myStandardName); } - Handle(TCollection_HAsciiString) IGESGraph_NominalSize::NominalSizeName () const -{ - return theNominalSizeName; -} - - Standard_Boolean IGESGraph_NominalSize::HasStandardName () const -{ - return (! theStandardName.IsNull() ); +IGESData_DirChecker IGESGraph_NominalSize::DirChecker () const +{ + IGESData_DirChecker DC (406, 13); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } - Handle(TCollection_HAsciiString) IGESGraph_NominalSize::StandardName () const +void IGESGraph_NominalSize::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const { - return theStandardName; + S << "IGESGraph_NominalSize" << endl; + const Standard_Integer aNbPropertyValues = myStandardName.IsNull()? 2 : 3; + S << "No. of property values : " << aNbPropertyValues << endl; + S << "Nominal size value : " << myNominalSizeValue << endl; + S << "Nominal size name : "; + IGESData_DumpString(S,myNominalSizeName); + S << endl; + S << "Name of relevant engineering standard : "; + IGESData_DumpString(S,myStandardName); + S << endl; } diff --git a/src/IGESGraph/IGESGraph_NominalSize.hxx b/src/IGESGraph/IGESGraph_NominalSize.hxx index bf6d1e0a0f..5e9c15cdb8 100644 --- a/src/IGESGraph/IGESGraph_NominalSize.hxx +++ b/src/IGESGraph/IGESGraph_NominalSize.hxx @@ -17,19 +17,10 @@ #ifndef _IGESGraph_NominalSize_HeaderFile #define _IGESGraph_NominalSize_HeaderFile -#include -#include - -#include -#include #include -#include class TCollection_HAsciiString; -class IGESGraph_NominalSize; -DEFINE_STANDARD_HANDLE(IGESGraph_NominalSize, IGESData_IGESEntity) - //! defines IGESNominalSize, Type <406> Form <13> //! in package IGESGraph //! @@ -37,61 +28,44 @@ DEFINE_STANDARD_HANDLE(IGESGraph_NominalSize, IGESData_IGESEntity) //! reference to an engineering standard class IGESGraph_NominalSize : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 13; } + + IGESGraph_NominalSize() + : myNominalSizeValue(0.) + {} - - Standard_EXPORT IGESGraph_NominalSize(); - - //! This method is used to set the fields of the class - //! NominalSize - //! - nbProps : Number of property values (2 or 3) - //! - aNominalSizeValue : NominalSize Value - //! - aNominalSizeName : NominalSize Name - //! - aStandardName : Name of relevant engineering standard - Standard_EXPORT void Init (const Standard_Integer nbProps, const Standard_Real aNominalSizeValue, const Handle(TCollection_HAsciiString)& aNominalSizeName, const Handle(TCollection_HAsciiString)& aStandardName); - - //! returns the number of property values in - Standard_EXPORT Standard_Integer NbPropertyValues() const; - //! returns the value of - Standard_EXPORT Standard_Real NominalSizeValue() const; - + Standard_Real NominalSizeValue() const { return myNominalSizeValue; } + //! returns the name of - Standard_EXPORT Handle(TCollection_HAsciiString) NominalSizeName() const; - + const Handle(TCollection_HAsciiString) & NominalSizeName() const { return myNominalSizeName; } + //! returns True if an engineering Standard is defined for //! else, returns False - Standard_EXPORT Standard_Boolean HasStandardName() const; - - //! returns the name of the relevant engineering standard of - Standard_EXPORT Handle(TCollection_HAsciiString) StandardName() const; + Standard_Boolean HasStandardName() const { return (! myStandardName.IsNull() ); } + //! returns the name of the relevant engineering standard of + const Handle(TCollection_HAsciiString) & StandardName() const { return myStandardName; } + + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESGraph_NominalSize,IGESData_IGESEntity) -protected: - - - - -private: - - - Standard_Integer theNbPropertyValues; - Standard_Real theNominalSizeValue; - Handle(TCollection_HAsciiString) theNominalSizeName; - Handle(TCollection_HAsciiString) theStandardName; - + private: + Standard_Real myNominalSizeValue; + Handle(TCollection_HAsciiString) myNominalSizeName; + Handle(TCollection_HAsciiString) myStandardName; }; - - - - - - #endif // _IGESGraph_NominalSize_HeaderFile diff --git a/src/IGESGraph/IGESGraph_Pick.cxx b/src/IGESGraph/IGESGraph_Pick.cxx index 38a4b2eb54..023f8bd67c 100644 --- a/src/IGESGraph/IGESGraph_Pick.cxx +++ b/src/IGESGraph/IGESGraph_Pick.cxx @@ -17,32 +17,52 @@ //-------------------------------------------------------------------- #include -#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_Pick,IGESData_IGESEntity) -IGESGraph_Pick::IGESGraph_Pick () { } +void IGESGraph_Pick::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer aNbPropertyValues = 0; + PR.ReadInteger(aNbPropertyValues,"No. of property values"); + if (aNbPropertyValues != 1) + PR.AddFail("No. of Property values : Value is not 1"); - - void IGESGraph_Pick::Init - (const Standard_Integer nbProps, const Standard_Integer aPickStatus) -{ - theNbPropertyValues = nbProps; - thePick = aPickStatus; - InitTypeAndForm(406,21); + myPick = 0; + PR.ReadInteger(myPick,"Pick Flag"); + if ( (myPick != 0) && (myPick != 1) ) + PR.AddFail("Pick Flag : Value != 0/1"); } - Standard_Integer IGESGraph_Pick::NbPropertyValues () const -{ - return theNbPropertyValues; +void IGESGraph_Pick::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(1); + IW.Send(myPick); } - Standard_Integer IGESGraph_Pick::PickFlag () const -{ - return thePick; +IGESData_DirChecker IGESGraph_Pick::DirChecker () const +{ + IGESData_DirChecker DC (406, 21); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } - Standard_Boolean IGESGraph_Pick::IsPickable () const +void IGESGraph_Pick::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const { - return (thePick == 0); + S << "IGESGraph_Pick" << endl; + S << "No. of property values : 1" << endl; + S << "Pick flag : " << myPick; + S << (myPick == 0 ? " NO" : " YES" ); + S << endl; } diff --git a/src/IGESGraph/IGESGraph_Pick.hxx b/src/IGESGraph/IGESGraph_Pick.hxx index fdeab96acf..248b6e3c20 100644 --- a/src/IGESGraph/IGESGraph_Pick.hxx +++ b/src/IGESGraph/IGESGraph_Pick.hxx @@ -17,16 +17,8 @@ #ifndef _IGESGraph_Pick_HeaderFile #define _IGESGraph_Pick_HeaderFile -#include -#include - -#include #include -#include - -class IGESGraph_Pick; -DEFINE_STANDARD_HANDLE(IGESGraph_Pick, IGESData_IGESEntity) //! defines IGESPick, Type <406> Form <21> //! in package IGESGraph @@ -36,50 +28,36 @@ DEFINE_STANDARD_HANDLE(IGESGraph_Pick, IGESData_IGESEntity) //! system class IGESGraph_Pick : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 21; } + + IGESGraph_Pick() + : myPick(0) + {} - - Standard_EXPORT IGESGraph_Pick(); - - //! This method is used to set the fields of the class Pick - //! - nbProps : Number of property values (NP = 1) - //! - aPickStatus : Pick Flag - Standard_EXPORT void Init (const Standard_Integer nbProps, const Standard_Integer aPickStatus); - - //! returns the number of property values in . - Standard_EXPORT Standard_Integer NbPropertyValues() const; - //! returns 0 if is pickable(default), //! 1 if is not pickable. - Standard_EXPORT Standard_Integer PickFlag() const; - + Standard_Integer PickFlag() const { return myPick; } + //! returns True if thePick is 0. - Standard_EXPORT Standard_Boolean IsPickable() const; + Standard_Boolean IsPickable() const { return (myPick == 0); } + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESGraph_Pick,IGESData_IGESEntity) -protected: - - - - -private: - - - Standard_Integer theNbPropertyValues; - Standard_Integer thePick; - + private: + Standard_Integer myPick; }; - - - - - - #endif // _IGESGraph_Pick_HeaderFile diff --git a/src/IGESGraph/IGESGraph_ReadWriteModule.cxx b/src/IGESGraph/IGESGraph_ReadWriteModule.cxx deleted file mode 100644 index 0a8a939c51..0000000000 --- a/src/IGESGraph/IGESGraph_ReadWriteModule.cxx +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_ReadWriteModule,IGESData_ReadWriteModule) - -// Each Module is attached to a Protocol : it must interprete Case Numbers -// (arguments of various methods) in accordance to values returned by -// the method TypeNumber from this Protocol -IGESGraph_ReadWriteModule::IGESGraph_ReadWriteModule () { } - - - Standard_Integer IGESGraph_ReadWriteModule::CaseIGES - (const Standard_Integer typenum, const Standard_Integer formnum) const -{ - switch (typenum) { - case 304 : - if (formnum == 1) return 9; - else if (formnum == 2) return 7; - break; - case 310 : return 13; - case 312 : return 12; - case 314 : return 1; - case 406 : - switch (formnum) { - case 1 : return 2; - case 13 : return 10; - case 16 : return 3; - case 17 : return 4; - case 18 : return 6; - case 19 : return 8; - case 20 : return 5; - case 21 : return 11; - case 22 : return 14; - default : break; - } - break; - default : break; - } - return 0; -} - - - void IGESGraph_ReadWriteModule::ReadOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESGraph_Color,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolColor tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 2 : { - DeclareAndCast(IGESGraph_DefinitionLevel,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolDefinitionLevel tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 3 : { - DeclareAndCast(IGESGraph_DrawingSize,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolDrawingSize tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 4 : { - DeclareAndCast(IGESGraph_DrawingUnits,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolDrawingUnits tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 5 : { - DeclareAndCast(IGESGraph_HighLight,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolHighLight tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 6 : { - DeclareAndCast(IGESGraph_IntercharacterSpacing,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolIntercharacterSpacing tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 7 : { - DeclareAndCast(IGESGraph_LineFontDefPattern,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolLineFontDefPattern tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 8 : { - DeclareAndCast(IGESGraph_LineFontPredefined,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolLineFontPredefined tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 9 : { - DeclareAndCast(IGESGraph_LineFontDefTemplate,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolLineFontDefTemplate tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 10 : { - DeclareAndCast(IGESGraph_NominalSize,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolNominalSize tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 11 : { - DeclareAndCast(IGESGraph_Pick,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolPick tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 12 : { - DeclareAndCast(IGESGraph_TextDisplayTemplate,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolTextDisplayTemplate tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 13 : { - DeclareAndCast(IGESGraph_TextFontDef,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolTextFontDef tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 14 : { - DeclareAndCast(IGESGraph_UniformRectGrid,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolUniformRectGrid tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - default : break; - } -} - - - void IGESGraph_ReadWriteModule::WriteOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - IGESData_IGESWriter& IW) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESGraph_Color,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolColor tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 2 : { - DeclareAndCast(IGESGraph_DefinitionLevel,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolDefinitionLevel tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 3 : { - DeclareAndCast(IGESGraph_DrawingSize,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolDrawingSize tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 4 : { - DeclareAndCast(IGESGraph_DrawingUnits,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolDrawingUnits tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 5 : { - DeclareAndCast(IGESGraph_HighLight,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolHighLight tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 6 : { - DeclareAndCast(IGESGraph_IntercharacterSpacing,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolIntercharacterSpacing tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 7 : { - DeclareAndCast(IGESGraph_LineFontDefPattern,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolLineFontDefPattern tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 8 : { - DeclareAndCast(IGESGraph_LineFontPredefined,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolLineFontPredefined tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 9 : { - DeclareAndCast(IGESGraph_LineFontDefTemplate,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolLineFontDefTemplate tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 10 : { - DeclareAndCast(IGESGraph_NominalSize,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolNominalSize tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 11 : { - DeclareAndCast(IGESGraph_Pick,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolPick tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 12 : { - DeclareAndCast(IGESGraph_TextDisplayTemplate,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolTextDisplayTemplate tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 13 : { - DeclareAndCast(IGESGraph_TextFontDef,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolTextFontDef tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 14 : { - DeclareAndCast(IGESGraph_UniformRectGrid,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolUniformRectGrid tool; - tool.WriteOwnParams(anent,IW); - } - break; - default : break; - } -} diff --git a/src/IGESGraph/IGESGraph_ReadWriteModule.hxx b/src/IGESGraph/IGESGraph_ReadWriteModule.hxx deleted file mode 100644 index 2839759638..0000000000 --- a/src/IGESGraph/IGESGraph_ReadWriteModule.hxx +++ /dev/null @@ -1,79 +0,0 @@ -// Created on: 1993-09-06 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ReadWriteModule_HeaderFile -#define _IGESGraph_ReadWriteModule_HeaderFile - -#include -#include - -#include -#include -class Standard_DomainError; -class IGESData_IGESEntity; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; - - -class IGESGraph_ReadWriteModule; -DEFINE_STANDARD_HANDLE(IGESGraph_ReadWriteModule, IGESData_ReadWriteModule) - -//! Defines Graph File Access Module for IGESGraph (specific parts) -//! Specific actions concern : Read and Write Own Parameters of -//! an IGESEntity. -class IGESGraph_ReadWriteModule : public IGESData_ReadWriteModule -{ - -public: - - - //! Creates a ReadWriteModule & puts it into ReaderLib & WriterLib - Standard_EXPORT IGESGraph_ReadWriteModule(); - - //! Defines Case Numbers for Entities of IGESGraph - Standard_EXPORT Standard_Integer CaseIGES (const Standard_Integer typenum, const Standard_Integer formnum) const Standard_OVERRIDE; - - //! Reads own parameters from file for an Entity of IGESGraph - Standard_EXPORT void ReadOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const Standard_OVERRIDE; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, IGESData_IGESWriter& IW) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IGESGraph_ReadWriteModule,IGESData_ReadWriteModule) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IGESGraph_ReadWriteModule_HeaderFile diff --git a/src/IGESGraph/IGESGraph_SpecificModule.cxx b/src/IGESGraph/IGESGraph_SpecificModule.cxx deleted file mode 100644 index d96d195e4f..0000000000 --- a/src/IGESGraph/IGESGraph_SpecificModule.cxx +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_SpecificModule,IGESData_SpecificModule) - -// Each Module is attached to a Protocol : it must interprete Case Numbers -// (arguments of various methods) in accordance to values returned by -// the method TypeNumber from this Protocol -IGESGraph_SpecificModule::IGESGraph_SpecificModule() { } - - - void IGESGraph_SpecificModule::OwnDump - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, - const Standard_Integer own) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESGraph_Color,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolColor tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 2 : { - DeclareAndCast(IGESGraph_DefinitionLevel,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolDefinitionLevel tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 3 : { - DeclareAndCast(IGESGraph_DrawingSize,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolDrawingSize tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 4 : { - DeclareAndCast(IGESGraph_DrawingUnits,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolDrawingUnits tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 5 : { - DeclareAndCast(IGESGraph_HighLight,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolHighLight tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 6 : { - DeclareAndCast(IGESGraph_IntercharacterSpacing,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolIntercharacterSpacing tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 7 : { - DeclareAndCast(IGESGraph_LineFontDefPattern,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolLineFontDefPattern tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 8 : { - DeclareAndCast(IGESGraph_LineFontPredefined,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolLineFontPredefined tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 9 : { - DeclareAndCast(IGESGraph_LineFontDefTemplate,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolLineFontDefTemplate tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 10 : { - DeclareAndCast(IGESGraph_NominalSize,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolNominalSize tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 11 : { - DeclareAndCast(IGESGraph_Pick,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolPick tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 12 : { - DeclareAndCast(IGESGraph_TextDisplayTemplate,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolTextDisplayTemplate tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 13 : { - DeclareAndCast(IGESGraph_TextFontDef,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolTextFontDef tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 14 : { - DeclareAndCast(IGESGraph_UniformRectGrid,anent,ent); - if (anent.IsNull()) return; - IGESGraph_ToolUniformRectGrid tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - default : break; - } -} - - - Standard_Boolean IGESGraph_SpecificModule::OwnCorrect - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const -{ -// Applies only on some types - switch (CN) { - case 3 : { - DeclareAndCast(IGESGraph_DrawingSize,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolDrawingSize tool; - return tool.OwnCorrect(anent); - } - case 4 : { - DeclareAndCast(IGESGraph_DrawingUnits,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolDrawingUnits tool; - return tool.OwnCorrect(anent); - } - case 5 : { - DeclareAndCast(IGESGraph_HighLight,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolHighLight tool; - return tool.OwnCorrect(anent); - } - case 6 : { - DeclareAndCast(IGESGraph_IntercharacterSpacing,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolIntercharacterSpacing tool; - return tool.OwnCorrect(anent); - } - case 8 : { - DeclareAndCast(IGESGraph_LineFontPredefined,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolLineFontPredefined tool; - return tool.OwnCorrect(anent); - } - case 10 : { - DeclareAndCast(IGESGraph_NominalSize,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolNominalSize tool; - return tool.OwnCorrect(anent); - } - case 11 : { - DeclareAndCast(IGESGraph_Pick,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolPick tool; - return tool.OwnCorrect(anent); - } - case 14 : { - DeclareAndCast(IGESGraph_UniformRectGrid,anent,ent); - if (anent.IsNull()) break; - IGESGraph_ToolUniformRectGrid tool; - return tool.OwnCorrect(anent); - } - default : break; - } - return Standard_False; -} diff --git a/src/IGESGraph/IGESGraph_SpecificModule.hxx b/src/IGESGraph/IGESGraph_SpecificModule.hxx deleted file mode 100644 index d119954854..0000000000 --- a/src/IGESGraph/IGESGraph_SpecificModule.hxx +++ /dev/null @@ -1,76 +0,0 @@ -// Created on: 1993-09-07 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_SpecificModule_HeaderFile -#define _IGESGraph_SpecificModule_HeaderFile - -#include -#include - -#include -#include -#include -class IGESData_IGESEntity; -class IGESData_IGESDumper; -class Message_Messenger; - - -class IGESGraph_SpecificModule; -DEFINE_STANDARD_HANDLE(IGESGraph_SpecificModule, IGESData_SpecificModule) - -//! Defines Services attached to IGES Entities : -//! Dump & OwnCorrect, for IGESGraph -class IGESGraph_SpecificModule : public IGESData_SpecificModule -{ - -public: - - - //! Creates a SpecificModule from IGESGraph & puts it into SpecificLib - Standard_EXPORT IGESGraph_SpecificModule(); - - //! Specific Dump (own parameters) for IGESGraph - Standard_EXPORT void OwnDump (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const Standard_OVERRIDE; - - //! Performs non-ambiguous Corrections on Entities which support - //! them (DrawingSize,DrawingUnits,HighLight,IntercharacterSpacing, - //! LineFontPredefined,NominalSize,Pick,UniformRectGrid) - Standard_EXPORT virtual Standard_Boolean OwnCorrect (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IGESGraph_SpecificModule,IGESData_SpecificModule) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IGESGraph_SpecificModule_HeaderFile diff --git a/src/IGESGraph/IGESGraph_TextDisplayTemplate.cxx b/src/IGESGraph/IGESGraph_TextDisplayTemplate.cxx index 24ea215fee..87cc8a9604 100644 --- a/src/IGESGraph/IGESGraph_TextDisplayTemplate.cxx +++ b/src/IGESGraph/IGESGraph_TextDisplayTemplate.cxx @@ -18,103 +18,109 @@ #include #include -#include #include #include -#include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_TextDisplayTemplate,IGESData_IGESEntity) -IGESGraph_TextDisplayTemplate::IGESGraph_TextDisplayTemplate () { } - - - void IGESGraph_TextDisplayTemplate::Init - (const Standard_Real aWidth, - const Standard_Real aHeight, - const Standard_Integer aFontCode, - const Handle(IGESGraph_TextFontDef)& aFontEntity, - const Standard_Real aSlantAngle, - const Standard_Real aRotationAngle, - const Standard_Integer aMirrorFlag, - const Standard_Integer aRotationFlag, - const gp_XYZ& aCorner) -{ - theBoxWidth = aWidth; - theBoxHeight = aHeight; - theFontCode = aFontCode; - theFontEntity = aFontEntity; - theSlantAngle = aSlantAngle; - theRotationAngle = aRotationAngle; - theMirrorFlag = aMirrorFlag; - theRotateFlag = aRotationFlag; - theCorner = aCorner; - InitTypeAndForm(312,FormNumber()); // FormNumber 0-1 : Incremental status -} - - void IGESGraph_TextDisplayTemplate::SetIncremental (const Standard_Boolean F) -{ - InitTypeAndForm(312, (F ? 1 : 0)); -} - - - Standard_Real IGESGraph_TextDisplayTemplate::BoxWidth () const -{ - return theBoxWidth; -} - - Standard_Real IGESGraph_TextDisplayTemplate::BoxHeight () const -{ - return theBoxHeight; -} - - Standard_Boolean IGESGraph_TextDisplayTemplate::IsFontEntity () const +gp_Pnt IGESGraph_TextDisplayTemplate::StartingCorner () const { - return (! theFontEntity.IsNull()); + return ( gp_Pnt(myCorner) ); } - Standard_Integer IGESGraph_TextDisplayTemplate::FontCode () const +gp_Pnt IGESGraph_TextDisplayTemplate::TransformedStartingCorner () const { - return theFontCode; + gp_XYZ TempXYZ = myCorner; + if (HasTransf()) Location().Transforms(TempXYZ); + return ( gp_Pnt(TempXYZ) ); } - Handle(IGESGraph_TextFontDef) IGESGraph_TextDisplayTemplate::FontEntity () const -{ - return theFontEntity; -} +void IGESGraph_TextDisplayTemplate::OwnRead (IGESFile_Reader &PR) +{ + PR.ReadReal(myBoxWidth,"Character box width"); + PR.ReadReal(myBoxHeight,"Character box height"); - Standard_Real IGESGraph_TextDisplayTemplate::SlantAngle () const -{ - return theSlantAngle; -} + myFontCode = 1; + PR.ReadInteger(myFontCode,"Font Code"); + if (myFontCode < 0) + PR.GetPointer(myFontEntity,-myFontCode); - Standard_Real IGESGraph_TextDisplayTemplate::RotationAngle () const -{ - return theRotationAngle; -} + mySlantAngle = M_PI/2.0; + PR.ReadReal(mySlantAngle,"Slant Angle"); - Standard_Integer IGESGraph_TextDisplayTemplate::MirrorFlag () const -{ - return theMirrorFlag; + PR.ReadReal(myRotationAngle,"Rotation Angle"); + PR.ReadInteger(myMirrorFlag,"Mirror Flag"); + PR.ReadInteger(myRotateFlag,"Rotate Flag"); + PR.ReadXYZ(myCorner,"Lower left coordinates/Increments"); } - Standard_Integer IGESGraph_TextDisplayTemplate::RotateFlag () const -{ - return theRotateFlag; +void IGESGraph_TextDisplayTemplate::OwnWrite (IGESData_IGESWriter &IW) const +{ + IW.Send(myBoxWidth); + IW.Send(myBoxHeight); + + if (!myFontEntity.IsNull()) + IW.Send(myFontEntity, Standard_True); // negative + else + IW.Send(myFontCode); + + IW.Send(mySlantAngle); + IW.Send(myRotationAngle); + IW.Send(myMirrorFlag); + IW.Send(myRotateFlag); + IW.Send(myCorner.X()); + IW.Send(myCorner.Y()); + IW.Send(myCorner.Z()); } - Standard_Boolean IGESGraph_TextDisplayTemplate::IsIncremental () const +void IGESGraph_TextDisplayTemplate::OwnShared (Interface_EntityIterator &theIter) const { - return ( FormNumber() == 1 ); + if (!myFontEntity.IsNull()) + theIter.GetOneItem(myFontEntity); } - gp_Pnt IGESGraph_TextDisplayTemplate::StartingCorner () const -{ - return ( gp_Pnt(theCorner) ); +IGESData_DirChecker IGESGraph_TextDisplayTemplate::DirChecker () const +{ + IGESData_DirChecker DC (312, 0, 1); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefAny); + DC.SubordinateStatusRequired(0); + DC.UseFlagRequired(2); + DC.HierarchyStatusRequired(0); + return DC; } - gp_Pnt IGESGraph_TextDisplayTemplate::TransformedStartingCorner () const +void IGESGraph_TextDisplayTemplate::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const { - gp_XYZ TempXYZ = theCorner; - if (HasTransf()) Location().Transforms(TempXYZ); - return ( gp_Pnt(TempXYZ) ); + S << "IGESGraph_TextDisplayTemplate" << endl; + S << "Character box width : " << myBoxWidth << " "; + S << "Character box height : " << myBoxHeight << endl; + if (!myFontEntity.IsNull()) + { + const Standard_Integer sublevel = (level <= 4) ? 0 : 1; + S << "Font Entity : "; + dumper.Dump(myFontEntity,S,sublevel); + } + else + S << "Font code : " << myFontCode; + S << endl; + S << "Slant angle : " << mySlantAngle << " "; + S << "Rotation angle : " << myRotationAngle << endl; + S << "Mirror flag : " << myMirrorFlag << " "; + S << "Rotate flag : " << myRotateFlag << endl; + if ( myForm == 0 ) + S << "Lower Left Corner coordinates : "; + else + S << "Increments from coordinates : "; + IGESData_DumpXYZL(S,level,myCorner,Location()); + S << endl; } diff --git a/src/IGESGraph/IGESGraph_TextDisplayTemplate.hxx b/src/IGESGraph/IGESGraph_TextDisplayTemplate.hxx index 133048e7d8..f211e60612 100644 --- a/src/IGESGraph/IGESGraph_TextDisplayTemplate.hxx +++ b/src/IGESGraph/IGESGraph_TextDisplayTemplate.hxx @@ -17,22 +17,12 @@ #ifndef _IGESGraph_TextDisplayTemplate_HeaderFile #define _IGESGraph_TextDisplayTemplate_HeaderFile -#include -#include - -#include -#include -#include #include -#include +#include class IGESGraph_TextFontDef; -class gp_XYZ; class gp_Pnt; -class IGESGraph_TextDisplayTemplate; -DEFINE_STANDARD_HANDLE(IGESGraph_TextDisplayTemplate, IGESData_IGESEntity) - //! defines IGES TextDisplayTemplate Entity, //! Type <312>, form <0, 1> in package IGESGraph //! @@ -41,66 +31,63 @@ DEFINE_STANDARD_HANDLE(IGESGraph_TextDisplayTemplate, IGESData_IGESEntity) //! as a parameter value class IGESGraph_TextDisplayTemplate : public IGESData_IGESEntity { - -public: - - - Standard_EXPORT IGESGraph_TextDisplayTemplate(); - - //! This method is used to set the fields of the class - //! TextDisplayTemplate - //! - aWidth : Character box width - //! - aHeight : Character box height - //! - afontCode : Font code - //! - aFontEntity : Text Font Definition Entity - //! - aSlantAngle : Slant angle - //! - aRotationAngle : Rotation angle - //! - aMirrorFlag : Mirror Flag - //! - aRotationFlag : Rotate internal text flag - //! - aCorner : Lower left corner coordinates(Form No. 0), - //! Increments from coordinates (Form No. 1) - Standard_EXPORT void Init (const Standard_Real aWidth, const Standard_Real aHeight, const Standard_Integer aFontCode, const Handle(IGESGraph_TextFontDef)& aFontEntity, const Standard_Real aSlantAngle, const Standard_Real aRotationAngle, const Standard_Integer aMirrorFlag, const Standard_Integer aRotationFlag, const gp_XYZ& aCorner); + public: + + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 312; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return myForm; } + + IGESGraph_TextDisplayTemplate(const Standard_Integer theForm) + : myForm(theForm), + myBoxWidth(0.), + myBoxHeight(0.), + myFontCode(0), + mySlantAngle(0.), + myRotationAngle(0.), + myMirrorFlag(0), + myRotateFlag(0) + {} //! Sets to be Incremental (Form 1) if is True, //! or Basolute (Form 0) else - Standard_EXPORT void SetIncremental (const Standard_Boolean mode); - + void SetIncremental (const Standard_Boolean mode) { myForm = (mode? 1 : 0); } + //! returns True if entity is Incremental (Form 1). //! False if entity is Absolute (Form 0). - Standard_EXPORT Standard_Boolean IsIncremental() const; - + Standard_Boolean IsIncremental() const { return ( myForm == 1 ); } + //! returns Character Box Width. - Standard_EXPORT Standard_Real BoxWidth() const; - + Standard_Real BoxWidth() const { return myBoxWidth; } + //! returns Character Box Height. - Standard_EXPORT Standard_Real BoxHeight() const; - - //! returns False if theFontEntity is Null, True otherwise. - Standard_EXPORT Standard_Boolean IsFontEntity() const; - + Standard_Real BoxHeight() const { return myBoxHeight; } + + //! returns False if myFontEntity is Null, True otherwise. + Standard_Boolean IsFontEntity() const { return (! myFontEntity.IsNull()); } + //! returns the font code. - Standard_EXPORT Standard_Integer FontCode() const; - + Standard_Integer FontCode() const { return myFontCode; } + //! returns Text Font Definition Entity used to define the font. - Standard_EXPORT Handle(IGESGraph_TextFontDef) FontEntity() const; - + const Handle(IGESGraph_TextFontDef) & FontEntity() const { return myFontEntity; } + //! returns slant angle of character in radians. - Standard_EXPORT Standard_Real SlantAngle() const; - + Standard_Real SlantAngle() const { return mySlantAngle; } + //! returns Rotation angle of text block in radians. - Standard_EXPORT Standard_Real RotationAngle() const; - + Standard_Real RotationAngle() const { return myRotationAngle; } + //! returns Mirror flag //! Mirror flag : 0 = no mirroring. //! 1 = mirror axis perpendicular to text base line. //! 2 = mirror axis is text base line. - Standard_EXPORT Standard_Integer MirrorFlag() const; - + Standard_Integer MirrorFlag() const { return myMirrorFlag; } + //! returns Rotate internal text flag. //! Rotate internal text flag : 0 = text horizontal. //! 1 = text vertical. - Standard_EXPORT Standard_Integer RotateFlag() const; - + Standard_Integer RotateFlag() const { return myRotateFlag; } + //! If IsIncremental() returns False, //! gets coordinates of lower left corner //! of first character box. @@ -117,36 +104,30 @@ public: //! found in parent entity. Standard_EXPORT gp_Pnt TransformedStartingCorner() const; + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnShared (Interface_EntityIterator &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(IGESGraph_TextDisplayTemplate,IGESData_IGESEntity) - -protected: - - - - -private: - - - Standard_Real theBoxWidth; - Standard_Real theBoxHeight; - Standard_Integer theFontCode; - Handle(IGESGraph_TextFontDef) theFontEntity; - Standard_Real theSlantAngle; - Standard_Real theRotationAngle; - Standard_Integer theMirrorFlag; - Standard_Integer theRotateFlag; - gp_XYZ theCorner; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESGraph_TextDisplayTemplate,IGESData_IGESEntity) + private: + + Standard_Integer myForm; + Standard_Real myBoxWidth; + Standard_Real myBoxHeight; + Standard_Integer myFontCode; + Interface_Pointer myFontEntity; + Standard_Real mySlantAngle; + Standard_Real myRotationAngle; + Standard_Integer myMirrorFlag; + Standard_Integer myRotateFlag; + gp_XYZ myCorner; }; - - - - - - #endif // _IGESGraph_TextDisplayTemplate_HeaderFile diff --git a/src/IGESGraph/IGESGraph_TextFontDef.cxx b/src/IGESGraph/IGESGraph_TextFontDef.cxx index 6621e9028d..7cb2daca9a 100644 --- a/src/IGESGraph/IGESGraph_TextFontDef.cxx +++ b/src/IGESGraph/IGESGraph_TextFontDef.cxx @@ -16,124 +16,222 @@ //-------------------------------------------------------------------- //-------------------------------------------------------------------- +#include #include #include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_TextFontDef,IGESData_IGESEntity) -IGESGraph_TextFontDef::IGESGraph_TextFontDef () { } - - - void IGESGraph_TextFontDef::Init - (const Standard_Integer aFontCode, - const Handle(TCollection_HAsciiString)& aFontName, - const Standard_Integer aSupersededFont, - const Handle(IGESGraph_TextFontDef)& aSupersededEntity, - const Standard_Integer aScale, - const Handle(TColStd_HArray1OfInteger)& allASCIICodes, - const Handle(TColStd_HArray1OfInteger)& allNextCharX, - const Handle(TColStd_HArray1OfInteger)& allNextCharY, - const Handle(TColStd_HArray1OfInteger)& allPenMotions, - const Handle(IGESBasic_HArray1OfHArray1OfInteger)& allPenFlags, - const Handle(IGESBasic_HArray1OfHArray1OfInteger)& allMovePenToX, - const Handle(IGESBasic_HArray1OfHArray1OfInteger)& allMovePenToY) +Standard_Integer IGESGraph_TextFontDef::NbCharacters () const { - Standard_Integer Len = allASCIICodes->Length(); - if (allASCIICodes->Lower() != 1 || - (allNextCharX->Lower() != 1 || allNextCharX->Length() != Len) || - (allNextCharY->Lower() != 1 || allNextCharY->Length() != Len) || - (allPenMotions->Lower() != 1 || allPenMotions->Length() != Len) || - (allPenFlags->Lower() != 1 || allPenFlags->Length() != Len) || - (allMovePenToX->Lower() != 1 || allMovePenToX->Length() != Len) || - (allMovePenToY->Lower() != 1 || allMovePenToY->Length() != Len) ) - Standard_DimensionMismatch::Raise("IGESGraph_TextFontDef : Init"); - - theFontCode = aFontCode; - theFontName = aFontName; - theSupersededFontCode = aSupersededFont; - theSupersededFontEntity = aSupersededEntity; - theScale = aScale; - theASCIICodes = allASCIICodes; - theNextCharOriginX = allNextCharX; - theNextCharOriginY = allNextCharY; - theNbPenMotions = allPenMotions; - thePenMotions = allPenFlags; - thePenMovesToX = allMovePenToX; - thePenMovesToY = allMovePenToY; - InitTypeAndForm(310,0); + return ( myASCIICodes->Length() ); } - Standard_Integer IGESGraph_TextFontDef::FontCode () const +Standard_Integer IGESGraph_TextFontDef::ASCIICode (const Standard_Integer Chnum) const { - return theFontCode; + return ( myASCIICodes->Value(Chnum) ); } - Handle(TCollection_HAsciiString) IGESGraph_TextFontDef::FontName () const +void IGESGraph_TextFontDef::NextCharOrigin (const Standard_Integer Chnum, Standard_Integer& NX, Standard_Integer& NY) const { - return theFontName; + NX = myNextCharOriginX->Value(Chnum); + NY = myNextCharOriginY->Value(Chnum); } - Standard_Boolean IGESGraph_TextFontDef::IsSupersededFontEntity () const +Standard_Integer IGESGraph_TextFontDef::NbPenMotions (const Standard_Integer Chnum) const { - return (! theSupersededFontEntity.IsNull()); + return ( myNbPenMotions->Value(Chnum) ); } - Standard_Integer IGESGraph_TextFontDef::SupersededFontCode () const -{ - return theSupersededFontCode; -} - - Handle(IGESGraph_TextFontDef) IGESGraph_TextFontDef::SupersededFontEntity () const -{ - return theSupersededFontEntity; -} - - Standard_Integer IGESGraph_TextFontDef::Scale () const +Standard_Boolean IGESGraph_TextFontDef::IsPenUp (const Standard_Integer Chnum, const Standard_Integer Motionnum) const { - return theScale; + Handle(TColStd_HArray1OfInteger) MotionArr = myPenMotions->Value(Chnum); + Standard_Integer PenStatus = MotionArr->Value(Motionnum); + return ( PenStatus == 1 ); } - Standard_Integer IGESGraph_TextFontDef::NbCharacters () const +void IGESGraph_TextFontDef::NextPenPosition (const Standard_Integer Chnum, const Standard_Integer Motionnum, Standard_Integer& IX, Standard_Integer& IY) const { - return ( theASCIICodes->Length() ); + IX = myPenMovesToX->Value(Chnum)->Value(Motionnum); + IY = myPenMovesToY->Value(Chnum)->Value(Motionnum); } - Standard_Integer IGESGraph_TextFontDef::ASCIICode - (const Standard_Integer Chnum) const -{ - return ( theASCIICodes->Value(Chnum) ); +void IGESGraph_TextFontDef::OwnRead (IGESFile_Reader &PR) +{ + PR.ReadInteger(myFontCode,"Font Code"); + PR.ReadText(myFontName,"Font Name"); + + mySupersededFontCode = 1; + PR.ReadInteger(mySupersededFontCode,"No. of superseded font"); + if (mySupersededFontCode < 0) + { + PR.GetPointer(mySupersededFontEntity,-mySupersededFontCode); + } + + PR.ReadInteger(myScale,"Grid units eqvt to one text height"); + + // Reading nbval(Integer) + Standard_Integer nbval = 0; + PR.ReadInteger(nbval,"No. of characters in this defn"); + if (nbval > 0) + { + myASCIICodes = new TColStd_HArray1OfInteger(1, nbval); + myNextCharOriginX = new TColStd_HArray1OfInteger(1, nbval); + myNextCharOriginY = new TColStd_HArray1OfInteger(1, nbval); + myNbPenMotions = new TColStd_HArray1OfInteger(1, nbval); + myPenMotions = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval); + myPenMovesToX = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval); + myPenMovesToY = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval); + + for ( Standard_Integer i = 1; i <= nbval; i++ ) + { + PR.ReadInteger(myASCIICodes->ChangeValue(i),"array ASCIICodes"); + PR.ReadInteger(myNextCharOriginX->ChangeValue(i),"array nextChar X"); + PR.ReadInteger(myNextCharOriginY->ChangeValue(i),"array nextChar Y"); + + Standard_Integer tempMotion = 0; + PR.ReadInteger(tempMotion,"array penMotions"); + myNbPenMotions->SetValue(i, tempMotion); + if (tempMotion > 0) + { + Handle(TColStd_HArray1OfInteger) intarray, xarray, yarray; + + intarray = new TColStd_HArray1OfInteger(1, tempMotion); + xarray = new TColStd_HArray1OfInteger(1, tempMotion); + yarray = new TColStd_HArray1OfInteger(1, tempMotion); + + for ( Standard_Integer j = 1; j <= tempMotion; j++ ) + { + Standard_Integer tempFlag = 0; + PR.ReadInteger(tempFlag,"array penFlags"); + intarray->SetValue(j, tempFlag); + PR.ReadInteger(xarray->ChangeValue(j),"array movePenTo X"); + PR.ReadInteger(yarray->ChangeValue(j),"array movePenTo Y"); + } + + myPenMotions->SetValue(i, intarray); + myPenMovesToX->SetValue(i, xarray); + myPenMovesToY->SetValue(i, yarray); + } + else PR.AddFail("Count of Pen motions : Not Positive"); + } + } + else PR.AddFail ("Count of characters in this defn : Not Positive"); } - void IGESGraph_TextFontDef::NextCharOrigin - (const Standard_Integer Chnum, - Standard_Integer& NX, Standard_Integer& NY) const +void IGESGraph_TextFontDef::OwnWrite (IGESData_IGESWriter &IW) const { - NX = theNextCharOriginX->Value(Chnum); - NY = theNextCharOriginY->Value(Chnum); -} - - Standard_Integer IGESGraph_TextFontDef::NbPenMotions - (const Standard_Integer Chnum) const + Standard_Integer IX,IY; + IW.Send(myFontCode); + IW.Send(myFontName); + + if (!mySupersededFontEntity.IsNull()) + IW.Send(mySupersededFontEntity, Standard_True); // negative + else + IW.Send(mySupersededFontCode); + + IW.Send(myScale); + + const Standard_Integer Up = NbCharacters(); + IW.Send(Up); + for ( Standard_Integer i = 1; i <= Up; i++ ) + { + IW.Send( ASCIICode(i) ); + NextCharOrigin (i,IX,IY); + IW.Send( IX ); + IW.Send( IY ); + IW.Send( NbPenMotions(i) ); + for ( Standard_Integer j = 1; j <= NbPenMotions(i); j ++) + { + IW.SendBoolean( IsPenUp(i,j) ); + NextPenPosition (i,j, IX,IY); + IW.Send( IX ); + IW.Send( IY ); + } + } +} + +void IGESGraph_TextFontDef::OwnShared (Interface_EntityIterator &theIter) const { - return ( theNbPenMotions->Value(Chnum) ); + if (!mySupersededFontEntity.IsNull()) + theIter.GetOneItem( mySupersededFontEntity ); } - Standard_Boolean IGESGraph_TextFontDef::IsPenUp - (const Standard_Integer Chnum, const Standard_Integer Motionnum) const -{ - Handle(TColStd_HArray1OfInteger) MotionArr = thePenMotions->Value(Chnum); - Standard_Integer PenStatus = MotionArr->Value(Motionnum); - return ( PenStatus == 1 ); +IGESData_DirChecker IGESGraph_TextFontDef::DirChecker () const +{ + IGESData_DirChecker DC (310, 0); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.SubordinateStatusRequired(0); + DC.UseFlagRequired(2); + DC.HierarchyStatusIgnored(); + return DC; } - void IGESGraph_TextFontDef::NextPenPosition - (const Standard_Integer Chnum, const Standard_Integer Motionnum, - Standard_Integer& IX, Standard_Integer& IY) const +void IGESGraph_TextFontDef::OwnDump (const IGESData_IGESDumper &dumper, const Handle(Message_Messenger) &S, const Standard_Integer level) const { - IX = thePenMovesToX->Value(Chnum)->Value(Motionnum); - IY = thePenMovesToY->Value(Chnum)->Value(Motionnum); + Standard_Integer nbchars = NbCharacters(); + + S << "IGESGraph_TextFontDef" << endl; + + S << "Font Code : " << myFontCode << endl; + S << "Font Name : "; + IGESData_DumpString(S,myFontName); + S << endl; + if (!mySupersededFontEntity.IsNull()) { + S << "Text Definition Entity : "; + const Standard_Integer sublevel = (level <= 4) ? 0 : 1; + dumper.Dump(mySupersededFontEntity,S,sublevel); + } + else S << "Superseding Font Number : " << mySupersededFontCode; + S << endl; + S << "No. of Grid Units eqvt to 1 Text Height : " << myScale << endl; + S << "ASCII Codes : " << endl + << "Grid Locations of next character origins : " << endl + << "Pen Motions : " << endl + << "Pen Positions : " << endl + << "Grid Locations the pen moves to : "; + S << "Count = " << nbchars << endl; + IGESData_DumpVals(S,-level,1,nbchars,ASCIICode); + S << endl; + if (level > 4) + { + Handle(TColgp_HArray1OfXY) arrXY; + Standard_Integer I, J, nbmotions; + for (I = 1; I <= nbchars; I++) + { + Standard_Integer IX,IY; + S << "[" << I << "]: "; + S << "ASCII Code : " << ASCIICode(I) << endl; + S << "Grid Location of next character's origin : "; + NextCharOrigin(I,IX,IY); + S << "X=" << IX << " Y=" << IY; + nbmotions = NbPenMotions(I); + S << " No. of Pen Motions : " << nbmotions; + if (level <= 5) S << " [ ask level > 5 for Details ]" << endl; + else { + S << endl; + for (J = 1; J <= nbmotions; J++) + { + S << "Pen up(1) / down(0) flag : " << (Standard_Integer)IsPenUp(I,J); + S << " Next Pen Position : "; + NextPenPosition(I,J, IX,IY); + S << " X="<Init(tempRed, tempGreen, tempBlue, tempColorName); -} - -void IGESGraph_ToolColor::WriteOwnParams - (const Handle(IGESGraph_Color)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Real Red,Green,Blue; - ent->RGBIntensity(Red,Green,Blue); - IW.Send(Red); - IW.Send(Green); - IW.Send(Blue); -// ATTENTION place a reserver (Null) silya des pointeurs additionnels - if (ent->HasColorName()) - IW.Send(ent->ColorName()); - else IW.SendVoid(); // placekeeper to be reserved for additional pointers -} - -IGESData_DirChecker IGESGraph_ToolColor::DirChecker - (const Handle(IGESGraph_Color)& /*ent*/ ) const -{ - IGESData_DirChecker DC(314, 0); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefAny); - DC.BlankStatusIgnored(); - DC.SubordinateStatusRequired(0); - DC.UseFlagRequired(2); - DC.HierarchyStatusIgnored(); - - return DC; -} - -void IGESGraph_ToolColor::OwnDump - (const Handle(IGESGraph_Color)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const -{ - S << "IGESGraph_Color" << endl; - - Standard_Real Red,Green,Blue; - ent->RGBIntensity(Red,Green,Blue); - S << "Red (in % Of Full Intensity) : " << Red << endl; - S << "Green (in % Of Full Intensity) : " << Green << endl; - S << "Blue (in % Of Full Intensity) : " << Blue << endl; - S << "Color Name : "; - IGESData_DumpString(S,ent->ColorName()); - S << endl; -} diff --git a/src/IGESGraph/IGESGraph_ToolColor.hxx b/src/IGESGraph/IGESGraph_ToolColor.hxx deleted file mode 100644 index 6d1d182e77..0000000000 --- a/src/IGESGraph/IGESGraph_ToolColor.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ToolColor_HeaderFile -#define _IGESGraph_ToolColor_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESGraph_Color; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a Color. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESGraph_ToolColor -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolColor, ready to work - IGESGraph_ToolColor() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESGraph_Color)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESGraph_Color)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESGraph_Color)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESGraph_Color)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESGraph_ToolColor_HeaderFile diff --git a/src/IGESGraph/IGESGraph_ToolDefinitionLevel.cxx b/src/IGESGraph/IGESGraph_ToolDefinitionLevel.cxx deleted file mode 100644 index b67fee0485..0000000000 --- a/src/IGESGraph/IGESGraph_ToolDefinitionLevel.cxx +++ /dev/null @@ -1,93 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESGraph_ToolDefinitionLevel::ReadOwnParams - (const Handle(IGESGraph_DefinitionLevel)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Standard_Integer nbval; - - Handle(TColStd_HArray1OfInteger) levelNumbers; - - // Reading nbval(No. of Property Values) - Standard_Boolean st = PR.ReadInteger(PR.Current(), "No. of Property Values", nbval); - if (st && nbval > 0) - { - // Reading levelNumbers(HArray1OfInteger) -// levelNumbers = new TColStd_HArray1OfInteger(1, nbval); done by : - PR.ReadInts(PR.CurrentList(nbval), "array levelNumbers", levelNumbers, 1); //szv#4:S4163:12Mar99 `st=` not needed - } - else PR.AddFail("No. of Property Values : Not Positive"); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(levelNumbers); -} - -void IGESGraph_ToolDefinitionLevel::WriteOwnParams - (const Handle(IGESGraph_DefinitionLevel)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer Up = ent->NbPropertyValues(); - IW.Send( Up ); - for ( Standard_Integer i = 1; i <= Up; i++) - IW.Send( ent->LevelNumber(i) ); -} - -IGESData_DirChecker IGESGraph_ToolDefinitionLevel::DirChecker - (const Handle(IGESGraph_DefinitionLevel)& /*ent*/) const -{ - IGESData_DirChecker DC (406, 1); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESGraph_ToolDefinitionLevel::OwnDump - (const Handle(IGESGraph_DefinitionLevel)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESGraph_DefinitionLevel" << endl; - - S << "Level Numbers : "; - IGESData_DumpVals(S ,level,1, ent->NbPropertyValues(),ent->LevelNumber); - S << endl; -} - diff --git a/src/IGESGraph/IGESGraph_ToolDefinitionLevel.hxx b/src/IGESGraph/IGESGraph_ToolDefinitionLevel.hxx deleted file mode 100644 index bf90df8f42..0000000000 --- a/src/IGESGraph/IGESGraph_ToolDefinitionLevel.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ToolDefinitionLevel_HeaderFile -#define _IGESGraph_ToolDefinitionLevel_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESGraph_DefinitionLevel; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a DefinitionLevel. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESGraph_ToolDefinitionLevel -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolDefinitionLevel, ready to work - IGESGraph_ToolDefinitionLevel() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESGraph_DefinitionLevel)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESGraph_DefinitionLevel)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESGraph_DefinitionLevel)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESGraph_DefinitionLevel)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESGraph_ToolDefinitionLevel_HeaderFile diff --git a/src/IGESGraph/IGESGraph_ToolDrawingSize.cxx b/src/IGESGraph/IGESGraph_ToolDrawingSize.cxx deleted file mode 100644 index 055f7af9c3..0000000000 --- a/src/IGESGraph/IGESGraph_ToolDrawingSize.cxx +++ /dev/null @@ -1,107 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESGraph_ToolDrawingSize::ReadOwnParams - (const Handle(IGESGraph_DrawingSize)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - Standard_Integer nbPropertyValues; - Standard_Real xSize; - Standard_Real ySize; - - // Reading nbPropertyValues(Integer) - PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed - if (nbPropertyValues != 2) - PR.AddFail("No. of Property values : Value is not 2"); - - // Reading xSize(Real) - PR.ReadReal (PR.Current(), "Drawing extent along +ve XD axis", xSize); //szv#4:S4163:12Mar99 `st=` not needed - - // Reading ySize(Real) - PR.ReadReal (PR.Current(), "Drawing extent along +ve YD axis", ySize); //szv#4:S4163:12Mar99 `st=` not needed - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(nbPropertyValues, xSize, ySize); -} - -void IGESGraph_ToolDrawingSize::WriteOwnParams - (const Handle(IGESGraph_DrawingSize)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send( ent->NbPropertyValues() ); - IW.Send( ent->XSize() ); - IW.Send( ent->YSize() ); -} - -Standard_Boolean IGESGraph_ToolDrawingSize::OwnCorrect - (const Handle(IGESGraph_DrawingSize)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 2); - if (res) ent->Init(2,ent->XSize(),ent->YSize()); // nbpropertyvalues=2 - return res; -} - -IGESData_DirChecker IGESGraph_ToolDrawingSize::DirChecker - (const Handle(IGESGraph_DrawingSize)& /*ent*/) const -{ - IGESData_DirChecker DC (406, 16); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESGraph_ToolDrawingSize::OwnCheck - (const Handle(IGESGraph_DrawingSize)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if (ent->NbPropertyValues() != 2) - ach->AddFail("No. of Property values : Value != 2"); -} - -void IGESGraph_ToolDrawingSize::OwnDump - (const Handle(IGESGraph_DrawingSize)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const -{ - S << "IGESGraph_DrawingSize" << endl; - - S << "No. of property values : " << ent->NbPropertyValues() << endl; - S << "Drawing extent along positive X-axis : " << ent->XSize() << endl; - S << "Drawing extent along positive Y-axis : " << ent->YSize() << endl; - S << endl; -} diff --git a/src/IGESGraph/IGESGraph_ToolDrawingSize.hxx b/src/IGESGraph/IGESGraph_ToolDrawingSize.hxx deleted file mode 100644 index 644845129d..0000000000 --- a/src/IGESGraph/IGESGraph_ToolDrawingSize.hxx +++ /dev/null @@ -1,71 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ToolDrawingSize_HeaderFile -#define _IGESGraph_ToolDrawingSize_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESGraph_DrawingSize; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a DrawingSize. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESGraph_ToolDrawingSize -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolDrawingSize, ready to work - IGESGraph_ToolDrawingSize() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESGraph_DrawingSize)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESGraph_DrawingSize)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a DrawingSize - //! (NbPropertyValues forced to 2) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESGraph_DrawingSize)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESGraph_DrawingSize)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESGraph_DrawingSize)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESGraph_DrawingSize)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESGraph_ToolDrawingSize_HeaderFile diff --git a/src/IGESGraph/IGESGraph_ToolDrawingUnits.cxx b/src/IGESGraph/IGESGraph_ToolDrawingUnits.cxx deleted file mode 100644 index b95bf1138c..0000000000 --- a/src/IGESGraph/IGESGraph_ToolDrawingUnits.cxx +++ /dev/null @@ -1,169 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESGraph_ToolDrawingUnits::ReadOwnParams - (const Handle(IGESGraph_DrawingUnits)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - Standard_Integer nbPropertyValues; - Standard_Integer flag; - Handle(TCollection_HAsciiString) unit; - - // Reading nbPropertyValues(Integer) - PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed - if (nbPropertyValues != 2) - PR.AddFail("No. of Property values : Value is not 2"); - - // Reading flag(Integer) - PR.ReadInteger(PR.Current(), "Units Flag", flag); //szv#4:S4163:12Mar99 `st=` not needed - - // Reading unit(String) - PR.ReadText(PR.Current(), "Units Name", unit); //szv#4:S4163:12Mar99 `st=` not needed - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(nbPropertyValues, flag, unit); -} - -void IGESGraph_ToolDrawingUnits::WriteOwnParams - (const Handle(IGESGraph_DrawingUnits)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send( ent->NbPropertyValues() ); - IW.Send( ent->Flag() ); - IW.Send( ent->Unit() ); -} - -Standard_Boolean IGESGraph_ToolDrawingUnits::OwnCorrect - (const Handle(IGESGraph_DrawingUnits)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 2); -// ya aussi les noms : Flag a priorite sur Unit - Standard_Integer unf = ent->Flag(); - Handle(TCollection_HAsciiString) name; - Standard_CString unm = ""; - if (!ent->Unit().IsNull()) unm = ent->Unit()->ToCString(); - switch (unf) { - case 1 : if ((strcmp(unm,"IN") == 0) || (strcmp(unm,"INCH") == 0)) - name = new TCollection_HAsciiString ("IN"); break; - case 2 : if (strcmp(unm,"MM") == 0) - name = new TCollection_HAsciiString ("MM"); break; - case 3 : break; // nom libre - case 4 : if (strcmp(unm,"FT") == 0) - name = new TCollection_HAsciiString ("FT"); break; - case 5 : if (strcmp(unm,"MI") == 0) - name = new TCollection_HAsciiString ("MI"); break; - case 6 : if (strcmp(unm,"M") == 0) - name = new TCollection_HAsciiString ("M"); break; - case 7 : if (strcmp(unm,"KM") == 0) - name = new TCollection_HAsciiString ("KM"); break; - case 8 : if (strcmp(unm,"MIL") == 0) - name = new TCollection_HAsciiString ("MIL"); break; - case 9 : if (strcmp(unm,"UM") == 0) - name = new TCollection_HAsciiString ("UM"); break; - case 10 : if (strcmp(unm,"CM") == 0) - name = new TCollection_HAsciiString ("CM"); break; - case 11 : if (strcmp(unm,"UIN") == 0) - name = new TCollection_HAsciiString ("UIN"); break; - default : break; // on ne peut rien faire ... ? - } - - res |= (!name.IsNull()); - if (name.IsNull()) name = ent->Unit(); - if (res) ent->Init(2,unf,name); // nbpropertyvalues=2 + Unit Flag//Name - return res; -} - -IGESData_DirChecker IGESGraph_ToolDrawingUnits::DirChecker - (const Handle(IGESGraph_DrawingUnits)& /*ent*/) const -{ - IGESData_DirChecker DC (406, 17); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESGraph_ToolDrawingUnits::OwnCheck - (const Handle(IGESGraph_DrawingUnits)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if (ent->NbPropertyValues() != 2) - ach->AddFail("No. of Property values : Value != 2"); -// Check Flag//Unit Name - Standard_Integer unf = ent->Flag(); - if (ent->Unit().IsNull()) { - if (unf == 3) ach->AddFail - ("Unit Flag = 3 (user def.) and Unit Name undefined"); - } else { - Standard_CString unm = ent->Unit()->ToCString(); - Standard_Boolean unok = Standard_True; - switch (unf) { - case 1 : unok = (!strcmp(unm,"IN") || !strcmp(unm,"INCH")); break; - case 2 : unok = !strcmp(unm,"MM"); break; - case 3 : unok = Standard_True; break; // nom libre - case 4 : unok = !strcmp(unm,"FT"); break; - case 5 : unok = !strcmp(unm,"MI"); break; - case 6 : unok = !strcmp(unm,"M"); break; - case 7 : unok = !strcmp(unm,"KM"); break; - case 8 : unok = !strcmp(unm,"MIL"); break; - case 9 : unok = !strcmp(unm,"UM"); break; - case 10 : unok = !strcmp(unm,"CM"); break; - case 11 : unok = !strcmp(unm,"UIN"); break; - default : ach->AddFail("Unit Flag not in range 1 - 11"); - break; - } - if (!unok) ach->AddFail("Unit Flag & Name not accorded"); - } -} - -void IGESGraph_ToolDrawingUnits::OwnDump - (const Handle(IGESGraph_DrawingUnits)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const -{ - S << "IGESGraph_DrawingUnits" << endl; - - S << "No. of property values : " << ent->NbPropertyValues() << endl; - S << " Units Flag : " << ent->Flag(); - S << " Units Name : "; - IGESData_DumpString(S,ent->Unit()); - S << " computed Value (in meters) : " << ent->UnitValue(); - S << endl; -} diff --git a/src/IGESGraph/IGESGraph_ToolDrawingUnits.hxx b/src/IGESGraph/IGESGraph_ToolDrawingUnits.hxx deleted file mode 100644 index c4b78f75b6..0000000000 --- a/src/IGESGraph/IGESGraph_ToolDrawingUnits.hxx +++ /dev/null @@ -1,71 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ToolDrawingUnits_HeaderFile -#define _IGESGraph_ToolDrawingUnits_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESGraph_DrawingUnits; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a DrawingUnits. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESGraph_ToolDrawingUnits -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolDrawingUnits, ready to work - IGESGraph_ToolDrawingUnits() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESGraph_DrawingUnits)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESGraph_DrawingUnits)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a DrawingUnits - //! (NbPropertyValues forced to 2) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESGraph_DrawingUnits)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESGraph_DrawingUnits)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESGraph_DrawingUnits)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESGraph_DrawingUnits)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESGraph_ToolDrawingUnits_HeaderFile diff --git a/src/IGESGraph/IGESGraph_ToolHighLight.cxx b/src/IGESGraph/IGESGraph_ToolHighLight.cxx deleted file mode 100644 index 2aa69746a3..0000000000 --- a/src/IGESGraph/IGESGraph_ToolHighLight.cxx +++ /dev/null @@ -1,102 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESGraph_ToolHighLight::ReadOwnParams - (const Handle(IGESGraph_HighLight)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - Standard_Integer nbPropertyValues; - Standard_Integer highLightStatus; - - // Reading nbPropertyValues(Integer) - PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); - if (nbPropertyValues != 1) - PR.AddFail("No. of Property values : Value is not 1"); - - if (PR.DefinedElseSkip()) - // Reading highLightStatus(Integer) - PR.ReadInteger (PR.Current(), "Highlight flag", highLightStatus); - else - highLightStatus = 0; // Default Value - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(nbPropertyValues, highLightStatus); -} - -void IGESGraph_ToolHighLight::WriteOwnParams - (const Handle(IGESGraph_HighLight)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send( ent->NbPropertyValues() ); - IW.Send( ent->HighLightStatus() ); -} - -Standard_Boolean IGESGraph_ToolHighLight::OwnCorrect - (const Handle(IGESGraph_HighLight)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 1); - if (res) ent->Init(1,ent->HighLightStatus()); // nbpropertyvalues=1 - return res; -} - -IGESData_DirChecker IGESGraph_ToolHighLight::DirChecker - (const Handle(IGESGraph_HighLight)& /*ent*/) const -{ - IGESData_DirChecker DC (406, 20); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESGraph_ToolHighLight::OwnCheck - (const Handle(IGESGraph_HighLight)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if (ent->NbPropertyValues() != 1) - ach->AddFail("No. of Property values : Value != 1"); -} - -void IGESGraph_ToolHighLight::OwnDump - (const Handle(IGESGraph_HighLight)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const -{ - S << "IGESGraph_HighLight" << endl; - - S << "No. of property values : " << ent->NbPropertyValues() << endl; - S << "Highlight Status : " << ent->HighLightStatus() << endl; - S << endl; -} diff --git a/src/IGESGraph/IGESGraph_ToolHighLight.hxx b/src/IGESGraph/IGESGraph_ToolHighLight.hxx deleted file mode 100644 index 66bba2e5b4..0000000000 --- a/src/IGESGraph/IGESGraph_ToolHighLight.hxx +++ /dev/null @@ -1,71 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ToolHighLight_HeaderFile -#define _IGESGraph_ToolHighLight_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESGraph_HighLight; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a HighLight. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESGraph_ToolHighLight -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolHighLight, ready to work - IGESGraph_ToolHighLight() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESGraph_HighLight)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESGraph_HighLight)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a HighLight - //! (NbPropertyValues forced to 1) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESGraph_HighLight)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESGraph_HighLight)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESGraph_HighLight)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESGraph_HighLight)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESGraph_ToolHighLight_HeaderFile diff --git a/src/IGESGraph/IGESGraph_ToolIntercharacterSpacing.cxx b/src/IGESGraph/IGESGraph_ToolIntercharacterSpacing.cxx deleted file mode 100644 index fd225d4997..0000000000 --- a/src/IGESGraph/IGESGraph_ToolIntercharacterSpacing.cxx +++ /dev/null @@ -1,103 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESGraph_ToolIntercharacterSpacing::ReadOwnParams - (const Handle(IGESGraph_IntercharacterSpacing)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - Standard_Integer nbPropertyValues; - Standard_Real iSpace; - - // Reading nbPropertyValues(Integer) - PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed - if (nbPropertyValues != 1) - PR.AddFail("No. of Property values : Value is not 1"); - - // Reading iSpace(Real) - PR.ReadReal(PR.Current(), "Intercharacter space in % of text height", iSpace); //szv#4:S4163:12Mar99 `st=` not needed - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(nbPropertyValues, iSpace); -} - -void IGESGraph_ToolIntercharacterSpacing::WriteOwnParams - (const Handle(IGESGraph_IntercharacterSpacing)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send( ent->NbPropertyValues() ); - IW.Send( ent->ISpace() ); -} - -Standard_Boolean IGESGraph_ToolIntercharacterSpacing::OwnCorrect - (const Handle(IGESGraph_IntercharacterSpacing)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 1); - if (res) ent->Init(1,ent->ISpace()); // nbpropertyvalues=1 - return res; -} - -IGESData_DirChecker IGESGraph_ToolIntercharacterSpacing::DirChecker - (const Handle(IGESGraph_IntercharacterSpacing)& /*ent*/) const -{ - IGESData_DirChecker DC (406, 18); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESGraph_ToolIntercharacterSpacing::OwnCheck - (const Handle(IGESGraph_IntercharacterSpacing)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if ((ent->ISpace() < 0.0) || (ent->ISpace() > 100.0)) - ach->AddFail("Intercharacter Space : Value not in the range [0-100]"); - if (ent->NbPropertyValues() != 1) - ach->AddFail("No. of Property values : Value != 1"); -} - -void IGESGraph_ToolIntercharacterSpacing::OwnDump - (const Handle(IGESGraph_IntercharacterSpacing)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const -{ - S << "IGESGraph_IntercharacterSpacing" << endl; - - S << "No. of property values : " << ent->NbPropertyValues() << endl; - S << "Intercharacter space in % of text height : " << ent->ISpace() << endl; - S << endl; -} diff --git a/src/IGESGraph/IGESGraph_ToolIntercharacterSpacing.hxx b/src/IGESGraph/IGESGraph_ToolIntercharacterSpacing.hxx deleted file mode 100644 index 3c20da5bd4..0000000000 --- a/src/IGESGraph/IGESGraph_ToolIntercharacterSpacing.hxx +++ /dev/null @@ -1,71 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ToolIntercharacterSpacing_HeaderFile -#define _IGESGraph_ToolIntercharacterSpacing_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESGraph_IntercharacterSpacing; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a IntercharacterSpacing. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESGraph_ToolIntercharacterSpacing -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolIntercharacterSpacing, ready to work - IGESGraph_ToolIntercharacterSpacing() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESGraph_IntercharacterSpacing)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESGraph_IntercharacterSpacing)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a IntercharacterSpacing - //! (NbPropertyValues forced to 1) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESGraph_IntercharacterSpacing)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESGraph_IntercharacterSpacing)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESGraph_IntercharacterSpacing)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESGraph_IntercharacterSpacing)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESGraph_ToolIntercharacterSpacing_HeaderFile diff --git a/src/IGESGraph/IGESGraph_ToolLineFontDefPattern.cxx b/src/IGESGraph/IGESGraph_ToolLineFontDefPattern.cxx deleted file mode 100644 index 4d2b7d2688..0000000000 --- a/src/IGESGraph/IGESGraph_ToolLineFontDefPattern.cxx +++ /dev/null @@ -1,126 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESGraph_ToolLineFontDefPattern::ReadOwnParams - (const Handle(IGESGraph_LineFontDefPattern)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - Standard_Integer tempNbSeg; - Handle(TCollection_HAsciiString) tempDisplayPattern; - Handle(TColStd_HArray1OfReal) tempSegmentLengths; - - if (PR.ReadInteger(PR.Current(), "Number of Visible-Blank Segments", tempNbSeg)) { //szv#4:S4163:12Mar99 `st=` not needed - // Initialise HArray1 only if there is no error reading its Length - if (tempNbSeg <= 0) PR.AddFail("Number of Visible-Blank Segments : Not Positive"); - else tempSegmentLengths = new TColStd_HArray1OfReal(1, tempNbSeg); - } - - // Read the HArray1 only if its Length was read without any Error - if (! tempSegmentLengths.IsNull()) { - Standard_Integer I; - for (I = 1; I <= tempNbSeg; I++) { - Standard_Real tempReal; - if (PR.ReadReal(PR.Current(), "Length of Segment", tempReal)) //szv#4:S4163:12Mar99 `st=` not needed - tempSegmentLengths->SetValue(I, tempReal); - } - } - - PR.ReadText(PR.Current(), "Visible-Blank Display Pattern", tempDisplayPattern); //szv#4:S4163:12Mar99 `st=` not needed - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(tempSegmentLengths, tempDisplayPattern); -} - -void IGESGraph_ToolLineFontDefPattern::WriteOwnParams - (const Handle(IGESGraph_LineFontDefPattern)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer up = ent->NbSegments(); - IW.Send(up); - Standard_Integer I; - for (I = 1; I <= up; I++) - IW.Send(ent->Length(I)); - IW.Send(ent->DisplayPattern()); -} - -IGESData_DirChecker IGESGraph_ToolLineFontDefPattern::DirChecker - (const Handle(IGESGraph_LineFontDefPattern)& /*ent*/) const -{ - IGESData_DirChecker DC(304, 2); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefValue); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.SubordinateStatusRequired(0); - DC.UseFlagRequired(2); - DC.HierarchyStatusIgnored(); - - return DC; -} - -void IGESGraph_ToolLineFontDefPattern::OwnCheck - (const Handle(IGESGraph_LineFontDefPattern)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if (ent->RankLineFont() == 0) - ach->AddWarning("Line Font Rank is zero"); - else if (ent->RankLineFont() < 1 || ent->RankLineFont() > 5) - ach->AddWarning("Invalid Value As Line Font Rank(Valid Range 1 to 5)"); -} - -void IGESGraph_ToolLineFontDefPattern::OwnDump - (const Handle(IGESGraph_LineFontDefPattern)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - S << "IGESGraph_LineFontDefPattern" << endl; - - S << "Visible-Blank Segments : "; - Standard_Integer nb = ent->NbSegments(); - IGESData_DumpVals(S ,level,1, nb,ent->Length); - S <DisplayPattern()); - S << endl; - if (level > 4) { - S << " -> Which Segments are Visible (the others are Blank) : " << endl; - for (Standard_Integer I = 1; I <= nb; I ++) { - if (ent->IsVisible(I)) S << " " << I; - } - S << endl; - } -} diff --git a/src/IGESGraph/IGESGraph_ToolLineFontDefPattern.hxx b/src/IGESGraph/IGESGraph_ToolLineFontDefPattern.hxx deleted file mode 100644 index 031c370b03..0000000000 --- a/src/IGESGraph/IGESGraph_ToolLineFontDefPattern.hxx +++ /dev/null @@ -1,66 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ToolLineFontDefPattern_HeaderFile -#define _IGESGraph_ToolLineFontDefPattern_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESGraph_LineFontDefPattern; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a LineFontDefPattern. Called by various -//! Modules (ReadWriteModule, GeneralModule, SpecificModule) -class IGESGraph_ToolLineFontDefPattern -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolLineFontDefPattern, ready to work - IGESGraph_ToolLineFontDefPattern() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESGraph_LineFontDefPattern)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESGraph_LineFontDefPattern)& ent, IGESData_IGESWriter& IW) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESGraph_LineFontDefPattern)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESGraph_LineFontDefPattern)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESGraph_LineFontDefPattern)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESGraph_ToolLineFontDefPattern_HeaderFile diff --git a/src/IGESGraph/IGESGraph_ToolLineFontDefTemplate.cxx b/src/IGESGraph/IGESGraph_ToolLineFontDefTemplate.cxx deleted file mode 100644 index 2b84396891..0000000000 --- a/src/IGESGraph/IGESGraph_ToolLineFontDefTemplate.cxx +++ /dev/null @@ -1,118 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESGraph_ToolLineFontDefTemplate::ReadOwnParams - (const Handle(IGESGraph_LineFontDefTemplate)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - Standard_Integer tempOrientation; - Standard_Real tempDistance, tempScale; - Handle(IGESBasic_SubfigureDef) tempTemplateEntity; - - PR.ReadInteger(PR.Current(), "Template Orientation", tempOrientation); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), - "Subfigure Definition Entity for Template Display", - STANDARD_TYPE(IGESBasic_SubfigureDef), tempTemplateEntity); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadReal(PR.Current(), "Distance between successive Template", - tempDistance); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadReal(PR.Current(), "Scale Factor For Subfigure", tempScale); //szv#4:S4163:12Mar99 `st=` not needed - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init (tempOrientation, tempTemplateEntity, tempDistance, tempScale); -} - -void IGESGraph_ToolLineFontDefTemplate::WriteOwnParams - (const Handle(IGESGraph_LineFontDefTemplate)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send(ent->Orientation()); - IW.Send(ent->TemplateEntity()); - IW.Send(ent->Distance()); - IW.Send(ent->Scale()); -} - -void IGESGraph_ToolLineFontDefTemplate::OwnShared - (const Handle(IGESGraph_LineFontDefTemplate)& ent, Interface_EntityIterator& iter) const -{ - iter.GetOneItem(ent->TemplateEntity()); -} - -IGESData_DirChecker IGESGraph_ToolLineFontDefTemplate::DirChecker - (const Handle(IGESGraph_LineFontDefTemplate)& /*ent*/) const -{ - IGESData_DirChecker DC(304, 1); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefValue); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.SubordinateStatusRequired(0); - DC.UseFlagRequired(2); - DC.HierarchyStatusIgnored(); - - return DC; -} - -void IGESGraph_ToolLineFontDefTemplate::OwnCheck - (const Handle(IGESGraph_LineFontDefTemplate)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if (ent->RankLineFont() == 0) - ach->AddWarning("Line Font Rank is zero"); - else if ((ent->RankLineFont() < 1) || (ent->RankLineFont() > 5)) - ach->AddWarning("Invalid Value As Line Font Rank"); -} - -void IGESGraph_ToolLineFontDefTemplate::OwnDump - (const Handle(IGESGraph_LineFontDefTemplate)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1; - - S << "IGESGraph_LineFontDefTemplate" << endl; - - S << "Orientation : " << ent->Orientation() << endl; - S << "Subfigure Display Entity For Template Display : "; - dumper.Dump(ent->TemplateEntity(),S, tempSubLevel); - S << endl; - S << "Length Between Successive Template Figure : " << ent->Distance()<Scale() << endl; - S << endl; -} - diff --git a/src/IGESGraph/IGESGraph_ToolLineFontDefTemplate.hxx b/src/IGESGraph/IGESGraph_ToolLineFontDefTemplate.hxx deleted file mode 100644 index 3bccc0369a..0000000000 --- a/src/IGESGraph/IGESGraph_ToolLineFontDefTemplate.hxx +++ /dev/null @@ -1,70 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ToolLineFontDefTemplate_HeaderFile -#define _IGESGraph_ToolLineFontDefTemplate_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESGraph_LineFontDefTemplate; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a LineFontDefTemplate. Called by various -//! Modules (ReadWriteModule, GeneralModule, SpecificModule) -class IGESGraph_ToolLineFontDefTemplate -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolLineFontDefTemplate, ready to work - IGESGraph_ToolLineFontDefTemplate() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESGraph_LineFontDefTemplate)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESGraph_LineFontDefTemplate)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a LineFontDefTemplate , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESGraph_LineFontDefTemplate)& ent, Interface_EntityIterator& iter) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESGraph_LineFontDefTemplate)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESGraph_LineFontDefTemplate)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESGraph_LineFontDefTemplate)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESGraph_ToolLineFontDefTemplate_HeaderFile diff --git a/src/IGESGraph/IGESGraph_ToolLineFontPredefined.cxx b/src/IGESGraph/IGESGraph_ToolLineFontPredefined.cxx deleted file mode 100644 index efe48847fe..0000000000 --- a/src/IGESGraph/IGESGraph_ToolLineFontPredefined.cxx +++ /dev/null @@ -1,101 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESGraph_ToolLineFontPredefined::ReadOwnParams - (const Handle(IGESGraph_LineFontPredefined)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - Standard_Integer nbPropertyValues; - Standard_Integer lineFontPatternCode; - - // Reading nbPropertyValues(Integer) - PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed - if (nbPropertyValues != 1) - PR.AddFail("No. of Property values : Value is not 1"); - - // Reading lineFontPatternCode(Integer) - PR.ReadInteger(PR.Current(), "Line Font Pattern Code", lineFontPatternCode); //szv#4:S4163:12Mar99 `st=` not needed - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(nbPropertyValues, lineFontPatternCode); -} - -void IGESGraph_ToolLineFontPredefined::WriteOwnParams - (const Handle(IGESGraph_LineFontPredefined)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send( ent->NbPropertyValues() ); - IW.Send( ent->LineFontPatternCode() ); -} - -Standard_Boolean IGESGraph_ToolLineFontPredefined::OwnCorrect - (const Handle(IGESGraph_LineFontPredefined)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 1); - if (res) ent->Init(1,ent->LineFontPatternCode()); // nbpropertyvalues=1 - return res; -} - -IGESData_DirChecker IGESGraph_ToolLineFontPredefined::DirChecker - (const Handle(IGESGraph_LineFontPredefined)& /*ent*/) const -{ - IGESData_DirChecker DC (406, 19); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESGraph_ToolLineFontPredefined::OwnCheck - (const Handle(IGESGraph_LineFontPredefined)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if (ent->NbPropertyValues() != 1) - ach->AddFail("No. of Property values : Value != 1"); -} - -void IGESGraph_ToolLineFontPredefined::OwnDump - (const Handle(IGESGraph_LineFontPredefined)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const -{ - S << "IGESGraph_LineFontPredefined" << endl; - - S << "No. of property values : " << ent->NbPropertyValues() << endl; - S << "Line font pattern code : " << ent->LineFontPatternCode() << endl; - S << endl; -} diff --git a/src/IGESGraph/IGESGraph_ToolLineFontPredefined.hxx b/src/IGESGraph/IGESGraph_ToolLineFontPredefined.hxx deleted file mode 100644 index ed7a9a4a75..0000000000 --- a/src/IGESGraph/IGESGraph_ToolLineFontPredefined.hxx +++ /dev/null @@ -1,71 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ToolLineFontPredefined_HeaderFile -#define _IGESGraph_ToolLineFontPredefined_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESGraph_LineFontPredefined; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a LineFontPredefined. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESGraph_ToolLineFontPredefined -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolLineFontPredefined, ready to work - IGESGraph_ToolLineFontPredefined() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESGraph_LineFontPredefined)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESGraph_LineFontPredefined)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a LineFontPredefined - //! (NbPropertyValues forced to 1) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESGraph_LineFontPredefined)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESGraph_LineFontPredefined)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESGraph_LineFontPredefined)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESGraph_LineFontPredefined)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESGraph_ToolLineFontPredefined_HeaderFile diff --git a/src/IGESGraph/IGESGraph_ToolNominalSize.cxx b/src/IGESGraph/IGESGraph_ToolNominalSize.cxx deleted file mode 100644 index 99cb57a630..0000000000 --- a/src/IGESGraph/IGESGraph_ToolNominalSize.cxx +++ /dev/null @@ -1,133 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESGraph_ToolNominalSize::ReadOwnParams - (const Handle(IGESGraph_NominalSize)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - Standard_Integer nbPropertyValues; - Standard_Real nominalSizeValue; - Handle(TCollection_HAsciiString) nominalSizeName; - Handle(TCollection_HAsciiString) standardName; - - // Reading nbPropertyValues(Integer) - PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed - if ( (nbPropertyValues != 2) && (nbPropertyValues != 3) ) - PR.AddFail("No. of Property values : Value is not 2/3"); - - // Reading nominalSizeValue(Real) - PR.ReadReal (PR.Current(), "Nominal size value", nominalSizeValue); //szv#4:S4163:12Mar99 `st=` not needed - - // Reading nominalSizeName(String) - PR.ReadText (PR.Current(), "Nominal size name", nominalSizeName); //szv#4:S4163:12Mar99 `st=` not needed - - if ( PR.NbParams() >= PR.CurrentNumber() ) - { - Standard_Integer num = PR.CurrentNumber(); - if ( PR.ParamType(num) == Interface_ParamText ) - // Reading standardName(String) - PR.ReadText (PR.Current(), "Name of relevant engg. standard", - standardName); //szv#4:S4163:12Mar99 `st=` not needed - } - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init - (nbPropertyValues, nominalSizeValue, nominalSizeName, standardName); -} - -void IGESGraph_ToolNominalSize::WriteOwnParams - (const Handle(IGESGraph_NominalSize)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send( ent->NbPropertyValues() ); - IW.Send( ent->NominalSizeValue() ); - IW.Send( ent->NominalSizeName() ); - - if (ent->HasStandardName() ) - IW.Send( ent->StandardName() ); // optionnal -} - -Standard_Boolean IGESGraph_ToolNominalSize::OwnCorrect - (const Handle(IGESGraph_NominalSize)& ent) const -{ - Standard_Integer nbp = 2; - if (ent->HasStandardName()) nbp = 3; - Standard_Boolean res = ( ent->NbPropertyValues() != nbp); - if (res) ent->Init - (nbp,ent->NominalSizeValue(),ent->NominalSizeName(),ent->StandardName()); - return res; // nbpropertyvalues=2/3 selon standard -} - -IGESData_DirChecker IGESGraph_ToolNominalSize::DirChecker - (const Handle(IGESGraph_NominalSize)& /*ent*/) const -{ - IGESData_DirChecker DC (406, 13); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESGraph_ToolNominalSize::OwnCheck - (const Handle(IGESGraph_NominalSize)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - Standard_Integer nbp = 2; - if (ent->HasStandardName()) nbp = 3; - if ( ent->NbPropertyValues() != nbp) ach->AddFail - ("No. of Property values : Value != 2/3 according Standard Name Status"); -} - -void IGESGraph_ToolNominalSize::OwnDump - (const Handle(IGESGraph_NominalSize)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const -{ - S << "IGESGraph_NominalSize" << endl; - - S << "No. of property values : " << ent->NbPropertyValues() << endl; - S << "Nominal size value : " << ent->NominalSizeValue() << endl; - S << "Nominal size name : "; - IGESData_DumpString(S,ent->NominalSizeName()); - S << endl; - S << "Name of relevant engineering standard : "; - IGESData_DumpString(S,ent->StandardName()); - S << endl; -} diff --git a/src/IGESGraph/IGESGraph_ToolNominalSize.hxx b/src/IGESGraph/IGESGraph_ToolNominalSize.hxx deleted file mode 100644 index bc5c7c6fa5..0000000000 --- a/src/IGESGraph/IGESGraph_ToolNominalSize.hxx +++ /dev/null @@ -1,71 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ToolNominalSize_HeaderFile -#define _IGESGraph_ToolNominalSize_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESGraph_NominalSize; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a NominalSize. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESGraph_ToolNominalSize -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolNominalSize, ready to work - IGESGraph_ToolNominalSize() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESGraph_NominalSize)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESGraph_NominalSize)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a NominalSize - //! (NbPropertyValues forced to 2 or 3 according HasStandardName) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESGraph_NominalSize)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESGraph_NominalSize)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESGraph_NominalSize)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESGraph_NominalSize)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESGraph_ToolNominalSize_HeaderFile diff --git a/src/IGESGraph/IGESGraph_ToolPick.cxx b/src/IGESGraph/IGESGraph_ToolPick.cxx deleted file mode 100644 index fdc9898112..0000000000 --- a/src/IGESGraph/IGESGraph_ToolPick.cxx +++ /dev/null @@ -1,105 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESGraph_ToolPick::ReadOwnParams - (const Handle(IGESGraph_Pick)& ent, - const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const -{ - Standard_Integer nbPropertyValues; - Standard_Integer pickStatus; - - // Reading nbPropertyValues(Integer) - PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); - if (nbPropertyValues != 1) - PR.AddFail("No. of Property values : Value is not 1"); - - if (PR.DefinedElseSkip()) - // Reading pickStatus(Integer) - PR.ReadInteger( PR.Current(), "Pick Flag", pickStatus); - else - pickStatus = 0; // Default Value - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init(nbPropertyValues, pickStatus); -} - -void IGESGraph_ToolPick::WriteOwnParams - (const Handle(IGESGraph_Pick)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send( ent->NbPropertyValues() ); - IW.Send( ent->PickFlag() ); -} - -Standard_Boolean IGESGraph_ToolPick::OwnCorrect - (const Handle(IGESGraph_Pick)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 1); - if (res) ent->Init(1,ent->PickFlag()); // nbpropertyvalues=1 - return res; -} - -IGESData_DirChecker IGESGraph_ToolPick::DirChecker - (const Handle(IGESGraph_Pick)& /*ent*/) const -{ - IGESData_DirChecker DC (406, 21); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESGraph_ToolPick::OwnCheck - (const Handle(IGESGraph_Pick)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if (ent->NbPropertyValues() != 1) - ach->AddFail("No. of Property values : Value != 1"); - if ( (ent->PickFlag() != 0) && (ent->PickFlag() != 1) ) - ach->AddFail("Pick Flag : Value != 0/1"); -} - -void IGESGraph_ToolPick::OwnDump - (const Handle(IGESGraph_Pick)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const -{ - S << "IGESGraph_Pick" << endl; - - S << "No. of property values : " << ent->NbPropertyValues() << endl; - S << "Pick flag : " << ent->PickFlag(); - S << (ent->PickFlag() == 0 ? " NO" : " YES" ); - S << endl; -} diff --git a/src/IGESGraph/IGESGraph_ToolPick.hxx b/src/IGESGraph/IGESGraph_ToolPick.hxx deleted file mode 100644 index b3586aa74c..0000000000 --- a/src/IGESGraph/IGESGraph_ToolPick.hxx +++ /dev/null @@ -1,71 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ToolPick_HeaderFile -#define _IGESGraph_ToolPick_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESGraph_Pick; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a Pick. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESGraph_ToolPick -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolPick, ready to work - IGESGraph_ToolPick() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESGraph_Pick)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESGraph_Pick)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a Pick - //! (NbPropertyValues forced to 1) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESGraph_Pick)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESGraph_Pick)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESGraph_Pick)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESGraph_Pick)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESGraph_ToolPick_HeaderFile diff --git a/src/IGESGraph/IGESGraph_ToolTextDisplayTemplate.cxx b/src/IGESGraph/IGESGraph_ToolTextDisplayTemplate.cxx deleted file mode 100644 index 8d13d7e612..0000000000 --- a/src/IGESGraph/IGESGraph_ToolTextDisplayTemplate.cxx +++ /dev/null @@ -1,169 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESGraph_ToolTextDisplayTemplate::ReadOwnParams - (const Handle(IGESGraph_TextDisplayTemplate)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - - Standard_Real boxWidth; - Standard_Real boxHeight; - Standard_Integer fontCode; - Handle(IGESGraph_TextFontDef) fontEnt; - Standard_Real slantAngle; - Standard_Real rotationAngle; - Standard_Integer mirrorFlag; - Standard_Integer rotateFlag; - gp_XYZ corner; - - // Reading boxWidth(Real) - PR.ReadReal(PR.Current(), "Character box width", boxWidth); //szv#4:S4163:12Mar99 `st=` not needed - - // Reading boxHeight(Real) - PR.ReadReal(PR.Current(), "Character box height", boxHeight); //szv#4:S4163:12Mar99 `st=` not needed - - Standard_Integer curnum = PR.CurrentNumber(); - if (PR.DefinedElseSkip()) - { - // Reading fontCode(Integer, must be positive) - PR.ReadInteger (PR.Current(), "Font Code", fontCode); //szv#4:S4163:12Mar99 `st=` not needed - // Reading fontEnt(TextFontDef) ? - if (fontCode < 0) { - fontEnt = GetCasted(IGESGraph_TextFontDef,PR.ParamEntity (IR,curnum)); - if (fontEnt.IsNull()) PR.AddFail("Font Entity : incorrect reference"); - } - } - else - fontCode = 1; // Default Value - - if (PR.DefinedElseSkip()) - // Reading slantAngle(Real) - PR.ReadReal (PR.Current(), "Slant Angle", slantAngle); //szv#4:S4163:12Mar99 `st=` not needed - else - slantAngle = M_PI/2.0; // Default Value - - // Reading rotationAngle(Real) - PR.ReadReal (PR.Current(), "Rotation Angle", rotationAngle); //szv#4:S4163:12Mar99 `st=` not needed - - // Reading mirrorFlag(Integer) - PR.ReadInteger (PR.Current(), "Mirror Flag", mirrorFlag); //szv#4:S4163:12Mar99 `st=` not needed - - // Reading rotateFlag(Integer) - PR.ReadInteger (PR.Current(), "Rotate Flag", rotateFlag); //szv#4:S4163:12Mar99 `st=` not needed - - // Reading corner(XYZ) - PR.ReadXYZ( PR.CurrentList(1, 3), "Lower left coordinates/Increments", corner); //szv#4:S4163:12Mar99 `st=` not needed - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init - (boxWidth, boxHeight, fontCode, fontEnt, - slantAngle, rotationAngle, mirrorFlag, rotateFlag, corner); -} - -void IGESGraph_ToolTextDisplayTemplate::WriteOwnParams - (const Handle(IGESGraph_TextDisplayTemplate)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send( ent->BoxWidth() ); - IW.Send( ent->BoxHeight() ); - - if ( ent->IsFontEntity() ) - IW.Send( ent->FontEntity(), Standard_True ); // negative - else - IW.Send( ent->FontCode() ); - - IW.Send( ent->SlantAngle() ); - IW.Send( ent->RotationAngle() ); - IW.Send( ent->MirrorFlag() ); - IW.Send( ent->RotateFlag() ); - IW.Send( ent->StartingCorner().X() ); - IW.Send( ent->StartingCorner().Y() ); - IW.Send( ent->StartingCorner().Z() ); -} - -void IGESGraph_ToolTextDisplayTemplate::OwnShared - (const Handle(IGESGraph_TextDisplayTemplate)& ent, Interface_EntityIterator& iter) const -{ - if ( ent->IsFontEntity() ) - iter.GetOneItem( ent->FontEntity() ); -} - -IGESData_DirChecker IGESGraph_ToolTextDisplayTemplate::DirChecker - (const Handle(IGESGraph_TextDisplayTemplate)& /*ent*/) const -{ - IGESData_DirChecker DC (312, 0, 1); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefAny); - DC.SubordinateStatusRequired(0); - DC.UseFlagRequired(2); - DC.HierarchyStatusRequired(0); - return DC; -} - -void IGESGraph_ToolTextDisplayTemplate::OwnDump - (const Handle(IGESGraph_TextDisplayTemplate)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer sublevel = (level <= 4) ? 0 : 1; - - S << "IGESGraph_TextDisplayTemplate" << endl; - - S << "Character box width : " << ent->BoxWidth() << " "; - S << "Character box height : " << ent->BoxHeight() << endl; - if ( ent->IsFontEntity() ) - { - S << "Font Entity : "; - dumper.Dump(ent->FontEntity(),S, sublevel); - } - else - S << "Font code : " << ent->FontCode(); - S << endl; - S << "Slant angle : " << ent->SlantAngle() << " "; - S << "Rotation angle : " << ent->RotationAngle() << endl; - S << "Mirror flag : " << ent->MirrorFlag() << " "; - S << "Rotate flag : " << ent->RotateFlag() << endl; - if ( ent->FormNumber() == 0 ) - S << "Lower Left Corner coordinates : "; - else - S << "Increments from coordinates : "; - IGESData_DumpXYZL(S,level, ent->StartingCorner(), ent->Location()); - S << endl; -} diff --git a/src/IGESGraph/IGESGraph_ToolTextDisplayTemplate.hxx b/src/IGESGraph/IGESGraph_ToolTextDisplayTemplate.hxx deleted file mode 100644 index 58505472c4..0000000000 --- a/src/IGESGraph/IGESGraph_ToolTextDisplayTemplate.hxx +++ /dev/null @@ -1,67 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ToolTextDisplayTemplate_HeaderFile -#define _IGESGraph_ToolTextDisplayTemplate_HeaderFile - -#include -#include -#include - -#include -class Standard_DomainError; -class IGESGraph_TextDisplayTemplate; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a TextDisplayTemplate. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESGraph_ToolTextDisplayTemplate -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolTextDisplayTemplate, ready to work - IGESGraph_ToolTextDisplayTemplate() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESGraph_TextDisplayTemplate)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESGraph_TextDisplayTemplate)& ent, IGESData_IGESWriter& IW) const; - - //! Lists the Entities shared by a TextDisplayTemplate , from - //! its specific (own) parameters - Standard_EXPORT void OwnShared (const Handle(IGESGraph_TextDisplayTemplate)& ent, Interface_EntityIterator& iter) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESGraph_TextDisplayTemplate)& ent) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESGraph_TextDisplayTemplate)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESGraph_ToolTextDisplayTemplate_HeaderFile diff --git a/src/IGESGraph/IGESGraph_ToolTextFontDef.cxx b/src/IGESGraph/IGESGraph_ToolTextFontDef.cxx deleted file mode 100644 index 35be08f45c..0000000000 --- a/src/IGESGraph/IGESGraph_ToolTextFontDef.cxx +++ /dev/null @@ -1,265 +0,0 @@ -// Created by: CKY / Contract Toubro-Larsen -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//-------------------------------------------------------------------- -//-------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -void IGESGraph_ToolTextFontDef::ReadOwnParams - (const Handle(IGESGraph_TextFontDef)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down - Standard_Integer nbval; - - Standard_Integer fontCode; - Handle(TCollection_HAsciiString) fontName; - Standard_Integer supersededFont; - Handle(IGESGraph_TextFontDef) supersededEntity; - Standard_Integer scale; - Handle(TColStd_HArray1OfInteger) aSCIICodes; - Handle(TColStd_HArray1OfInteger) nextCharX, nextCharY; - Handle(TColStd_HArray1OfInteger) penMotions; - Handle(IGESBasic_HArray1OfHArray1OfInteger) penFlags; - Handle(IGESBasic_HArray1OfHArray1OfInteger) movePenX, movePenY; - - Standard_Integer tempCode, tempNextX,tempNextY; - Standard_Integer tempMotion; - Standard_Integer tempFlag, tempMoveX,tempMoveY; - - // Reading fontCode(Integer) - PR.ReadInteger (PR.Current(), "Font Code", fontCode); //szv#4:S4163:12Mar99 `st=` not needed - - // Reading fontName(String) - PR.ReadText (PR.Current(), "Font Name", fontName); //szv#4:S4163:12Mar99 `st=` not needed - - if ( PR.IsParamEntity(PR.CurrentNumber()) ) - { - supersededFont = -1; - - // Reading supersededEntity(TextFontDef) - PR.ReadEntity (IR, PR.Current(), "Text Definition Entity", - STANDARD_TYPE(IGESGraph_TextFontDef), supersededEntity); //szv#4:S4163:12Mar99 `st=` not needed - } - else - // Reading supersededFont(Integer) - PR.ReadInteger(PR.Current(), "No. of superseded font", supersededFont); //szv#4:S4163:12Mar99 `st=` not needed - - // Reading scale(Integer) - PR.ReadInteger(PR.Current(), "Grid units eqvt to one text height", scale); //szv#4:S4163:12Mar99 `st=` not needed - - // Reading nbval(Integer) - Standard_Boolean st = PR.ReadInteger(PR.Current(), "No. of characters in this defn", nbval); - if (st && nbval > 0) - { - aSCIICodes = new TColStd_HArray1OfInteger(1, nbval); - nextCharX = new TColStd_HArray1OfInteger(1, nbval); - nextCharY = new TColStd_HArray1OfInteger(1, nbval); - penMotions = new TColStd_HArray1OfInteger(1, nbval); - penFlags = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval); - movePenX = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval); - movePenY = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval); - - for ( Standard_Integer i = 1; i <= nbval; i++ ) - { - // Reading aSCIICodes(HArray1OfInteger) - if (PR.ReadInteger(PR.Current(), "array aSCIICodes", tempCode)) //szv#4:S4163:12Mar99 `st=` not needed - aSCIICodes->SetValue(i, tempCode); - - // Reading nextChars(HArray1OfInteger*2) - if (PR.ReadInteger(PR.Current(), "array nextChar X", tempNextX)) //szv#4:S4163:12Mar99 `st=` not needed - nextCharX->SetValue(i, tempNextX); - if (PR.ReadInteger(PR.Current(), "array nextChar Y", tempNextY)) //szv#4:S4163:12Mar99 `st=` not needed - nextCharY->SetValue(i, tempNextY); - - // Reading penMotions(HArray1OfInteger) - if (PR.ReadInteger(PR.Current(), "array penMotions", tempMotion)) { //szv#4:S4163:12Mar99 `st=` not needed - penMotions->SetValue(i, tempMotion); - if (tempMotion > 0) { - Handle(TColStd_HArray1OfInteger) intarray, xarray, yarray; - - intarray = new TColStd_HArray1OfInteger(1, tempMotion); - xarray = new TColStd_HArray1OfInteger(1, tempMotion); - yarray = new TColStd_HArray1OfInteger(1, tempMotion); - - for ( Standard_Integer j = 1; j <= tempMotion; j++ ) { - if (PR.DefinedElseSkip()) { - // Reading penFlags(HArray1OfHArray1OfInteger) - if (PR.ReadInteger(PR.Current(), "array penFlags", tempFlag)) //szv#4:S4163:12Mar99 `st=` not needed - intarray->SetValue(j, tempFlag); - } - else intarray->SetValue(j, 0); // Default Value - - // Reading movePenTo(HArray1OfHArray1OfInteger*2) - if (PR.ReadInteger(PR.Current(), "array movePenTo X", tempMoveX)) //szv#4:S4163:12Mar99 `st=` not needed - xarray->SetValue(j, tempMoveX); - if (PR.ReadInteger(PR.Current(), "array movePenTo Y", tempMoveY)) //szv#4:S4163:12Mar99 `st=` not needed - yarray->SetValue(j, tempMoveY); - } - penFlags->SetValue(i, intarray); - movePenX->SetValue(i, xarray); - movePenY->SetValue(i, yarray); - - } - else PR.AddFail("Count of Pen motions : Not Positive"); - } - } - } - else PR.AddFail ("Count of characters in this defn : Not Positive"); - - DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); - ent->Init - (fontCode, fontName, supersededFont, supersededEntity, - scale, aSCIICodes, nextCharX, nextCharY, - penMotions, penFlags, movePenX, movePenY); -} - -void IGESGraph_ToolTextFontDef::WriteOwnParams - (const Handle(IGESGraph_TextFontDef)& ent, IGESData_IGESWriter& IW) const -{ - Standard_Integer IX,IY; - IW.Send( ent->FontCode() ); - IW.Send( ent->FontName() ); - - if ( ent->IsSupersededFontEntity() ) - IW.Send( ent->SupersededFontEntity(), Standard_True ); // negative - else - IW.Send( ent->SupersededFontCode() ); - - IW.Send( ent->Scale() ); - - Standard_Integer Up = ent->NbCharacters(); - IW.Send( Up ); - for ( Standard_Integer i = 1; i <= Up; i++) - { - IW.Send( ent->ASCIICode(i) ); - ent->NextCharOrigin (i,IX,IY); - IW.Send( IX ); - IW.Send( IY ); - IW.Send( ent->NbPenMotions(i) ); - for ( Standard_Integer j = 1; j <= ent->NbPenMotions(i); j ++) - { - IW.SendBoolean( ent->IsPenUp(i,j) ); - ent->NextPenPosition (i,j, IX,IY); - IW.Send( IX ); - IW.Send( IY ); - } - } -} - -void IGESGraph_ToolTextFontDef::OwnShared - (const Handle(IGESGraph_TextFontDef)& ent, Interface_EntityIterator& iter) const -{ - if ( ent->IsSupersededFontEntity() ) - iter.GetOneItem( ent->SupersededFontEntity() ); -} - -IGESData_DirChecker IGESGraph_ToolTextFontDef::DirChecker - (const Handle(IGESGraph_TextFontDef)& /*ent*/) const -{ - IGESData_DirChecker DC (310, 0); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.SubordinateStatusRequired(0); - DC.UseFlagRequired(2); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESGraph_ToolTextFontDef::OwnDump - (const Handle(IGESGraph_TextFontDef)& ent, const IGESData_IGESDumper& dumper, - const Handle(Message_Messenger)& S, const Standard_Integer level) const -{ - Standard_Integer sublevel = (level <= 4) ? 0 : 1; - Standard_Integer nbchars = ent->NbCharacters(); - - S << "IGESGraph_TextFontDef" << endl; - - S << "Font Code : " << ent->FontCode() << endl; - S << "Font Name : "; - IGESData_DumpString(S,ent->FontName()); - S << endl; - if ( ent->IsSupersededFontEntity() ) { - S << "Text Definition Entity : "; - dumper.Dump(ent->SupersededFontEntity(),S, sublevel); - } - else S << "Superseding Font Number : " << ent->SupersededFontCode(); - S << endl; - S << "No. of Grid Units eqvt to 1 Text Height : " << ent->Scale() << endl; - S << "ASCII Codes : " << endl - << "Grid Locations of next character origins : " << endl - << "Pen Motions : " << endl - << "Pen Positions : " << endl - << "Grid Locations the pen moves to : "; - S << "Count = " << nbchars << endl; - IGESData_DumpVals(S,-level,1,nbchars,ent->ASCIICode); - S << endl; - if (level > 4 ) - { - Handle(TColgp_HArray1OfXY) arrXY; - Standard_Integer I, J, nbmotions; - for (I = 1; I <= nbchars; I++) - { - Standard_Integer IX,IY; - S << "[" << I << "]: "; - S << "ASCII Code : " << ent->ASCIICode(I) << endl; - S << "Grid Location of next character's origin : "; - ent->NextCharOrigin(I,IX,IY); - S << "X=" << IX << " Y=" << IY; - nbmotions = ent->NbPenMotions(I); - S << " No. of Pen Motions : " << nbmotions; - if (level <= 5) S << " [ ask level > 5 for Details ]" << endl; - else { - S << endl; - for (J = 1; J <= nbmotions; J++) - { - S << "Pen up(1) / down(0) flag : " << (Standard_Integer)ent->IsPenUp(I,J); - S << " Next Pen Position : "; - ent->NextPenPosition(I,J, IX,IY); - S << " X="<Init - (nbPropertyValues, finite, line, weighted, - gridPoint, gridSpacing, nbPointsX, nbPointsY); -} - -void IGESGraph_ToolUniformRectGrid::WriteOwnParams - (const Handle(IGESGraph_UniformRectGrid)& ent, IGESData_IGESWriter& IW) const -{ - IW.Send( ent->NbPropertyValues() ); - IW.SendBoolean( ent->IsFinite() ); - IW.SendBoolean( ent->IsLine() ); - IW.SendBoolean( !ent->IsWeighted() ); - IW.Send( ent->GridPoint().X() ); - IW.Send( ent->GridPoint().Y() ); - IW.Send( ent->GridSpacing().X() ); - IW.Send( ent->GridSpacing().Y() ); - IW.Send( ent->NbPointsX() ); // ?? even if not IsFinite ?? - IW.Send( ent->NbPointsY() ); -} - -Standard_Boolean IGESGraph_ToolUniformRectGrid::OwnCorrect - (const Handle(IGESGraph_UniformRectGrid)& ent) const -{ - Standard_Boolean res = (ent->NbPropertyValues() != 9); - if (res) ent->Init - (9, (ent->IsFinite() ? 1 : 0), (ent->IsLine() ? 1 : 0), - (ent->IsWeighted() ? 0 : 1),ent->GridPoint().XY(),ent->GridSpacing().XY(), - ent->NbPointsX(), ent->NbPointsY()); // nbpropertyvalues=9 - return res; -} - -IGESData_DirChecker IGESGraph_ToolUniformRectGrid::DirChecker - (const Handle(IGESGraph_UniformRectGrid)& /*ent*/) const -{ - IGESData_DirChecker DC (406, 22); - DC.Structure(IGESData_DefVoid); - DC.LineFont(IGESData_DefVoid); - DC.LineWeight(IGESData_DefVoid); - DC.Color(IGESData_DefVoid); - DC.BlankStatusIgnored(); - DC.UseFlagIgnored(); - DC.HierarchyStatusIgnored(); - return DC; -} - -void IGESGraph_ToolUniformRectGrid::OwnCheck - (const Handle(IGESGraph_UniformRectGrid)& ent, - const Interface_ShareTool& , Handle(Interface_Check)& ach) const -{ - if ( ent->IsFinite() != 0 && ent->IsFinite() != 1 ) - ach->AddFail("Finite/infinite grid flag : Value != 0/1"); - if ( ent->IsLine() != 0 && ent->IsLine() != 1 ) - ach->AddFail("Line/point grid flag : Value != 0/1"); - if ( ent->IsWeighted() != 0 && ent->IsWeighted() != 1 ) - ach->AddFail("Weighted/unweighted grid flag : Value != 0/1"); - if (ent->NbPropertyValues() != 9) - ach->AddFail("No. of Property values : Value != 9"); -} - -void IGESGraph_ToolUniformRectGrid::OwnDump - (const Handle(IGESGraph_UniformRectGrid)& ent, const IGESData_IGESDumper& /*dumper*/, - const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const -{ - S << "IGESGraph_UniformRectGrid" << endl; - - S << "No. of property values : " << ent->NbPropertyValues() << endl; - S << "Grid : " << ( ent->IsFinite() ? "Finite" : "Infinite"); - S << " - Composed of " << ( ent->IsLine() ? "Lines" : "Points"); - S << " - " << ( ent->IsWeighted() ? "Weighted" : "Unweighted") << endl; - S << "Grid Point : "; - IGESData_DumpXY(S, ent->GridPoint()); - S << " Grid Spacing : "; - IGESData_DumpXY(S, ent->GridSpacing()); S << endl; - if (ent->IsFinite()) - S << "No. of points/lines in direction : X : " << ent->NbPointsX() - << " - Y : " << ent->NbPointsY() << endl; -} diff --git a/src/IGESGraph/IGESGraph_ToolUniformRectGrid.hxx b/src/IGESGraph/IGESGraph_ToolUniformRectGrid.hxx deleted file mode 100644 index f6d00ec6cd..0000000000 --- a/src/IGESGraph/IGESGraph_ToolUniformRectGrid.hxx +++ /dev/null @@ -1,71 +0,0 @@ -// Created on: 1993-10-14 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESGraph_ToolUniformRectGrid_HeaderFile -#define _IGESGraph_ToolUniformRectGrid_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_DomainError; -class IGESGraph_UniformRectGrid; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; -class Interface_EntityIterator; -class IGESData_DirChecker; -class Interface_ShareTool; -class Interface_Check; -class IGESData_IGESDumper; -class Message_Messenger; - - -//! Tool to work on a UniformRectGrid. Called by various Modules -//! (ReadWriteModule, GeneralModule, SpecificModule) -class IGESGraph_ToolUniformRectGrid -{ - public: - - DEFINE_STANDARD_ALLOC - - //! Returns a ToolUniformRectGrid, ready to work - IGESGraph_ToolUniformRectGrid() {} - - //! Reads own parameters from file. gives access to them, - //! detains parameter types and values - Standard_EXPORT void ReadOwnParams (const Handle(IGESGraph_UniformRectGrid)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Handle(IGESGraph_UniformRectGrid)& ent, IGESData_IGESWriter& IW) const; - - //! Sets automatic unambiguous Correction on a UniformRectGrid - //! (NbPropertyValues forced to 9) - Standard_EXPORT Standard_Boolean OwnCorrect (const Handle(IGESGraph_UniformRectGrid)& ent) const; - - //! Returns specific DirChecker - Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESGraph_UniformRectGrid)& ent) const; - - //! Performs Specific Semantic Check - Standard_EXPORT void OwnCheck (const Handle(IGESGraph_UniformRectGrid)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const; - - //! Dump of Specific Parameters - Standard_EXPORT void OwnDump (const Handle(IGESGraph_UniformRectGrid)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const; -}; - -#endif // _IGESGraph_ToolUniformRectGrid_HeaderFile diff --git a/src/IGESGraph/IGESGraph_UniformRectGrid.cxx b/src/IGESGraph/IGESGraph_UniformRectGrid.cxx index 5455e37e25..3ee7c83675 100644 --- a/src/IGESGraph/IGESGraph_UniformRectGrid.cxx +++ b/src/IGESGraph/IGESGraph_UniformRectGrid.cxx @@ -18,71 +18,86 @@ #include #include -#include #include -#include +#include +#include +#include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_UniformRectGrid,IGESData_IGESEntity) -IGESGraph_UniformRectGrid::IGESGraph_UniformRectGrid () { } - - void IGESGraph_UniformRectGrid::Init - (const Standard_Integer nbProps, - const Standard_Integer finite, - const Standard_Integer line, - const Standard_Integer weighted, - const gp_XY& aGridPoint, - const gp_XY& aGridSpacing, - const Standard_Integer pointsX, - const Standard_Integer pointsY) +gp_Pnt2d IGESGraph_UniformRectGrid::GridPoint () const { - theNbPropertyValues = nbProps; - isItFinite = finite; - isItLine = line; - isItWeighted = weighted; - theGridPoint = aGridPoint; - theGridSpacing = aGridSpacing; - theNbPointsX = pointsX; - theNbPointsY = pointsY; - InitTypeAndForm(406,22); + return ( gp_Pnt2d(theGridPoint) ); } - Standard_Integer IGESGraph_UniformRectGrid::NbPropertyValues () const +gp_Vec2d IGESGraph_UniformRectGrid::GridSpacing () const { - return theNbPropertyValues; + return ( gp_Vec2d(theGridSpacing) ); } - Standard_Boolean IGESGraph_UniformRectGrid::IsFinite () const -{ - return (isItFinite == 1); -} +void IGESGraph_UniformRectGrid::OwnRead (IGESFile_Reader &PR) +{ + Standard_Integer aNbPropertyValues = 0; + PR.ReadInteger(aNbPropertyValues,"No. of property values"); + if (aNbPropertyValues != 9) + PR.AddFail("No. of Property values : Value is not 9"); - Standard_Boolean IGESGraph_UniformRectGrid::IsLine () const -{ - return (isItLine == 1); -} + PR.ReadInteger(isItFinite,"Finite/infinite grid flag"); + PR.ReadInteger(isItLine,"Line/point grid flag"); + PR.ReadInteger(isItWeighted,"Weighted/unweighted grid flag"); + PR.ReadXY(theGridPoint,"Grid point coordinates"); + PR.ReadXY(theGridSpacing,"Grid Spacing coordinates"); - Standard_Boolean IGESGraph_UniformRectGrid::IsWeighted () const -{ - return (isItWeighted == 0); -} + theNbPointsX = 0; + if (isItFinite) + PR.ReadInteger(theNbPointsX,"No. of points/lines in X direction"); - gp_Pnt2d IGESGraph_UniformRectGrid::GridPoint () const -{ - return ( gp_Pnt2d(theGridPoint) ); + theNbPointsY = 0; + if (isItFinite) + PR.ReadInteger(theNbPointsY,"No. of points/lines in Y direction"); } - gp_Vec2d IGESGraph_UniformRectGrid::GridSpacing () const +void IGESGraph_UniformRectGrid::OwnWrite (IGESData_IGESWriter &IW) const { - return ( gp_Vec2d(theGridSpacing) ); + IW.Send(9); + IW.SendBoolean(isItFinite != 0); + IW.SendBoolean(isItLine != 0); + IW.SendBoolean(isItWeighted != 0); + IW.Send(theGridPoint.X()); + IW.Send(theGridPoint.Y()); + IW.Send(theGridSpacing.X()); + IW.Send(theGridSpacing.Y()); + IW.Send(theNbPointsX); // ?? even if not IsFinite ?? + IW.Send(theNbPointsY); } - Standard_Integer IGESGraph_UniformRectGrid::NbPointsX () const -{ - return theNbPointsX; +IGESData_DirChecker IGESGraph_UniformRectGrid::DirChecker () const +{ + IGESData_DirChecker DC (406, 22); + DC.Structure(IGESData_DefVoid); + DC.LineFont(IGESData_DefVoid); + DC.LineWeight(IGESData_DefVoid); + DC.Color(IGESData_DefVoid); + DC.BlankStatusIgnored(); + DC.UseFlagIgnored(); + DC.HierarchyStatusIgnored(); + return DC; } - Standard_Integer IGESGraph_UniformRectGrid::NbPointsY () const +void IGESGraph_UniformRectGrid::OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &S, const Standard_Integer) const { - return theNbPointsY; + S << "IGESGraph_UniformRectGrid" << endl; + S << "No. of property values : 9" << endl; + S << "Grid : " << ( isItFinite ? "Finite" : "Infinite"); + S << " - Composed of " << ( isItLine ? "Lines" : "Points"); + S << " - " << ( isItWeighted ? "Weighted" : "Unweighted") << endl; + S << "Grid Point : "; + IGESData_DumpXY(S,theGridPoint); + S << " Grid Spacing : "; + IGESData_DumpXY(S,theGridSpacing); S << endl; + if (isItFinite) + S << "No. of points/lines in direction : X : " << theNbPointsX << " - Y : " << theNbPointsY << endl; } diff --git a/src/IGESGraph/IGESGraph_UniformRectGrid.hxx b/src/IGESGraph/IGESGraph_UniformRectGrid.hxx index 999405fdc1..587cd2f18c 100644 --- a/src/IGESGraph/IGESGraph_UniformRectGrid.hxx +++ b/src/IGESGraph/IGESGraph_UniformRectGrid.hxx @@ -17,21 +17,12 @@ #ifndef _IGESGraph_UniformRectGrid_HeaderFile #define _IGESGraph_UniformRectGrid_HeaderFile -#include -#include - -#include #include #include -#include -class gp_XY; class gp_Pnt2d; class gp_Vec2d; -class IGESGraph_UniformRectGrid; -DEFINE_STANDARD_HANDLE(IGESGraph_UniformRectGrid, IGESData_IGESEntity) - //! defines IGESUniformRectGrid, Type <406> Form <22> //! in package IGESGraph //! @@ -39,39 +30,32 @@ DEFINE_STANDARD_HANDLE(IGESGraph_UniformRectGrid, IGESData_IGESEntity) //! a uniform rectangular grid within a drawing class IGESGraph_UniformRectGrid : public IGESData_IGESEntity { + public: -public: + Standard_EXPORT virtual Standard_Integer TypeNumber() const Standard_OVERRIDE { return 406; } + + Standard_EXPORT virtual Standard_Integer FormNumber() const Standard_OVERRIDE { return 22; } + + IGESGraph_UniformRectGrid() + : isItFinite(0), + isItLine(0), + isItWeighted(0), + theNbPointsX(0), + theNbPointsY(0) + {} - - Standard_EXPORT IGESGraph_UniformRectGrid(); - - //! This method is used to set the fields of the class - //! UniformRectGrid - //! - nbProps : Number of property values (NP = 9) - //! - finite : Finite/Infinite grid flag - //! - line : Line/Point grid flag - //! - weighted : Weighted/Unweighted grid flag - //! - aGridPoint : Point on the grid - //! - aGridSpacing : Grid spacing - //! - pointsX : No. of points/lines in X Direction - //! - pointsY : No. of points/lines in Y Direction - Standard_EXPORT void Init (const Standard_Integer nbProps, const Standard_Integer finite, const Standard_Integer line, const Standard_Integer weighted, const gp_XY& aGridPoint, const gp_XY& aGridSpacing, const Standard_Integer pointsX, const Standard_Integer pointsY); - - //! returns the number of property values in . - Standard_EXPORT Standard_Integer NbPropertyValues() const; - //! returns False if is an infinite grid, //! True if is a finite grid. - Standard_EXPORT Standard_Boolean IsFinite() const; - + Standard_Boolean IsFinite() const { return (isItFinite == 1); } + //! returns False if is a Point grid, //! True if is a Line grid. - Standard_EXPORT Standard_Boolean IsLine() const; - + Standard_Boolean IsLine() const { return (isItLine == 1); } + //! returns False if is a Weighted grid, //! True if is not a Weighted grid. - Standard_EXPORT Standard_Boolean IsWeighted() const; - + Standard_Boolean IsWeighted() const { return (isItWeighted == 0); } + //! returns coordinates of lower left corner, //! if is a finite grid, //! coordinates of an arbitrary point, @@ -83,26 +67,24 @@ public: //! returns the no. of points/lines in X direction //! (only applicable if IsFinite() = 1, i.e: a finite grid). - Standard_EXPORT Standard_Integer NbPointsX() const; - + Standard_Integer NbPointsX() const { return theNbPointsX; } + //! returns the no. of points/lines in Y direction //! (only applicable if IsFinite() = 1, i.e: a finite grid). - Standard_EXPORT Standard_Integer NbPointsY() const; + Standard_Integer NbPointsY() const { return theNbPointsY; } + Standard_EXPORT virtual void OwnRead (IGESFile_Reader &) Standard_OVERRIDE; + + Standard_EXPORT virtual void OwnWrite (IGESData_IGESWriter &) const Standard_OVERRIDE; + Standard_EXPORT virtual IGESData_DirChecker DirChecker () const Standard_OVERRIDE; + Standard_EXPORT virtual void OwnDump (const IGESData_IGESDumper &, const Handle(Message_Messenger) &, const Standard_Integer) const Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESGraph_UniformRectGrid,IGESData_IGESEntity) -protected: - - + private: - -private: - - - Standard_Integer theNbPropertyValues; Standard_Integer isItFinite; Standard_Integer isItLine; Standard_Integer isItWeighted; @@ -110,14 +92,6 @@ private: gp_XY theGridSpacing; Standard_Integer theNbPointsX; Standard_Integer theNbPointsY; - - }; - - - - - - #endif // _IGESGraph_UniformRectGrid_HeaderFile diff --git a/src/IGESSolid/FILES b/src/IGESSolid/FILES index ffc7ddd6bf..5d4442f7cb 100755 --- a/src/IGESSolid/FILES +++ b/src/IGESSolid/FILES @@ -36,8 +36,6 @@ IGESSolid_PlaneSurface.cxx IGESSolid_PlaneSurface.hxx IGESSolid_Protocol.cxx IGESSolid_Protocol.hxx -IGESSolid_ReadWriteModule.cxx -IGESSolid_ReadWriteModule.hxx IGESSolid_RightAngularWedge.cxx IGESSolid_RightAngularWedge.hxx IGESSolid_SelectedComponent.cxx @@ -52,8 +50,6 @@ IGESSolid_SolidOfLinearExtrusion.cxx IGESSolid_SolidOfLinearExtrusion.hxx IGESSolid_SolidOfRevolution.cxx IGESSolid_SolidOfRevolution.hxx -IGESSolid_SpecificModule.cxx -IGESSolid_SpecificModule.hxx IGESSolid_Sphere.cxx IGESSolid_Sphere.hxx IGESSolid_SphericalSurface.cxx diff --git a/src/IGESSolid/IGESSolid.cxx b/src/IGESSolid/IGESSolid.cxx index f3b5a7762a..163900a5e4 100644 --- a/src/IGESSolid/IGESSolid.cxx +++ b/src/IGESSolid/IGESSolid.cxx @@ -12,16 +12,11 @@ // commercial license or contractual agreement. /* -#include -#include #include #include #include #include -#include -#include #include -#include void IGESSolid::Init () { @@ -35,9 +30,6 @@ const Handle(IGESSolid_Protocol) & IGESSolid::Protocol () if (protocol.IsNull()) { protocol = new IGESSolid_Protocol; Interface_GeneralLib::SetGlobal (new IGESSolid_GeneralModule, protocol); - Interface_ReaderLib::SetGlobal (new IGESSolid_ReadWriteModule,protocol); - IGESData_WriterLib::SetGlobal (new IGESSolid_ReadWriteModule,protocol); - IGESData_SpecificLib::SetGlobal (new IGESSolid_SpecificModule, protocol); } return protocol; } diff --git a/src/IGESSolid/IGESSolid_GeneralModule.cxx b/src/IGESSolid/IGESSolid_GeneralModule.cxx index 56955488ec..91470ad19c 100644 --- a/src/IGESSolid/IGESSolid_GeneralModule.cxx +++ b/src/IGESSolid/IGESSolid_GeneralModule.cxx @@ -72,128 +72,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESSolid_GeneralModule,IGESData_GeneralModule) - void IGESSolid_GeneralModule::OwnSharedCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - Interface_EntityIterator& iter) const -{ - switch (CN) { - case 2 : { - DeclareAndCast(IGESSolid_BooleanTree,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolBooleanTree tool; - tool.OwnShared(anent,iter); - } - break; - case 4 : { - DeclareAndCast(IGESSolid_ConicalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolConicalSurface tool; - tool.OwnShared(anent,iter); - } - break; - case 6 : { - DeclareAndCast(IGESSolid_CylindricalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolCylindricalSurface tool; - tool.OwnShared(anent,iter); - } - break; - case 7 : { - DeclareAndCast(IGESSolid_EdgeList,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolEdgeList tool; - tool.OwnShared(anent,iter); - } - break; - case 9 : { - DeclareAndCast(IGESSolid_Face,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolFace tool; - tool.OwnShared(anent,iter); - } - break; - case 10 : { - DeclareAndCast(IGESSolid_Loop,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolLoop tool; - tool.OwnShared(anent,iter); - } - break; - case 11 : { - DeclareAndCast(IGESSolid_ManifoldSolid,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolManifoldSolid tool; - tool.OwnShared(anent,iter); - } - break; - case 12 : { - DeclareAndCast(IGESSolid_PlaneSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolPlaneSurface tool; - tool.OwnShared(anent,iter); - } - break; - case 14 : { - DeclareAndCast(IGESSolid_SelectedComponent,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSelectedComponent tool; - tool.OwnShared(anent,iter); - } - break; - case 15 : { - DeclareAndCast(IGESSolid_Shell,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolShell tool; - tool.OwnShared(anent,iter); - } - break; - case 16 : { - DeclareAndCast(IGESSolid_SolidAssembly,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidAssembly tool; - tool.OwnShared(anent,iter); - } - break; - case 17 : { - DeclareAndCast(IGESSolid_SolidInstance,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidInstance tool; - tool.OwnShared(anent,iter); - } - break; - case 18 : { - DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidOfLinearExtrusion tool; - tool.OwnShared(anent,iter); - } - break; - case 19 : { - DeclareAndCast(IGESSolid_SolidOfRevolution,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidOfRevolution tool; - tool.OwnShared(anent,iter); - } - break; - case 21 : { - DeclareAndCast(IGESSolid_SphericalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSphericalSurface tool; - tool.OwnShared(anent,iter); - } - break; - case 22 : { - DeclareAndCast(IGESSolid_ToroidalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolToroidalSurface tool; - tool.OwnShared(anent,iter); - } - break; - default : break; - } -} - - IGESData_DirChecker IGESSolid_GeneralModule::DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const { @@ -348,197 +226,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESSolid_GeneralModule,IGESData_GeneralModule) } - void IGESSolid_GeneralModule::OwnCheckCase - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESSolid_Block,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolBlock tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 2 : { - DeclareAndCast(IGESSolid_BooleanTree,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolBooleanTree tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 3 : { - DeclareAndCast(IGESSolid_ConeFrustum,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolConeFrustum tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 4 : { - DeclareAndCast(IGESSolid_ConicalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolConicalSurface tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 5 : { - DeclareAndCast(IGESSolid_Cylinder,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolCylinder tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 6 : { - DeclareAndCast(IGESSolid_CylindricalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolCylindricalSurface tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 7 : { - DeclareAndCast(IGESSolid_EdgeList,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolEdgeList tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 8 : { - DeclareAndCast(IGESSolid_Ellipsoid,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolEllipsoid tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 9 : { - DeclareAndCast(IGESSolid_Face,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolFace tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 10 : { - DeclareAndCast(IGESSolid_Loop,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolLoop tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 11 : { - DeclareAndCast(IGESSolid_ManifoldSolid,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolManifoldSolid tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 12 : { - DeclareAndCast(IGESSolid_PlaneSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolPlaneSurface tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 13 : { - DeclareAndCast(IGESSolid_RightAngularWedge,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolRightAngularWedge tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 15 : { - DeclareAndCast(IGESSolid_Shell,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolShell tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 18 : { - DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidOfLinearExtrusion tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 19 : { - DeclareAndCast(IGESSolid_SolidOfRevolution,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidOfRevolution tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 20 : { - DeclareAndCast(IGESSolid_Sphere,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSphere tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 21 : { - DeclareAndCast(IGESSolid_SphericalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSphericalSurface tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 22 : { - DeclareAndCast(IGESSolid_ToroidalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolToroidalSurface tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 23 : { - DeclareAndCast(IGESSolid_Torus,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolTorus tool; - tool.OwnCheck(anent,shares,ach); - } - break; - case 24 : { - DeclareAndCast(IGESSolid_VertexList,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolVertexList tool; - tool.OwnCheck(anent,shares,ach); - } - break; - default : break; - } -} - - - Standard_Boolean IGESSolid_GeneralModule::NewVoid - (const Standard_Integer CN, Handle(Standard_Transient)& ent) const -{ - switch (CN) { - case 1 : ent = new IGESSolid_Block; break; - case 2 : ent = new IGESSolid_BooleanTree; break; - case 3 : ent = new IGESSolid_ConeFrustum; break; - case 4 : ent = new IGESSolid_ConicalSurface; break; - case 5 : ent = new IGESSolid_Cylinder; break; - case 6 : ent = new IGESSolid_CylindricalSurface; break; - case 7 : ent = new IGESSolid_EdgeList; break; - case 8 : ent = new IGESSolid_Ellipsoid; break; - case 9 : ent = new IGESSolid_Face; break; - case 10 : ent = new IGESSolid_Loop; break; - case 11 : ent = new IGESSolid_ManifoldSolid; break; - case 12 : ent = new IGESSolid_PlaneSurface; break; - case 13 : ent = new IGESSolid_RightAngularWedge; break; - case 14 : ent = new IGESSolid_SelectedComponent; break; - case 15 : ent = new IGESSolid_Shell; break; - case 16 : ent = new IGESSolid_SolidAssembly; break; - case 17 : ent = new IGESSolid_SolidInstance; break; - case 18 : ent = new IGESSolid_SolidOfLinearExtrusion; break; - case 19 : ent = new IGESSolid_SolidOfRevolution; break; - case 20 : ent = new IGESSolid_Sphere; break; - case 21 : ent = new IGESSolid_SphericalSurface; break; - case 22 : ent = new IGESSolid_ToroidalSurface; break; - case 23 : ent = new IGESSolid_Torus; break; - case 24 : ent = new IGESSolid_VertexList; break; - default : return Standard_False; // by default, Failure on Recognize - } - return Standard_True; -} - - Standard_Integer IGESSolid_GeneralModule::CategoryNumber (const Standard_Integer , const Handle(Standard_Transient)& , const Interface_ShareTool& ) const diff --git a/src/IGESSolid/IGESSolid_GeneralModule.hxx b/src/IGESSolid/IGESSolid_GeneralModule.hxx index 5c419389e2..e4aa0a51f9 100644 --- a/src/IGESSolid/IGESSolid_GeneralModule.hxx +++ b/src/IGESSolid/IGESSolid_GeneralModule.hxx @@ -32,21 +32,11 @@ class IGESSolid_GeneralModule : public IGESData_GeneralModule //! Creates a GeneralModule from IGESSolid and puts it into GeneralLib IGESSolid_GeneralModule() {} - //! Lists the Entities shared by a given IGESEntity , from - //! its specific parameters : specific for each type - Standard_EXPORT void OwnSharedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - //! Returns a DirChecker, specific for each type of Entity //! (identified by its Case Number) : this DirChecker defines //! constraints which must be respected by the DirectoryPart Standard_EXPORT IGESData_DirChecker DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE; - //! Performs Specific Semantic Check for each type of Entity - Standard_EXPORT void OwnCheckCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE; - - //! Specific creation of a new void entity - Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE; - //! Returns a category number which characterizes an entity //! Shape for all Standard_EXPORT virtual Standard_Integer CategoryNumber (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares) const Standard_OVERRIDE; diff --git a/src/IGESSolid/IGESSolid_ReadWriteModule.cxx b/src/IGESSolid/IGESSolid_ReadWriteModule.cxx deleted file mode 100644 index 7395dd614f..0000000000 --- a/src/IGESSolid/IGESSolid_ReadWriteModule.cxx +++ /dev/null @@ -1,467 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESSolid_ReadWriteModule,IGESData_ReadWriteModule) - -// Each Module is attached to a Protocol : it must interprete Case Numbers -// (arguments of various methods) in accordance to values returned by -// the method TypeNumber from this Protocol -IGESSolid_ReadWriteModule::IGESSolid_ReadWriteModule () { } - - - Standard_Integer IGESSolid_ReadWriteModule::CaseIGES - (const Standard_Integer typenum, const Standard_Integer /*formnum*/) const -{ - switch (typenum) { - case 150 : return 1; - case 152 : return 13; - case 154 : return 5; - case 156 : return 3; - case 158 : return 20; - case 160 : return 23; - case 162 : return 19; - case 164 : return 18; - case 168 : return 8; - case 180 : return 2; - case 182 : return 14; - case 184 : return 16; - case 186 : return 11; - case 190 : return 12; - case 192 : return 6; - case 194 : return 4; - case 196 : return 21; - case 198 : return 22; - case 430 : return 17; - case 502 : return 24; - case 504 : return 7; - case 508 : return 10; - case 510 : return 9; - case 514 : return 15; - default : break; - } - return 0; -} - - - void IGESSolid_ReadWriteModule::ReadOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESSolid_Block,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolBlock tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 2 : { - DeclareAndCast(IGESSolid_BooleanTree,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolBooleanTree tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 3 : { - DeclareAndCast(IGESSolid_ConeFrustum,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolConeFrustum tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 4 : { - DeclareAndCast(IGESSolid_ConicalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolConicalSurface tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 5 : { - DeclareAndCast(IGESSolid_Cylinder,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolCylinder tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 6 : { - DeclareAndCast(IGESSolid_CylindricalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolCylindricalSurface tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 7 : { - DeclareAndCast(IGESSolid_EdgeList,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolEdgeList tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 8 : { - DeclareAndCast(IGESSolid_Ellipsoid,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolEllipsoid tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 9 : { - DeclareAndCast(IGESSolid_Face,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolFace tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 10 : { - DeclareAndCast(IGESSolid_Loop,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolLoop tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 11 : { - DeclareAndCast(IGESSolid_ManifoldSolid,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolManifoldSolid tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 12 : { - DeclareAndCast(IGESSolid_PlaneSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolPlaneSurface tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 13 : { - DeclareAndCast(IGESSolid_RightAngularWedge,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolRightAngularWedge tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 14 : { - DeclareAndCast(IGESSolid_SelectedComponent,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSelectedComponent tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 15 : { - DeclareAndCast(IGESSolid_Shell,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolShell tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 16 : { - DeclareAndCast(IGESSolid_SolidAssembly,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidAssembly tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 17 : { - DeclareAndCast(IGESSolid_SolidInstance,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidInstance tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 18 : { - DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidOfLinearExtrusion tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 19 : { - DeclareAndCast(IGESSolid_SolidOfRevolution,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidOfRevolution tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 20 : { - DeclareAndCast(IGESSolid_Sphere,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSphere tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 21 : { - DeclareAndCast(IGESSolid_SphericalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSphericalSurface tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 22 : { - DeclareAndCast(IGESSolid_ToroidalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolToroidalSurface tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 23 : { - DeclareAndCast(IGESSolid_Torus,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolTorus tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - case 24 : { - DeclareAndCast(IGESSolid_VertexList,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolVertexList tool; - tool.ReadOwnParams(anent,IR,PR); - } - break; - default : break; - } -} - - - void IGESSolid_ReadWriteModule::WriteOwnParams - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - IGESData_IGESWriter& IW) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESSolid_Block,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolBlock tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 2 : { - DeclareAndCast(IGESSolid_BooleanTree,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolBooleanTree tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 3 : { - DeclareAndCast(IGESSolid_ConeFrustum,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolConeFrustum tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 4 : { - DeclareAndCast(IGESSolid_ConicalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolConicalSurface tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 5 : { - DeclareAndCast(IGESSolid_Cylinder,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolCylinder tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 6 : { - DeclareAndCast(IGESSolid_CylindricalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolCylindricalSurface tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 7 : { - DeclareAndCast(IGESSolid_EdgeList,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolEdgeList tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 8 : { - DeclareAndCast(IGESSolid_Ellipsoid,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolEllipsoid tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 9 : { - DeclareAndCast(IGESSolid_Face,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolFace tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 10 : { - DeclareAndCast(IGESSolid_Loop,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolLoop tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 11 : { - DeclareAndCast(IGESSolid_ManifoldSolid,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolManifoldSolid tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 12 : { - DeclareAndCast(IGESSolid_PlaneSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolPlaneSurface tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 13 : { - DeclareAndCast(IGESSolid_RightAngularWedge,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolRightAngularWedge tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 14 : { - DeclareAndCast(IGESSolid_SelectedComponent,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSelectedComponent tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 15 : { - DeclareAndCast(IGESSolid_Shell,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolShell tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 16 : { - DeclareAndCast(IGESSolid_SolidAssembly,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidAssembly tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 17 : { - DeclareAndCast(IGESSolid_SolidInstance,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidInstance tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 18 : { - DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidOfLinearExtrusion tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 19 : { - DeclareAndCast(IGESSolid_SolidOfRevolution,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidOfRevolution tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 20 : { - DeclareAndCast(IGESSolid_Sphere,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSphere tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 21 : { - DeclareAndCast(IGESSolid_SphericalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSphericalSurface tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 22 : { - DeclareAndCast(IGESSolid_ToroidalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolToroidalSurface tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 23 : { - DeclareAndCast(IGESSolid_Torus,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolTorus tool; - tool.WriteOwnParams(anent,IW); - } - break; - case 24 : { - DeclareAndCast(IGESSolid_VertexList,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolVertexList tool; - tool.WriteOwnParams(anent,IW); - } - break; - default : break; - } -} diff --git a/src/IGESSolid/IGESSolid_ReadWriteModule.hxx b/src/IGESSolid/IGESSolid_ReadWriteModule.hxx deleted file mode 100644 index 0eb551d841..0000000000 --- a/src/IGESSolid/IGESSolid_ReadWriteModule.hxx +++ /dev/null @@ -1,79 +0,0 @@ -// Created on: 1993-09-06 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESSolid_ReadWriteModule_HeaderFile -#define _IGESSolid_ReadWriteModule_HeaderFile - -#include -#include - -#include -#include -class Standard_DomainError; -class IGESData_IGESEntity; -class IGESData_IGESReaderData; -class IGESData_ParamReader; -class IGESData_IGESWriter; - - -class IGESSolid_ReadWriteModule; -DEFINE_STANDARD_HANDLE(IGESSolid_ReadWriteModule, IGESData_ReadWriteModule) - -//! Defines Solid File Access Module for IGESSolid (specific parts) -//! Specific actions concern : Read and Write Own Parameters of -//! an IGESEntity. -class IGESSolid_ReadWriteModule : public IGESData_ReadWriteModule -{ - -public: - - - //! Creates a ReadWriteModule & puts it into ReaderLib & WriterLib - Standard_EXPORT IGESSolid_ReadWriteModule(); - - //! Defines Case Numbers for Entities of IGESSolid - Standard_EXPORT Standard_Integer CaseIGES (const Standard_Integer typenum, const Standard_Integer formnum) const Standard_OVERRIDE; - - //! Reads own parameters from file for an Entity of IGESSolid - Standard_EXPORT void ReadOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const Standard_OVERRIDE; - - //! Writes own parameters to IGESWriter - Standard_EXPORT void WriteOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, IGESData_IGESWriter& IW) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IGESSolid_ReadWriteModule,IGESData_ReadWriteModule) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IGESSolid_ReadWriteModule_HeaderFile diff --git a/src/IGESSolid/IGESSolid_SpecificModule.cxx b/src/IGESSolid/IGESSolid_SpecificModule.cxx deleted file mode 100644 index 88cff12e1f..0000000000 --- a/src/IGESSolid/IGESSolid_SpecificModule.cxx +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IGESSolid_SpecificModule,IGESData_SpecificModule) - -// Each Module is attached to a Protocol : it must interprete Case Numbers -// (arguments of various methods) in accordance to values returned by -// the method TypeNumber from this Protocol -IGESSolid_SpecificModule::IGESSolid_SpecificModule() { } - - - void IGESSolid_SpecificModule::OwnDump - (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, - const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, - const Standard_Integer own) const -{ - switch (CN) { - case 1 : { - DeclareAndCast(IGESSolid_Block,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolBlock tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 2 : { - DeclareAndCast(IGESSolid_BooleanTree,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolBooleanTree tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 3 : { - DeclareAndCast(IGESSolid_ConeFrustum,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolConeFrustum tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 4 : { - DeclareAndCast(IGESSolid_ConicalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolConicalSurface tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 5 : { - DeclareAndCast(IGESSolid_Cylinder,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolCylinder tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 6 : { - DeclareAndCast(IGESSolid_CylindricalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolCylindricalSurface tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 7 : { - DeclareAndCast(IGESSolid_EdgeList,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolEdgeList tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 8 : { - DeclareAndCast(IGESSolid_Ellipsoid,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolEllipsoid tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 9 : { - DeclareAndCast(IGESSolid_Face,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolFace tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 10 : { - DeclareAndCast(IGESSolid_Loop,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolLoop tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 11 : { - DeclareAndCast(IGESSolid_ManifoldSolid,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolManifoldSolid tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 12 : { - DeclareAndCast(IGESSolid_PlaneSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolPlaneSurface tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 13 : { - DeclareAndCast(IGESSolid_RightAngularWedge,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolRightAngularWedge tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 14 : { - DeclareAndCast(IGESSolid_SelectedComponent,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSelectedComponent tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 15 : { - DeclareAndCast(IGESSolid_Shell,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolShell tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 16 : { - DeclareAndCast(IGESSolid_SolidAssembly,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidAssembly tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 17 : { - DeclareAndCast(IGESSolid_SolidInstance,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidInstance tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 18 : { - DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidOfLinearExtrusion tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 19 : { - DeclareAndCast(IGESSolid_SolidOfRevolution,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSolidOfRevolution tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 20 : { - DeclareAndCast(IGESSolid_Sphere,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSphere tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 21 : { - DeclareAndCast(IGESSolid_SphericalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolSphericalSurface tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 22 : { - DeclareAndCast(IGESSolid_ToroidalSurface,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolToroidalSurface tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 23 : { - DeclareAndCast(IGESSolid_Torus,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolTorus tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - case 24 : { - DeclareAndCast(IGESSolid_VertexList,anent,ent); - if (anent.IsNull()) return; - IGESSolid_ToolVertexList tool; - tool.OwnDump(anent,dumper,S,own); - } - break; - default : break; - } -} diff --git a/src/IGESSolid/IGESSolid_SpecificModule.hxx b/src/IGESSolid/IGESSolid_SpecificModule.hxx deleted file mode 100644 index 642adebb12..0000000000 --- a/src/IGESSolid/IGESSolid_SpecificModule.hxx +++ /dev/null @@ -1,69 +0,0 @@ -// Created on: 1993-09-07 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESSolid_SpecificModule_HeaderFile -#define _IGESSolid_SpecificModule_HeaderFile - -#include -#include - -#include -#include -class IGESData_IGESEntity; -class IGESData_IGESDumper; -class Message_Messenger; - - -class IGESSolid_SpecificModule; -DEFINE_STANDARD_HANDLE(IGESSolid_SpecificModule, IGESData_SpecificModule) - -//! Defines Services attached to IGES Entities : Dump, for IGESSolid -class IGESSolid_SpecificModule : public IGESData_SpecificModule -{ - -public: - - - //! Creates a SpecificModule from IGESSolid & puts it into SpecificLib - Standard_EXPORT IGESSolid_SpecificModule(); - - //! Specific Dump (own parameters) for IGESSolid - Standard_EXPORT void OwnDump (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, const Standard_Integer own) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IGESSolid_SpecificModule,IGESData_SpecificModule) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IGESSolid_SpecificModule_HeaderFile diff --git a/src/IGESSolid/IGESSolid_ToolBlock.cxx b/src/IGESSolid/IGESSolid_ToolBlock.cxx index 07d8c23195..688ed27306 100644 --- a/src/IGESSolid/IGESSolid_ToolBlock.cxx +++ b/src/IGESSolid/IGESSolid_ToolBlock.cxx @@ -40,78 +40,68 @@ void IGESSolid_ToolBlock::ReadOwnParams { gp_XYZ tempSize, tempCorner, tempXAxis, tempZAxis; Standard_Real tempreal; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadXYZ(PR.CurrentList(1, 3), "Size of Block", tempSize); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadXYZ(tempSize,"Size of Block"); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Corner Point (X)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Corner Point (X)", tempreal)) + if (PR.ReadReal(tempreal,"Corner Point (X)")) tempCorner.SetX(tempreal); } else tempCorner.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Corner Point (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Corner Point (Y)", tempreal)) + if (PR.ReadReal(tempreal,"Corner Point (Y)")) tempCorner.SetY(tempreal); } else tempCorner.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Corner Point (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Corner Point (Z)", tempreal)) + if (PR.ReadReal(tempreal,"Corner Point (Z)")) tempCorner.SetZ(tempreal); } else tempCorner.SetZ(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local X axis (I)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local X axis (I)", tempreal)) + if (PR.ReadReal(tempreal,"Local X axis (I)")) tempXAxis.SetX(tempreal); } else tempXAxis.SetX(1.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local X axis (J)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local X axis (J)", tempreal)) + if (PR.ReadReal(tempreal,"Local X axis (J)")) tempXAxis.SetY(tempreal); } else tempXAxis.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local X axis (K)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local X axis (K)", tempreal)) + if (PR.ReadReal(tempreal,"Local X axis (K)")) tempXAxis.SetZ(tempreal); } else tempXAxis.SetZ(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local Z axis (I)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local Z axis (I)", tempreal)) + if (PR.ReadReal(tempreal,"Local Z axis (I)")) tempZAxis.SetX(tempreal); } else tempZAxis.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local Z axis (J)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local Z axis (J)", tempreal)) + if (PR.ReadReal(tempreal,"Local Z axis (J)")) tempZAxis.SetY(tempreal); } else tempZAxis.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local Z axis (K)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local Z axis (K)", tempreal)) + if (PR.ReadReal(tempreal,"Local Z axis (K)")) tempZAxis.SetZ(tempreal); } else tempZAxis.SetZ(1.0); diff --git a/src/IGESSolid/IGESSolid_ToolBooleanTree.cxx b/src/IGESSolid/IGESSolid_ToolBooleanTree.cxx index d704b75070..8a0a3b0304 100644 --- a/src/IGESSolid/IGESSolid_ToolBooleanTree.cxx +++ b/src/IGESSolid/IGESSolid_ToolBooleanTree.cxx @@ -46,26 +46,24 @@ void IGESSolid_ToolBooleanTree::ReadOwnParams Handle(TColStd_HArray1OfInteger) tempOperations; Handle(IGESData_HArray1OfIGESEntity) tempOperands; - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Length of post-order notation", length); + Standard_Boolean st = PR.ReadInteger(length,"Length of post-order notation"); if (st && length > 0) { tempOperations = new TColStd_HArray1OfInteger(1,length); tempOperations->Init(0); tempOperands = new IGESData_HArray1OfIGESEntity(1,length); // Op. 1-2 : Operands - //st = PR.ReadEntity(IR, PR.Current(), "Operand 1", entvalue); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR, PR.Current(), "Operand 1", entvalue)) + if (PR.ReadEntity(IR, "Operand 1", entvalue)) tempOperands->SetValue(1, entvalue); - //st = PR.ReadEntity(IR, PR.Current(), "Operand 2", entvalue); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR, PR.Current(), "Operand 2", entvalue)) + if (PR.ReadEntity(IR, "Operand 2", entvalue)) tempOperands->SetValue(2, entvalue); // Op. 3 -> length-1 : Operand or Operation for (Standard_Integer i = 3; i < length; i++) { Standard_Integer curnum = PR.CurrentNumber(); - PR.ReadInteger(PR.Current(), "Operation code", intvalue); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadInteger(intvalue,"Operation code"); if (intvalue < 0) { entvalue = PR.ParamEntity (IR,curnum); if (entvalue.IsNull()) PR.AddFail("Operand : incorrect reference"); @@ -74,8 +72,7 @@ void IGESSolid_ToolBooleanTree::ReadOwnParams else tempOperations->SetValue(i, intvalue); } // Last Op. : Operation - //st = PR.ReadInteger(PR.Current(), "Operation code", intvalue); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadInteger(PR.Current(), "Operation code", intvalue)) + if (PR.ReadInteger(intvalue,"Operation code")) tempOperations->SetValue(length, intvalue); } else PR.AddFail("Length of post-order : Not Positive"); diff --git a/src/IGESSolid/IGESSolid_ToolConeFrustum.cxx b/src/IGESSolid/IGESSolid_ToolConeFrustum.cxx index e798b3effc..08c3baa458 100644 --- a/src/IGESSolid/IGESSolid_ToolConeFrustum.cxx +++ b/src/IGESSolid/IGESSolid_ToolConeFrustum.cxx @@ -41,61 +41,53 @@ void IGESSolid_ToolConeFrustum::ReadOwnParams { Standard_Real tempHeight, tempR1, tempR2, tempreal; gp_XYZ tempCenter, tempAxis; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadReal(PR.Current(), "Height", tempHeight); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadReal(PR.Current(), "Larger face radius", tempR1); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(tempHeight,"Height"); + PR.ReadReal(tempR1,"Larger face radius"); if (PR.DefinedElseSkip()) - PR.ReadReal(PR.Current(), "Smaller face radius", tempR2); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(tempR2,"Smaller face radius"); else tempR2 = 0.0; if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Face center (X)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Face center (X)", tempreal)) + if (PR.ReadReal(tempreal,"Face center (X)")) tempCenter.SetX(tempreal); } else tempCenter.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Face center (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Face center (Y)", tempreal)) + if (PR.ReadReal(tempreal,"Face center (Y)")) tempCenter.SetY(tempreal); } else tempCenter.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Face center (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Face center (Z)", tempreal)) + if (PR.ReadReal(tempreal,"Face center (Z)")) tempCenter.SetZ(tempreal); } else tempCenter.SetZ(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal)) + if (PR.ReadReal(tempreal,"Axis direction (I)")) tempAxis.SetX(tempreal); } else tempAxis.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal)) + if (PR.ReadReal(tempreal,"Axis direction (J)")) tempAxis.SetY(tempreal); } else tempAxis.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal)) + if (PR.ReadReal(tempreal,"Axis direction (K)")) tempAxis.SetZ(tempreal); } else tempAxis.SetZ(1.0); diff --git a/src/IGESSolid/IGESSolid_ToolConicalSurface.cxx b/src/IGESSolid/IGESSolid_ToolConicalSurface.cxx index 5756d854d4..ec7d25cc90 100644 --- a/src/IGESSolid/IGESSolid_ToolConicalSurface.cxx +++ b/src/IGESSolid/IGESSolid_ToolConicalSurface.cxx @@ -42,21 +42,14 @@ void IGESSolid_ToolConicalSurface::ReadOwnParams Handle(IGESGeom_Direction) tempAxis; Handle(IGESGeom_Direction) tempRefdir; // default Unparametrised Standard_Real tempRadius, tempAngle; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadEntity(IR, PR.Current(), "Point on axis", - STANDARD_TYPE(IGESGeom_Point), tempLocation); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Axis direction", - STANDARD_TYPE(IGESGeom_Direction), tempAxis); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadReal(PR.Current(), "Radius", tempRadius); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadReal(PR.Current(), "Semi-angle", tempAngle); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Point on axis", STANDARD_TYPE(IGESGeom_Point), tempLocation); + PR.ReadEntity(IR, "Axis direction", STANDARD_TYPE(IGESGeom_Direction), tempAxis); + PR.ReadReal(tempRadius,"Radius"); + PR.ReadReal(tempAngle,"Semi-angle"); if (ent->FormNumber() == 1) // Parametrised surface - PR.ReadEntity(IR, PR.Current(), "Reference direction", - STANDARD_TYPE(IGESGeom_Direction), tempRefdir); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Reference direction", STANDARD_TYPE(IGESGeom_Direction), tempRefdir); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init diff --git a/src/IGESSolid/IGESSolid_ToolCylinder.cxx b/src/IGESSolid/IGESSolid_ToolCylinder.cxx index d06721c4e3..05d2e1bd7e 100644 --- a/src/IGESSolid/IGESSolid_ToolCylinder.cxx +++ b/src/IGESSolid/IGESSolid_ToolCylinder.cxx @@ -40,56 +40,48 @@ void IGESSolid_ToolCylinder::ReadOwnParams { Standard_Real tempHeight, tempRadius, tempreal; gp_XYZ tempCenter, tempAxis; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadReal(PR.Current(), "Height", tempHeight); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadReal(PR.Current(), "Radius", tempRadius); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(tempHeight,"Height"); + PR.ReadReal(tempRadius,"Radius"); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Face center (X)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Face center (X)", tempreal)) + if (PR.ReadReal(tempreal,"Face center (X)")) tempCenter.SetX(tempreal); } else tempCenter.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Face center (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Face center (Y)", tempreal)) + if (PR.ReadReal(tempreal,"Face center (Y)")) tempCenter.SetY(tempreal); } else tempCenter.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Face center (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Face center (Z)", tempreal)) + if (PR.ReadReal(tempreal,"Face center (Z)")) tempCenter.SetZ(tempreal); } else tempCenter.SetZ(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal)) + if (PR.ReadReal(tempreal,"Axis direction (I)")) tempAxis.SetX(tempreal); } else tempAxis.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal)) + if (PR.ReadReal(tempreal,"Axis direction (J)")) tempAxis.SetY(tempreal); } else tempAxis.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal)) + if (PR.ReadReal(tempreal,"Axis direction (K)")) tempAxis.SetZ(tempreal); } else tempAxis.SetZ(1.0); diff --git a/src/IGESSolid/IGESSolid_ToolCylindricalSurface.cxx b/src/IGESSolid/IGESSolid_ToolCylindricalSurface.cxx index d65f5bf95a..f3732116e8 100644 --- a/src/IGESSolid/IGESSolid_ToolCylindricalSurface.cxx +++ b/src/IGESSolid/IGESSolid_ToolCylindricalSurface.cxx @@ -42,19 +42,13 @@ void IGESSolid_ToolCylindricalSurface::ReadOwnParams Handle(IGESGeom_Direction) tempAxis; Handle(IGESGeom_Direction) tempRefdir; // default Unparametrised Standard_Real tempRadius; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadEntity(IR, PR.Current(), "Point on axis", - STANDARD_TYPE(IGESGeom_Point), tempLocation); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Axis direction", - STANDARD_TYPE(IGESGeom_Direction), tempAxis); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadReal(PR.Current(), "Radius", tempRadius); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Point on axis", STANDARD_TYPE(IGESGeom_Point), tempLocation); + PR.ReadEntity(IR, "Axis direction", STANDARD_TYPE(IGESGeom_Direction), tempAxis); + PR.ReadReal(tempRadius,"Radius"); if (ent->FormNumber() == 1) // Parametrised surface - PR.ReadEntity(IR, PR.Current(), "Reference direction", - STANDARD_TYPE(IGESGeom_Direction), tempRefdir); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Reference direction", STANDARD_TYPE(IGESGeom_Direction), tempRefdir); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init (tempLocation, tempAxis, tempRadius, tempRefdir); diff --git a/src/IGESSolid/IGESSolid_ToolEdgeList.cxx b/src/IGESSolid/IGESSolid_ToolEdgeList.cxx index e8a71343c4..80bcf87e0b 100644 --- a/src/IGESSolid/IGESSolid_ToolEdgeList.cxx +++ b/src/IGESSolid/IGESSolid_ToolEdgeList.cxx @@ -61,12 +61,11 @@ void IGESSolid_ToolEdgeList::ReadOwnParams(const Handle(IGESSolid_EdgeList)& ent Handle(TColStd_HArray1OfInteger) tempEndVertexIndex; IGESData_Status aStatus; - Standard_Boolean st = PR.ReadInteger(PR.Current(), length); + Standard_Boolean st = PR.ReadInteger(length); if(!st){ Message_Msg Msg184("XSTEP_184"); PR.SendFail(Msg184); } - //st = PR.ReadInteger(PR.Current(), "Number of edges", length); if (st && length > 0) { tempCurves = new IGESData_HArray1OfIGESEntity(1, length); @@ -77,9 +76,7 @@ void IGESSolid_ToolEdgeList::ReadOwnParams(const Handle(IGESSolid_EdgeList)& ent for (Standard_Integer i=1 ; i<=length ; i++) { // Curves - //st = PR.ReadEntity(IR, PR.Current(), Msg185, anent); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadEntity(IR, PR.Current(), "Model space curve", anent); - if (PR.ReadEntity(IR, PR.Current(), aStatus, anent)) + if (PR.ReadEntity(IR, aStatus, anent)) tempCurves->SetValue(i, anent); else{ Message_Msg Msg185("XSTEP_185"); @@ -99,13 +96,7 @@ void IGESSolid_ToolEdgeList::ReadOwnParams(const Handle(IGESSolid_EdgeList)& ent } } // Start vertex list - //st = PR.ReadEntity(IR, PR.Current(), Msg188, - //STANDARD_TYPE(IGESSolid_VertexList), avert); //szv#4:S4163:12Mar99 moved in if - /* - st = PR.ReadEntity(IR, PR.Current(), "Start vertex list", - STANDARD_TYPE(IGESSolid_VertexList), avert); - */ - if (PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESSolid_VertexList), avert)) + if (PR.ReadEntity(IR, aStatus, STANDARD_TYPE(IGESSolid_VertexList), avert)) tempStartVertexList->SetValue(i, avert); else{ Message_Msg Msg188("XSTEP_188"); @@ -131,9 +122,7 @@ void IGESSolid_ToolEdgeList::ReadOwnParams(const Handle(IGESSolid_EdgeList)& ent } // Start vertex index - //st = PR.ReadInteger(PR.Current(), Msg186, anint); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadInteger(PR.Current(), "Start vertex index", anint); - if (PR.ReadInteger(PR.Current(), anint)) + if (PR.ReadInteger(anint)) tempStartVertexIndex->SetValue(i, anint); else{ Message_Msg Msg186("XSTEP_186"); @@ -141,13 +130,7 @@ void IGESSolid_ToolEdgeList::ReadOwnParams(const Handle(IGESSolid_EdgeList)& ent } // End vertex list - //st = PR.ReadEntity(IR, PR.Current(),Msg189 , - //STANDARD_TYPE(IGESSolid_VertexList), avert); //szv#4:S4163:12Mar99 moved in if - /* - st = PR.ReadEntity(IR, PR.Current(), "End vertex list", - STANDARD_TYPE(IGESSolid_VertexList), avert); - */ - if (PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESSolid_VertexList), avert)) + if (PR.ReadEntity(IR, aStatus, STANDARD_TYPE(IGESSolid_VertexList), avert)) tempEndVertexList->SetValue(i, avert); else{ Message_Msg Msg189("XSTEP_189"); @@ -172,9 +155,7 @@ void IGESSolid_ToolEdgeList::ReadOwnParams(const Handle(IGESSolid_EdgeList)& ent } } // End vertex index - //st = PR.ReadInteger(PR.Current(), Msg187, anint); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadInteger(PR.Current(), "End vertex index", anint); - if (PR.ReadInteger(PR.Current(), anint)) + if (PR.ReadInteger(anint)) tempEndVertexIndex->SetValue(i, anint); else { Message_Msg Msg187("XSTEP_187"); diff --git a/src/IGESSolid/IGESSolid_ToolEllipsoid.cxx b/src/IGESSolid/IGESSolid_ToolEllipsoid.cxx index d0a7f33f1b..cc5a7ece74 100644 --- a/src/IGESSolid/IGESSolid_ToolEllipsoid.cxx +++ b/src/IGESSolid/IGESSolid_ToolEllipsoid.cxx @@ -40,79 +40,69 @@ void IGESSolid_ToolEllipsoid::ReadOwnParams const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { gp_XYZ tempSize, tempCenter, tempXAxis, tempZAxis; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed Standard_Real tempreal; - PR.ReadXYZ(PR.CurrentList(1, 3), "Size", tempSize); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadXYZ(tempSize,"Size"); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Center Point (X)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Center Point (X)", tempreal)) + if (PR.ReadReal(tempreal,"Center Point (X)")) tempCenter.SetX(tempreal); } else tempCenter.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Center Point (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Center Point (Y)", tempreal)) + if (PR.ReadReal(tempreal,"Center Point (Y)")) tempCenter.SetY(tempreal); } else tempCenter.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Center Point (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Center Point (Z)", tempreal)) + if (PR.ReadReal(tempreal,"Center Point (Z)")) tempCenter.SetZ(tempreal); } else tempCenter.SetZ(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local X axis (I)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local X axis (I)", tempreal)) + if (PR.ReadReal(tempreal,"Local X axis (I)")) tempXAxis.SetX(tempreal); } else tempXAxis.SetX(1.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local X axis (J)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local X axis (J)", tempreal)) + if (PR.ReadReal(tempreal,"Local X axis (J)")) tempXAxis.SetY(tempreal); } else tempXAxis.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local X axis (K)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local X axis (K)", tempreal)) + if (PR.ReadReal(tempreal,"Local X axis (K)")) tempXAxis.SetZ(tempreal); } else tempXAxis.SetZ(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local Z axis (I)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local Z axis (I)", tempreal)) + if (PR.ReadReal(tempreal,"Local Z axis (I)")) tempZAxis.SetX(tempreal); } else tempZAxis.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local Z axis (J)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local Z axis (J)", tempreal)) + if (PR.ReadReal(tempreal,"Local Z axis (J)")) tempZAxis.SetY(tempreal); } else tempZAxis.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local Z axis (K)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local Z axis (K)", tempreal)) + if (PR.ReadReal(tempreal,"Local Z axis (K)")) tempZAxis.SetZ(tempreal); } else tempZAxis.SetZ(1.0); diff --git a/src/IGESSolid/IGESSolid_ToolFace.cxx b/src/IGESSolid/IGESSolid_ToolFace.cxx index 6af756b25f..e35ba31aea 100644 --- a/src/IGESSolid/IGESSolid_ToolFace.cxx +++ b/src/IGESSolid/IGESSolid_ToolFace.cxx @@ -54,7 +54,7 @@ void IGESSolid_ToolFace::ReadOwnParams(const Handle(IGESSolid_Face)& ent, Message_Msg Msg198("XSTEP_198"); //======================================== - Standard_Boolean outerLoopFlag; //szv#4:S4163:12Mar99 `st` moved down + Standard_Boolean outerLoopFlag; Handle(IGESData_IGESEntity) anent; Handle(IGESSolid_Loop) aloop; Handle(IGESData_IGESEntity) tempSurface; @@ -62,7 +62,7 @@ void IGESSolid_ToolFace::ReadOwnParams(const Handle(IGESSolid_Face)& ent, Handle(IGESSolid_HArray1OfLoop) tempLoops; IGESData_Status aStatus; - if (!PR.ReadEntity(IR, PR.Current(), aStatus, tempSurface)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadEntity(IR, aStatus, tempSurface)) { Message_Msg Msg196("XSTEP_196"); switch(aStatus) { case IGESData_ReferenceError: { @@ -79,25 +79,18 @@ void IGESSolid_ToolFace::ReadOwnParams(const Handle(IGESSolid_Face)& ent, } } } - Standard_Boolean st = PR.ReadInteger(PR.Current(), nbloops); + Standard_Boolean st = PR.ReadInteger(nbloops); if(!st){ PR.SendFail(Msg197); } -/* - st = PR.ReadEntity(IR, PR.Current(), "Surface", tempSurface); - st = PR.ReadInteger(PR.Current(), "Number of loops", nbloops); -*/ if (st && nbloops > 0) tempLoops = new IGESSolid_HArray1OfLoop(1, nbloops); else PR.SendFail(Msg197); - PR.ReadBoolean(PR.Current(), Msg198, outerLoopFlag); //szv#4:S4163:12Mar99 `st=` not needed - //st = PR.ReadBoolean(PR.Current(), "Outer loop flag", outerLoopFlag); + PR.ReadBoolean(Msg198, outerLoopFlag); if (!tempLoops.IsNull()) { for (Standard_Integer i=1; i<=nbloops; i++) { - //st = PR.ReadEntity(IR, PR.Current(), Msg199, STANDARD_TYPE(IGESSolid_Loop), aloop); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadEntity(IR, PR.Current(), "Loops", STANDARD_TYPE(IGESSolid_Loop), aloop); - if (PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESSolid_Loop), aloop)) + if (PR.ReadEntity(IR, aStatus, STANDARD_TYPE(IGESSolid_Loop), aloop)) tempLoops->SetValue(i, aloop); else{ Message_Msg Msg199("XSTEP_199"); diff --git a/src/IGESSolid/IGESSolid_ToolLoop.cxx b/src/IGESSolid/IGESSolid_ToolLoop.cxx index 655b29ce56..0ae79cc20b 100644 --- a/src/IGESSolid/IGESSolid_ToolLoop.cxx +++ b/src/IGESSolid/IGESSolid_ToolLoop.cxx @@ -53,9 +53,7 @@ void IGESSolid_ToolLoop::ReadOwnParams (const Handle(IGESSolid_Loop)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - // MGE 03/08/98 - - Standard_Boolean abool; //szv#4:S4163:12Mar99 `st` moved down + Standard_Boolean abool; Standard_Integer nbedges = 0; Standard_Integer i, j; Standard_Integer anint; @@ -69,9 +67,7 @@ void IGESSolid_ToolLoop::ReadOwnParams (const Handle(IGESSolid_Loop)& ent, Handle(IGESBasic_HArray1OfHArray1OfIGESEntity) tempCurves; IGESData_Status aStatus; - //st = PR.ReadInteger(PR.Current(),Msg184, nbedges); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadInteger(PR.Current(), "Number of edges", nbedges); - Standard_Boolean sb = PR.ReadInteger(PR.Current(), nbedges); + Standard_Boolean sb = PR.ReadInteger(nbedges); if (sb && (nbedges > 0)) { Message_Msg Msg180("XSTEP_180"); @@ -89,13 +85,11 @@ void IGESSolid_ToolLoop::ReadOwnParams (const Handle(IGESSolid_Loop)& ent, for (i=1; i<= nbedges; i++) { - //st = PR.ReadInteger(PR.Current(), Msg190, anint); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadInteger(PR.Current(), "Edge types", anint); - if (PR.ReadInteger(PR.Current(), anint)) + if (PR.ReadInteger(anint)) tempTypes->SetValue(i, anint); else PR.SendFail(Msg190); - if (!PR.ReadEntity(IR, PR.Current(), aStatus, anent)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadEntity(IR, aStatus, anent)) { Message_Msg Msg193("XSTEP_193"); switch(aStatus) { case IGESData_ReferenceError: { @@ -112,33 +106,26 @@ void IGESSolid_ToolLoop::ReadOwnParams (const Handle(IGESSolid_Loop)& ent, } } } - //st = PR.ReadEntity(IR, PR.Current(), "Edges", anent); - //if (!st) { } // WARNING : Two possible Types : //szv#4:S4163:12Mar99 not needed if (!anent->IsKind(STANDARD_TYPE(IGESSolid_VertexList)) && !anent->IsKind(STANDARD_TYPE(IGESSolid_EdgeList)) ) PR.SendFail(Msg190); else tempEdges->SetValue(i, anent); - //st = PR.ReadInteger(PR.Current(), Msg191, anint); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadInteger(PR.Current(), "List index", anint); - if (PR.ReadInteger(PR.Current(), anint)) + if (PR.ReadInteger(anint)) tempIndex->SetValue(i, anint); else{ Message_Msg Msg191("XSTEP_191"); PR.SendFail(Msg191); } - //st = PR.ReadBoolean(PR.Current(), Msg180, abool); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadBoolean(PR.Current(), "Orientation flags", abool); - if (PR.ReadBoolean(PR.Current(), Msg180, abool)) + if (PR.ReadBoolean(Msg180, abool)) tempOrientation->SetValue(i, (abool ? 1 : 0)); // bool; - Standard_Boolean st = PR.ReadInteger(PR.Current(),anint); + Standard_Boolean st = PR.ReadInteger(anint); if(!st){ Message_Msg Msg192("XSTEP_192"); PR.SendFail(Msg192); } - //st = PR.ReadInteger(PR.Current(), "Number of parameter curves", anint); if (st && anint > 0) { Message_Msg Msg195("XSTEP_195"); @@ -149,14 +136,10 @@ void IGESSolid_ToolLoop::ReadOwnParams (const Handle(IGESSolid_Loop)& ent, new TColStd_HArray1OfInteger(1, anint); for (j = 1; j <= anint; j ++) { - //st = PR.ReadBoolean(PR.Current(), Msg195, abool); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadBoolean(PR.Current(), "Isoparametric flags", abool); - if (PR.ReadBoolean(PR.Current(), Msg195, abool)) + if (PR.ReadBoolean(Msg195, abool)) tmpints->SetValue(j, (abool ? 1 : 0)); // bool; - //st = PR.ReadEntity(IR, PR.Current(), Msg194, anent); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadEntity(IR, PR.Current(), "Curves", anent); - if (PR.ReadEntity(IR, PR.Current(), aStatus, anent)) + if (PR.ReadEntity(IR, aStatus, anent)) tmpents->SetValue(j, anent); else { Message_Msg Msg194("XSTEP_194"); diff --git a/src/IGESSolid/IGESSolid_ToolManifoldSolid.cxx b/src/IGESSolid/IGESSolid_ToolManifoldSolid.cxx index 1b95deec13..b03354addf 100644 --- a/src/IGESSolid/IGESSolid_ToolManifoldSolid.cxx +++ b/src/IGESSolid/IGESSolid_ToolManifoldSolid.cxx @@ -49,7 +49,7 @@ void IGESSolid_ToolManifoldSolid::ReadOwnParams Message_Msg Msg180("XSTEP_180"); //======================================== - Standard_Boolean abool, shellFlag; //szv#4:S4163:12Mar99 `st` moved down + Standard_Boolean abool, shellFlag; Standard_Integer nbshells, i; Handle(TColStd_HArray1OfInteger) voidShellFlags; Handle(IGESData_IGESEntity) shell; @@ -57,7 +57,7 @@ void IGESSolid_ToolManifoldSolid::ReadOwnParams Handle(IGESSolid_HArray1OfShell) voidShells; IGESData_Status aStatus; - if (!PR.ReadEntity(IR, PR.Current(), aStatus, shell)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadEntity(IR, aStatus, shell)) { Message_Msg Msg178("XSTEP_178"); switch(aStatus) { case IGESData_ReferenceError: { @@ -75,30 +75,19 @@ void IGESSolid_ToolManifoldSolid::ReadOwnParams } } - PR.ReadBoolean(PR.Current(), Msg180, shellFlag); //szv#4:S4163:12Mar99 `st=` not needed - Standard_Boolean st = PR.ReadInteger(PR.Current(), nbshells); + PR.ReadBoolean(Msg180, shellFlag); + Standard_Boolean st = PR.ReadInteger(nbshells); if(!st){ Message_Msg Msg181("XSTEP_181"); PR.SendFail(Msg181); } -/* - st = PR.ReadEntity(IR, PR.Current(), "Shell", shell); - st = PR.ReadBoolean(PR.Current(), "Shell orientation", shellFlag); - st = PR.ReadInteger(PR.Current(), "Number of shells", nbshells); -*/ if (st && nbshells > 0) { voidShells = new IGESSolid_HArray1OfShell(1, nbshells); voidShellFlags = new TColStd_HArray1OfInteger(1, nbshells); voidShellFlags->Init(0); for (i=1; i<=nbshells; i++) { - //st = PR.ReadEntity(IR, PR.Current(), Msg179, - //STANDARD_TYPE(IGESSolid_Shell), ashell); //szv#4:S4163:12Mar99 moved in if - /* - st = PR.ReadEntity(IR, PR.Current(), "Void shells", - STANDARD_TYPE(IGESSolid_Shell), ashell); - */ - if (PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESSolid_Shell), ashell)) + if (PR.ReadEntity(IR, aStatus, STANDARD_TYPE(IGESSolid_Shell), ashell)) voidShells->SetValue(i, ashell); else { Message_Msg Msg179("XSTEP_179"); @@ -123,7 +112,7 @@ void IGESSolid_ToolManifoldSolid::ReadOwnParams } } - PR.ReadBoolean(PR.Current(), Msg180, abool); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadBoolean(Msg180, abool); if (abool) voidShellFlags->SetValue(i, 1); } } diff --git a/src/IGESSolid/IGESSolid_ToolPlaneSurface.cxx b/src/IGESSolid/IGESSolid_ToolPlaneSurface.cxx index b93bd1f07f..7c472305a4 100644 --- a/src/IGESSolid/IGESSolid_ToolPlaneSurface.cxx +++ b/src/IGESSolid/IGESSolid_ToolPlaneSurface.cxx @@ -49,9 +49,8 @@ void IGESSolid_ToolPlaneSurface::ReadOwnParams(const Handle(IGESSolid_PlaneSurfa Handle(IGESGeom_Direction) tempNormal; Handle(IGESGeom_Direction) tempRefdir; // default Unparametrised IGESData_Status aStatus; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - if (!PR.ReadEntity(IR, PR.Current(),aStatus,STANDARD_TYPE(IGESGeom_Point), tempLocation)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadEntity(IR,aStatus,STANDARD_TYPE(IGESGeom_Point), tempLocation)) { Message_Msg Msg174("XSTEP_174"); switch(aStatus) { case IGESData_ReferenceError: { @@ -73,11 +72,7 @@ void IGESSolid_ToolPlaneSurface::ReadOwnParams(const Handle(IGESSolid_PlaneSurfa } } } -/* - st = PR.ReadEntity(IR, PR.Current(), "Point on axis", - STANDARD_TYPE(IGESGeom_Point), tempLocation); -*/ - if (!PR.ReadEntity(IR, PR.Current(),aStatus,STANDARD_TYPE(IGESGeom_Direction), tempNormal)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadEntity(IR,aStatus,STANDARD_TYPE(IGESGeom_Direction), tempNormal)) { Message_Msg Msg175("XSTEP_175"); switch(aStatus) { case IGESData_ReferenceError: { @@ -99,13 +94,9 @@ void IGESSolid_ToolPlaneSurface::ReadOwnParams(const Handle(IGESSolid_PlaneSurfa } } } -/* - st = PR.ReadEntity(IR, PR.Current(), "Normal direction", - STANDARD_TYPE(IGESGeom_Direction), tempNormal); -*/ if (ent->FormNumber() == 1){ // Parametrised surface - if (!PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESGeom_Direction), tempRefdir)){ //szv#4:S4163:12Mar99 `st=` not needed + if (!PR.ReadEntity(IR, aStatus, STANDARD_TYPE(IGESGeom_Direction), tempRefdir)) { Message_Msg Msg176("XSTEP_176"); switch(aStatus) { case IGESData_ReferenceError: { @@ -128,10 +119,6 @@ void IGESSolid_ToolPlaneSurface::ReadOwnParams(const Handle(IGESSolid_PlaneSurfa } } } -/* - st = PR.ReadEntity(IR, PR.Current(), "Reference direction", - STANDARD_TYPE(IGESGeom_Direction), tempRefdir); -*/ DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init (tempLocation, tempNormal, tempRefdir); } diff --git a/src/IGESSolid/IGESSolid_ToolRightAngularWedge.cxx b/src/IGESSolid/IGESSolid_ToolRightAngularWedge.cxx index 98894b1112..22d12a5dad 100644 --- a/src/IGESSolid/IGESSolid_ToolRightAngularWedge.cxx +++ b/src/IGESSolid/IGESSolid_ToolRightAngularWedge.cxx @@ -42,80 +42,69 @@ void IGESSolid_ToolRightAngularWedge::ReadOwnParams gp_XYZ tempSize, tempCorner, tempXAxis, tempZAxis; Standard_Real lowX; Standard_Real tempreal; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadXYZ(PR.CurrentList(1, 3), "Size of RightAngularWedge", tempSize); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadReal(PR.Current(), "Small X length", lowX); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadXYZ(tempSize,"Size of RightAngularWedge"); + PR.ReadReal(lowX,"Small X length"); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Corner Point (X)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Corner Point (X)", tempreal)) + if (PR.ReadReal(tempreal,"Corner Point (X)")) tempCorner.SetX(tempreal); } else tempCorner.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Corner Point (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Corner Point (Y)", tempreal)) + if (PR.ReadReal(tempreal,"Corner Point (Y)")) tempCorner.SetY(tempreal); } else tempCorner.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Corner Point (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Corner Point (Z)", tempreal)) + if (PR.ReadReal(tempreal,"Corner Point (Z)")) tempCorner.SetZ(tempreal); } else tempCorner.SetZ(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local X axis (I)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local X axis (I)", tempreal)) + if (PR.ReadReal(tempreal,"Local X axis (I)")) tempXAxis.SetX(tempreal); } else tempXAxis.SetX(1.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local X axis (J)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local X axis (J)", tempreal)) + if (PR.ReadReal(tempreal,"Local X axis (J)")) tempXAxis.SetY(tempreal); } else tempXAxis.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local X axis (K)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local X axis (K)", tempreal)) + if (PR.ReadReal(tempreal,"Local X axis (K)")) tempXAxis.SetZ(tempreal); } else tempXAxis.SetZ(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local Z axis (I)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local Z axis (I)", tempreal)) + if (PR.ReadReal(tempreal,"Local Z axis (I)")) tempZAxis.SetX(tempreal); } else tempZAxis.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local Z axis (J)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local Z axis (J)", tempreal)) + if (PR.ReadReal(tempreal,"Local Z axis (J)")) tempZAxis.SetY(tempreal); } else tempZAxis.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Local Z axis (K)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Local Z axis (K)", tempreal)) + if (PR.ReadReal(tempreal,"Local Z axis (K)")) tempZAxis.SetZ(tempreal); } else tempZAxis.SetZ(1.0); diff --git a/src/IGESSolid/IGESSolid_ToolSelectedComponent.cxx b/src/IGESSolid/IGESSolid_ToolSelectedComponent.cxx index 84b023dc0f..fcbcd175e2 100644 --- a/src/IGESSolid/IGESSolid_ToolSelectedComponent.cxx +++ b/src/IGESSolid/IGESSolid_ToolSelectedComponent.cxx @@ -42,12 +42,9 @@ void IGESSolid_ToolSelectedComponent::ReadOwnParams { Handle(IGESSolid_BooleanTree) tempEntity; gp_XYZ tempSelectPoint; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadEntity(IR, PR.Current(), "Boolean Tree Entity", - STANDARD_TYPE(IGESSolid_BooleanTree), tempEntity); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadXYZ(PR.CurrentList(1, 3), "Select Point", tempSelectPoint); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Boolean Tree Entity", STANDARD_TYPE(IGESSolid_BooleanTree), tempEntity); + PR.ReadXYZ(tempSelectPoint,"Select Point"); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(tempEntity, tempSelectPoint); diff --git a/src/IGESSolid/IGESSolid_ToolShell.cxx b/src/IGESSolid/IGESSolid_ToolShell.cxx index b28a6c7e07..4e40fe689c 100644 --- a/src/IGESSolid/IGESSolid_ToolShell.cxx +++ b/src/IGESSolid/IGESSolid_ToolShell.cxx @@ -48,18 +48,11 @@ void IGESSolid_ToolShell::ReadOwnParams(const Handle(IGESSolid_Shell)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - - // MGE 03/08/98 - - //Standard_Boolean abool; //szv#4:S4163:12Mar99 moved down - Standard_Integer nbfaces=0;; //szv#4:S4163:12Mar99 `i` moved in for - //Handle(IGESSolid_Face) aface; //szv#4:S4163:12Mar99 moved down + Standard_Integer nbfaces=0; Handle(IGESSolid_HArray1OfFace) tempFaces; Handle(TColStd_HArray1OfInteger) tempOrientation; - //st = PR.ReadInteger(PR.Current(), Msg200, nbfaces); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadInteger(PR.Current(), "Number of faces", nbfaces); - Standard_Boolean sb = PR.ReadInteger(PR.Current(), nbfaces); + Standard_Boolean sb = PR.ReadInteger(nbfaces); if (sb && nbfaces > 0 ) { Message_Msg Msg180("XSTEP_180"); @@ -69,9 +62,7 @@ void IGESSolid_ToolShell::ReadOwnParams(const Handle(IGESSolid_Shell)& ent, tempOrientation = new TColStd_HArray1OfInteger(1, nbfaces); IGESData_Status aStatus; for (Standard_Integer i=1; i<=nbfaces; i++) { - //st = PR.ReadEntity(IR, PR.Current(),Msg201, STANDARD_TYPE(IGESSolid_Face), aface); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadEntity(IR, PR.Current(), "Faces", STANDARD_TYPE(IGESSolid_Face), aface); - if (PR.ReadEntity(IR, PR.Current(),aStatus, STANDARD_TYPE(IGESSolid_Face), aface)) + if (PR.ReadEntity(IR, aStatus, STANDARD_TYPE(IGESSolid_Face), aface)) tempFaces->SetValue(i, aface); else{ Message_Msg Msg201("XSTEP_201"); @@ -95,9 +86,7 @@ void IGESSolid_ToolShell::ReadOwnParams(const Handle(IGESSolid_Shell)& ent, } } } - //st = PR.ReadBoolean(PR.Current(), Msg180, abool); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadBoolean(PR.Current(), "Orientation flags", abool); - if (PR.ReadBoolean(PR.Current(), Msg180, abool)) + if (PR.ReadBoolean(Msg180, abool)) tempOrientation->SetValue(i, (abool ? 1 : 0) ); } } diff --git a/src/IGESSolid/IGESSolid_ToolSolidAssembly.cxx b/src/IGESSolid/IGESSolid_ToolSolidAssembly.cxx index efb4985d7f..ccecf5f70c 100644 --- a/src/IGESSolid/IGESSolid_ToolSolidAssembly.cxx +++ b/src/IGESSolid/IGESSolid_ToolSolidAssembly.cxx @@ -41,14 +41,11 @@ void IGESSolid_ToolSolidAssembly::ReadOwnParams (const Handle(IGESSolid_SolidAssembly)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { - //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down Standard_Integer nbitems; //szv#4:S4163:12Mar99 `i` moved in for - //Handle(IGESData_IGESEntity) anent; //szv#4:S4163:12Mar99 moved down - //Handle(IGESGeom_TransformationMatrix) amatr; //szv#4:S4163:12Mar99 moved down Handle(IGESData_HArray1OfIGESEntity) tempItems; Handle(IGESGeom_HArray1OfTransformationMatrix) tempMatrices; - Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Items", nbitems); + Standard_Boolean st = PR.ReadInteger(nbitems,"Number of Items"); if (st && nbitems > 0) { tempItems = new IGESData_HArray1OfIGESEntity(1, nbitems); @@ -58,18 +55,14 @@ void IGESSolid_ToolSolidAssembly::ReadOwnParams Standard_Integer i; // svv Jan 10 2000 : porting on DEC for (i = 1; i <= nbitems; i++) { - //st = PR.ReadEntity(IR,PR.Current(), "Solid assembly items", anent); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR,PR.Current(), "Solid assembly items", anent)) + if (PR.ReadEntity(IR, "Solid assembly items", anent)) tempItems->SetValue(i, anent); } Handle(IGESGeom_TransformationMatrix) amatr; for (i = 1; i <= nbitems; i++) { - //st = PR.ReadEntity(IR,PR.Current(), "Matrices", - //STANDARD_TYPE(IGESGeom_TransformationMatrix), - //amatr, Standard_True); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadEntity(IR,PR.Current(), "Matrices", + if (PR.ReadEntity(IR, "Matrices", STANDARD_TYPE(IGESGeom_TransformationMatrix), amatr, Standard_True)) tempMatrices->SetValue(i, amatr); } diff --git a/src/IGESSolid/IGESSolid_ToolSolidInstance.cxx b/src/IGESSolid/IGESSolid_ToolSolidInstance.cxx index bfd3ff80d9..ac1d983c23 100644 --- a/src/IGESSolid/IGESSolid_ToolSolidInstance.cxx +++ b/src/IGESSolid/IGESSolid_ToolSolidInstance.cxx @@ -38,9 +38,8 @@ void IGESSolid_ToolSolidInstance::ReadOwnParams const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const { Handle(IGESData_IGESEntity) tempEntity; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadEntity(IR, PR.Current(), "Solid Entity", tempEntity); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Solid Entity", tempEntity); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init(tempEntity); diff --git a/src/IGESSolid/IGESSolid_ToolSolidOfLinearExtrusion.cxx b/src/IGESSolid/IGESSolid_ToolSolidOfLinearExtrusion.cxx index f5b32a3d70..83505dab7e 100644 --- a/src/IGESSolid/IGESSolid_ToolSolidOfLinearExtrusion.cxx +++ b/src/IGESSolid/IGESSolid_ToolSolidOfLinearExtrusion.cxx @@ -43,32 +43,27 @@ void IGESSolid_ToolSolidOfLinearExtrusion::ReadOwnParams gp_XYZ tempDirection; Standard_Real tempLength; Standard_Real tempreal; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadEntity(IR, PR.Current(), "Curve Entity", tempEntity); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadReal(PR.Current(), "Length of extrusion", tempLength); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Curve Entity", tempEntity); + PR.ReadReal(tempLength,"Length of extrusion"); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Extrusion direction (I)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Extrusion direction (I)", tempreal)) + if (PR.ReadReal(tempreal,"Extrusion direction (I)")) tempDirection.SetX(tempreal); } else tempDirection.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Extrusion direction (J)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Extrusion direction (J)", tempreal)) + if (PR.ReadReal(tempreal,"Extrusion direction (J)")) tempDirection.SetY(tempreal); } else tempDirection.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Extrusion direction (K)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Extrusion direction (K)", tempreal)) + if (PR.ReadReal(tempreal,"Extrusion direction (K)")) tempDirection.SetZ(tempreal); } else tempDirection.SetZ(1.0); diff --git a/src/IGESSolid/IGESSolid_ToolSolidOfRevolution.cxx b/src/IGESSolid/IGESSolid_ToolSolidOfRevolution.cxx index 628631a614..d2bc663261 100644 --- a/src/IGESSolid/IGESSolid_ToolSolidOfRevolution.cxx +++ b/src/IGESSolid/IGESSolid_ToolSolidOfRevolution.cxx @@ -46,58 +46,51 @@ void IGESSolid_ToolSolidOfRevolution::ReadOwnParams gp_XYZ tempAxis; Standard_Real tempFraction; Standard_Real tempreal; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadEntity(IR, PR.Current(), "Curve Entity", tempEntity); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Curve Entity", tempEntity); if (PR.DefinedElseSkip()) - PR.ReadReal(PR.Current(), "Fraction of rotation", tempFraction); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(tempFraction,"Fraction of rotation"); else tempFraction = 1.0; if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis Point (X)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis Point (X)", tempreal)) + if (PR.ReadReal(tempreal,"Axis Point (X)")) tempAxisPoint.SetX(tempreal); } else tempAxisPoint.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis Point (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis Point (Y)", tempreal)) + if (PR.ReadReal(tempreal,"Axis Point (Y)")) tempAxisPoint.SetY(tempreal); } else tempAxisPoint.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis Point (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis Point (Z)", tempreal)) + if (PR.ReadReal(tempreal,"Axis Point (Z)")) tempAxisPoint.SetZ(tempreal); } else tempAxisPoint.SetZ(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal)) + if (PR.ReadReal(tempreal,"Axis direction (I)")) tempAxis.SetX(tempreal); } else tempAxis.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal)) + if (PR.ReadReal(tempreal,"Axis direction (J)")) tempAxis.SetY(tempreal); } else tempAxis.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal)) + if (PR.ReadReal(tempreal,"Axis direction (K)")) tempAxis.SetZ(tempreal); } else tempAxis.SetZ(1.0); diff --git a/src/IGESSolid/IGESSolid_ToolSphere.cxx b/src/IGESSolid/IGESSolid_ToolSphere.cxx index c519c40fd6..50059219af 100644 --- a/src/IGESSolid/IGESSolid_ToolSphere.cxx +++ b/src/IGESSolid/IGESSolid_ToolSphere.cxx @@ -40,30 +40,26 @@ void IGESSolid_ToolSphere::ReadOwnParams { Standard_Real tempRadius, tempreal; gp_XYZ tempCenter; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadReal(PR.Current(), "Radius", tempRadius); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(tempRadius,"Radius"); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Center (X)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Center (X)", tempreal)) + if (PR.ReadReal(tempreal,"Center (X)")) tempCenter.SetX(tempreal); } else tempCenter.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Center (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Center (Y)", tempreal)) + if (PR.ReadReal(tempreal,"Center (Y)")) tempCenter.SetY(tempreal); } else tempCenter.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Center (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Center (Z)", tempreal)) + if (PR.ReadReal(tempreal,"Center (Z)")) tempCenter.SetZ(tempreal); } else tempCenter.SetZ(0.0); diff --git a/src/IGESSolid/IGESSolid_ToolSphericalSurface.cxx b/src/IGESSolid/IGESSolid_ToolSphericalSurface.cxx index 61aa9abf3e..14fb5edbbc 100644 --- a/src/IGESSolid/IGESSolid_ToolSphericalSurface.cxx +++ b/src/IGESSolid/IGESSolid_ToolSphericalSurface.cxx @@ -42,25 +42,18 @@ void IGESSolid_ToolSphericalSurface::ReadOwnParams Standard_Real tempRadius; Handle(IGESGeom_Direction) tempAxis; // default Unparameterised Handle(IGESGeom_Direction) tempRefdir; // default Unparameterised - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadEntity(IR, PR.Current(), "Center point", - STANDARD_TYPE(IGESGeom_Point), tempCenter); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadReal(PR.Current(), "Radius", tempRadius); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Center point", STANDARD_TYPE(IGESGeom_Point), tempCenter); + PR.ReadReal(tempRadius,"Radius"); if (ent->FormNumber() == 1) // Parametrised surface { - PR.ReadEntity(IR, PR.Current(), "Axis direction", - STANDARD_TYPE(IGESGeom_Direction), tempAxis); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Reference direction", - STANDARD_TYPE(IGESGeom_Direction), tempRefdir); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Axis direction", STANDARD_TYPE(IGESGeom_Direction), tempAxis); + PR.ReadEntity(IR, "Reference direction", STANDARD_TYPE(IGESGeom_Direction), tempRefdir); } DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init (tempCenter, tempRadius, tempAxis, tempRefdir); - } void IGESSolid_ToolSphericalSurface::WriteOwnParams diff --git a/src/IGESSolid/IGESSolid_ToolToroidalSurface.cxx b/src/IGESSolid/IGESSolid_ToolToroidalSurface.cxx index 8a87bec2ac..0970cfbea7 100644 --- a/src/IGESSolid/IGESSolid_ToolToroidalSurface.cxx +++ b/src/IGESSolid/IGESSolid_ToolToroidalSurface.cxx @@ -42,20 +42,14 @@ void IGESSolid_ToolToroidalSurface::ReadOwnParams Standard_Real majRad, minRad; Handle(IGESGeom_Direction) tempAxis; // default Unparametrised Handle(IGESData_IGESEntity) tempRefdir; // default Unparametrised - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadEntity(IR, PR.Current(), "Center point", - STANDARD_TYPE(IGESGeom_Point), tempCenter); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadEntity(IR, PR.Current(), "Axis direction", - STANDARD_TYPE(IGESGeom_Direction), tempAxis); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadReal(PR.Current(), "Major Radius", majRad); //szv#4:S4163:12Mar99 `st=` not needed - - PR.ReadReal(PR.Current(), "Minor Radius", minRad); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Center point", STANDARD_TYPE(IGESGeom_Point), tempCenter); + PR.ReadEntity(IR, "Axis direction", STANDARD_TYPE(IGESGeom_Direction), tempAxis); + PR.ReadReal(majRad,"Major Radius"); + PR.ReadReal(minRad,"Minor Radius"); if (ent->FormNumber() == 1) // Parametrised surface - PR.ReadEntity(IR, PR.Current(), "Reference direction", tempRefdir); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadEntity(IR, "Reference direction", tempRefdir); DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); ent->Init (tempCenter, tempAxis, majRad, minRad, Handle(IGESGeom_Direction)::DownCast (tempRefdir)); diff --git a/src/IGESSolid/IGESSolid_ToolTorus.cxx b/src/IGESSolid/IGESSolid_ToolTorus.cxx index 9d1b61c19f..672ce45f66 100644 --- a/src/IGESSolid/IGESSolid_ToolTorus.cxx +++ b/src/IGESSolid/IGESSolid_ToolTorus.cxx @@ -42,55 +42,48 @@ void IGESSolid_ToolTorus::ReadOwnParams Standard_Real r1, r2; Standard_Real tempreal; gp_XYZ tempPoint, tempAxis; - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - PR.ReadReal(PR.Current(), "Radius of revolution", r1); //szv#4:S4163:12Mar99 `st=` not needed - PR.ReadReal(PR.Current(), "Radius of disc", r2); //szv#4:S4163:12Mar99 `st=` not needed + PR.ReadReal(r1,"Radius of revolution"); + PR.ReadReal(r2,"Radius of disc"); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Center Point (X)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Center Point (X)", tempreal)) + if (PR.ReadReal(tempreal,"Center Point (X)")) tempPoint.SetX(tempreal); } else tempPoint.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Center Point (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Center Point (Y)", tempreal)) + if (PR.ReadReal(tempreal,"Center Point (Y)")) tempPoint.SetY(tempreal); } else tempPoint.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Center Point (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Center Point (Z)", tempreal)) + if (PR.ReadReal(tempreal,"Center Point (Z)")) tempPoint.SetZ(tempreal); } else tempPoint.SetZ(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal)) + if (PR.ReadReal(tempreal,"Axis direction (I)")) tempAxis.SetX(tempreal); } else tempAxis.SetX(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal)) + if (PR.ReadReal(tempreal,"Axis direction (J)")) tempAxis.SetY(tempreal); } else tempAxis.SetY(0.0); if (PR.DefinedElseSkip()) { - //st = PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal); //szv#4:S4163:12Mar99 moved in if - if (PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal)) + if (PR.ReadReal(tempreal,"Axis direction (K)")) tempAxis.SetZ(tempreal); } else tempAxis.SetZ(1.0); diff --git a/src/IGESSolid/IGESSolid_ToolVertexList.cxx b/src/IGESSolid/IGESSolid_ToolVertexList.cxx index 1802362ed1..01b546d8e8 100644 --- a/src/IGESSolid/IGESSolid_ToolVertexList.cxx +++ b/src/IGESSolid/IGESSolid_ToolVertexList.cxx @@ -46,34 +46,17 @@ void IGESSolid_ToolVertexList::ReadOwnParams(const Handle(IGESSolid_VertexList)& const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const { - // MGE 03/08/98 - // Building of messages - //======================================== -// Message_Msg Msg182("XSTEP_182"); -// Message_Msg Msg183("XSTEP_183"); - //======================================== - - //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed - Standard_Integer nbitems = 0; //szv#4:S4163:12Mar99 `i` moved in for - //gp_XYZ anXYZ; //szv#4:S4163:12Mar99 moved down + Standard_Integer nbitems = 0; Handle(TColgp_HArray1OfXYZ) tempVertices; - //st = PR.ReadInteger(PR.Current(), Msg182, nbitems); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadInteger(PR.Current(), "Number of Vertices", nbitems); - Standard_Boolean sb = PR.ReadInteger(PR.Current(), nbitems); + Standard_Boolean sb = PR.ReadInteger(nbitems); if (sb && (nbitems > 0)) { - Message_Msg Msg183("XSTEP_183"); - tempVertices = new TColgp_HArray1OfXYZ(1, nbitems); - gp_XYZ anXYZ; for (Standard_Integer i = 1; i <= nbitems; i++) { - //st = PR.ReadXYZ(PR.CurrentList(1, 3), Msg183, anXYZ); //szv#4:S4163:12Mar99 moved in if - //st = PR.ReadXYZ(PR.CurrentList(1, 3), "Vertices", anXYZ); - if (PR.ReadXYZ(PR.CurrentList(1, 3), Msg183, anXYZ)) - tempVertices->SetValue(i, anXYZ); + PR.ReadXYZ(tempVertices->ChangeValue(i)); } } else { diff --git a/src/IGESToBRep/IGESToBRep_Reader.cxx b/src/IGESToBRep/IGESToBRep_Reader.cxx index 64735ec516..2168ee1d36 100644 --- a/src/IGESToBRep/IGESToBRep_Reader.cxx +++ b/src/IGESToBRep/IGESToBRep_Reader.cxx @@ -19,10 +19,11 @@ #include #include #include +#include #include #include #include -#include +#include #include #include #include @@ -97,12 +98,17 @@ Standard_Integer IGESToBRep_Reader::LoadFile (const Standard_CString filename) msg2005.Arg(theProc->TraceLevel()); TF->Send (msg2005, Message_Info); ///////////////////////////////////////////////////////// - Handle(IGESData_IGESModel) model = new IGESData_IGESModel; OSD_Timer c; c.Reset(); c.Start(); - char *pfilename=(char *)filename; + const Handle(IGESData_Protocol) &protocol = IGESControl_Controller::DefineProtocol(); - Standard_Integer StatusFile = IGESFile_Read(pfilename,model,protocol); + + IGESFile_Reader aReader(protocol); + + const Standard_Integer StatusFile = aReader.Read(filename); + + const Handle(IGESData_IGESModel) &model = aReader.Model(); + if (StatusFile != 0) { // Sending of message : IGES file opening error Message_Msg Msg2("XSTEP_2"); diff --git a/src/Interface/Interface_FileReaderData.cxx b/src/Interface/Interface_FileReaderData.cxx index 8ce57f7f7d..897b174b58 100644 --- a/src/Interface/Interface_FileReaderData.cxx +++ b/src/Interface/Interface_FileReaderData.cxx @@ -43,7 +43,7 @@ static Standard_Integer thenp0 = -1; Interface_FileReaderData::Interface_FileReaderData (const Standard_Integer nbr, const Standard_Integer npar) - : therrload (0), thenumpar (0,nbr), theents (0,nbr) + : thenumpar (0,nbr), theents (0,nbr) { theparams = new Interface_ParamSet (npar); thenumpar.Init(0); @@ -174,21 +174,11 @@ Interface_FileReaderData::Interface_FileReaderData (const Standard_Integer nbr, (const Standard_Integer num) const { return thenumpar(num); } - void Interface_FileReaderData::SetErrorLoad (const Standard_Boolean val) - { therrload = (val ? 1 : -1); } - - Standard_Boolean Interface_FileReaderData::IsErrorLoad () const - { return (therrload != 0); } - - Standard_Boolean Interface_FileReaderData::ResetErrorLoad () - { Standard_Boolean res = (therrload > 0); therrload = 0; return res; } - // .... Gestion des Entites Associees aux Donnees du Fichier .... const Handle(Standard_Transient)& Interface_FileReaderData::BoundEntity (const Standard_Integer num) const - // { return theents(num); } { if (num >= theents.Lower() && num <= theents.Upper()) { return theents(num); @@ -198,49 +188,13 @@ const Handle(Standard_Transient)& Interface_FileReaderData::BoundEntity return dummy; } } -/* //static Handle(Standard_Transient) dummy; - { - //smh#10 Protection. If iges entity does not exist, return null pointer. - try { - OCC_CATCH_SIGNALS - Handle(Standard_Transient) temp = theents.Value(num); - } - ////sln 21.01.2002 OCC133: Exception handling - // catch (Standard_OutOfRange) { - // cout<<" Catch of sln"< True : declares unloaded - //! False : declares loaded - //! If not called before loading (see FileReaderTool), check fails - //! give the status - //! IsErrorLoad says if SetErrorLoad has been called by user - //! ResetErrorLoad resets it (called by FileReaderTool) - //! This allows to specify that the currently loaded entity - //! remains unloaded (because of syntactic fail) - Standard_EXPORT void SetErrorLoad (const Standard_Boolean val); - - //! Returns True if the status "Error Load" has been set (to True - //! or False) - Standard_EXPORT Standard_Boolean IsErrorLoad() const; - - //! Returns the former value of status "Error Load" then resets it - //! Used to read the status then ensure it is reset - Standard_EXPORT Standard_Boolean ResetErrorLoad(); - - //! Destructor (waiting for memory management) - Standard_EXPORT void Destroy(); -~Interface_FileReaderData() -{ - Destroy(); -} - //! Same spec.s as standard but 5 times faster Standard_EXPORT static Standard_Real Fastof (const Standard_CString str); - - DEFINE_STANDARD_RTTIEXT(Interface_FileReaderData,MMgt_TShared) -protected: + protected: - //! Initializes arrays of Entities and of ParamLists attached //! to registered records //! must be the maximum number of records to get (no way to @@ -206,24 +175,12 @@ protected: //! record to which its belongs, and the parameter number for it Standard_EXPORT void ParamPosition (const Standard_Integer numpar, Standard_Integer& num, Standard_Integer& nump) const; - - -private: - + private: Standard_Integer thenum0; - Standard_Integer therrload; Handle(Interface_ParamSet) theparams; TColStd_Array1OfInteger thenumpar; TColStd_Array1OfTransient theents; - - }; - - - - - - #endif // _Interface_FileReaderData_HeaderFile diff --git a/src/Interface/Interface_FileReaderTool.cxx b/src/Interface/Interface_FileReaderTool.cxx index fcdf413681..5c01713fd6 100644 --- a/src/Interface/Interface_FileReaderTool.cxx +++ b/src/Interface/Interface_FileReaderTool.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #ifdef _WIN32 #include @@ -60,95 +61,66 @@ Interface_FileReaderTool::Interface_FileReaderTool (const Handle(Interface_Protocol)& protocol) : theglib(protocol), therlib(protocol), - themessenger(Message::DefaultMessenger()), - thetrace(1), - thenbrep0(0), - thenbreps(0) + themessenger(Message::DefaultMessenger()) { } //======================================================================= -//function : SetMessenger +//function : EndRead //purpose : //======================================================================= -void Interface_FileReaderTool::SetMessenger (const Handle(Message_Messenger)& messenger) +void Interface_FileReaderTool::EndRead(const Handle(Interface_InterfaceModel)& ) { - themessenger = ( messenger.IsNull()? Message::DefaultMessenger() : messenger ); } -// .... Actions Connexes au CHARGEMENT DU MODELE .... -// SetEntities fait appel a des methodes a fournir : -// s appuyant sur un Recognizer adapte a l interface : -// - Recognize fait reco->Evaluate(... : selon record no num) -// et recupere le resultat -// ainsi que la definition de l entite inconnue de l interface +// .... (Sa Majeste le) CHARGEMENT DU MODELE .... //======================================================================= -//function : SetEntities +//function : LoadModel //purpose : //======================================================================= -void Interface_FileReaderTool::SetEntities () +void Interface_FileReaderTool::LoadModel (const Handle(Interface_InterfaceModel)& amodel) +// +// Methode generale de lecture d un fichier : il est lu via un FileReaderData +// qui doit y donner acces de la facon la plus performante possible +// chaque interface definit son FileHeader avec ses methodes, appelees ici { - Standard_Integer num; - thenbreps = 0; thenbrep0 = 0; + Prepare (); + + Standard_Integer numr; + Standard_Integer thenbreps = 0, thenbrep0 = 0; + Handle(TColStd_HArray1OfTransient) thereports; - for (num = thereader->FindNextRecord(0); num > 0; - num = thereader->FindNextRecord(num)) { + for (numr = thereader->FindNextRecord(0); numr > 0; + numr = thereader->FindNextRecord(numr)) + { Handle(Standard_Transient) newent; - const Standard_Boolean res = Recognize (num,newent); + const Standard_Boolean res = Recognize (numr,newent); if (!res) { newent = theproto->UnknownEntity(); if (thereports.IsNull()) thereports = new TColStd_HArray1OfTransient (1,thereader->NbRecords()); thenbreps ++; thenbrep0 ++; - thereports->SetValue (num,new Interface_ReportEntity(newent)); + thereports->SetValue (numr,new Interface_ReportEntity(newent)); } - thereader->BindEntity (num,newent); + thereader->BindEntity (numr,newent); } -} - -//======================================================================= -//function : EndRead -//purpose : -//======================================================================= - -void Interface_FileReaderTool::EndRead(const Handle(Interface_InterfaceModel)& ) -{ -} - - -// .... (Sa Majeste le) CHARGEMENT DU MODELE .... - - -//======================================================================= -//function : LoadModel -//purpose : -//======================================================================= - -void Interface_FileReaderTool::LoadModel (const Handle(Interface_InterfaceModel)& amodel) -// -// Methode generale de lecture d un fichier : il est lu via un FileReaderData -// qui doit y donner acces de la facon la plus performante possible -// chaque interface definit son FileHeader avec ses methodes, appelees ici -{ - // MGE 16/06/98 - // Building of Messages //==================================== - Handle(Message_Messenger) TF = Messenger(); + const Handle(Message_Messenger) &TF = Messenger(); //==================================== Handle(Interface_Check) ach = new Interface_Check; - SetModel(amodel); + themodel = amodel; // .. Demarrage : Lecture du Header .. try { OCC_CATCH_SIGNALS - BeginRead(amodel); // selon la norme + BeginRead(themodel); // selon la norme } catch (Standard_Failure) { // Sendinf of message : Internal error during the header reading @@ -158,46 +130,88 @@ void Interface_FileReaderTool::LoadModel (const Handle(Interface_InterfaceModel) // .. Lecture des Entites .. - amodel->Reservate (thereader->NbEntities()); + themodel->Reservate (thereader->NbEntities()); - Standard_Integer num, num0 = thereader->FindNextRecord(0); - num = num0; + numr = thereader->FindNextRecord(0); - while (num > 0) { + Standard_Integer num = numr; + while (num > 0) + { Standard_Integer ierr = 0; // erreur sur analyse d une entite Handle(Standard_Transient) anent; - try { + try + { OCC_CATCH_SIGNALS - for (num = num0; num > 0; num = thereader->FindNextRecord(num)) { - num0 = num; - - // Lecture sous protection contre crash - // (fait aussi AddEntity mais pas SetReportEntity) - anent = LoadedEntity(num); - - // Lecture non protegee : utile pour travailler avec dbx -//// else -//// anent = LoadedEntity(num); - - // .. Fin Lecture .. - if (anent.IsNull()) { + for (num = numr; num > 0; num = thereader->FindNextRecord(num)) + { + numr = num; + + // Lecture sous protection contre crash + // (fait aussi AddEntity mais pas SetReportEntity) + Handle(Standard_Transient) anent = thereader->BoundEntity(num); + Handle(Interface_Check) ach = new Interface_Check(anent); + Handle(Interface_ReportEntity) rep; // entite Report, s il y a lieu + Standard_Integer irep = 0; + if (thenbrep0 > 0) { + rep = Handle(Interface_ReportEntity)::DownCast(thereports->Value(num)); + if (!rep.IsNull()) { irep = num; ach = rep->Check(); } + } + + // .. Chargement proprement dit : Specifique de la Norme .. + AnalyseRecord(num,anent,ach); + + // .. Ajout dans le modele de l entite telle quelle .. + // ATTENTION, ReportEntity traitee en bloc apres les Load + themodel->AddEntity(anent); + + // Erreur ou Correction : On cree une ReportEntity qui memorise le Check, + // l Entite, et en cas d Erreur une UndefinedEntity pour les Parametres + + // On exploite ici le flag IsLoadError : s il a ete defini (a vrai ou faux) + // il a priorite sur les fails du check. Sinon, ce sont les fails qui parlent + + Standard_Integer nbf = ach->NbFails(); + Standard_Integer nbw = ach->NbWarnings(); + if (nbf + nbw > 0) + { + themodel->NbEntities(); + rep = new Interface_ReportEntity(ach,anent); + if (irep == 0) + { + if (thereports.IsNull()) + thereports = new TColStd_HArray1OfTransient (1,thereader->NbRecords()); + irep = num; + thenbreps ++; + } + thereports->SetValue(irep,rep); + } + + // Rechargement ? si oui, dans une UnknownEntity fournie par le protocole + if (nbf > 0) { + Handle(Standard_Transient) undef = theproto->UnknownEntity(); + AnalyseRecord(num,undef,ach); + rep->SetContent(undef); + } + + // .. Fin Lecture .. + if (anent.IsNull()) { // Sending of message : Number of ignored Null Entities - Message_Msg Msg21("XSTEP_21"); + Message_Msg Msg21("XSTEP_21"); Msg21.Arg(amodel->NbEntities()); TF->Send (Msg21, Message_Info); - continue; - } - // LoadedEntity fait AddEntity MAIS PAS SetReport (en bloc a la fin) + continue; + } + // LoadedEntity fait AddEntity MAIS PAS SetReport (en bloc a la fin) } // ---- fin boucle sur entites - num0 = 0; // plus rien + numr = 0; // plus rien } // ---- fin du try, le catch suit // En cas d erreur NON PREVUE par l analyse, recuperation par defaut // Attention : la recuperation peut elle-meme planter ... (cf ierr) catch (Standard_Failure) { // Au passage suivant, on attaquera le record suivant - num0 = thereader->FindNextRecord(num); //:g9 abv 28 May 98: tr8_as2_ug.stp - infinite cycle: (0); + numr = thereader->FindNextRecord(num); //:g9 abv 28 May 98: tr8_as2_ug.stp - infinite cycle: (0); Handle(Standard_Failure) afail = Standard_Failure::Caught(); #ifdef _WIN32 @@ -208,85 +222,73 @@ void Interface_FileReaderTool::LoadModel (const Handle(Interface_InterfaceModel) //:abv 03Apr00: anent is actually a previous one: if (anent.IsNull()) anent = thereader->BoundEntity(num); if (anent.IsNull()) { - if (thetrace > 0) - { - // Sending of message : Number of ignored Null Entities - Message_Msg Msg21("XSTEP_21"); - Msg21.Arg(amodel->NbEntities()+1); - TF->Send (Msg21, Message_Info); - continue; - } + // Sending of message : Number of ignored Null Entities + Message_Msg Msg21("XSTEP_21"); + Msg21.Arg(amodel->NbEntities()+1); + TF->Send (Msg21, Message_Info); + continue; } - /*Handle(Interface_Check)*/ ach = new Interface_Check(anent); + ach = new Interface_Check(anent); //: abv 03 Apr 00: trj3_s1-tc-214.stp: generate a message on exception Message_Msg Msg278("XSTEP_278"); Msg278.Arg(amodel->StringLabel(anent)); ach->SendFail (Msg278); if (ierr == 2) { - // Sending of message : reading of entity failed - Message_Msg Msg22("XSTEP_22"); + // Sending of message : reading of entity failed + Message_Msg Msg22("XSTEP_22"); Msg22.Arg(amodel->StringLabel(anent)); TF->Send (Msg22, Message_Info); - return; + return; } if (!ierr) { - //char mess[100]; svv #2 - ierr = 1; -// ce qui serait bien ici serait de recuperer le texte de l erreur pour ach ... - if (thetrace > 0) { - // Sending of message : recovered entity - Message_Msg Msg23("XSTEP_23"); - Msg23.Arg(num); - TF->Send (Msg23, Message_Info); - } - -// Finalement, on charge une Entite Inconnue - thenbreps ++; - Handle(Interface_ReportEntity) rep = - new Interface_ReportEntity(ach,anent); - Handle(Standard_Transient) undef = theproto->UnknownEntity(); - AnalyseRecord(num,undef,ach); - rep->SetContent(undef); - - if (thereports.IsNull()) thereports = - new TColStd_HArray1OfTransient (1,thereader->NbRecords()); - thenbreps ++; - thereports->SetValue (num,rep); - //if(isValid) - amodel->AddEntity (anent); // pas fait par LoadedEntity ... + ierr = 1; + // ce qui serait bien ici serait de recuperer le texte de l erreur pour ach ... + // Sending of message : recovered entity + Message_Msg Msg23("XSTEP_23"); + Msg23.Arg(num); + TF->Send (Msg23, Message_Info); + + // Finalement, on charge une Entite Inconnue + thenbreps ++; + Handle(Interface_ReportEntity) rep = + new Interface_ReportEntity(ach,anent); + Handle(Standard_Transient) undef = theproto->UnknownEntity(); + AnalyseRecord(num,undef,ach); + rep->SetContent(undef); + + if (thereports.IsNull()) + thereports = new TColStd_HArray1OfTransient (1,thereader->NbRecords()); + thenbreps ++; + thereports->SetValue (num,rep); + amodel->AddEntity (anent); // pas fait par LoadedEntity ... } else { - if (thetrace > 0) { - // Sending of message : reading of entity failed - Message_Msg Msg22("XSTEP_22"); - Msg22.Arg(amodel->StringLabel(anent)); - TF->Send (Msg22, Message_Info); - } -// On garde telle quelle : pas d analyse fichier supplementaire, -// Mais la phase preliminaire eventuelle est conservee -// (en particulier, on garde trace du Type lu du fichier, etc...) + // Sending of message : reading of entity failed + Message_Msg Msg22("XSTEP_22"); + Msg22.Arg(amodel->StringLabel(anent)); + TF->Send (Msg22, Message_Info); + // On garde telle quelle : pas d analyse fichier supplementaire, + // Mais la phase preliminaire eventuelle est conservee + // (en particulier, on garde trace du Type lu du fichier, etc...) } } // ----- fin complete du try/catch } // ----- fin du while // .. Ajout des Reports, silya if (!thereports.IsNull()) { - if (thetrace > 0) - { - // Sending of message : report - Message_Msg Msg24("XSTEP_24"); - Msg24.Arg(thenbreps); - TF->Send (Msg24, Message_Info); - } + // Sending of message : report + Message_Msg Msg24("XSTEP_24"); + Msg24.Arg(thenbreps); + TF->Send (Msg24, Message_Info); amodel->Reservate (-thenbreps-10); thenbreps = thereports->Upper(); for (Standard_Integer nr = 1; nr <= thenbreps; nr ++) { if (thereports->Value(nr).IsNull()) continue; Handle(Standard_Transient) anent = thereader->BoundEntity (nr); Handle(Interface_ReportEntity) rep = - Handle(Interface_ReportEntity)::DownCast(thereports->Value(nr)); + Handle(Interface_ReportEntity)::DownCast(thereports->Value(nr)); amodel->SetReportEntity (-amodel->Number(anent),rep); } } @@ -304,74 +306,6 @@ void Interface_FileReaderTool::LoadModel (const Handle(Interface_InterfaceModel) } -//======================================================================= -//function : LoadedEntity -//purpose : -//======================================================================= - -Handle(Standard_Transient) Interface_FileReaderTool::LoadedEntity (const Standard_Integer num) -{ - Handle(Standard_Transient) anent = thereader->BoundEntity(num); - Handle(Interface_Check) ach = new Interface_Check(anent); - Handle(Interface_ReportEntity) rep; // entite Report, s il y a lieu - Standard_Integer irep = 0; - //Standard_Integer nbe = 0; svv #2 - if (thenbrep0 > 0) { - rep = Handle(Interface_ReportEntity)::DownCast(thereports->Value(num)); - if (!rep.IsNull()) { irep = num; ach = rep->Check(); } - } - -// Trace Entite Inconnue - if (thetrace >= 2 && theproto->IsUnknownEntity(anent)) { - Handle(Message_Messenger) TF = Messenger(); - Message_Msg Msg22("XSTEP_22"); - // Sending of message : reading of entity failed - Msg22.Arg(themodel->StringLabel(anent)->String()); - TF->Send (Msg22, Message_Info); - } -// .. Chargement proprement dit : Specifique de la Norme .. - AnalyseRecord(num,anent,ach); - -// .. Ajout dans le modele de l entite telle quelle .. -// ATTENTION, ReportEntity traitee en bloc apres les Load - themodel->AddEntity(anent); - -// Erreur ou Correction : On cree une ReportEntity qui memorise le Check, -// l Entite, et en cas d Erreur une UndefinedEntity pour les Parametres - -// On exploite ici le flag IsLoadError : s il a ete defini (a vrai ou faux) -// il a priorite sur les fails du check. Sinon, ce sont les fails qui parlent - - Standard_Integer nbf = ach->NbFails(); - Standard_Integer nbw = ach->NbWarnings(); - if (nbf + nbw > 0) { - //Standard_Integer n0; svv #2 - themodel->NbEntities(); - rep = new Interface_ReportEntity(ach,anent); - if (irep == 0) { - if (thereports.IsNull()) thereports = - new TColStd_HArray1OfTransient (1,thereader->NbRecords()); - irep = num; - thenbreps ++; - } - thereports->SetValue(irep,rep); - - if ( thetrace >= 2) - ach->Print (Messenger(),2); - } - -// Rechargement ? si oui, dans une UnknownEntity fournie par le protocole - if (thereader->IsErrorLoad()) nbf = (thereader->ResetErrorLoad() ? 1 : 0); - if (nbf > 0) { - Handle(Standard_Transient) undef = theproto->UnknownEntity(); - AnalyseRecord(num,undef,ach); - rep->SetContent(undef); - } - - return anent; -} - - //======================================================================= //function : RecognizeByLib //purpose : diff --git a/src/Interface/Interface_FileReaderTool.hxx b/src/Interface/Interface_FileReaderTool.hxx index 997089d4c8..306a7d103f 100644 --- a/src/Interface/Interface_FileReaderTool.hxx +++ b/src/Interface/Interface_FileReaderTool.hxx @@ -23,7 +23,6 @@ #include #include -#include class Interface_Protocol; class Interface_FileReaderData; class Interface_InterfaceModel; @@ -57,43 +56,11 @@ public: theproto = protocol; } - //! Returns the Protocol given at creation time - const Handle(Interface_Protocol) & Protocol() const { return theproto; } - - //! Returns the FileReaderData which is used to work - const Handle(Interface_FileReaderData) & Data() const { return thereader; } - - //! Stores a Model. Used when the Model has been loaded - void SetModel (const Handle(Interface_InterfaceModel)& amodel) { themodel = amodel; } - - //! Returns the stored Model - const Handle(Interface_InterfaceModel) & Model() const { return themodel; } - - //! Sets Messenger used for outputting messages - Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& messenger); - //! Returns Messenger used for outputting messages. //! The returned object is guaranteed to be non-null; //! default is Message::Messenger(). const Handle(Message_Messenger) & Messenger() const { return themessenger; } - //! Sets trace level used for outputting messages - //! - 0: no trace at all - //! - 1: errors - //! - 2: errors and warnings - //! - 3: all messages - //! Default is 1 : Errors traced - void SetTraceLevel (const Standard_Integer tracelev) { thetrace = tracelev; } - - //! Returns trace level used for outputting messages. - Standard_Integer TraceLevel() const { return thetrace; } - - //! Fills records with empty entities; once done, each entity can - //! ask the FileReaderTool for any entity referenced through an - //! identifier. Calls Recognize which is specific to each specific - //! type of FileReaderTool - Standard_EXPORT void SetEntities(); - //! Reads and fills Entities from the FileReaderData set by //! SetData to an InterfaceModel. //! It enchains required operations, the specific ones correspond @@ -103,24 +70,30 @@ public: //! It Can raise any error which can occur during a load //! operation, unless Error Handling is set. //! This method can also be redefined if judged necessary. - Standard_EXPORT void LoadModel (const Handle(Interface_InterfaceModel)& amodel); - - //! Reads, Fills and Returns one Entity read from a Record of the - //! FileReaderData. This Method manages also case of Fail or - //! Warning, by producing a ReportEntyty plus , for a Fail, a - //! literal Content (as an UnknownEntity). Performs also Trace - Standard_EXPORT Handle(Standard_Transient) LoadedEntity (const Standard_Integer num); + Standard_EXPORT virtual void LoadModel (const Handle(Interface_InterfaceModel)& amodel); protected: //! Constructor; sets default fields Standard_EXPORT Interface_FileReaderTool(const Handle(Interface_Protocol)& protocol); + //! Fills records with empty entities; once done, each entity can + //! ask the FileReaderTool for any entity referenced through an + //! identifier. Calls Recognize which is specific to each specific + //! type of FileReaderTool + //Standard_EXPORT void SetEntities(); + //! Recognizes a record with the help of Libraries. Can be used //! to implement the method Recognize. //! is the result //! Returns False if recognition has failed, True else Standard_EXPORT Standard_Boolean RecognizeByLib (const Standard_Integer num, Handle(Standard_Transient)& ent) const; + + //! binds empty entities to records, works with the Protocol + //! (from IGESData) stored and later used + //! RQ : Actually, sets DNum into IGES Entities + //! Also loads the list of parameters for ParamReader + Standard_EXPORT virtual void Prepare () = 0; //! Recognizes a record, given its number. Specific to each //! Interface; called by SetEntities. It can call the basic method @@ -166,10 +139,6 @@ public: Handle(Interface_FileReaderData) thereader; Handle(Interface_InterfaceModel) themodel; Handle(Message_Messenger) themessenger; - Standard_Integer thetrace; - Standard_Integer thenbrep0; - Standard_Integer thenbreps; - Handle(TColStd_HArray1OfTransient) thereports; }; #endif // _Interface_FileReaderTool_HeaderFile diff --git a/src/Interface/Interface_Pointer.hxx b/src/Interface/Interface_Pointer.hxx new file mode 100644 index 0000000000..4e2069aea2 --- /dev/null +++ b/src/Interface/Interface_Pointer.hxx @@ -0,0 +1,65 @@ +// Created: 2016-09-08 +// Created by: Sergey ZERCHANINOV +// Copyright (c) 2001-2016 OPEN CASCADE SAS +// +// This file is part of commercial software by OPEN CASCADE SAS. +// +// This software is furnished in accordance with the terms and conditions +// of the contract and with the inclusion of this copyright notice. +// This software or any other copy thereof may not be provided or otherwise +// be made available to any third party. +// No ownership title to the software is transferred hereby. +// +// OPEN CASCADE SAS makes no representation or warranties with respect to the +// performance of this software, and specifically disclaims any responsibility +// for any damages, special or consequential, connected with its use. + +#ifndef _Interface_Pointer_HeaderFile +#define _Interface_Pointer_HeaderFile + +#include + +//! Root class for pointer fields +class Interface_PointerBase +{ + public: + + //! Default constructor + Interface_PointerBase() {} + + //! Sets the entity of this pointer + Standard_EXPORT virtual void SetEntity(const Handle(Standard_Transient) &) = 0; + + //! Gets the entity of this pointer + Standard_EXPORT virtual const Handle(Standard_Transient) & GetEntity() const = 0; +}; + +//! Template class for pointer fields +template +class Interface_Pointer : public Interface_PointerBase, public Handle(TheItemType) +{ + public: + + DEFINE_STANDARD_ALLOC + + //! Default constructor + Interface_Pointer() {} + + //! Constructor from handle + Interface_Pointer(const Handle(TheItemType)& theHandle) : Handle(TheItemType)(theHandle) {} + + //! Constructor from pointer + Interface_Pointer(TheItemType* thePointer) : Handle(TheItemType)(thePointer) {} + + //! Sets the entity of this pointer + Standard_EXPORT virtual void SetEntity(const Handle(Standard_Transient) &) Standard_OVERRIDE; + + //! Gets the entity of this pointer + Standard_EXPORT virtual const Handle(Standard_Transient) & GetEntity() const Standard_OVERRIDE; +}; + +#define IMPLEMENT_INTERFACE_POINTER(C1) \ +void Interface_Pointer::SetEntity(const Handle(Standard_Transient) &theEntity) { *this = Handle(C1)::DownCast(theEntity); } \ +const Handle(Standard_Transient) & Interface_Pointer::GetEntity() const { return *this; } + +#endif diff --git a/src/StepData/StepData_StepReaderTool.cxx b/src/StepData/StepData_StepReaderTool.cxx index 80fc4cca56..06f790ad42 100644 --- a/src/StepData/StepData_StepReaderTool.cxx +++ b/src/StepData/StepData_StepReaderTool.cxx @@ -54,11 +54,11 @@ void StepData_StepReaderTool::Prepare () Standard_Integer i = 0; // Reconnaissance des types - DeclareAndCast(StepData_StepReaderData,stepdat,Data()); + DeclareAndCast(StepData_StepReaderData,stepdat,thereader); while ( (i = stepdat->FindNextHeaderRecord(i)) != 0) { Handle(Standard_Transient) ent; RecognizeByLib (i,ent); - if (ent.IsNull()) ent = Protocol()->UnknownEntity(); + if (ent.IsNull()) ent = theproto->UnknownEntity(); stepdat->BindEntity(i,ent); } @@ -70,7 +70,6 @@ void StepData_StepReaderTool::Prepare () try { OCC_CATCH_SIGNALS stepdat->SetEntityNumbers(Standard_True); - SetEntities(); } catch(Standard_Failure) { const Handle(Message_Messenger) &sout = Message::DefaultMessenger(); @@ -104,7 +103,7 @@ void StepData_StepReaderTool::BeginRead (const Handle(Interface_InterfaceModel)& { Handle(Message_Messenger) sout = Message::DefaultMessenger(); DeclareAndCast(StepData_StepModel,model,amodel); - DeclareAndCast(StepData_StepReaderData,stepdat,Data()); + DeclareAndCast(StepData_StepReaderData,stepdat,thereader); model->ClearHeader(); model->SetGlobalCheck(stepdat->GlobalCheck()); @@ -153,7 +152,7 @@ Standard_Boolean StepData_StepReaderTool::AnalyseRecord const Handle(Standard_Transient)& anent, Handle(Interface_Check)& acheck) { - DeclareAndCast(StepData_StepReaderData,stepdat,Data()); + DeclareAndCast(StepData_StepReaderData,stepdat,thereader); Handle(Interface_ReaderModule) imodule; Standard_Integer CN; if (therlib.Select(anent,imodule,CN)) @@ -180,7 +179,7 @@ Standard_Boolean StepData_StepReaderTool::AnalyseRecord void StepData_StepReaderTool::EndRead (const Handle(Interface_InterfaceModel)& amodel) { - DeclareAndCast(StepData_StepReaderData,stepdat,Data()); + DeclareAndCast(StepData_StepReaderData,stepdat,thereader); DeclareAndCast(StepData_StepModel,stepmodel,amodel); if (stepmodel.IsNull()) return; Standard_Integer i = 0; diff --git a/src/StepData/StepData_StepReaderTool.hxx b/src/StepData/StepData_StepReaderTool.hxx index f322ecfff7..105892af02 100644 --- a/src/StepData/StepData_StepReaderTool.hxx +++ b/src/StepData/StepData_StepReaderTool.hxx @@ -41,15 +41,15 @@ class StepData_StepReaderTool : public Interface_FileReaderTool //! creates StepReaderTool to work with a StepReaderData according //! to a Step Protocol. Defines the ReaderLib at this time Standard_EXPORT StepData_StepReaderTool(const Handle(StepData_StepReaderData)& reader, const Handle(StepData_Protocol)& protocol); + + private: //! Bounds empty entities and sub-lists to header records //! Bounds empty entities to records //! works like Prepare + SetEntityNumbers, but for header //! (N.B.: in Header, no Ident and no reference) //! Then works only on data entities - Standard_EXPORT void Prepare (); - - private: + Standard_EXPORT virtual void Prepare () Standard_OVERRIDE; //! recognizes records, by asking ReaderLib. Standard_EXPORT virtual Standard_Boolean Recognize (const Standard_Integer num, Handle(Standard_Transient)& ent) Standard_OVERRIDE; diff --git a/src/StepFile/StepFile_Read.cxx b/src/StepFile/StepFile_Read.cxx index b6a55bfa37..a4e0f368d2 100644 --- a/src/StepFile/StepFile_Read.cxx +++ b/src/StepFile/StepFile_Read.cxx @@ -158,13 +158,6 @@ Standard_Integer StepFile_Read // Analyse : par StepReaderTool StepData_StepReaderTool readtool (undirec,protocol); - readtool.Prepare(); - -#ifdef CHRONOMESURE - sout << " ... Parameters prepared ... "; - c.Show(); -#endif - readtool.LoadModel(stepmodel); if (stepmodel->Protocol().IsNull()) stepmodel->SetProtocol (protocol); lir_file_fin(2); -- 2.39.5