From 2b5410a946c5c84c0ef5cb0594f39d0182ffabcb Mon Sep 17 00:00:00 2001 From: dpasukhi Date: Fri, 27 Jan 2023 23:26:45 +0000 Subject: [PATCH] starting of hell --- dox/user_guides/iges/iges.md | 10 +- dox/user_guides/step/step.md | 14 +- dox/user_guides/xde/xde.md | 8 +- .../APIHeaderSection_EditHeader.cxx | 186 - .../APIHeaderSection_EditHeader.hxx | 76 - src/APIHeaderSection/FILES | 4 - .../DE_DataModel.cxx} | 0 .../DE_DataModel.hxx} | 0 src/DE/DE_InterfaceParameters.cxx | 435 ++ src/DE/DE_InterfaceParameters.hxx | 291 + .../DE_ReturnStatus.hxx} | 12 +- src/DE/DE_WorkSession.cxx | 502 ++ src/DE/DE_WorkSession.hxx | 190 + src/DE/FILES | 7 + src/HeaderSection/FILES | 2 + .../HeaderSection_MakeHeader.cxx} | 94 +- .../HeaderSection_MakeHeader.hxx} | 12 +- src/IFGraph/FILES | 22 - src/IFGraph/IFGraph_AllConnected.cxx | 52 - src/IFGraph/IFGraph_AllConnected.hxx | 85 - src/IFGraph/IFGraph_AllShared.cxx | 47 - src/IFGraph/IFGraph_AllShared.hxx | 85 - src/IFGraph/IFGraph_Articulations.cxx | 82 - src/IFGraph/IFGraph_Articulations.hxx | 75 - src/IFGraph/IFGraph_Compare.cxx | 78 - src/IFGraph/IFGraph_Compare.hxx | 105 - src/IFGraph/IFGraph_ConnectedComponants.cxx | 44 - src/IFGraph/IFGraph_ConnectedComponants.hxx | 44 - src/IFGraph/IFGraph_Cumulate.cxx | 107 - src/IFGraph/IFGraph_Cumulate.hxx | 100 - src/IFGraph/IFGraph_Cycles.cxx | 39 - src/IFGraph/IFGraph_Cycles.hxx | 73 - src/IFGraph/IFGraph_ExternalSources.cxx | 64 - src/IFGraph/IFGraph_ExternalSources.hxx | 84 - src/IFGraph/IFGraph_SCRoots.cxx | 69 - src/IFGraph/IFGraph_SCRoots.hxx | 69 - src/IFGraph/IFGraph_StrongComponants.cxx | 34 - src/IFGraph/IFGraph_StrongComponants.hxx | 69 - src/IFGraph/IFGraph_SubPartsIterator.cxx | 254 - src/IFGraph/IFGraph_SubPartsIterator.hxx | 180 - src/IFSelect/FILES | 159 - src/IFSelect/IFSelect.cxx | 33 - src/IFSelect/IFSelect.hxx | 60 - src/IFSelect/IFSelect_AppliedModifiers.cxx | 74 - src/IFSelect/IFSelect_AppliedModifiers.hxx | 110 - src/IFSelect/IFSelect_BasicDumper.cxx | 188 - src/IFSelect/IFSelect_BasicDumper.hxx | 75 - src/IFSelect/IFSelect_CheckCounter.cxx | 99 - src/IFSelect/IFSelect_CheckCounter.hxx | 85 - src/IFSelect/IFSelect_ContextModif.cxx | 464 -- src/IFSelect/IFSelect_ContextModif.hxx | 218 - src/IFSelect/IFSelect_ContextWrite.cxx | 297 -- src/IFSelect/IFSelect_ContextWrite.hxx | 181 - src/IFSelect/IFSelect_DispGlobal.cxx | 41 - src/IFSelect/IFSelect_DispGlobal.hxx | 78 - src/IFSelect/IFSelect_DispPerCount.cxx | 80 - src/IFSelect/IFSelect_DispPerCount.hxx | 92 - src/IFSelect/IFSelect_DispPerFiles.cxx | 83 - src/IFSelect/IFSelect_DispPerFiles.hxx | 96 - src/IFSelect/IFSelect_DispPerOne.cxx | 47 - src/IFSelect/IFSelect_DispPerOne.hxx | 78 - src/IFSelect/IFSelect_DispPerSignature.cxx | 80 - src/IFSelect/IFSelect_DispPerSignature.hxx | 92 - src/IFSelect/IFSelect_Dispatch.cxx | 83 - src/IFSelect/IFSelect_Dispatch.hxx | 151 - src/IFSelect/IFSelect_EditForm.cxx | 546 -- src/IFSelect/IFSelect_EditForm.hxx | 294 -- src/IFSelect/IFSelect_EditValue.hxx | 37 - src/IFSelect/IFSelect_Editor.cxx | 230 - src/IFSelect/IFSelect_Editor.hxx | 195 - src/IFSelect/IFSelect_FileModifier.gxx | 19 - src/IFSelect/IFSelect_GeneralModifier.cxx | 56 - src/IFSelect/IFSelect_GeneralModifier.hxx | 121 - src/IFSelect/IFSelect_GraphCounter.cxx | 66 - src/IFSelect/IFSelect_GraphCounter.hxx | 82 - src/IFSelect/IFSelect_HSeqOfSelection.hxx | 26 - src/IFSelect/IFSelect_IntParam.cxx | 40 - src/IFSelect/IFSelect_IntParam.hxx | 84 - src/IFSelect/IFSelect_ListEditor.cxx | 210 - src/IFSelect/IFSelect_ListEditor.hxx | 152 - src/IFSelect/IFSelect_ModelCopier.cxx | 531 -- src/IFSelect/IFSelect_ModelCopier.hxx | 260 - src/IFSelect/IFSelect_ModelModifier.gxx | 41 - src/IFSelect/IFSelect_ModifEditForm.cxx | 56 - src/IFSelect/IFSelect_ModifEditForm.hxx | 78 - src/IFSelect/IFSelect_ModifReorder.cxx | 46 - src/IFSelect/IFSelect_ModifReorder.hxx | 82 - src/IFSelect/IFSelect_Modifier.cxx | 25 - src/IFSelect/IFSelect_Modifier.hxx | 86 - src/IFSelect/IFSelect_PacketList.cxx | 144 - src/IFSelect/IFSelect_PacketList.hxx | 130 - src/IFSelect/IFSelect_ParamEditor.cxx | 106 - src/IFSelect/IFSelect_ParamEditor.hxx | 86 - src/IFSelect/IFSelect_PrintCount.hxx | 61 - src/IFSelect/IFSelect_RemainMode.hxx | 29 - src/IFSelect/IFSelect_SelectAnyList.cxx | 111 - src/IFSelect/IFSelect_SelectAnyList.hxx | 153 - src/IFSelect/IFSelect_SelectAnyType.cxx | 25 - src/IFSelect/IFSelect_SelectAnyType.hxx | 52 - src/IFSelect/IFSelect_SelectBase.cxx | 23 - src/IFSelect/IFSelect_SelectBase.hxx | 65 - src/IFSelect/IFSelect_SelectCombine.cxx | 68 - src/IFSelect/IFSelect_SelectCombine.hxx | 103 - src/IFSelect/IFSelect_SelectControl.cxx | 45 - src/IFSelect/IFSelect_SelectControl.hxx | 95 - src/IFSelect/IFSelect_SelectDeduct.cxx | 61 - src/IFSelect/IFSelect_SelectDeduct.hxx | 108 - src/IFSelect/IFSelect_SelectDiff.cxx | 41 - src/IFSelect/IFSelect_SelectDiff.hxx | 76 - src/IFSelect/IFSelect_SelectEntityNumber.cxx | 52 - src/IFSelect/IFSelect_SelectEntityNumber.hxx | 66 - src/IFSelect/IFSelect_SelectErrorEntities.cxx | 32 - src/IFSelect/IFSelect_SelectErrorEntities.hxx | 77 - src/IFSelect/IFSelect_SelectExplore.cxx | 103 - src/IFSelect/IFSelect_SelectExplore.hxx | 115 - src/IFSelect/IFSelect_SelectExtract.cxx | 64 - src/IFSelect/IFSelect_SelectExtract.hxx | 110 - src/IFSelect/IFSelect_SelectFlag.cxx | 61 - src/IFSelect/IFSelect_SelectFlag.hxx | 92 - src/IFSelect/IFSelect_SelectInList.cxx | 31 - src/IFSelect/IFSelect_SelectInList.hxx | 80 - .../IFSelect_SelectIncorrectEntities.cxx | 24 - .../IFSelect_SelectIncorrectEntities.hxx | 66 - src/IFSelect/IFSelect_SelectIntersection.cxx | 44 - src/IFSelect/IFSelect_SelectIntersection.hxx | 73 - src/IFSelect/IFSelect_SelectModelEntities.cxx | 35 - src/IFSelect/IFSelect_SelectModelEntities.hxx | 77 - src/IFSelect/IFSelect_SelectModelRoots.cxx | 30 - src/IFSelect/IFSelect_SelectModelRoots.hxx | 75 - src/IFSelect/IFSelect_SelectPointed.cxx | 188 - src/IFSelect/IFSelect_SelectPointed.hxx | 149 - src/IFSelect/IFSelect_SelectRange.cxx | 92 - src/IFSelect/IFSelect_SelectRange.hxx | 93 - src/IFSelect/IFSelect_SelectRootComps.cxx | 74 - src/IFSelect/IFSelect_SelectRootComps.hxx | 72 - src/IFSelect/IFSelect_SelectRoots.cxx | 61 - src/IFSelect/IFSelect_SelectRoots.hxx | 66 - src/IFSelect/IFSelect_SelectSent.cxx | 78 - src/IFSelect/IFSelect_SelectSent.hxx | 114 - src/IFSelect/IFSelect_SelectShared.cxx | 40 - src/IFSelect/IFSelect_SelectShared.hxx | 73 - src/IFSelect/IFSelect_SelectSharing.cxx | 40 - src/IFSelect/IFSelect_SelectSharing.hxx | 75 - src/IFSelect/IFSelect_SelectSignature.cxx | 171 - src/IFSelect/IFSelect_SelectSignature.hxx | 128 - src/IFSelect/IFSelect_SelectSignedShared.cxx | 71 - src/IFSelect/IFSelect_SelectSignedShared.hxx | 94 - src/IFSelect/IFSelect_SelectSignedSharing.cxx | 71 - src/IFSelect/IFSelect_SelectSignedSharing.hxx | 94 - src/IFSelect/IFSelect_SelectSuite.cxx | 84 - src/IFSelect/IFSelect_SelectSuite.hxx | 121 - src/IFSelect/IFSelect_SelectType.cxx | 35 - src/IFSelect/IFSelect_SelectType.hxx | 80 - src/IFSelect/IFSelect_SelectUnion.cxx | 38 - src/IFSelect/IFSelect_SelectUnion.hxx | 73 - .../IFSelect_SelectUnknownEntities.cxx | 31 - .../IFSelect_SelectUnknownEntities.hxx | 74 - src/IFSelect/IFSelect_Selection.cxx | 53 - src/IFSelect/IFSelect_Selection.hxx | 83 - src/IFSelect/IFSelect_SelectionIterator.cxx | 54 - src/IFSelect/IFSelect_SelectionIterator.hxx | 71 - .../IFSelect_SequenceOfAppliedModifiers.hxx | 26 - .../IFSelect_SequenceOfGeneralModifier.hxx | 26 - .../IFSelect_SequenceOfInterfaceModel.hxx | 26 - src/IFSelect/IFSelect_SessionDumper.cxx | 41 - src/IFSelect/IFSelect_SessionDumper.hxx | 119 - src/IFSelect/IFSelect_SessionFile.cxx | 883 ---- src/IFSelect/IFSelect_SessionFile.hxx | 288 - src/IFSelect/IFSelect_ShareOut.cxx | 352 -- src/IFSelect/IFSelect_ShareOut.hxx | 239 - src/IFSelect/IFSelect_ShareOutResult.cxx | 218 - src/IFSelect/IFSelect_ShareOutResult.hxx | 166 - src/IFSelect/IFSelect_SignAncestor.cxx | 40 - src/IFSelect/IFSelect_SignAncestor.hxx | 65 - src/IFSelect/IFSelect_SignCategory.cxx | 41 - src/IFSelect/IFSelect_SignCategory.hxx | 68 - src/IFSelect/IFSelect_SignCounter.cxx | 163 - src/IFSelect/IFSelect_SignCounter.hxx | 166 - src/IFSelect/IFSelect_SignMultiple.cxx | 76 - src/IFSelect/IFSelect_SignMultiple.hxx | 91 - src/IFSelect/IFSelect_SignType.cxx | 44 - src/IFSelect/IFSelect_SignType.hxx | 73 - src/IFSelect/IFSelect_SignValidity.cxx | 80 - src/IFSelect/IFSelect_SignValidity.hxx | 76 - src/IFSelect/IFSelect_Signature.cxx | 126 - src/IFSelect/IFSelect_Signature.hxx | 126 - src/IFSelect/IFSelect_SignatureList.cxx | 248 - src/IFSelect/IFSelect_SignatureList.hxx | 164 - src/IFSelect/IFSelect_TSeqOfDispatch.hxx | 26 - src/IFSelect/IFSelect_TSeqOfSelection.hxx | 26 - src/IFSelect/IFSelect_TransformStandard.cxx | 214 - src/IFSelect/IFSelect_TransformStandard.hxx | 160 - src/IFSelect/IFSelect_Transformer.cxx | 28 - src/IFSelect/IFSelect_Transformer.hxx | 100 - src/IFSelect/IFSelect_WorkSession.hxx | 1116 ---- .../IGESCAFControl_Provider.cxx | 10 +- src/IGESCAFControl/IGESCAFControl_Reader.cxx | 2 +- src/IGESCAFControl/IGESCAFControl_Writer.cxx | 4 +- src/IGESControl/IGESControl_Controller.cxx | 210 +- src/IGESControl/IGESControl_Controller.hxx | 6 +- src/IGESSelect/FILES | 90 - src/IGESSelect/IGESSelect_AddFileComment.cxx | 69 - src/IGESSelect/IGESSelect_AddFileComment.hxx | 98 - src/IGESSelect/IGESSelect_AddGroup.cxx | 65 - src/IGESSelect/IGESSelect_AddGroup.hxx | 74 - src/IGESSelect/IGESSelect_AutoCorrect.cxx | 55 - src/IGESSelect/IGESSelect_AutoCorrect.hxx | 95 - src/IGESSelect/IGESSelect_ChangeLevelList.cxx | 105 - src/IGESSelect/IGESSelect_ChangeLevelList.hxx | 119 - .../IGESSelect_ChangeLevelNumber.cxx | 91 - .../IGESSelect_ChangeLevelNumber.hxx | 110 - src/IGESSelect/IGESSelect_ComputeStatus.cxx | 50 - src/IGESSelect/IGESSelect_ComputeStatus.hxx | 82 - .../IGESSelect_CounterOfLevelNumber.cxx | 139 - .../IGESSelect_CounterOfLevelNumber.hxx | 109 - src/IGESSelect/IGESSelect_DispPerDrawing.cxx | 73 - src/IGESSelect/IGESSelect_DispPerDrawing.hxx | 87 - .../IGESSelect_DispPerSingleView.cxx | 73 - .../IGESSelect_DispPerSingleView.hxx | 87 - src/IGESSelect/IGESSelect_Dumper.cxx | 281 - src/IGESSelect/IGESSelect_Dumper.hxx | 75 - src/IGESSelect/IGESSelect_EditDirPart.cxx | 418 -- src/IGESSelect/IGESSelect_EditDirPart.hxx | 80 - src/IGESSelect/IGESSelect_EditHeader.cxx | 370 -- src/IGESSelect/IGESSelect_EditHeader.hxx | 80 - src/IGESSelect/IGESSelect_FileModifier.hxx | 75 - src/IGESSelect/IGESSelect_FileModifier_0.cxx | 39 - src/IGESSelect/IGESSelect_FloatFormat.cxx | 110 - src/IGESSelect/IGESSelect_FloatFormat.hxx | 117 - src/IGESSelect/IGESSelect_IGESName.cxx | 42 - src/IGESSelect/IGESSelect_IGESName.hxx | 73 - src/IGESSelect/IGESSelect_IGESTypeForm.cxx | 61 - src/IGESSelect/IGESSelect_IGESTypeForm.hxx | 82 - src/IGESSelect/IGESSelect_ModelModifier.hxx | 86 - src/IGESSelect/IGESSelect_ModelModifier_0.cxx | 47 - src/IGESSelect/IGESSelect_RebuildDrawings.cxx | 177 - src/IGESSelect/IGESSelect_RebuildDrawings.hxx | 82 - src/IGESSelect/IGESSelect_RebuildGroups.cxx | 135 - src/IGESSelect/IGESSelect_RebuildGroups.hxx | 82 - src/IGESSelect/IGESSelect_RemoveCurves.cxx | 130 - src/IGESSelect/IGESSelect_RemoveCurves.hxx | 77 - src/IGESSelect/IGESSelect_SelectBasicGeom.cxx | 214 - src/IGESSelect/IGESSelect_SelectBasicGeom.hxx | 103 - .../IGESSelect_SelectBypassGroup.cxx | 48 - .../IGESSelect_SelectBypassGroup.hxx | 82 - .../IGESSelect_SelectBypassSubfigure.cxx | 87 - .../IGESSelect_SelectBypassSubfigure.hxx | 88 - .../IGESSelect_SelectDrawingFrom.cxx | 49 - .../IGESSelect_SelectDrawingFrom.hxx | 78 - src/IGESSelect/IGESSelect_SelectFaces.cxx | 100 - src/IGESSelect/IGESSelect_SelectFaces.hxx | 82 - .../IGESSelect_SelectFromDrawing.cxx | 62 - .../IGESSelect_SelectFromDrawing.hxx | 75 - .../IGESSelect_SelectFromSingleView.cxx | 48 - .../IGESSelect_SelectFromSingleView.hxx | 75 - .../IGESSelect_SelectLevelNumber.cxx | 72 - .../IGESSelect_SelectLevelNumber.hxx | 93 - src/IGESSelect/IGESSelect_SelectName.cxx | 73 - src/IGESSelect/IGESSelect_SelectName.hxx | 87 - src/IGESSelect/IGESSelect_SelectPCurves.cxx | 149 - src/IGESSelect/IGESSelect_SelectPCurves.hxx | 81 - .../IGESSelect_SelectSingleViewFrom.cxx | 49 - .../IGESSelect_SelectSingleViewFrom.hxx | 78 - .../IGESSelect_SelectSubordinate.cxx | 56 - .../IGESSelect_SelectSubordinate.hxx | 92 - .../IGESSelect_SelectVisibleStatus.cxx | 40 - .../IGESSelect_SelectVisibleStatus.hxx | 74 - .../IGESSelect_SetGlobalParameter.cxx | 78 - .../IGESSelect_SetGlobalParameter.hxx | 99 - src/IGESSelect/IGESSelect_SetLabel.cxx | 68 - src/IGESSelect/IGESSelect_SetLabel.hxx | 83 - src/IGESSelect/IGESSelect_SetVersion5.cxx | 45 - src/IGESSelect/IGESSelect_SetVersion5.hxx | 80 - src/IGESSelect/IGESSelect_SignColor.cxx | 162 - src/IGESSelect/IGESSelect_SignColor.hxx | 82 - src/IGESSelect/IGESSelect_SignLevelNumber.cxx | 74 - src/IGESSelect/IGESSelect_SignLevelNumber.hxx | 77 - src/IGESSelect/IGESSelect_SignStatus.cxx | 92 - src/IGESSelect/IGESSelect_SignStatus.hxx | 84 - src/IGESSelect/IGESSelect_SplineToBSpline.cxx | 88 - src/IGESSelect/IGESSelect_SplineToBSpline.hxx | 106 - .../IGESSelect_UpdateCreationDate.cxx | 58 - .../IGESSelect_UpdateCreationDate.hxx | 78 - src/IGESSelect/IGESSelect_UpdateFileName.cxx | 46 - src/IGESSelect/IGESSelect_UpdateFileName.hxx | 80 - .../IGESSelect_UpdateLastChange.cxx | 59 - .../IGESSelect_UpdateLastChange.hxx | 81 - src/IGESSelect/IGESSelect_ViewSorter.cxx | 217 - src/IGESSelect/IGESSelect_ViewSorter.hxx | 148 - src/IGESSelect/IGESSelect_WorkLibrary.cxx | 196 - src/IGESSelect/IGESSelect_WorkLibrary.hxx | 86 - .../STEPCAFControl_ExternFile.cxx | 4 +- .../STEPCAFControl_ExternFile.hxx | 14 +- .../STEPCAFControl_ExternFile.lxx | 8 +- .../STEPCAFControl_Provider.cxx | 30 +- src/STEPCAFControl/STEPCAFControl_Reader.cxx | 10 +- src/STEPCAFControl/STEPCAFControl_Reader.hxx | 6 +- src/STEPCAFControl/STEPCAFControl_Writer.cxx | 20 +- src/STEPCAFControl/STEPCAFControl_Writer.hxx | 4 +- .../STEPConstruct_ExternRefs.hxx | 2 + src/STEPConstruct/STEPConstruct_Styles.cxx | 4 +- .../STEPConstruct_ValidationProps.cxx | 4 +- src/STEPControl/STEPControl_Controller.cxx | 161 +- src/STEPControl/STEPControl_Controller.hxx | 6 +- src/STEPControl/STEPControl_Reader.cxx | 10 +- src/STEPControl/STEPControl_Reader.hxx | 91 +- src/STEPControl/STEPControl_Writer.cxx | 16 +- src/STEPControl/STEPControl_Writer.hxx | 8 +- src/STEPEdit/STEPEdit.cxx | 4 +- src/STEPSelections/FILES | 27 - .../STEPSelections_AssemblyComponent.cxx | 32 - .../STEPSelections_AssemblyComponent.hxx | 76 - .../STEPSelections_AssemblyComponent.lxx | 50 - .../STEPSelections_AssemblyExplorer.cxx | 189 - .../STEPSelections_AssemblyExplorer.hxx | 89 - .../STEPSelections_AssemblyExplorer.lxx | 35 - .../STEPSelections_AssemblyLink.cxx | 36 - .../STEPSelections_AssemblyLink.hxx | 81 - .../STEPSelections_AssemblyLink.lxx | 75 - src/STEPSelections/STEPSelections_Counter.cxx | 248 - src/STEPSelections/STEPSelections_Counter.hxx | 108 - src/STEPSelections/STEPSelections_Counter.lxx | 66 - ...STEPSelections_HSequenceOfAssemblyLink.hxx | 26 - .../STEPSelections_SelectAssembly.cxx | 95 - .../STEPSelections_SelectAssembly.hxx | 73 - .../STEPSelections_SelectDerived.cxx | 76 - .../STEPSelections_SelectDerived.hxx | 66 - .../STEPSelections_SelectFaces.cxx | 66 - .../STEPSelections_SelectFaces.hxx | 73 - .../STEPSelections_SelectForTransfer.cxx | 57 - .../STEPSelections_SelectForTransfer.hxx | 67 - .../STEPSelections_SelectGSCurves.cxx | 85 - .../STEPSelections_SelectGSCurves.hxx | 71 - .../STEPSelections_SelectInstances.cxx | 183 - .../STEPSelections_SelectInstances.hxx | 75 - ...Selections_SequenceOfAssemblyComponent.hxx | 26 - .../STEPSelections_SequenceOfAssemblyLink.hxx | 26 - src/StepSelect/FILES | 10 - src/StepSelect/StepSelect_FileModifier.hxx | 75 - src/StepSelect/StepSelect_FileModifier_0.cxx | 39 - src/StepSelect/StepSelect_FloatFormat.cxx | 98 - src/StepSelect/StepSelect_FloatFormat.hxx | 117 - src/StepSelect/StepSelect_ModelModifier.hxx | 87 - src/StepSelect/StepSelect_ModelModifier_0.cxx | 47 - src/StepSelect/StepSelect_StepType.cxx | 91 - src/StepSelect/StepSelect_StepType.hxx | 88 - src/StepSelect/StepSelect_WorkLibrary.cxx | 171 - src/StepSelect/StepSelect_WorkLibrary.hxx | 108 - src/TKXDEIGES/PACKAGES | 1 - src/TKXDESTEP/PACKAGES | 3 - src/TKXSBase/PACKAGES | 8 - src/XSControl/FILES | 5 + .../IFSelect_WorkLibrary.cxx | 0 .../IFSelect_WorkLibrary.hxx | 0 .../IFSelect_WorkSession.cxx | 69 +- src/XSControl/IFSelect_WorkSession.hxx | 228 + src/XSControl/XSControl_Controller.cxx | 180 +- src/XSControl/XSControl_Controller.hxx | 54 +- src/XSControl/XSControl_Reader.cxx | 8 +- src/XSControl/XSControl_Reader.hxx | 31 +- .../XSControl_ReturnStatus.hxx} | 28 +- src/XSControl/XSControl_TransferWriter.cxx | 20 +- src/XSControl/XSControl_TransferWriter.hxx | 6 +- src/XSControl/XSControl_WorkSession.cxx | 16 +- src/XSControl/XSControl_WorkSession.hxx | 3 +- src/XSControl/XSControl_Writer.cxx | 4 +- src/XSControl/XSControl_Writer.hxx | 6 +- src/XSDRAW/XSDRAW_FunctionsSession.cxx | 4668 ++++++++--------- src/XSDRAWIGES/XSDRAWIGES.cxx | 16 +- src/XSDRAWSTEP/XSDRAWSTEP.cxx | 38 +- tools/DFBrowser/DFBrowser_OpenApplication.cxx | 4 +- 371 files changed, 4309 insertions(+), 34963 deletions(-) delete mode 100644 src/APIHeaderSection/APIHeaderSection_EditHeader.cxx delete mode 100644 src/APIHeaderSection/APIHeaderSection_EditHeader.hxx delete mode 100644 src/APIHeaderSection/FILES rename src/{Interface/Interface_InterfaceModel.cxx => DE/DE_DataModel.cxx} (100%) rename src/{Interface/Interface_InterfaceModel.hxx => DE/DE_DataModel.hxx} (100%) create mode 100644 src/DE/DE_InterfaceParameters.cxx create mode 100644 src/DE/DE_InterfaceParameters.hxx rename src/{IFSelect/IFSelect_ReturnStatus.hxx => DE/DE_ReturnStatus.hxx} (90%) create mode 100644 src/DE/DE_WorkSession.cxx create mode 100644 src/DE/DE_WorkSession.hxx rename src/{APIHeaderSection/APIHeaderSection_MakeHeader.cxx => HeaderSection/HeaderSection_MakeHeader.cxx} (71%) rename src/{APIHeaderSection/APIHeaderSection_MakeHeader.hxx => HeaderSection/HeaderSection_MakeHeader.hxx} (95%) delete mode 100644 src/IFGraph/FILES delete mode 100644 src/IFGraph/IFGraph_AllConnected.cxx delete mode 100644 src/IFGraph/IFGraph_AllConnected.hxx delete mode 100644 src/IFGraph/IFGraph_AllShared.cxx delete mode 100644 src/IFGraph/IFGraph_AllShared.hxx delete mode 100644 src/IFGraph/IFGraph_Articulations.cxx delete mode 100644 src/IFGraph/IFGraph_Articulations.hxx delete mode 100644 src/IFGraph/IFGraph_Compare.cxx delete mode 100644 src/IFGraph/IFGraph_Compare.hxx delete mode 100644 src/IFGraph/IFGraph_ConnectedComponants.cxx delete mode 100644 src/IFGraph/IFGraph_ConnectedComponants.hxx delete mode 100644 src/IFGraph/IFGraph_Cumulate.cxx delete mode 100644 src/IFGraph/IFGraph_Cumulate.hxx delete mode 100644 src/IFGraph/IFGraph_Cycles.cxx delete mode 100644 src/IFGraph/IFGraph_Cycles.hxx delete mode 100644 src/IFGraph/IFGraph_ExternalSources.cxx delete mode 100644 src/IFGraph/IFGraph_ExternalSources.hxx delete mode 100644 src/IFGraph/IFGraph_SCRoots.cxx delete mode 100644 src/IFGraph/IFGraph_SCRoots.hxx delete mode 100644 src/IFGraph/IFGraph_StrongComponants.cxx delete mode 100644 src/IFGraph/IFGraph_StrongComponants.hxx delete mode 100644 src/IFGraph/IFGraph_SubPartsIterator.cxx delete mode 100644 src/IFGraph/IFGraph_SubPartsIterator.hxx delete mode 100755 src/IFSelect/FILES delete mode 100644 src/IFSelect/IFSelect.cxx delete mode 100644 src/IFSelect/IFSelect.hxx delete mode 100644 src/IFSelect/IFSelect_AppliedModifiers.cxx delete mode 100644 src/IFSelect/IFSelect_AppliedModifiers.hxx delete mode 100644 src/IFSelect/IFSelect_BasicDumper.cxx delete mode 100644 src/IFSelect/IFSelect_BasicDumper.hxx delete mode 100644 src/IFSelect/IFSelect_CheckCounter.cxx delete mode 100644 src/IFSelect/IFSelect_CheckCounter.hxx delete mode 100644 src/IFSelect/IFSelect_ContextModif.cxx delete mode 100644 src/IFSelect/IFSelect_ContextModif.hxx delete mode 100644 src/IFSelect/IFSelect_ContextWrite.cxx delete mode 100644 src/IFSelect/IFSelect_ContextWrite.hxx delete mode 100644 src/IFSelect/IFSelect_DispGlobal.cxx delete mode 100644 src/IFSelect/IFSelect_DispGlobal.hxx delete mode 100644 src/IFSelect/IFSelect_DispPerCount.cxx delete mode 100644 src/IFSelect/IFSelect_DispPerCount.hxx delete mode 100644 src/IFSelect/IFSelect_DispPerFiles.cxx delete mode 100644 src/IFSelect/IFSelect_DispPerFiles.hxx delete mode 100644 src/IFSelect/IFSelect_DispPerOne.cxx delete mode 100644 src/IFSelect/IFSelect_DispPerOne.hxx delete mode 100644 src/IFSelect/IFSelect_DispPerSignature.cxx delete mode 100644 src/IFSelect/IFSelect_DispPerSignature.hxx delete mode 100644 src/IFSelect/IFSelect_Dispatch.cxx delete mode 100644 src/IFSelect/IFSelect_Dispatch.hxx delete mode 100644 src/IFSelect/IFSelect_EditForm.cxx delete mode 100644 src/IFSelect/IFSelect_EditForm.hxx delete mode 100644 src/IFSelect/IFSelect_EditValue.hxx delete mode 100644 src/IFSelect/IFSelect_Editor.cxx delete mode 100644 src/IFSelect/IFSelect_Editor.hxx delete mode 100644 src/IFSelect/IFSelect_FileModifier.gxx delete mode 100644 src/IFSelect/IFSelect_GeneralModifier.cxx delete mode 100644 src/IFSelect/IFSelect_GeneralModifier.hxx delete mode 100644 src/IFSelect/IFSelect_GraphCounter.cxx delete mode 100644 src/IFSelect/IFSelect_GraphCounter.hxx delete mode 100644 src/IFSelect/IFSelect_HSeqOfSelection.hxx delete mode 100644 src/IFSelect/IFSelect_IntParam.cxx delete mode 100644 src/IFSelect/IFSelect_IntParam.hxx delete mode 100644 src/IFSelect/IFSelect_ListEditor.cxx delete mode 100644 src/IFSelect/IFSelect_ListEditor.hxx delete mode 100644 src/IFSelect/IFSelect_ModelCopier.cxx delete mode 100644 src/IFSelect/IFSelect_ModelCopier.hxx delete mode 100644 src/IFSelect/IFSelect_ModelModifier.gxx delete mode 100644 src/IFSelect/IFSelect_ModifEditForm.cxx delete mode 100644 src/IFSelect/IFSelect_ModifEditForm.hxx delete mode 100644 src/IFSelect/IFSelect_ModifReorder.cxx delete mode 100644 src/IFSelect/IFSelect_ModifReorder.hxx delete mode 100644 src/IFSelect/IFSelect_Modifier.cxx delete mode 100644 src/IFSelect/IFSelect_Modifier.hxx delete mode 100644 src/IFSelect/IFSelect_PacketList.cxx delete mode 100644 src/IFSelect/IFSelect_PacketList.hxx delete mode 100644 src/IFSelect/IFSelect_ParamEditor.cxx delete mode 100644 src/IFSelect/IFSelect_ParamEditor.hxx delete mode 100644 src/IFSelect/IFSelect_PrintCount.hxx delete mode 100644 src/IFSelect/IFSelect_RemainMode.hxx delete mode 100644 src/IFSelect/IFSelect_SelectAnyList.cxx delete mode 100644 src/IFSelect/IFSelect_SelectAnyList.hxx delete mode 100644 src/IFSelect/IFSelect_SelectAnyType.cxx delete mode 100644 src/IFSelect/IFSelect_SelectAnyType.hxx delete mode 100644 src/IFSelect/IFSelect_SelectBase.cxx delete mode 100644 src/IFSelect/IFSelect_SelectBase.hxx delete mode 100644 src/IFSelect/IFSelect_SelectCombine.cxx delete mode 100644 src/IFSelect/IFSelect_SelectCombine.hxx delete mode 100644 src/IFSelect/IFSelect_SelectControl.cxx delete mode 100644 src/IFSelect/IFSelect_SelectControl.hxx delete mode 100644 src/IFSelect/IFSelect_SelectDeduct.cxx delete mode 100644 src/IFSelect/IFSelect_SelectDeduct.hxx delete mode 100644 src/IFSelect/IFSelect_SelectDiff.cxx delete mode 100644 src/IFSelect/IFSelect_SelectDiff.hxx delete mode 100644 src/IFSelect/IFSelect_SelectEntityNumber.cxx delete mode 100644 src/IFSelect/IFSelect_SelectEntityNumber.hxx delete mode 100644 src/IFSelect/IFSelect_SelectErrorEntities.cxx delete mode 100644 src/IFSelect/IFSelect_SelectErrorEntities.hxx delete mode 100644 src/IFSelect/IFSelect_SelectExplore.cxx delete mode 100644 src/IFSelect/IFSelect_SelectExplore.hxx delete mode 100644 src/IFSelect/IFSelect_SelectExtract.cxx delete mode 100644 src/IFSelect/IFSelect_SelectExtract.hxx delete mode 100644 src/IFSelect/IFSelect_SelectFlag.cxx delete mode 100644 src/IFSelect/IFSelect_SelectFlag.hxx delete mode 100644 src/IFSelect/IFSelect_SelectInList.cxx delete mode 100644 src/IFSelect/IFSelect_SelectInList.hxx delete mode 100644 src/IFSelect/IFSelect_SelectIncorrectEntities.cxx delete mode 100644 src/IFSelect/IFSelect_SelectIncorrectEntities.hxx delete mode 100644 src/IFSelect/IFSelect_SelectIntersection.cxx delete mode 100644 src/IFSelect/IFSelect_SelectIntersection.hxx delete mode 100644 src/IFSelect/IFSelect_SelectModelEntities.cxx delete mode 100644 src/IFSelect/IFSelect_SelectModelEntities.hxx delete mode 100644 src/IFSelect/IFSelect_SelectModelRoots.cxx delete mode 100644 src/IFSelect/IFSelect_SelectModelRoots.hxx delete mode 100644 src/IFSelect/IFSelect_SelectPointed.cxx delete mode 100644 src/IFSelect/IFSelect_SelectPointed.hxx delete mode 100644 src/IFSelect/IFSelect_SelectRange.cxx delete mode 100644 src/IFSelect/IFSelect_SelectRange.hxx delete mode 100644 src/IFSelect/IFSelect_SelectRootComps.cxx delete mode 100644 src/IFSelect/IFSelect_SelectRootComps.hxx delete mode 100644 src/IFSelect/IFSelect_SelectRoots.cxx delete mode 100644 src/IFSelect/IFSelect_SelectRoots.hxx delete mode 100644 src/IFSelect/IFSelect_SelectSent.cxx delete mode 100644 src/IFSelect/IFSelect_SelectSent.hxx delete mode 100644 src/IFSelect/IFSelect_SelectShared.cxx delete mode 100644 src/IFSelect/IFSelect_SelectShared.hxx delete mode 100644 src/IFSelect/IFSelect_SelectSharing.cxx delete mode 100644 src/IFSelect/IFSelect_SelectSharing.hxx delete mode 100644 src/IFSelect/IFSelect_SelectSignature.cxx delete mode 100644 src/IFSelect/IFSelect_SelectSignature.hxx delete mode 100644 src/IFSelect/IFSelect_SelectSignedShared.cxx delete mode 100644 src/IFSelect/IFSelect_SelectSignedShared.hxx delete mode 100644 src/IFSelect/IFSelect_SelectSignedSharing.cxx delete mode 100644 src/IFSelect/IFSelect_SelectSignedSharing.hxx delete mode 100644 src/IFSelect/IFSelect_SelectSuite.cxx delete mode 100644 src/IFSelect/IFSelect_SelectSuite.hxx delete mode 100644 src/IFSelect/IFSelect_SelectType.cxx delete mode 100644 src/IFSelect/IFSelect_SelectType.hxx delete mode 100644 src/IFSelect/IFSelect_SelectUnion.cxx delete mode 100644 src/IFSelect/IFSelect_SelectUnion.hxx delete mode 100644 src/IFSelect/IFSelect_SelectUnknownEntities.cxx delete mode 100644 src/IFSelect/IFSelect_SelectUnknownEntities.hxx delete mode 100644 src/IFSelect/IFSelect_Selection.cxx delete mode 100644 src/IFSelect/IFSelect_Selection.hxx delete mode 100644 src/IFSelect/IFSelect_SelectionIterator.cxx delete mode 100644 src/IFSelect/IFSelect_SelectionIterator.hxx delete mode 100644 src/IFSelect/IFSelect_SequenceOfAppliedModifiers.hxx delete mode 100644 src/IFSelect/IFSelect_SequenceOfGeneralModifier.hxx delete mode 100644 src/IFSelect/IFSelect_SequenceOfInterfaceModel.hxx delete mode 100644 src/IFSelect/IFSelect_SessionDumper.cxx delete mode 100644 src/IFSelect/IFSelect_SessionDumper.hxx delete mode 100644 src/IFSelect/IFSelect_SessionFile.cxx delete mode 100644 src/IFSelect/IFSelect_SessionFile.hxx delete mode 100644 src/IFSelect/IFSelect_ShareOut.cxx delete mode 100644 src/IFSelect/IFSelect_ShareOut.hxx delete mode 100644 src/IFSelect/IFSelect_ShareOutResult.cxx delete mode 100644 src/IFSelect/IFSelect_ShareOutResult.hxx delete mode 100644 src/IFSelect/IFSelect_SignAncestor.cxx delete mode 100644 src/IFSelect/IFSelect_SignAncestor.hxx delete mode 100644 src/IFSelect/IFSelect_SignCategory.cxx delete mode 100644 src/IFSelect/IFSelect_SignCategory.hxx delete mode 100644 src/IFSelect/IFSelect_SignCounter.cxx delete mode 100644 src/IFSelect/IFSelect_SignCounter.hxx delete mode 100644 src/IFSelect/IFSelect_SignMultiple.cxx delete mode 100644 src/IFSelect/IFSelect_SignMultiple.hxx delete mode 100644 src/IFSelect/IFSelect_SignType.cxx delete mode 100644 src/IFSelect/IFSelect_SignType.hxx delete mode 100644 src/IFSelect/IFSelect_SignValidity.cxx delete mode 100644 src/IFSelect/IFSelect_SignValidity.hxx delete mode 100644 src/IFSelect/IFSelect_Signature.cxx delete mode 100644 src/IFSelect/IFSelect_Signature.hxx delete mode 100644 src/IFSelect/IFSelect_SignatureList.cxx delete mode 100644 src/IFSelect/IFSelect_SignatureList.hxx delete mode 100644 src/IFSelect/IFSelect_TSeqOfDispatch.hxx delete mode 100644 src/IFSelect/IFSelect_TSeqOfSelection.hxx delete mode 100644 src/IFSelect/IFSelect_TransformStandard.cxx delete mode 100644 src/IFSelect/IFSelect_TransformStandard.hxx delete mode 100644 src/IFSelect/IFSelect_Transformer.cxx delete mode 100644 src/IFSelect/IFSelect_Transformer.hxx delete mode 100644 src/IFSelect/IFSelect_WorkSession.hxx delete mode 100644 src/IGESSelect/FILES delete mode 100644 src/IGESSelect/IGESSelect_AddFileComment.cxx delete mode 100644 src/IGESSelect/IGESSelect_AddFileComment.hxx delete mode 100644 src/IGESSelect/IGESSelect_AddGroup.cxx delete mode 100644 src/IGESSelect/IGESSelect_AddGroup.hxx delete mode 100644 src/IGESSelect/IGESSelect_AutoCorrect.cxx delete mode 100644 src/IGESSelect/IGESSelect_AutoCorrect.hxx delete mode 100644 src/IGESSelect/IGESSelect_ChangeLevelList.cxx delete mode 100644 src/IGESSelect/IGESSelect_ChangeLevelList.hxx delete mode 100644 src/IGESSelect/IGESSelect_ChangeLevelNumber.cxx delete mode 100644 src/IGESSelect/IGESSelect_ChangeLevelNumber.hxx delete mode 100644 src/IGESSelect/IGESSelect_ComputeStatus.cxx delete mode 100644 src/IGESSelect/IGESSelect_ComputeStatus.hxx delete mode 100644 src/IGESSelect/IGESSelect_CounterOfLevelNumber.cxx delete mode 100644 src/IGESSelect/IGESSelect_CounterOfLevelNumber.hxx delete mode 100644 src/IGESSelect/IGESSelect_DispPerDrawing.cxx delete mode 100644 src/IGESSelect/IGESSelect_DispPerDrawing.hxx delete mode 100644 src/IGESSelect/IGESSelect_DispPerSingleView.cxx delete mode 100644 src/IGESSelect/IGESSelect_DispPerSingleView.hxx delete mode 100644 src/IGESSelect/IGESSelect_Dumper.cxx delete mode 100644 src/IGESSelect/IGESSelect_Dumper.hxx delete mode 100644 src/IGESSelect/IGESSelect_EditDirPart.cxx delete mode 100644 src/IGESSelect/IGESSelect_EditDirPart.hxx delete mode 100644 src/IGESSelect/IGESSelect_EditHeader.cxx delete mode 100644 src/IGESSelect/IGESSelect_EditHeader.hxx delete mode 100644 src/IGESSelect/IGESSelect_FileModifier.hxx delete mode 100644 src/IGESSelect/IGESSelect_FileModifier_0.cxx delete mode 100644 src/IGESSelect/IGESSelect_FloatFormat.cxx delete mode 100644 src/IGESSelect/IGESSelect_FloatFormat.hxx delete mode 100644 src/IGESSelect/IGESSelect_IGESName.cxx delete mode 100644 src/IGESSelect/IGESSelect_IGESName.hxx delete mode 100644 src/IGESSelect/IGESSelect_IGESTypeForm.cxx delete mode 100644 src/IGESSelect/IGESSelect_IGESTypeForm.hxx delete mode 100644 src/IGESSelect/IGESSelect_ModelModifier.hxx delete mode 100644 src/IGESSelect/IGESSelect_ModelModifier_0.cxx delete mode 100644 src/IGESSelect/IGESSelect_RebuildDrawings.cxx delete mode 100644 src/IGESSelect/IGESSelect_RebuildDrawings.hxx delete mode 100644 src/IGESSelect/IGESSelect_RebuildGroups.cxx delete mode 100644 src/IGESSelect/IGESSelect_RebuildGroups.hxx delete mode 100644 src/IGESSelect/IGESSelect_RemoveCurves.cxx delete mode 100644 src/IGESSelect/IGESSelect_RemoveCurves.hxx delete mode 100644 src/IGESSelect/IGESSelect_SelectBasicGeom.cxx delete mode 100644 src/IGESSelect/IGESSelect_SelectBasicGeom.hxx delete mode 100644 src/IGESSelect/IGESSelect_SelectBypassGroup.cxx delete mode 100644 src/IGESSelect/IGESSelect_SelectBypassGroup.hxx delete mode 100644 src/IGESSelect/IGESSelect_SelectBypassSubfigure.cxx delete mode 100644 src/IGESSelect/IGESSelect_SelectBypassSubfigure.hxx delete mode 100644 src/IGESSelect/IGESSelect_SelectDrawingFrom.cxx delete mode 100644 src/IGESSelect/IGESSelect_SelectDrawingFrom.hxx delete mode 100644 src/IGESSelect/IGESSelect_SelectFaces.cxx delete mode 100644 src/IGESSelect/IGESSelect_SelectFaces.hxx delete mode 100644 src/IGESSelect/IGESSelect_SelectFromDrawing.cxx delete mode 100644 src/IGESSelect/IGESSelect_SelectFromDrawing.hxx delete mode 100644 src/IGESSelect/IGESSelect_SelectFromSingleView.cxx delete mode 100644 src/IGESSelect/IGESSelect_SelectFromSingleView.hxx delete mode 100644 src/IGESSelect/IGESSelect_SelectLevelNumber.cxx delete mode 100644 src/IGESSelect/IGESSelect_SelectLevelNumber.hxx delete mode 100644 src/IGESSelect/IGESSelect_SelectName.cxx delete mode 100644 src/IGESSelect/IGESSelect_SelectName.hxx delete mode 100644 src/IGESSelect/IGESSelect_SelectPCurves.cxx delete mode 100644 src/IGESSelect/IGESSelect_SelectPCurves.hxx delete mode 100644 src/IGESSelect/IGESSelect_SelectSingleViewFrom.cxx delete mode 100644 src/IGESSelect/IGESSelect_SelectSingleViewFrom.hxx delete mode 100644 src/IGESSelect/IGESSelect_SelectSubordinate.cxx delete mode 100644 src/IGESSelect/IGESSelect_SelectSubordinate.hxx delete mode 100644 src/IGESSelect/IGESSelect_SelectVisibleStatus.cxx delete mode 100644 src/IGESSelect/IGESSelect_SelectVisibleStatus.hxx delete mode 100644 src/IGESSelect/IGESSelect_SetGlobalParameter.cxx delete mode 100644 src/IGESSelect/IGESSelect_SetGlobalParameter.hxx delete mode 100644 src/IGESSelect/IGESSelect_SetLabel.cxx delete mode 100644 src/IGESSelect/IGESSelect_SetLabel.hxx delete mode 100644 src/IGESSelect/IGESSelect_SetVersion5.cxx delete mode 100644 src/IGESSelect/IGESSelect_SetVersion5.hxx delete mode 100644 src/IGESSelect/IGESSelect_SignColor.cxx delete mode 100644 src/IGESSelect/IGESSelect_SignColor.hxx delete mode 100644 src/IGESSelect/IGESSelect_SignLevelNumber.cxx delete mode 100644 src/IGESSelect/IGESSelect_SignLevelNumber.hxx delete mode 100644 src/IGESSelect/IGESSelect_SignStatus.cxx delete mode 100644 src/IGESSelect/IGESSelect_SignStatus.hxx delete mode 100644 src/IGESSelect/IGESSelect_SplineToBSpline.cxx delete mode 100644 src/IGESSelect/IGESSelect_SplineToBSpline.hxx delete mode 100644 src/IGESSelect/IGESSelect_UpdateCreationDate.cxx delete mode 100644 src/IGESSelect/IGESSelect_UpdateCreationDate.hxx delete mode 100644 src/IGESSelect/IGESSelect_UpdateFileName.cxx delete mode 100644 src/IGESSelect/IGESSelect_UpdateFileName.hxx delete mode 100644 src/IGESSelect/IGESSelect_UpdateLastChange.cxx delete mode 100644 src/IGESSelect/IGESSelect_UpdateLastChange.hxx delete mode 100644 src/IGESSelect/IGESSelect_ViewSorter.cxx delete mode 100644 src/IGESSelect/IGESSelect_ViewSorter.hxx delete mode 100644 src/IGESSelect/IGESSelect_WorkLibrary.cxx delete mode 100644 src/IGESSelect/IGESSelect_WorkLibrary.hxx delete mode 100644 src/STEPSelections/FILES delete mode 100644 src/STEPSelections/STEPSelections_AssemblyComponent.cxx delete mode 100644 src/STEPSelections/STEPSelections_AssemblyComponent.hxx delete mode 100644 src/STEPSelections/STEPSelections_AssemblyComponent.lxx delete mode 100644 src/STEPSelections/STEPSelections_AssemblyExplorer.cxx delete mode 100644 src/STEPSelections/STEPSelections_AssemblyExplorer.hxx delete mode 100644 src/STEPSelections/STEPSelections_AssemblyExplorer.lxx delete mode 100644 src/STEPSelections/STEPSelections_AssemblyLink.cxx delete mode 100644 src/STEPSelections/STEPSelections_AssemblyLink.hxx delete mode 100644 src/STEPSelections/STEPSelections_AssemblyLink.lxx delete mode 100644 src/STEPSelections/STEPSelections_Counter.cxx delete mode 100644 src/STEPSelections/STEPSelections_Counter.hxx delete mode 100644 src/STEPSelections/STEPSelections_Counter.lxx delete mode 100644 src/STEPSelections/STEPSelections_HSequenceOfAssemblyLink.hxx delete mode 100644 src/STEPSelections/STEPSelections_SelectAssembly.cxx delete mode 100644 src/STEPSelections/STEPSelections_SelectAssembly.hxx delete mode 100644 src/STEPSelections/STEPSelections_SelectDerived.cxx delete mode 100644 src/STEPSelections/STEPSelections_SelectDerived.hxx delete mode 100644 src/STEPSelections/STEPSelections_SelectFaces.cxx delete mode 100644 src/STEPSelections/STEPSelections_SelectFaces.hxx delete mode 100644 src/STEPSelections/STEPSelections_SelectForTransfer.cxx delete mode 100644 src/STEPSelections/STEPSelections_SelectForTransfer.hxx delete mode 100644 src/STEPSelections/STEPSelections_SelectGSCurves.cxx delete mode 100644 src/STEPSelections/STEPSelections_SelectGSCurves.hxx delete mode 100644 src/STEPSelections/STEPSelections_SelectInstances.cxx delete mode 100644 src/STEPSelections/STEPSelections_SelectInstances.hxx delete mode 100644 src/STEPSelections/STEPSelections_SequenceOfAssemblyComponent.hxx delete mode 100644 src/STEPSelections/STEPSelections_SequenceOfAssemblyLink.hxx delete mode 100644 src/StepSelect/FILES delete mode 100644 src/StepSelect/StepSelect_FileModifier.hxx delete mode 100644 src/StepSelect/StepSelect_FileModifier_0.cxx delete mode 100644 src/StepSelect/StepSelect_FloatFormat.cxx delete mode 100644 src/StepSelect/StepSelect_FloatFormat.hxx delete mode 100644 src/StepSelect/StepSelect_ModelModifier.hxx delete mode 100644 src/StepSelect/StepSelect_ModelModifier_0.cxx delete mode 100644 src/StepSelect/StepSelect_StepType.cxx delete mode 100644 src/StepSelect/StepSelect_StepType.hxx delete mode 100644 src/StepSelect/StepSelect_WorkLibrary.cxx delete mode 100644 src/StepSelect/StepSelect_WorkLibrary.hxx rename src/{IFSelect => XSControl}/IFSelect_WorkLibrary.cxx (100%) rename src/{IFSelect => XSControl}/IFSelect_WorkLibrary.hxx (100%) rename src/{IFSelect => XSControl}/IFSelect_WorkSession.cxx (98%) create mode 100644 src/XSControl/IFSelect_WorkSession.hxx rename src/{IFSelect/IFSelect_PrintFail.hxx => XSControl/XSControl_ReturnStatus.hxx} (56%) diff --git a/dox/user_guides/iges/iges.md b/dox/user_guides/iges/iges.md index 1db3f4dec8..c78e025ba6 100644 --- a/dox/user_guides/iges/iges.md +++ b/dox/user_guides/iges/iges.md @@ -62,7 +62,7 @@ Administrative data, in the Global Section of the IGES file (such as the file n Before performing any other operation, you have to load the file using the syntax below. ~~~~{.cpp} IGESControl_Reader reader; -IFSelect_ReturnStatus stat = reader.ReadFile(“filename.igs”); +XSControl_ReturnStatus stat = reader.ReadFile(“filename.igs”); ~~~~ The loading operation only loads the IGES file into computer memory; it does not translate it. @@ -1125,7 +1125,7 @@ Allows writing the prepared model to a file with name *filename.igs*. Before performing any other operation, you must load an IGES file with: ~~~~{.cpp} IGESCAFControl_Reader reader(XSDRAW::Session(), Standard_False); -IFSelect_ReturnStatus stat = reader.ReadFile(“filename.igs”); +XSControl_ReturnStatus stat = reader.ReadFile(“filename.igs”); ~~~~ Loading the file only memorizes, but does not translate the data. @@ -1183,7 +1183,7 @@ aWriter.SetNameMode(mode); You can perform the translation of a document by calling the function: ~~~~{.cpp} -IFSelect_ReturnStatus aRetSt = aWriter.Transfer(doc); +XSControl_ReturnStatus aRetSt = aWriter.Transfer(doc); ~~~~ where "doc" is a variable which contains a handle to the input document for transferring and should have a type *Handle(TDocStd_Document)*. @@ -1191,11 +1191,11 @@ where "doc" is a variable which contains a handle to the input document for tran Write an IGES file with: ~~~~{.cpp} -IFSelect_ReturnStatus statw = aWriter.WriteFile("filename.igs"); +XSControl_ReturnStatus statw = aWriter.WriteFile("filename.igs"); ~~~~ or ~~~~{.cpp} -IFSelect_ReturnStatus statw = writer.WriteFile (S); +XSControl_ReturnStatus statw = writer.WriteFile (S); ~~~~ where S is OStream. diff --git a/dox/user_guides/step/step.md b/dox/user_guides/step/step.md index f8f47da396..d8b89d70c5 100644 --- a/dox/user_guides/step/step.md +++ b/dox/user_guides/step/step.md @@ -123,7 +123,7 @@ For further information see 2.4 Mapping STEP entities to Open CASCADE Technology Before performing any other operation you have to load the file with: ~~~~{.cpp} STEPControl_Reader reader; -IFSelect_ReturnStatus stat = reader.ReadFile("filename.stp"); +XSControl_ReturnStatus stat = reader.ReadFile("filename.stp"); ~~~~ Loading the file only memorizes the data, it does not translate it. @@ -1067,13 +1067,13 @@ If *TopoDS_Compound* contains any other types besides the ones mentioned in the In case if an OCCT shape cannot be translated according to its mode the result of translation is void. ~~~~{.cpp} STEP214Control_StepModelTope mode = STEP214Control_ManifoldSolidBrep; -IFSelect_ReturnStatus stat = writer.Transfer(shape,mode); +XSControl_ReturnStatus stat = writer.Transfer(shape,mode); ~~~~ @subsubsection occt_step_3_3_4 Writing the STEP file Write the STEP file with: ~~~~{.cpp} -IFSelect_ReturnStatus stat = writer.Write("filename.stp"); +XSControl_ReturnStatus stat = writer.Write("filename.stp"); ~~~~ to give the file name. @@ -1514,7 +1514,7 @@ In addition to the translation of shapes implemented in basic translator, it pro Before performing any other operation, you must load a STEP file with: ~~~~{.cpp} STEPCAFControl_Reader reader(XSDRAW::Session(), Standard_False); -IFSelect_ReturnStatus stat = reader.ReadFile("filename.stp"); +XSControl_ReturnStatus stat = reader.ReadFile("filename.stp"); ~~~~ Loading the file only memorizes the data, it does not translate it. @@ -1678,7 +1678,7 @@ aWriter.SetNameMode(mode); You can perform the translation of document by calling the function: ~~~~{.cpp} -IFSelect_ReturnStatus aRetSt = aWriter.Transfer(doc); +XSControl_ReturnStatus aRetSt = aWriter.Transfer(doc); ~~~~ where *doc* is a variable, which contains a handle to the input document for transferring and should have a type *Handle(TDocStd_Document)*. @@ -1686,11 +1686,11 @@ where *doc* is a variable, which contains a handle to the input document for tr Write a STEP file with: ~~~~{.cpp} -IFSelect_ReturnStatus statw = aWriter.WriteFile("filename.stp"); +XSControl_ReturnStatus statw = aWriter.WriteFile("filename.stp"); ~~~~ or ~~~~{.cpp} -IFSelect_ReturnStatus statw = writer.WriteFile (S); +XSControl_ReturnStatus statw = writer.WriteFile (S); ~~~~ where *S* is *OStream*. diff --git a/dox/user_guides/xde/xde.md b/dox/user_guides/xde/xde.md index 72056a2e63..226953527b 100644 --- a/dox/user_guides/xde/xde.md +++ b/dox/user_guides/xde/xde.md @@ -1240,8 +1240,8 @@ To read a STEP file by itself, use: ~~~~{.cpp} const char* theFilename = ...; STEPCAFControl_Reader aReader; -IFSelect_ReturnStatus aReadStat = aReader.ReadFile (theFilename); -if (aReadStat != IFSelect_RetDone) { .. reader/parser error .. } +XSControl_ReturnStatus aReadStat = aReader.ReadFile (theFilename); +if (aReadStat != XSControl_RetDone) { .. reader/parser error .. } // the various ways of reading a file are available here too: // to read it by the reader, to take it from a WorkSession ... Handle(TDocStd_Document) aDoc = ...; @@ -1278,8 +1278,8 @@ if (!aWriter.Transfer (aDoc, aMode)) // writing the File const char* theFilename = ...; -IFSelect_ReturnStatus aStat = aWriter.Write (theFilename); -if (aStat != IFSelect_RetDone) { .. writing failed .. } +XSControl_ReturnStatus aStat = aWriter.Write (theFilename); +if (aStat != XSControl_RetDone) { .. writing failed .. } ~~~~ @subsection occt_xde_2_11_3 Reading an IGES File diff --git a/src/APIHeaderSection/APIHeaderSection_EditHeader.cxx b/src/APIHeaderSection/APIHeaderSection_EditHeader.cxx deleted file mode 100644 index 2bc59031ef..0000000000 --- a/src/APIHeaderSection/APIHeaderSection_EditHeader.cxx +++ /dev/null @@ -1,186 +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 - -IMPLEMENT_STANDARD_RTTIEXT(APIHeaderSection_EditHeader,IFSelect_Editor) - -static Standard_Boolean IsTimeStamp - (const Handle(TCollection_HAsciiString)& val) -{ - if (val.IsNull()) return Standard_False; - if (val->Length() != 19) return Standard_False; -// On y va - char dizmois = val->Value(6); - char dizjour = val->Value(9); - char dizheur = val->Value(12); - for (Standard_Integer i = 1; i <= 19; i ++) - { - char uncar = val->Value(i); - switch (i) { - case 1 : if (uncar != '1' && uncar != '2') return Standard_False; - break; - case 2 : - case 3 : - case 4 : if (uncar < '0' || uncar > '9') return Standard_False; - break; - case 5 : if (uncar != '-') return Standard_False; - Standard_FALLTHROUGH - case 6 : if (uncar != '0' && uncar != '1') return Standard_False; - break; - case 7 : if (uncar < '0' || uncar > '9') return Standard_False; - if (dizmois == '1' && (uncar < '0' || uncar > '2')) return Standard_False; - break; - case 8 : if (uncar != '-') return Standard_False; - Standard_FALLTHROUGH - case 9 : if (uncar < '0' || uncar > '3') return Standard_False; - break; - case 10 : if (uncar < '0' || uncar > '9') return Standard_False; - if (dizjour == '3' && (uncar != '0' && uncar != '1')) return Standard_False; - break; - case 11 : if (uncar != 'T') return Standard_False; - Standard_FALLTHROUGH - case 12 : if (uncar < '0' || uncar > '2') return Standard_False; - break; - case 13 : if (uncar < '0' || uncar > '9') return Standard_False; - if (dizheur == '2' && (uncar < '0' || uncar > '3')) return Standard_False; - break; - case 14 : if (uncar != ':') return Standard_False; - Standard_FALLTHROUGH - case 15 : if (uncar < '0' || uncar > '5') return Standard_False; - break; - case 16 : if (uncar < '0' || uncar > '9') return Standard_False; - break; - case 17 : if (uncar != ':') return Standard_False; - Standard_FALLTHROUGH - case 18 : if (uncar < '0' || uncar > '5') return Standard_False; - break; - case 19 : if (uncar < '0' || uncar > '9') return Standard_False; - break; - default : - break; - } - } - return Standard_True; -} - - - APIHeaderSection_EditHeader::APIHeaderSection_EditHeader () - : IFSelect_Editor (10) -{ -// Definition - Handle(Interface_TypedValue) fn_name = new Interface_TypedValue("fn_name"); - SetValue (1,fn_name,"name"); - Handle(Interface_TypedValue) fn_time = new Interface_TypedValue("fn_time_stamp"); - fn_time->SetSatisfies (IsTimeStamp,"IsTimeStamp"); - SetValue (2,fn_time,"time"); - Handle(Interface_TypedValue) fn_author = new Interface_TypedValue("fn_author"); - SetValue (3,fn_author,"author"); // 1 seul (1er de liste) - Handle(Interface_TypedValue) fn_org = new Interface_TypedValue("fn_organization"); - SetValue (4,fn_org,"org"); // 1 seul (1er de liste) - Handle(Interface_TypedValue) fn_preproc = new Interface_TypedValue("fn_preprocessor_version"); - SetValue (5,fn_preproc,"preproc"); - Handle(Interface_TypedValue) fn_orig = new Interface_TypedValue("fn_originating_system"); - SetValue (6,fn_orig,"orig"); - Handle(Interface_TypedValue) fn_autorize = new Interface_TypedValue("fn_authorization"); - SetValue (7,fn_autorize,"autorize"); - - Handle(Interface_TypedValue) fs_schema = new Interface_TypedValue("fs_schema_identifiers"); - SetValue (8,fs_schema,"schema"); // 1 seul (1er de liste) - - Handle(Interface_TypedValue) fd_descr = new Interface_TypedValue("fd_description"); - SetValue (9,fd_descr,"descr"); // 1 seul (1er de liste) - - Handle(Interface_TypedValue) fd_level = new Interface_TypedValue("fd_implementation_level"); - SetValue (10,fd_level,"level"); - -} - - TCollection_AsciiString APIHeaderSection_EditHeader::Label () const - { return TCollection_AsciiString ("Step Header"); } - - Standard_Boolean APIHeaderSection_EditHeader::Recognize - (const Handle(IFSelect_EditForm)& /*form*/) const -{ return Standard_True; } // ?? - - Handle(TCollection_HAsciiString) APIHeaderSection_EditHeader::StringValue - (const Handle(IFSelect_EditForm)& /*form*/, const Standard_Integer num) const -{ -// Default Values - return TypedValue(num)->HStringValue(); -} - - Standard_Boolean APIHeaderSection_EditHeader::Load - (const Handle(IFSelect_EditForm)& form, - const Handle(Standard_Transient)& /*ent*/, - const Handle(Interface_InterfaceModel)& model) const -{ - Handle(StepData_StepModel) modl = - Handle(StepData_StepModel)::DownCast(model); - if (modl.IsNull()) return Standard_False; - - APIHeaderSection_MakeHeader mkh (modl); - - form->LoadValue (1 ,mkh.Name ()); - form->LoadValue (2 ,mkh.TimeStamp ()); - form->LoadValue (3 ,mkh.AuthorValue (1)); - form->LoadValue (4 ,mkh.OrganizationValue (1)); - form->LoadValue (5 ,mkh.PreprocessorVersion ()); - form->LoadValue (6 ,mkh.OriginatingSystem ()); - form->LoadValue (7 ,mkh.Authorisation ()); - - form->LoadValue (8 ,mkh.SchemaIdentifiersValue (1)); - - form->LoadValue (9 ,mkh.DescriptionValue (1)); - form->LoadValue (10,mkh.ImplementationLevel ()); - - return Standard_True; -} - - Standard_Boolean APIHeaderSection_EditHeader::Apply - (const Handle(IFSelect_EditForm)& form, - const Handle(Standard_Transient)& /*ent*/, - const Handle(Interface_InterfaceModel)& model) const -{ - Handle(StepData_StepModel) modl = - Handle(StepData_StepModel)::DownCast(model); - if (modl.IsNull()) return Standard_False; - - APIHeaderSection_MakeHeader mkh (modl); - - if (form->IsModified(1)) mkh.SetName (form->EditedValue(1)); - if (form->IsModified(2)) mkh.SetTimeStamp (form->EditedValue(2)); - if (form->IsModified(3)) mkh.SetAuthorValue (1,form->EditedValue(3)); - if (form->IsModified(4)) mkh.SetOrganizationValue (1,form->EditedValue(4)); - if (form->IsModified(5)) mkh.SetPreprocessorVersion (form->EditedValue(5)); - if (form->IsModified(6)) mkh.SetOriginatingSystem (form->EditedValue(6)); - if (form->IsModified(7)) mkh.SetAuthorisation (form->EditedValue(7)); - - if (form->IsModified(8)) mkh.SetSchemaIdentifiersValue (1,form->EditedValue(8)); - - if (form->IsModified(9)) mkh.SetDescriptionValue (1,form->EditedValue(9)); - if (form->IsModified(10)) mkh.SetImplementationLevel (form->EditedValue(10)); - - mkh.Apply( Handle(StepData_StepModel)::DownCast(model) ); - - return Standard_True; -} diff --git a/src/APIHeaderSection/APIHeaderSection_EditHeader.hxx b/src/APIHeaderSection/APIHeaderSection_EditHeader.hxx deleted file mode 100644 index 749528cb48..0000000000 --- a/src/APIHeaderSection/APIHeaderSection_EditHeader.hxx +++ /dev/null @@ -1,76 +0,0 @@ -// Created on: 1998-07-08 -// Created by: Christian CAILLET -// Copyright (c) 1998-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 _APIHeaderSection_EditHeader_HeaderFile -#define _APIHeaderSection_EditHeader_HeaderFile - -#include - -#include -#include -class TCollection_AsciiString; -class IFSelect_EditForm; -class TCollection_HAsciiString; -class Standard_Transient; -class Interface_InterfaceModel; - - -class APIHeaderSection_EditHeader; -DEFINE_STANDARD_HANDLE(APIHeaderSection_EditHeader, IFSelect_Editor) - - -class APIHeaderSection_EditHeader : public IFSelect_Editor -{ - -public: - - - Standard_EXPORT APIHeaderSection_EditHeader(); - - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - Standard_EXPORT Standard_Boolean Recognize (const Handle(IFSelect_EditForm)& form) const Standard_OVERRIDE; - - Standard_EXPORT Handle(TCollection_HAsciiString) StringValue (const Handle(IFSelect_EditForm)& form, const Standard_Integer num) const Standard_OVERRIDE; - - Standard_EXPORT Standard_Boolean Apply (const Handle(IFSelect_EditForm)& form, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - Standard_EXPORT Standard_Boolean Load (const Handle(IFSelect_EditForm)& form, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(APIHeaderSection_EditHeader,IFSelect_Editor) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _APIHeaderSection_EditHeader_HeaderFile diff --git a/src/APIHeaderSection/FILES b/src/APIHeaderSection/FILES deleted file mode 100644 index 41bf0dd0ec..0000000000 --- a/src/APIHeaderSection/FILES +++ /dev/null @@ -1,4 +0,0 @@ -APIHeaderSection_EditHeader.cxx -APIHeaderSection_EditHeader.hxx -APIHeaderSection_MakeHeader.cxx -APIHeaderSection_MakeHeader.hxx diff --git a/src/Interface/Interface_InterfaceModel.cxx b/src/DE/DE_DataModel.cxx similarity index 100% rename from src/Interface/Interface_InterfaceModel.cxx rename to src/DE/DE_DataModel.cxx diff --git a/src/Interface/Interface_InterfaceModel.hxx b/src/DE/DE_DataModel.hxx similarity index 100% rename from src/Interface/Interface_InterfaceModel.hxx rename to src/DE/DE_DataModel.hxx diff --git a/src/DE/DE_InterfaceParameters.cxx b/src/DE/DE_InterfaceParameters.cxx new file mode 100644 index 0000000000..afa597d56e --- /dev/null +++ b/src/DE/DE_InterfaceParameters.cxx @@ -0,0 +1,435 @@ +// 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 +IMPLEMENT_STANDARD_RTTIEXT(Interface_Static,Interface_TypedValue) + +static char defmess[31]; + +// Fonctions Satisfies offertes en standard ... + +//svv #2 +//static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val) +//{ +// OSD_Path apath; +// return apath.IsValid (TCollection_AsciiString(val->ToCString())); +//} + + + Interface_Static::Interface_Static + (const Standard_CString family, const Standard_CString name, + const Interface_ParamType type, const Standard_CString init) + : Interface_TypedValue (name,type,init) , + thefamily (family) , + theupdate (Standard_True) { } + + Interface_Static::Interface_Static + (const Standard_CString family, const Standard_CString name, + const Handle(Interface_Static)& other) + : Interface_TypedValue (name, other->Type(), "") , + thefamily (family) , + theupdate (Standard_True) +{ + switch (Type()) { + case Interface_ParamInteger : { + Standard_Integer lim; + if (other->IntegerLimit (Standard_True ,lim)) SetIntegerLimit (Standard_True ,lim); + if (other->IntegerLimit (Standard_False,lim)) SetIntegerLimit (Standard_False,lim); + } + break; + case Interface_ParamReal : { + Standard_Real lim; + if (other->RealLimit (Standard_True ,lim)) SetRealLimit (Standard_True ,lim); + if (other->RealLimit (Standard_False,lim)) SetRealLimit (Standard_False,lim); + SetUnitDef (other->UnitDef()); + } + break; + case Interface_ParamEnum : { + Standard_Boolean match; Standard_Integer e0,e1,i; + other->EnumDef (e0,e1,match); + StartEnum (e0,match); +// if (e1 >= e0) theenums = new TColStd_HArray1OfAsciiString(e0,e1); + for (i = e0; i <= e1; i ++) + AddEnum (other->EnumVal(i)); + } + break; + case Interface_ParamIdent : + SetObjectType (other->ObjectType()); + break; + default : break; + } + + if (other->IsSetValue()) SetCStringValue (other->CStringValue()); +} + + +// ## Print ## + +void Interface_Static::PrintStatic (Standard_OStream& S) const +{ + S <<"--- Static Value : "<Name()< imax rmin rmax unit +// enum ematch eval + Standard_Integer i,iblc = 0; + for (i = 0; init[i] != '\0'; i ++) if (init[i] == ' ') iblc = i+1; +// Reconnaissance du sous-cas et aiguillage + if (init[0] == 'i' && init[2] == 'i') + unstat->SetIntegerLimit (Standard_False,atoi(&init[iblc])); + else if (init[0] == 'i' && init[2] == 'a') + unstat->SetIntegerLimit (Standard_True ,atoi(&init[iblc])); + else if (init[0] == 'r' && init[2] == 'i') + unstat->SetRealLimit (Standard_False,Atof(&init[iblc])); + else if (init[0] == 'r' && init[2] == 'a') + unstat->SetRealLimit (Standard_True ,Atof(&init[iblc])); + else if (init[0] == 'u') + unstat->SetUnitDef (&init[iblc]); + else if (init[0] == 'e' && init[1] == 'm') + unstat->StartEnum (atoi(&init[iblc]),Standard_True); + else if (init[0] == 'e' && init[1] == 'n') + unstat->StartEnum (atoi(&init[iblc]),Standard_False); + else if (init[0] == 'e' && init[1] == 'v') + unstat->AddEnum (&init[iblc]); + else return Standard_False; + return Standard_True; + } + default : return Standard_False; + } + if (!Interface_Static::Init (family,name,epyt,init)) return Standard_False; + if (type != 'p') return Standard_True; + Handle(Interface_Static) stat = Interface_Static::Static(name); +//NT stat->SetSatisfies (StaticPath,"Path"); + if (!stat->Satisfies(stat->HStringValue())) stat->SetCStringValue(""); + return Standard_True; +} + + +Handle(Interface_Static) Interface_Static::Static + (const Standard_CString name) +{ + Handle(Standard_Transient) result; + MoniTool_TypedValue::Stats().Find(name, result); + return Handle(Interface_Static)::DownCast(result); +} + + +Standard_Boolean Interface_Static::IsPresent (const Standard_CString name) +{ + return MoniTool_TypedValue::Stats().IsBound (name); +} + + +Standard_CString Interface_Static::CDef + (const Standard_CString name, const Standard_CString part) +{ + if (!part || part[0] == '\0') return ""; + Handle(Interface_Static) stat = Interface_Static::Static(name); + if (stat.IsNull()) return ""; + if (part[0] == 'f' && part[1] == 'a') return stat->Family(); + if (part[0] == 'l' && part[1] == 'a') return stat->Label(); + if (part[0] == 's' && part[1] == 'a') return stat->SatisfiesName(); + if (part[0] == 't' && part[1] == 'y') { + Interface_ParamType typ = stat->Type(); + if (typ == Interface_ParamInteger) return "integer"; + if (typ == Interface_ParamReal) return "real"; + if (typ == Interface_ParamText) return "text"; + if (typ == Interface_ParamEnum) return "enum"; + return "?type?"; + } + if (part[0] == 'e') { + Standard_Integer nume = 0; + sscanf (part,"%30s %d",defmess,&nume); + return stat->EnumVal(nume); + } + if (part[0] == 'i') { + Standard_Integer ilim; + if (!stat->IntegerLimit((part[2] == 'a'),ilim)) return ""; + Sprintf(defmess,"%d",ilim); return defmess; + } + if (part[0] == 'r') { + Standard_Real rlim; + if (!stat->RealLimit((part[2] == 'a'),rlim)) return ""; + Sprintf(defmess,"%f",rlim); return defmess; + } + if (part[0] == 'u') return stat->UnitDef(); + return ""; +} + + +Standard_Integer Interface_Static::IDef + (const Standard_CString name, const Standard_CString part) +{ + if (!part || part[0] == '\0') return 0; + Handle(Interface_Static) stat = Interface_Static::Static(name); + if (stat.IsNull()) return 0; + if (part[0] == 'i') { + Standard_Integer ilim; + if (!stat->IntegerLimit((part[2] == 'a'),ilim)) return 0; + return ilim; + } + if (part[0] == 'e') { + Standard_Integer startcase,endcase; Standard_Boolean match; + stat->EnumDef (startcase,endcase,match); + if (part[1] == 's') return startcase; + if (part[1] == 'c') return (endcase - startcase + 1); + if (part[1] == 'm') return (match ? 1 : 0); + if (part[1] == 'v') { + char vale[51]; + sscanf (part,"%30s %50s",defmess,vale); + return stat->EnumCase (vale); + } + } + return 0; +} + + +// ########## VALEUR COURANTE ########### + +Standard_Boolean Interface_Static::IsSet + (const Standard_CString name, const Standard_Boolean proper) +{ + Handle(Interface_Static) item = Interface_Static::Static(name); + if (item.IsNull()) return Standard_False; + if (item->IsSetValue()) return Standard_True; + if (proper) return Standard_False; + item = item->Wild(); + return item->IsSetValue(); +} + + +Standard_CString Interface_Static::CVal (const Standard_CString name) +{ + Handle(Interface_Static) item = Interface_Static::Static(name); + if (item.IsNull()) { +#ifdef OCCT_DEBUG + std::cout << "Warning: Interface_Static::CVal: incorrect parameter " << name << std::endl; +#endif + return ""; + } + return item->CStringValue(); +} + + +Standard_Integer Interface_Static::IVal (const Standard_CString name) +{ + Handle(Interface_Static) item = Interface_Static::Static(name); + if (item.IsNull()) { +#ifdef OCCT_DEBUG + std::cout << "Warning: Interface_Static::IVal: incorrect parameter " << name << std::endl; +#endif + return 0; + } + return item->IntegerValue(); +} + + +Standard_Real Interface_Static::RVal (const Standard_CString name) +{ + Handle(Interface_Static) item = Interface_Static::Static(name); + if (item.IsNull()) { +#ifdef OCCT_DEBUG + std::cout << "Warning: Interface_Static::RVal: incorrect parameter " << name << std::endl; +#endif + return 0.0; + } + return item->RealValue(); +} + + +Standard_Boolean Interface_Static::SetCVal + (const Standard_CString name, const Standard_CString val) +{ + Handle(Interface_Static) item = Interface_Static::Static(name); + if (item.IsNull()) return Standard_False; + return item->SetCStringValue(val); +} + + +Standard_Boolean Interface_Static::SetIVal + (const Standard_CString name, const Standard_Integer val) +{ + Handle(Interface_Static) item = Interface_Static::Static(name); + if (item.IsNull()) return Standard_False; + if (!item->SetIntegerValue(val)) return Standard_False; + return Standard_True; +} + + +Standard_Boolean Interface_Static::SetRVal + (const Standard_CString name, const Standard_Real val) +{ + Handle(Interface_Static) item = Interface_Static::Static(name); + if (item.IsNull()) return Standard_False; + return item->SetRealValue(val); +} + +// UPDATE + +Standard_Boolean Interface_Static::Update (const Standard_CString name) +{ + Handle(Interface_Static) item = Interface_Static::Static(name); + if (item.IsNull()) return Standard_False; + item->SetUptodate(); + return Standard_True; +} + +Standard_Boolean Interface_Static::IsUpdated (const Standard_CString name) +{ + Handle(Interface_Static) item = Interface_Static::Static(name); + if (item.IsNull()) return Standard_False; + return item->UpdatedStatus(); +} + +Handle(TColStd_HSequenceOfHAsciiString) Interface_Static::Items + (const Standard_Integer mode, const Standard_CString criter) +{ + Standard_Integer modup = (mode / 100); // 0 any, 1 non-update, 2 update + Handle(TColStd_HSequenceOfHAsciiString) list = + new TColStd_HSequenceOfHAsciiString(); + NCollection_DataMap::Iterator iter(MoniTool_TypedValue::Stats()); + for (; iter.More(); iter.Next()) { + Handle(Interface_Static) item = + Handle(Interface_Static)::DownCast(iter.Value()); + if (item.IsNull()) continue; + Standard_Boolean ok = Standard_True; + if (criter[0] == '$' && criter[1] == '\0') { + if ( (item->Family())[0] != '$') ok = Standard_False; + } else if (criter[0] != '\0') { + if (strcmp(criter, item->Family())) continue; + ok = Standard_True; + } else { // tous ... sauf famille a $ + if (item->Family()[0] == '$') continue; + } + if (ok && (modup == 1)) ok = !item->UpdatedStatus(); + if (ok && (modup == 2)) ok = item->UpdatedStatus(); + + if (ok) list->Append (new TCollection_HAsciiString (iter.Key()) ); + } + return list; +} + +//======================================================================= +// function : FillMap +// purpose : Fills given string-to-string map with all static data +//======================================================================= +void Interface_Static::FillMap (NCollection_DataMap& theMap) +{ + theMap.Clear(); + + NCollection_DataMap& aMap = MoniTool_TypedValue::Stats(); + + for (NCollection_DataMap::Iterator anIt(aMap); anIt.More(); anIt.Next()) + { + Handle(Interface_Static) aValue = Handle(Interface_Static)::DownCast(anIt.Value()); + if (aValue.IsNull()) + { + continue; + } + if (aValue->HStringValue().IsNull()) + { + continue; + } + + theMap.Bind (anIt.Key(), aValue->HStringValue()->String()); + } +} diff --git a/src/DE/DE_InterfaceParameters.hxx b/src/DE/DE_InterfaceParameters.hxx new file mode 100644 index 0000000000..7069c5f361 --- /dev/null +++ b/src/DE/DE_InterfaceParameters.hxx @@ -0,0 +1,291 @@ +// Created on: 1995-12-08 +// Created by: Christian CAILLET +// Copyright (c) 1995-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 _Interface_Static_HeaderFile +#define _Interface_Static_HeaderFile + +#include + +#include +#include +#include +#include +#include +class TCollection_HAsciiString; + +class Interface_Static; +DEFINE_STANDARD_HANDLE(Interface_Static, Interface_TypedValue) + +//! This class gives a way to manage meaningful static variables, +//! used as "global" parameters in various procedures. +//! +//! A Static brings a specification (its type, constraints if any) +//! and a value. Its basic form is a string, it can be specified +//! as integer or real or enumerative string, and queried as such. +//! Its string content, which is a Handle(HAsciiString) can be +//! shared by other data structures, hence gives a direct on line +//! access to its value. +//! +//! All this description is inherited from TypedValue +//! +//! A Static can be given an initial value, it can be filled from, +//! either a set of Resources (an applicative feature which +//! accesses and manages parameter files), or environment or +//! internal definition : these define families of Static. +//! In addition, it supports a status for reinitialisation : an +//! initialisation procedure can ask if the value of the Static +//! has changed from its last call, in this case does something +//! then marks the Status "uptodate", else it does nothing. +//! +//! Statics are named and recorded then accessed in an alphabetic +//! dictionary +class Interface_Static : public Interface_TypedValue +{ + +public: + + + //! Creates and records a Static, with a family and a name + //! family can report to a name of resource or to a system or + //! internal definition. The name must be unique. + //! + //! type gives the type of the parameter, default is free text + //! Also available : Integer, Real, Enum, Entity (i.e. Object) + //! More precise specifications, titles, can be given to the + //! Static once created + //! + //! init gives an initial value. If it is not given, the Static + //! begin as "not set", its value is empty + Standard_EXPORT Interface_Static(const Standard_CString family, const Standard_CString name, const Interface_ParamType type = Interface_ParamText, const Standard_CString init = ""); + + //! Creates a new Static with same definition as another one + //! (value is copied, except for Entity : it remains null) + Standard_EXPORT Interface_Static(const Standard_CString family, const Standard_CString name, const Handle(Interface_Static)& other); + + //! Writes the properties of a + //! parameter in the diagnostic file. These include: + //! - Name + //! - Family, + //! - Wildcard (if it has one) + //! - Current status (empty string if it was updated or + //! if it is the original one) + //! - Value + Standard_EXPORT void PrintStatic (Standard_OStream& S) const; + + //! Returns the family. It can be : a resource name for applis, + //! an internal name between : $e (environment variables), + //! $l (other, purely local) + Standard_EXPORT Standard_CString Family() const; + + //! Sets a "wild-card" static : its value will be considered + //! if is not properly set. (reset by set a null one) + Standard_EXPORT void SetWild (const Handle(Interface_Static)& wildcard); + + //! Returns the wildcard static, which can be (is most often) null + Standard_EXPORT Handle(Interface_Static) Wild() const; + + //! Records a Static has "uptodate", i.e. its value has been taken + //! into account by a reinitialisation procedure + //! This flag is reset at each successful SetValue + Standard_EXPORT void SetUptodate(); + + //! Returns the status "uptodate" + Standard_EXPORT Standard_Boolean UpdatedStatus() const; + + //! Declares a new Static (by calling its constructor) + //! If this name is already taken, does nothing and returns False + //! Else, creates it and returns True + //! For additional definitions, get the Static then edit it + Standard_EXPORT static Standard_Boolean Init (const Standard_CString family, const Standard_CString name, const Interface_ParamType type, const Standard_CString init = ""); + + //! As Init with ParamType, but type is given as a character + //! This allows a simpler call + //! Types : 'i' Integer, 'r' Real, 't' Text, 'e' Enum, 'o' Object + //! '=' for same definition as, gives the initial Static + //! Returns False if does not match this list + Standard_EXPORT static Standard_Boolean Init (const Standard_CString family, const Standard_CString name, const Standard_Character type, const Standard_CString init = ""); + + //! Returns a Static from its name. Null Handle if not present + Standard_EXPORT static Handle(Interface_Static) Static (const Standard_CString name); + + //! Returns True if a Static named is present, False else + Standard_EXPORT static Standard_Boolean IsPresent (const Standard_CString name); + + //! Returns a part of the definition of a Static, as a CString + //! The part is designated by its name, as a CString + //! If the required value is not a string, it is converted to a + //! CString then returned + //! If is not present, or not defined for , + //! this function returns an empty string + //! + //! Allowed parts for CDef : + //! family : the family + //! type : the type ("integer","real","text","enum") + //! label : the label + //! satis : satisfy function name if any + //! rmin : minimum real value + //! rmax : maximum real value + //! imin : minimum integer value + //! imax : maximum integer value + //! enum nn (nn : value of an integer) : enum value for nn + //! unit : unit definition for a real + Standard_EXPORT static Standard_CString CDef (const Standard_CString name, const Standard_CString part); + + //! Returns a part of the definition of a Static, as an Integer + //! The part is designated by its name, as a CString + //! If the required value is not a string, returns zero + //! For a Boolean, 0 for false, 1 for true + //! If is not present, or not defined for , + //! this function returns zero + //! + //! Allowed parts for IDef : + //! imin, imax : minimum or maximum integer value + //! estart : starting number for enum + //! ecount : count of enum values (starting from estart) + //! ematch : exact match status + //! eval val : case determined from a string + Standard_EXPORT static Standard_Integer IDef (const Standard_CString name, const Standard_CString part); + + //! Returns True if is present AND set + //! True (D) : considers this item only + //! False : if not set and attached to a wild-card, + //! considers this wild-card + Standard_EXPORT static Standard_Boolean IsSet (const Standard_CString name, const Standard_Boolean proper = Standard_True); + + //! Returns the value of the + //! parameter identified by the string name. + //! If the specified parameter does not exist, an empty + //! string is returned. + //! Example + //! Interface_Static::CVal("write.step.schema"); + //! which could return: + //! "AP214" + Standard_EXPORT static Standard_CString CVal (const Standard_CString name); + + //! Returns the integer value of + //! the translation parameter identified by the string name. + //! Returns the value 0 if the parameter does not exist. + //! Example + //! Interface_Static::IVal("write.step.schema"); + //! which could return: 3 + Standard_EXPORT static Standard_Integer IVal (const Standard_CString name); + + //! Returns the value of a static + //! translation parameter identified by the string name. + //! Returns the value 0.0 if the parameter does not exist. + Standard_EXPORT static Standard_Real RVal (const Standard_CString name); + + //! Modifies the value of the + //! parameter identified by name. The modification is specified + //! by the string val. false is returned if the parameter does not exist. + //! Example + //! Interface_Static::SetCVal + //! ("write.step.schema","AP203") + //! This syntax specifies a switch from the default STEP 214 mode to STEP 203 mode. + Standard_EXPORT static Standard_Boolean SetCVal (const Standard_CString name, const Standard_CString val); + + //! Modifies the value of the + //! parameter identified by name. The modification is specified + //! by the integer value val. false is returned if the + //! parameter does not exist. + //! Example + //! Interface_Static::SetIVal + //! ("write.step.schema", 3) + //! This syntax specifies a switch from the default STEP 214 mode to STEP 203 mode.S + Standard_EXPORT static Standard_Boolean SetIVal (const Standard_CString name, const Standard_Integer val); + + //! Modifies the value of a + //! translation parameter. false is returned if the + //! parameter does not exist. The modification is specified + //! by the real number value val. + Standard_EXPORT static Standard_Boolean SetRVal (const Standard_CString name, const Standard_Real val); + + //! Sets a Static to be "uptodate" + //! Returns False if is not present + //! This status can be used by a reinitialisation procedure to + //! rerun if a value has been changed + Standard_EXPORT static Standard_Boolean Update (const Standard_CString name); + + //! Returns the status "uptodate" from a Static + //! Returns False if is not present + Standard_EXPORT static Standard_Boolean IsUpdated (const Standard_CString name); + + //! Returns a list of names of statics : + //! = 0 (D) : criter is for family + //! = 1 : criter is regexp on names, takes final items + //! (ignore wild cards) + //! = 2 : idem but take only wilded, not final items + //! = 3 : idem, take all items matching criter + //! idem + 100 : takes only non-updated items + //! idem + 200 : takes only updated items + //! criter empty (D) : returns all names + //! else returns names which match the given criter + //! Remark : families beginning by '$' are not listed by criter "" + //! they are listed only by criter "$" + //! + //! This allows for instance to set new values after having loaded + //! or reloaded a resource, then to update them as required + Standard_EXPORT static Handle(TColStd_HSequenceOfHAsciiString) Items (const Standard_Integer mode = 0, const Standard_CString criter = ""); + + //! Initializes all standard static parameters, which can be used + //! by every function. statics specific of a norm or a function + //! must be defined around it + Standard_EXPORT static void Standards(); + + //! Fills given string-to-string map with all static data + Standard_EXPORT static void FillMap(NCollection_DataMap& theMap); + + DEFINE_STANDARD_RTTIEXT(Interface_Static,Interface_TypedValue) + +protected: + + + + +private: + + + TCollection_AsciiString thefamily; + TCollection_AsciiString thename; + TCollection_AsciiString thelabel; + Interface_ParamType thetype; + Handle(Standard_Type) theotyp; + Handle(Interface_Static) thewild; + Standard_Integer thelims; + Standard_Integer theintlow; + Standard_Integer theintup; + Standard_Real therealow; + Standard_Real therealup; + TCollection_AsciiString theunidef; + Handle(TColStd_HArray1OfAsciiString) theenums; + NCollection_DataMap theeadds; + Interface_StaticSatisfies thesatisf; + TCollection_AsciiString thesatisn; + Standard_Boolean theupdate; + Standard_Integer theival; + Handle(TCollection_HAsciiString) thehval; + Handle(Standard_Transient) theoval; + + +}; + + + + + + + +#endif // _Interface_Static_HeaderFile diff --git a/src/IFSelect/IFSelect_ReturnStatus.hxx b/src/DE/DE_ReturnStatus.hxx similarity index 90% rename from src/IFSelect/IFSelect_ReturnStatus.hxx rename to src/DE/DE_ReturnStatus.hxx index b95172fb27..01546e12a4 100644 --- a/src/IFSelect/IFSelect_ReturnStatus.hxx +++ b/src/DE/DE_ReturnStatus.hxx @@ -24,13 +24,13 @@ //! RetError : error in command or input data, no execution //! RetFail : execution was run and has failed //! RetStop : indicates end or stop (such as Raise) -enum IFSelect_ReturnStatus +enum XSControl_ReturnStatus { -IFSelect_RetVoid, -IFSelect_RetDone, -IFSelect_RetError, -IFSelect_RetFail, -IFSelect_RetStop +XSControl_RetVoid, +XSControl_RetDone, +XSControl_RetError, +XSControl_RetFail, +XSControl_RetStop }; #endif // _IFSelect_ReturnStatus_HeaderFile diff --git a/src/DE/DE_WorkSession.cxx b/src/DE/DE_WorkSession.cxx new file mode 100644 index 0000000000..8f683f562b --- /dev/null +++ b/src/DE/DE_WorkSession.cxx @@ -0,0 +1,502 @@ +// 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 + +IMPLEMENT_STANDARD_RTTIEXT(XSControl_WorkSession, Standard_Transient) + +//======================================================================= +//function : XSControl_WorkSession +//purpose : +//======================================================================= +XSControl_WorkSession::XSControl_WorkSession() : + myTransferReader(new XSControl_TransferReader), + myTransferWriter(new XSControl_TransferWriter) +{} + +//======================================================================= +//function : XSControl_WorkSession +//purpose : +//======================================================================= +XSControl_WorkSession::~XSControl_WorkSession() +{ + clearBinders(); +} + +//======================================================================= +//function : ClearData +//purpose : +//======================================================================= +void XSControl_WorkSession::ClearData(const Standard_Integer mode) +{ + // 1-2-3-4 : standard IFSelect + if (mode >= 1 && mode <= 4) IFSelect_WorkSession::ClearData(mode); + + // 5 : Transferts seuls + // 6 : Resultats forces seuls + // 7 : Management, y compris tous transferts (forces/calcules), views + + if (mode == 5 || mode == 7) + { + myTransferReader->Clear(-1); + myTransferWriter->Clear(-1); + } + if (mode == 6 && !myTransferReader.IsNull()) myTransferReader->Clear(1); + myTransferReader->SetGraph(HGraph()); +} + +//======================================================================= +//function : SelectNorm +//purpose : +//======================================================================= +Standard_Boolean XSControl_WorkSession::SelectNorm(const Standard_CString normname) +{ + // Old norm and results + myTransferReader->Clear(-1); + // ???? En toute rigueur, menage a faire dans XWS : virer les items + // ( a la limite, pourquoi pas, refaire XWS en entier) + + Handle(XSControl_Controller) newadapt = XSControl_Controller::Recorded(normname); + if (newadapt.IsNull()) return Standard_False; + if (newadapt == myController) return Standard_True; + SetController(newadapt); + return Standard_True; +} + +//======================================================================= +//function : SetController +//purpose : +//======================================================================= +void XSControl_WorkSession::SetController(const Handle(XSControl_Controller)& ctl) +{ + myController = ctl; + + SetLibrary(myController->WorkLibrary()); + SetProtocol(myController->Protocol()); + + ClearItems(); + ClearFinalModifiers(); + ClearShareOut(Standard_False); + ClearFile(); + + myTransferReader->SetController(myController); + myTransferWriter->SetController(myController); +} + +//======================================================================= +//function : SelectedNorm +//purpose : +//======================================================================= +Standard_CString XSControl_WorkSession::SelectedNorm(const Standard_Boolean rsc) const +{ + //JR/Hp : + Standard_CString astr = (Standard_CString)(myController.IsNull() ? "" : myController->Name(rsc)); + return astr; +} + +//======================================================================= +//function : SelectedNorm +//purpose : +//======================================================================= +void XSControl_WorkSession::AppendReferenceWS(const TCollection_AsciiString& theName, + const Handle(XSControl_WorkSession)& theWS) +{ + myReferenceWS.Bind(theName, theWS); +} + +//======================================================================= +//function : PrintTransferStatus +//purpose : +//======================================================================= +Standard_Boolean XSControl_WorkSession::PrintTransferStatus(const Standard_Integer num, + const Standard_Boolean wri, + Standard_OStream& S) const +{ + const Handle(Transfer_FinderProcess)& FP = myTransferWriter->FinderProcess(); + Handle(Transfer_TransientProcess) TP = myTransferReader->TransientProcess(); + + Handle(Transfer_Binder) binder; + Handle(Transfer_Finder) finder; + Handle(Standard_Transient) ent; + + // *** WRITE *** + if (wri) + { + if (FP.IsNull()) return Standard_False; + if (num == 0) return Standard_False; + + Standard_Integer ne = 0, nr = 0, max = FP->NbMapped(), maxr = FP->NbRoots(); + if (num > 0) + { + if (num > max) return Standard_False; + ne = num; + finder = FP->Mapped(ne); + nr = FP->RootIndex(finder); + } + else if (num < 0) + { + nr = -num; + if (nr > maxr) return Standard_False; + finder = FP->Root(nr); + ne = FP->MapIndex(finder); + } + + S << "Transfer Write item n0." << ne << " of " << max; + if (nr > 0) + { + S << " ** Transfer Root n0." << ne; + } + S << std::endl; + ent = FP->FindTransient(finder); + S << " -> Type " << finder->DynamicType()->Name() << std::endl; + FP->StartTrace(binder, finder, 0, 0); // pb sout/S + if (!ent.IsNull()) + { + S << " ** Resultat Transient, type " << ent->DynamicType()->Name(); + const Handle(Interface_InterfaceModel)& model = Model(); + if (!model.IsNull()) + { + S << " In output Model, Entity "; model->Print(ent, S); + } + S << std::endl; + } + } + + // *** READ *** + else + { + if (TP.IsNull()) return Standard_False; + Handle(Interface_InterfaceModel) model = TP->Model(); + if (model.IsNull()) std::cout << "No Model" << std::endl; + else if (model != Model()) std::cout << "Model different from the session" << std::endl; + if (num == 0) return Standard_False; + + Standard_Integer ne = 0, nr = 0, max = TP->NbMapped(), maxr = TP->NbRoots(); + if (num > 0) + { + if (num > max) return Standard_False; + ne = num; + ent = TP->Mapped(ne); + nr = TP->RootIndex(finder); + } + else if (num < 0) + { + nr = -num; + if (nr > maxr) return Standard_False; + ent = TP->Root(nr); + ne = TP->MapIndex(ent); + } + + S << "Transfer Read item n0." << ne << " of " << max; + if (nr > 0) + { + S << " ** Transfer Root n0." << ne; + } + S << std::endl; + if (!model.IsNull()) { S << " In Model, Entity "; model->Print(ent, S); } + binder = TP->MapItem(ne); + S << std::endl; + TP->StartTrace(binder, ent, 0, 0); + + } + + // *** CHECK (commun READ+WRITE) *** + if (!binder.IsNull()) + { + const Handle(Interface_Check) ch = binder->Check(); + Standard_Integer i, nbw = ch->NbWarnings(), nbf = ch->NbFails(); + if (nbw > 0) + { + S << " - Warnings : " << nbw << " :\n"; + for (i = 1; i <= nbw; i++) S << ch->CWarning(i) << std::endl; + } + if (nbf > 0) + { + S << " - Fails : " << nbf << " :\n"; + for (i = 1; i <= nbf; i++) S << ch->CFail(i) << std::endl; + } + } + return Standard_True; +} + +//======================================================================= +//function : InitTransferReader +//purpose : +//======================================================================= +void XSControl_WorkSession::InitTransferReader(const Standard_Integer mode) +{ + if (mode == 0 || mode == 5) myTransferReader->Clear(-1); // full clear + if (myTransferReader.IsNull()) SetTransferReader(new XSControl_TransferReader); + else SetTransferReader(myTransferReader); + + // mode = 0 fait par SetTransferReader suite a Nullify + if (mode == 1) + { + if (!myTransferReader.IsNull()) myTransferReader->Clear(-1); + else SetTransferReader(new XSControl_TransferReader); + } + if (mode == 2) + { + Handle(Transfer_TransientProcess) TP = myTransferReader->TransientProcess(); + if (TP.IsNull()) + { + TP = new Transfer_TransientProcess; + myTransferReader->SetTransientProcess(TP); + TP->SetGraph(HGraph()); + } + Handle(TColStd_HSequenceOfTransient) lis = myTransferReader->RecordedList(); + Standard_Integer i, nb = lis->Length(); + for (i = 1; i <= nb; i++) TP->SetRoot(lis->Value(i)); + } + if (mode == 3) + { + Handle(Transfer_TransientProcess) TP = myTransferReader->TransientProcess(); + if (TP.IsNull()) return; + Standard_Integer i, nb = TP->NbRoots(); + for (i = 1; i <= nb; i++) myTransferReader->RecordResult(TP->Root(i)); + } + if (mode == 4 || mode == 5) myTransferReader->BeginTransfer(); +} + +//======================================================================= +//function : SetTransferReader +//purpose : +//======================================================================= +void XSControl_WorkSession::SetTransferReader(const Handle(XSControl_TransferReader)& TR) +{ + if (myTransferReader != TR) //i1 pdn 03.04.99 BUC60301 + myTransferReader = TR; + if (TR.IsNull()) return; + TR->SetController(myController); + TR->SetGraph(HGraph()); + if (!TR->TransientProcess().IsNull()) return; + Handle(Transfer_TransientProcess) TP = new Transfer_TransientProcess + (Model().IsNull() ? 100 : Model()->NbEntities() + 100); + TP->SetGraph(HGraph()); + TP->SetErrorHandle(Standard_True); + TR->SetTransientProcess(TP); +} + +//======================================================================= +//function : MapReader +//purpose : +//======================================================================= +Handle(Transfer_TransientProcess) XSControl_WorkSession::MapReader() const +{ + return myTransferReader->TransientProcess(); +} + +//======================================================================= +//function : SetMapReader +//purpose : +//======================================================================= +Standard_Boolean XSControl_WorkSession::SetMapReader(const Handle(Transfer_TransientProcess)& TP) +{ + if (TP.IsNull()) return Standard_False; + if (TP->Model().IsNull()) TP->SetModel(Model()); + TP->SetGraph(HGraph()); + if (TP->Model() != Model()) return Standard_False; + // TR ne doit pas bouger, c est un "crochet" pour signatures, selections ... + // En revanche, mieux vaut le RAZ + // Handle(XSControl_TransferReader) TR = new XSControl_TransferReader; + Handle(XSControl_TransferReader) TR = myTransferReader; + TR->Clear(-1); + + SetTransferReader(TR); // avec le meme mais le reinitialise + TR->SetTransientProcess(TP); // et prend le nouveau TP + return Standard_True; +} + +//======================================================================= +//function : Result +//purpose : +//======================================================================= +Handle(Standard_Transient) XSControl_WorkSession::Result(const Handle(Standard_Transient)& ent, + const Standard_Integer mode) const +{ + Standard_Integer ouca = (mode % 10); + Standard_Integer kica = (mode / 10); + + Handle(Transfer_Binder) binder; + Handle(Transfer_ResultFromModel) resu; + + if (ouca != 1) resu = myTransferReader->FinalResult(ent); + if (mode == 20) return resu; + + if (!resu.IsNull()) binder = resu->MainResult()->Binder(); + if (binder.IsNull() && ouca > 0) + binder = myTransferReader->TransientProcess()->Find(ent); + + if (kica == 1) return binder; + DeclareAndCast(Transfer_SimpleBinderOfTransient, trb, binder); + if (!trb.IsNull()) return trb->Result(); + return binder; +} + +//======================================================================= +//function : TransferReadOne +//purpose : +//======================================================================= +Standard_Integer XSControl_WorkSession::TransferReadOne(const Handle(Standard_Transient)& ent, + const Message_ProgressRange& theProgress) +{ + Handle(Interface_InterfaceModel) model = Model(); + if (ent == model) return TransferReadRoots(theProgress); + + Handle(TColStd_HSequenceOfTransient) list = GiveList(ent); + if (list->Length() == 1) + return myTransferReader->TransferOne(list->Value(1), Standard_True, theProgress); + else + return myTransferReader->TransferList(list, Standard_True, theProgress); +} + +//======================================================================= +//function : TransferReadRoots +//purpose : +//======================================================================= +Standard_Integer XSControl_WorkSession::TransferReadRoots(const Message_ProgressRange& theProgress) +{ + return myTransferReader->TransferRoots(Graph(), theProgress); +} + +//======================================================================= +//function : NewModel +//purpose : +//======================================================================= +Handle(Interface_InterfaceModel) XSControl_WorkSession::NewModel() +{ + Handle(Interface_InterfaceModel) newmod; + if (myController.IsNull()) return newmod; + newmod = myController->NewModel(); + + SetModel(newmod); + if (!myTransferReader->TransientProcess().IsNull()) + myTransferReader->TransientProcess()->Clear(); + //clear all contains of WS + myTransferReader->Clear(3); + myTransferWriter->Clear(-1); + + return newmod; +} + +//======================================================================= +//function : TransferWriter +//purpose : +//======================================================================= +const Handle(XSControl_TransferWriter)& XSControl_WorkSession::TransferWriter() const +{ + return myTransferWriter; +} + +//======================================================================= +//function : SetMapWriter +//purpose : +//======================================================================= +Standard_Boolean XSControl_WorkSession::SetMapWriter(const Handle(Transfer_FinderProcess)& theFP) +{ + if (theFP.IsNull()) return Standard_False; + myTransferWriter->SetFinderProcess(theFP); + return Standard_True; +} + +//======================================================================= +//function : TransferWriteShape +//purpose : +//======================================================================= +XSControl_ReturnStatus XSControl_WorkSession::TransferWriteShape(const TopoDS_Shape& shape, + const Standard_Boolean compgraph, + const Message_ProgressRange& theProgress) +{ + XSControl_ReturnStatus status; + if (myController.IsNull()) return XSControl_RetError; + const Handle(Interface_InterfaceModel)& model = Model(); + if (model.IsNull() || shape.IsNull()) + { + return XSControl_RetVoid; + } + + status = myTransferWriter->TransferWriteShape(model, shape, theProgress); + if (theProgress.UserBreak()) + return XSControl_RetStop; + // qui s occupe de tout, try/catch inclus + + //skl insert param compgraph for XDE writing 10.12.2003 + if (compgraph) ComputeGraph(Standard_True); + + return status; +} + +//======================================================================= +//function : TransferWriteCheckList +//purpose : +//======================================================================= +Interface_CheckIterator XSControl_WorkSession::TransferWriteCheckList() const +{ + return myTransferWriter->ResultCheckList(Model()); +} + +//======================================================================= +//function : clearBinders +//purpose : +//======================================================================= +void XSControl_WorkSession::clearBinders() +{ + const Handle(Transfer_FinderProcess)& FP = myTransferWriter->FinderProcess(); + //Due to big number of chains of binders it is necessary to + //collect head binders of each chain in the sequence + TColStd_SequenceOfTransient aSeqBnd; + TColStd_SequenceOfTransient aSeqShapes; + Standard_Integer i = 1; + for (; i <= FP->NbMapped(); i++) + { + Handle(Transfer_Binder) bnd = FP->MapItem(i); + if (!bnd.IsNull()) + aSeqBnd.Append(bnd); + Handle(Standard_Transient) ash(FP->Mapped(i)); + aSeqShapes.Append(ash); + } + //removing finder process containing result of translation. + FP->Clear(); + ClearData(1); + ClearData(5); + + //removing each chain of binders + while (aSeqBnd.Length() > 0) + { + Handle(Transfer_Binder) aBnd = Handle(Transfer_Binder)::DownCast(aSeqBnd.Value(1)); + Handle(Standard_Transient) ash = aSeqShapes.Value(1); + aSeqBnd.Remove(1); + aSeqShapes.Remove(1); + ash.Nullify(); + while (!aBnd.IsNull()) + { + Handle(Transfer_Binder) aBndNext = aBnd->NextResult(); + aBnd.Nullify(); + aBnd = aBndNext; + } + } +} diff --git a/src/DE/DE_WorkSession.hxx b/src/DE/DE_WorkSession.hxx new file mode 100644 index 0000000000..c1c18bf084 --- /dev/null +++ b/src/DE/DE_WorkSession.hxx @@ -0,0 +1,190 @@ +// Created on: 1995-06-01 +// Created by: Christian CAILLET +// Copyright (c) 1995-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 _XSControl_WorkSession_HeaderFile +#define _XSControl_WorkSession_HeaderFile + +#include +#include + +#include +#include + +class XSControl_Controller; +class XSControl_TransferReader; +class XSControl_TransferWriter; +class Transfer_TransientProcess; +class Interface_InterfaceModel; +class Transfer_FinderProcess; +class TopoDS_Shape; +class Interface_CheckIterator; + +class XSControl_WorkSession; +DEFINE_STANDARD_HANDLE(XSControl_WorkSession, IFSelect_WorkSession) + +typedef NCollection_DataMap XSControl_WorkSessionMap; + +//! This WorkSession completes the basic one, by adding : +//! - use of Controller, with norm selection... +//! - management of transfers (both ways) with auxiliary classes +//! TransferReader and TransferWriter +//! -> these transfers may work with a Context List : its items +//! are given by the user, according to the transfer to be +//! i.e. it is interpreted by the Actors +//! Each item is accessed by a Name +class XSControl_WorkSession : public IFSelect_WorkSession +{ +public: + + Standard_EXPORT XSControl_WorkSession(); + + Standard_EXPORT ~XSControl_WorkSession(); + + //! In addition to basic ClearData, clears Transfer and Management + //! for interactive use, for mode = 0,1,2 and over 4 + //! Plus : mode = 5 to clear Transfers (both ways) only + //! mode = 6 to clear enforced results + //! mode = 7 to clear transfers, results + Standard_EXPORT virtual void ClearData(const Standard_Integer theMode) Standard_OVERRIDE; + + //! Selects a Norm defined by its name. + //! A Norm is described and handled by a Controller + //! Returns True if done, False if is unknown + //! + //! The current Profile for this Norm is taken. + Standard_EXPORT Standard_Boolean SelectNorm(const Standard_CString theNormName); + + //! Selects a Norm defined by its Controller itself + Standard_EXPORT void SetController(const Handle(XSControl_Controller)& theCtl); + + //! Returns the name of the last Selected Norm. If none is + //! defined, returns an empty string + //! By default, returns the complete name of the norm + //! If is True, returns the short name used for resource + Standard_EXPORT Standard_CString SelectedNorm(const Standard_Boolean theRsc = Standard_False) const; + + //! Returns the norm controller itself + const Handle(XSControl_Controller)& NormAdaptor() const { return myController; } + + //! Returns the current reference WS List, empty if not defined + const XSControl_WorkSessionMap& ReferenceWS() const { return myReferenceWS; } + + //! Appends new refrence Work Session + Standard_EXPORT void AppendReferenceWS(const TCollection_AsciiString& theName, + const Handle(XSControl_WorkSession)& theWS); + + //! Prints the transfer status of a transferred item, as being + //! the Mapped n0 , from MapWriter if is True, or + //! from MapReader if is False + //! Returns True when done, False else (i.e. num out of range) + Standard_EXPORT Standard_Boolean PrintTransferStatus(const Standard_Integer theNum, + const Standard_Boolean theWri, + Standard_OStream& theS) const; + + //! Sets a Transfer Reader, by internal ways, according mode : + //! 0 recreates it clear, 1 clears it (does not recreate) + //! 2 aligns Roots of TransientProcess from final Results + //! 3 aligns final Results from Roots of TransientProcess + //! 4 begins a new transfer (by BeginTransfer) + //! 5 recreates TransferReader then begins a new transfer + Standard_EXPORT void InitTransferReader(const Standard_Integer theMode); + + //! Sets a Transfer Reader, which manages transfers on reading + Standard_EXPORT void SetTransferReader(const Handle(XSControl_TransferReader)& theTR); + + //! Returns the Transfer Reader, Null if not set + const Handle(XSControl_TransferReader)& TransferReader() const { return myTransferReader; } + + //! Returns the TransientProcess(internal data for TransferReader) + Standard_EXPORT Handle(Transfer_TransientProcess) MapReader() const; + + //! Changes the Map Reader, i.e. considers that the new one + //! defines the relevant read results (forgets the former ones) + //! Returns True when done, False in case of bad definition, i.e. + //! if Model from TP differs from that of Session + Standard_EXPORT Standard_Boolean SetMapReader(const Handle(Transfer_TransientProcess)& theTP); + + //! Returns the result attached to a starting entity + //! If = 0, returns Final Result + //! If = 1, considers Last Result + //! If = 2, considers Final, else if absent, Last + //! returns it as Transient, if result is not transient returns + //! the Binder + //! = 10,11,12 idem but returns the Binder itself + //! (if it is not, e.g. Shape, returns the Binder) + //! = 20, returns the ResultFromModel + Standard_EXPORT Handle(Standard_Transient) Result(const Handle(Standard_Transient)& theEnt, + const Standard_Integer theMode) const; + + //! Commands the transfer of, either one entity, or a list + //! I.E. calls the TransferReader after having analysed + //! It is cumulated from the last BeginTransfer + //! is processed by GiveList, hence : + //! - a Selection : its SelectionResult + //! - a HSequenceOfTransient : this list + //! - the Model : in this specific case, all the roots, + //! with no cumulation of former transfers (TransferReadRoots) + Standard_EXPORT Standard_Integer TransferReadOne(const Handle(Standard_Transient)& theEnts, + const Message_ProgressRange& theProgress = Message_ProgressRange()); + + //! Commands the transfer of all the root entities of the model + //! i.e. calls TransferRoot from the TransferReader with the Graph + //! No cumulation with former calls to TransferReadOne + Standard_EXPORT Standard_Integer TransferReadRoots(const Message_ProgressRange& theProgress = Message_ProgressRange()); + + //! produces and returns a new Model well conditioned + //! It is produced by the Norm Controller + //! It can be Null (if this function is not implemented) + Standard_EXPORT Handle(Interface_InterfaceModel) NewModel(); + + //! Returns the Transfer Reader, Null if not set + Standard_EXPORT const Handle(XSControl_TransferWriter)& TransferWriter() const; + + //! Changes the Map Reader, i.e. considers that the new one + //! defines the relevant read results (forgets the former ones) + //! Returns True when done, False if is Null + Standard_EXPORT Standard_Boolean SetMapWriter(const Handle(Transfer_FinderProcess)& theFP); + + //! Transfers a Shape from CasCade to a model of current norm, + //! according to the last call to SetModeWriteShape + //! Returns status :Done if OK, Fail if error during transfer, + //! Error if transfer badly initialised + Standard_EXPORT XSControl_ReturnStatus TransferWriteShape(const TopoDS_Shape& theShape, + const Standard_Boolean theCompGraph = Standard_True, + const Message_ProgressRange& theProgress = Message_ProgressRange()); + + //! Returns the check-list of last transfer (write) + //! It is recorded in the FinderProcess, but it must be bound with + //! resulting entities (in the resulting file model) rather than + //! with original objects (in fact, their mappers) + Standard_EXPORT Interface_CheckIterator TransferWriteCheckList() const; + + DEFINE_STANDARD_RTTIEXT(XSControl_WorkSession, IFSelect_WorkSession) + +protected: + + //! Clears binders + void clearBinders(); + +private: + + Handle(XSControl_Controller) myController; + Handle(XSControl_TransferReader) myTransferReader; + Handle(XSControl_TransferWriter) myTransferWriter; + XSControl_WorkSessionMap myReferenceWS; +}; + +#endif // _XSControl_WorkSession_HeaderFile diff --git a/src/DE/FILES b/src/DE/FILES index 89267b6533..ed1461c892 100644 --- a/src/DE/FILES +++ b/src/DE/FILES @@ -2,7 +2,14 @@ DE_ConfigurationContext.cxx DE_ConfigurationContext.hxx DE_ConfigurationNode.cxx DE_ConfigurationNode.hxx +DE_DataModel.cxx +DE_DataModel.hxx +DE_InterfaceParameters.cxx +DE_InterfaceParameters.hxx DE_Provider.cxx DE_Provider.hxx +DE_ReturnStatus.hxx +DE_WorkSession.cxx +DE_WorkSession.hxx DE_Wrapper.cxx DE_Wrapper.hxx diff --git a/src/HeaderSection/FILES b/src/HeaderSection/FILES index 4949ebd272..d6a1f7a1fd 100644 --- a/src/HeaderSection/FILES +++ b/src/HeaderSection/FILES @@ -6,5 +6,7 @@ HeaderSection_FileName.cxx HeaderSection_FileName.hxx HeaderSection_FileSchema.cxx HeaderSection_FileSchema.hxx +HeaderSection_MakeHeader.cxx +HeaderSection_MakeHeader.hxx HeaderSection_Protocol.cxx HeaderSection_Protocol.hxx diff --git a/src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx b/src/HeaderSection/HeaderSection_MakeHeader.cxx similarity index 71% rename from src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx rename to src/HeaderSection/HeaderSection_MakeHeader.cxx index 9f90004ff9..88c13ad1ab 100644 --- a/src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx +++ b/src/HeaderSection/HeaderSection_MakeHeader.cxx @@ -17,7 +17,7 @@ //#58 rln 28.12.98 STEP header fields (NOTE: more parameterization is necessary) //pdn 11.01.99 including for compilation on NT -#include +#include #include #include #include @@ -35,7 +35,7 @@ static Handle(TCollection_HAsciiString) nulstr; static Handle(Interface_HArray1OfHAsciiString) nularr; -APIHeaderSection_MakeHeader::APIHeaderSection_MakeHeader +HeaderSection_MakeHeader::HeaderSection_MakeHeader (const Handle(StepData_StepModel)& model) { done = Standard_True; @@ -56,7 +56,7 @@ APIHeaderSection_MakeHeader::APIHeaderSection_MakeHeader else done = Standard_False; } -APIHeaderSection_MakeHeader::APIHeaderSection_MakeHeader +HeaderSection_MakeHeader::HeaderSection_MakeHeader (const Standard_Integer shapetype) { switch(shapetype) { @@ -68,7 +68,7 @@ APIHeaderSection_MakeHeader::APIHeaderSection_MakeHeader } } -void APIHeaderSection_MakeHeader::Init (const Standard_CString nameval) +void HeaderSection_MakeHeader::Init (const Standard_CString nameval) { done = Standard_True; @@ -134,12 +134,12 @@ void APIHeaderSection_MakeHeader::Init (const Standard_CString nameval) } -Standard_Boolean APIHeaderSection_MakeHeader::IsDone() const +Standard_Boolean HeaderSection_MakeHeader::IsDone() const { return done; } -void APIHeaderSection_MakeHeader::Apply +void HeaderSection_MakeHeader::Apply (const Handle(StepData_StepModel)& model) const { Interface_EntityIterator header = model->Header(); @@ -177,7 +177,7 @@ void APIHeaderSection_MakeHeader::Apply // FileName // ======== -Handle(StepData_StepModel) APIHeaderSection_MakeHeader::NewModel +Handle(StepData_StepModel) HeaderSection_MakeHeader::NewModel (const Handle(Interface_Protocol)& protocol) const { Handle(StepData_StepModel) stepmodel = new StepData_StepModel; @@ -195,16 +195,16 @@ Handle(StepData_StepModel) APIHeaderSection_MakeHeader::NewModel // FileName // ======== -Standard_Boolean APIHeaderSection_MakeHeader::HasFn() const +Standard_Boolean HeaderSection_MakeHeader::HasFn() const { return (!fn.IsNull()); } -Handle(HeaderSection_FileName) APIHeaderSection_MakeHeader::FnValue() const +Handle(HeaderSection_FileName) HeaderSection_MakeHeader::FnValue() const { return fn; } /* -void APIHeaderSection_MakeHeader::SetNameFromShapeType(const Standard_Integer shapetype) +void HeaderSection_MakeHeader::SetNameFromShapeType(const Standard_Integer shapetype) { Handle(TCollection_HAsciiString) name; switch(shapetype) @@ -230,106 +230,106 @@ void APIHeaderSection_MakeHeader::SetNameFromShapeType(const Standard_Integer sh } */ -void APIHeaderSection_MakeHeader::SetName(const Handle(TCollection_HAsciiString)& aName) +void HeaderSection_MakeHeader::SetName(const Handle(TCollection_HAsciiString)& aName) { if (!fn.IsNull()) fn->SetName(aName); } -Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::Name() const +Handle(TCollection_HAsciiString) HeaderSection_MakeHeader::Name() const { return (fn.IsNull() ? nulstr : fn->Name()); } -void APIHeaderSection_MakeHeader::SetTimeStamp(const Handle(TCollection_HAsciiString)& aTimeStamp) +void HeaderSection_MakeHeader::SetTimeStamp(const Handle(TCollection_HAsciiString)& aTimeStamp) { if (!fn.IsNull()) fn->SetTimeStamp(aTimeStamp); } -Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::TimeStamp() const +Handle(TCollection_HAsciiString) HeaderSection_MakeHeader::TimeStamp() const { return (fn.IsNull() ? nulstr : fn->TimeStamp()); } -void APIHeaderSection_MakeHeader::SetAuthor(const Handle(Interface_HArray1OfHAsciiString)& aAuthor) +void HeaderSection_MakeHeader::SetAuthor(const Handle(Interface_HArray1OfHAsciiString)& aAuthor) { if (!fn.IsNull()) fn->SetAuthor(aAuthor); } -void APIHeaderSection_MakeHeader::SetAuthorValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aAuthor) +void HeaderSection_MakeHeader::SetAuthorValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aAuthor) { if (fn.IsNull()) return; Handle(Interface_HArray1OfHAsciiString) li = fn->Author(); if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num,aAuthor); } -Handle(Interface_HArray1OfHAsciiString) APIHeaderSection_MakeHeader::Author() const +Handle(Interface_HArray1OfHAsciiString) HeaderSection_MakeHeader::Author() const { return (fn.IsNull() ? nularr : fn->Author()); } -Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::AuthorValue(const Standard_Integer num) const +Handle(TCollection_HAsciiString) HeaderSection_MakeHeader::AuthorValue(const Standard_Integer num) const { return (fn.IsNull() ? nulstr : fn->AuthorValue(num)); } -Standard_Integer APIHeaderSection_MakeHeader::NbAuthor () const +Standard_Integer HeaderSection_MakeHeader::NbAuthor () const { return (fn.IsNull() ? 0 : fn->NbAuthor()); } -void APIHeaderSection_MakeHeader::SetOrganization(const Handle(Interface_HArray1OfHAsciiString)& aOrganization) +void HeaderSection_MakeHeader::SetOrganization(const Handle(Interface_HArray1OfHAsciiString)& aOrganization) { if (!fn.IsNull()) fn->SetOrganization(aOrganization); } -void APIHeaderSection_MakeHeader::SetOrganizationValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aOrgan) +void HeaderSection_MakeHeader::SetOrganizationValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aOrgan) { if (fn.IsNull()) return; Handle(Interface_HArray1OfHAsciiString) li = fn->Organization(); if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num,aOrgan); } -Handle(Interface_HArray1OfHAsciiString) APIHeaderSection_MakeHeader::Organization() const +Handle(Interface_HArray1OfHAsciiString) HeaderSection_MakeHeader::Organization() const { return (fn.IsNull() ? nularr : fn->Organization()); } -Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::OrganizationValue(const Standard_Integer num) const +Handle(TCollection_HAsciiString) HeaderSection_MakeHeader::OrganizationValue(const Standard_Integer num) const { return (fn.IsNull() ? nulstr : fn->OrganizationValue(num)); } -Standard_Integer APIHeaderSection_MakeHeader::NbOrganization () const +Standard_Integer HeaderSection_MakeHeader::NbOrganization () const { return (fn.IsNull() ? 0 : fn->NbOrganization()); } -void APIHeaderSection_MakeHeader::SetPreprocessorVersion(const Handle(TCollection_HAsciiString)& aPreprocessorVersion) +void HeaderSection_MakeHeader::SetPreprocessorVersion(const Handle(TCollection_HAsciiString)& aPreprocessorVersion) { if (!fn.IsNull()) fn->SetPreprocessorVersion(aPreprocessorVersion); } -Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::PreprocessorVersion() const +Handle(TCollection_HAsciiString) HeaderSection_MakeHeader::PreprocessorVersion() const { return (fn.IsNull() ? nulstr : fn->PreprocessorVersion()); } -void APIHeaderSection_MakeHeader::SetOriginatingSystem(const Handle(TCollection_HAsciiString)& aOriginatingSystem) +void HeaderSection_MakeHeader::SetOriginatingSystem(const Handle(TCollection_HAsciiString)& aOriginatingSystem) { if (!fn.IsNull()) fn->SetOriginatingSystem(aOriginatingSystem); } -Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::OriginatingSystem() const +Handle(TCollection_HAsciiString) HeaderSection_MakeHeader::OriginatingSystem() const { return (fn.IsNull() ? nulstr : fn->OriginatingSystem()); } -void APIHeaderSection_MakeHeader::SetAuthorisation(const Handle(TCollection_HAsciiString)& aAuthorisation) +void HeaderSection_MakeHeader::SetAuthorisation(const Handle(TCollection_HAsciiString)& aAuthorisation) { if (!fn.IsNull()) fn->SetAuthorisation(aAuthorisation); } -Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::Authorisation() const +Handle(TCollection_HAsciiString) HeaderSection_MakeHeader::Authorisation() const { return (fn.IsNull() ? nulstr : fn->Authorisation()); } @@ -338,37 +338,37 @@ Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::Authorisation() co // File Schema // =========== -Standard_Boolean APIHeaderSection_MakeHeader::HasFs() const +Standard_Boolean HeaderSection_MakeHeader::HasFs() const { return (!fs.IsNull()); } -Handle(HeaderSection_FileSchema) APIHeaderSection_MakeHeader::FsValue() const +Handle(HeaderSection_FileSchema) HeaderSection_MakeHeader::FsValue() const { return fs; } -void APIHeaderSection_MakeHeader::SetSchemaIdentifiers(const Handle(Interface_HArray1OfHAsciiString)& aSchemaIdentifiers) +void HeaderSection_MakeHeader::SetSchemaIdentifiers(const Handle(Interface_HArray1OfHAsciiString)& aSchemaIdentifiers) { if (!fs.IsNull()) fs->SetSchemaIdentifiers(aSchemaIdentifiers); } -void APIHeaderSection_MakeHeader::SetSchemaIdentifiersValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aSchem) +void HeaderSection_MakeHeader::SetSchemaIdentifiersValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aSchem) { if (fs.IsNull()) return; Handle(Interface_HArray1OfHAsciiString) li = fs->SchemaIdentifiers(); if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num,aSchem); } -Handle(Interface_HArray1OfHAsciiString) APIHeaderSection_MakeHeader::SchemaIdentifiers() const +Handle(Interface_HArray1OfHAsciiString) HeaderSection_MakeHeader::SchemaIdentifiers() const { return (fs.IsNull() ? nularr : fs->SchemaIdentifiers()); } -Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::SchemaIdentifiersValue(const Standard_Integer num) const +Handle(TCollection_HAsciiString) HeaderSection_MakeHeader::SchemaIdentifiersValue(const Standard_Integer num) const { return (fs.IsNull() ? nulstr : fs->SchemaIdentifiersValue(num)); } -Standard_Integer APIHeaderSection_MakeHeader::NbSchemaIdentifiers () const +Standard_Integer HeaderSection_MakeHeader::NbSchemaIdentifiers () const { return (fs.IsNull() ? 0 : fs->NbSchemaIdentifiers()); } @@ -378,7 +378,7 @@ Standard_Integer APIHeaderSection_MakeHeader::NbSchemaIdentifiers () const //purpose : //======================================================================= -void APIHeaderSection_MakeHeader::AddSchemaIdentifier(const Handle(TCollection_HAsciiString)& aSchem) +void HeaderSection_MakeHeader::AddSchemaIdentifier(const Handle(TCollection_HAsciiString)& aSchem) { if ( fs.IsNull() ) fs = new HeaderSection_FileSchema; Handle(Interface_HArray1OfHAsciiString) idents = fs->SchemaIdentifiers(); @@ -404,47 +404,47 @@ void APIHeaderSection_MakeHeader::AddSchemaIdentifier(const Handle(TCollection_H // File Description // ================ -Standard_Boolean APIHeaderSection_MakeHeader::HasFd() const +Standard_Boolean HeaderSection_MakeHeader::HasFd() const { return (!fd.IsNull()); } -Handle(HeaderSection_FileDescription) APIHeaderSection_MakeHeader::FdValue() const +Handle(HeaderSection_FileDescription) HeaderSection_MakeHeader::FdValue() const { return fd; } -void APIHeaderSection_MakeHeader::SetDescription(const Handle(Interface_HArray1OfHAsciiString)& aDescription) +void HeaderSection_MakeHeader::SetDescription(const Handle(Interface_HArray1OfHAsciiString)& aDescription) { if (!fs.IsNull()) fd->SetDescription(aDescription); } -void APIHeaderSection_MakeHeader::SetDescriptionValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aDescr) +void HeaderSection_MakeHeader::SetDescriptionValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aDescr) { if (fd.IsNull()) return; Handle(Interface_HArray1OfHAsciiString) li = fd->Description(); if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num,aDescr); } -Handle(Interface_HArray1OfHAsciiString) APIHeaderSection_MakeHeader::Description() const +Handle(Interface_HArray1OfHAsciiString) HeaderSection_MakeHeader::Description() const { return (fd.IsNull() ? nularr : fd->Description()); } -Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::DescriptionValue(const Standard_Integer num) const +Handle(TCollection_HAsciiString) HeaderSection_MakeHeader::DescriptionValue(const Standard_Integer num) const { return (fd.IsNull() ? nulstr : fd->DescriptionValue(num)); } -Standard_Integer APIHeaderSection_MakeHeader::NbDescription () const +Standard_Integer HeaderSection_MakeHeader::NbDescription () const { return (fd.IsNull() ? 0 : fd->NbDescription()); } -void APIHeaderSection_MakeHeader::SetImplementationLevel(const Handle(TCollection_HAsciiString)& aImplementationLevel) +void HeaderSection_MakeHeader::SetImplementationLevel(const Handle(TCollection_HAsciiString)& aImplementationLevel) { if (!fd.IsNull()) fd->SetImplementationLevel(aImplementationLevel); } -Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::ImplementationLevel() const +Handle(TCollection_HAsciiString) HeaderSection_MakeHeader::ImplementationLevel() const { return (fd.IsNull() ? nulstr : fd->ImplementationLevel()); } diff --git a/src/APIHeaderSection/APIHeaderSection_MakeHeader.hxx b/src/HeaderSection/HeaderSection_MakeHeader.hxx similarity index 95% rename from src/APIHeaderSection/APIHeaderSection_MakeHeader.hxx rename to src/HeaderSection/HeaderSection_MakeHeader.hxx index 9415693b65..2a34e2bb3e 100644 --- a/src/APIHeaderSection/APIHeaderSection_MakeHeader.hxx +++ b/src/HeaderSection/HeaderSection_MakeHeader.hxx @@ -14,8 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _APIHeaderSection_MakeHeader_HeaderFile -#define _APIHeaderSection_MakeHeader_HeaderFile +#ifndef _HeaderSection_MakeHeader_HeaderFile +#define _HeaderSection_MakeHeader_HeaderFile #include #include @@ -34,7 +34,7 @@ class TCollection_HAsciiString; //! This class allows to consult and prepare/edit data stored in //! a Step Model Header -class APIHeaderSection_MakeHeader +class HeaderSection_MakeHeader { public: @@ -42,11 +42,11 @@ public: //! Prepares a new MakeHeader from scratch - Standard_EXPORT APIHeaderSection_MakeHeader(const Standard_Integer shapetype = 0); + Standard_EXPORT HeaderSection_MakeHeader(const Standard_Integer shapetype = 0); //! Prepares a MakeHeader from the content of a StepModel //! See IsDone to know if the Header is well defined - Standard_EXPORT APIHeaderSection_MakeHeader(const Handle(StepData_StepModel)& model); + Standard_EXPORT HeaderSection_MakeHeader(const Handle(StepData_StepModel)& model); //! Cancels the former definition and gives a FileName //! To be used when a Model has no well defined Header @@ -199,4 +199,4 @@ private: -#endif // _APIHeaderSection_MakeHeader_HeaderFile +#endif // _HeaderSection_MakeHeader_HeaderFile diff --git a/src/IFGraph/FILES b/src/IFGraph/FILES deleted file mode 100644 index a205ace277..0000000000 --- a/src/IFGraph/FILES +++ /dev/null @@ -1,22 +0,0 @@ -IFGraph_AllConnected.cxx -IFGraph_AllConnected.hxx -IFGraph_AllShared.cxx -IFGraph_AllShared.hxx -IFGraph_Articulations.cxx -IFGraph_Articulations.hxx -IFGraph_Compare.cxx -IFGraph_Compare.hxx -IFGraph_ConnectedComponants.cxx -IFGraph_ConnectedComponants.hxx -IFGraph_Cumulate.cxx -IFGraph_Cumulate.hxx -IFGraph_Cycles.cxx -IFGraph_Cycles.hxx -IFGraph_ExternalSources.cxx -IFGraph_ExternalSources.hxx -IFGraph_SCRoots.cxx -IFGraph_SCRoots.hxx -IFGraph_StrongComponants.cxx -IFGraph_StrongComponants.hxx -IFGraph_SubPartsIterator.cxx -IFGraph_SubPartsIterator.hxx diff --git a/src/IFGraph/IFGraph_AllConnected.cxx b/src/IFGraph/IFGraph_AllConnected.cxx deleted file mode 100644 index 86c4b27160..0000000000 --- a/src/IFGraph/IFGraph_AllConnected.cxx +++ /dev/null @@ -1,52 +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 - -// AllConnected prend toutes les Entites connectees a une Entite donnee -// c-a-d toutes les "Shared" + toutes les "Sharings" et on recommence -// Autrement dit le contenu du "Composant Connexe" du graphe d'ensemble -// qui contient cette entite -// Le calcul est effectue par GetFromEntity (Evaluate n'a rien a faire) -IFGraph_AllConnected::IFGraph_AllConnected (const Interface_Graph& agraph) - : thegraph (agraph) { } - - - IFGraph_AllConnected::IFGraph_AllConnected - (const Interface_Graph& agraph, const Handle(Standard_Transient)& ent) - : thegraph (agraph) - { GetFromEntity(ent); } - - void IFGraph_AllConnected::GetFromEntity - (const Handle(Standard_Transient)& ent) -{ - if (!thegraph.IsPresent(thegraph.EntityNumber(ent))) return; - thegraph.GetFromEntity(ent,Standard_False); - - for (Interface_EntityIterator shareds = thegraph.Shareds(ent); - shareds.More(); shareds.Next()) - GetFromEntity(shareds.Value()); - - for (Interface_EntityIterator sharings = thegraph.Sharings(ent); - sharings.More(); sharings.Next()) - GetFromEntity(sharings.Value()); -} - - void IFGraph_AllConnected::ResetData () - { Reset(); thegraph.Reset(); } - - void IFGraph_AllConnected::Evaluate() - { GetFromGraph(thegraph); } // GetFromEntity a tout fait diff --git a/src/IFGraph/IFGraph_AllConnected.hxx b/src/IFGraph/IFGraph_AllConnected.hxx deleted file mode 100644 index a691700032..0000000000 --- a/src/IFGraph/IFGraph_AllConnected.hxx +++ /dev/null @@ -1,85 +0,0 @@ -// Created on: 1992-10-02 -// 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 _IFGraph_AllConnected_HeaderFile -#define _IFGraph_AllConnected_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_Transient; - - -//! this class gives content of the CONNECTED COMPONENT(S) -//! which include specific Entity(ies) -class IFGraph_AllConnected : public Interface_GraphContent -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! creates an AllConnected from a graph, empty ready to be filled - Standard_EXPORT IFGraph_AllConnected(const Interface_Graph& agraph); - - //! creates an AllConnected which memorizes Entities Connected to - //! a given one, at any level : that is, itself, all Entities - //! Shared by it and Sharing it, and so on. - //! In other terms, this is the content of the CONNECTED COMPONENT - //! which include a specific Entity - Standard_EXPORT IFGraph_AllConnected(const Interface_Graph& agraph, const Handle(Standard_Transient)& ent); - - //! adds an entity and its Connected ones to the list (allows to - //! cumulate all Entities Connected by some ones) - //! Note that if "ent" is in the already computed list,, no entity - //! will be added, but if "ent" is not already in the list, a new - //! Connected Component will be cumulated - Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent); - - //! Allows to restart on a new data set - Standard_EXPORT void ResetData(); - - //! does the specific evaluation (Connected entities atall levels) - Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - - - - -protected: - - - - - -private: - - - - Interface_Graph thegraph; - - -}; - - - - - - - -#endif // _IFGraph_AllConnected_HeaderFile diff --git a/src/IFGraph/IFGraph_AllShared.cxx b/src/IFGraph/IFGraph_AllShared.cxx deleted file mode 100644 index 02ea28c56d..0000000000 --- a/src/IFGraph/IFGraph_AllShared.cxx +++ /dev/null @@ -1,47 +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 - -IFGraph_AllShared::IFGraph_AllShared (const Interface_Graph& agraph) - : thegraph (agraph) { } - - - IFGraph_AllShared::IFGraph_AllShared - (const Interface_Graph& agraph, const Handle(Standard_Transient)& ent) - : thegraph (agraph) -{ - if (!agraph.Model()->Contains(ent)) return; - GetFromEntity(ent); -} - - void IFGraph_AllShared::GetFromEntity - (const Handle(Standard_Transient)& ent) - { thegraph.GetFromEntity(ent,Standard_True); } // le fait pour nous - - void IFGraph_AllShared::GetFromIter (const Interface_EntityIterator& iter) -{ - for (iter.Start(); iter.More(); iter.Next()) - thegraph.GetFromEntity(iter.Value(),Standard_True); -} - - void IFGraph_AllShared::ResetData () - { Reset(); thegraph.Reset(); } - - void IFGraph_AllShared::Evaluate() - { Reset(); GetFromGraph(thegraph); } diff --git a/src/IFGraph/IFGraph_AllShared.hxx b/src/IFGraph/IFGraph_AllShared.hxx deleted file mode 100644 index 496b6976a6..0000000000 --- a/src/IFGraph/IFGraph_AllShared.hxx +++ /dev/null @@ -1,85 +0,0 @@ -// Created on: 1992-09-30 -// 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 _IFGraph_AllShared_HeaderFile -#define _IFGraph_AllShared_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_Transient; -class Interface_EntityIterator; - - -//! this class determines all Entities shared by some specific -//! ones, at any level (those which will be lead in a Transfer -//! for instance) -class IFGraph_AllShared : public Interface_GraphContent -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! creates an AllShared from a graph, empty ready to be filled - Standard_EXPORT IFGraph_AllShared(const Interface_Graph& agraph); - - //! creates an AllShared which memrizes Entities shared by a given - //! one, at any level, including itself - Standard_EXPORT IFGraph_AllShared(const Interface_Graph& agraph, const Handle(Standard_Transient)& ent); - - //! adds an entity and its shared ones to the list (allows to - //! cumulate all Entities shared by some ones) - Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent); - - //! Adds Entities from an EntityIterator and all their shared - //! ones at any level - Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter); - - //! Allows to restart on a new data set - Standard_EXPORT void ResetData(); - - //! does the specific evaluation (shared entities atall levels) - Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - - - - -protected: - - - - - -private: - - - - Interface_Graph thegraph; - - -}; - - - - - - - -#endif // _IFGraph_AllShared_HeaderFile diff --git a/src/IFGraph/IFGraph_Articulations.cxx b/src/IFGraph/IFGraph_Articulations.cxx deleted file mode 100644 index f185c25b0f..0000000000 --- a/src/IFGraph/IFGraph_Articulations.cxx +++ /dev/null @@ -1,82 +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 - -// Points d'Articulation d'un Graphe : ce sont les "passages obliges" du graphe -// Algorithme tire du Sedgewick, p 392 -IFGraph_Articulations::IFGraph_Articulations - (const Interface_Graph& agraph, const Standard_Boolean whole) - : thegraph (agraph) - { if (whole) thegraph.GetFromModel(); } - - - void IFGraph_Articulations::GetFromEntity - (const Handle(Standard_Transient)& ent) - { thegraph.GetFromEntity(ent,Standard_True); } - - void IFGraph_Articulations::GetFromIter(const Interface_EntityIterator& iter) - { thegraph.GetFromIter(iter,0); } - - - void IFGraph_Articulations::ResetData () -{ Reset(); thegraph.Reset(); thelist = new TColStd_HSequenceOfInteger(); } - - void IFGraph_Articulations::Evaluate () -{ -// Algorithme, cf Sedgewick "Algorithms", p 392 - thelist = new TColStd_HSequenceOfInteger(); -// Utilisation de Visit - Standard_Integer nb = thegraph.Size(); - for (Standard_Integer i = 1; i <= nb; i ++) { - thenow = 0; - if (thegraph.IsPresent(i)) Visit(i); - } -// Resultat dans thelist - Reset(); - Standard_Integer nbres = thelist->Length(); - for (Standard_Integer ires = 1; ires <= nbres; ires ++) { - Standard_Integer num = thelist->Value(ires); - GetOneItem(thegraph.Model()->Value(num)); - } -} - - Standard_Integer IFGraph_Articulations::Visit (const Standard_Integer num) -{ - thenow ++; - thegraph.SetStatus(num,thenow); - Standard_Integer min = thenow; - - for (Interface_EntityIterator iter = thegraph.Shareds(thegraph.Entity(num)); - iter.More(); iter.Next()) { - Handle(Standard_Transient) ent = iter.Value(); - Standard_Integer nument = thegraph.EntityNumber(ent); - if (!thegraph.IsPresent(num)) { - thegraph.GetFromEntity(ent,Standard_False); - nument = thegraph.EntityNumber(ent); - } - Standard_Integer statent = thegraph.Status(nument); // pas reevalue - if (statent == 0) { - Standard_Integer mm = Visit(nument); - if (mm < min) min = mm; - if (mm > thegraph.Status(num)) thelist->Append(num); // ON EN A UN : num - } - else if (statent < min) min = statent; - } - return min; -} diff --git a/src/IFGraph/IFGraph_Articulations.hxx b/src/IFGraph/IFGraph_Articulations.hxx deleted file mode 100644 index 94480c158e..0000000000 --- a/src/IFGraph/IFGraph_Articulations.hxx +++ /dev/null @@ -1,75 +0,0 @@ -// Created on: 1992-09-23 -// 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 _IFGraph_Articulations_HeaderFile -#define _IFGraph_Articulations_HeaderFile - -#include -#include -#include - -#include -#include -#include -#include -#include -class Standard_Transient; -class Interface_EntityIterator; - -//! this class gives entities which are Articulation points -//! in a whole Model or in a sub-part -//! An Articulation Point divides the graph in two (or more) -//! disconnected sub-graphs -//! Identifying Articulation Points allows improving -//! efficiency of splitting a set of Entities into sub-sets -class IFGraph_Articulations : public Interface_GraphContent -{ -public: - - DEFINE_STANDARD_ALLOC - - //! creates Articulations to evaluate a Graph - //! whole True : works on the whole Model - //! whole False : remains empty, ready to work on a sub-part - Standard_EXPORT IFGraph_Articulations(const Interface_Graph& agraph, const Standard_Boolean whole); - - //! adds an entity and its shared ones to the list - Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent); - - //! adds a list of entities (as an iterator) - Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter); - - //! Allows to restart on a new data set - Standard_EXPORT void ResetData(); - - //! Evaluates the list of Articulation points - Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - -private: - - //! basic routine of computation - //! (see book Sedgewick "Algorithms", p 392) - Standard_EXPORT Standard_Integer Visit (const Standard_Integer num); - -private: - - Interface_Graph thegraph; - Standard_Integer thenow; - Handle(TColStd_HSequenceOfInteger) thelist; - -}; - -#endif // _IFGraph_Articulations_HeaderFile diff --git a/src/IFGraph/IFGraph_Compare.cxx b/src/IFGraph/IFGraph_Compare.cxx deleted file mode 100644 index b23454959d..0000000000 --- a/src/IFGraph/IFGraph_Compare.cxx +++ /dev/null @@ -1,78 +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 - -// Comparateur de deux sous-ensembles d un Modele -// Au premier sous-ensemble, est attribue le Status 1 -// Au deuxieme sous-ensemble, est attribue le Status 2 -// La partie commune se voit attribuer le Status 3 -IFGraph_Compare::IFGraph_Compare (const Interface_Graph& agraph) - : thegraph (agraph) { } - - void IFGraph_Compare::GetFromEntity - (const Handle(Standard_Transient)& ent, const Standard_Boolean first) -{ - IFGraph_AllShared iter(thegraph.Model(),ent); - GetFromIter(iter,first); -} - - void IFGraph_Compare::GetFromIter - (const Interface_EntityIterator& iter, const Standard_Boolean first) -{ - Standard_Integer stat = 2; - if (first) stat = 1; - thegraph.GetFromIter(iter,stat,3,Standard_False); -} - - - void IFGraph_Compare::Merge () -{ - thegraph.ChangeStatus (2,1); - thegraph.ChangeStatus (3,1); -} - - void IFGraph_Compare::RemoveSecond () -{ - thegraph.ChangeStatus (3,1); - thegraph.RemoveStatus (2); -} - - void IFGraph_Compare::KeepCommon () -{ - thegraph.RemoveStatus (1); - thegraph.RemoveStatus (2); - thegraph.ChangeStatus (3,1); -} - - void IFGraph_Compare::ResetData () - { Reset(); thegraph.Reset(); } - - void IFGraph_Compare::Evaluate () -{ - Reset(); GetFromGraph(thegraph); // Evaluation deja faite par le graphe -} - - Interface_EntityIterator IFGraph_Compare::Common () const - { return Interface_GraphContent(thegraph,3); } - - Interface_EntityIterator IFGraph_Compare::FirstOnly () const - { return Interface_GraphContent(thegraph,1); } - - Interface_EntityIterator IFGraph_Compare::SecondOnly () const - { return Interface_GraphContent(thegraph,2); } diff --git a/src/IFGraph/IFGraph_Compare.hxx b/src/IFGraph/IFGraph_Compare.hxx deleted file mode 100644 index e7d9b5c303..0000000000 --- a/src/IFGraph/IFGraph_Compare.hxx +++ /dev/null @@ -1,105 +0,0 @@ -// Created on: 1992-09-23 -// 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 _IFGraph_Compare_HeaderFile -#define _IFGraph_Compare_HeaderFile - -#include -#include -#include - -#include -#include -class Standard_Transient; -class Interface_EntityIterator; - - -//! this class evaluates effect of two compared sub-parts : -//! cumulation (union), common part (intersection-overlapping) -//! part specific to first sub-part or to the second one -//! Results are kept in a Graph, several question can be set -//! Basic Iteration gives Cumulation (union) -class IFGraph_Compare : public Interface_GraphContent -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! creates empty Compare, ready to work - Standard_EXPORT IFGraph_Compare(const Interface_Graph& agraph); - - //! adds an entity and its shared ones to the list : - //! first True means adds to the first sub-list, else to the 2nd - Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent, const Standard_Boolean first); - - //! adds a list of entities (as an iterator) as such, that is, - //! their shared entities are not considered (use AllShared to - //! have them) - //! first True means adds to the first sub-list, else to the 2nd - Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter, const Standard_Boolean first); - - //! merges the second list into the first one, hence the second - //! list is empty - Standard_EXPORT void Merge(); - - //! Removes the contents of second list - Standard_EXPORT void RemoveSecond(); - - //! Keeps only Common part, sets it as First list and clears - //! second list - Standard_EXPORT void KeepCommon(); - - //! Allows to restart on a new data set - Standard_EXPORT void ResetData(); - - //! Recomputes result of comparing to sub-parts - Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - - //! returns entities common to the both parts - Standard_EXPORT Interface_EntityIterator Common() const; - - //! returns entities which are exclusively in the first list - Standard_EXPORT Interface_EntityIterator FirstOnly() const; - - //! returns entities which are exclusively in the second part - Standard_EXPORT Interface_EntityIterator SecondOnly() const; - - - - -protected: - - - - - -private: - - - - Interface_Graph thegraph; - - -}; - - - - - - - -#endif // _IFGraph_Compare_HeaderFile diff --git a/src/IFGraph/IFGraph_ConnectedComponants.cxx b/src/IFGraph/IFGraph_ConnectedComponants.cxx deleted file mode 100644 index 519e3b2ff4..0000000000 --- a/src/IFGraph/IFGraph_ConnectedComponants.cxx +++ /dev/null @@ -1,44 +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 - -// Pour travailler, ConnectedComponants exploite AllConnected : -// On prend un 1er Vertex, on determine ses AllConnected -> voila un 1er -// Connected Component -// On recommence jusqu'a ce qu'il n'y ait plus de Vertex libre -// Honnetement, si ca ne marche pas, cf classe ConnectedVerticesIterator -// de GraphTools qui fait en principe la meme chose -IFGraph_ConnectedComponants::IFGraph_ConnectedComponants - (const Interface_Graph& agraph, const Standard_Boolean whole) - : IFGraph_SubPartsIterator (agraph, whole) { } - - void IFGraph_ConnectedComponants::Evaluate() -{ -// On part des "loaded" -// Pour chacun : s il est note dans le graphe, on passe -// Sinon, on ajoute les AllConnected en tant que sub-part - Interface_EntityIterator loaded = Loaded(); - Reset(); - for (loaded.Start(); loaded.More(); loaded.Next()) { - Handle(Standard_Transient) ent = loaded.Value(); - if (IsInPart(ent)) continue; - IFGraph_AllConnected connect(Model(),ent); - AddPart(); - GetFromIter (connect); - } -} diff --git a/src/IFGraph/IFGraph_ConnectedComponants.hxx b/src/IFGraph/IFGraph_ConnectedComponants.hxx deleted file mode 100644 index a29fe82d96..0000000000 --- a/src/IFGraph/IFGraph_ConnectedComponants.hxx +++ /dev/null @@ -1,44 +0,0 @@ -// Created on: 1992-09-23 -// 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 _IFGraph_ConnectedComponants_HeaderFile -#define _IFGraph_ConnectedComponants_HeaderFile - -#include -#include - -#include -class Interface_Graph; - -//! determines Connected Components in a Graph. -//! They define disjoined sets of Entities. -class IFGraph_ConnectedComponants : public IFGraph_SubPartsIterator -{ -public: - - DEFINE_STANDARD_ALLOC - - //! creates with a Graph, and will analyse : - //! whole True : all the contents of the Model - //! whole False : sub-parts which will be given later - Standard_EXPORT IFGraph_ConnectedComponants(const Interface_Graph& agraph, const Standard_Boolean whole); - - //! does the computation - Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - -}; - -#endif // _IFGraph_ConnectedComponants_HeaderFile diff --git a/src/IFGraph/IFGraph_Cumulate.cxx b/src/IFGraph/IFGraph_Cumulate.cxx deleted file mode 100644 index 453ec33753..0000000000 --- a/src/IFGraph/IFGraph_Cumulate.cxx +++ /dev/null @@ -1,107 +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 - -// Calcul de cumul -// Tres simple, on note les entites demandees, et a la fin -// on a le cumul lui-meme, et comme infos derivees, les doubles et les oublis -// Chaque recouvrement correspond a une augmentation de UN du status -// Les status demarrent a 2, ainsi a l ajout d une entite, on distingue bien -// entre les entites nouvelles, liees a cet appel (statut temporaire 1) et les -// autres (statut superieur ou egal a 2) -IFGraph_Cumulate::IFGraph_Cumulate (const Interface_Graph& agraph) - : thegraph (agraph) { } - - void IFGraph_Cumulate::GetFromEntity - (const Handle(Standard_Transient)& ent) -{ - IFGraph_AllShared iter(thegraph.Model(),ent); - GetFromIter (iter); -} - - void IFGraph_Cumulate::ResetData () - { Reset(); thegraph.Reset(); } - - void IFGraph_Cumulate::GetFromIter (const Interface_EntityIterator& iter) -{ - thegraph.GetFromIter(iter,1,1,Standard_True); - thegraph.ChangeStatus (1,2); // une fois le calcul fait -} - - void IFGraph_Cumulate::Evaluate () -{ - Reset(); GetFromGraph(thegraph); // evaluation deja faite dans le graphe -} - - Interface_EntityIterator IFGraph_Cumulate::Overlapped () const -{ - Interface_EntityIterator iter; - Standard_Integer nb = thegraph.Size(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (thegraph.IsPresent(i) && thegraph.Status(i) > 2) - iter.GetOneItem(thegraph.Entity(i)); - } - return iter; -} - - Interface_EntityIterator IFGraph_Cumulate::Forgotten () const -{ - Interface_EntityIterator iter; - Standard_Integer nb = thegraph.Size(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (!thegraph.IsPresent(i)) - iter.GetOneItem(thegraph.Model()->Value(i)); - } - return iter; -} - - Interface_EntityIterator IFGraph_Cumulate::PerCount - (const Standard_Integer count) const -{ - Interface_EntityIterator iter; - Standard_Integer nb = thegraph.Size(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (thegraph.IsPresent(i) && thegraph.Status(i) == (count + 1)) - iter.GetOneItem(thegraph.Model()->Value(i)); - } - return iter; -} - - - Standard_Integer IFGraph_Cumulate::NbTimes - (const Handle(Standard_Transient)& ent) const -{ - Standard_Integer num = thegraph.EntityNumber(ent); - if (num == 0) return 0; - Standard_Integer stat = thegraph.Status(num); - return stat-1; -} - - Standard_Integer IFGraph_Cumulate::HighestNbTimes () const -{ - Standard_Integer max = 0; - Standard_Integer nb = thegraph.Size(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (!thegraph.IsPresent(i)) continue; - Standard_Integer count = thegraph.Status(i) - 1; - if (count > max) max = count; - } - return max; -} diff --git a/src/IFGraph/IFGraph_Cumulate.hxx b/src/IFGraph/IFGraph_Cumulate.hxx deleted file mode 100644 index 328cc62ed4..0000000000 --- a/src/IFGraph/IFGraph_Cumulate.hxx +++ /dev/null @@ -1,100 +0,0 @@ -// Created on: 1992-09-23 -// 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 _IFGraph_Cumulate_HeaderFile -#define _IFGraph_Cumulate_HeaderFile - -#include -#include -#include - -#include -#include -#include -class Standard_Transient; -class Interface_EntityIterator; - - -//! this class evaluates effect of cumulated sub-parts : -//! overlapping, forgotten entities -//! Results are kept in a Graph, several question can be set -//! Basic Iteration gives entities which are part of Cumulation -class IFGraph_Cumulate : public Interface_GraphContent -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! creates empty Cumulate, ready to work - Standard_EXPORT IFGraph_Cumulate(const Interface_Graph& agraph); - - //! adds an entity and its shared ones to the list - Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent); - - //! adds a list of entities (as an iterator) as such, that is, - //! without their shared entities (use AllShared to have them) - Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter); - - //! Allows to restart on a new data set - Standard_EXPORT void ResetData(); - - //! Evaluates the result of cumulation - Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - - //! returns entities which are taken several times - Standard_EXPORT Interface_EntityIterator Overlapped() const; - - //! returns entities which are not taken - Standard_EXPORT Interface_EntityIterator Forgotten() const; - - //! Returns entities taken a given count of times - //! (0 : same as Forgotten, 1 : same as no Overlap : default) - Standard_EXPORT Interface_EntityIterator PerCount (const Standard_Integer count = 1) const; - - //! returns number of times an Entity has been counted - //! (0 means forgotten, more than 1 means overlap, 1 is normal) - Standard_EXPORT Standard_Integer NbTimes (const Handle(Standard_Transient)& ent) const; - - //! Returns the highest number of times recorded for every Entity - //! (0 means empty, 1 means no overlap) - Standard_EXPORT Standard_Integer HighestNbTimes() const; - - - - -protected: - - - - - -private: - - - - Interface_Graph thegraph; - - -}; - - - - - - - -#endif // _IFGraph_Cumulate_HeaderFile diff --git a/src/IFGraph/IFGraph_Cycles.cxx b/src/IFGraph/IFGraph_Cycles.cxx deleted file mode 100644 index b4b44bc3fa..0000000000 --- a/src/IFGraph/IFGraph_Cycles.cxx +++ /dev/null @@ -1,39 +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 - -// Cycles utilise les services de StrongComponants : -// Il retient les Strong Componants qui ne sont pas Single -IFGraph_Cycles::IFGraph_Cycles - (const Interface_Graph& agraph, const Standard_Boolean whole) - : IFGraph_SubPartsIterator (agraph,whole) { } - - IFGraph_Cycles::IFGraph_Cycles (IFGraph_StrongComponants& subparts) - : IFGraph_SubPartsIterator (subparts) { } - - - void IFGraph_Cycles::Evaluate () -{ - IFGraph_StrongComponants complist(Model(),Standard_False); - complist.GetFromIter(Loaded()); - for (complist.Start(); complist.More(); complist.Next()) { - if (complist.IsSingle()) continue; - AddPart(); - GetFromIter(complist.Entities()); - } -} diff --git a/src/IFGraph/IFGraph_Cycles.hxx b/src/IFGraph/IFGraph_Cycles.hxx deleted file mode 100644 index 79d1442372..0000000000 --- a/src/IFGraph/IFGraph_Cycles.hxx +++ /dev/null @@ -1,73 +0,0 @@ -// Created on: 1992-09-23 -// 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 _IFGraph_Cycles_HeaderFile -#define _IFGraph_Cycles_HeaderFile - -#include -#include -#include - -#include -#include -class Interface_Graph; -class IFGraph_StrongComponants; - - -//! determines strong components in a graph which are Cycles -class IFGraph_Cycles : public IFGraph_SubPartsIterator -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! creates with a Graph, and will analyse : - //! whole True : all the contents of the Model - //! whole False : sub-parts which will be given later - Standard_EXPORT IFGraph_Cycles(const Interface_Graph& agraph, const Standard_Boolean whole); - - //! creates from a StrongComponants which was already computed - Standard_EXPORT IFGraph_Cycles(IFGraph_StrongComponants& subparts); - - //! does the computation. Cycles are StrongComponants which are - //! not Single - Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - - - - -protected: - - - - - -private: - - - - - -}; - - - - - - - -#endif // _IFGraph_Cycles_HeaderFile diff --git a/src/IFGraph/IFGraph_ExternalSources.cxx b/src/IFGraph/IFGraph_ExternalSources.cxx deleted file mode 100644 index 51be0657c0..0000000000 --- a/src/IFGraph/IFGraph_ExternalSources.cxx +++ /dev/null @@ -1,64 +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 - -// ExternalSources exploite les resultats stockes dans le Graphe sur Sharings -// Soit les "Sharings" des entites notees par GetFromEntity et GetFromIter -// Celles des "Sharings" qui n etaient pas deja notees sont ExternalSources -// Les status : -// - Les entites de depart sont au Status 0 -// - Les entites Sharing NOUVELLES (ExternalSources) sont au Status 1 -IFGraph_ExternalSources::IFGraph_ExternalSources - (const Interface_Graph& agraph) - : thegraph (agraph) { } - - - void IFGraph_ExternalSources::GetFromEntity - (const Handle(Standard_Transient)& ent) - { thegraph.GetFromEntity(ent,Standard_True); } - - void IFGraph_ExternalSources::GetFromIter - (const Interface_EntityIterator& iter) - { thegraph.GetFromIter(iter,0); } - - void IFGraph_ExternalSources::ResetData () - { Reset(); thegraph.Reset(); } - - - void IFGraph_ExternalSources::Evaluate () -{ - Reset(); - thegraph.RemoveStatus(1); - Standard_Integer nb = thegraph.Size(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (thegraph.IsPresent(i) && thegraph.Status(i) == 0) - thegraph.GetFromIter ( thegraph.Sharings(thegraph.Entity(i)), 1 ); - } - GetFromGraph(thegraph,1); -} - - Standard_Boolean IFGraph_ExternalSources::IsEmpty () -{ - Evaluate(); - Standard_Integer nb = thegraph.Size(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (thegraph.IsPresent(i) || thegraph.Status(i) == 1) - return Standard_False; - } - return Standard_True; -} diff --git a/src/IFGraph/IFGraph_ExternalSources.hxx b/src/IFGraph/IFGraph_ExternalSources.hxx deleted file mode 100644 index e8f379921e..0000000000 --- a/src/IFGraph/IFGraph_ExternalSources.hxx +++ /dev/null @@ -1,84 +0,0 @@ -// Created on: 1992-09-23 -// 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 _IFGraph_ExternalSources_HeaderFile -#define _IFGraph_ExternalSources_HeaderFile - -#include -#include -#include - -#include -#include -#include -class Standard_Transient; -class Interface_EntityIterator; - - -//! this class gives entities which are Source of entities of -//! a sub-part, but are not contained by this sub-part -class IFGraph_ExternalSources : public Interface_GraphContent -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! creates empty ExternalSources, ready to work - Standard_EXPORT IFGraph_ExternalSources(const Interface_Graph& agraph); - - //! adds an entity and its shared ones to the list - Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent); - - //! adds a list of entities (as an iterator) with shared ones - Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter); - - //! Allows to restart on a new data set - Standard_EXPORT void ResetData(); - - //! Evaluates external sources of a set of entities - Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - - //! Returns True if no External Source are found - //! It means that we have a "root" set - //! (performs an Evaluation as necessary) - Standard_EXPORT Standard_Boolean IsEmpty(); - - - - -protected: - - - - - -private: - - - - Interface_Graph thegraph; - - -}; - - - - - - - -#endif // _IFGraph_ExternalSources_HeaderFile diff --git a/src/IFGraph/IFGraph_SCRoots.cxx b/src/IFGraph/IFGraph_SCRoots.cxx deleted file mode 100644 index 2d7a3a1624..0000000000 --- a/src/IFGraph/IFGraph_SCRoots.cxx +++ /dev/null @@ -1,69 +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 -IFGraph_SCRoots::IFGraph_SCRoots - (const Interface_Graph& agraph, const Standard_Boolean whole) - : IFGraph_StrongComponants (agraph,whole) { } - - IFGraph_SCRoots::IFGraph_SCRoots (IFGraph_StrongComponants& subparts) - : IFGraph_StrongComponants (subparts) { } - -// StrongComponants racines d un ensemble donne -// On ne tient pas compte du reste eventuel (c est un autre probleme) -// On part du fait que StrongComponants donne les Composants dans l ordre de -// dependance, le premier ne dependant de rien (les autres, on ne sait pas ...) - - void IFGraph_SCRoots::Evaluate () -{ - IFGraph_StrongComponants complist (Model(),Standard_False); - complist.GetFromIter(Loaded()); -// Interface_Graph G(Model()); - Interface_Graph G(thegraph); -#ifdef OCCT_DEBUG - std::cout<<" SCRoots:"< -#include - -#include -class Interface_Graph; - - -//! determines strong components in a graph which are Roots -class IFGraph_SCRoots : public IFGraph_StrongComponants -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! creates with a Graph, and will analyse : - //! whole True : all the contents of the Model - //! whole False : sub-parts which will be given later - Standard_EXPORT IFGraph_SCRoots(const Interface_Graph& agraph, const Standard_Boolean whole); - - //! creates from a StrongComponants which was already computed - Standard_EXPORT IFGraph_SCRoots(IFGraph_StrongComponants& subparts); - - //! does the computation - Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - - - - -protected: - - - - - -private: - - - - - -}; - - - - - - - -#endif // _IFGraph_SCRoots_HeaderFile diff --git a/src/IFGraph/IFGraph_StrongComponants.cxx b/src/IFGraph/IFGraph_StrongComponants.cxx deleted file mode 100644 index 3eeb8b7cf1..0000000000 --- a/src/IFGraph/IFGraph_StrongComponants.cxx +++ /dev/null @@ -1,34 +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 -IFGraph_StrongComponants::IFGraph_StrongComponants - (const Interface_Graph& agraph, const Standard_Boolean whole) - : IFGraph_SubPartsIterator (agraph, whole) { } - - void IFGraph_StrongComponants::Evaluate () -{ - Interface_GraphContent iter = Loaded(); - Interface_Graph G(thegraph); G.GetFromIter(iter,0); - Standard_Integer nb = G.Size(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (!G.IsPresent(i)) continue; - AddPart(); - GetFromEntity (G.Entity(i),Standard_False); - } -} diff --git a/src/IFGraph/IFGraph_StrongComponants.hxx b/src/IFGraph/IFGraph_StrongComponants.hxx deleted file mode 100644 index 00a8ee4660..0000000000 --- a/src/IFGraph/IFGraph_StrongComponants.hxx +++ /dev/null @@ -1,69 +0,0 @@ -// Created on: 1992-09-23 -// 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 _IFGraph_StrongComponants_HeaderFile -#define _IFGraph_StrongComponants_HeaderFile - -#include -#include -#include - -#include -#include -class Interface_Graph; - - -//! determines strong components of a graph, that is -//! isolated entities (single components) or loops -class IFGraph_StrongComponants : public IFGraph_SubPartsIterator -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! creates with a Graph, and will analyse : - //! whole True : all the contents of the Model - //! whole False : sub-parts which will be given later - Standard_EXPORT IFGraph_StrongComponants(const Interface_Graph& agraph, const Standard_Boolean whole); - - //! does the computation - Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - - - - -protected: - - - - - -private: - - - - - -}; - - - - - - - -#endif // _IFGraph_StrongComponants_HeaderFile diff --git a/src/IFGraph/IFGraph_SubPartsIterator.cxx b/src/IFGraph/IFGraph_SubPartsIterator.cxx deleted file mode 100644 index 52ee0f2e6b..0000000000 --- a/src/IFGraph/IFGraph_SubPartsIterator.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 - -// SubPartsIterator permet de regrouper les entites en plusieurs sous-parties -// A chaque sous-partie est attache un Status : la 1re a 1, la 2e a 2, etc... -// (consequence, les sous-parties sont necessairement disjointes) -IFGraph_SubPartsIterator::IFGraph_SubPartsIterator - (const Interface_Graph& agraph, const Standard_Boolean whole) - : thegraph (agraph) -{ - if (whole) thegraph.GetFromModel(); - theparts = new TColStd_HSequenceOfInteger(); - thefirsts = new TColStd_HSequenceOfInteger(); - thepart = 0; - thecurr = 0; -} - - IFGraph_SubPartsIterator::IFGraph_SubPartsIterator - (IFGraph_SubPartsIterator& other) - : thegraph (other.Graph()) -{ - Standard_Integer nb = thegraph.Size(); - theparts = new TColStd_HSequenceOfInteger(); - thepart = 0; - for (other.Start(); other.More(); other.Next()) { - thepart ++; - Standard_Integer nbent = 0; - GetFromIter (other.Entities()); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (thegraph.Status(i) == thepart) nbent ++; - } - theparts->Append(nbent); // compte vide - } - thepart = 0; - thecurr = 1; -} - - void IFGraph_SubPartsIterator::GetParts - (IFGraph_SubPartsIterator& other) -{ - if (Model() != other.Model()) throw Interface_InterfaceError("SubPartsIterator : GetParts"); -// On AJOUTE les Parts de other, sans perdre les siennes propres -// (meme principe que le constructeur ci-dessus) - Standard_Integer nb = thegraph.Size(); - thepart = theparts->Length(); - for (other.Start(); other.More(); other.Next()) { - thepart ++; - Standard_Integer nbent = 0; - GetFromIter (other.Entities()); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (thegraph.Status(i) == thepart) nbent ++; - } - theparts->Append(nbent); // compte vide - } -} - - const Interface_Graph& IFGraph_SubPartsIterator::Graph () const - { return thegraph; } - -// .... Gestion Interne (remplissage, etc...) .... // - - Handle(Interface_InterfaceModel) IFGraph_SubPartsIterator::Model() const - { return thegraph.Model(); } - - void IFGraph_SubPartsIterator::AddPart () -{ - theparts->Append( Standard_Integer(0) ); - thepart = theparts->Length(); -} - - Standard_Integer IFGraph_SubPartsIterator::NbParts () const - { return theparts->Length(); } - - Standard_Integer IFGraph_SubPartsIterator::PartNum () const - { return thepart; } - - void IFGraph_SubPartsIterator::SetLoad () - { thepart = 0; } - - void IFGraph_SubPartsIterator::SetPartNum (const Standard_Integer num) -{ - if (num <= 0 || num > theparts->Length()) throw Standard_OutOfRange("IFGraph_SubPartsIterator : SetPartNum"); - thepart = num; -} - - void IFGraph_SubPartsIterator::GetFromEntity - (const Handle(Standard_Transient)& ent, const Standard_Boolean shared) -{ - thegraph.GetFromEntity(ent,shared, thepart,thepart,Standard_False); -} - - void IFGraph_SubPartsIterator::GetFromIter (const Interface_EntityIterator& iter) -{ - thegraph.GetFromIter(iter, thepart,thepart, Standard_False); -} - - void IFGraph_SubPartsIterator::Reset () -{ - thegraph.Reset(); - theparts->Clear(); - thepart = 0; - thecurr = 0; -} - - -// .... Resultat (Evaluation, Iterations) .... // - - void IFGraph_SubPartsIterator::Evaluate () -{ } // par defaut, ne fait rien; redefinie par les sous-classes - - Interface_GraphContent IFGraph_SubPartsIterator::Loaded () const -{ - Interface_EntityIterator iter; -// Standard_Integer nb = thegraph.Size(); - return Interface_GraphContent(thegraph,0); -} - - Interface_Graph IFGraph_SubPartsIterator::LoadedGraph () const -{ - Interface_Graph G(Model()); - Standard_Integer nb = thegraph.Size(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (thegraph.IsPresent(i) && thegraph.Status(i) == 0) - G.GetFromEntity(thegraph.Entity(i),Standard_False); - } - return G; -} - - - Standard_Boolean IFGraph_SubPartsIterator::IsLoaded - (const Handle(Standard_Transient)& ent) const -{ return thegraph.IsPresent(thegraph.EntityNumber(ent)); } - - Standard_Boolean IFGraph_SubPartsIterator::IsInPart - (const Handle(Standard_Transient)& ent) const -{ - Standard_Integer num = thegraph.EntityNumber(ent); - if (!thegraph.IsPresent(num)) return Standard_False; - return (thegraph.Status(num) != 0); -} - - Standard_Integer IFGraph_SubPartsIterator::EntityPartNum - (const Handle(Standard_Transient)& ent) const -{ - Standard_Integer num = thegraph.EntityNumber(ent); - if (!thegraph.IsPresent(num)) return 0; - return thegraph.Status(num); -} - - - void IFGraph_SubPartsIterator::Start () -{ - Evaluate(); -// On evalue les tailles des contenus des Parts - Standard_Integer nb = thegraph.Size(); - Standard_Integer nbp = theparts->Length(); - if (thepart > nbp) thepart = nbp; - if (nbp == 0) { thecurr = 1; return; } // L Iteration s arrete de suite - -// - On fait les comptes (via tableaux pour performances) - TColStd_Array1OfInteger partcounts (1,nbp); partcounts.Init(0); - TColStd_Array1OfInteger partfirsts (1,nbp); partfirsts.Init(0); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (!thegraph.IsPresent(i)) continue; - Standard_Integer nump = thegraph.Status(i); - if (nump < 1 || nump > nbp) continue; - Standard_Integer nbent = partcounts.Value(nump); - partcounts.SetValue(nump,nbent+1); - if (nbent == 0) partfirsts.SetValue(nump,i); - } -// - On les met en forme (c-a-d dans les sequences) - theparts->Clear(); thefirsts->Clear(); - Standard_Integer lastp = 0; - for (Standard_Integer np = 1; np <= nbp; np ++) { - Standard_Integer nbent = partcounts.Value(np); - if (np != 0) lastp = np; - theparts->Append (nbent); - thefirsts->Append (partfirsts.Value(np)); - } - if (lastp < nbp) theparts->Remove(lastp+1,nbp); -// Enfin, on se prepare a iterer - thecurr = 1; -} - - Standard_Boolean IFGraph_SubPartsIterator::More () -{ - if (thecurr == 0) Start(); - return (thecurr <= theparts->Length()); -} - - void IFGraph_SubPartsIterator::Next () -{ - thecurr ++; if (thecurr > theparts->Length()) return; - if (theparts->Value(thecurr) == 0) Next(); // sauter parties vides -} - - Standard_Boolean IFGraph_SubPartsIterator::IsSingle () const -{ - if (thecurr < 1 || thecurr > theparts->Length()) throw Standard_NoSuchObject("IFGraph_SubPartsIterator : IsSingle"); - return (theparts->Value(thecurr) == 1); -} - - Handle(Standard_Transient) IFGraph_SubPartsIterator::FirstEntity - () const -{ - if (thecurr < 1 || thecurr > theparts->Length()) throw Standard_NoSuchObject("IFGraph_SubPartsIterator : FirstEntity"); - Standard_Integer nument = thefirsts->Value(thecurr); - if (nument == 0) throw Standard_NoSuchObject("IFGraph_SubPartsIterator : FirstEntity (current part is empty)"); - return thegraph.Entity(nument); -} - - Interface_EntityIterator IFGraph_SubPartsIterator::Entities () const -{ - if (thecurr < 1 || thecurr > theparts->Length()) throw Standard_NoSuchObject("IFGraph_SubPartsIterator : Entities"); - Interface_EntityIterator iter; - Standard_Integer nb = thegraph.Size(); - Standard_Integer nument = thefirsts->Value(thecurr); - if (nument == 0) return iter; - if (theparts->Value(thecurr) == 1) nb = nument; // evident : 1 seule Entite - for (Standard_Integer i = nument; i <= nb; i ++) { - if (thegraph.Status(i) == thecurr && thegraph.IsPresent(i)) - iter.GetOneItem(thegraph.Entity(i)); - } - return iter; -} - -//======================================================================= -//function : ~IFGraph_SubPartsIterator -//purpose : -//======================================================================= - -IFGraph_SubPartsIterator::~IFGraph_SubPartsIterator() -{} diff --git a/src/IFGraph/IFGraph_SubPartsIterator.hxx b/src/IFGraph/IFGraph_SubPartsIterator.hxx deleted file mode 100644 index d5f26972f0..0000000000 --- a/src/IFGraph/IFGraph_SubPartsIterator.hxx +++ /dev/null @@ -1,180 +0,0 @@ -// Created on: 1992-09-23 -// 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 _IFGraph_SubPartsIterator_HeaderFile -#define _IFGraph_SubPartsIterator_HeaderFile - -#include -#include -#include - -#include -#include -#include -#include -class Interface_InterfaceModel; -class Standard_Transient; -class Interface_EntityIterator; -class Interface_GraphContent; - - -//! defines general form for graph classes of which result is -//! not a single iteration on Entities, but a nested one : -//! External iteration works on sub-parts, identified by each -//! class (according to its algorithm) -//! Internal Iteration concerns Entities of a sub-part -//! Sub-Parts are assumed to be disjoined; if they are not, -//! the first one has priority -//! -//! A SubPartsIterator can work in two steps : first, load -//! entities which have to be processed -//! then, analyse to set those entities into sub-parts -class IFGraph_SubPartsIterator -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! Creates with a Graph, whole or parts of it - //! whole True : works on the entire Model - //! whole False : empty, ready to be filled - //! SubPartIterator is set to load entities - Standard_EXPORT IFGraph_SubPartsIterator(const Interface_Graph& agraph, const Standard_Boolean whole); - - //! Creates a SubPartIterator from another one and gets its Data - //! Note that only non-empty sub-parts are taken into account - //! PartNum is set to the last one - Standard_EXPORT IFGraph_SubPartsIterator(IFGraph_SubPartsIterator& other); - - //! Gets Parts from another SubPartsIterator (in addition to the - //! ones already recorded) - //! Error if both SubPartsIterators are not based on the same Model - Standard_EXPORT void GetParts (IFGraph_SubPartsIterator& other); - - //! Returns the Model with which this Iterator was created - Standard_EXPORT Handle(Interface_InterfaceModel) Model() const; - - //! Adds an empty part and sets it to receive entities - Standard_EXPORT void AddPart(); - - //! Returns count of registered parts - Standard_EXPORT Standard_Integer NbParts() const; - - //! Returns numero of part which currently receives entities - //! (0 at load time) - Standard_EXPORT Standard_Integer PartNum() const; - - //! Sets SubPartIterator to get Entities (by GetFromEntity & - //! GetFromIter) into load status, to be analysed later - Standard_EXPORT void SetLoad(); - - //! Sets numero of receiving part to a new value - //! Error if not in range (1-NbParts) - Standard_EXPORT void SetPartNum (const Standard_Integer num); - - //! Adds an Entity : into load status if in Load mode, to the - //! current part if there is one. If shared is True, adds - //! also its shared ones (shared at all levels) - Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent, const Standard_Boolean shared); - - //! Adds a list of Entities (into Load mode or to a Part), - //! given as an Iterator - Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter); - - //! Erases data (parts, entities) : "me" becomes empty and in - //! load status - Standard_EXPORT void Reset(); - - //! Called by Clear, this method allows evaluation just before - //! iteration; its default is doing nothing, it is designed to - //! be redefined - Standard_EXPORT virtual void Evaluate(); - - //! Returns entities which where loaded (not set into a sub-part) - Standard_EXPORT Interface_GraphContent Loaded() const; - - //! Same as above, but under the form of a Graph - Standard_EXPORT Interface_Graph LoadedGraph() const; - - //! Returns True if an Entity is loaded (either set into a - //! sub-part or not) - Standard_EXPORT Standard_Boolean IsLoaded (const Handle(Standard_Transient)& ent) const; - - //! Returns True if an Entity is Present in a sub-part - Standard_EXPORT Standard_Boolean IsInPart (const Handle(Standard_Transient)& ent) const; - - //! Returns number of the sub-part in which an Entity has been set - //! if it is not in a sub-part (or not loaded at all), Returns 0 - Standard_EXPORT Standard_Integer EntityPartNum (const Handle(Standard_Transient)& ent) const; - - //! Sets iteration to its beginning; calls Evaluate - Standard_EXPORT void Start(); - - //! Returns True if there are more sub-parts to iterate on - //! Note : an empty sub-part is not taken in account by Iteration - Standard_EXPORT Standard_Boolean More(); - - //! Sets iteration to the next sub-part - //! if there is not, IsSingle-Entities will raises an exception - Standard_EXPORT void Next(); - - //! Returns True if current sub-part is single (has only one Entity) - //! Error if there is no sub-part to iterate now - Standard_EXPORT Standard_Boolean IsSingle() const; - - //! Returns the first entity of current sub-part, that is for a - //! Single one, the only one it contains - //! Error : same as above (end of iteration) - Standard_EXPORT Handle(Standard_Transient) FirstEntity() const; - - //! Returns current sub-part, not as a "Value", but as an Iterator - //! on Entities it contains - //! Error : same as above (end of iteration) - Standard_EXPORT Interface_EntityIterator Entities() const; - - Standard_EXPORT virtual ~IFGraph_SubPartsIterator(); - -protected: - - - - Interface_Graph thegraph; - - -private: - - - //! Returns the Graph used by . Used to create another - //! SubPartsIterator from - Standard_EXPORT const Interface_Graph& Graph() const; - - - Handle(TColStd_HSequenceOfInteger) theparts; - Handle(TColStd_HSequenceOfInteger) thefirsts; - Standard_Integer thepart; - Standard_Integer thecurr; - - -}; - - - - - - - -#endif // _IFGraph_SubPartsIterator_HeaderFile diff --git a/src/IFSelect/FILES b/src/IFSelect/FILES deleted file mode 100755 index f9ee2479b7..0000000000 --- a/src/IFSelect/FILES +++ /dev/null @@ -1,159 +0,0 @@ -IFSelect.cxx -IFSelect.hxx -IFSelect_AppliedModifiers.cxx -IFSelect_AppliedModifiers.hxx -IFSelect_BasicDumper.cxx -IFSelect_BasicDumper.hxx -IFSelect_CheckCounter.cxx -IFSelect_CheckCounter.hxx -IFSelect_ContextModif.cxx -IFSelect_ContextModif.hxx -IFSelect_ContextWrite.cxx -IFSelect_ContextWrite.hxx -IFSelect_Dispatch.cxx -IFSelect_Dispatch.hxx -IFSelect_DispGlobal.cxx -IFSelect_DispGlobal.hxx -IFSelect_DispPerCount.cxx -IFSelect_DispPerCount.hxx -IFSelect_DispPerFiles.cxx -IFSelect_DispPerFiles.hxx -IFSelect_DispPerOne.cxx -IFSelect_DispPerOne.hxx -IFSelect_DispPerSignature.cxx -IFSelect_DispPerSignature.hxx -IFSelect_EditForm.cxx -IFSelect_EditForm.hxx -IFSelect_Editor.cxx -IFSelect_Editor.hxx -IFSelect_EditValue.hxx -IFSelect_FileModifier.gxx -IFSelect_GeneralModifier.cxx -IFSelect_GeneralModifier.hxx -IFSelect_GraphCounter.cxx -IFSelect_GraphCounter.hxx -IFSelect_HSeqOfSelection.hxx -IFSelect_IntParam.cxx -IFSelect_IntParam.hxx -IFSelect_ListEditor.cxx -IFSelect_ListEditor.hxx -IFSelect_ModelCopier.cxx -IFSelect_ModelCopier.hxx -IFSelect_ModelModifier.gxx -IFSelect_ModifEditForm.cxx -IFSelect_ModifEditForm.hxx -IFSelect_Modifier.cxx -IFSelect_Modifier.hxx -IFSelect_ModifReorder.cxx -IFSelect_ModifReorder.hxx -IFSelect_PacketList.cxx -IFSelect_PacketList.hxx -IFSelect_ParamEditor.cxx -IFSelect_ParamEditor.hxx -IFSelect_PrintCount.hxx -IFSelect_PrintFail.hxx -IFSelect_RemainMode.hxx -IFSelect_ReturnStatus.hxx -IFSelect_SelectAnyList.cxx -IFSelect_SelectAnyList.hxx -IFSelect_SelectAnyType.cxx -IFSelect_SelectAnyType.hxx -IFSelect_SelectBase.cxx -IFSelect_SelectBase.hxx -IFSelect_SelectCombine.cxx -IFSelect_SelectCombine.hxx -IFSelect_SelectControl.cxx -IFSelect_SelectControl.hxx -IFSelect_SelectDeduct.cxx -IFSelect_SelectDeduct.hxx -IFSelect_SelectDiff.cxx -IFSelect_SelectDiff.hxx -IFSelect_SelectEntityNumber.cxx -IFSelect_SelectEntityNumber.hxx -IFSelect_SelectErrorEntities.cxx -IFSelect_SelectErrorEntities.hxx -IFSelect_SelectExplore.cxx -IFSelect_SelectExplore.hxx -IFSelect_SelectExtract.cxx -IFSelect_SelectExtract.hxx -IFSelect_SelectFlag.cxx -IFSelect_SelectFlag.hxx -IFSelect_SelectIncorrectEntities.cxx -IFSelect_SelectIncorrectEntities.hxx -IFSelect_SelectInList.cxx -IFSelect_SelectInList.hxx -IFSelect_SelectIntersection.cxx -IFSelect_SelectIntersection.hxx -IFSelect_Selection.cxx -IFSelect_Selection.hxx -IFSelect_SelectionIterator.cxx -IFSelect_SelectionIterator.hxx -IFSelect_SelectModelEntities.cxx -IFSelect_SelectModelEntities.hxx -IFSelect_SelectModelRoots.cxx -IFSelect_SelectModelRoots.hxx -IFSelect_SelectPointed.cxx -IFSelect_SelectPointed.hxx -IFSelect_SelectRange.cxx -IFSelect_SelectRange.hxx -IFSelect_SelectRootComps.cxx -IFSelect_SelectRootComps.hxx -IFSelect_SelectRoots.cxx -IFSelect_SelectRoots.hxx -IFSelect_SelectSent.cxx -IFSelect_SelectSent.hxx -IFSelect_SelectShared.cxx -IFSelect_SelectShared.hxx -IFSelect_SelectSharing.cxx -IFSelect_SelectSharing.hxx -IFSelect_SelectSignature.cxx -IFSelect_SelectSignature.hxx -IFSelect_SelectSignedShared.cxx -IFSelect_SelectSignedShared.hxx -IFSelect_SelectSignedSharing.cxx -IFSelect_SelectSignedSharing.hxx -IFSelect_SelectSuite.cxx -IFSelect_SelectSuite.hxx -IFSelect_SelectType.cxx -IFSelect_SelectType.hxx -IFSelect_SelectUnion.cxx -IFSelect_SelectUnion.hxx -IFSelect_SelectUnknownEntities.cxx -IFSelect_SelectUnknownEntities.hxx -IFSelect_SequenceOfAppliedModifiers.hxx -IFSelect_SequenceOfGeneralModifier.hxx -IFSelect_SequenceOfInterfaceModel.hxx -IFSelect_SessionDumper.cxx -IFSelect_SessionDumper.hxx -IFSelect_SessionFile.cxx -IFSelect_SessionFile.hxx -IFSelect_ShareOut.cxx -IFSelect_ShareOut.hxx -IFSelect_ShareOutResult.cxx -IFSelect_ShareOutResult.hxx -IFSelect_SignAncestor.cxx -IFSelect_SignAncestor.hxx -IFSelect_Signature.cxx -IFSelect_Signature.hxx -IFSelect_SignatureList.cxx -IFSelect_SignatureList.hxx -IFSelect_SignCategory.cxx -IFSelect_SignCategory.hxx -IFSelect_SignCounter.cxx -IFSelect_SignCounter.hxx -IFSelect_SignMultiple.cxx -IFSelect_SignMultiple.hxx -IFSelect_SignType.cxx -IFSelect_SignType.hxx -IFSelect_SignValidity.cxx -IFSelect_SignValidity.hxx -IFSelect_Transformer.cxx -IFSelect_Transformer.hxx -IFSelect_TransformStandard.cxx -IFSelect_TransformStandard.hxx -IFSelect_TSeqOfDispatch.hxx -IFSelect_TSeqOfSelection.hxx -IFSelect_WorkLibrary.cxx -IFSelect_WorkLibrary.hxx -IFSelect_WorkSession.cxx -IFSelect_WorkSession.hxx diff --git a/src/IFSelect/IFSelect.cxx b/src/IFSelect/IFSelect.cxx deleted file mode 100644 index 5677e24b79..0000000000 --- a/src/IFSelect/IFSelect.cxx +++ /dev/null @@ -1,33 +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 - -// Methodes de confort, evitant de devoir connaitre SessionFile, qui est un -// Tool non destine a l export (en particulier, pas un Handle) -Standard_Boolean IFSelect::SaveSession - (const Handle(IFSelect_WorkSession)& WS, const Standard_CString file) -{ - IFSelect_SessionFile sesfile(WS,file); - return sesfile.IsDone(); -} - - Standard_Boolean IFSelect::RestoreSession - (const Handle(IFSelect_WorkSession)& WS, const Standard_CString file) -{ - IFSelect_SessionFile sesfile(WS); - return (sesfile.Read(file) == 0); -} diff --git a/src/IFSelect/IFSelect.hxx b/src/IFSelect/IFSelect.hxx deleted file mode 100644 index 57774b9a4e..0000000000 --- a/src/IFSelect/IFSelect.hxx +++ /dev/null @@ -1,60 +0,0 @@ -// Created on: 1992-09-21 -// 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 _IFSelect_HeaderFile -#define _IFSelect_HeaderFile - -#include -#include -#include - -#include -class IFSelect_WorkSession; - - -//! Gives tools to manage Selecting a group of Entities -//! processed by an Interface, for instance to divide up an -//! original Model (from a File) to several smaller ones -//! They use description of an Interface Model as a graph -//! -//! Remark that this corresponds to the description of a -//! "scenario" of sharing out a File. Parts of this Scenario -//! are intended to be permanently stored. IFSelect provides -//! the Transient, active counterparts (to run the Scenario). -//! But a permanent one (either as Persistent Objects or as -//! interpretable Text) must be provided elsewhere. -class IFSelect -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! Saves the state of a WorkSession from IFSelect, by using a - //! SessionFile from IFSelect. Returns True if Done, False in - //! case of Error on Writing. gives the name of the File - //! to be produced (this avoids to export the class SessionFile). - Standard_EXPORT static Standard_Boolean SaveSession (const Handle(IFSelect_WorkSession)& WS, const Standard_CString file); - - //! Restore the state of a WorkSession from IFSelect, by using a - //! SessionFile from IFSelect. Returns True if Done, False in - //! case of Error on Writing. gives the name of the File - //! to be used (this avoids to export the class SessionFile). - Standard_EXPORT static Standard_Boolean RestoreSession (const Handle(IFSelect_WorkSession)& WS, const Standard_CString file); - -}; - -#endif // _IFSelect_HeaderFile diff --git a/src/IFSelect/IFSelect_AppliedModifiers.cxx b/src/IFSelect/IFSelect_AppliedModifiers.cxx deleted file mode 100644 index 76e4bd40b6..0000000000 --- a/src/IFSelect/IFSelect_AppliedModifiers.cxx +++ /dev/null @@ -1,74 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_AppliedModifiers,Standard_Transient) - -IFSelect_AppliedModifiers::IFSelect_AppliedModifiers - (const Standard_Integer nbmax, const Standard_Integer nbent) - : thelists (nbmax+1) -{ - thenbent = nbent; theentcnt = 0; -} - - Standard_Boolean IFSelect_AppliedModifiers::AddModif - (const Handle(IFSelect_GeneralModifier)& modif) -{ - if (themodifs.Length() >= thelists.NbEntities()) return Standard_False; - themodifs.Append(modif); - thelists.SetNumber (themodifs.Length()); - return Standard_True; -} - - Standard_Boolean IFSelect_AppliedModifiers::AddNum - (const Standard_Integer nument) -{ - thelists.Add (nument); - return Standard_True; -} - - - Standard_Integer IFSelect_AppliedModifiers::Count () const - { return themodifs.Length(); } - - Standard_Boolean IFSelect_AppliedModifiers::Item - (const Standard_Integer num, - Handle(IFSelect_GeneralModifier)& modif, - Standard_Integer& entcount) -{ - if (num < 1 || num > themodifs.Length()) return Standard_False; - modif = themodifs.Value(num); - thelists.SetNumber (num); - theentcnt = thelists.Length(); - entcount = (theentcnt > 0 ? theentcnt : thenbent); - return Standard_True; -} - - Standard_Integer IFSelect_AppliedModifiers::ItemNum - (const Standard_Integer nument) const - { return (theentcnt > 0 ? thelists.Value(nument) : nument); } - - Handle(TColStd_HSequenceOfInteger) IFSelect_AppliedModifiers::ItemList () const -{ - Handle(TColStd_HSequenceOfInteger) list = new TColStd_HSequenceOfInteger(); - Standard_Integer i, nb = (theentcnt > 0 ? theentcnt : thenbent); - for (i = 1; i <= nb; i ++) list->Append (ItemNum(i)); - return list; -} - - Standard_Boolean IFSelect_AppliedModifiers::IsForAll () const - { return (theentcnt == 0); } diff --git a/src/IFSelect/IFSelect_AppliedModifiers.hxx b/src/IFSelect/IFSelect_AppliedModifiers.hxx deleted file mode 100644 index ce04998743..0000000000 --- a/src/IFSelect/IFSelect_AppliedModifiers.hxx +++ /dev/null @@ -1,110 +0,0 @@ -// Created on: 1994-05-02 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_AppliedModifiers_HeaderFile -#define _IFSelect_AppliedModifiers_HeaderFile - -#include - -#include -#include -#include -#include -#include -class IFSelect_GeneralModifier; - -class IFSelect_AppliedModifiers; -DEFINE_STANDARD_HANDLE(IFSelect_AppliedModifiers, Standard_Transient) - -//! This class allows to memorize and access to the modifiers -//! which are to be applied to a file. To each modifier, is bound -//! a list of integers (optional) : if this list is absent, -//! the modifier applies to all the file. Else, it applies to the -//! entities designated by these numbers in the produced file. -//! -//! To record a modifier, and a possible list of entity numbers to be applied on: -//! AddModif (amodifier); -//! loop on AddNum (anumber); -//! -//! To query it, Count gives the count of recorded modifiers, then for each one: -//! Item (numodif, amodifier, entcount); -//! IsForAll () -> can be called, if True, applies on the whole file -//! -//! for (i = 1; i <= entcount; i ++) -//! nument = ItemNum (i); -> return an entity number -class IFSelect_AppliedModifiers : public Standard_Transient -{ -public: - - //! Creates an AppliedModifiers, ready to record up to - //! modifiers, on a model of entities - Standard_EXPORT IFSelect_AppliedModifiers(const Standard_Integer nbmax, const Standard_Integer nbent); - - //! Records a modifier. By default, it is to apply on all a - //! produced file. Further calls to AddNum will restrict this. - //! Returns True if done, False if too many modifiers are already - //! recorded - Standard_EXPORT Standard_Boolean AddModif (const Handle(IFSelect_GeneralModifier)& modif); - - //! Adds a number of entity of the output file to be applied on. - //! If a sequence of AddNum is called after AddModif, this - //! Modifier will be applied on the list of designated entities. - //! Else, it will be applied on all the file - //! Returns True if done, False if no modifier has yet been added - Standard_EXPORT Standard_Boolean AddNum (const Standard_Integer nument); - - //! Returns the count of recorded modifiers - Standard_EXPORT Standard_Integer Count() const; - - //! Returns the description for applied modifier n0 : - //! the modifier itself, and the count of entities to be applied - //! on. If no specific list of number has been defined, returns - //! the total count of entities of the file - //! If this count is zero, then the modifier applies to all - //! the file (see below). Else, the numbers are then queried by - //! calls to ItemNum between 1 and - //! Returns True if OK, False if is out of range - Standard_EXPORT Standard_Boolean Item (const Standard_Integer num, Handle(IFSelect_GeneralModifier)& modif, Standard_Integer& entcount); - - //! Returns a numero of entity to be applied on, given its rank - //! in the list. If no list is defined (i.e. for all the file), - //! returns itself, to give all the entities of the file - //! Returns 0 if out of range - Standard_EXPORT Standard_Integer ItemNum (const Standard_Integer nument) const; - - //! Returns the list of entities to be applied on (see Item) - //! as a HSequence (IsForAll produces the complete list of all - //! the entity numbers of the file - Standard_EXPORT Handle(TColStd_HSequenceOfInteger) ItemList() const; - - //! Returns True if the applied modifier queried by last call to - //! Item is to be applied to all the produced file. - //! Else, returned by Item gives the count of entity - //! numbers, each one is queried by ItemNum - Standard_EXPORT Standard_Boolean IsForAll() const; - - DEFINE_STANDARD_RTTIEXT(IFSelect_AppliedModifiers,Standard_Transient) - -private: - - IFSelect_SequenceOfGeneralModifier themodifs; - Interface_IntList thelists; - Standard_Integer thenbent; - Standard_Integer theentcnt; - -}; - -#endif // _IFSelect_AppliedModifiers_HeaderFile diff --git a/src/IFSelect/IFSelect_BasicDumper.cxx b/src/IFSelect/IFSelect_BasicDumper.cxx deleted file mode 100644 index 26a04db161..0000000000 --- a/src/IFSelect/IFSelect_BasicDumper.cxx +++ /dev/null @@ -1,188 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_BasicDumper,IFSelect_SessionDumper) - -//#include -#define FIRSTCHAR 1 -// Param litteral "own" sous la forme :"" -> first = 3 -// A present, forme simplifiee : directement -> first = 1 - - - -IFSelect_BasicDumper::IFSelect_BasicDumper () { } - - Standard_Boolean IFSelect_BasicDumper::WriteOwn - (IFSelect_SessionFile& file, const Handle(Standard_Transient)& item) const -{ - Handle(Standard_Type) type = item->DynamicType(); - if (type == STANDARD_TYPE(IFSelect_SelectModelRoots)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_SelectModelEntities)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_SelectEntityNumber)) { - DeclareAndCast(IFSelect_SelectEntityNumber,sen,item); - file.SendItem(sen->Number()); - return Standard_True; - } - if (type == STANDARD_TYPE(IFSelect_SelectPointed)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_SelectUnion)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_SelectIntersection)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_SelectDiff)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_SelectUnknownEntities)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_SelectErrorEntities)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_SelectIncorrectEntities)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_SelectRoots)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_SelectRootComps)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_SelectRange)) { - DeclareAndCast(IFSelect_SelectRange,sra,item); - file.SendItem(sra->Lower()); - file.SendItem(sra->Upper()); - return Standard_True; - } - if (type == STANDARD_TYPE(IFSelect_SelectShared)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_SelectSharing)) return Standard_True; - - if (type == STANDARD_TYPE(IFSelect_DispPerOne)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_DispGlobal)) return Standard_True; - if (type == STANDARD_TYPE(IFSelect_DispPerCount)) { - DeclareAndCast(IFSelect_DispPerCount,dpc,item); - file.SendItem(dpc->Count()); - return Standard_True; - } - - if (type == STANDARD_TYPE(IFSelect_TransformStandard)) { - DeclareAndCast(IFSelect_TransformStandard,trs,item); - if (trs->CopyOption()) file.SendText("copy"); - else file.SendText("onthespot"); - Standard_Integer nbm = trs->NbModifiers(); - for (Standard_Integer i = 1; i <= nbm; i ++) - file.SendItem(trs->Modifier(i)); - } - - return Standard_False; -} - - Standard_Boolean IFSelect_BasicDumper::ReadOwn - (IFSelect_SessionFile& file, const TCollection_AsciiString& type, - Handle(Standard_Transient)& item) const -{ - if (type.IsEqual("IFSelect_SelectModelRoots")) - { item = new IFSelect_SelectModelRoots (); return Standard_True; } - if (type.IsEqual("IFSelect_SelectModelEntities")) - { item = new IFSelect_SelectModelEntities (); return Standard_True; } - if (type.IsEqual("IFSelect_SelectEntityNumber")) { - Handle(IFSelect_SelectEntityNumber) sen = - new IFSelect_SelectEntityNumber (); - sen->SetNumber (GetCasted(IFSelect_IntParam,file.ItemValue(1))); - item = sen; - return Standard_True; - } - if (type.IsEqual("IFSelect_SelectPointed")) - { item = new IFSelect_SelectPointed; return Standard_True; } - if (type.IsEqual("IFSelect_SelectUnion")) - { item = new IFSelect_SelectUnion; return Standard_True; } - if (type.IsEqual("IFSelect_SelectIntersection")) - { item = new IFSelect_SelectIntersection; return Standard_True; } - if (type.IsEqual("IFSelect_SelectDiff")) - { item = new IFSelect_SelectDiff; return Standard_True; } - if (type.IsEqual("IFSelect_SelectUnknownEntities")) - { item = new IFSelect_SelectUnknownEntities; return Standard_True; } - if (type.IsEqual("IFSelect_SelectErrorEntities")) - { item = new IFSelect_SelectErrorEntities; return Standard_True; } - if (type.IsEqual("IFSelect_SelectIncorrectEntities")) - { item = new IFSelect_SelectIncorrectEntities; return Standard_True; } - if (type.IsEqual("IFSelect_SelectRoots")) - { item = new IFSelect_SelectRoots; return Standard_True; } - if (type.IsEqual("IFSelect_SelectRootComps")) - { item = new IFSelect_SelectRootComps; return Standard_True; } - if (type.IsEqual("IFSelect_SelectRange")) { - Handle(IFSelect_SelectRange) sra = new IFSelect_SelectRange; - sra->SetRange (GetCasted(IFSelect_IntParam,file.ItemValue(1)), - GetCasted(IFSelect_IntParam,file.ItemValue(2)) ); - item = sra; - return Standard_True; - } - if (type.IsEqual("IFSelect_SelectTextType")) { - const TCollection_AsciiString exname = file.ParamValue(1); - if (exname.Length() < FIRSTCHAR) return Standard_False; - if (exname.Value(FIRSTCHAR) == 'e') {} - else if (exname.Value(FIRSTCHAR) == 'c') {} - else return Standard_False; -// item = new IFSelect_SelectTextType (file.TextValue(2).ToCString(),exact); -// return Standard_True; - } - if (type.IsEqual("IFSelect_SelectShared")) - { item = new IFSelect_SelectShared; return Standard_True; } - if (type.IsEqual("IFSelect_SelectSharing")) - { item = new IFSelect_SelectSharing; return Standard_True; } - - if (type.IsEqual("IFSelect_DispPerOne")) - { item = new IFSelect_DispPerOne; return Standard_True; } - if (type.IsEqual("IFSelect_DispGlobal")) - { item = new IFSelect_DispGlobal; return Standard_True; } - if (type.IsEqual("IFSelect_DispPerCount")) { - Handle(IFSelect_DispPerCount) dpc = new IFSelect_DispPerCount; - dpc->SetCount (GetCasted(IFSelect_IntParam,file.ItemValue(1)) ); - item = dpc; - return Standard_True; - } - - if (type.IsEqual("IFSelect_TransformStandard")) { - Standard_Boolean copyoption; - const TCollection_AsciiString copyname = file.ParamValue(1); - if (copyname.Length() < FIRSTCHAR) return Standard_False; - if (copyname.Value(FIRSTCHAR) == 'c') copyoption = Standard_True; - else if (copyname.Value(FIRSTCHAR) == 'o') copyoption = Standard_False; - else return Standard_False; - Handle(IFSelect_TransformStandard) trs = new IFSelect_TransformStandard; - trs->SetCopyOption(copyoption); - Standard_Integer nbp = file.NbParams(); - for (Standard_Integer i = 2; i <= nbp; i ++) { - DeclareAndCast(IFSelect_Modifier,modif,file.ItemValue(i)); - if (!modif.IsNull()) trs->AddModifier(modif); - } - item = trs; - return Standard_True; - } - - return Standard_False; -} diff --git a/src/IFSelect/IFSelect_BasicDumper.hxx b/src/IFSelect/IFSelect_BasicDumper.hxx deleted file mode 100644 index 6f7ba52ca6..0000000000 --- a/src/IFSelect/IFSelect_BasicDumper.hxx +++ /dev/null @@ -1,75 +0,0 @@ -// Created on: 1993-11-04 -// 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 _IFSelect_BasicDumper_HeaderFile -#define _IFSelect_BasicDumper_HeaderFile - -#include -#include - -#include -class IFSelect_SessionFile; -class Standard_Transient; -class TCollection_AsciiString; - - -class IFSelect_BasicDumper; -DEFINE_STANDARD_HANDLE(IFSelect_BasicDumper, IFSelect_SessionDumper) - -//! BasicDumper takes into account, for SessionFile, all the -//! classes defined in the package IFSelect : Selections, -//! Dispatches (there is no Modifier) -class IFSelect_BasicDumper : public IFSelect_SessionDumper -{ - -public: - - - //! Creates a BasicDumper and puts it into the Library of Dumper - Standard_EXPORT IFSelect_BasicDumper(); - - //! Write the Own Parameters of Types defined in package IFSelect - //! Returns True if has been processed, False else - Standard_EXPORT Standard_Boolean WriteOwn (IFSelect_SessionFile& file, const Handle(Standard_Transient)& item) const Standard_OVERRIDE; - - //! Recognizes and Read Own Parameters for Types of package - //! IFSelect. Returns True if done and created, False else - Standard_EXPORT Standard_Boolean ReadOwn (IFSelect_SessionFile& file, const TCollection_AsciiString& type, Handle(Standard_Transient)& item) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_BasicDumper,IFSelect_SessionDumper) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_BasicDumper_HeaderFile diff --git a/src/IFSelect/IFSelect_CheckCounter.cxx b/src/IFSelect/IFSelect_CheckCounter.cxx deleted file mode 100644 index 6c3802c4e5..0000000000 --- a/src/IFSelect/IFSelect_CheckCounter.cxx +++ /dev/null @@ -1,99 +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 -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_CheckCounter,IFSelect_SignatureList) - -//======================================================================= -//function : IFSelect_CheckCounter -//purpose : -//======================================================================= -IFSelect_CheckCounter::IFSelect_CheckCounter(const Standard_Boolean withlist) - : IFSelect_SignatureList (withlist) -{ - SetName("Check"); -} - - -//======================================================================= -//function : SetSignature -//purpose : -//======================================================================= - -void IFSelect_CheckCounter::SetSignature(const Handle(MoniTool_SignText)& sign) -{ - thesign = sign; -} - - -//======================================================================= -//function : Signature -//purpose : -//======================================================================= - -Handle(MoniTool_SignText) IFSelect_CheckCounter::Signature () const -{ - return thesign; -} - - -//======================================================================= -//function : Analyse -//purpose : -//======================================================================= - -void IFSelect_CheckCounter::Analyse(const Interface_CheckIterator& list, - const Handle(Interface_InterfaceModel)& model, - const Standard_Boolean original, - const Standard_Boolean failsonly) -{ - Standard_Integer i,nb,num, nbe = (model.IsNull() ? 0 : model->NbEntities()); - char mess[300]; - sprintf (mess,"Check %s",list.Name()); - SetName (mess); - for (list.Start(); list.More(); list.Next()) { - num = list.Number(); - Handle(Standard_Transient) ent; - const Handle(Interface_Check) check = list.Value(); - ent = check->Entity(); - if (ent.IsNull() && num > 0 && num <= nbe) ent = model->Value(num); - nb = check->NbFails(); - Standard_CString tystr = NULL; - if (!ent.IsNull()) { - if (!thesign.IsNull()) tystr = thesign->Text (ent,model).ToCString(); - else if (!model.IsNull()) tystr = model->TypeName (ent); - else tystr = - Interface_InterfaceModel::ClassName(ent->DynamicType()->Name()); - } - for (i = 1; i <= nb; i ++) { - if (ent.IsNull()) sprintf(mess,"F: %s",check->CFail(i,original)); - else sprintf(mess,"F:%s: %s",tystr,check->CFail(i,original)); - Add (ent,mess); - } - nb = 0; - if (!failsonly) nb = check->NbWarnings(); - for (i = 1; i <= nb; i ++) { - if (ent.IsNull()) sprintf(mess,"W: %s",check->CWarning(i,original)); - else sprintf(mess,"W:%s: %s",tystr,check->CWarning(i,original)); - Add (ent,mess); - } - } -} diff --git a/src/IFSelect/IFSelect_CheckCounter.hxx b/src/IFSelect/IFSelect_CheckCounter.hxx deleted file mode 100644 index 28d14510e1..0000000000 --- a/src/IFSelect/IFSelect_CheckCounter.hxx +++ /dev/null @@ -1,85 +0,0 @@ -// Created on: 1994-11-07 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_CheckCounter_HeaderFile -#define _IFSelect_CheckCounter_HeaderFile - -#include - -#include -class MoniTool_SignText; -class Interface_CheckIterator; -class Interface_InterfaceModel; - - -class IFSelect_CheckCounter; -DEFINE_STANDARD_HANDLE(IFSelect_CheckCounter, IFSelect_SignatureList) - -//! A CheckCounter allows to see a CheckList (i.e. CheckIterator) -//! not per entity, its messages, but per message, the entities -//! attached (count and list). Because many messages can be -//! repeated if they are due to systematic errors -class IFSelect_CheckCounter : public IFSelect_SignatureList -{ - -public: - - - //! Creates a CheckCounter, empty ready to work - Standard_EXPORT IFSelect_CheckCounter(const Standard_Boolean withlist = Standard_False); - - //! Sets a specific signature - //! Else, the current SignType (in the model) is used - Standard_EXPORT void SetSignature (const Handle(MoniTool_SignText)& sign); - - //! Returns the Signature; - Standard_EXPORT Handle(MoniTool_SignText) Signature() const; - - //! Analyses a CheckIterator according a Model (which detains the - //! entities for which the CheckIterator has messages), i.e. - //! counts messages for entities - //! If is True, does not consider final messages but - //! those before interpretation (such as inserting variables : - //! integers, reals, strings) - //! If is True, only Fails are considered - //! Remark : global messages are recorded with a Null entity - Standard_EXPORT void Analyse (const Interface_CheckIterator& list, const Handle(Interface_InterfaceModel)& model, const Standard_Boolean original = Standard_False, const Standard_Boolean failsonly = Standard_False); - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_CheckCounter,IFSelect_SignatureList) - -protected: - - - - -private: - - - Handle(MoniTool_SignText) thesign; - - -}; - - - - - - - -#endif // _IFSelect_CheckCounter_HeaderFile diff --git a/src/IFSelect/IFSelect_ContextModif.cxx b/src/IFSelect/IFSelect_ContextModif.cxx deleted file mode 100644 index c69ad559be..0000000000 --- a/src/IFSelect/IFSelect_ContextModif.cxx +++ /dev/null @@ -1,464 +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 - -//======================================================================= -//function : IFSelect_ContextModif -//purpose : -//======================================================================= -IFSelect_ContextModif::IFSelect_ContextModif(const Interface_Graph& graph, - const Interface_CopyTool& TC, - const Standard_CString filename) - : thegraf (graph,Standard_False) , thefile (filename) , - thelist (graph.Size(),' ') -{ - themap = TC.Control(); thesel = Standard_False; thecurr = thecurt = 0; - Standard_Integer nb = thelist.Length(); - Handle(Standard_Transient) newent; - for (Standard_Integer i = 1; i <= nb; i ++) { - if (themap->Search(graph.Entity(i),newent)) thelist.SetValue(i,'1'); - } -} - - -//======================================================================= -//function : IFSelect_ContextModif -//purpose : -//======================================================================= - -IFSelect_ContextModif::IFSelect_ContextModif(const Interface_Graph& graph, - const Standard_CString filename) - : thegraf (graph,Standard_False) , thefile (filename) , - thelist (graph.Size(),' ') -{ - thesel = Standard_False; thecurr = thecurt = 0; - Standard_Integer nb = thelist.Length(); - Handle(Standard_Transient) newent; - for (Standard_Integer i = 1; i <= nb; i ++) thelist.SetValue(i,'1'); -} - - -//======================================================================= -//function : Select -//purpose : -//======================================================================= - -void IFSelect_ContextModif::Select (Interface_EntityIterator& list) -{ - thesel = Standard_True; - Standard_Integer nb = thelist.Length(); - for (Standard_Integer i = 1; i <= nb; i ++) thelist.SetValue(i,' '); - for (list.Start(); list.More(); list.Next()) { - Handle(Standard_Transient) start,newent; - start = list.Value(); - Standard_Integer num = thegraf.EntityNumber(start); - if (num > nb || num < 0) num = 0; - if (themap.IsNull() && num > 0) thelist.SetValue(num,'1'); - else if (themap->Search (start,newent)) { - if (num > 0) thelist.SetValue(num,'1'); - } - } -} - - -//======================================================================= -//function : OriginalGraph -//purpose : -//======================================================================= - -const Interface_Graph& IFSelect_ContextModif::OriginalGraph () const -{ - return thegraf; -} - - -//======================================================================= -//function : OriginalModel -//purpose : -//======================================================================= - -Handle(Interface_InterfaceModel) IFSelect_ContextModif::OriginalModel() const -{ - return thegraf.Model(); -} - - -//======================================================================= -//function : SetProtocol -//purpose : -//======================================================================= - -void IFSelect_ContextModif::SetProtocol(const Handle(Interface_Protocol)& prot) -{ - theprot = prot; -} - - -//======================================================================= -//function : Protocol -//purpose : -//======================================================================= - -Handle(Interface_Protocol) IFSelect_ContextModif::Protocol() const -{ - return theprot; -} - - -//======================================================================= -//function : HasFileName -//purpose : -//======================================================================= - -Standard_Boolean IFSelect_ContextModif::HasFileName() const -{ - return (thefile.Length() > 0); -} - - -//======================================================================= -//function : FileName -//purpose : -//======================================================================= - -Standard_CString IFSelect_ContextModif::FileName () const -{ - return thefile.ToCString(); -} - - -//======================================================================= -//function : Control -//purpose : -//======================================================================= - -Handle(Interface_CopyControl) IFSelect_ContextModif::Control () const -{ - return themap; -} - - -//======================================================================= -//function : IsForNone -//purpose : -//======================================================================= - -Standard_Boolean IFSelect_ContextModif::IsForNone () const -{ - if (!thesel) return Standard_False; - Standard_Integer nb = thelist.Length(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (thelist.Value(i) != ' ') return Standard_False; - } - return Standard_True; -} - - -//======================================================================= -//function : IsForAll -//purpose : -//======================================================================= - -Standard_Boolean IFSelect_ContextModif::IsForAll () const -{ - return (!thesel); -} - - -//======================================================================= -//function : IsTransferred -//purpose : -//======================================================================= - -Standard_Boolean IFSelect_ContextModif::IsTransferred - (const Handle(Standard_Transient)& ent) const -{ - if (themap.IsNull()) return Standard_True; - Handle(Standard_Transient) newent; - return themap->Search(ent,newent); -} - - -//======================================================================= -//function : IsSelected -//purpose : -//======================================================================= - -Standard_Boolean IFSelect_ContextModif::IsSelected - (const Handle(Standard_Transient)& ent) const -{ - // Select a deja verifie "IsTransferred" - Standard_Integer num = thegraf.EntityNumber(ent); - if (num == 0) return Standard_False; - return (thelist.Value(num) != ' '); -} - - -//======================================================================= -//function : SelectedOriginal -//purpose : -//======================================================================= - -Interface_EntityIterator IFSelect_ContextModif::SelectedOriginal () const -{ - Interface_EntityIterator list; - Standard_Integer nb = thelist.Length(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (thelist.Value(i) != ' ') list.GetOneItem (thegraf.Entity(i)); - } - return list; -} - - -//======================================================================= -//function : SelectedResult -//purpose : -//======================================================================= - -Interface_EntityIterator IFSelect_ContextModif::SelectedResult () const -{ - Interface_EntityIterator list; - Standard_Integer nb = thelist.Length(); - for (Standard_Integer i = 1; i <= nb; i ++) { - Handle(Standard_Transient) newent; - if (themap.IsNull()) newent = thegraf.Entity(i); - else if (thelist.Value(i) != ' ') themap->Search (thegraf.Entity(i),newent); - if (!newent.IsNull()) list.GetOneItem (newent); - } - return list; -} - - -//======================================================================= -//function : SelectedCount -//purpose : -//======================================================================= - -Standard_Integer IFSelect_ContextModif::SelectedCount () const -{ - Standard_Integer nb = thelist.Length(); - Standard_Integer ns = 0; - for (Standard_Integer i = 1; i <= nb; i ++) - { if (thelist.Value(i) != ' ') ns ++; } - return ns; -} - - -//======================================================================= -//function : Start -//purpose : -//======================================================================= - -void IFSelect_ContextModif::Start () -{ - thecurr = thecurt = 0; - Next(); -} - - -//======================================================================= -//function : More -//purpose : -//======================================================================= - -Standard_Boolean IFSelect_ContextModif::More () const -{ - return (thecurr > 0); -} - - -//======================================================================= -//function : Next -//purpose : -//======================================================================= - -void IFSelect_ContextModif::Next() -{ - Standard_Integer nb = thelist.Length(); -// thecurr = thecurt; -// if (thecurr <= 0 && thecurt >= 0) return; - for (Standard_Integer i = thecurr+1; i <= nb; i ++) { - if (thelist.Value(i) != ' ') { thecurr = i; thecurt ++; return; } - } - thecurr = thecurt = 0; -} - - -//======================================================================= -//function : ValueOriginal -//purpose : -//======================================================================= - -Handle(Standard_Transient) IFSelect_ContextModif::ValueOriginal () const -{ - if (thecurr <= 0) throw Standard_NoSuchObject("IFSelect_ContextModif"); - return thegraf.Entity(thecurr); -} - - -//======================================================================= -//function : ValueResult -//purpose : -//======================================================================= - -Handle(Standard_Transient) IFSelect_ContextModif::ValueResult () const -{ - if (thecurr <= 0) throw Standard_NoSuchObject("IFSelect_ContextModif"); - Handle(Standard_Transient) ent,newent; - ent = thegraf.Entity(thecurr); - if (themap.IsNull()) newent = ent; - else themap->Search(ent,newent); - return newent; -} - - -//======================================================================= -//function : TraceModifier -//purpose : -//======================================================================= - -void IFSelect_ContextModif::TraceModifier - (const Handle(IFSelect_GeneralModifier)& modif) -{ - if (modif.IsNull()) return; - - Message_Messenger::StreamBuffer sout = Message::SendInfo(); - sout << "--- Run Modifier:" << std::endl; - Handle(IFSelect_Selection) sel = modif->Selection(); - if (!sel.IsNull()) sout<<" Selection:"<Label(); - else sout<<" (no Selection)"; - -// on va simplement compter les entites - Standard_Integer ne = 0, nb = thelist.Length(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (thelist.Value(i) != ' ') ne ++; - } - if (nb == ne) sout<<" All Model ("<NbFails() + check->NbWarnings() == 0) return; - const Handle(Standard_Transient)& ent = check->Entity(); - Standard_Integer num = thegraf.EntityNumber(ent); - if (num == 0 && !ent.IsNull()) num = -1; // force enregistrement - thechek.Add(check,num); -} - - -//======================================================================= -//function : AddWarning -//purpose : -//======================================================================= - -void IFSelect_ContextModif::AddWarning(const Handle(Standard_Transient)& start, - const Standard_CString mess, - const Standard_CString orig) -{ - thechek.CCheck(thegraf.EntityNumber(start))->AddWarning(mess,orig); -} - - -//======================================================================= -//function : AddFail -//purpose : -//======================================================================= - -void IFSelect_ContextModif::AddFail(const Handle(Standard_Transient)& start, - const Standard_CString mess, - const Standard_CString orig) -{ - thechek.CCheck(thegraf.EntityNumber(start))->AddFail(mess,orig); -} - - -//======================================================================= -//function : CCheck -//purpose : -//======================================================================= - -Handle(Interface_Check) IFSelect_ContextModif::CCheck(const Standard_Integer num) -{ - Handle(Interface_Check) ach = thechek.CCheck(num); - if (num > 0 && num <= thegraf.Size()) ach->SetEntity(thegraf.Entity(num)); - return ach; -} - - -//======================================================================= -//function : CCheck -//purpose : -//======================================================================= - -Handle(Interface_Check) IFSelect_ContextModif::CCheck - (const Handle(Standard_Transient)& ent) -{ - Standard_Integer num = thegraf.EntityNumber(ent); - if (num == 0) num = -1; // force l enregistrement - Handle(Interface_Check)& ach = thechek.CCheck(num); - ach->SetEntity(ent); - return ach; -} - - -//======================================================================= -//function : CheckList -//purpose : -//======================================================================= - -Interface_CheckIterator IFSelect_ContextModif::CheckList () const -{ - return thechek; -} diff --git a/src/IFSelect/IFSelect_ContextModif.hxx b/src/IFSelect/IFSelect_ContextModif.hxx deleted file mode 100644 index 50c77d53a3..0000000000 --- a/src/IFSelect/IFSelect_ContextModif.hxx +++ /dev/null @@ -1,218 +0,0 @@ -// Created on: 1994-06-08 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_ContextModif_HeaderFile -#define _IFSelect_ContextModif_HeaderFile - -#include -#include -#include - -#include -#include -#include -#include -#include -class Interface_Protocol; -class Interface_CopyControl; -class Interface_CopyTool; -class Interface_EntityIterator; -class Interface_InterfaceModel; -class Standard_Transient; -class IFSelect_GeneralModifier; -class Interface_Check; - - -//! This class gathers various information used by Model Modifiers -//! apart from the target model itself, and the CopyTool which -//! must be passed directly. -//! -//! These information report to original data : model, entities, -//! and the selection list if there is one : it allows to query -//! about such or such starting entity, or result entity, or -//! iterate on selection list ... -//! Also data useful for file output are available (because some -//! Modifiers concern models produced for file output). -//! -//! Furthermore, in return, ContextModif can record Checks, either -//! one for all, or one for each Entity. It supports trace too. -class IFSelect_ContextModif -{ -public: - - DEFINE_STANDARD_ALLOC - - //! Prepares a ContextModif with these information : - //! - the graph established from original model (target passed - //! directly to Modifier) - //! - the CopyTool which detains the CopyControl, which maps - //! starting (in original) and result (in target) entities - //! - an optional file name (for file output) - //! - //! Such a ContextModif is considered to be applied on all - //! transferred entities (no filter active) - Standard_EXPORT IFSelect_ContextModif(const Interface_Graph& graph, const Interface_CopyTool& TC, const Standard_CString filename = ""); - - //! Prepares a ContextModif with these information : - //! - the graph established from original model (target passed - //! directly to Modifier) - //! - an optional file name (for file output) - //! Here, no CopyControl, hence all entities are considered equal - //! as starting and result - //! - //! Such a ContextModif is considered to be applied on all - //! transferred entities (no filter active) - Standard_EXPORT IFSelect_ContextModif(const Interface_Graph& graph, const Standard_CString filename = ""); - - //! This method requires ContextModif to be applied with a filter. - //! If a ModelModifier is defined with a Selection criterium, - //! the result of this Selection is used as a filter : - //! - if none of its items has been transferred, the modification - //! does not apply at all - //! - else, the Modifier can query for what entities were selected - //! and what are their results - //! - if this method is not called before working, the Modifier - //! has to work on the whole Model - Standard_EXPORT void Select (Interface_EntityIterator& list); - - //! Returns the original Graph (compared to OriginalModel, it - //! gives more query capabilitites) - Standard_EXPORT const Interface_Graph& OriginalGraph() const; - - //! Returns the original model - Standard_EXPORT Handle(Interface_InterfaceModel) OriginalModel() const; - - //! Allows to transmit a Protocol as part of a ContextModif - Standard_EXPORT void SetProtocol (const Handle(Interface_Protocol)& proto); - - //! Returns the Protocol (Null if not set) - Standard_EXPORT Handle(Interface_Protocol) Protocol() const; - - //! Returns True if a non empty file name has been defined - Standard_EXPORT Standard_Boolean HasFileName() const; - - //! Returns File Name (can be empty) - Standard_EXPORT Standard_CString FileName() const; - - //! Returns the map for a direct use, if required - Standard_EXPORT Handle(Interface_CopyControl) Control() const; - - //! Returns True if Select has determined that a Modifier may not - //! be run (filter defined and empty) - Standard_EXPORT Standard_Boolean IsForNone() const; - - //! Returns True if no filter is defined : a Modifier has to work - //! on all entities of the resulting (target) model - Standard_EXPORT Standard_Boolean IsForAll() const; - - //! Returns True if a starting item has been transferred - Standard_EXPORT Standard_Boolean IsTransferred (const Handle(Standard_Transient)& ent) const; - - //! Returns True if a starting item has been transferred and selected - Standard_EXPORT Standard_Boolean IsSelected (const Handle(Standard_Transient)& ent) const; - - //! Returns True if a starting entity has been transferred, and - //! the result is in . Returns False else - //! (direct call to the map) - Standard_EXPORT Standard_Boolean Search (const Handle(Standard_Transient)& ent, Handle(Standard_Transient)& res) const; - - //! Returns the list of original selected items. - //! See also the iteration - Standard_EXPORT Interface_EntityIterator SelectedOriginal() const; - - //! Returns the list of resulting counterparts of selected items. - //! See also the iteration - Standard_EXPORT Interface_EntityIterator SelectedResult() const; - - //! Returns the count of selected and transferred items - Standard_EXPORT Standard_Integer SelectedCount() const; - - //! Starts an iteration on selected items. It takes into account - //! IsForAll/IsForNone, by really iterating on all selected items. - Standard_EXPORT void Start(); - - //! Returns True until the iteration has finished - Standard_EXPORT Standard_Boolean More() const; - - //! Advances the iteration - Standard_EXPORT void Next(); - - //! Returns the current selected item in the original model - Standard_EXPORT Handle(Standard_Transient) ValueOriginal() const; - - //! Returns the result counterpart of current selected item - //! (in the target model) - Standard_EXPORT Handle(Standard_Transient) ValueResult() const; - - //! Traces the application of a Modifier. Works with default trace - //! File and Level. Fills the trace if default trace level is at - //! least 1. Traces the Modifier (its Label) and its Selection if - //! there is one (its Label). - //! To be called after Select (because status IsForAll is printed) - //! Worths to trace a global modification. See also Trace below - Standard_EXPORT void TraceModifier (const Handle(IFSelect_GeneralModifier)& modif); - - //! Traces the modification of the current entity (see above, - //! ValueOriginal and ValueResult) for default trace level >= 2. - //! To be called on each individual entity really modified - //! is an optional additional message - Standard_EXPORT void Trace (const Standard_CString mess = ""); - - //! Adds a Check to the CheckList. If it is empty, nothing is done - //! If it concerns an Entity from the Original Model (by SetEntity) - //! to which another Check is attached, it is merged to it. - //! Else, it is added or merged as to GlobalCheck. - Standard_EXPORT void AddCheck (const Handle(Interface_Check)& check); - - //! Adds a Warning Message for an Entity from the original Model - //! If is not an Entity from the original model (e.g. the - //! model itself) this message is added to Global Check. - Standard_EXPORT void AddWarning (const Handle(Standard_Transient)& start, const Standard_CString mess, const Standard_CString orig = ""); - - //! Adds a Fail Message for an Entity from the original Model - //! If is not an Entity from the original model (e.g. the - //! model itself) this message is added to Global Check. - Standard_EXPORT void AddFail (const Handle(Standard_Transient)& start, const Standard_CString mess, const Standard_CString orig = ""); - - //! Returns a Check given an Entity number (in the original Model) - //! by default a Global Check. Creates it the first time. - //! It can then be acknowledged on the spot, in condition that the - //! caller works by reference ("Interface_Check& check = ...") - Standard_EXPORT Handle(Interface_Check) CCheck (const Standard_Integer num = 0); - - //! Returns a Check attached to an Entity from the original Model - //! It can then be acknowledged on the spot, in condition that the - //! caller works by reference ("Interface_Check& check = ...") - Standard_EXPORT Handle(Interface_Check) CCheck (const Handle(Standard_Transient)& start); - - //! Returns the complete CheckList - Standard_EXPORT Interface_CheckIterator CheckList() const; - -private: - - Interface_Graph thegraf; - Handle(Interface_Protocol) theprot; - Handle(Interface_CopyControl) themap; - TCollection_AsciiString thefile; - TCollection_AsciiString thelist; - Interface_CheckIterator thechek; - Standard_Boolean thesel; - Standard_Integer thecurr; - Standard_Integer thecurt; - -}; - -#endif // _IFSelect_ContextModif_HeaderFile diff --git a/src/IFSelect/IFSelect_ContextWrite.cxx b/src/IFSelect/IFSelect_ContextWrite.cxx deleted file mode 100644 index c4bbcf1e03..0000000000 --- a/src/IFSelect/IFSelect_ContextWrite.cxx +++ /dev/null @@ -1,297 +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 - -//======================================================================= -//function : IFSelect_ContextWrite -//purpose : -//======================================================================= -IFSelect_ContextWrite::IFSelect_ContextWrite - (const Handle(Interface_InterfaceModel)& model, - const Handle(Interface_Protocol)& proto, - const Handle(IFSelect_AppliedModifiers)& applieds, - const Standard_CString filename) - : themodel (model) , theproto (proto) , thefile (filename) , - theapply (applieds) , thenumod(0) , thenbent (0) , thecurr (0) { } - - -//======================================================================= -//function : IFSelect_ContextWrite -//purpose : -//======================================================================= - -IFSelect_ContextWrite::IFSelect_ContextWrite - (const Handle(Interface_HGraph)& hgraph, - const Handle(Interface_Protocol)& proto, - const Handle(IFSelect_AppliedModifiers)& applieds, - const Standard_CString filename) - : themodel (hgraph->Graph().Model()) , - theproto (proto) , thefile (filename) , theapply (applieds) , - thehgraf (hgraph) , thenumod(0) , thenbent (0) , thecurr (0) { } - - -//======================================================================= -//function : Model -//purpose : -//======================================================================= - -Handle(Interface_InterfaceModel) IFSelect_ContextWrite::Model () const -{ - return themodel; -} - - -//======================================================================= -//function : Protocol -//purpose : -//======================================================================= - -Handle(Interface_Protocol) IFSelect_ContextWrite::Protocol () const -{ - return theproto; -} - - -//======================================================================= -//function : FileName -//purpose : -//======================================================================= - -Standard_CString IFSelect_ContextWrite::FileName () const -{ - return thefile.ToCString(); -} - - -//======================================================================= -//function : AppliedModifiers -//purpose : -//======================================================================= - -Handle(IFSelect_AppliedModifiers) IFSelect_ContextWrite::AppliedModifiers () const -{ - return theapply; -} - - -//======================================================================= -//function : Graph -//purpose : -//======================================================================= - -const Interface_Graph& IFSelect_ContextWrite::Graph () -{ - if (thehgraf.IsNull()) thehgraf = new Interface_HGraph(themodel,theproto); - return thehgraf->Graph(); -} - - -//======================================================================= -//function : NbModifiers -//purpose : -//======================================================================= - -Standard_Integer IFSelect_ContextWrite::NbModifiers () const - { return (theapply.IsNull() ? 0 : theapply->Count()); } - - Standard_Boolean IFSelect_ContextWrite::SetModifier - (const Standard_Integer numod) -{ - themodif.Nullify(); thenumod = thenbent = thecurr = 0; - if (theapply.IsNull()) return Standard_False; - if (numod < 1 || numod > theapply->Count()) return Standard_False; - theapply->Item(numod,themodif,thenbent); - return Standard_True; -} - - -//======================================================================= -//function : FileModifier -//purpose : -//======================================================================= - -Handle(IFSelect_GeneralModifier) IFSelect_ContextWrite::FileModifier () const -{ - return themodif; -} - - -//======================================================================= -//function : IsForNone -//purpose : -//======================================================================= - -Standard_Boolean IFSelect_ContextWrite::IsForNone () const -{ - return (thenbent == 0); -} - - -//======================================================================= -//function : IsForAll -//purpose : -//======================================================================= - -Standard_Boolean IFSelect_ContextWrite::IsForAll () const -{ - return theapply->IsForAll(); -} - - -//======================================================================= -//function : NbEntities -//purpose : -//======================================================================= - -Standard_Integer IFSelect_ContextWrite::NbEntities () const -{ - return thenbent; -} - - -//======================================================================= -//function : Start -//purpose : -//======================================================================= - -void IFSelect_ContextWrite::Start () -{ - thecurr = 1; -} - - -//======================================================================= -//function : More -//purpose : -//======================================================================= - -Standard_Boolean IFSelect_ContextWrite::More () const -{ - return (thecurr <= thenbent); -} - - -//======================================================================= -//function : Next -//purpose : -//======================================================================= - -void IFSelect_ContextWrite::Next () -{ - thecurr ++; -} - - -//======================================================================= -//function : Value -//purpose : -//======================================================================= - -Handle(Standard_Transient) IFSelect_ContextWrite::Value() const -{ - if (thecurr < 1 || thecurr > thenbent) - throw Standard_NoSuchObject("IFSelect_ContextWrite:Value"); - Standard_Integer num = theapply->ItemNum (thecurr); - return themodel->Value(num); -} - - -//======================================================================= -//function : AddCheck -//purpose : -//======================================================================= - -void IFSelect_ContextWrite::AddCheck (const Handle(Interface_Check)& check) -{ - if (check->NbFails() + check->NbWarnings() == 0) return; - const Handle(Standard_Transient)& ent = check->Entity(); - Standard_Integer num = themodel->Number(ent); - if (num == 0 && !ent.IsNull()) num = -1; // force enregistrement - thecheck.Add(check,num); -} - - -//======================================================================= -//function : AddWarning -//purpose : -//======================================================================= - -void IFSelect_ContextWrite::AddWarning(const Handle(Standard_Transient)& start, - const Standard_CString mess, - const Standard_CString orig) -{ - thecheck.CCheck(themodel->Number(start))->AddWarning(mess,orig); -} - - -//======================================================================= -//function : AddFail -//purpose : -//======================================================================= - -void IFSelect_ContextWrite::AddFail(const Handle(Standard_Transient)& start, - const Standard_CString mess, - const Standard_CString orig) -{ - thecheck.CCheck(themodel->Number(start))->AddFail(mess,orig); -} - - -//======================================================================= -//function : CCheck -//purpose : -//======================================================================= - -Handle(Interface_Check) IFSelect_ContextWrite::CCheck (const Standard_Integer num) -{ - Handle(Interface_Check) ach = thecheck.CCheck(num); - if (num > 0 && num <= themodel->NbEntities()) ach->SetEntity(themodel->Value(num)); - return ach; -} - - -//======================================================================= -//function : CCheck -//purpose : -//======================================================================= - -Handle(Interface_Check) IFSelect_ContextWrite::CCheck(const Handle(Standard_Transient)& ent) -{ - Standard_Integer num = themodel->Number(ent); - if (num == 0) num = -1; // force l enregistrement - Handle(Interface_Check) ach = thecheck.CCheck(num); - ach->SetEntity(ent); - return ach; -} - - -//======================================================================= -//function : CheckList -//purpose : -//======================================================================= - -Interface_CheckIterator IFSelect_ContextWrite::CheckList () const -{ - return thecheck; -} diff --git a/src/IFSelect/IFSelect_ContextWrite.hxx b/src/IFSelect/IFSelect_ContextWrite.hxx deleted file mode 100644 index 05dca8c386..0000000000 --- a/src/IFSelect/IFSelect_ContextWrite.hxx +++ /dev/null @@ -1,181 +0,0 @@ -// Created on: 1996-01-26 -// Created by: Christian CAILLET -// Copyright (c) 1996-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 _IFSelect_ContextWrite_HeaderFile -#define _IFSelect_ContextWrite_HeaderFile - -#include -#include -#include - -#include -#include -#include -class Interface_InterfaceModel; -class Interface_Protocol; -class IFSelect_AppliedModifiers; -class Interface_HGraph; -class IFSelect_GeneralModifier; -class Interface_Graph; -class Standard_Transient; -class Interface_Check; - - -//! This class gathers various information used by File Modifiers -//! apart from the writer object, which is specific of the norm -//! and of the physical format -//! -//! These information are controlled by an object AppliedModifiers -//! (if it is not defined, no modification is allowed on writing) -//! -//! Furthermore, in return, ContextModif can record Checks, either -//! one for all, or one for each Entity. It supports trace too. -class IFSelect_ContextWrite -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! Prepares a ContextWrite with these information : - //! - the model which is to be written - //! - the protocol to be used - //! - the filename - //! - an object AppliedModifiers to work. It gives a list of - //! FileModifiers to be ran, and for each one it can give - //! a restricted list of entities (in the model), else all - //! the model is considered - Standard_EXPORT IFSelect_ContextWrite(const Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& proto, const Handle(IFSelect_AppliedModifiers)& applieds, const Standard_CString filename); - - //! Same as above but with an already computed Graph - Standard_EXPORT IFSelect_ContextWrite(const Handle(Interface_HGraph)& hgraph, const Handle(Interface_Protocol)& proto, const Handle(IFSelect_AppliedModifiers)& applieds, const Standard_CString filename); - - //! Returns the Model - Standard_EXPORT Handle(Interface_InterfaceModel) Model() const; - - //! Returns the Protocol; - Standard_EXPORT Handle(Interface_Protocol) Protocol() const; - - //! Returns the File Name - Standard_EXPORT Standard_CString FileName() const; - - //! Returns the object AppliedModifiers - Standard_EXPORT Handle(IFSelect_AppliedModifiers) AppliedModifiers() const; - - //! Returns the Graph, either given when created, else created - //! the first time it is queried - Standard_EXPORT const Interface_Graph& Graph(); - - //! Returns the count of recorded File Modifiers - Standard_EXPORT Standard_Integer NbModifiers() const; - - //! Sets active the File Modifier n0 - //! Then, it prepares the list of entities to consider, if any - //! Returns False if out of range - Standard_EXPORT Standard_Boolean SetModifier (const Standard_Integer numod); - - //! Returns the currently active File Modifier. Cast to be done - //! Null if not properly set : must be test IsNull after casting - Standard_EXPORT Handle(IFSelect_GeneralModifier) FileModifier() const; - - //! Returns True if no modifier is currently set - Standard_EXPORT Standard_Boolean IsForNone() const; - - //! Returns True if the current modifier is to be applied to - //! the whole model. Else, a restricted list of selected entities - //! is defined, it can be exploited by the File Modifier - Standard_EXPORT Standard_Boolean IsForAll() const; - - //! Returns the total count of selected entities - Standard_EXPORT Standard_Integer NbEntities() const; - - //! Starts an iteration on selected items. It takes into account - //! IsForAll/IsForNone, by really iterating on all selected items. - Standard_EXPORT void Start(); - - //! Returns True until the iteration has finished - Standard_EXPORT Standard_Boolean More() const; - - //! Advances the iteration - Standard_EXPORT void Next(); - - //! Returns the current selected entity in the model - Standard_EXPORT Handle(Standard_Transient) Value() const; - - //! Adds a Check to the CheckList. If it is empty, nothing is done - //! If it concerns an Entity from the Model (by SetEntity) - //! to which another Check is attached, it is merged to it. - //! Else, it is added or merged as to GlobalCheck. - Standard_EXPORT void AddCheck (const Handle(Interface_Check)& check); - - //! Adds a Warning Message for an Entity from the Model - //! If is not an Entity from the model (e.g. the - //! model itself) this message is added to Global Check. - Standard_EXPORT void AddWarning (const Handle(Standard_Transient)& start, const Standard_CString mess, const Standard_CString orig = ""); - - //! Adds a Fail Message for an Entity from the Model - //! If is not an Entity from the model (e.g. the - //! model itself) this message is added to Global Check. - Standard_EXPORT void AddFail (const Handle(Standard_Transient)& start, const Standard_CString mess, const Standard_CString orig = ""); - - //! Returns a Check given an Entity number (in the Model) - //! by default a Global Check. Creates it the first time. - //! It can then be acknowledged on the spot, in condition that the - //! caller works by reference ("Interface_Check& check = ...") - Standard_EXPORT Handle(Interface_Check) CCheck (const Standard_Integer num = 0); - - //! Returns a Check attached to an Entity from the Model - //! It can then be acknowledged on the spot, in condition that the - //! caller works by reference ("Interface_Check& check = ...") - Standard_EXPORT Handle(Interface_Check) CCheck (const Handle(Standard_Transient)& start); - - //! Returns the complete CheckList - Standard_EXPORT Interface_CheckIterator CheckList() const; - - - - -protected: - - - - - -private: - - - - Handle(Interface_InterfaceModel) themodel; - Handle(Interface_Protocol) theproto; - TCollection_AsciiString thefile; - Handle(IFSelect_AppliedModifiers) theapply; - Handle(Interface_HGraph) thehgraf; - Interface_CheckIterator thecheck; - Standard_Integer thenumod; - Standard_Integer thenbent; - Standard_Integer thecurr; - Handle(IFSelect_GeneralModifier) themodif; - - -}; - - - - - - - -#endif // _IFSelect_ContextWrite_HeaderFile diff --git a/src/IFSelect/IFSelect_DispGlobal.cxx b/src/IFSelect/IFSelect_DispGlobal.cxx deleted file mode 100644 index 76cec696b2..0000000000 --- a/src/IFSelect/IFSelect_DispGlobal.cxx +++ /dev/null @@ -1,41 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_DispGlobal,IFSelect_Dispatch) - -// Genere un seul paquet avec la sortie finale -IFSelect_DispGlobal::IFSelect_DispGlobal () { } - - TCollection_AsciiString IFSelect_DispGlobal::Label () const -{ return TCollection_AsciiString ("One File for All Input"); } - - Standard_Boolean IFSelect_DispGlobal::LimitedMax - (const Standard_Integer /* nbent */, Standard_Integer& pcount) const - { pcount = 1; return Standard_True; } - -// 1 packet ( a partir de UniqueResult) - void IFSelect_DispGlobal::Packets - (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const -{ - packs.AddPart(); - packs.GetFromIter(FinalSelection()->UniqueResult(G)); -} diff --git a/src/IFSelect/IFSelect_DispGlobal.hxx b/src/IFSelect/IFSelect_DispGlobal.hxx deleted file mode 100644 index 84fabe19e6..0000000000 --- a/src/IFSelect/IFSelect_DispGlobal.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_DispGlobal_HeaderFile -#define _IFSelect_DispGlobal_HeaderFile - -#include -#include - -#include -#include -class TCollection_AsciiString; -class Interface_Graph; -class IFGraph_SubPartsIterator; - - -class IFSelect_DispGlobal; -DEFINE_STANDARD_HANDLE(IFSelect_DispGlobal, IFSelect_Dispatch) - -//! A DispGlobal gathers all the input Entities into only one -//! global Packet -class IFSelect_DispGlobal : public IFSelect_Dispatch -{ - -public: - - - //! Creates a DispGlobal - Standard_EXPORT IFSelect_DispGlobal(); - - //! Returns as Label, "One File for all Input" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - //! Returns True : maximum equates 1 - Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE; - - //! Computes the list of produced Packets. It is made of only ONE - //! Packet, which gets the RootResult from the Final Selection. - //! Remark : the inherited exception raising is never activated. - Standard_EXPORT void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_DispGlobal,IFSelect_Dispatch) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_DispGlobal_HeaderFile diff --git a/src/IFSelect/IFSelect_DispPerCount.cxx b/src/IFSelect/IFSelect_DispPerCount.cxx deleted file mode 100644 index e15b42af6c..0000000000 --- a/src/IFSelect/IFSelect_DispPerCount.cxx +++ /dev/null @@ -1,80 +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(IFSelect_DispPerCount,IFSelect_Dispatch) - -IFSelect_DispPerCount::IFSelect_DispPerCount () { } - - Handle(IFSelect_IntParam) IFSelect_DispPerCount::Count () const - { return thecount; } - - void IFSelect_DispPerCount::SetCount - (const Handle(IFSelect_IntParam)& pcount) - { thecount = pcount; } - - Standard_Integer IFSelect_DispPerCount::CountValue () const -{ - Standard_Integer pcount = 0; - if (!thecount.IsNull()) pcount = thecount->Value(); - if (pcount <= 0) pcount = 1; // option prise par defaut - return pcount; -} - - TCollection_AsciiString IFSelect_DispPerCount::Label () const -{ - TCollection_AsciiString lab(CountValue()); - lab.Insert(1,"One File per "); - lab.AssignCat(" Entities"); - return lab; -} - - - Standard_Boolean IFSelect_DispPerCount::LimitedMax - (const Standard_Integer nbent, Standard_Integer& pcount) const -{ - pcount = 1 + nbent / CountValue(); - return Standard_True; -} - - void IFSelect_DispPerCount::Packets - (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const -{ -// Ressemble a DispPerOne, mais fait un AddPart tous les "count" racines - Standard_Integer pcount = CountValue(); - - IFGraph_SCRoots roots(G,Standard_False); - roots.SetLoad(); - roots.GetFromIter(FinalSelection()->UniqueResult(G)); -// SCRoots a initie la resolution : decoupage en StrongComponants + selection -// des racines. Un paquet correspond des lors a racines -// Donc, il faut iterer sur les Parts de roots et les prendre par - - Standard_Integer i = 0; - for (roots.Start(); roots.More(); roots.Next()) { - if (i == 0) packs.AddPart(); - i ++; if (i >= pcount) i = 0; // regroupement selon "count" - packs.GetFromIter(roots.Entities()); - } -} diff --git a/src/IFSelect/IFSelect_DispPerCount.hxx b/src/IFSelect/IFSelect_DispPerCount.hxx deleted file mode 100644 index a12bd91390..0000000000 --- a/src/IFSelect/IFSelect_DispPerCount.hxx +++ /dev/null @@ -1,92 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_DispPerCount_HeaderFile -#define _IFSelect_DispPerCount_HeaderFile - -#include -#include - -#include -#include -class IFSelect_IntParam; -class TCollection_AsciiString; -class Interface_Graph; -class IFGraph_SubPartsIterator; - - -class IFSelect_DispPerCount; -DEFINE_STANDARD_HANDLE(IFSelect_DispPerCount, IFSelect_Dispatch) - -//! A DispPerCount gathers all the input Entities into one or -//! several Packets, each containing a defined count of Entity -//! This count is a Parameter of the DispPerCount, given as an -//! IntParam, thus allowing external control of its Value -class IFSelect_DispPerCount : public IFSelect_Dispatch -{ - -public: - - - //! Creates a DispPerCount with no Count (default value 1) - Standard_EXPORT IFSelect_DispPerCount(); - - //! Returns the Count Parameter used for splitting - Standard_EXPORT Handle(IFSelect_IntParam) Count() const; - - //! Sets a new Parameter for Count - Standard_EXPORT void SetCount (const Handle(IFSelect_IntParam)& count); - - //! Returns the effective value of the count parameter - //! (if Count Parameter not Set or value not positive, returns 1) - Standard_EXPORT Standard_Integer CountValue() const; - - //! Returns as Label, "One File per Input Entities" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - //! Returns True, maximum count is given as - Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE; - - //! Computes the list of produced Packets. It defines Packets in - //! order to have at most Entities per Packet, Entities - //! are given by RootResult from the Final Selection. - Standard_EXPORT void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_DispPerCount,IFSelect_Dispatch) - -protected: - - - - -private: - - - Handle(IFSelect_IntParam) thecount; - - -}; - - - - - - - -#endif // _IFSelect_DispPerCount_HeaderFile diff --git a/src/IFSelect/IFSelect_DispPerFiles.cxx b/src/IFSelect/IFSelect_DispPerFiles.cxx deleted file mode 100644 index b37d770de5..0000000000 --- a/src/IFSelect/IFSelect_DispPerFiles.cxx +++ /dev/null @@ -1,83 +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(IFSelect_DispPerFiles,IFSelect_Dispatch) - -IFSelect_DispPerFiles::IFSelect_DispPerFiles () { } - - Handle(IFSelect_IntParam) IFSelect_DispPerFiles::Count () const - { return thecount; } - - void IFSelect_DispPerFiles::SetCount - (const Handle(IFSelect_IntParam)& pcount) - { thecount = pcount; } - - Standard_Integer IFSelect_DispPerFiles::CountValue () const -{ - Standard_Integer pcount = 0; - if (!thecount.IsNull()) pcount = thecount->Value(); - if (pcount <= 0) pcount = 1; // option prise par defaut - return pcount; -} - - TCollection_AsciiString IFSelect_DispPerFiles::Label () const -{ - TCollection_AsciiString lab(CountValue()); - lab.Insert(1,"Maximum "); - lab.AssignCat(" Files"); - return lab; -} - - - Standard_Boolean IFSelect_DispPerFiles::LimitedMax - (const Standard_Integer /* nbent */, Standard_Integer& pcount) const -{ - pcount = CountValue(); - return Standard_True; -} - - void IFSelect_DispPerFiles::Packets - (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const -{ -// Ressemble a DispPerOne, mais fait "count" AddPart racines - Standard_Integer pcount = CountValue(); - - IFGraph_SCRoots roots(G,Standard_False); - roots.SetLoad(); - roots.GetFromIter(FinalSelection()->UniqueResult(G)); -// SCRoots a initie la resolution : decoupage en StrongComponants + selection -// des racines. Un paquet correspond des lors a racines -// Donc, il faut iterer sur les Parts de roots et les prendre par - roots.Start(); // Start fait Evaluate specifique - Standard_Integer nb = roots.NbParts(); - if (pcount > 0) pcount = (nb-1) / pcount +1; // par packet - - Standard_Integer i = 0; - for (; roots.More(); roots.Next()) { // Start deja fait - if (i == 0) packs.AddPart(); - i ++; if (i >= pcount) i = 0; // regroupement selon "count" - packs.GetFromIter(roots.Entities()); - } -} diff --git a/src/IFSelect/IFSelect_DispPerFiles.hxx b/src/IFSelect/IFSelect_DispPerFiles.hxx deleted file mode 100644 index 02f4258a4c..0000000000 --- a/src/IFSelect/IFSelect_DispPerFiles.hxx +++ /dev/null @@ -1,96 +0,0 @@ -// Created on: 1994-12-21 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_DispPerFiles_HeaderFile -#define _IFSelect_DispPerFiles_HeaderFile - -#include -#include - -#include -#include -class IFSelect_IntParam; -class TCollection_AsciiString; -class Interface_Graph; -class IFGraph_SubPartsIterator; - - -class IFSelect_DispPerFiles; -DEFINE_STANDARD_HANDLE(IFSelect_DispPerFiles, IFSelect_Dispatch) - -//! A DispPerFiles produces a determined count of Packets from the -//! input Entities. It divides, as equally as possible, the input -//! list into a count of files. This count is the parameter of the -//! DispPerFiles. If the input list has less than this count, of -//! course there will be one packet per input entity. -//! This count is a Parameter of the DispPerFiles, given as an -//! IntParam, thus allowing external control of its Value -class IFSelect_DispPerFiles : public IFSelect_Dispatch -{ - -public: - - - //! Creates a DispPerFiles with no Count (default value 1 file) - Standard_EXPORT IFSelect_DispPerFiles(); - - //! Returns the Count Parameter used for splitting - Standard_EXPORT Handle(IFSelect_IntParam) Count() const; - - //! Sets a new Parameter for Count - Standard_EXPORT void SetCount (const Handle(IFSelect_IntParam)& count); - - //! Returns the effective value of the count parameter - //! (if Count Parameter not Set or value not positive, returns 1) - Standard_EXPORT Standard_Integer CountValue() const; - - //! Returns as Label, "Maximum Files" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - //! Returns True, maximum count is given as CountValue - Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE; - - //! Computes the list of produced Packets. It defines Packets in - //! order to have Packets, except if the input count of - //! Entities is lower. Entities are given by RootResult from the - //! Final Selection. - Standard_EXPORT void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_DispPerFiles,IFSelect_Dispatch) - -protected: - - - - -private: - - - Handle(IFSelect_IntParam) thecount; - - -}; - - - - - - - -#endif // _IFSelect_DispPerFiles_HeaderFile diff --git a/src/IFSelect/IFSelect_DispPerOne.cxx b/src/IFSelect/IFSelect_DispPerOne.cxx deleted file mode 100644 index 4778c80792..0000000000 --- a/src/IFSelect/IFSelect_DispPerOne.cxx +++ /dev/null @@ -1,47 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_DispPerOne,IFSelect_Dispatch) - -// Genere un paquet par racine (strong comp.) locale a la liste transmise -IFSelect_DispPerOne::IFSelect_DispPerOne () { } - - TCollection_AsciiString IFSelect_DispPerOne::Label () const -{ return TCollection_AsciiString ("One File per Input Entity"); } - - - Standard_Boolean IFSelect_DispPerOne::LimitedMax - (const Standard_Integer nbent, Standard_Integer& pcount) const -{ pcount = nbent; return Standard_True; } - - void IFSelect_DispPerOne::Packets - (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const -{ - IFGraph_SCRoots packsc(G,Standard_False); // OK pour SubPartsIterator - packsc.SetLoad(); - packsc.GetFromIter(FinalSelection()->UniqueResult(G)); -// SCRoots a initie la resolution : decoupage en StrongComponants + selection -// des Racines. Chaque Racine correspond a un Packet. CQFD - packs.GetParts(packsc); -} diff --git a/src/IFSelect/IFSelect_DispPerOne.hxx b/src/IFSelect/IFSelect_DispPerOne.hxx deleted file mode 100644 index 2d889111c3..0000000000 --- a/src/IFSelect/IFSelect_DispPerOne.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_DispPerOne_HeaderFile -#define _IFSelect_DispPerOne_HeaderFile - -#include -#include - -#include -#include -class TCollection_AsciiString; -class Interface_Graph; -class IFGraph_SubPartsIterator; - - -class IFSelect_DispPerOne; -DEFINE_STANDARD_HANDLE(IFSelect_DispPerOne, IFSelect_Dispatch) - -//! A DispPerOne gathers all the input Entities into as many -//! Packets as there Root Entities from the Final Selection, -//! that is, one Packet per Entity -class IFSelect_DispPerOne : public IFSelect_Dispatch -{ - -public: - - - //! Creates a DispPerOne - Standard_EXPORT IFSelect_DispPerOne(); - - //! Returns as Label, "One File per Input Entity" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - //! Returns True, maximum limit is given as - Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE; - - //! Returns the list of produced Packets. It defines one Packet - //! per Entity given by RootResult from the Final Selection. - Standard_EXPORT void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_DispPerOne,IFSelect_Dispatch) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_DispPerOne_HeaderFile diff --git a/src/IFSelect/IFSelect_DispPerSignature.cxx b/src/IFSelect/IFSelect_DispPerSignature.cxx deleted file mode 100644 index fda05474fd..0000000000 --- a/src/IFSelect/IFSelect_DispPerSignature.cxx +++ /dev/null @@ -1,80 +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(IFSelect_DispPerSignature,IFSelect_Dispatch) - -IFSelect_DispPerSignature::IFSelect_DispPerSignature () { } - - Handle(IFSelect_SignCounter) IFSelect_DispPerSignature::SignCounter () const -{ return thesign; } - - void IFSelect_DispPerSignature::SetSignCounter - (const Handle(IFSelect_SignCounter)& sign) -{ thesign = sign; thesign->SetList (Standard_True); } - - Standard_CString IFSelect_DispPerSignature::SignName () const -{ return (Standard_CString ) (thesign.IsNull() ? "???" : thesign->Name()); } - - TCollection_AsciiString IFSelect_DispPerSignature::Label () const -{ - char lab[50]; - sprintf (lab,"One File per Signature %s",SignName()); - return TCollection_AsciiString(lab); -} - - Standard_Boolean IFSelect_DispPerSignature::LimitedMax - (const Standard_Integer nbent, Standard_Integer& max) const -{ - max = nbent; - return Standard_True; -} - - void IFSelect_DispPerSignature::Packets - (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const -{ - if (thesign.IsNull()) { - packs.AddPart(); - packs.GetFromIter (FinalSelection()->RootResult(G)); - return; - } - - thesign->Clear(); - thesign->AddList (FinalSelection()->RootResult(G).Content(),G.Model()); - Handle(TColStd_HSequenceOfHAsciiString) list = thesign->List(); - Standard_Integer i,nb,is,nbs = list->Length(); - Handle(TCollection_HAsciiString) asign; - Handle(TColStd_HSequenceOfTransient) ents; - for (is = 1; is <= nbs; is ++) { - asign = list->Value(is); - ents = thesign->Entities (asign->ToCString()); - if (ents.IsNull()) continue; - packs.AddPart(); - nb = ents->Length(); - for (i = 1; i <= nb; i ++) - packs.GetFromEntity (ents->Value(i),Standard_False); - } -} diff --git a/src/IFSelect/IFSelect_DispPerSignature.hxx b/src/IFSelect/IFSelect_DispPerSignature.hxx deleted file mode 100644 index 94622de19e..0000000000 --- a/src/IFSelect/IFSelect_DispPerSignature.hxx +++ /dev/null @@ -1,92 +0,0 @@ -// Created on: 1994-12-21 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_DispPerSignature_HeaderFile -#define _IFSelect_DispPerSignature_HeaderFile - -#include -#include - -#include -#include -class IFSelect_SignCounter; -class TCollection_AsciiString; -class Interface_Graph; -class IFGraph_SubPartsIterator; - - -class IFSelect_DispPerSignature; -DEFINE_STANDARD_HANDLE(IFSelect_DispPerSignature, IFSelect_Dispatch) - -//! A DispPerSignature sorts input Entities according to a -//! Signature : it works with a SignCounter to do this. -class IFSelect_DispPerSignature : public IFSelect_Dispatch -{ - -public: - - - //! Creates a DispPerSignature with no SignCounter (by default, - //! produces only one packet) - Standard_EXPORT IFSelect_DispPerSignature(); - - //! Returns the SignCounter used for splitting - Standard_EXPORT Handle(IFSelect_SignCounter) SignCounter() const; - - //! Sets a SignCounter for sort - //! Remark : it is set to record lists of entities, not only counts - Standard_EXPORT void SetSignCounter (const Handle(IFSelect_SignCounter)& sign); - - //! Returns the name of the SignCounter, which caracterises the - //! sorting criterium for this Dispatch - Standard_EXPORT Standard_CString SignName() const; - - //! Returns as Label, "One File per Signature " - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - //! Returns True, maximum count is given as - Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE; - - //! Computes the list of produced Packets. It defines Packets from - //! the SignCounter, which sirts the input Entities per Signature - //! (specific of the SignCounter). - Standard_EXPORT void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_DispPerSignature,IFSelect_Dispatch) - -protected: - - - - -private: - - - Handle(IFSelect_SignCounter) thesign; - - -}; - - - - - - - -#endif // _IFSelect_DispPerSignature_HeaderFile diff --git a/src/IFSelect/IFSelect_Dispatch.cxx b/src/IFSelect/IFSelect_Dispatch.cxx deleted file mode 100644 index db9b00d002..0000000000 --- a/src/IFSelect/IFSelect_Dispatch.cxx +++ /dev/null @@ -1,83 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_Dispatch,Standard_Transient) - -void IFSelect_Dispatch::SetRootName - (const Handle(TCollection_HAsciiString)& name) -{ - thename = name; -} - - Standard_Boolean IFSelect_Dispatch::HasRootName () const - { return (!thename.IsNull()); } - - const Handle(TCollection_HAsciiString)& IFSelect_Dispatch::RootName () const - { return thename; } - - void IFSelect_Dispatch::SetFinalSelection - (const Handle(IFSelect_Selection)& sel) - { thefinal = sel; } - - Handle(IFSelect_Selection) IFSelect_Dispatch::FinalSelection () const - { return thefinal; } - - IFSelect_SelectionIterator IFSelect_Dispatch::Selections () const -{ - IFSelect_SelectionIterator iter; - iter.AddItem(thefinal); - for(; iter.More(); iter.Next()) { - iter.Value()->FillIterator(iter); // Iterateur qui se court apres - } - return iter; -} - - - Standard_Boolean IFSelect_Dispatch::CanHaveRemainder () const - { return Standard_False; } - - Standard_Boolean IFSelect_Dispatch::LimitedMax - (const Standard_Integer , Standard_Integer& max) const - { max = 0; return Standard_False; } - - Interface_EntityIterator IFSelect_Dispatch::GetEntities - (const Interface_Graph& G) const - { return thefinal->UniqueResult(G); } - - Interface_EntityIterator IFSelect_Dispatch::Packeted - (const Interface_Graph& G) const -{ - Interface_EntityIterator total = GetEntities(G); - Interface_EntityIterator remain = Remainder(G); - if (remain.NbEntities() == 0) return total; -// sinon, faire la difference ! - IFGraph_Compare GC(G); - GC.GetFromIter (total, Standard_True); - GC.GetFromIter (remain,Standard_False); - return GC.FirstOnly(); -} - - Interface_EntityIterator IFSelect_Dispatch::Remainder - (const Interface_Graph& ) const - { Interface_EntityIterator iter; return iter; } // par defaut vide diff --git a/src/IFSelect/IFSelect_Dispatch.hxx b/src/IFSelect/IFSelect_Dispatch.hxx deleted file mode 100644 index 11c8126ffa..0000000000 --- a/src/IFSelect/IFSelect_Dispatch.hxx +++ /dev/null @@ -1,151 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_Dispatch_HeaderFile -#define _IFSelect_Dispatch_HeaderFile - -#include -#include - -#include -#include -class TCollection_HAsciiString; -class IFSelect_Selection; -class IFSelect_SelectionIterator; -class TCollection_AsciiString; -class Interface_EntityIterator; -class Interface_Graph; -class IFGraph_SubPartsIterator; - - -class IFSelect_Dispatch; -DEFINE_STANDARD_HANDLE(IFSelect_Dispatch, Standard_Transient) - -//! This class allows to describe how a set of Entities has to be -//! dispatched into resulting Packets : a Packet is a sub-set of -//! the initial set of entities. -//! -//! Thus, it can generate zero, one, or more Packets according -//! input set and criterium of dispatching. And it can let apart -//! some entities : it is the Remainder, which can be recovered -//! by a specific Selection (RemainderFromDispatch). -//! -//! Depending of sub-classes, a Dispatch can potentially generate -//! a limited or not count of packet, and a remainder or none. -//! -//! The input set is read from a specified Selection, attached to -//! the Dispatch : the Final Selection of the Dispatch. The input -//! is the Unique Root Entities list of the Final Selection -class IFSelect_Dispatch : public Standard_Transient -{ - -public: - - - //! Sets a Root Name as an HAsciiString - //! To reset it, give a Null Handle (then, a ShareOut will have - //! to define the Default Root Name) - Standard_EXPORT void SetRootName (const Handle(TCollection_HAsciiString)& name); - - //! Returns True if a specific Root Name has been set - //! (else, the Default Root Name has to be used) - Standard_EXPORT Standard_Boolean HasRootName() const; - - //! Returns the Root Name for files produced by this dispatch - //! It is empty if it has not been set or if it has been reset - Standard_EXPORT const Handle(TCollection_HAsciiString)& RootName() const; - - //! Stores (or Changes) the Final Selection for a Dispatch - Standard_EXPORT void SetFinalSelection (const Handle(IFSelect_Selection)& sel); - - //! Returns the Final Selection of a Dispatch - //! we 'd like : C++ : return const & - Standard_EXPORT Handle(IFSelect_Selection) FinalSelection() const; - - //! Returns the complete list of source Selections (starting - //! from FinalSelection) - Standard_EXPORT IFSelect_SelectionIterator Selections() const; - - //! Returns True if a Dispatch can have a Remainder, i.e. if its - //! criterium can let entities apart. It is a potential answer, - //! remainder can be empty at run-time even if answer is True. - //! (to attach a RemainderFromDispatch Selection is not allowed if - //! answer is True). - //! Default answer given here is False (can be redefined) - Standard_EXPORT virtual Standard_Boolean CanHaveRemainder() const; - - //! Returns True if a Dispatch generates a count of Packets always - //! less than or equal to a maximum value : it can be computed - //! from the total count of Entities to be dispatched : . - //! If answer is False, no limited maximum is expected for account - //! If answer is True, expected maximum is given in argument - //! Default answer given here is False (can be redefined) - Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const; - - //! Returns a text which defines the way a Dispatch produces - //! packets (which will become files) from its Input - Standard_EXPORT virtual TCollection_AsciiString Label() const = 0; - - //! Gets Unique Root Entities from the Final Selection, given an - //! input Graph - //! This the starting step for an Evaluation (Packets - Remainder) - Standard_EXPORT Interface_EntityIterator GetEntities (const Interface_Graph& G) const; - - //! Returns the list of produced Packets into argument . - //! Each Packet corresponds to a Part, the Entities listed are the - //! Roots given by the Selection. Input is given as a Graph. - //! Thus, to create a file from a packet, it suffices to take the - //! entities listed in a Part of Packets (that is, a Packet) - //! without worrying about Shared entities - //! This method can raise an Exception if data are not coherent - Standard_EXPORT virtual void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const = 0; - - //! Returns the list of all Input Entities (see GetEntities) which - //! are put in a Packet. That is, Entities listed in GetEntities - //! but not in Remainder (see below). Input is given as a Graph. - Standard_EXPORT Interface_EntityIterator Packeted (const Interface_Graph& G) const; - - //! Returns Remainder which is a set of Entities. Can be empty. - //! Default evaluation is empty (has to be redefined if - //! CanHaveRemainder is redefined to return True). - Standard_EXPORT virtual Interface_EntityIterator Remainder (const Interface_Graph& G) const; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_Dispatch,Standard_Transient) - -protected: - - - - -private: - - - Handle(TCollection_HAsciiString) thename; - Handle(IFSelect_Selection) thefinal; - - -}; - - - - - - - -#endif // _IFSelect_Dispatch_HeaderFile diff --git a/src/IFSelect/IFSelect_EditForm.cxx b/src/IFSelect/IFSelect_EditForm.cxx deleted file mode 100644 index 7065164e56..0000000000 --- a/src/IFSelect/IFSelect_EditForm.cxx +++ /dev/null @@ -1,546 +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(IFSelect_EditForm,Standard_Transient) - -IFSelect_EditForm::IFSelect_EditForm - (const Handle(IFSelect_Editor)& editor, - const Standard_Boolean readonly, const Standard_Boolean undoable, - const Standard_CString label) - : thecomplete (Standard_True) , - theloaded (Standard_False) , - thekeepst (Standard_False) , - thelabel (label) , - thenums (0,1) , - theorigs (0, (undoable ? editor->NbValues() : 0) ) , - themodifs (0, (readonly ? 0 : editor->NbValues()) ) , - thestatus (0, (readonly ? 0 : editor->NbValues()) ) , - theeditor (editor) , - thetouched (0) { } - - IFSelect_EditForm::IFSelect_EditForm - (const Handle(IFSelect_Editor)& editor, - const TColStd_SequenceOfInteger& nums, - const Standard_Boolean readonly, const Standard_Boolean undoable, - const Standard_CString label) - : thecomplete (Standard_False) , - theloaded (Standard_False) , - thekeepst (Standard_False) , - thelabel (label) , - thenums (0,nums.Length()) , - theorigs (0, (undoable ? nums.Length() : 0) ) , - themodifs (0, (readonly ? 0 : nums.Length()) ) , - thestatus (0, (readonly ? 0 : nums.Length()) ) , - theeditor (editor) , - thetouched (0) -{ - Standard_Integer i,nb = nums.Length(); - for (i = 1; i <= nb; i ++) thenums.SetValue (i,nums.Value(i)); -} - - Standard_Boolean& IFSelect_EditForm::EditKeepStatus () - { return thekeepst; } - - Standard_CString IFSelect_EditForm::Label () const - { return thelabel.ToCString(); } - - Standard_Boolean IFSelect_EditForm::IsLoaded () const - { return theloaded; } - - void IFSelect_EditForm::ClearData () - { theent.Nullify(); themodel.Nullify(); theloaded = Standard_False; } - - void IFSelect_EditForm::SetData - (const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model) - { theent = ent; themodel = model; } - - void IFSelect_EditForm::SetEntity - (const Handle(Standard_Transient)& ent) - { theent = ent; } - - void IFSelect_EditForm::SetModel - (const Handle(Interface_InterfaceModel)& model) - { themodel = model; } - - Handle(Standard_Transient) IFSelect_EditForm::Entity () const - { return theent; } - - Handle(Interface_InterfaceModel) IFSelect_EditForm::Model () const - { return themodel; } - - Handle(IFSelect_Editor) IFSelect_EditForm::Editor () const - { return theeditor; } - - Standard_Boolean IFSelect_EditForm::IsComplete () const - { return thecomplete; } - - Standard_Integer IFSelect_EditForm::NbValues - (const Standard_Boolean editable) const -{ - if (!editable || thecomplete) return theeditor->NbValues(); - return thenums.Upper(); -} - - Standard_Integer IFSelect_EditForm::NumberFromRank - (const Standard_Integer rank) const -{ - if (thecomplete) return rank; - if (rank < 1 || rank > thenums.Upper()) return 0; - return thenums.Value(rank); -} - - Standard_Integer IFSelect_EditForm::RankFromNumber - (const Standard_Integer num) const -{ - if (thecomplete) return num; - Standard_Integer i, n = thenums.Upper(); - for (i = 1; i <= n; i ++) { - if (thenums.Value(i) == num) return i; - } - return 0; -} - - Standard_Integer IFSelect_EditForm::NameNumber - (const Standard_CString name) const -{ - Standard_Integer res = theeditor->NameNumber(name); - if (thecomplete || res == 0) return res; -// Sinon, chercher res dans thenums - Standard_Integer i, nb = thenums.Length(); - for (i = 1; i <= nb; i ++) { - if (res == thenums.Value(i)) return res; - } - return -res; -} - - Standard_Integer IFSelect_EditForm::NameRank - (const Standard_CString name) const -{ - Standard_Integer res = theeditor->NameNumber(name); - if (thecomplete || res == 0) return res; -// Sinon, chercher res dans thenums - Standard_Integer i, nb = thenums.Length(); - for (i = 1; i <= nb; i ++) { - if (res == thenums.Value(i)) return i; - } - return 0; -} - - - void IFSelect_EditForm::LoadDefault () -{ - theloaded = Standard_True; - thetouched = 0; - Standard_Integer i,nb = theorigs.Upper(); - if (nb == 0) return; - for (i = 1; i <= nb; i ++) { - Standard_Integer num = NumberFromRank(i); - if (num == 0) continue; - Handle(TCollection_HAsciiString) str = theeditor->StringValue (this,num); - theorigs.SetValue (i,str); - } -} - - - Standard_Boolean IFSelect_EditForm::LoadData - (const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model) -{ - thetouched = 0; - if (!theeditor->Load (this,ent,model)) return Standard_False; - SetData (ent,model); - theloaded = Standard_True; - return Standard_True; -} - - Standard_Boolean IFSelect_EditForm::LoadEntity - (const Handle(Standard_Transient)& ent) -{ - thetouched = 0; - Handle(Interface_InterfaceModel) model; - if (!theeditor->Load (this,ent,model)) return Standard_False; - SetEntity (ent); - theloaded = Standard_True; - return Standard_True; -} - - Standard_Boolean IFSelect_EditForm::LoadModel - (const Handle(Interface_InterfaceModel)& model) -{ - thetouched = 0; - Handle(Standard_Transient) ent; - if (!theeditor->Load (this,ent,model)) return Standard_False; - SetData (ent,model); - theloaded = Standard_True; - return Standard_True; -} - - Standard_Boolean IFSelect_EditForm::LoadData () -{ - thetouched = 0; - Handle(Interface_InterfaceModel) model; - Handle(Standard_Transient) ent; - if (!theeditor->Load (this,ent,model)) return Standard_False; - theloaded = Standard_True; - return Standard_True; -} - - -// ######## VALUES ######## - - Handle(IFSelect_ListEditor) IFSelect_EditForm::ListEditor - (const Standard_Integer num) const -{ - Standard_Integer n = RankFromNumber(num); - Handle(IFSelect_ListEditor) led; - if (n <= 0 || n > theorigs.Upper()) return led; - if (!theeditor->IsList(n)) return led; - led = theeditor->ListEditor (num); - Handle(TColStd_HSequenceOfHAsciiString) lis = theeditor->ListValue(this,num); - led->LoadModel (themodel); - led->LoadValues (lis); - return led; -} - - void IFSelect_EditForm::LoadValue - (const Standard_Integer num, const Handle(TCollection_HAsciiString)& val) -{ - Standard_Integer n = RankFromNumber(num); - if (n <= 0 || n > theorigs.Upper()) return; - theorigs.SetValue (n,val); -} - - void IFSelect_EditForm::LoadList - (const Standard_Integer num, const Handle(TColStd_HSequenceOfHAsciiString)& list) -{ - Standard_Integer n = RankFromNumber(num); - if (n <= 0 || n > theorigs.Upper()) return; - theorigs.SetValue (n,list); -} - - - Handle(TCollection_HAsciiString) IFSelect_EditForm::OriginalValue - (const Standard_Integer num) const -{ - Standard_Integer n = RankFromNumber(num); - Handle(TCollection_HAsciiString) val; - if (theorigs.Upper() == 0) return theeditor->StringValue (this,num); - else return Handle(TCollection_HAsciiString)::DownCast(theorigs.Value(n)); -} - - Handle(TColStd_HSequenceOfHAsciiString) IFSelect_EditForm::OriginalList - (const Standard_Integer num) const -{ - Standard_Integer n = RankFromNumber(num); - Handle(TColStd_HSequenceOfHAsciiString) list; - if (theorigs.Upper() == 0) return theeditor->ListValue (this,num); - else return Handle(TColStd_HSequenceOfHAsciiString)::DownCast(theorigs.Value(n)); -} - - Handle(TCollection_HAsciiString) IFSelect_EditForm::EditedValue - (const Standard_Integer num) const -{ - if (themodifs.Upper() == 0) return OriginalValue(num); - if (!IsModified(num)) return OriginalValue(num); - Standard_Integer n = RankFromNumber(num); - return Handle(TCollection_HAsciiString)::DownCast(themodifs.Value(n)); -} - - Handle(TColStd_HSequenceOfHAsciiString) IFSelect_EditForm::EditedList - (const Standard_Integer num) const -{ - if (themodifs.Upper() == 0) return OriginalList(num); - if (!IsModified(num)) return OriginalList(num); - Standard_Integer n = RankFromNumber(num); - return Handle(TColStd_HSequenceOfHAsciiString)::DownCast(themodifs.Value(n)); -} - - - Standard_Boolean IFSelect_EditForm::IsModified - (const Standard_Integer num) const -{ - if (thestatus.Upper() == 0) return Standard_False; - Standard_Integer n = RankFromNumber(num); - return (thestatus.Value(n) != 0); -} - - Standard_Boolean IFSelect_EditForm::IsTouched - (const Standard_Integer num) const -{ - if (thestatus.Upper() == 0) return Standard_False; - Standard_Integer n = RankFromNumber(num); - return (thestatus.Value(n) == 2); -} - - Standard_Boolean IFSelect_EditForm::Modify - (const Standard_Integer num, const Handle(TCollection_HAsciiString)& newval, - const Standard_Boolean enforce) -{ -// Peut-on editer - thetouched = 0; - if (themodifs.Upper() == 0) return Standard_False; - Standard_Integer tnum = RankFromNumber(num); - if (tnum == 0) return Standard_False; - IFSelect_EditValue acc = theeditor->EditMode (num); - if (newval.IsNull() && acc != IFSelect_Optional) return Standard_False; - if (!enforce && (acc == IFSelect_EditProtected || acc == IFSelect_EditComputed)) return Standard_False; - -// Satisfies ? - Handle(Interface_TypedValue) typval = theeditor->TypedValue(num); - if (!typval->Satisfies(newval)) return Standard_False; - Interface_ParamType pty = typval->Type(); - if (pty == Interface_ParamIdent && !newval.IsNull()) { - if (themodel.IsNull()) return Standard_False; - if (themodel->NextNumberForLabel(newval->ToCString(),0,Standard_False) <= 0) - return Standard_False; - } - -// Update ? - if (!theeditor->Update(this,num,newval,enforce)) return Standard_False; - - thestatus.SetValue (tnum,1); - themodifs.SetValue (tnum,newval); - return Standard_True; -} - - Standard_Boolean IFSelect_EditForm::ModifyList - (const Standard_Integer num, const Handle(IFSelect_ListEditor)& edited, - const Standard_Boolean enforce) -{ -// Faut-il prendre - if (edited.IsNull()) return Standard_False; - if (!edited->IsTouched()) return Standard_False; - Handle(TColStd_HSequenceOfHAsciiString) newlist = edited->EditedValues(); - -// Peut-on editer - thetouched = 0; - if (themodifs.Upper() == 0) return Standard_False; - Standard_Integer tnum = RankFromNumber(num); - if (tnum == 0) return Standard_False; - IFSelect_EditValue acc = theeditor->EditMode (num); - if (acc == IFSelect_EditRead || acc == IFSelect_EditDynamic) return Standard_False; - if (newlist.IsNull() && acc != IFSelect_Optional) return Standard_False; - if (!enforce && (acc == IFSelect_EditProtected || acc == IFSelect_EditComputed)) return Standard_False; - -// Update ? - if (!theeditor->UpdateList(this,num,newlist,enforce)) return Standard_False; - - thestatus.SetValue (tnum,1); - themodifs.SetValue (tnum,newlist); - return Standard_True; -} - - Standard_Boolean IFSelect_EditForm::ModifyListValue - (const Standard_Integer num, const Handle(TColStd_HSequenceOfHAsciiString)& list, - const Standard_Boolean enforce) -{ - Handle(IFSelect_ListEditor) led = ListEditor (num); - if (led.IsNull()) return Standard_False; - if (!led->LoadEdited(list)) return Standard_False; - return ModifyList (num,led,enforce); -} - - - Standard_Boolean IFSelect_EditForm::Touch - (const Standard_Integer num, const Handle(TCollection_HAsciiString)& newval) -{ - if (themodifs.Upper() == 0) return Standard_False; - Standard_Integer tnum = RankFromNumber(num); - if (tnum == 0) return Standard_False; - - thestatus.SetValue (tnum,2); - themodifs.SetValue (tnum,newval); - thetouched ++; - return Standard_True; -} - - Standard_Boolean IFSelect_EditForm::TouchList - (const Standard_Integer num, const Handle(TColStd_HSequenceOfHAsciiString)& newlist) -{ - if (themodifs.Upper() == 0) return Standard_False; - Standard_Integer tnum = RankFromNumber(num); - if (tnum == 0) return Standard_False; - - thestatus.SetValue (tnum,2); - themodifs.SetValue (tnum,newlist); - thetouched ++; - return Standard_True; -} - - - void IFSelect_EditForm::ClearEdit (const Standard_Integer num) -{ - Standard_Integer i, nb = thestatus.Upper(); - if (num == 0) { - for (i = 1; i <= nb; i ++) thestatus.SetValue (i,0); - } else { - Standard_Integer tnum = RankFromNumber(num); - if (tnum > 0 && num <= nb) thestatus.SetValue (tnum,0); - } -} - - - void IFSelect_EditForm::PrintDefs (Standard_OStream& S) const -{ - Standard_Integer iv, nbv = NbValues(Standard_True); - S<<"***** EditForm, Label : "<Length(); - S<<"(List : "<Value(i); - S<<" ["<ToCString())<DynamicType()->Name(); - } else { - if (theent.IsNull()) S<<"***** No loaded entity"; - else { S<<"***** Loaded entity : "; themodel->PrintLabel (theent, S); } - } - } - S<MaxNameLength (names ? 0 : -1); - if (maxnam == 0) { maxnam = theeditor->MaxNameLength (0); nams = Standard_True; } - Standard_Integer nbmod = 0; - if (what != 0) S<<"Mod N0 Name Value"<Name(jv,!nams); - -// Original ou Final - if (what != 0) { - Handle(TCollection_HAsciiString) str; - if (IsModified(jv)) S<<"* "; - else S<<" "; - S<IsList(jv)) { - Handle(TColStd_HSequenceOfHAsciiString) list; - if (what < 0) list = OriginalList (jv); - if (what > 0) list = EditedList (jv); - PrintList (list,S,alsolist); - continue; - } - - if (what < 0) str = OriginalValue (jv); - if (what > 0) str = EditedValue (jv); - - S<< (str.IsNull() ? "(NULL)" : str->ToCString()) <IsList(jv)) { - Handle(TColStd_HSequenceOfHAsciiString) list= OriginalList (jv); - S<ToCString()) <ToCString()) <Recognize(this); } - - Standard_Boolean IFSelect_EditForm::ApplyData - (const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model) - { return theeditor->Apply (this,ent,model); } - - - Standard_Boolean IFSelect_EditForm::Undo () -{ - if (thestatus.Upper() == 0 || theorigs.Upper() == 0) return Standard_False; - Standard_Integer i, nb = thestatus.Upper(); - for (i = 1; i <= nb; i ++) { - if (thestatus.Value (i) != 0) themodifs.SetValue (i,theorigs.Value(i)); - } - return Apply (); -} diff --git a/src/IFSelect/IFSelect_EditForm.hxx b/src/IFSelect/IFSelect_EditForm.hxx deleted file mode 100644 index 857715a5b9..0000000000 --- a/src/IFSelect/IFSelect_EditForm.hxx +++ /dev/null @@ -1,294 +0,0 @@ -// Created on: 1998-02-23 -// Created by: Christian CAILLET -// Copyright (c) 1998-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 _IFSelect_EditForm_HeaderFile -#define _IFSelect_EditForm_HeaderFile - -#include - -#include -#include -#include -#include -#include -#include -class IFSelect_Editor; -class Interface_InterfaceModel; -class IFSelect_ListEditor; -class TCollection_HAsciiString; - -class IFSelect_EditForm; -DEFINE_STANDARD_HANDLE(IFSelect_EditForm, Standard_Transient) - -//! An EditForm is the way to apply an Editor on an Entity or on -//! the Model -//! It gives read-only or read-write access, with or without undo -//! -//! It can be complete (all the values of the Editor are present) -//! or partial (a sub-list of these value are present) -//! Anyway, all references to Number (argument ) refer to -//! Number of Value for the Editor -//! While references to Rank are for rank in the EditForm, which -//! may differ if it is not Complete -//! Two methods give the correspondence between this Number and -//! the Rank in the EditForm : RankFromNumber and NumberFromRank -class IFSelect_EditForm : public Standard_Transient -{ -public: - - //! Creates a complete EditForm from an Editor - //! A specific Label can be given - Standard_EXPORT IFSelect_EditForm(const Handle(IFSelect_Editor)& editor, const Standard_Boolean readonly, const Standard_Boolean undoable, const Standard_CString label = ""); - - //! Creates an extracted EditForm from an Editor, limited to - //! the values identified in - //! A specific Label can be given - Standard_EXPORT IFSelect_EditForm(const Handle(IFSelect_Editor)& editor, const TColStd_SequenceOfInteger& nums, const Standard_Boolean readonly, const Standard_Boolean undoable, const Standard_CString label = ""); - - //! Returns and may change the keep status on modif - //! It starts as False - //! If it is True, Apply does not clear modification status - //! and the EditForm can be loaded again, modified value remain - //! and may be applied again - //! Remark that ApplyData does not clear the modification status, - //! a call to ClearEdit does - Standard_EXPORT Standard_Boolean& EditKeepStatus(); - - Standard_EXPORT Standard_CString Label() const; - - //! Tells if the EditForm is loaded now - Standard_EXPORT Standard_Boolean IsLoaded() const; - - Standard_EXPORT void ClearData(); - - Standard_EXPORT void SetData (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model); - - Standard_EXPORT void SetEntity (const Handle(Standard_Transient)& ent); - - Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& model); - - Standard_EXPORT Handle(Standard_Transient) Entity() const; - - Standard_EXPORT Handle(Interface_InterfaceModel) Model() const; - - Standard_EXPORT Handle(IFSelect_Editor) Editor() const; - - //! Tells if an EditForm is complete or is an extract from Editor - Standard_EXPORT Standard_Boolean IsComplete() const; - - //! Returns the count of values - //! True : count of editable values, i.e. - //! For a complete EditForm, it is given by the Editor - //! Else, it is the length of the extraction map - //! False : all the values from the Editor - Standard_EXPORT Standard_Integer NbValues (const Standard_Boolean editable) const; - - //! Returns the Value Number in the Editor from a given Rank in - //! the EditForm - //! For a complete EditForm, both are equal - //! Else, it is given by the extraction map - //! Returns 0 if exceeds the count of editable values, - Standard_EXPORT Standard_Integer NumberFromRank (const Standard_Integer rank) const; - - //! Returns the Rank in the EditForm from a given Number of Value - //! for the Editor - //! For a complete EditForm, both are equal - //! Else, it is given by the extraction map - //! Returns 0 if is not forecast to be edited, or is - //! out of range - Standard_EXPORT Standard_Integer RankFromNumber (const Standard_Integer number) const; - - //! Returns the Value Number in the Editor for a given Name - //! i.e. the true ValueNumber which can be used in various methods - //! of EditForm - //! If it is not complete, for a recorded (in the Editor) but - //! non-loaded name, returns negative value (- number) - Standard_EXPORT Standard_Integer NameNumber (const Standard_CString name) const; - - //! Returns the Rank of Value in the EditForm for a given Name - //! i.e. if it is not complete, for a recorded (in the Editor) but - //! non-loaded name, returns 0 - Standard_EXPORT Standard_Integer NameRank (const Standard_CString name) const; - - //! For a read-write undoable EditForm, loads original values - //! from defaults stored in the Editor - Standard_EXPORT void LoadDefault(); - - //! Loads modifications to data - //! Default uses Editor. Can be redefined - //! Remark that and/or may be null, according to the - //! kind of Editor. Shortcuts are available for these cases, but - //! they finally call LoadData (hence, just ignore non-used args) - Standard_EXPORT virtual Standard_Boolean LoadData (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model); - - //! Shortcut for LoadData when is not used - Standard_EXPORT Standard_Boolean LoadEntity (const Handle(Standard_Transient)& ent); - - //! Shortcut for LoadData when only the model is concerned - Standard_EXPORT Standard_Boolean LoadModel (const Handle(Interface_InterfaceModel)& model); - - //! Shortcut when both and are not used - //! (when the Editor works on fully static or global data) - Standard_EXPORT Standard_Boolean LoadData(); - - //! Returns a ListEditor to edit the parameter of the - //! EditForm, if it is a List - //! The Editor created it (by ListEditor) then loads it (by - //! ListValue) - //! For a single parameter, returns a Null Handle ... - Standard_EXPORT Handle(IFSelect_ListEditor) ListEditor (const Standard_Integer num) const; - - //! Loads an original value (single). Called by the Editor only - Standard_EXPORT void LoadValue (const Standard_Integer num, const Handle(TCollection_HAsciiString)& val); - - //! Loads an original value as a list. Called by the Editor only - Standard_EXPORT void LoadList (const Standard_Integer num, const Handle(TColStd_HSequenceOfHAsciiString)& list); - - //! From an edited value, returns its ... value (original one) - //! Null means that this value is not defined - //! is for the EditForm, not the Editor - //! It is for a single parameter. For a list, gives a Null Handle - Standard_EXPORT Handle(TCollection_HAsciiString) OriginalValue (const Standard_Integer num) const; - - //! Returns an original value, as a list - //! is for the EditForm, not the Editor - //! For a single parameter, gives a Null Handle - Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) OriginalList (const Standard_Integer num) const; - - //! Returns the Edited (i.e. Modified) Value (string for single) - //! reports to the EditForm - //! If IsModified is False, returns OriginalValue - //! Null with IsModified True : means that this value is not - //! defined or has been removed - //! It is for a single parameter. For a list, gives a Null Handle - Standard_EXPORT Handle(TCollection_HAsciiString) EditedValue (const Standard_Integer num) const; - - //! Returns the Edited Value as a list - //! If IsModified is False, returns OriginalValue - //! Null with IsModified True : means that this value is not - //! defined or has been removed - //! For a single parameter, gives a Null Handle - Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) EditedList (const Standard_Integer num) const; - - //! Tells if a Value (of the EditForm) is modified (directly or - //! through touching by Update) - Standard_EXPORT Standard_Boolean IsModified (const Standard_Integer num) const; - - //! Tells if a Value (of the EditForm) has been touched, i.e. - //! not modified directly but by the modification of another one - //! (by method Update from the Editor) - Standard_EXPORT Standard_Boolean IsTouched (const Standard_Integer num) const; - - //! Gives a new value for the item of the EditForm, if - //! it is a single parameter (for a list, just returns False) - //! Null means to Remove it - //! True to overpass Protected or Computed Access Mode - //! Calls the method Update from the Editor, which can touch other - //! parameters (see NbTouched) - //! Returns True if well recorded, False if this value is not - //! allowed - //! Warning : Does not apply immediately : will be applied by the method - //! Apply - Standard_EXPORT Standard_Boolean Modify (const Standard_Integer num, const Handle(TCollection_HAsciiString)& newval, const Standard_Boolean enforce = Standard_False); - - //! Changes the value of an item of the EditForm, if it is a List - //! (else, just returns False) - //! The ListEditor contains the edited values of the list - //! If no edition was recorded, just returns False - //! Calls the method Update from the Editor, which can touch other - //! parameters (see NbTouched) - //! Returns True if well recorded, False if this value is not - //! allowed - //! Warning : Does not apply immediately : will be applied by the method - //! Apply - Standard_EXPORT Standard_Boolean ModifyList (const Standard_Integer num, const Handle(IFSelect_ListEditor)& edited, const Standard_Boolean enforce = Standard_False); - - //! As ModifyList but the new value is given as such - //! Creates a ListEditor, Loads it, then calls ModifyList - Standard_EXPORT Standard_Boolean ModifyListValue (const Standard_Integer num, const Handle(TColStd_HSequenceOfHAsciiString)& list, const Standard_Boolean enforce = Standard_False); - - //! Gives a new value computed by the Editor, if another parameter - //! commands the value of - //! It is generally the case for a Computed Parameter for instance - //! Increments the counter of touched parameters - //! Warning : it gives no protection for ReadOnly etc... while it is the - //! internal way of touching parameters - //! Does not work (returns False) if is for a list - Standard_EXPORT Standard_Boolean Touch (const Standard_Integer num, const Handle(TCollection_HAsciiString)& newval); - - //! Acts as Touch but for a list - //! Does not work (returns False) if is for a single param - Standard_EXPORT Standard_Boolean TouchList (const Standard_Integer num, const Handle(TColStd_HSequenceOfHAsciiString)& newlist); - - //! Returns the count of parameters touched by the last Modify - //! (apart from the modified parameter itself) - //! Normally it is zero - Standard_EXPORT Standard_Integer NbTouched() const; - - //! Clears modification status : by default all, or one by its - //! numbers (in the Editor) - Standard_EXPORT void ClearEdit (const Standard_Integer num = 0); - - //! Prints Definitions, relative to the Editor - Standard_EXPORT void PrintDefs (Standard_OStream& S) const; - - //! Prints Values, according to what and alsolist - //! True : prints Long Names; False : prints Short Names - //! < 0 : prints Original Values (+ flag Modified) - //! > 0 : prints Final Values (+flag Modified) - //! = 0 : prints Modified Values (Original + Edited) - //! False (D) : lists are printed only as their count - //! True : lists are printed for all their items - Standard_EXPORT void PrintValues (Standard_OStream& S, const Standard_Integer what, const Standard_Boolean names, const Standard_Boolean alsolist = Standard_False) const; - - //! Applies modifications to own data - //! Calls ApplyData then Clears Status according EditKeepStatus - Standard_EXPORT Standard_Boolean Apply(); - - //! Tells if this EditForm can work with its Editor and its actual - //! Data (Entity and Model) - //! Default uses Editor. Can be redefined - Standard_EXPORT virtual Standard_Boolean Recognize() const; - - //! Applies modifications to data - //! Default uses Editor. Can be redefined - Standard_EXPORT virtual Standard_Boolean ApplyData (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model); - - //! For an undoable EditForm, Applies ... origibal values ! - //! and clears modified ones - //! Can be run only once - Standard_EXPORT Standard_Boolean Undo(); - - DEFINE_STANDARD_RTTIEXT(IFSelect_EditForm,Standard_Transient) - -private: - - Standard_Boolean thecomplete; - Standard_Boolean theloaded; - Standard_Boolean thekeepst; - TCollection_AsciiString thelabel; - TColStd_Array1OfInteger thenums; - TColStd_Array1OfTransient theorigs; - TColStd_Array1OfTransient themodifs; - TColStd_Array1OfInteger thestatus; - Handle(IFSelect_Editor) theeditor; - Handle(Standard_Transient) theent; - Handle(Interface_InterfaceModel) themodel; - Standard_Integer thetouched; - -}; - -#endif // _IFSelect_EditForm_HeaderFile diff --git a/src/IFSelect/IFSelect_EditValue.hxx b/src/IFSelect/IFSelect_EditValue.hxx deleted file mode 100644 index 5d59fe424e..0000000000 --- a/src/IFSelect/IFSelect_EditValue.hxx +++ /dev/null @@ -1,37 +0,0 @@ -// Created on: 1992-09-21 -// 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 _IFSelect_EditValue_HeaderFile -#define _IFSelect_EditValue_HeaderFile - -//! Controls access on Values by an Editor -//! EditOptional : normal access, in addition may be removed -//! Editable : normal access, must be present -//! EditProtected : access must be validated -//! EditComputed : why write it ? it will be recomputed -//! EditRead : no way to write it, only for read -//! EditDynamic : not a field, only to be displayed -enum IFSelect_EditValue -{ -IFSelect_Optional, -IFSelect_Editable, -IFSelect_EditProtected, -IFSelect_EditComputed, -IFSelect_EditRead, -IFSelect_EditDynamic -}; - -#endif // _IFSelect_EditValue_HeaderFile diff --git a/src/IFSelect/IFSelect_Editor.cxx b/src/IFSelect/IFSelect_Editor.cxx deleted file mode 100644 index 49c9464c19..0000000000 --- a/src/IFSelect/IFSelect_Editor.cxx +++ /dev/null @@ -1,230 +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(IFSelect_Editor,Standard_Transient) - -IFSelect_Editor::IFSelect_Editor (const Standard_Integer nbval) - : thenbval (nbval) , themaxsh (0) , themaxco (0) , themaxla (0) , - thevalues (1,nbval) , theshorts (1,nbval) , themodes (1,nbval) , - thelists (1,nbval) - { thelists.Init(-1); } - - void IFSelect_Editor::SetNbValues (const Standard_Integer nbval) -{ - if (nbval > thevalues.Upper()) throw Standard_OutOfRange("IFSelect_Editor:SetNbValues"); - thenbval = nbval; -} - - void IFSelect_Editor::SetValue - (const Standard_Integer num, const Handle(Interface_TypedValue)& typval, - const Standard_CString shortname, const IFSelect_EditValue editmode) -{ - if (num < 1 || num > thenbval) return; - TCollection_AsciiString shn (shortname); - Standard_Integer lng = shn.Length(); - if (lng > 0) thenames.Bind (shortname,num); - if (lng > themaxsh) themaxsh = lng; - lng = (Standard_Integer) strlen (typval->Name()); - if (lng > themaxco) themaxco = lng; - lng = (Standard_Integer) strlen (typval->Label()); - if (lng > themaxla) themaxla = lng; - - thenames.Bind (typval->Name(),num); - Standard_Integer edm = (Standard_Integer) editmode; - thevalues.SetValue (num,typval); - theshorts.SetValue (num,shn); - themodes.SetValue (num,edm); -} - - void IFSelect_Editor::SetList - (const Standard_Integer num, const Standard_Integer max) -{ - if (num < 1 || num > thenbval) return; - thelists.SetValue (num,max); -} - - Standard_Integer IFSelect_Editor::NbValues () const - { return thenbval; } - - Handle(Interface_TypedValue) IFSelect_Editor::TypedValue - (const Standard_Integer num) const - { return Handle(Interface_TypedValue)::DownCast(thevalues.Value(num)); } - -Standard_Boolean IFSelect_Editor::IsList (const Standard_Integer num) const -{ - if (num < 1 || num > thenbval) return Standard_False; - return (thelists.Value(num) >= 0); -} - -Standard_Integer IFSelect_Editor::MaxList (const Standard_Integer num) const -{ - if (num < 1 || num > thenbval) return -1; - return thelists.Value(num); -} - - Standard_CString IFSelect_Editor::Name - (const Standard_Integer num, const Standard_Boolean isshort) const -{ - if (num < 1 || num > thenbval) return ""; - if (isshort) return theshorts.Value (num).ToCString(); - else return TypedValue (num)->Name(); -} - - IFSelect_EditValue IFSelect_Editor::EditMode - (const Standard_Integer num) const -{ - if (num < 1 || num > thenbval) return IFSelect_EditDynamic; - Standard_Integer edm = themodes.Value(num); - return (IFSelect_EditValue) edm; -} - - void IFSelect_Editor::PrintNames (Standard_OStream& S) const -{ - Standard_Integer i, nb = NbValues(); - S<<"**** Editor : "< 0) S<<"Short"< 0) { - const TCollection_AsciiString& sho = theshorts(i); - S<Name()<Name(),themaxco)<<" "<Label()< 0) S<<"Short"<Label()<Label(),themaxla); - else { - if (themaxsh > 0) { - const TCollection_AsciiString& sho = theshorts(i); - S<Name()<Name(),themaxco); - } - - S<<" "; - Standard_Integer maxls = MaxList (i); - if (maxls == 0) S<<" (List) "; - else if (maxls > 0) S<<" (List <= "<Definition()< NbValues()) res = 0; - return res; -} - - - Handle(IFSelect_EditForm) IFSelect_Editor::Form - (const Standard_Boolean readonly, const Standard_Boolean undoable) const -{ - return new IFSelect_EditForm (this,readonly,undoable,Label().ToCString()); -} - - Handle(IFSelect_ListEditor) IFSelect_Editor::ListEditor - (const Standard_Integer num) const -{ - Handle(IFSelect_ListEditor) led; - Standard_Integer max = MaxList (num); - if (max < 0) return led; - led = new IFSelect_ListEditor (TypedValue(num),max); - return led; -} - - Handle(TColStd_HSequenceOfHAsciiString) IFSelect_Editor::ListValue - (const Handle(IFSelect_EditForm)& /*form*/, const Standard_Integer /*num*/) const -{ - Handle(TColStd_HSequenceOfHAsciiString) list; - return list; -} - - - Standard_Boolean IFSelect_Editor::Update - (const Handle(IFSelect_EditForm)& /*form*/, const Standard_Integer /*num*/, - const Handle(TCollection_HAsciiString)& /*newval*/, - const Standard_Boolean /*enforce*/) const - { return Standard_True; } - - Standard_Boolean IFSelect_Editor::UpdateList - (const Handle(IFSelect_EditForm)& /*form*/, const Standard_Integer /*num*/, - const Handle(TColStd_HSequenceOfHAsciiString)& /*newval*/, - const Standard_Boolean /*enforce*/) const - { return Standard_True; } diff --git a/src/IFSelect/IFSelect_Editor.hxx b/src/IFSelect/IFSelect_Editor.hxx deleted file mode 100644 index 6cd9960bc1..0000000000 --- a/src/IFSelect/IFSelect_Editor.hxx +++ /dev/null @@ -1,195 +0,0 @@ -// Created on: 1998-02-23 -// Created by: Christian CAILLET -// Copyright (c) 1998-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 _IFSelect_Editor_HeaderFile -#define _IFSelect_Editor_HeaderFile - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -class Interface_TypedValue; -class IFSelect_EditForm; -class TCollection_HAsciiString; -class IFSelect_ListEditor; -class Interface_InterfaceModel; - - -class IFSelect_Editor; -DEFINE_STANDARD_HANDLE(IFSelect_Editor, Standard_Transient) - -//! An Editor defines a set of values and a way to edit them, on -//! an entity or on the model (e.g. on its header) -//! -//! Each Value is controlled by a TypedValue, with a number (it is -//! an Integer) and a name under two forms (complete and short) -//! and an edit mode -class IFSelect_Editor : public Standard_Transient -{ - -public: - - - //! Sets a Typed Value for a given ident and short name, with an - //! Edit Mode - Standard_EXPORT void SetValue (const Standard_Integer num, const Handle(Interface_TypedValue)& typval, const Standard_CString shortname = "", const IFSelect_EditValue accessmode = IFSelect_Editable); - - //! Sets a parameter to be a List - //! max < 0 : not for a list (set when starting) - //! max = 0 : list with no length limit (default for SetList) - //! max > 0 : list limited to items - Standard_EXPORT void SetList (const Standard_Integer num, const Standard_Integer max = 0); - - //! Returns the count of Typed Values - Standard_EXPORT Standard_Integer NbValues() const; - - //! Returns a Typed Value from its ident - Standard_EXPORT Handle(Interface_TypedValue) TypedValue (const Standard_Integer num) const; - - //! Tells if a parameter is a list - Standard_EXPORT Standard_Boolean IsList (const Standard_Integer num) const; - - //! Returns max length allowed for a list - //! = 0 means : list with no limit - //! < 0 means : not a list - Standard_EXPORT Standard_Integer MaxList (const Standard_Integer num) const; - - //! Returns the name of a Value (complete or short) from its ident - //! Short Name can be empty - Standard_EXPORT Standard_CString Name (const Standard_Integer num, const Standard_Boolean isshort = Standard_False) const; - - //! Returns the edit mode of a Value - Standard_EXPORT IFSelect_EditValue EditMode (const Standard_Integer num) const; - - //! Returns the number (ident) of a Value, from its name, short or - //! complete. If not found, returns 0 - Standard_EXPORT Standard_Integer NameNumber (const Standard_CString name) const; - - Standard_EXPORT void PrintNames (Standard_OStream& S) const; - - Standard_EXPORT void PrintDefs (Standard_OStream& S, const Standard_Boolean labels = Standard_False) const; - - //! Returns the MaxLength of, according to what : - //! = -1 : length of short names - //! = 0 : length of complete names - //! = 1 : length of values labels - Standard_EXPORT Standard_Integer MaxNameLength (const Standard_Integer what) const; - - //! Returns the specific label - Standard_EXPORT virtual TCollection_AsciiString Label() const = 0; - - //! Builds and Returns an EditForm, empty (no data yet) - //! Can be redefined to return a specific type of EditForm - Standard_EXPORT virtual Handle(IFSelect_EditForm) Form (const Standard_Boolean readonly, const Standard_Boolean undoable = Standard_True) const; - - //! Tells if this Editor can work on this EditForm and its content - //! (model, entity ?) - Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(IFSelect_EditForm)& form) const = 0; - - //! Returns the value of an EditForm, for a given item - //! (if not a list. for a list, a Null String may be returned) - Standard_EXPORT virtual Handle(TCollection_HAsciiString) StringValue (const Handle(IFSelect_EditForm)& form, const Standard_Integer num) const = 0; - - //! Returns a ListEditor for a parameter which is a List - //! Default returns a basic ListEditor for a List, a Null Handle - //! if is not for a List. Can be redefined - Standard_EXPORT virtual Handle(IFSelect_ListEditor) ListEditor (const Standard_Integer num) const; - - //! Returns the value of an EditForm as a List, for a given item - //! If not a list, a Null Handle should be returned - //! Default returns a Null Handle, because many Editors have - //! no list to edit. To be redefined as required - Standard_EXPORT virtual Handle(TColStd_HSequenceOfHAsciiString) ListValue (const Handle(IFSelect_EditForm)& form, const Standard_Integer num) const; - - //! Loads original values from some data, to an EditForm - //! Remark: may be Null, this means all is concerned - //! Also may be Null, if no context applies for - //! And both and may be Null, for a full static - //! editor - Standard_EXPORT virtual Standard_Boolean Load (const Handle(IFSelect_EditForm)& form, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const = 0; - - //! Updates the EditForm when a parameter is modified - //! I.E. default does nothing, can be redefined, as follows : - //! Returns True when done (even if does nothing), False in case - //! of refuse (for instance, if the new value is not suitable) - //! is the rank of the parameter for the EDITOR itself - //! True means that protected parameters can be touched - //! - //! If a parameter commands the value of other ones, when it is - //! modified, it is necessary to touch them by Touch from EditForm - Standard_EXPORT virtual Standard_Boolean Update (const Handle(IFSelect_EditForm)& form, const Standard_Integer num, const Handle(TCollection_HAsciiString)& newval, const Standard_Boolean enforce) const; - - //! Acts as Update, but when the value is a list - Standard_EXPORT virtual Standard_Boolean UpdateList (const Handle(IFSelect_EditForm)& form, const Standard_Integer num, const Handle(TColStd_HSequenceOfHAsciiString)& newlist, const Standard_Boolean enforce) const; - - //! Applies modified values of the EditForm with some data - //! Remark: may be Null, this means all is concerned - //! Also may be Null, if no context applies for - //! And both and may be Null, for a full static - //! editor - Standard_EXPORT virtual Standard_Boolean Apply (const Handle(IFSelect_EditForm)& form, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const = 0; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_Editor,Standard_Transient) - -protected: - - - //! Prepares the list of Typed Values (gives its count) - //! This count can be tuned later, to a LOWER value, this allows - //! to initialize with a "maximum reservation" then cut the extra - Standard_EXPORT IFSelect_Editor(const Standard_Integer nbval); - - //! Adjusts the true count of values. It can be LOWER or equal to - //! the initial size (which then acts as a reservation), but never - //! greater - Standard_EXPORT void SetNbValues (const Standard_Integer nbval); - - - -private: - - - Standard_Integer thenbval; - Standard_Integer themaxsh; - Standard_Integer themaxco; - Standard_Integer themaxla; - NCollection_DataMap thenames; - TColStd_Array1OfTransient thevalues; - TColStd_Array1OfAsciiString theshorts; - TColStd_Array1OfInteger themodes; - TColStd_Array1OfInteger thelists; - - -}; - - - - - - - -#endif // _IFSelect_Editor_HeaderFile diff --git a/src/IFSelect/IFSelect_FileModifier.gxx b/src/IFSelect/IFSelect_FileModifier.gxx deleted file mode 100644 index e87396ff39..0000000000 --- a/src/IFSelect/IFSelect_FileModifier.gxx +++ /dev/null @@ -1,19 +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 - - - -IFSelect_FileModifier::IFSelect_FileModifier () - : IFSelect_GeneralModifier (Standard_False) { } diff --git a/src/IFSelect/IFSelect_GeneralModifier.cxx b/src/IFSelect/IFSelect_GeneralModifier.cxx deleted file mode 100644 index 5e2e5de29f..0000000000 --- a/src/IFSelect/IFSelect_GeneralModifier.cxx +++ /dev/null @@ -1,56 +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(IFSelect_GeneralModifier,Standard_Transient) - -IFSelect_GeneralModifier::IFSelect_GeneralModifier - (const Standard_Boolean maychangegraph) { thechgr = maychangegraph; } - - Standard_Boolean IFSelect_GeneralModifier::MayChangeGraph () const - { return thechgr; } - - void IFSelect_GeneralModifier::SetDispatch - (const Handle(IFSelect_Dispatch)& disp) - { thedisp = disp; } - - Handle(IFSelect_Dispatch) IFSelect_GeneralModifier::Dispatch () const - { return thedisp; } - - Standard_Boolean IFSelect_GeneralModifier::Applies - (const Handle(IFSelect_Dispatch)& disp) const -{ - if (thedisp.IsNull()) return Standard_True; - if (thedisp != disp) return Standard_False; - return Standard_True; -} - - - void IFSelect_GeneralModifier::SetSelection - (const Handle(IFSelect_Selection)& sel) - { thesel = sel; } - - void IFSelect_GeneralModifier::ResetSelection () - { thesel.Nullify(); } - - Standard_Boolean IFSelect_GeneralModifier::HasSelection () const - { return !thesel.IsNull(); } - - Handle(IFSelect_Selection) IFSelect_GeneralModifier::Selection () const - { return thesel; } diff --git a/src/IFSelect/IFSelect_GeneralModifier.hxx b/src/IFSelect/IFSelect_GeneralModifier.hxx deleted file mode 100644 index 0a53c8ba73..0000000000 --- a/src/IFSelect/IFSelect_GeneralModifier.hxx +++ /dev/null @@ -1,121 +0,0 @@ -// Created on: 1993-10-19 -// 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 _IFSelect_GeneralModifier_HeaderFile -#define _IFSelect_GeneralModifier_HeaderFile - -#include -#include - -#include -class IFSelect_Selection; -class IFSelect_Dispatch; -class TCollection_AsciiString; - -class IFSelect_GeneralModifier; -DEFINE_STANDARD_HANDLE(IFSelect_GeneralModifier, Standard_Transient) - -//! This class gives a frame for Actions which modify the effect -//! of a Dispatch, i.e. : -//! By Selections and Dispatches, an original Model can be -//! split into one or more "target" Models : these Models -//! contain Entities copied from the original one (that is, a -//! part of it). Basically, these dispatched Entities are copied -//! as identical to their original counterparts. Also the copied -//! Models reproduce the Header of the original one. -//! -//! Modifiers allow to change this copied content : this is the -//! way to be used for any kind of alterations, adaptations ... -//! They are exploited by a ModelCopier, which firstly performs -//! the copy operation described by Dispatches, then invokes the -//! Modifiers to work on the result. -//! -//! Each GeneralModifier can be attached to : -//! - all the Models produced -//! - a Dispatch (it will be applied to all the Models obtained -//! from this Dispatch) designated by its Ident in a ShareOut -//! - in addition, to a Selection (facultative) : this adds a -//! criterium, the Modifier is invoked on a produced Model only -//! if this Model contains an Entity copied from one of the -//! Entities designated by this Selection. -//! (for special Modifiers from IFAdapt, while they must work on -//! definite Entities, this Selection is mandatory to run) -//! -//! Remark : this class has no action attached, it only provides -//! a frame to work on criteria. Then, sub-classes will define -//! their kind of action, which can be applied at a precise step -//! of the production of a File : see Modifier, and in the -//! package IFAdapt, EntityModifier and EntityCopier -class IFSelect_GeneralModifier : public Standard_Transient -{ - -public: - - //! Returns True if this modifier may change the graph of - //! dependences (aknowledged at creation time) - Standard_EXPORT Standard_Boolean MayChangeGraph() const; - - //! Attaches to a Dispatch. If is Null, Resets it - //! (to apply the Modifier on every Dispatch) - Standard_EXPORT void SetDispatch (const Handle(IFSelect_Dispatch)& disp); - - //! Returns the Dispatch to be matched, Null if not set - Standard_EXPORT Handle(IFSelect_Dispatch) Dispatch() const; - - //! Returns True if a Model obtained from the Dispatch - //! is to be treated (apart from the Selection criterium) - //! If Dispatch(me) is Null, returns True. Else, checks - Standard_EXPORT Standard_Boolean Applies (const Handle(IFSelect_Dispatch)& disp) const; - - //! Sets a Selection : a Model is treated if it contains one or - //! more Entities designated by the Selection - Standard_EXPORT void SetSelection (const Handle(IFSelect_Selection)& sel); - - //! Resets the Selection : this criterium is not longer active - Standard_EXPORT void ResetSelection(); - - //! Returns True if a Selection is set as an additional criterium - Standard_EXPORT Standard_Boolean HasSelection() const; - - //! Returns the Selection, or a Null Handle if not set - Standard_EXPORT Handle(IFSelect_Selection) Selection() const; - - //! Returns a short text which defines the operation performed - Standard_EXPORT virtual TCollection_AsciiString Label() const = 0; - - DEFINE_STANDARD_RTTIEXT(IFSelect_GeneralModifier,Standard_Transient) - -protected: - - //! Sets the Modifier criteria to default Values - //! (i.e. "always applies") - //! must be provided at creation time, to : - //! - False if this GeneralModifier surely lets the graph of - //! dependencies unchanged (NO edition of any reference, BUT - //! also NO entity added or replaced or removed) - //! - True if there is a possibility of changing the graph of - //! dependencies when this modifier is applied - Standard_EXPORT IFSelect_GeneralModifier(const Standard_Boolean maychangegraph); - -private: - - Handle(IFSelect_Selection) thesel; - Handle(IFSelect_Dispatch) thedisp; - Standard_Boolean thechgr; - -}; - -#endif // _IFSelect_GeneralModifier_HeaderFile diff --git a/src/IFSelect/IFSelect_GraphCounter.cxx b/src/IFSelect/IFSelect_GraphCounter.cxx deleted file mode 100644 index 36a7300621..0000000000 --- a/src/IFSelect/IFSelect_GraphCounter.cxx +++ /dev/null @@ -1,66 +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 -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_GraphCounter,IFSelect_SignCounter) - -IFSelect_GraphCounter::IFSelect_GraphCounter - (const Standard_Boolean withmap, const Standard_Boolean withlist) - : IFSelect_SignCounter (withmap,withlist) { } - - Handle(IFSelect_SelectDeduct) IFSelect_GraphCounter::Applied () const - { return theapplied; } - - void IFSelect_GraphCounter::SetApplied - (const Handle(IFSelect_SelectDeduct)& applied) - { theapplied = applied; } - - void IFSelect_GraphCounter::AddWithGraph - (const Handle(TColStd_HSequenceOfTransient)& list, - const Interface_Graph& graph) -{ - if (theapplied.IsNull()) { AddList (list,graph.Model()); return; } - if (list.IsNull()) return; - Standard_Integer i, nb = list->Length(); - for (i = 1; i <= nb; i ++) { - char val[12]; - Handle(Standard_Transient) ent = list->Value(i); - theapplied->Alternate()->SetEntity (ent); - Interface_EntityIterator iter = theapplied->UniqueResult(graph); - Standard_Integer n = iter.NbEntities(); - switch (n) { - case 0: Add (ent,"0"); break; - case 1: Add (ent,"1"); break; - case 2: Add (ent,"2"); break; - case 3: Add (ent,"3"); break; - case 4: Add (ent,"4"); break; - case 5: Add (ent,"5"); break; - case 6: Add (ent,"6"); break; - case 7: Add (ent,"7"); break; - case 8: Add (ent,"8"); break; - case 9: Add (ent,"9"); break; - default : - sprintf (val,"%d",n); - Add (ent,val); - break; - } - } -} diff --git a/src/IFSelect/IFSelect_GraphCounter.hxx b/src/IFSelect/IFSelect_GraphCounter.hxx deleted file mode 100644 index ca522b523b..0000000000 --- a/src/IFSelect/IFSelect_GraphCounter.hxx +++ /dev/null @@ -1,82 +0,0 @@ -// Created on: 1998-10-15 -// Created by: Christian CAILLET -// Copyright (c) 1998-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 _IFSelect_GraphCounter_HeaderFile -#define _IFSelect_GraphCounter_HeaderFile - -#include - -#include -#include -class IFSelect_SelectDeduct; -class Interface_Graph; - - -class IFSelect_GraphCounter; -DEFINE_STANDARD_HANDLE(IFSelect_GraphCounter, IFSelect_SignCounter) - -//! A GraphCounter computes values to be sorted with the help of -//! a Graph. I.E. not from a Signature -//! -//! The default GraphCounter works with an Applied Selection (a -//! SelectDeduct), the value is the count of selected entities -//! from each input entities) -class IFSelect_GraphCounter : public IFSelect_SignCounter -{ - -public: - - - //! Creates a GraphCounter, without applied selection - Standard_EXPORT IFSelect_GraphCounter(const Standard_Boolean withmap = Standard_True, const Standard_Boolean withlist = Standard_False); - - //! Returns the applied selection - Standard_EXPORT Handle(IFSelect_SelectDeduct) Applied() const; - - //! Sets a new applied selection - Standard_EXPORT void SetApplied (const Handle(IFSelect_SelectDeduct)& sel); - - //! Adds a list of entities in the context given by the graph - //! Default takes the count of entities selected by the applied - //! selection, when it is given each entity of the list - //! Can be redefined - Standard_EXPORT virtual void AddWithGraph (const Handle(TColStd_HSequenceOfTransient)& list, const Interface_Graph& graph) Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_GraphCounter,IFSelect_SignCounter) - -protected: - - - - -private: - - - Handle(IFSelect_SelectDeduct) theapplied; - - -}; - - - - - - - -#endif // _IFSelect_GraphCounter_HeaderFile diff --git a/src/IFSelect/IFSelect_HSeqOfSelection.hxx b/src/IFSelect/IFSelect_HSeqOfSelection.hxx deleted file mode 100644 index e2cdd5c46f..0000000000 --- a/src/IFSelect/IFSelect_HSeqOfSelection.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// Created on: 1992-09-21 -// 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 IFSelect_HSeqOfSelection_HeaderFile -#define IFSelect_HSeqOfSelection_HeaderFile - -#include -#include - -DEFINE_HSEQUENCE(IFSelect_HSeqOfSelection, IFSelect_TSeqOfSelection) - - -#endif diff --git a/src/IFSelect/IFSelect_IntParam.cxx b/src/IFSelect/IFSelect_IntParam.cxx deleted file mode 100644 index 67d13bb7c8..0000000000 --- a/src/IFSelect/IFSelect_IntParam.cxx +++ /dev/null @@ -1,40 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_IntParam,Standard_Transient) - -IFSelect_IntParam::IFSelect_IntParam () - { theval = 0; } - - void IFSelect_IntParam::SetStaticName (const Standard_CString statname) - { thestn.Clear(); thestn.AssignCat (statname); } - - Standard_Integer IFSelect_IntParam::Value () const -{ - if (thestn.Length() == 0) return theval; - if (!Interface_Static::IsSet(thestn.ToCString()) ) return theval; - return Interface_Static::IVal(thestn.ToCString()); -} - - void IFSelect_IntParam::SetValue (const Standard_Integer val) -{ - theval = val; - if (thestn.Length() == 0) return; - if (!Interface_Static::IsPresent(thestn.ToCString()) ) return; - Interface_Static::SetIVal (thestn.ToCString(),theval); -} diff --git a/src/IFSelect/IFSelect_IntParam.hxx b/src/IFSelect/IFSelect_IntParam.hxx deleted file mode 100644 index 4d48a064d9..0000000000 --- a/src/IFSelect/IFSelect_IntParam.hxx +++ /dev/null @@ -1,84 +0,0 @@ -// Created on: 1992-11-30 -// 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 _IFSelect_IntParam_HeaderFile -#define _IFSelect_IntParam_HeaderFile - -#include - -#include -#include -#include - -class IFSelect_IntParam; -DEFINE_STANDARD_HANDLE(IFSelect_IntParam, Standard_Transient) - -//! This class simply allows to access an Integer value through a -//! Handle, as a String can be (by using HString). -//! Hence, this value can be accessed : read and modified, without -//! passing through the specific object which detains it. Thus, -//! parameters of a Selection or a Dispatch (according its type) -//! can be controlled directly from the ShareOut which contains them -//! -//! Additionally, an IntParam can be bound to a Static. -//! Remember that for a String, binding is immediate, because the -//! string value of a Static is a HAsciiString, it then suffices -//! to get its Handle. -//! For an Integer, an IntParam can designate (by its name) a -//! Static : each time its value is required or set, the Static -//! is aknowledged -class IFSelect_IntParam : public Standard_Transient -{ - -public: - - //! Creates an IntParam. Initial value is set to zer - Standard_EXPORT IFSelect_IntParam(); - - //! Commands this IntParam to be bound to a Static - //! Hence, Value will return the value if this Static if it is set - //! Else, Value works on the locally stored value - //! SetValue also will set the value of the Static - //! This works only for a present static of type integer or enum - //! Else, it is ignored - //! - //! If is empty, disconnects the IntParam from Static - Standard_EXPORT void SetStaticName (const Standard_CString statname); - - //! Returns the name of static parameter to which this IntParam - //! is bound, empty if none - Standard_EXPORT Standard_CString StaticName() const; - - //! Reads Integer Value of the IntParam. If a StaticName is - //! defined and the Static is set, looks in priority the value - //! of the static - Standard_EXPORT Standard_Integer Value() const; - - //! Sets a new Integer Value for the IntParam. If a StaticName is - //! defined and the Static is set, also sets the value of the static - Standard_EXPORT void SetValue (const Standard_Integer val); - - - DEFINE_STANDARD_RTTIEXT(IFSelect_IntParam,Standard_Transient) - -private: - - Standard_Integer theval; - TCollection_AsciiString thestn; - -}; - -#endif // _IFSelect_IntParam_HeaderFile diff --git a/src/IFSelect/IFSelect_ListEditor.cxx b/src/IFSelect/IFSelect_ListEditor.cxx deleted file mode 100644 index d0ee3cb389..0000000000 --- a/src/IFSelect/IFSelect_ListEditor.cxx +++ /dev/null @@ -1,210 +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(IFSelect_ListEditor,Standard_Transient) - -IFSelect_ListEditor::IFSelect_ListEditor () -: themax (0) , thetouc (0) { } - - IFSelect_ListEditor::IFSelect_ListEditor - (const Handle(Interface_TypedValue)& def, const Standard_Integer max) -: themax (max) , thedef (def) , thetouc (0) { } - - -void IFSelect_ListEditor::LoadModel (const Handle(Interface_InterfaceModel)& model) -{ themodl = model; } - -void IFSelect_ListEditor::LoadValues (const Handle(TColStd_HSequenceOfHAsciiString)& vals) -{ - theorig = vals; - ClearEdit(); -} - - -void IFSelect_ListEditor::SetTouched () -{ thetouc = 1; } - -void IFSelect_ListEditor::ClearEdit () -{ - theedit = new TColStd_HSequenceOfHAsciiString(); - thestat = new TColStd_HSequenceOfInteger(); - if (theorig.IsNull()) return; - Standard_Integer i,nb = theorig->Length(); - for (i = 1; i <= nb; i ++) { - theedit->Append (theorig->Value(i)); - thestat->Append (0); - } - thetouc = 0; -} - -// ######## CHECK ######## - -static Standard_Boolean CheckValue - (const Handle(TCollection_HAsciiString)& val, - const Handle(Interface_InterfaceModel)& modl, - const Handle(Interface_TypedValue)& thedef) -{ - if (val.IsNull() || modl.IsNull() || thedef.IsNull()) return Standard_True; - - Interface_ParamType pty = thedef->Type(); - if (!thedef->Satisfies(val)) return Standard_False; - if (pty == Interface_ParamIdent && !val.IsNull()) { - if (modl->NextNumberForLabel(val->ToCString(),0) <= 0) - return Standard_False; - } - return Standard_True; -} - -// ######## EDITION ######## - -Standard_Boolean IFSelect_ListEditor::LoadEdited - (const Handle(TColStd_HSequenceOfHAsciiString)& list) -{ - if (list.IsNull()) return Standard_False; - Standard_Integer i, nb = list->Length(); - if (nb > themax) return Standard_False; - -// check values - if (!thedef.IsNull()) { - for (i = 1; i <= nb; i ++) { - Handle(TCollection_HAsciiString) newval = list->Value(i); - if (!CheckValue (newval,themodl,thedef)) return Standard_False; - } - } - -// OK - theedit = list; - thestat = new TColStd_HSequenceOfInteger(); - for (i = 1; i <= nb; i ++) thestat->Append (1); - thetouc = 1; - - return Standard_True; -} - - -Standard_Boolean IFSelect_ListEditor::SetValue - (const Standard_Integer num, const Handle(TCollection_HAsciiString)& val) -{ - if (theedit.IsNull()) return Standard_False; - if (num < 1 || num > theedit->Length()) return Standard_False; - -// check value - if (!CheckValue(val,themodl,thedef)) return Standard_False; - -// OK - theedit->SetValue (num,val); - thestat->SetValue (num,1); - thetouc = 1; - return Standard_True; -} - - -Standard_Boolean IFSelect_ListEditor::AddValue - (const Handle(TCollection_HAsciiString)& val, const Standard_Integer atnum) -{ - if (theedit.IsNull()) return Standard_False; - if (themax > 0 && theedit->Length() >= themax) return Standard_False; - if (!CheckValue (val,themodl,thedef)) return Standard_False; - if (atnum > 0) { - theedit->InsertBefore (atnum,val); - thestat->InsertBefore (atnum,2); - } else { - theedit->Append (val); - thestat->Append (2); - } - thetouc = 2; - return Standard_True; -} - - -Standard_Boolean IFSelect_ListEditor::Remove - (const Standard_Integer num, const Standard_Integer howmany) -{ - if (theedit.IsNull()) return Standard_False; - Standard_Integer nb = theedit->Length(); - if (num < 0) return Standard_False; - if (num == 0) return Remove (nb-howmany,howmany); - - if ((num+howmany) > nb) return Standard_False; - theedit->Remove(num,howmany); - thestat->Remove(num,howmany); - thetouc = 3; - return Standard_True; -} - - -// ######## QUERIES ######## - -Handle(TColStd_HSequenceOfHAsciiString) IFSelect_ListEditor::OriginalValues () const -{ return theorig; } - -Handle(TColStd_HSequenceOfHAsciiString) IFSelect_ListEditor::EditedValues () const -{ return theedit; } - - -Standard_Integer IFSelect_ListEditor::NbValues (const Standard_Boolean edited) const -{ - if (edited) return (theedit.IsNull() ? 0 : theedit->Length()); - return (theorig.IsNull() ? 0 : theorig->Length()); -} - - -Handle(TCollection_HAsciiString) IFSelect_ListEditor::Value - (const Standard_Integer num, const Standard_Boolean edited) const -{ - Handle(TCollection_HAsciiString) val; - if (edited) { - if (theedit.IsNull()) return val; - if (num < 1 || num > theedit->Length()) return val; - val = theedit->Value(num); - } else { - if (theorig.IsNull()) return val; - if (num < 1 || num > theorig->Length()) return val; - val = theorig->Value(num); - } - return val; -} - -Standard_Boolean IFSelect_ListEditor::IsChanged (const Standard_Integer num) const -{ - if (thestat.IsNull()) return Standard_False; - if (num < 1 || num > thestat->Length()) return Standard_False; - Standard_Integer stat = thestat->Value(num); - return (stat != 0); -} - -Standard_Boolean IFSelect_ListEditor::IsModified (const Standard_Integer num) const -{ - if (thestat.IsNull()) return Standard_False; - if (num < 1 || num > thestat->Length()) return Standard_False; - Standard_Integer stat = thestat->Value(num); - return (stat == 1); -} - -Standard_Boolean IFSelect_ListEditor::IsAdded (const Standard_Integer num) const -{ - if (thestat.IsNull()) return Standard_False; - if (num < 1 || num > thestat->Length()) return Standard_False; - Standard_Integer stat = thestat->Value(num); - return (stat == 2); -} - -Standard_Boolean IFSelect_ListEditor::IsTouched () const - { return (thetouc != 0); } diff --git a/src/IFSelect/IFSelect_ListEditor.hxx b/src/IFSelect/IFSelect_ListEditor.hxx deleted file mode 100644 index 7c8608f200..0000000000 --- a/src/IFSelect/IFSelect_ListEditor.hxx +++ /dev/null @@ -1,152 +0,0 @@ -// Created on: 1998-07-28 -// Created by: Christian CAILLET -// Copyright (c) 1998-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 _IFSelect_ListEditor_HeaderFile -#define _IFSelect_ListEditor_HeaderFile - -#include - -#include -#include -#include -#include -class Interface_TypedValue; -class Interface_InterfaceModel; -class TCollection_HAsciiString; - -class IFSelect_ListEditor; -DEFINE_STANDARD_HANDLE(IFSelect_ListEditor, Standard_Transient) - -//! A ListEditor is an auxiliary operator for Editor/EditForm -//! I.E. it works on parameter values expressed as strings -//! -//! For a parameter which is a list, it may not be edited in once -//! by just setting a new value (as a string) -//! -//! Firstly, a list can be long (and tedious to be accessed flat) -//! then requires a better way of accessing -//! -//! Moreover, not only its VALUES may be changed (SetValue), but -//! also its LENGTH : items may be added or removed ... -//! -//! Hence, the way of editing a parameter as a list is : -//! - edit it separately, with the help of a ListEditor -//! - it remains possible to prepare a new list of values apart -//! - then give the new list in once to the EditForm -//! -//! An EditList is produced by the Editor, with a basic definition -//! This definition (brought by this class) can be redefined -//! Hence the Editor may produce a specific ListEditor as needed -class IFSelect_ListEditor : public Standard_Transient -{ - -public: - - //! Creates a ListEditor with absolutely no constraint - Standard_EXPORT IFSelect_ListEditor(); - - //! Creates a ListEditor, for which items of the list to edit are - //! defined by , and describes max length : - //! 0 (D) means no limit - //! value > 0 means : no more the items are allowed - Standard_EXPORT IFSelect_ListEditor(const Handle(Interface_TypedValue)& def, const Standard_Integer max = 0); - - //! Loads a Model. It is used to check items of type Entity(Ident) - Standard_EXPORT void LoadModel (const Handle(Interface_InterfaceModel)& model); - - //! Loads the original values for the list. - //! Remark : If its length is more then MaxLength, editions remain allowed, except Add - Standard_EXPORT void LoadValues (const Handle(TColStd_HSequenceOfHAsciiString)& vals); - - //! Declares this ListEditor to have been touched (whatever action) - Standard_EXPORT void SetTouched(); - - //! Clears all editions already recorded - Standard_EXPORT void ClearEdit(); - - //! Loads a new list to replace the older one, in once ! - //! By default (can be redefined) checks the length of the list - //! and the value of each item according to the def - //! Items are all recorded as Modified - //! - //! If no def has been given at creation time, no check is done - //! Returns True when done, False if checks have failed ... a - //! specialisation may also lock it by returning always False ... - Standard_EXPORT virtual Standard_Boolean LoadEdited (const Handle(TColStd_HSequenceOfHAsciiString)& list); - - //! Sets a new value for the item (in edited list) - //! may be a Null Handle, then the value will be cleared but - //! not removed - //! Returns True when done. False if is out of range or if - //! does not satisfy the definition - Standard_EXPORT virtual Standard_Boolean SetValue (const Standard_Integer num, const Handle(TCollection_HAsciiString)& val); - - //! Adds a new item. By default appends (at the end of the list) - //! Can insert before a given rank , if positive - //! Returns True when done. False if MaxLength may be overpassed - //! or if does not satisfy the definition - Standard_EXPORT virtual Standard_Boolean AddValue (const Handle(TCollection_HAsciiString)& val, const Standard_Integer atnum = 0); - - //! Removes items from the list - //! By default removes one item. Else, count given by - //! Remove from rank included. By default, from the end - //! Returns True when done, False (and does not work) if case of - //! out of range of if is greater than current length - Standard_EXPORT virtual Standard_Boolean Remove (const Standard_Integer num = 0, const Standard_Integer howmany = 1); - - //! Returns the value from which the edition started - Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) OriginalValues() const; - - //! Returns the result of the edition - Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) EditedValues() const; - - //! Returns count of values, edited (D) or original - Standard_EXPORT Standard_Integer NbValues (const Standard_Boolean edited = Standard_True) const; - - //! Returns a value given its rank. Edited (D) or Original - //! A Null String means the value is cleared but not removed - Standard_EXPORT Handle(TCollection_HAsciiString) Value (const Standard_Integer num, const Standard_Boolean edited = Standard_True) const; - - //! Tells if a value (in edited list) has been changed, i.e. - //! either modified-value, or added - Standard_EXPORT Standard_Boolean IsChanged (const Standard_Integer num) const; - - //! Tells if a value (in edited list) has been modified-value - //! (not added) - Standard_EXPORT Standard_Boolean IsModified (const Standard_Integer num) const; - - //! Tells if a value (in edited list) has been added (new one) - Standard_EXPORT Standard_Boolean IsAdded (const Standard_Integer num) const; - - //! Tells if at least one edition (SetValue-AddValue-Remove) has - //! been recorded - Standard_EXPORT Standard_Boolean IsTouched() const; - - DEFINE_STANDARD_RTTIEXT(IFSelect_ListEditor,Standard_Transient) - -private: - - Standard_Integer themax; - Handle(Interface_TypedValue) thedef; - Standard_Integer thetouc; - Handle(TColStd_HSequenceOfHAsciiString) theorig; - Handle(TColStd_HSequenceOfHAsciiString) theedit; - Handle(TColStd_HSequenceOfInteger) thestat; - Handle(Interface_InterfaceModel) themodl; - -}; - -#endif // _IFSelect_ListEditor_HeaderFile diff --git a/src/IFSelect/IFSelect_ModelCopier.cxx b/src/IFSelect/IFSelect_ModelCopier.cxx deleted file mode 100644 index 79ddb58d50..0000000000 --- a/src/IFSelect/IFSelect_ModelCopier.cxx +++ /dev/null @@ -1,531 +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 -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_ModelCopier,Standard_Transient) - -//#define MISOPOINT -IFSelect_ModelCopier::IFSelect_ModelCopier () { } - - void IFSelect_ModelCopier::SetShareOut - (const Handle(IFSelect_ShareOut)& sho) - { theshareout = sho; } - - -// ######################################################################## -// ######## OPERATIONS DE TRANSFERT GLOBAL (memorise ou non) ######## - - - void IFSelect_ModelCopier::ClearResult () - { thefilemodels.Clear(); thefilenames.Clear(); theapplieds.Clear(); - theremain.Nullify(); } - - - Standard_Boolean IFSelect_ModelCopier::AddFile - (const TCollection_AsciiString& filename, - const Handle(Interface_InterfaceModel)& content) -{ - Standard_Integer nb = thefilenames.Length(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (filename.IsEmpty()) continue; - if (thefilenames(i).IsEqual(filename)) return Standard_False; - } - Handle(IFSelect_AppliedModifiers) nulapplied; - thefilenames.Append (filename); - thefilemodels.Append (content); - theapplieds.Append (nulapplied); - return Standard_True; -} - - Standard_Boolean IFSelect_ModelCopier::NameFile - (const Standard_Integer num, - const TCollection_AsciiString& filename) -{ - Standard_Integer nb = thefilenames.Length(); - if (num <= 0 || num > nb) return Standard_False; - for (Standard_Integer i = 1; i <= nb; i ++) { - if (filename.IsEmpty()) continue; - if (thefilenames(i).IsEqual(filename)) return Standard_False; - } - thefilenames.SetValue(num,filename); - return Standard_True; -} - - Standard_Boolean IFSelect_ModelCopier::ClearFile - (const Standard_Integer num) -{ - Standard_Integer nb = thefilenames.Length(); - if (num <= 0 || num > nb) return Standard_False; - thefilenames.ChangeValue(num).Clear(); - return Standard_True; -} - - Standard_Boolean IFSelect_ModelCopier::SetAppliedModifiers - (const Standard_Integer num, const Handle(IFSelect_AppliedModifiers)& applied) -{ - Standard_Integer nb = theapplieds.Length(); - if (num <= 0 || num > nb) return Standard_False; - theapplieds.SetValue(num,applied); - return Standard_True; -} - - Standard_Boolean IFSelect_ModelCopier::ClearAppliedModifiers - (const Standard_Integer num) -{ - Standard_Integer nb = theapplieds.Length(); - if (num <= 0 || num > nb) return Standard_False; - theapplieds.ChangeValue(num).Nullify(); - return Standard_True; -} - -// .... Copy : Opere les Transferts, les Memorise (pas d envoi fichier ici) - - Interface_CheckIterator IFSelect_ModelCopier::Copy - (IFSelect_ShareOutResult& eval, - const Handle(IFSelect_WorkLibrary)& WL, - const Handle(Interface_Protocol)& protocol) -{ - Interface_CopyTool TC (eval.Graph().Model(), protocol); - return Copying (eval,WL,protocol,TC); -} - -// Copy Interne - - Interface_CheckIterator IFSelect_ModelCopier::Copying - (IFSelect_ShareOutResult& eval, - const Handle(IFSelect_WorkLibrary)& WL, - const Handle(Interface_Protocol)& protocol, - Interface_CopyTool& TC) -{ - Message::SendInfo() << "** WorkSession : Copying split data before sending"<Init(0); - for (eval.Evaluate(); eval.More(); eval.Next()) { - Handle(Interface_InterfaceModel) model; - TCollection_AsciiString filename = eval.FileName(); - Standard_Integer dispnum = eval.DispatchRank(); - Standard_Integer numod, nbmod; - eval.PacketsInDispatch (numod,nbmod); - Handle(IFSelect_AppliedModifiers) curapp; - CopiedModel (G, WL,protocol, eval.PacketRoot(), filename,dispnum,numod, TC, - model, curapp,checks); - - AddFile (filename, model); - theapplieds.SetValue (theapplieds.Length(), curapp); - } - theshareout->SetLastRun (theshareout->NbDispatches()); - checks.SetName ("X-STEP WorkSession : Split Copy (no Write)"); - return checks; -} - -// Send a deux arguments : Envoi Fichier du Resultat deja memorise - - Interface_CheckIterator IFSelect_ModelCopier::SendCopied - (const Handle(IFSelect_WorkLibrary)& WL, - const Handle(Interface_Protocol)& protocol) -{ - Message::SendInfo() << "** WorkSession : Sending split data already copied"< 0) { - for (Standard_Integer i = 1; i <= nb; i ++) { - if (FileName(i).Length() == 0) continue; - Handle(IFSelect_AppliedModifiers) curapp = theapplieds.Value(i); - IFSelect_ContextWrite ctx (FileModel(i),protocol,curapp,FileName(i).ToCString()); - Standard_Boolean res = WL->WriteFile (ctx); - Interface_CheckIterator checklst = ctx.CheckList(); - checks.Merge(checklst); -// (FileName(i).ToCString(), FileModel(i),protocol,curapp,checks); -// if (!checks.IsEmpty(Standard_False)) { -// sout<<" ** On Sending File n0."<AddFail (mess); - Message::SendInfo() << " ** Sending File n0."<Init(0); - for (eval.Evaluate(); eval.More(); eval.Next()) { - i ++; - Handle(Interface_InterfaceModel) model; - TCollection_AsciiString filename = eval.FileName(); - Standard_Integer dispnum = eval.DispatchRank(); - Standard_Integer numod, nbmod; - eval.PacketsInDispatch (numod,nbmod); - Handle(IFSelect_AppliedModifiers) curapp; - CopiedModel (G, WL,protocol, eval.PacketRoot(), filename,dispnum,numod, TC, - model, curapp, checks); - IFSelect_ContextWrite ctx (model,protocol,curapp,filename.ToCString()); - Standard_Boolean res = WL->WriteFile (ctx); - Interface_CheckIterator checklst = ctx.CheckList(); - checks.Merge(checklst); -// (filename.ToCString(), model, protocol, curapp, checks); -// if (!checks.IsEmpty(Standard_False)) { -// sout<<" ** On Sending File "<AddFail (mess); - Message::SendInfo() << " ** Sending File "<SetLastRun (theshareout->NbDispatches()); - checks.SetName ("X-STEP WorkSession : Split Send (only Write)"); - return checks; -} - - -// .... SendAll : Donnees a tranferer dans G, aucun split, envoi sur fichier - - Interface_CheckIterator IFSelect_ModelCopier::SendAll - (const Standard_CString filename, const Interface_Graph& G, - const Handle(IFSelect_WorkLibrary)& WL, - const Handle(Interface_Protocol)& protocol) -{ - Interface_CheckIterator checks; - checks.SetName ("X-STEP WorkSession : Send All"); - Message::SendInfo() << "** WorkSession : Sending all data"<NbEntities(); - for (i = 1; i <= nb; i ++) TC.Bind (model->Value(i),model->Value(i)); - - Interface_EntityIterator pipo; - Handle(Interface_InterfaceModel) newmod; - Handle(IFSelect_AppliedModifiers) applied; - CopiedModel (G, WL,protocol,pipo,TCollection_AsciiString(filename), - 0,0,TC,newmod, applied,checks); - - IFSelect_ContextWrite ctx (model,protocol,applied,filename); - Standard_Boolean res = WL->WriteFile (ctx); - Interface_CheckIterator checklst = ctx.CheckList(); - checks.Merge(checklst); - if (!res) checks.CCheck(0)->AddFail ("SendAll (WriteFile) has failed"); -// if (!checks.IsEmpty(Standard_False)) { -// Message::SendWarning() << -// " ** SendAll has produced Check Messages : **"<NewEmptyModel(); - Interface_CopyTool TC (original, protocol); - TC.FillModel(newmod); // pour Header ... - -// Pas de copie : AddWithRefs plus declaration de Bind - Interface_GeneralLib lib(protocol); - for (list.Start(); list.More(); list.Next()) { - newmod->AddWithRefs (list.Value(),lib); - } - Standard_Integer i, nb = newmod->NbEntities(); - for (i = 1; i <= nb; i ++) TC.Bind (newmod->Value(i),newmod->Value(i)); - if (theremain.IsNull()) - { theremain = new TColStd_HArray1OfInteger(0,G.Size()); theremain->Init(0); } - - Interface_EntityIterator pipo; - Handle(IFSelect_AppliedModifiers) applied; - CopiedModel (G, WL,protocol, pipo,TCollection_AsciiString(filename), - 0,0,TC,newmod, applied,checks); -// Alimenter Remaining : les entites copiees sont a noter - Handle(Standard_Transient) ent1,ent2; - for (Standard_Integer ic = TC.LastCopiedAfter (0,ent1,ent2); ic > 0; - ic = TC.LastCopiedAfter (ic,ent1,ent2) ) { - if (ic <= theremain->Upper()) - theremain->SetValue(ic,theremain->Value(ic)+1); - } - IFSelect_ContextWrite ctx (newmod,protocol,applied,filename); - Standard_Boolean res = WL->WriteFile (ctx); - Interface_CheckIterator checklst = ctx.CheckList(); - checks.Merge(checklst); - if (!res) checks.CCheck(0)->AddFail ("SendSelected (WriteFile) has failed"); -// if (!checks.IsEmpty(Standard_False)) { -// Message::SendWarning() << -// " ** SendSelected has produced Check Messages : **"< 0) { - newmod = original->NewEmptyModel(); - TC.Clear(); - WL->CopyModel (original,newmod,tocopy,TC); - - Handle(Standard_Transient) ent1,ent2; -// Alimenter Remaining : les entites copiees sont a noter - for (Standard_Integer ic = TC.LastCopiedAfter (0,ent1,ent2); ic > 0; - ic = TC.LastCopiedAfter (ic,ent1,ent2) ) { - if (ic <= theremain->Upper()) - theremain->SetValue(ic,theremain->Value(ic)+1); - } - } - else if (newmod.IsNull()) newmod = original; - -// ... Ensuite : On prend en compte les Model Modifiers ... - Standard_Integer nbmod = 0; - if (!theshareout.IsNull()) nbmod = theshareout->NbModifiers(Standard_True); - Standard_Integer i; // svv Jan11 2000 : porting on DEC - for (i = 1; i <= nbmod; i ++) { - Handle(IFSelect_Modifier) unmod = theshareout->ModelModifier(i); - -// D abord, critere Dispatch/Packet - if (dispnum > 0) - if (!unmod->Applies (theshareout->Dispatch(dispnum))) continue; - IFSelect_ContextModif ctx (G,TC,filename.ToCString()); -// Ensuite, la Selection - Handle(IFSelect_Selection) sel = unmod->Selection(); - if (!sel.IsNull()) { - Interface_EntityIterator entiter = sel->UniqueResult(G); - ctx.Select (entiter); - } - if (ctx.IsForNone()) continue; - unmod->Perform (ctx,newmod,protocol,TC); - Interface_CheckIterator checklst = ctx.CheckList(); - checks.Merge (checklst); - -// Faut-il enregistrer les erreurs dans newmod ? bonne question -// if (!checks.IsEmpty(Standard_False)) { -// Message::SendWarning() << -// " Messages on Copied Model n0 "<NbModifiers(Standard_False); - if (nbmod == 0) return; - applied = new IFSelect_AppliedModifiers (nbmod,newmod->NbEntities()); - for (i = 1; i <= nbmod; i ++) { - Handle(IFSelect_GeneralModifier) unmod = theshareout->GeneralModifier(Standard_False,i); - -// D abord, critere Dispatch/Packet - if (dispnum > 0) - if (!unmod->Applies (theshareout->Dispatch(dispnum))) continue; -// Ensuite, la Selection - Handle(IFSelect_Selection) sel = unmod->Selection(); - if (sel.IsNull()) applied->AddModif (unmod); // vide -> on prend tout - else { - Interface_EntityIterator list = sel->UniqueResult(G); - Handle(Standard_Transient) newent; - -// Entites designees par la Selection et Copiees ? -// -> s ilyena au moins une, le Modifier s applique, sinon il est rejete -// -> et cette liste est exploitable par le Modifier ... - for (list.Start(); list.More(); list.Next()) { - if (TC.Search (list.Value(),newent)) - applied->AddNum (newmod->Number(newent)); - } - } - } -} - - - void IFSelect_ModelCopier::CopiedRemaining - (const Interface_Graph& G, const Handle(IFSelect_WorkLibrary)& WL, - Interface_CopyTool& TC, Handle(Interface_InterfaceModel)& newmod) -{ - Handle(Interface_InterfaceModel) original = G.Model(); -// Interface_CopyTool TC(original,protocol); - newmod = original->NewEmptyModel(); - TC.Clear(); - Interface_EntityIterator tocopy; - Standard_Integer nb = G.Size(); - theremain = new TColStd_HArray1OfInteger(0,nb+1); theremain->Init(0); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (G.Status(i) == 0) tocopy.AddItem (original->Value(i)); - else theremain->SetValue(i,-1); // ?? -1 - } - WL->CopyModel (original,newmod,tocopy,TC); - - if (newmod->NbEntities() == 0) newmod.Nullify(); - else { -// CE QUI SUIT NE DOIT PAS ETRE SUPPRIME ! cf theremain - Handle(Standard_Transient) ent1,ent2; - for (Standard_Integer ic = TC.LastCopiedAfter (0,ent1,ent2); ic > 0; - ic = TC.LastCopiedAfter (ic,ent1,ent2) ) { - if (ic <= theremain->Upper()) - theremain->SetValue(ic,1); - } -// qq impressions de mise au point -#ifdef MISOPOINT - std::cout << " Remaining Model : " << newmod->NbEntities() << " Entities"<Value(i) == 0) { - if (ne == 0) std::cout << " Refractaires : "; - ne ++; std::cout << " " << i; - } - } - if (ne > 0) std::cout << " -- " << ne << " Entities" << std::endl; - else std::cout<<" -- Remaining data complete"<Upper()) return Standard_False; - for (Standard_Integer i = 1; i <= nb; i ++) { - if (CG.Status(i) >= 0) CG.SetStatus(i,CG.Status(i)+theremain->Value(i)); - } - theremain->Init(0); - return Standard_True; -} - -// ########################################################################## -// ######## RESULTAT de la Memorisation des Transferts ######## - - Standard_Integer IFSelect_ModelCopier::NbFiles () const - { return thefilemodels.Length(); } - - TCollection_AsciiString IFSelect_ModelCopier::FileName - (const Standard_Integer num) const - { return thefilenames.Value(num); } - - Handle(Interface_InterfaceModel) IFSelect_ModelCopier::FileModel - (const Standard_Integer num) const - { return thefilemodels.Value(num); } - - Handle(IFSelect_AppliedModifiers) IFSelect_ModelCopier::AppliedModifiers - (const Standard_Integer num) const - { return theapplieds.Value(num); } - - - void IFSelect_ModelCopier::BeginSentFiles - (const Handle(IFSelect_ShareOut)& sho, const Standard_Boolean record) -{ - thesentfiles.Nullify(); - if (record) thesentfiles = new TColStd_HSequenceOfHAsciiString(); -// et numerotation des fichiers par defaut : detenue par ShareOut - if (sho.IsNull()) return; - Standard_Integer lastrun = sho->LastRun(); - sho->ClearResult (Standard_True); - sho->SetLastRun (lastrun); // on ne s interesse quaux numeros -} - - void IFSelect_ModelCopier::AddSentFile (const Standard_CString filename) - { if (!thesentfiles.IsNull()) - thesentfiles->Append(new TCollection_HAsciiString(filename)); } - - Handle(TColStd_HSequenceOfHAsciiString) IFSelect_ModelCopier::SentFiles () const - { return thesentfiles; } diff --git a/src/IFSelect/IFSelect_ModelCopier.hxx b/src/IFSelect/IFSelect_ModelCopier.hxx deleted file mode 100644 index 694e81c4ff..0000000000 --- a/src/IFSelect/IFSelect_ModelCopier.hxx +++ /dev/null @@ -1,260 +0,0 @@ -// Created on: 1993-08-26 -// 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 _IFSelect_ModelCopier_HeaderFile -#define _IFSelect_ModelCopier_HeaderFile - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -class IFSelect_ShareOut; -class TCollection_AsciiString; -class Interface_InterfaceModel; -class IFSelect_AppliedModifiers; -class Interface_CheckIterator; -class IFSelect_ShareOutResult; -class IFSelect_WorkLibrary; -class Interface_Protocol; -class Interface_CopyTool; -class Interface_Graph; -class Interface_EntityIterator; - -class IFSelect_ModelCopier; -DEFINE_STANDARD_HANDLE(IFSelect_ModelCopier, Standard_Transient) - -//! This class performs the Copy operations involved by the -//! description of a ShareOut (evaluated by a ShareOutResult) -//! plus, if there are, the Modifications on the results, with -//! the help of Modifiers. Each Modifier can work on one or more -//! resulting packets, according to its criteria : it operates on -//! a Model once copied and filled with the content of the packet. -//! -//! Modifiers can be : -//! - Model Modifiers, inheriting from the specific class Modifier -//! able to run on the content of a Model (header or entities), -//! activated by the ModelCopier itself -//! - File Modifiers, inheriting directly from GeneralModifier, -//! intended to be activated under the control of a WorkLibrary, -//! once the Model has been produced (i.e. to act on output -//! format, or other specific file features) -//! -//! The Copy operations can be : -//! - immediately put to files : for each packet, a Model is -//! created and filled, then the file is output, at that's all -//! - memorized : for each packet, a Model is created and filled, -//! it is memorized with the corresponding file name. -//! it is possible to query the result of memorization (list of -//! produced Models and their file names) -//! -> it is also possible to send it into the files : -//! once files are written, the result is cleared -//! -//! In addition, a list of really written files is managed : -//! A first call to BeginSentFiles clears the list and commands, -//! either to begin a new list, or to stop recording it. A call -//! to SentFiles returns the list (if recording has been required) -//! This list allows to globally exploit the set of produced files -//! -//! Remark : For operations which concern specific Entities, see -//! also in package IFAdapt : a sub-class of ModelCopier allows -//! to work with EntityModifier, in addition to Modifier itself -//! which still applies to a whole copied Model. -class IFSelect_ModelCopier : public Standard_Transient -{ - -public: - - //! Creates an empty ModelCopier - Standard_EXPORT IFSelect_ModelCopier(); - - //! Sets the ShareOut, which is used to define Modifiers to apply - Standard_EXPORT void SetShareOut (const Handle(IFSelect_ShareOut)& sho); - - //! Clears the list of produced Models - Standard_EXPORT void ClearResult(); - - //! Records a new File to be sent, as a couple - //! (Name as AsciiString, Content as InterfaceModel) - //! Returns True if Done, False if is already attached - //! to another File - Standard_EXPORT Standard_Boolean AddFile (const TCollection_AsciiString& filename, const Handle(Interface_InterfaceModel)& content); - - //! Changes the Name attached to a File which was formerly defined - //! by a call to AddFile - //! Returns True if Done, False else : if out of range or if - //! the new is already attached to another File - //! Remark : Giving an empty File Name is equivalent to ClearFile - Standard_EXPORT Standard_Boolean NameFile (const Standard_Integer num, const TCollection_AsciiString& filename); - - //! Clears the Name attached to a File which was formerly defined - //! by a call to AddFile. This Clearing can be undone by a call to - //! NameFile (with same ) - //! Returns True if Done, False else : if is out of range - Standard_EXPORT Standard_Boolean ClearFile (const Standard_Integer num); - - //! Sets a list of File Modifiers to be applied on a file - Standard_EXPORT Standard_Boolean SetAppliedModifiers (const Standard_Integer num, const Handle(IFSelect_AppliedModifiers)& applied); - - //! Clears the list of File Modifiers to be applied on a file - Standard_EXPORT Standard_Boolean ClearAppliedModifiers (const Standard_Integer num); - - //! Performs the Copy Operations, which include the Modifications - //! defined by the list of Modifiers. Memorizes the result, as a - //! list of InterfaceModels with the corresponding FileNames - //! They can then be sent, by the method Send, or queried - //! Copy calls internal method Copying. - //! Returns the produced CheckList - Standard_EXPORT Interface_CheckIterator Copy (IFSelect_ShareOutResult& eval, const Handle(IFSelect_WorkLibrary)& WL, const Handle(Interface_Protocol)& protocol); - - //! Sends the formerly defined results (see method Copy) to files, - //! then clears it - //! Remark : A Null File Name cause file to be not produced - Standard_EXPORT Interface_CheckIterator SendCopied (const Handle(IFSelect_WorkLibrary)& WL, const Handle(Interface_Protocol)& protocol); - - //! Performs the Copy Operations (which include the Modifications) - //! and Sends the result on files, without memorizing it. - //! (the memorized result is ignored : neither queried not filled) - Standard_EXPORT Interface_CheckIterator Send (IFSelect_ShareOutResult& eval, const Handle(IFSelect_WorkLibrary)& WL, const Handle(Interface_Protocol)& protocol); - - //! Sends a model (defined in ) into one file, without managing - //! remaining data, already sent files, etc. Applies the Model and - //! File Modifiers. - //! Returns True if well done, False else - Standard_EXPORT Interface_CheckIterator SendAll (const Standard_CString filename, const Interface_Graph& G, const Handle(IFSelect_WorkLibrary)& WL, const Handle(Interface_Protocol)& protocol); - - //! Sends a part of a model into one file. Model is gotten from - //! , the part is defined in . - //! Remaining data are managed and can be later be worked on. - //! Returns True if well done, False else - Standard_EXPORT Interface_CheckIterator SendSelected (const Standard_CString filename, const Interface_Graph& G, const Handle(IFSelect_WorkLibrary)& WL, const Handle(Interface_Protocol)& protocol, const Interface_EntityIterator& iter); - - //! Produces a Model copied from the Remaining List as - //! is a Null Handle if this list is empty - //! performs the copy by using - //! is assumed to have been defined with the starting model - //! same as defined by . - Standard_EXPORT void CopiedRemaining (const Interface_Graph& G, const Handle(IFSelect_WorkLibrary)& WL, Interface_CopyTool& TC, Handle(Interface_InterfaceModel)& newmod); - - //! Updates Graph status for remaining data, for each entity : - //! - Entities just Sent to file or Copied (by CopiedRemaining) - //! have their status set to 1 - //! - the other keep their former status (1 for Send/Copied, - //! 0 for Remaining) - //! These status are computed by Copying/Sending/CopiedRemaining - //! Then, SetRemaining updates graph status, and mustr be called - //! just after one of these method has been called - //! Returns True if done, False if remaining info if not in phase - //! which the Graph (not same counts of items) - Standard_EXPORT Standard_Boolean SetRemaining (Interface_Graph& CG) const; - - //! Returns the count of Files produced, i.e. the count of Models - //! memorized (produced by the mmethod Copy) with their file names - Standard_EXPORT Standard_Integer NbFiles() const; - - //! Returns the File Name for a file given its rank - //! It is empty after a call to ClearFile on same - Standard_EXPORT TCollection_AsciiString FileName (const Standard_Integer num) const; - - //! Returns the content of a file before sending, under the form - //! of an InterfaceModel, given its rank - Standard_EXPORT Handle(Interface_InterfaceModel) FileModel (const Standard_Integer num) const; - - //! Returns the list of File Modifiers to be applied on a file - //! when it will be sent, as computed by CopiedModel : - //! If it is a null handle, no File Modifier has to be applied. - Standard_EXPORT Handle(IFSelect_AppliedModifiers) AppliedModifiers (const Standard_Integer num) const; - - //! Begins a sequence of recording the really sent files - //! : the default file numbering is cleared - //! If is False, clears the list and stops recording - //! If is True, clears the list and commands recording - //! Creation time corresponds to "stop recording" - Standard_EXPORT void BeginSentFiles (const Handle(IFSelect_ShareOut)& sho, const Standard_Boolean record); - - //! Adds the name of a just sent file, if BeginSentFiles - //! has commanded recording; else does nothing - //! It is called by methods SendCopied Sending - Standard_EXPORT void AddSentFile (const Standard_CString filename); - - //! Returns the list of recorded names of sent files. Can be empty - //! (if no file has been sent). Returns a Null Handle if - //! BeginSentFiles has stopped recording. - Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) SentFiles() const; - - DEFINE_STANDARD_RTTIEXT(IFSelect_ModelCopier,Standard_Transient) - -protected: - - //! Internal routine which does the effective Copy. It allows to - //! work, either with a standard CopyTool, or a specialised one - //! Copying itself is done by which uses a CopyTool - Standard_EXPORT Interface_CheckIterator Copying (IFSelect_ShareOutResult& eval, const Handle(IFSelect_WorkLibrary)& WL, const Handle(Interface_Protocol)& protocol, Interface_CopyTool& TC); - - //! Internal routine which does the effective Send. It allows to - //! work, either with a standard CopyTool, or a specialised one - Standard_EXPORT Interface_CheckIterator Sending (IFSelect_ShareOutResult& eval, const Handle(IFSelect_WorkLibrary)& WL, const Handle(Interface_Protocol)& protocol, Interface_CopyTool& TC); - - //! Performs the Copy of a unitary Packet - //! Input parameters are : - //! is the graph which defines the starting entities, it - //! contains the original InterfaceModel - //! performs the copy by using - //! is the used protocol (can be useful for Modifiers) - //! is the list of Entities which are the Roots of the - //! packet to be copied - //! is the name of the file which will receive it - //! is the Identifier of the Dispatch which have produced - //! this packet, is the rank of the packet for this - //! Dispatch - //! is a CopyTool, which performs the copy - //! - //! Returned values (as arguments) are : - //! is the result of the copy, as a new InterfaceModel on - //! which Model Modifiers have already been applied (if there are) - //! determines the File Modifiers which remain to be - //! applied (when the file itself will be output) : for each File - //! Modifier recorded in , 's Value is : - //! - Null if this Modifier has not to be applied - //! - an empty list if this Modifier has to be applied without - //! distinguishing specific entities - //! - a list of numbers of entities in if this Modifier - //! concerns particularly these entities (which are the results - //! of copying the result of its input selection) - //! is the produced Check List (by Modifiers as required) - //! - //! Warning : File Modifiers are evaluated at the time of Copy itself - //! If their list is changed between this Copy and the Sending - //! itself of the file, these changes are ignored - Standard_EXPORT void CopiedModel (const Interface_Graph& G, const Handle(IFSelect_WorkLibrary)& WL, const Handle(Interface_Protocol)& protocol, const Interface_EntityIterator& topcopy, const TCollection_AsciiString& filename, const Standard_Integer dispnum, const Standard_Integer numod, Interface_CopyTool& TC, Handle(Interface_InterfaceModel)& newmod, Handle(IFSelect_AppliedModifiers)& applied, Interface_CheckIterator& checks) const; - -private: - - IFSelect_SequenceOfInterfaceModel thefilemodels; - TColStd_SequenceOfAsciiString thefilenames; - IFSelect_SequenceOfAppliedModifiers theapplieds; - Handle(IFSelect_ShareOut) theshareout; - Handle(TColStd_HArray1OfInteger) theremain; - Handle(TColStd_HSequenceOfHAsciiString) thesentfiles; - -}; - -#endif // _IFSelect_ModelCopier_HeaderFile diff --git a/src/IFSelect/IFSelect_ModelModifier.gxx b/src/IFSelect/IFSelect_ModelModifier.gxx deleted file mode 100644 index dd35c34442..0000000000 --- a/src/IFSelect/IFSelect_ModelModifier.gxx +++ /dev/null @@ -1,41 +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 - -IFSelect_ModelModifier::IFSelect_ModelModifier (const Standard_Boolean grf) - : IFSelect_Modifier (grf) { } - - void IFSelect_ModelModifier::Perform - (IFSelect_ContextModif& ctx, - const Handle(Interface_InterfaceModel)& target, - const Handle(Interface_Protocol)& protocol, - Interface_CopyTool& TC) const -{ - ctx.TraceModifier(this); - Handle(Model) targ = Handle(Model)::DownCast(target); - Handle(Proto) prot = Handle(Proto)::DownCast(protocol); - if (targ.IsNull()) { - ctx.CCheck()->AddFail("Model to Modify : unproper type"); - return; - } - PerformProtocol (ctx,targ,prot,TC); -} - - void IFSelect_ModelModifier::PerformProtocol - (IFSelect_ContextModif& ctx, - const Handle(Model)& target, - const Handle(Proto)& protocol, - Interface_CopyTool& TC) const -{ ctx.SetProtocol(protocol); Performing (ctx,target,TC); } diff --git a/src/IFSelect/IFSelect_ModifEditForm.cxx b/src/IFSelect/IFSelect_ModifEditForm.cxx deleted file mode 100644 index 8a731b33bb..0000000000 --- a/src/IFSelect/IFSelect_ModifEditForm.cxx +++ /dev/null @@ -1,56 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_ModifEditForm,IFSelect_Modifier) - -IFSelect_ModifEditForm::IFSelect_ModifEditForm - (const Handle(IFSelect_EditForm)& editform) - : IFSelect_Modifier (Standard_False) { theedit = editform; } - - Handle(IFSelect_EditForm) IFSelect_ModifEditForm::EditForm () const - { return theedit; } - - - void IFSelect_ModifEditForm::Perform - (IFSelect_ContextModif& ctx, - const Handle(Interface_InterfaceModel)& target, - const Handle(Interface_Protocol)& /*protocol*/, - Interface_CopyTool& /*TC*/) const -{ - for (ctx.Start(); ctx.More(); ctx.Next()) { - Standard_Boolean done = theedit->ApplyData(ctx.ValueResult(),target); - if (done) ctx.Trace(); - else ctx.AddWarning (ctx.ValueResult(),"EditForm could not be applied"); - } -} - - TCollection_AsciiString IFSelect_ModifEditForm::Label () const -{ - Standard_CString editlab = theedit->Label(); - TCollection_AsciiString lab ("Apply EditForm"); - if (editlab && editlab[0] != '\0') { - lab.AssignCat (" : "); - lab.AssignCat (editlab); - } - return lab; -} diff --git a/src/IFSelect/IFSelect_ModifEditForm.hxx b/src/IFSelect/IFSelect_ModifEditForm.hxx deleted file mode 100644 index 3965d1a2a6..0000000000 --- a/src/IFSelect/IFSelect_ModifEditForm.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// Created on: 1998-02-27 -// Created by: Christian CAILLET -// Copyright (c) 1998-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 _IFSelect_ModifEditForm_HeaderFile -#define _IFSelect_ModifEditForm_HeaderFile - -#include -#include - -#include -class IFSelect_EditForm; -class IFSelect_ContextModif; -class Interface_InterfaceModel; -class Interface_Protocol; -class Interface_CopyTool; -class TCollection_AsciiString; - - -class IFSelect_ModifEditForm; -DEFINE_STANDARD_HANDLE(IFSelect_ModifEditForm, IFSelect_Modifier) - -//! This modifier applies an EditForm on the entities selected -class IFSelect_ModifEditForm : public IFSelect_Modifier -{ - -public: - - - //! Creates a ModifEditForm. It may not change the graph - Standard_EXPORT IFSelect_ModifEditForm(const Handle(IFSelect_EditForm)& editform); - - //! Returns the EditForm - Standard_EXPORT Handle(IFSelect_EditForm) EditForm() const; - - //! Acts by applying an EditForm to entities, selected or all model - Standard_EXPORT void Perform (IFSelect_ContextModif& ctx, const Handle(Interface_InterfaceModel)& target, const Handle(Interface_Protocol)& protocol, Interface_CopyTool& TC) const Standard_OVERRIDE; - - //! Returns Label as "Apply EditForm <+ label of EditForm>" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_ModifEditForm,IFSelect_Modifier) - -protected: - - - - -private: - - - Handle(IFSelect_EditForm) theedit; - - -}; - - - - - - - -#endif // _IFSelect_ModifEditForm_HeaderFile diff --git a/src/IFSelect/IFSelect_ModifReorder.cxx b/src/IFSelect/IFSelect_ModifReorder.cxx deleted file mode 100644 index 76f675e7ea..0000000000 --- a/src/IFSelect/IFSelect_ModifReorder.cxx +++ /dev/null @@ -1,46 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_ModifReorder,IFSelect_Modifier) - -IFSelect_ModifReorder::IFSelect_ModifReorder (const Standard_Boolean rootlast) - : IFSelect_Modifier (Standard_True) { thertl = rootlast; } - - void IFSelect_ModifReorder::Perform (IFSelect_ContextModif& ctx, - const Handle(Interface_InterfaceModel)& target, - const Handle(Interface_Protocol)& /*protocol*/, - Interface_CopyTool& /*TC*/) const -{ - Interface_ShareTool sht (ctx.OriginalGraph()); - Interface_EntityIterator list = sht.All (ctx.OriginalModel(),thertl); - target->ClearEntities(); - for (list.Start(); list.More(); list.Next()) target->AddEntity (list.Value()); -} - -TCollection_AsciiString IFSelect_ModifReorder::Label () const -{ - Standard_CString astr = (Standard_CString ) ( thertl ? "Reorder, Roots last" : "Reorder, Roots first"); - return TCollection_AsciiString( astr ) ; -// ( thertl ? "Reorder, Roots last" : "Reorder, Roots first"); -} diff --git a/src/IFSelect/IFSelect_ModifReorder.hxx b/src/IFSelect/IFSelect_ModifReorder.hxx deleted file mode 100644 index d07a99c8f4..0000000000 --- a/src/IFSelect/IFSelect_ModifReorder.hxx +++ /dev/null @@ -1,82 +0,0 @@ -// Created on: 1996-03-15 -// Created by: Christian CAILLET -// Copyright (c) 1996-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 _IFSelect_ModifReorder_HeaderFile -#define _IFSelect_ModifReorder_HeaderFile - -#include -#include - -#include -class IFSelect_ContextModif; -class Interface_InterfaceModel; -class Interface_Protocol; -class Interface_CopyTool; -class TCollection_AsciiString; - - -class IFSelect_ModifReorder; -DEFINE_STANDARD_HANDLE(IFSelect_ModifReorder, IFSelect_Modifier) - -//! This modifier reorders a whole model from its roots, i.e. -//! according to status, it considers each of its -//! roots, then it orders all its shared entities at any level, -//! the result begins by the lower level entities ... ends by -//! the roots. -class IFSelect_ModifReorder : public IFSelect_Modifier -{ - -public: - - - //! Creates a ModifReorder. It may change the graph (it does !) - //! If is True (D), roots are set at the end of packets - //! Else, they are set at beginning (as done by AddWithRefs) - Standard_EXPORT IFSelect_ModifReorder(const Standard_Boolean rootlast = Standard_True); - - //! Acts by computing orders (by method All from ShareTool) then - //! forcing them in the model. Remark that selection is ignored : - //! ALL the model is processed in once - Standard_EXPORT void Perform (IFSelect_ContextModif& ctx, const Handle(Interface_InterfaceModel)& target, const Handle(Interface_Protocol)& protocol, Interface_CopyTool& TC) const Standard_OVERRIDE; - - //! Returns Label as "Reorder, Roots (last or first)" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_ModifReorder,IFSelect_Modifier) - -protected: - - - - -private: - - - Standard_Boolean thertl; - - -}; - - - - - - - -#endif // _IFSelect_ModifReorder_HeaderFile diff --git a/src/IFSelect/IFSelect_Modifier.cxx b/src/IFSelect/IFSelect_Modifier.cxx deleted file mode 100644 index eeebc1ec5b..0000000000 --- a/src/IFSelect/IFSelect_Modifier.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 -#include - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_Modifier,IFSelect_GeneralModifier) - -IFSelect_Modifier::IFSelect_Modifier (const Standard_Boolean grf) - : IFSelect_GeneralModifier (grf) { } diff --git a/src/IFSelect/IFSelect_Modifier.hxx b/src/IFSelect/IFSelect_Modifier.hxx deleted file mode 100644 index 9e98826452..0000000000 --- a/src/IFSelect/IFSelect_Modifier.hxx +++ /dev/null @@ -1,86 +0,0 @@ -// Created on: 1993-08-26 -// 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 _IFSelect_Modifier_HeaderFile -#define _IFSelect_Modifier_HeaderFile - -#include -#include - -#include -class IFSelect_ContextModif; -class Interface_InterfaceModel; -class Interface_Protocol; -class Interface_CopyTool; - - -class IFSelect_Modifier; -DEFINE_STANDARD_HANDLE(IFSelect_Modifier, IFSelect_GeneralModifier) - -//! This class gives a frame for Actions which can work globally -//! on a File once completely defined (i.e. afterwards) -//! -//! Remark : if no Selection is set as criterium, the Modifier is -//! set to work and should consider all the content of the Model -//! produced. -class IFSelect_Modifier : public IFSelect_GeneralModifier -{ - -public: - - - //! This deferred method defines the action specific to each class - //! of Modifier. It is called by a ModelCopier, once the Model - //! generated and filled. ModelCopier has already checked the - //! criteria (Dispatch, Model Rank, Selection) before calling it. - //! - //! detains information about original data and selection. - //! The result of copying, on which modifications are to be done, - //! is . - //! allows to run additional copies as required - //! - //! In case of Error, use methods CCheck from the ContextModif - //! to aknowledge an entity Check or a Global Check with messages - Standard_EXPORT virtual void Perform (IFSelect_ContextModif& ctx, const Handle(Interface_InterfaceModel)& target, const Handle(Interface_Protocol)& protocol, Interface_CopyTool& TC) const = 0; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_Modifier,IFSelect_GeneralModifier) - -protected: - - - //! Calls inherited Initialize, transmits to it the information - //! - Standard_EXPORT IFSelect_Modifier(const Standard_Boolean maychangegraph); - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_Modifier_HeaderFile diff --git a/src/IFSelect/IFSelect_PacketList.cxx b/src/IFSelect/IFSelect_PacketList.cxx deleted file mode 100644 index 64a974412c..0000000000 --- a/src/IFSelect/IFSelect_PacketList.cxx +++ /dev/null @@ -1,144 +0,0 @@ -// Created on: 1994-09-02 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_PacketList,Standard_Transient) - -IFSelect_PacketList::IFSelect_PacketList - (const Handle(Interface_InterfaceModel)& model) - : thedupls (0,model->NbEntities()) , - thepacks (100) , - theflags (0,model->NbEntities()) , - thename ("Packets") -{ - themodel = model; thelast = 0; thebegin = Standard_False; // begin-begin - thedupls.Init(0); theflags.Init(0); -} - - void IFSelect_PacketList::SetName (const Standard_CString name) - { thename.Clear(); thename.AssignCat (name); } - - Standard_CString IFSelect_PacketList::Name () const - { return thename.ToCString(); } - - Handle(Interface_InterfaceModel) IFSelect_PacketList::Model () const - { return themodel; } - - void IFSelect_PacketList::AddPacket () -{ - Standard_Integer nbl = thepacks.NbEntities(); - Standard_Integer nbe = theflags.Upper(); - for (Standard_Integer i = 1; i <= nbe; i ++) theflags.SetValue(i,0); - - if (thelast >= nbl) thepacks.SetNbEntities (nbl*2); - - if (!thebegin) thelast ++; - thepacks.SetNumber (thelast); - thebegin = Standard_False; -} - - - void IFSelect_PacketList::Add - (const Handle(Standard_Transient)& ent) -{ - Standard_Integer num = themodel->Number(ent); - if (num == 0) throw Interface_InterfaceError("PacketList:Add, Entity not in Model"); - if (thelast == 0) throw Interface_InterfaceError("PacketList:Add, no Packet yet added"); - if (theflags(num) != 0) return; - theflags(num) = 1; - thedupls(num) ++; - thepacks.Add(num); - thebegin = Standard_False; -} - - void IFSelect_PacketList::AddList - (const Handle(TColStd_HSequenceOfTransient)& list) -{ - if (list.IsNull()) return; - Standard_Integer i , nb = list->Length(); - thepacks.Reservate (nb+1); - for (i = 1; i <= nb; i ++) Add (list->Value(i)); -} - - - Standard_Integer IFSelect_PacketList::NbPackets () const - { return (thebegin ? thelast-1 : thelast); } - - Standard_Integer IFSelect_PacketList::NbEntities - (const Standard_Integer numpack) const -{ - if (numpack <= 0 || numpack > NbPackets()) return 0; - Interface_IntList lisi(thepacks,Standard_False); lisi.SetNumber (numpack); - return lisi.Length(); -} - - Interface_EntityIterator IFSelect_PacketList::Entities - (const Standard_Integer numpack) const -{ - Interface_EntityIterator list; - if (numpack <= 0 || numpack > NbPackets()) return list; - Interface_IntList lisi(thepacks,Standard_False); lisi.SetNumber (numpack); - Standard_Integer i , nb = lisi.Length(); - for (i = 1; i <= nb; i ++) - list.AddItem(themodel->Value(lisi.Value(i))); - return list; -} - - Standard_Integer IFSelect_PacketList::HighestDuplicationCount () const -{ - Standard_Integer i , nb = themodel->NbEntities(); - Standard_Integer high = 0; - for (i = 1; i <= nb; i ++) { - Standard_Integer j = thedupls.Value(i); - if (j > high) high = j; - } - return high; -} - - Standard_Integer IFSelect_PacketList::NbDuplicated - (const Standard_Integer newcount, const Standard_Boolean andmore) const -{ - Standard_Integer i, nb = themodel->NbEntities(); - Standard_Integer nbdu = 0; - - for (i = 1; i <= nb; i ++) { - Standard_Integer j = thedupls.Value(i); - if (j == newcount || (j > newcount && andmore)) nbdu ++; - } - return nbdu; -} - - Interface_EntityIterator IFSelect_PacketList::Duplicated - (const Standard_Integer newcount, const Standard_Boolean andmore) const -{ - Standard_Integer nb = themodel->NbEntities(); - Interface_EntityIterator list; - - Standard_Integer i; - for (i = 1; i <= nb; i ++) { - Standard_Integer j = thedupls.Value(i); - if (j == newcount || (j > newcount && andmore)) list.AddItem(themodel->Value(i)); - } - return list; -} diff --git a/src/IFSelect/IFSelect_PacketList.hxx b/src/IFSelect/IFSelect_PacketList.hxx deleted file mode 100644 index 3b01d8e9bb..0000000000 --- a/src/IFSelect/IFSelect_PacketList.hxx +++ /dev/null @@ -1,130 +0,0 @@ -// Created on: 1994-09-02 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_PacketList_HeaderFile -#define _IFSelect_PacketList_HeaderFile - -#include - -#include -#include -#include -#include -#include -class Interface_InterfaceModel; -class Interface_EntityIterator; - - -class IFSelect_PacketList; -DEFINE_STANDARD_HANDLE(IFSelect_PacketList, Standard_Transient) - -//! This class gives a simple way to return then consult a -//! list of packets, determined from the content of a Model, -//! by various criteria. -//! -//! It allows to describe several lists with entities from a -//! given model, possibly more than one list knowing every entity, -//! and to determine the remaining list (entities in no lists) and -//! the duplications (with their count). -class IFSelect_PacketList : public Standard_Transient -{ - -public: - - - //! Creates a PackList, empty, ready to receive entities from a - //! given Model - Standard_EXPORT IFSelect_PacketList(const Handle(Interface_InterfaceModel)& model); - - //! Sets a name to a packet list : this makes easier a general - //! routine to print it. Default is "Packets" - Standard_EXPORT void SetName (const Standard_CString name); - - //! Returns the recorded name for a packet list - Standard_EXPORT Standard_CString Name() const; - - //! Returns the Model of reference - Standard_EXPORT Handle(Interface_InterfaceModel) Model() const; - - //! Declares a new Packet, ready to be filled - //! The entities to be added will be added to this Packet - Standard_EXPORT void AddPacket(); - - //! Adds an entity from the Model into the current packet for Add - Standard_EXPORT void Add (const Handle(Standard_Transient)& ent); - - //! Adds an list of entities into the current packet for Add - Standard_EXPORT void AddList (const Handle(TColStd_HSequenceOfTransient)& list); - - //! Returns the count of non-empty packets - Standard_EXPORT Standard_Integer NbPackets() const; - - //! Returns the count of entities in a Packet given its rank, or 0 - Standard_EXPORT Standard_Integer NbEntities (const Standard_Integer numpack) const; - - //! Returns the content of a Packet given its rank - //! Null Handle if is out of range - Standard_EXPORT Interface_EntityIterator Entities (const Standard_Integer numpack) const; - - //! Returns the highest number of packets which know a same entity - //! For no duplication, should be one - Standard_EXPORT Standard_Integer HighestDuplicationCount() const; - - //! Returns the count of entities duplicated : - //! times, if is False, or - //! or more times, if is True - //! See Duplicated for more details - Standard_EXPORT Standard_Integer NbDuplicated (const Standard_Integer count, const Standard_Boolean andmore) const; - - //! Returns a list of entities duplicated : - //! times, if is False, or - //! or more times, if is True - //! Hence, count=2 & andmore=True gives all duplicated entities - //! count=1 gives non-duplicated entities (in only one packet) - //! count=0 gives remaining entities (in no packet at all) - Standard_EXPORT Interface_EntityIterator Duplicated (const Standard_Integer count, const Standard_Boolean andmore) const; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_PacketList,Standard_Transient) - -protected: - - - - -private: - - - Handle(Interface_InterfaceModel) themodel; - TColStd_Array1OfInteger thedupls; - Interface_IntList thepacks; - TColStd_Array1OfInteger theflags; - Standard_Integer thelast; - Standard_Boolean thebegin; - TCollection_AsciiString thename; - - -}; - - - - - - - -#endif // _IFSelect_PacketList_HeaderFile diff --git a/src/IFSelect/IFSelect_ParamEditor.cxx b/src/IFSelect/IFSelect_ParamEditor.cxx deleted file mode 100644 index 3380692fb0..0000000000 --- a/src/IFSelect/IFSelect_ParamEditor.cxx +++ /dev/null @@ -1,106 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_ParamEditor,IFSelect_Editor) - -IFSelect_ParamEditor::IFSelect_ParamEditor - (const Standard_Integer nbmax, const Standard_CString label) -: IFSelect_Editor (nbmax) , thelabel (label) -{ - SetNbValues (0); - if (thelabel.Length() == 0) thelabel.AssignCat ("Param Editor"); -} - -void IFSelect_ParamEditor::AddValue - (const Handle(Interface_TypedValue)& val, const Standard_CString shortname) -{ - SetNbValues (NbValues() + 1); - SetValue (NbValues(), val, shortname); -} - -void IFSelect_ParamEditor::AddConstantText - (const Standard_CString val, const Standard_CString shortname, - const Standard_CString longname) -{ - Handle(Interface_TypedValue) tv = new Interface_TypedValue - (longname[0] == '\0' ? shortname : longname); - tv->SetCStringValue (val); - SetNbValues (NbValues() + 1); - SetValue (NbValues(), tv, shortname, IFSelect_EditRead); -} - - -TCollection_AsciiString IFSelect_ParamEditor::Label () const - { return thelabel; } - -Standard_Boolean IFSelect_ParamEditor::Recognize - (const Handle(IFSelect_EditForm)& /*form*/) const - { return Standard_True; } // pas de contrainte - -Handle(TCollection_HAsciiString) IFSelect_ParamEditor::StringValue - (const Handle(IFSelect_EditForm)& /*form*/,const Standard_Integer num) const - { return TypedValue(num)->HStringValue(); } - - -Standard_Boolean IFSelect_ParamEditor::Load - (const Handle(IFSelect_EditForm)& form, - const Handle(Standard_Transient)& /*ent*/, - const Handle(Interface_InterfaceModel)& /*model*/) const -{ - Standard_Integer i, nb = NbValues(); - for (i = 1; i <= nb; i ++) form->LoadValue (i,TypedValue(i)->HStringValue()); - - return Standard_True; -} - - -Standard_Boolean IFSelect_ParamEditor::Apply - (const Handle(IFSelect_EditForm)& form, - const Handle(Standard_Transient)& /*ent*/, - const Handle(Interface_InterfaceModel)& /*model*/) const -{ - Standard_Integer i, nb = NbValues(); - for (i = 1; i <= nb; i ++) - if (form->IsModified(i)) - TypedValue (i)->SetHStringValue (form->EditedValue(i)); - - return Standard_True; -} - -Handle(IFSelect_ParamEditor) IFSelect_ParamEditor::StaticEditor - (const Handle(TColStd_HSequenceOfHAsciiString)& list, - const Standard_CString label) -{ - Handle(IFSelect_ParamEditor) editor; - if (list.IsNull()) return editor; - Standard_Integer i,nb = list->Length(); -// if (nb == 0) return editor; - editor = new IFSelect_ParamEditor (nb+10,label); - for (i = 1; i <= nb; i ++) { - Handle(Interface_Static) val = Interface_Static::Static - (list->Value(i)->ToCString()); - if (!val.IsNull()) editor->AddValue(val); - } - return editor; -} diff --git a/src/IFSelect/IFSelect_ParamEditor.hxx b/src/IFSelect/IFSelect_ParamEditor.hxx deleted file mode 100644 index c80c8cd152..0000000000 --- a/src/IFSelect/IFSelect_ParamEditor.hxx +++ /dev/null @@ -1,86 +0,0 @@ -// Created on: 1998-07-30 -// Created by: Christian CAILLET -// Copyright (c) 1998-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 _IFSelect_ParamEditor_HeaderFile -#define _IFSelect_ParamEditor_HeaderFile - -#include -#include - -#include -#include -#include -#include -class Interface_TypedValue; -class IFSelect_EditForm; -class TCollection_HAsciiString; -class Standard_Transient; -class Interface_InterfaceModel; - -class IFSelect_ParamEditor; -DEFINE_STANDARD_HANDLE(IFSelect_ParamEditor, IFSelect_Editor) - -//! A ParamEditor gives access for edition to a list of TypedValue -//! (i.e. of Static too) -//! Its definition is made of the TypedValue to edit themselves, -//! and can add some constants, which can then be displayed but -//! not changed (for instance, system name, processor version ...) -//! -//! I.E. it gives a way of editing or at least displaying -//! parameters as global -class IFSelect_ParamEditor : public IFSelect_Editor -{ - -public: - - //! Creates a ParamEditor, empty, with a maximum count of params - //! (default is 100) - //! And a label, by default it will be "Param Editor" - Standard_EXPORT IFSelect_ParamEditor(const Standard_Integer nbmax = 100, const Standard_CString label = ""); - - //! Adds a TypedValue - //! By default, its short name equates its complete name, it can be made explicit - Standard_EXPORT void AddValue (const Handle(Interface_TypedValue)& val, - const Standard_CString shortname = ""); - - //! Adds a Constant Text, it will be Read Only - //! By default, its long name equates its shortname - Standard_EXPORT void AddConstantText (const Standard_CString val, const Standard_CString shortname, const Standard_CString completename = ""); - - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - Standard_EXPORT Standard_Boolean Recognize (const Handle(IFSelect_EditForm)& form) const Standard_OVERRIDE; - - Standard_EXPORT Handle(TCollection_HAsciiString) StringValue (const Handle(IFSelect_EditForm)& form, const Standard_Integer num) const Standard_OVERRIDE; - - Standard_EXPORT Standard_Boolean Load (const Handle(IFSelect_EditForm)& form, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - Standard_EXPORT Standard_Boolean Apply (const Handle(IFSelect_EditForm)& form, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - //! Returns a ParamEditor to work on the Static Parameters of - //! which names are listed in - //! Null Handle if is null or empty - Standard_EXPORT static Handle(IFSelect_ParamEditor) StaticEditor (const Handle(TColStd_HSequenceOfHAsciiString)& list, const Standard_CString label = ""); - - DEFINE_STANDARD_RTTIEXT(IFSelect_ParamEditor,IFSelect_Editor) - -private: - - TCollection_AsciiString thelabel; - -}; - -#endif // _IFSelect_ParamEditor_HeaderFile diff --git a/src/IFSelect/IFSelect_PrintCount.hxx b/src/IFSelect/IFSelect_PrintCount.hxx deleted file mode 100644 index 573f6fd6fc..0000000000 --- a/src/IFSelect/IFSelect_PrintCount.hxx +++ /dev/null @@ -1,61 +0,0 @@ -// Created on: 1992-09-21 -// 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 _IFSelect_PrintCount_HeaderFile -#define _IFSelect_PrintCount_HeaderFile - - -//! Lets you choose the manner in which you want to analyze an -//! IGES or STEP file. Your analysis can be either message-oriented or -//! entity-oriented. The specific values are as follows: -//! - ItemsByEntity is a sequential list of all -//! messages per entity of the defined type -//! - CountByItem is the number of entities of the defined -//! type, with their rank number per message -//! - ShortByItem is the number of entities of the defined -//! type, with their types per message; displays the rank -//! numbers of the first five entities of the defined type -//! per message -//! - ListByItem is the number of entities of the defined type -//! per message and the numbers of the entities -//! - EntitiesByItem is the number of entities of the -//! defined type, with their types, rank numbers and -//! Directory Entry numbers per message -//! - GeneralInfo is general information on transfer such as: -//! - number of entities -//! - number of roots -//! - number of resulting Open CASCADE shapes -//! - number of warnings and failures -//! - CountSummary summary statistics for counters and signatures -//! - ResultCount information that contains the number of -//! roots in the IGES file and the number of resulting Open CASCADE shapes. -//! - Mapping of the IGES root entities to the resulting Open -//! CASCADE shape (including type and form of the IGES entity -//! and type of the resulting shape). -enum IFSelect_PrintCount -{ -IFSelect_ItemsByEntity, -IFSelect_CountByItem, -IFSelect_ShortByItem, -IFSelect_ListByItem, -IFSelect_EntitiesByItem, -IFSelect_CountSummary, -IFSelect_GeneralInfo, -IFSelect_Mapping, -IFSelect_ResultCount -}; - -#endif // _IFSelect_PrintCount_HeaderFile diff --git a/src/IFSelect/IFSelect_RemainMode.hxx b/src/IFSelect/IFSelect_RemainMode.hxx deleted file mode 100644 index 658cc57ec3..0000000000 --- a/src/IFSelect/IFSelect_RemainMode.hxx +++ /dev/null @@ -1,29 +0,0 @@ -// Created on: 1992-09-21 -// 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 _IFSelect_RemainMode_HeaderFile -#define _IFSelect_RemainMode_HeaderFile - - -enum IFSelect_RemainMode -{ -IFSelect_RemainForget, -IFSelect_RemainCompute, -IFSelect_RemainDisplay, -IFSelect_RemainUndo -}; - -#endif // _IFSelect_RemainMode_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectAnyList.cxx b/src/IFSelect/IFSelect_SelectAnyList.cxx deleted file mode 100644 index c9686867dd..0000000000 --- a/src/IFSelect/IFSelect_SelectAnyList.cxx +++ /dev/null @@ -1,111 +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 -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectAnyList,IFSelect_SelectDeduct) - -// .... Definition de liste : methodes "deferred" NbItems & FillResult -void IFSelect_SelectAnyList::SetRange - (const Handle(IFSelect_IntParam)& rankfrom, - const Handle(IFSelect_IntParam)& rankto) - { thelower = rankfrom; theupper = rankto; } - - void IFSelect_SelectAnyList::SetOne (const Handle(IFSelect_IntParam)& rank) - { thelower = theupper = rank; } - - void IFSelect_SelectAnyList::SetFrom - (const Handle(IFSelect_IntParam)& rankfrom) - { thelower = rankfrom; theupper.Nullify(); } - - void IFSelect_SelectAnyList::SetUntil - (const Handle(IFSelect_IntParam)& rankto) - { thelower.Nullify(); theupper = rankto; } - - Standard_Boolean IFSelect_SelectAnyList::HasLower () const - { return (!thelower.IsNull()); } - - Handle(IFSelect_IntParam) IFSelect_SelectAnyList::Lower () const - { return thelower; } - - Standard_Integer IFSelect_SelectAnyList::LowerValue () const -{ - if (thelower.IsNull()) return 0; - return thelower->Value(); -} - - Standard_Boolean IFSelect_SelectAnyList::HasUpper () const - { return (!theupper.IsNull()); } - - Handle(IFSelect_IntParam) IFSelect_SelectAnyList::Upper () const - { return theupper; } - - Standard_Integer IFSelect_SelectAnyList::UpperValue () const -{ - if (theupper.IsNull()) return 0; - return theupper->Value(); -} - -// On prend les sous-entites de lower a upper (inclus) - Interface_EntityIterator IFSelect_SelectAnyList::RootResult - (const Interface_Graph& G) const -{ - Interface_EntityIterator input = InputResult(G); - KeepInputEntity (input); // selon type voulu - if (input.NbEntities() > 1) throw Interface_InterfaceError("SelectAnyList : more than ONE Entity in input"); - if (input.NbEntities() == 0) return input; - - Handle(Standard_Transient) ent; - for (input.Start(); input.More(); input.Next()) ent = input.Value(); - - Standard_Integer rankmax = NbItems(ent); - Standard_Integer rankfrom = 1; - if (!thelower.IsNull()) rankfrom = thelower->Value(); - Standard_Integer rankto; - if (!theupper.IsNull()) rankto = theupper->Value(); - else rankto = rankmax; - if (rankfrom < 1) rankfrom = 1; - if (rankto > rankmax) rankto = rankmax; - - Interface_EntityIterator iter; - if (rankfrom <= rankto) FillResult(rankfrom,rankto,ent,iter); - return iter; -} - - - TCollection_AsciiString IFSelect_SelectAnyList::Label () const -{ - char lab[30]; - Standard_Integer rankfrom = 0; - if (HasLower()) rankfrom = LowerValue(); - Standard_Integer rankto = 0; - if (HasUpper()) rankto = UpperValue(); - if (rankfrom == rankto) sprintf(lab," (no %d)",rankfrom); - else if (rankfrom == 0) sprintf(lab," (-> %d)",rankfrom); - else if (rankto == 0) sprintf(lab," (%d ->)",rankto); - else sprintf(lab," (%d -> %d)",rankfrom,rankto); - - TCollection_AsciiString labl("In List "); - labl.AssignCat(ListLabel()); - labl.AssignCat(lab); - return labl; -} diff --git a/src/IFSelect/IFSelect_SelectAnyList.hxx b/src/IFSelect/IFSelect_SelectAnyList.hxx deleted file mode 100644 index c47868da70..0000000000 --- a/src/IFSelect/IFSelect_SelectAnyList.hxx +++ /dev/null @@ -1,153 +0,0 @@ -// Created on: 1992-12-09 -// 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 _IFSelect_SelectAnyList_HeaderFile -#define _IFSelect_SelectAnyList_HeaderFile - -#include -#include - -#include -#include -class IFSelect_IntParam; -class Interface_EntityIterator; -class Standard_Transient; -class Interface_Graph; -class TCollection_AsciiString; - - -class IFSelect_SelectAnyList; -DEFINE_STANDARD_HANDLE(IFSelect_SelectAnyList, IFSelect_SelectDeduct) - -//! A SelectAnyList kind Selection selects a List of an Entity, as -//! well as this Entity contains some. A List contains sub-entities -//! as one per Item, or several (for instance if an Entity binds -//! couples of sub-entities, each item is one of these couples). -//! Remark that only Entities are taken into account (neither -//! Reals, nor Strings, etc...) -//! -//! To define the list on which to work, SelectAnyList has two -//! deferred methods : NbItems (which gives the length of the -//! list), FillResult (which fills an EntityIterator). They are -//! intended to get a List in an Entity of the required Type (and -//! consider that list is empty if Entity has not required Type) -//! -//! In addition, remark that some types of Entity define more than -//! one list in each instance : a given sub-class of SelectAnyList -//! must be attached to one list -//! -//! SelectAnyList keeps or rejects a sub-set of the list, -//! that is the Items of which rank in the list is in a given -//! range (for instance form 2nd to 6th, etc...) -//! Range is defined by two Integer values. In order to allow -//! external control of them, these values are not directly -//! defined as fields, but accessed through IntParams, that is, -//! referenced as Transient (Handle) objects -//! -//! Warning : the Input can be any kind of Selection, BUT its -//! RootResult must have zero (empty) or one Entity maximum -class IFSelect_SelectAnyList : public IFSelect_SelectDeduct -{ - -public: - - - //! Keeps Input Entity, as having required type. It works by - //! keeping in , only suitable Entities (SelectType can be - //! used). Called by RootResult (which waits for ONE ENTITY MAX) - Standard_EXPORT virtual void KeepInputEntity (Interface_EntityIterator& iter) const = 0; - - //! Returns count of Items in the list in the Entity - //! If has not required type, returned value must be Zero - Standard_EXPORT virtual Standard_Integer NbItems (const Handle(Standard_Transient)& ent) const = 0; - - //! Sets a Range for numbers, with a lower and a upper limits - Standard_EXPORT void SetRange (const Handle(IFSelect_IntParam)& rankfrom, const Handle(IFSelect_IntParam)& rankto); - - //! Sets a unique number (only one Entity will be sorted as True) - Standard_EXPORT void SetOne (const Handle(IFSelect_IntParam)& rank); - - //! Sets a Lower limit but no upper limit - Standard_EXPORT void SetFrom (const Handle(IFSelect_IntParam)& rankfrom); - - //! Sets an Upper limit but no lower limit (equivalent to lower 1) - Standard_EXPORT void SetUntil (const Handle(IFSelect_IntParam)& rankto); - - //! Returns True if a Lower limit is defined - Standard_EXPORT Standard_Boolean HasLower() const; - - //! Returns Lower limit (if there is; else, value is senseless) - Standard_EXPORT Handle(IFSelect_IntParam) Lower() const; - - //! Returns Integer Value of Lower Limit (0 if none) - Standard_EXPORT Standard_Integer LowerValue() const; - - //! Returns True if a Lower limit is defined - Standard_EXPORT Standard_Boolean HasUpper() const; - - //! Returns Upper limit (if there is; else, value is senseless) - Standard_EXPORT Handle(IFSelect_IntParam) Upper() const; - - //! Returns Integer Value of Upper Limit (0 if none) - Standard_EXPORT Standard_Integer UpperValue() const; - - //! Returns the list of selected entities (list of entities - //! complying with rank criterium) - //! Error if the input list has more than one Item - Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Puts into , the sub-entities of the list, from n1 to - //! n2 included. Remark that adequation with Entity's type and - //! length of list has already been made at this stage - //! Called by RootResult - Standard_EXPORT virtual void FillResult (const Standard_Integer n1, const Standard_Integer n2, const Handle(Standard_Transient)& ent, Interface_EntityIterator& res) const = 0; - - //! Returns a text defining the criterium : "Components of List " - //! then Specific List Label, then, following cases : - //! " From .. Until .." or "From .." or "Until .." or "Rank no .." - //! Specific type is given by deferred method ListLabel - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - //! Returns the specific label for the list, which is included as - //! a part of Label - Standard_EXPORT virtual TCollection_AsciiString ListLabel() const = 0; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectAnyList,IFSelect_SelectDeduct) - -protected: - - - - -private: - - - Handle(IFSelect_IntParam) thelower; - Handle(IFSelect_IntParam) theupper; - - -}; - - - - - - - -#endif // _IFSelect_SelectAnyList_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectAnyType.cxx b/src/IFSelect/IFSelect_SelectAnyType.cxx deleted file mode 100644 index be63842af2..0000000000 --- a/src/IFSelect/IFSelect_SelectAnyType.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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectAnyType,IFSelect_SelectExtract) - -Standard_Boolean IFSelect_SelectAnyType::Sort - (const Standard_Integer , const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& ) const - { return ent->IsKind(TypeForMatch()); } diff --git a/src/IFSelect/IFSelect_SelectAnyType.hxx b/src/IFSelect/IFSelect_SelectAnyType.hxx deleted file mode 100644 index 28eb5ee658..0000000000 --- a/src/IFSelect/IFSelect_SelectAnyType.hxx +++ /dev/null @@ -1,52 +0,0 @@ -// Created on: 1992-11-18 -// 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 _IFSelect_SelectAnyType_HeaderFile -#define _IFSelect_SelectAnyType_HeaderFile - -#include -#include - -#include -#include -#include -class Standard_Transient; -class Interface_InterfaceModel; - -class IFSelect_SelectAnyType; -DEFINE_STANDARD_HANDLE(IFSelect_SelectAnyType, IFSelect_SelectExtract) - -//! A SelectAnyType sorts the Entities of which the Type is Kind -//! of a given Type : this Type for Match is specific of each -//! class of SelectAnyType -class IFSelect_SelectAnyType : public IFSelect_SelectExtract -{ - -public: - - //! Returns the Type which has to be matched for select - Standard_EXPORT virtual Handle(Standard_Type) TypeForMatch() const = 0; - - //! Returns True for an Entity (model->Value(num)) which is kind - //! of the chosen type, given by the method TypeForMatch. - //! Criterium is IsKind. - Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectAnyType,IFSelect_SelectExtract) - -}; - -#endif // _IFSelect_SelectAnyType_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectBase.cxx b/src/IFSelect/IFSelect_SelectBase.cxx deleted file mode 100644 index 6b15b09c89..0000000000 --- a/src/IFSelect/IFSelect_SelectBase.cxx +++ /dev/null @@ -1,23 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectBase,IFSelect_Selection) - -void IFSelect_SelectBase::FillIterator - (IFSelect_SelectionIterator& ) const - { } // rien a faire, une SelectBase ne depend d aucune autre Selection diff --git a/src/IFSelect/IFSelect_SelectBase.hxx b/src/IFSelect/IFSelect_SelectBase.hxx deleted file mode 100644 index 841e43d17f..0000000000 --- a/src/IFSelect/IFSelect_SelectBase.hxx +++ /dev/null @@ -1,65 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_SelectBase_HeaderFile -#define _IFSelect_SelectBase_HeaderFile - -#include -#include - -#include -class IFSelect_SelectionIterator; - - -class IFSelect_SelectBase; -DEFINE_STANDARD_HANDLE(IFSelect_SelectBase, IFSelect_Selection) - -//! SelectBase works directly from an InterfaceModel : it is the -//! first base for other Selections. -class IFSelect_SelectBase : public IFSelect_Selection -{ - -public: - - - //! Puts in an Iterator the Selections from which "me" depends - //! This list is empty for all SelectBase type Selections - Standard_EXPORT void FillIterator (IFSelect_SelectionIterator& iter) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectBase,IFSelect_Selection) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SelectBase_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectCombine.cxx b/src/IFSelect/IFSelect_SelectCombine.cxx deleted file mode 100644 index f72253bfd2..0000000000 --- a/src/IFSelect/IFSelect_SelectCombine.cxx +++ /dev/null @@ -1,68 +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(IFSelect_SelectCombine,IFSelect_Selection) - -IFSelect_SelectCombine::IFSelect_SelectCombine () { } -// { thelist = new IFSelect_SequenceOfSelection(); } - - Standard_Integer IFSelect_SelectCombine::NbInputs () const - { return thelist.Length(); } - - Handle(IFSelect_Selection) IFSelect_SelectCombine::Input - (const Standard_Integer num) const - { return thelist.Value(num); } - - Standard_Integer IFSelect_SelectCombine::InputRank - (const Handle(IFSelect_Selection)& sel) const -{ - if (sel.IsNull()) return 0; - Standard_Integer i, nb = thelist.Length(); - for (i = 1; i <= nb; i ++) - if (sel == thelist.Value(i)) return i; - return 0; -} - - void IFSelect_SelectCombine::Add - (const Handle(IFSelect_Selection)& sel, const Standard_Integer atnum) -{ - if (atnum <= 0 || atnum > thelist.Length()) thelist.Append(sel); - else thelist.InsertBefore(atnum,sel); -} - - Standard_Boolean IFSelect_SelectCombine::Remove - (const Handle(IFSelect_Selection)& sel) - { return Remove (InputRank(sel)); } - - Standard_Boolean IFSelect_SelectCombine::Remove - (const Standard_Integer num) -{ - if (num <= 0 || num > thelist.Length()) return Standard_False; - thelist.Remove(num); - return Standard_True; -} - - - Standard_Boolean IFSelect_SelectCombine::HasUniqueResult () const - { return Standard_True; } - - void IFSelect_SelectCombine::FillIterator - (IFSelect_SelectionIterator& iter) const - { iter.AddList(thelist); } diff --git a/src/IFSelect/IFSelect_SelectCombine.hxx b/src/IFSelect/IFSelect_SelectCombine.hxx deleted file mode 100644 index b6c2031f06..0000000000 --- a/src/IFSelect/IFSelect_SelectCombine.hxx +++ /dev/null @@ -1,103 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_SelectCombine_HeaderFile -#define _IFSelect_SelectCombine_HeaderFile - -#include -#include - -#include -#include -#include -class IFSelect_SelectionIterator; - - -class IFSelect_SelectCombine; -DEFINE_STANDARD_HANDLE(IFSelect_SelectCombine, IFSelect_Selection) - -//! A SelectCombine type Selection defines algebraic operations -//! between results of several Selections -//! It is a deferred class : sub-classes will have to define -//! precise what operator is to be applied -class IFSelect_SelectCombine : public IFSelect_Selection -{ - -public: - - - //! Returns the count of Input Selections - Standard_EXPORT Standard_Integer NbInputs() const; - - //! Returns an Input Selection, given its rank in the list - Standard_EXPORT Handle(IFSelect_Selection) Input (const Standard_Integer num) const; - - //! Returns the rank of an input Selection, 0 if not in the list. - //! Most generally, its value is meaningless, except for testing - //! the presence of an input Selection : - //! - == 0 if is not an input for - //! - > 0 if is an input for - Standard_EXPORT Standard_Integer InputRank (const Handle(IFSelect_Selection)& sel) const; - - //! Adds a Selection to the filling list - //! By default, adds it to the end of the list - //! A Positive rank less then NbInputs gives an insertion rank - //! (InsertBefore : the new th item of the list is ) - Standard_EXPORT void Add (const Handle(IFSelect_Selection)& sel, const Standard_Integer atnum = 0); - - //! Removes an input Selection. - //! Returns True if Done, False, if is not an input for - Standard_EXPORT Standard_Boolean Remove (const Handle(IFSelect_Selection)& sel); - - //! Removes an input Selection, given its rank in the list - //! Returns True if Done, False if is out of range - Standard_EXPORT Standard_Boolean Remove (const Standard_Integer num); - - //! Puts in an Iterator the Selections from which "me" depends - //! That is to say, the list of Input Selections - Standard_EXPORT void FillIterator (IFSelect_SelectionIterator& iter) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectCombine,IFSelect_Selection) - -protected: - - - //! Defines an empty SelectCombine - Standard_EXPORT IFSelect_SelectCombine(); - - //! Returns always True, because RootResult gives a Unique list - Standard_EXPORT virtual Standard_Boolean HasUniqueResult() const Standard_OVERRIDE; - - - -private: - - - IFSelect_TSeqOfSelection thelist; - - -}; - - - - - - - -#endif // _IFSelect_SelectCombine_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectControl.cxx b/src/IFSelect/IFSelect_SelectControl.cxx deleted file mode 100644 index e9239cdf1e..0000000000 --- a/src/IFSelect/IFSelect_SelectControl.cxx +++ /dev/null @@ -1,45 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectControl,IFSelect_Selection) - -Handle(IFSelect_Selection) IFSelect_SelectControl::MainInput () const - { return themain; } - - Handle(IFSelect_Selection) IFSelect_SelectControl::SecondInput () const - { return thesecond; } - - Standard_Boolean IFSelect_SelectControl::HasSecondInput () const - { return (!thesecond.IsNull()); } - - void IFSelect_SelectControl::SetMainInput - (const Handle(IFSelect_Selection)& sel) - { themain = sel; } - - void IFSelect_SelectControl::SetSecondInput - (const Handle(IFSelect_Selection)& sel) - { thesecond = sel; } - - - void IFSelect_SelectControl::FillIterator - (IFSelect_SelectionIterator& iter) const -{ - iter.AddItem(themain); - if (!thesecond.IsNull()) iter.AddItem(thesecond); -} diff --git a/src/IFSelect/IFSelect_SelectControl.hxx b/src/IFSelect/IFSelect_SelectControl.hxx deleted file mode 100644 index 3951bda112..0000000000 --- a/src/IFSelect/IFSelect_SelectControl.hxx +++ /dev/null @@ -1,95 +0,0 @@ -// Created on: 1994-02-16 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_SelectControl_HeaderFile -#define _IFSelect_SelectControl_HeaderFile - -#include -#include - -#include -class IFSelect_SelectionIterator; - - -class IFSelect_SelectControl; -DEFINE_STANDARD_HANDLE(IFSelect_SelectControl, IFSelect_Selection) - -//! A SelectControl kind Selection works with two input Selections -//! in a dissymmetric way : the Main Input which gives an input -//! list of Entities, to be processed, and the Second Input which -//! gives another list, to be used to filter the main input. -//! -//! e.g. : SelectDiff retains the items of the Main Input which -//! are not in the Control Input (which acts as Diff Input) -//! or a specific selection which retains Entities from the Main -//! Input if and only if they are concerned by an entity from -//! the Control Input (such as Views in IGES, etc...) -//! -//! The way RootResult and Label are produced are at charge of -//! each sub-class -class IFSelect_SelectControl : public IFSelect_Selection -{ - -public: - - - //! Returns the Main Input Selection - Standard_EXPORT Handle(IFSelect_Selection) MainInput() const; - - //! Returns True if a Control Input is defined - //! Thus, Result can be computed differently if there is a - //! Control Input or if there is none - Standard_EXPORT Standard_Boolean HasSecondInput() const; - - //! Returns the Control Input Selection, or a Null Handle - Standard_EXPORT Handle(IFSelect_Selection) SecondInput() const; - - //! Sets a Selection to be the Main Input - Standard_EXPORT void SetMainInput (const Handle(IFSelect_Selection)& sel); - - //! Sets a Selection to be the Control Input - Standard_EXPORT void SetSecondInput (const Handle(IFSelect_Selection)& sel); - - //! Puts in an Iterator the Selections from which "me" depends - //! That is to say, the list of Input Selections - Standard_EXPORT void FillIterator (IFSelect_SelectionIterator& iter) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectControl,IFSelect_Selection) - -protected: - - - - -private: - - - Handle(IFSelect_Selection) themain; - Handle(IFSelect_Selection) thesecond; - - -}; - - - - - - - -#endif // _IFSelect_SelectControl_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectDeduct.cxx b/src/IFSelect/IFSelect_SelectDeduct.cxx deleted file mode 100644 index 62701357f6..0000000000 --- a/src/IFSelect/IFSelect_SelectDeduct.cxx +++ /dev/null @@ -1,61 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectDeduct,IFSelect_Selection) - -void IFSelect_SelectDeduct::SetInput (const Handle(IFSelect_Selection)& sel) - { thesel = sel; } - - Handle(IFSelect_Selection) IFSelect_SelectDeduct::Input () const - { return thesel; } - - Standard_Boolean IFSelect_SelectDeduct::HasInput () const - { return (!thesel.IsNull()); } - - Standard_Boolean IFSelect_SelectDeduct::HasAlternate () const -{ if (!thealt.IsNull()) return thealt->IsSet(); return Standard_False; } - - Handle(IFSelect_SelectPointed)& IFSelect_SelectDeduct::Alternate () -{ - if (thealt.IsNull()) thealt = new IFSelect_SelectPointed; - return thealt; -} - - - Interface_EntityIterator IFSelect_SelectDeduct::InputResult - (const Interface_Graph& G) const -{ - Interface_EntityIterator res; - if (!thealt.IsNull()) { - if (thealt->IsSet()) { - res = thealt->UniqueResult (G); - thealt->Clear(); - return res; - } - } - if (thesel.IsNull()) return res; - return thesel->UniqueResult(G); -} - - void IFSelect_SelectDeduct::FillIterator - (IFSelect_SelectionIterator& iter) const - { iter.AddItem(thesel); } diff --git a/src/IFSelect/IFSelect_SelectDeduct.hxx b/src/IFSelect/IFSelect_SelectDeduct.hxx deleted file mode 100644 index c23fe4c8f1..0000000000 --- a/src/IFSelect/IFSelect_SelectDeduct.hxx +++ /dev/null @@ -1,108 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_SelectDeduct_HeaderFile -#define _IFSelect_SelectDeduct_HeaderFile - -#include -#include - -#include -class IFSelect_SelectPointed; -class Interface_EntityIterator; -class Interface_Graph; -class IFSelect_SelectionIterator; - - -class IFSelect_SelectDeduct; -DEFINE_STANDARD_HANDLE(IFSelect_SelectDeduct, IFSelect_Selection) - -//! A SelectDeduct determines a list of Entities from an Input -//! Selection, by a computation : Output list is not obliged to be -//! a sub-list of Input list -//! (for more specific, see SelectExtract for filtered sub-lists, -//! and SelectExplore for recurcive exploration) -//! -//! A SelectDeduct may use an alternate input for one shot -//! This allows to use an already existing definition, by -//! overloading the input selection by an alternate list, -//! already defined, for one use : -//! If this alternate list is set, InputResult queries it instead -//! of calling the input selection, then clears it immediately -class IFSelect_SelectDeduct : public IFSelect_Selection -{ - -public: - - - //! Defines or Changes the Input Selection - Standard_EXPORT void SetInput (const Handle(IFSelect_Selection)& sel); - - //! Returns the Input Selection - Standard_EXPORT Handle(IFSelect_Selection) Input() const; - - //! Returns True if the Input Selection is defined, False else - Standard_EXPORT Standard_Boolean HasInput() const; - - //! Tells if an Alternate List has been set, i.e. : the Alternate - //! Definition is present and set - Standard_EXPORT Standard_Boolean HasAlternate() const; - - //! Returns the Alternate Definition - //! It is returned modifiable, hence an already defined - //! SelectPointed can be used - //! But if it was not yet defined, it is created the first time - //! - //! It is exploited by InputResult - Standard_EXPORT Handle(IFSelect_SelectPointed)& Alternate(); - - //! Returns the Result determined by Input Selection, as Unique - //! if Input Selection is not defined, returns an empty list. - //! - //! If Alternate is set, InputResult takes its definition instead - //! of calling the Input Selection, then clears it - Standard_EXPORT Interface_EntityIterator InputResult (const Interface_Graph& G) const; - - //! Puts in an Iterator the Selections from which "me" depends - //! This list contains one Selection : the InputSelection - Standard_EXPORT void FillIterator (IFSelect_SelectionIterator& iter) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectDeduct,IFSelect_Selection) - -protected: - - - - -private: - - - Handle(IFSelect_Selection) thesel; - Handle(IFSelect_SelectPointed) thealt; - - -}; - - - - - - - -#endif // _IFSelect_SelectDeduct_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectDiff.cxx b/src/IFSelect/IFSelect_SelectDiff.cxx deleted file mode 100644 index 4c23ec358f..0000000000 --- a/src/IFSelect/IFSelect_SelectDiff.cxx +++ /dev/null @@ -1,41 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectDiff,IFSelect_SelectControl) - -IFSelect_SelectDiff::IFSelect_SelectDiff () { } - - - Interface_EntityIterator IFSelect_SelectDiff::RootResult - (const Interface_Graph& G) const -{ - IFGraph_Compare GC(G); - GC.GetFromIter(MainInput()->RootResult(G),Standard_True); // first - if (HasSecondInput()) - GC.GetFromIter(SecondInput()->RootResult(G),Standard_False); // second - return GC.FirstOnly(); -} - - Standard_Boolean IFSelect_SelectDiff::HasUniqueResult () const - { return Standard_True; } // naturellement unique - - TCollection_AsciiString IFSelect_SelectDiff::Label () const - { return TCollection_AsciiString("Differences"); } diff --git a/src/IFSelect/IFSelect_SelectDiff.hxx b/src/IFSelect/IFSelect_SelectDiff.hxx deleted file mode 100644 index 5c9e610c85..0000000000 --- a/src/IFSelect/IFSelect_SelectDiff.hxx +++ /dev/null @@ -1,76 +0,0 @@ -// Created on: 1992-11-18 -// 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 _IFSelect_SelectDiff_HeaderFile -#define _IFSelect_SelectDiff_HeaderFile - -#include -#include - -#include -class Interface_EntityIterator; -class Interface_Graph; -class TCollection_AsciiString; - - -class IFSelect_SelectDiff; -DEFINE_STANDARD_HANDLE(IFSelect_SelectDiff, IFSelect_SelectControl) - -//! A SelectDiff keeps the entities from a Selection, the Main -//! Input, which are not listed by the Second Input -class IFSelect_SelectDiff : public IFSelect_SelectControl -{ - -public: - - - //! Creates an empty SelectDiff - Standard_EXPORT IFSelect_SelectDiff(); - - //! Returns the list of selected entities : they are the Entities - //! gotten from the Main Input but not from the Diff Input - Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : "Difference" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectDiff,IFSelect_SelectControl) - -protected: - - - //! Returns always True, because RootResult gives a Unique list - Standard_EXPORT virtual Standard_Boolean HasUniqueResult() const Standard_OVERRIDE; - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SelectDiff_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectEntityNumber.cxx b/src/IFSelect/IFSelect_SelectEntityNumber.cxx deleted file mode 100644 index 989872734d..0000000000 --- a/src/IFSelect/IFSelect_SelectEntityNumber.cxx +++ /dev/null @@ -1,52 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectEntityNumber,IFSelect_SelectBase) - -IFSelect_SelectEntityNumber::IFSelect_SelectEntityNumber () { } - - void IFSelect_SelectEntityNumber::SetNumber - (const Handle(IFSelect_IntParam)& num) - { thenum = num; } - - Handle(IFSelect_IntParam) IFSelect_SelectEntityNumber::Number () const - { return thenum; } - - Interface_EntityIterator IFSelect_SelectEntityNumber::RootResult - (const Interface_Graph& G) const -{ - Interface_EntityIterator iter; - Standard_Integer num = 0; - if (!thenum.IsNull()) num = thenum->Value(); - if (num < 1) return iter; // vide si num < 1 ou num > NbEntities - if (num <= G.Size()) iter.GetOneItem(G.Entity(num)); - return iter; -} - - TCollection_AsciiString IFSelect_SelectEntityNumber::Label () const -{ - Standard_Integer num = 0; - if (!thenum.IsNull()) num = thenum->Value(); - TCollection_AsciiString labl(num); - labl.InsertBefore (1,"Entity Number "); - return labl; -} diff --git a/src/IFSelect/IFSelect_SelectEntityNumber.hxx b/src/IFSelect/IFSelect_SelectEntityNumber.hxx deleted file mode 100644 index f594f9d989..0000000000 --- a/src/IFSelect/IFSelect_SelectEntityNumber.hxx +++ /dev/null @@ -1,66 +0,0 @@ -// Created on: 1992-11-18 -// 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 _IFSelect_SelectEntityNumber_HeaderFile -#define _IFSelect_SelectEntityNumber_HeaderFile - -#include -#include - -#include -class IFSelect_IntParam; -class Interface_EntityIterator; -class Interface_Graph; -class TCollection_AsciiString; - -class IFSelect_SelectEntityNumber; -DEFINE_STANDARD_HANDLE(IFSelect_SelectEntityNumber, IFSelect_SelectBase) - -//! A SelectEntityNumber gets in an InterfaceModel (through a -//! Graph), the Entity which has a specified Number (its rank of -//! adding into the Model) : there can be zero (if none) or one. -//! The Number is not directly defined as an Integer, but as a -//! Parameter, which can be externally controlled -class IFSelect_SelectEntityNumber : public IFSelect_SelectBase -{ - -public: - - //! Creates a SelectEntityNumber, initially with no specified Number - Standard_EXPORT IFSelect_SelectEntityNumber(); - - //! Sets Entity Number to be taken (initially, none is set : 0) - Standard_EXPORT void SetNumber (const Handle(IFSelect_IntParam)& num); - - //! Returns specified Number (as a Parameter) - Standard_EXPORT Handle(IFSelect_IntParam) Number() const; - - //! Returns the list of selected entities : the Entity having the - //! specified Number (this result assures naturally uniqueness) - Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : "Entity Number ..." - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectEntityNumber,IFSelect_SelectBase) - -private: - - Handle(IFSelect_IntParam) thenum; - -}; - -#endif // _IFSelect_SelectEntityNumber_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectErrorEntities.cxx b/src/IFSelect/IFSelect_SelectErrorEntities.cxx deleted file mode 100644 index 50b5ab202d..0000000000 --- a/src/IFSelect/IFSelect_SelectErrorEntities.cxx +++ /dev/null @@ -1,32 +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(IFSelect_SelectErrorEntities,IFSelect_SelectExtract) - -IFSelect_SelectErrorEntities::IFSelect_SelectErrorEntities () { } - - Standard_Boolean IFSelect_SelectErrorEntities::Sort - (const Standard_Integer , const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model) const -//.. ne peut pas marcher, il faut aussi le modele ! ex. via le graphe ... - { return model->IsErrorEntity (model->Number(ent)); } - - TCollection_AsciiString IFSelect_SelectErrorEntities::ExtractLabel () const - { return TCollection_AsciiString("Error Entities"); } diff --git a/src/IFSelect/IFSelect_SelectErrorEntities.hxx b/src/IFSelect/IFSelect_SelectErrorEntities.hxx deleted file mode 100644 index 7614310097..0000000000 --- a/src/IFSelect/IFSelect_SelectErrorEntities.hxx +++ /dev/null @@ -1,77 +0,0 @@ -// Created on: 1992-11-18 -// 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 _IFSelect_SelectErrorEntities_HeaderFile -#define _IFSelect_SelectErrorEntities_HeaderFile - -#include -#include - -#include -#include -class Standard_Transient; -class Interface_InterfaceModel; -class TCollection_AsciiString; - - -class IFSelect_SelectErrorEntities; -DEFINE_STANDARD_HANDLE(IFSelect_SelectErrorEntities, IFSelect_SelectExtract) - -//! A SelectErrorEntities sorts the Entities which are qualified -//! as "Error" (their Type has not been recognized) during reading -//! a File. This does not concern Entities which are syntactically -//! correct, but with incorrect data (for integrity constraints). -class IFSelect_SelectErrorEntities : public IFSelect_SelectExtract -{ - -public: - - - //! Creates a SelectErrorEntities - Standard_EXPORT IFSelect_SelectErrorEntities(); - - //! Returns True for an Entity which is qualified as "Error", i.e. - //! if explicitly knows (through its Number) as - //! Erroneous - Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : "Error Entities" - Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectErrorEntities,IFSelect_SelectExtract) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SelectErrorEntities_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectExplore.cxx b/src/IFSelect/IFSelect_SelectExplore.cxx deleted file mode 100644 index 477780bdbd..0000000000 --- a/src/IFSelect/IFSelect_SelectExplore.cxx +++ /dev/null @@ -1,103 +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 -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectExplore,IFSelect_SelectDeduct) - -IFSelect_SelectExplore::IFSelect_SelectExplore (const Standard_Integer level) -: thelevel (level) { } - - - Standard_Integer IFSelect_SelectExplore::Level () const - { return thelevel; } - - - Interface_EntityIterator IFSelect_SelectExplore::RootResult - (const Interface_Graph& G) const -{ -// Attention, voila comme on procede -// On a une IndexedMapOfTransient en entree (entites deja traitees/a traiter) -// Elle est initialisee par InputResult -// Et une map en sortie (resultats pris) -> le resultat sera unique -// En entree, un curseur d entite courante -// Pour chaque entite, on appelle Explore. 3 cas possibles : -// retour False, on passe -// retour True et liste vide, on prend cette entite sans aller plus loin -// retour True et liste non vide, on ne prend pas cette entite mais on -// considere son resultat. -// Si dernier niveau, on le prend en entier. Sinon, il alimente l entree - - Standard_Integer nb = G.Size(); - TColStd_IndexedMapOfTransient entrees (nb); - TColStd_IndexedMapOfTransient result (nb); -// Initialisation - Standard_Integer i, j, level = 1, ilev = 0; - Interface_EntityIterator input; input = InputResult(G); - for (input.Start(); input.More(); input.Next()) - i = entrees.Add (input.Value()); - ilev = entrees.Extent(); - -// Exploration - for (i = 1; i <= nb; i ++) { - if (i > entrees.Extent()) break; - if (i > ilev) { - level ++; - if (level > thelevel && thelevel > 0) break; - ilev = entrees.Extent(); - } - Handle(Standard_Transient) ent = entrees.FindKey(i); - if (ent.IsNull()) continue; - Interface_EntityIterator exp; - if (!Explore (level,ent,G,exp)) continue; - -// On prend en compte : entite a prendre directement ? -// reprendre liste en entree (niveau pas atteint) ou resultat (niveau atteint) - if (exp.NbEntities() == 0) { - j = result.Add (ent); - continue; - } else if (level == thelevel) { - for (exp.Start(); exp.More(); exp.Next()) j = result.Add (exp.Value()); - } else { - for (exp.Start(); exp.More(); exp.Next()) j = entrees.Add (exp.Value()); - } - } - -// On recolte le resultat - Interface_EntityIterator res; - nb = result.Extent(); - for (j = 1; j <= nb; j ++) res.AddItem (result.FindKey(j)); - return res; -} - - - TCollection_AsciiString IFSelect_SelectExplore::Label () const -{ - TCollection_AsciiString labl; - if (thelevel == 0) labl.AssignCat("(Recursive)"); - else if (thelevel > 0) { - char lab[30]; - sprintf (lab,"(Level %d)",thelevel); - labl.AssignCat(lab); - } - labl.AssignCat(ExploreLabel()); - return labl; -} diff --git a/src/IFSelect/IFSelect_SelectExplore.hxx b/src/IFSelect/IFSelect_SelectExplore.hxx deleted file mode 100644 index d0ad35944f..0000000000 --- a/src/IFSelect/IFSelect_SelectExplore.hxx +++ /dev/null @@ -1,115 +0,0 @@ -// Created on: 1996-09-25 -// Created by: Christian CAILLET -// Copyright (c) 1996-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 _IFSelect_SelectExplore_HeaderFile -#define _IFSelect_SelectExplore_HeaderFile - -#include -#include - -#include -#include -class Interface_EntityIterator; -class Interface_Graph; -class Standard_Transient; -class TCollection_AsciiString; - - -class IFSelect_SelectExplore; -DEFINE_STANDARD_HANDLE(IFSelect_SelectExplore, IFSelect_SelectDeduct) - -//! A SelectExplore determines from an input list of Entities, -//! a list obtained by a way of exploration. This implies the -//! possibility of recursive exploration : the output list is -//! itself reused as input, etc... -//! Examples : Shared Entities, can be considered at one level -//! (immediate shared) or more, or max level -//! -//! Then, for each input entity, if it is not rejected, it can be -//! either taken itself, or explored : it then produces a list. -//! According to a level, either the produced lists or taken -//! entities give the result (level one), or lists are themselves -//! considered and for each item, is it taken or explored. -//! -//! Remark that rejection is just a safety : normally, an input -//! entity is, either taken itself, or explored -//! A maximum level can be specified. Else, the process continues -//! until all entities have been either taken or rejected -class IFSelect_SelectExplore : public IFSelect_SelectDeduct -{ - -public: - - - //! Returns the required exploring level - Standard_EXPORT Standard_Integer Level() const; - - //! Returns the list of selected entities. Works by calling the - //! method Explore on each input entity : it can be rejected, - //! taken for output, or to explore. If the maximum level has not - //! yet been attained, or if no max level is specified, entities - //! to be explored are themselves used as if they were input - Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Analyses and, if required, Explores an entity, as follows : - //! The explored list starts as empty, it has to be filled by this - //! method. - //! If it returns False, is rejected for result (this is to - //! be used only as safety) - //! If it returns True and remains empty, is - //! taken itself for result, not explored - //! If it returns True and is not empty, the content - //! of this list is considered : - //! If maximum level is attained, it is taken for result - //! Else (or no max), each of its entity will be itself explored - Standard_EXPORT virtual Standard_Boolean Explore (const Standard_Integer level, const Handle(Standard_Transient)& ent, const Interface_Graph& G, Interface_EntityIterator& explored) const = 0; - - //! Returns a text saying "(Recursive)" or "(Level nn)" plus - //! specific criterium returned by ExploreLabel (see below) - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - //! Returns a text defining the way of exploration - Standard_EXPORT virtual TCollection_AsciiString ExploreLabel() const = 0; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectExplore,IFSelect_SelectDeduct) - -protected: - - - //! Initializes a SelectExplore : the level must be specified on - //! starting. 0 means all levels, 1 means level one only, etc... - Standard_EXPORT IFSelect_SelectExplore(const Standard_Integer level); - - - -private: - - - Standard_Integer thelevel; - - -}; - - - - - - - -#endif // _IFSelect_SelectExplore_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectExtract.cxx b/src/IFSelect/IFSelect_SelectExtract.cxx deleted file mode 100644 index 2985948be7..0000000000 --- a/src/IFSelect/IFSelect_SelectExtract.cxx +++ /dev/null @@ -1,64 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectExtract,IFSelect_SelectDeduct) - -IFSelect_SelectExtract::IFSelect_SelectExtract () - { thesort = Standard_True; } - - Standard_Boolean IFSelect_SelectExtract::IsDirect () const - { return thesort; } - - void IFSelect_SelectExtract::SetDirect (const Standard_Boolean direct) - { thesort = direct; } - - - Interface_EntityIterator IFSelect_SelectExtract::RootResult - (const Interface_Graph& G) const -{ - Interface_EntityIterator iter; - Interface_EntityIterator inputer = InputResult(G); // tient compte de tout - Handle(Interface_InterfaceModel) model = G.Model(); - Standard_Integer rank = 0; - for (inputer.Start(); inputer.More(); inputer.Next()) { - Handle(Standard_Transient) ent = inputer.Value(); - rank ++; - if (SortInGraph(rank,ent,G) == thesort) iter.GetOneItem(ent); - } - return iter; -} - - - Standard_Boolean IFSelect_SelectExtract::SortInGraph - (const Standard_Integer rank, const Handle(Standard_Transient)& ent, - const Interface_Graph& G) const - { return Sort (rank, ent, G.Model()); } - - - TCollection_AsciiString IFSelect_SelectExtract::Label () const -{ - TCollection_AsciiString labl; - if ( thesort) labl.AssignCat("Picked: "); - if (!thesort) labl.AssignCat("Removed: "); - labl.AssignCat(ExtractLabel()); - return labl; -} diff --git a/src/IFSelect/IFSelect_SelectExtract.hxx b/src/IFSelect/IFSelect_SelectExtract.hxx deleted file mode 100644 index 8da3cd95cf..0000000000 --- a/src/IFSelect/IFSelect_SelectExtract.hxx +++ /dev/null @@ -1,110 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_SelectExtract_HeaderFile -#define _IFSelect_SelectExtract_HeaderFile - -#include -#include - -#include -#include -class Interface_EntityIterator; -class Interface_Graph; -class Standard_Transient; -class Interface_InterfaceModel; -class TCollection_AsciiString; - - -class IFSelect_SelectExtract; -DEFINE_STANDARD_HANDLE(IFSelect_SelectExtract, IFSelect_SelectDeduct) - -//! A SelectExtract determines a list of Entities from an Input -//! Selection, as a sub-list of the Input Result -//! It works by applying a sort criterium on each Entity of the -//! Input. This criterium can be applied Direct to Pick Items -//! (default case) or Reverse to Remove Item -//! -//! Basic features (the unique Input) are inherited from SelectDeduct -class IFSelect_SelectExtract : public IFSelect_SelectDeduct -{ - -public: - - - //! Returns True if Sort criterium is Direct, False if Reverse - Standard_EXPORT Standard_Boolean IsDirect() const; - - //! Sets Sort criterium sense to a new value - //! (True : Direct , False : Reverse) - Standard_EXPORT void SetDirect (const Standard_Boolean direct); - - //! Returns the list of selected entities. Works by calling the - //! method Sort on each input Entity : the Entity is kept as - //! output if Sort returns the same value as Direct status - Standard_EXPORT virtual Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns True for an Entity if it satisfies the Sort criterium - //! It receives : - //! - , the rank of the Entity in the Iteration, - //! - , the Entity itself, and - //! - , the Starting Model - //! Hence, the Entity to check is "model->Value(num)" (but an - //! InterfaceModel allows other checks) - //! This method is specific to each class of SelectExtract - Standard_EXPORT virtual Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const = 0; - - //! Works as Sort but works on the Graph - //! Default directly calls Sort, but it can be redefined - //! If SortInGraph is redefined, Sort should be defined even if - //! not called (to avoid deferred methods in a final class) - Standard_EXPORT virtual Standard_Boolean SortInGraph (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Interface_Graph& G) const; - - //! Returns a text saying "Picked" or "Removed", plus the - //! specific criterium returned by ExtractLabel (see below) - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - //! Returns a text defining the criterium for extraction - Standard_EXPORT virtual TCollection_AsciiString ExtractLabel() const = 0; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectExtract,IFSelect_SelectDeduct) - -protected: - - - //! Initializes a SelectExtract : enforces the sort to be Direct - Standard_EXPORT IFSelect_SelectExtract(); - - - -private: - - - Standard_Boolean thesort; - - -}; - - - - - - - -#endif // _IFSelect_SelectExtract_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectFlag.cxx b/src/IFSelect/IFSelect_SelectFlag.cxx deleted file mode 100644 index 5dbab34c0a..0000000000 --- a/src/IFSelect/IFSelect_SelectFlag.cxx +++ /dev/null @@ -1,61 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectFlag,IFSelect_SelectExtract) - -IFSelect_SelectFlag::IFSelect_SelectFlag (const Standard_CString flagname) - : thename (flagname) { } - - Standard_CString IFSelect_SelectFlag::FlagName () const - { return thename.ToCString(); } - - - Interface_EntityIterator IFSelect_SelectFlag::RootResult - (const Interface_Graph& G) const -{ - Standard_Boolean direct = IsDirect(); - Interface_EntityIterator res; - const Interface_BitMap& bm = G.BitMap(); - Standard_Integer flag = bm.FlagNumber (thename.ToCString()); - if (flag == 0) return res; - Interface_EntityIterator inp = InputResult(G); - - for (inp.Start(); inp.More(); inp.Next()) { - Standard_Integer num = G.EntityNumber(inp.Value()); - if (num == 0) continue; - if (direct == bm.Value(num,flag)) res.AddItem (G.Entity(num)); - } - return res; -} - - Standard_Boolean IFSelect_SelectFlag::Sort - (const Standard_Integer , - const Handle(Standard_Transient)&, - const Handle(Interface_InterfaceModel)& ) const - { return Standard_False; } - - TCollection_AsciiString IFSelect_SelectFlag::ExtractLabel () const -{ - TCollection_AsciiString lab ("Entities Flagged by "); - lab.AssignCat (thename); - return lab; -} diff --git a/src/IFSelect/IFSelect_SelectFlag.hxx b/src/IFSelect/IFSelect_SelectFlag.hxx deleted file mode 100644 index 35de262a7b..0000000000 --- a/src/IFSelect/IFSelect_SelectFlag.hxx +++ /dev/null @@ -1,92 +0,0 @@ -// Created on: 1995-09-05 -// Created by: Christian CAILLET -// Copyright (c) 1995-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 _IFSelect_SelectFlag_HeaderFile -#define _IFSelect_SelectFlag_HeaderFile - -#include - -#include -#include -#include -class Interface_EntityIterator; -class Interface_Graph; -class Standard_Transient; -class Interface_InterfaceModel; - - -class IFSelect_SelectFlag; -DEFINE_STANDARD_HANDLE(IFSelect_SelectFlag, IFSelect_SelectExtract) - -//! A SelectFlag queries a flag noted in the bitmap of the Graph. -//! The Flag is designated by its Name. Flag Names are defined -//! by Work Session and, as necessary, other functional objects -//! -//! WorkSession from IFSelect defines flag "Incorrect" -//! Objects which control application running define some others -class IFSelect_SelectFlag : public IFSelect_SelectExtract -{ - -public: - - - //! Creates a Select Flag, to query a flag designated by its name - Standard_EXPORT IFSelect_SelectFlag(const Standard_CString flagname); - - //! Returns the name of the flag - Standard_EXPORT Standard_CString FlagName() const; - - //! Returns the list of selected entities. It is redefined to - //! work on the graph itself (not queried by sort) - //! - //! An entity is selected if its flag is True on Direct mode, - //! False on Reversed mode - //! - //! If flag does not exist for the given name, returns an empty - //! result, whatever the Direct/Reversed sense - Standard_EXPORT virtual Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns always False because RootResult has done the work - Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - //! Returns a text defining the criterium, includes the flag name - Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectFlag,IFSelect_SelectExtract) - -protected: - - - - -private: - - - TCollection_AsciiString thename; - - -}; - - - - - - - -#endif // _IFSelect_SelectFlag_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectInList.cxx b/src/IFSelect/IFSelect_SelectInList.cxx deleted file mode 100644 index be4e750aee..0000000000 --- a/src/IFSelect/IFSelect_SelectInList.cxx +++ /dev/null @@ -1,31 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectInList,IFSelect_SelectAnyList) - -// .... Specialisation de SelectAnyList dans laquelle on traite une liste -// dont chaque item est une Entite -void IFSelect_SelectInList::FillResult - (const Standard_Integer n1, const Standard_Integer n2, - const Handle(Standard_Transient)& ent, - Interface_EntityIterator& result) const -{ - for (Standard_Integer i = n1; i <= n2; i ++) - result.GetOneItem (ListedEntity(i,ent)); -} diff --git a/src/IFSelect/IFSelect_SelectInList.hxx b/src/IFSelect/IFSelect_SelectInList.hxx deleted file mode 100644 index 774451f9d9..0000000000 --- a/src/IFSelect/IFSelect_SelectInList.hxx +++ /dev/null @@ -1,80 +0,0 @@ -// Created on: 1993-01-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 _IFSelect_SelectInList_HeaderFile -#define _IFSelect_SelectInList_HeaderFile - -#include -#include - -#include -#include -class Standard_Transient; -class Interface_EntityIterator; - - -class IFSelect_SelectInList; -DEFINE_STANDARD_HANDLE(IFSelect_SelectInList, IFSelect_SelectAnyList) - -//! A SelectInList kind Selection selects a List of an Entity, -//! which is composed of single Entities -//! To know the list on which to work, SelectInList has two -//! deferred methods : NbItems (inherited from SelectAnyList) and -//! ListedEntity (which gives an item as an Entity) which must be -//! defined to get a List in an Entity of the required Type (and -//! consider that list is empty if Entity has not required Type) -//! -//! As for SelectAnyList, if a type of Entity defines several -//! lists, a given sub-class of SelectInList is attached on one -class IFSelect_SelectInList : public IFSelect_SelectAnyList -{ - -public: - - - //! Returns an Entity, given its rank in the list - Standard_EXPORT virtual Handle(Standard_Transient) ListedEntity (const Standard_Integer num, const Handle(Standard_Transient)& ent) const = 0; - - //! Puts into the result, the sub-entities of the list, from n1 to - //! n2 included. Remark that adequation with Entity's type and - //! length of list has already been made at this stage - //! Called by RootResult; calls ListedEntity (see below) - Standard_EXPORT void FillResult (const Standard_Integer n1, const Standard_Integer n2, const Handle(Standard_Transient)& ent, Interface_EntityIterator& result) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectInList,IFSelect_SelectAnyList) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SelectInList_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectIncorrectEntities.cxx b/src/IFSelect/IFSelect_SelectIncorrectEntities.cxx deleted file mode 100644 index 7ce246b1d1..0000000000 --- a/src/IFSelect/IFSelect_SelectIncorrectEntities.cxx +++ /dev/null @@ -1,24 +0,0 @@ -// Created on: 1994-09-02 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectIncorrectEntities,IFSelect_SelectFlag) - -IFSelect_SelectIncorrectEntities::IFSelect_SelectIncorrectEntities () - : IFSelect_SelectFlag ("Incorrect") { } diff --git a/src/IFSelect/IFSelect_SelectIncorrectEntities.hxx b/src/IFSelect/IFSelect_SelectIncorrectEntities.hxx deleted file mode 100644 index 64b5fe7189..0000000000 --- a/src/IFSelect/IFSelect_SelectIncorrectEntities.hxx +++ /dev/null @@ -1,66 +0,0 @@ -// Created on: 1994-09-02 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_SelectIncorrectEntities_HeaderFile -#define _IFSelect_SelectIncorrectEntities_HeaderFile - -#include - -#include - - -class IFSelect_SelectIncorrectEntities; -DEFINE_STANDARD_HANDLE(IFSelect_SelectIncorrectEntities, IFSelect_SelectFlag) - -//! A SelectIncorrectEntities sorts the Entities which have been -//! noted as Incorrect in the Graph of the Session -//! (flag "Incorrect") -//! It can find a result only if ComputeCheck has formerly been -//! called on the WorkSession. Else, its result will be empty. -class IFSelect_SelectIncorrectEntities : public IFSelect_SelectFlag -{ - -public: - - - //! Creates a SelectIncorrectEntities - //! i.e. a SelectFlag("Incorrect") - Standard_EXPORT IFSelect_SelectIncorrectEntities(); - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectIncorrectEntities,IFSelect_SelectFlag) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SelectIncorrectEntities_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectIntersection.cxx b/src/IFSelect/IFSelect_SelectIntersection.cxx deleted file mode 100644 index c154b7ac52..0000000000 --- a/src/IFSelect/IFSelect_SelectIntersection.cxx +++ /dev/null @@ -1,44 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectIntersection,IFSelect_SelectCombine) - -IFSelect_SelectIntersection::IFSelect_SelectIntersection () { } - - - Interface_EntityIterator IFSelect_SelectIntersection::RootResult - (const Interface_Graph& G) const -{ - IFGraph_Compare GC(G); - Standard_Integer nb = NbInputs(); - for (Standard_Integer i = 1; i <= nb; i ++) { - GC.GetFromIter(Input(i)->RootResult(G), (i==1)); - if (i > 1 && i < nb) { - Interface_EntityIterator comm = GC.Common(); - GC.ResetData(); - GC.GetFromIter (comm,Standard_True); - } - } - return GC.Common(); -} - - TCollection_AsciiString IFSelect_SelectIntersection::Label () const - { return TCollection_AsciiString("Intersection (AND)"); } diff --git a/src/IFSelect/IFSelect_SelectIntersection.hxx b/src/IFSelect/IFSelect_SelectIntersection.hxx deleted file mode 100644 index c0ab1a3f50..0000000000 --- a/src/IFSelect/IFSelect_SelectIntersection.hxx +++ /dev/null @@ -1,73 +0,0 @@ -// Created on: 1993-01-11 -// 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 _IFSelect_SelectIntersection_HeaderFile -#define _IFSelect_SelectIntersection_HeaderFile - -#include -#include - -#include -class Interface_EntityIterator; -class Interface_Graph; -class TCollection_AsciiString; - - -class IFSelect_SelectIntersection; -DEFINE_STANDARD_HANDLE(IFSelect_SelectIntersection, IFSelect_SelectCombine) - -//! A SelectIntersection filters the Entities issued from several -//! other Selections as Intersection of results : "AND" operator -class IFSelect_SelectIntersection : public IFSelect_SelectCombine -{ - -public: - - - //! Creates an empty SelectIntersection - Standard_EXPORT IFSelect_SelectIntersection(); - - //! Returns the list of selected Entities, which is the common part - //! of results from all input selections. Uniqueness is guaranteed. - Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : "Intersection (AND)" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectIntersection,IFSelect_SelectCombine) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SelectIntersection_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectModelEntities.cxx b/src/IFSelect/IFSelect_SelectModelEntities.cxx deleted file mode 100644 index d6e42235f2..0000000000 --- a/src/IFSelect/IFSelect_SelectModelEntities.cxx +++ /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. - - -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectModelEntities,IFSelect_SelectBase) - -IFSelect_SelectModelEntities::IFSelect_SelectModelEntities () { } - - Interface_EntityIterator IFSelect_SelectModelEntities::RootResult - (const Interface_Graph& G) const - { return G.Model()->Entities(); } - - Interface_EntityIterator IFSelect_SelectModelEntities::CompleteResult - (const Interface_Graph& G) const - { return G.Model()->Entities(); } - - TCollection_AsciiString IFSelect_SelectModelEntities::Label () const -{ return TCollection_AsciiString("All Entities from Model"); } diff --git a/src/IFSelect/IFSelect_SelectModelEntities.hxx b/src/IFSelect/IFSelect_SelectModelEntities.hxx deleted file mode 100644 index a3afcd9150..0000000000 --- a/src/IFSelect/IFSelect_SelectModelEntities.hxx +++ /dev/null @@ -1,77 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_SelectModelEntities_HeaderFile -#define _IFSelect_SelectModelEntities_HeaderFile - -#include -#include - -#include -class Interface_EntityIterator; -class Interface_Graph; -class TCollection_AsciiString; - - -class IFSelect_SelectModelEntities; -DEFINE_STANDARD_HANDLE(IFSelect_SelectModelEntities, IFSelect_SelectBase) - -//! A SelectModelEntities gets all the Entities of an -//! InterfaceModel. -class IFSelect_SelectModelEntities : public IFSelect_SelectBase -{ - -public: - - - //! Creates a SelectModelRoot - Standard_EXPORT IFSelect_SelectModelEntities(); - - //! Returns the list of selected entities : the Entities of the - //! Model (note that this result assures naturally uniqueness) - Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! The complete list of Entities (including shared ones) ... - //! is exactly identical to RootResults in this case - Standard_EXPORT virtual Interface_EntityIterator CompleteResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : "Model Entities" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectModelEntities,IFSelect_SelectBase) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SelectModelEntities_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectModelRoots.cxx b/src/IFSelect/IFSelect_SelectModelRoots.cxx deleted file mode 100644 index f1bc5eedf6..0000000000 --- a/src/IFSelect/IFSelect_SelectModelRoots.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 -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectModelRoots,IFSelect_SelectBase) - -IFSelect_SelectModelRoots::IFSelect_SelectModelRoots () { } - - Interface_EntityIterator IFSelect_SelectModelRoots::RootResult - (const Interface_Graph& G) const - { return G.RootEntities(); } - - TCollection_AsciiString IFSelect_SelectModelRoots::Label () const -{ return TCollection_AsciiString("Root (not shared) Entities from Model"); } diff --git a/src/IFSelect/IFSelect_SelectModelRoots.hxx b/src/IFSelect/IFSelect_SelectModelRoots.hxx deleted file mode 100644 index 1827aa1a40..0000000000 --- a/src/IFSelect/IFSelect_SelectModelRoots.hxx +++ /dev/null @@ -1,75 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_SelectModelRoots_HeaderFile -#define _IFSelect_SelectModelRoots_HeaderFile - -#include -#include - -#include -class Interface_EntityIterator; -class Interface_Graph; -class TCollection_AsciiString; - - -class IFSelect_SelectModelRoots; -DEFINE_STANDARD_HANDLE(IFSelect_SelectModelRoots, IFSelect_SelectBase) - -//! A SelectModelRoots gets all the Root Entities of an -//! InterfaceModel. Remember that a "Root Entity" is defined as -//! having no Sharing Entity (if there is a Loop between Entities, -//! none of them can be a "Root"). -class IFSelect_SelectModelRoots : public IFSelect_SelectBase -{ - -public: - - - //! Creates a SelectModelRoot - Standard_EXPORT IFSelect_SelectModelRoots(); - - //! Returns the list of selected entities : the Roots of the Model - //! (note that this result assures naturally uniqueness) - Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : "Model Roots" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectModelRoots,IFSelect_SelectBase) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SelectModelRoots_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectPointed.cxx b/src/IFSelect/IFSelect_SelectPointed.cxx deleted file mode 100644 index 7524af418a..0000000000 --- a/src/IFSelect/IFSelect_SelectPointed.cxx +++ /dev/null @@ -1,188 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectPointed,IFSelect_SelectBase) - -IFSelect_SelectPointed::IFSelect_SelectPointed () - : theset (Standard_False) { } - - void IFSelect_SelectPointed::Clear() - { theitems.Clear(); theset = Standard_False; } - - Standard_Boolean IFSelect_SelectPointed::IsSet () const - { return theset; } - - void IFSelect_SelectPointed::SetEntity - (const Handle(Standard_Transient)& ent) -{ - theitems.Clear(); - theset = Standard_True; - if (ent.IsNull()) return; - theitems.Append (ent); -} - - void IFSelect_SelectPointed::SetList - (const Handle(TColStd_HSequenceOfTransient)& list) -{ - theitems.Clear(); - theset = Standard_True; - if (list.IsNull()) return; - Standard_Integer i,nb = list->Length(); - for (i = 1; i <= nb; i ++) theitems.Append (list->Value(i)); -} - -// .... Editions - - Standard_Boolean IFSelect_SelectPointed::Add - (const Handle(Standard_Transient)& item) -{ - if (item.IsNull()) return Standard_False; - for (Standard_Integer i = theitems.Length(); i >= 1; i --) - if (item == theitems.Value(i)) return Standard_False; - theitems.Append(item); - theset = Standard_True; - return Standard_True; -} - - Standard_Boolean IFSelect_SelectPointed::Remove - (const Handle(Standard_Transient)& item) -{ - if (item.IsNull()) return Standard_False; - for (Standard_Integer i = theitems.Length(); i >= 1; i --) - if (item == theitems.Value(i)) { theitems.Remove(i); return Standard_True;} - return Standard_True; -} - - Standard_Boolean IFSelect_SelectPointed::Toggle - (const Handle(Standard_Transient)& item) -{ - if (item.IsNull()) return Standard_False; - Standard_Integer num = 0; - for (Standard_Integer i = theitems.Length(); i >= 1; i --) - if (item == theitems.Value(i)) num = i; - if (num == 0) theitems.Append(item); - else theitems.Remove(num); - return (num == 0); -} - - Standard_Boolean IFSelect_SelectPointed::AddList - (const Handle(TColStd_HSequenceOfTransient)& list) -{ -// Optimise avec une Map - Standard_Boolean res = Standard_False; - if (list.IsNull()) return res; - Standard_Integer i, nb = theitems.Length(), nl = list->Length(); - TColStd_MapOfTransient deja (nb+nl+1); - for (i = 1; i <= nb; i ++) deja.Add (theitems.Value(i)); - - for (i = 1; i <= nl; i ++) { - if (!deja.Contains (list->Value(i)) ) theitems.Append (list->Value(i)); - } - theset = Standard_True; - return res; -} - - Standard_Boolean IFSelect_SelectPointed::RemoveList - (const Handle(TColStd_HSequenceOfTransient)& list) -{ - Standard_Boolean res = Standard_False; - if (list.IsNull()) return res; - Standard_Integer i, nb = list->Length(); - for (i = 1; i <= nb; i ++) res |= Remove (list->Value(i)); - return res; -} - - Standard_Boolean IFSelect_SelectPointed::ToggleList - (const Handle(TColStd_HSequenceOfTransient)& list) -{ - Standard_Boolean res = Standard_True; - if (list.IsNull()) return res; - Standard_Integer i, nb = list->Length(); - for (i = 1; i <= nb; i ++) res |= Toggle (list->Value(i)); - return res; -} - - -// .... Consultations - - Standard_Integer IFSelect_SelectPointed::Rank - (const Handle(Standard_Transient)& item) const -{ - if (item.IsNull()) return 0; - for (Standard_Integer i = theitems.Length(); i >= 1; i --) - if (item == theitems.Value(i)) return i; - return 0; -} - - Standard_Integer IFSelect_SelectPointed::NbItems () const - { return theitems.Length(); } - - Handle(Standard_Transient) IFSelect_SelectPointed::Item - (const Standard_Integer num) const -{ - Handle(Standard_Transient) item; - if (num <= 0 || num > theitems.Length()) return item; - return theitems.Value(num); -} - - void IFSelect_SelectPointed::Update - (const Handle(Interface_CopyControl)& control) -{ - Standard_Integer nb = theitems.Length(); - for (Standard_Integer i = nb; i > 0; i --) { - Handle(Standard_Transient) enfr, ento; - enfr = theitems.Value(i); - if (!control->Search(enfr,ento)) theitems.Remove(i); - else theitems.SetValue(i,ento); - } -} - - void IFSelect_SelectPointed::Update - (const Handle(IFSelect_Transformer)& trf) -{ - Standard_Integer nb = theitems.Length(); - for (Standard_Integer i = nb; i > 0; i --) { - Handle(Standard_Transient) enfr, ento; - enfr = theitems.Value(i); - if (!trf->Updated(enfr,ento)) theitems.Remove(i); - else theitems.SetValue(i,ento); - } -} - -// .... Actions Generales - - Interface_EntityIterator IFSelect_SelectPointed::RootResult - (const Interface_Graph& G) const -{ - Interface_EntityIterator result; - Standard_Integer nb = theitems.Length(); - for (Standard_Integer i = 1; i <= nb; i ++) { - Handle(Standard_Transient) item = theitems.Value(i); - if (G.EntityNumber(item) > 0) result.GetOneItem(item); - } - return result; -} - - TCollection_AsciiString IFSelect_SelectPointed::Label () const - { return TCollection_AsciiString ("Pointed Entities"); } diff --git a/src/IFSelect/IFSelect_SelectPointed.hxx b/src/IFSelect/IFSelect_SelectPointed.hxx deleted file mode 100644 index 8d853d1532..0000000000 --- a/src/IFSelect/IFSelect_SelectPointed.hxx +++ /dev/null @@ -1,149 +0,0 @@ -// Created on: 1994-05-30 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_SelectPointed_HeaderFile -#define _IFSelect_SelectPointed_HeaderFile - -#include -#include - -#include -#include -#include -class Standard_Transient; -class Interface_CopyControl; -class IFSelect_Transformer; -class Interface_EntityIterator; -class Interface_Graph; -class TCollection_AsciiString; - - -class IFSelect_SelectPointed; -DEFINE_STANDARD_HANDLE(IFSelect_SelectPointed, IFSelect_SelectBase) - -//! This type of Selection is intended to describe a direct -//! selection without an explicit criterium, for instance the -//! result of picking viewed entities on a graphic screen -//! -//! It can also be used to provide a list as internal alternate -//! input : this use implies to clear the list once queried -class IFSelect_SelectPointed : public IFSelect_SelectBase -{ - -public: - - - //! Creates a SelectPointed - Standard_EXPORT IFSelect_SelectPointed(); - - //! Clears the list of selected items - //! Also says the list is unset - //! All Add* methods and SetList say the list is set - Standard_EXPORT void Clear(); - - //! Tells if the list has been set. Even if empty - Standard_EXPORT Standard_Boolean IsSet() const; - - //! As SetList but with only one entity - //! If is Null, the list is said as being set but is empty - Standard_EXPORT void SetEntity (const Handle(Standard_Transient)& item); - - //! Sets a given list to define the list of selected items - //! can be empty or null : in this case, the list is said - //! as being set, but it is empty - //! - //! To use it as an alternate input, one shot : - //! - SetList or SetEntity to define the input list - //! - RootResult to get it - //! - then Clear to drop it - Standard_EXPORT void SetList (const Handle(TColStd_HSequenceOfTransient)& list); - - //! Adds an item. Returns True if Done, False if is already - //! in the selected list - Standard_EXPORT Standard_Boolean Add (const Handle(Standard_Transient)& item); - - //! Removes an item. Returns True if Done, False if was not - //! in the selected list - Standard_EXPORT Standard_Boolean Remove (const Handle(Standard_Transient)& item); - - //! Toggles status of an item : adds it if not pointed or removes - //! it if already pointed. Returns the new status (Pointed or not) - Standard_EXPORT Standard_Boolean Toggle (const Handle(Standard_Transient)& item); - - //! Adds all the items defined in a list. Returns True if at least - //! one item has been added, False else - Standard_EXPORT Standard_Boolean AddList (const Handle(TColStd_HSequenceOfTransient)& list); - - //! Removes all the items defined in a list. Returns True if at - //! least one item has been removed, False else - Standard_EXPORT Standard_Boolean RemoveList (const Handle(TColStd_HSequenceOfTransient)& list); - - //! Toggles status of all the items defined in a list : adds it if - //! not pointed or removes it if already pointed. - Standard_EXPORT Standard_Boolean ToggleList (const Handle(TColStd_HSequenceOfTransient)& list); - - //! Returns the rank of an item in the selected list, or 0. - Standard_EXPORT Standard_Integer Rank (const Handle(Standard_Transient)& item) const; - - //! Returns the count of selected items - Standard_EXPORT Standard_Integer NbItems() const; - - //! Returns an item given its rank, or a Null Handle - Standard_EXPORT Handle(Standard_Transient) Item (const Standard_Integer num) const; - - //! Rebuilds the selected list. Any selected entity which has a - //! bound result is replaced by this result, else it is removed. - Standard_EXPORT void Update (const Handle(Interface_CopyControl)& control); - - //! Rebuilds the selected list, by querying a Transformer - //! (same principle as from a CopyControl) - Standard_EXPORT void Update (const Handle(IFSelect_Transformer)& trf); - - //! Returns the list of selected items. Only the selected entities - //! which are present in the graph are given (this result assures - //! uniqueness). - Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns a text which identifies the type of selection made. - //! It is "Pointed Entities" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectPointed,IFSelect_SelectBase) - -protected: - - - - -private: - - - Standard_Boolean theset; - TColStd_SequenceOfTransient theitems; - - -}; - - - - - - - -#endif // _IFSelect_SelectPointed_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectRange.cxx b/src/IFSelect/IFSelect_SelectRange.cxx deleted file mode 100644 index 1512d09b3c..0000000000 --- a/src/IFSelect/IFSelect_SelectRange.cxx +++ /dev/null @@ -1,92 +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 -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectRange,IFSelect_SelectExtract) - -IFSelect_SelectRange::IFSelect_SelectRange () { } - - void IFSelect_SelectRange::SetRange - (const Handle(IFSelect_IntParam)& rankfrom, - const Handle(IFSelect_IntParam)& rankto) - { thelower = rankfrom; theupper = rankto; } - - void IFSelect_SelectRange::SetOne (const Handle(IFSelect_IntParam)& rank) - { thelower = theupper = rank; } - - void IFSelect_SelectRange::SetFrom - (const Handle(IFSelect_IntParam)& rankfrom) - { thelower = rankfrom; theupper.Nullify(); } - - void IFSelect_SelectRange::SetUntil - (const Handle(IFSelect_IntParam)& rankto) - { thelower.Nullify(); theupper = rankto; } - - - Standard_Boolean IFSelect_SelectRange::HasLower () const - { return (!thelower.IsNull()); } - - Handle(IFSelect_IntParam) IFSelect_SelectRange::Lower () const - { return thelower; } - - Standard_Integer IFSelect_SelectRange::LowerValue () const -{ - if (thelower.IsNull()) return 0; - return thelower->Value(); -} - - Standard_Boolean IFSelect_SelectRange::HasUpper () const - { return (!theupper.IsNull()); } - - Handle(IFSelect_IntParam) IFSelect_SelectRange::Upper () const - { return theupper; } - - Standard_Integer IFSelect_SelectRange::UpperValue () const -{ - if (theupper.IsNull()) return 0; - return theupper->Value(); -} - - Standard_Boolean IFSelect_SelectRange::Sort - (const Standard_Integer rank, const Handle(Standard_Transient)& , - const Handle(Interface_InterfaceModel)& ) const -{ - Standard_Integer rankfrom = 0; - if (!thelower.IsNull()) rankfrom = thelower->Value(); - Standard_Integer rankto = 0; - if (!theupper.IsNull()) rankto = theupper->Value(); - return (rank >= rankfrom && (rankto == 0 || rankto >= rank)); -} - - TCollection_AsciiString IFSelect_SelectRange::ExtractLabel () const -{ - char lab[30]; - Standard_Integer rankfrom = 0; - if (!thelower.IsNull()) rankfrom = thelower->Value(); - Standard_Integer rankto = 0; - if (!theupper.IsNull()) rankto = theupper->Value(); - if (rankfrom == rankto) sprintf(lab,"Rank no %d",rankfrom); - else if (rankfrom == 0) sprintf(lab,"Until no %d",rankto); - else if (rankto == 0) sprintf(lab,"From no %d",rankto); - else sprintf(lab,"From %d Until %d",rankfrom,rankto); - - return TCollection_AsciiString(lab); -} diff --git a/src/IFSelect/IFSelect_SelectRange.hxx b/src/IFSelect/IFSelect_SelectRange.hxx deleted file mode 100644 index 3c915eb791..0000000000 --- a/src/IFSelect/IFSelect_SelectRange.hxx +++ /dev/null @@ -1,93 +0,0 @@ -// Created on: 1992-11-18 -// 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 _IFSelect_SelectRange_HeaderFile -#define _IFSelect_SelectRange_HeaderFile - -#include -#include - -#include -#include -class IFSelect_IntParam; -class Standard_Transient; -class Interface_InterfaceModel; -class TCollection_AsciiString; - -class IFSelect_SelectRange; -DEFINE_STANDARD_HANDLE(IFSelect_SelectRange, IFSelect_SelectExtract) - -//! A SelectRange keeps or rejects a sub-set of the input set, -//! that is the Entities of which rank in the iteration list -//! is in a given range (for instance form 2nd to 6th, etc...) -class IFSelect_SelectRange : public IFSelect_SelectExtract -{ - -public: - - - //! Creates a SelectRange. Default is Take all the input list - Standard_EXPORT IFSelect_SelectRange(); - - //! Sets a Range for numbers, with a lower and a upper limits - //! Error if rankto is lower then rankfrom - Standard_EXPORT void SetRange (const Handle(IFSelect_IntParam)& rankfrom, const Handle(IFSelect_IntParam)& rankto); - - //! Sets a unique number (only one Entity will be sorted as True) - Standard_EXPORT void SetOne (const Handle(IFSelect_IntParam)& rank); - - //! Sets a Lower limit but no upper limit - Standard_EXPORT void SetFrom (const Handle(IFSelect_IntParam)& rankfrom); - - //! Sets an Upper limit but no lower limit (equivalent to lower 1) - Standard_EXPORT void SetUntil (const Handle(IFSelect_IntParam)& rankto); - - //! Returns True if a Lower limit is defined - Standard_EXPORT Standard_Boolean HasLower() const; - - //! Returns Lower limit (if there is; else, value is senseless) - Standard_EXPORT Handle(IFSelect_IntParam) Lower() const; - - //! Returns Value of Lower Limit (0 if none is defined) - Standard_EXPORT Standard_Integer LowerValue() const; - - //! Returns True if a Lower limit is defined - Standard_EXPORT Standard_Boolean HasUpper() const; - - //! Returns Upper limit (if there is; else, value is senseless) - Standard_EXPORT Handle(IFSelect_IntParam) Upper() const; - - //! Returns Value of Upper Limit (0 if none is defined) - Standard_EXPORT Standard_Integer UpperValue() const; - - //! Returns True for an Entity of which occurrence number in the - //! iteration is inside the selected Range (considers ) - Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : following cases, - //! " From .. Until .." or "From .." or "Until .." or "Rank no .." - Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE; - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectRange,IFSelect_SelectExtract) - -private: - - Handle(IFSelect_IntParam) thelower; - Handle(IFSelect_IntParam) theupper; - -}; - -#endif // _IFSelect_SelectRange_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectRootComps.cxx b/src/IFSelect/IFSelect_SelectRootComps.cxx deleted file mode 100644 index 368a82bf0c..0000000000 --- a/src/IFSelect/IFSelect_SelectRootComps.cxx +++ /dev/null @@ -1,74 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectRootComps,IFSelect_SelectExtract) - -IFSelect_SelectRootComps::IFSelect_SelectRootComps () { } - - -// Refait pour travailler en une fois -// ATTENTION, il ne faut pas s interesser aux ENTITES mais aux COMPOSANTS -// c-a-d gerer les CYCLES s il y en a - - Interface_EntityIterator IFSelect_SelectRootComps::RootResult - (const Interface_Graph& G) const -{ - Interface_EntityIterator IEIinput = InputResult(G); - Interface_EntityIterator iter; -// ICI, extraire les Componants, puis considerer une Entite de chacun - IFGraph_StrongComponants comps(G,Standard_False); - comps.SetLoad(); - comps.GetFromIter(IEIinput); - Interface_EntityIterator inp1; // IEIinput reduit a une Entite par Composant - - IFGraph_Cumulate GC(G); - -// On note dans le graphe : le cumul de chaque ensemble (Entite + Shared tous -// niveaux). Les Roots initiales comptees une seule fois sont bonnes -// Pour Entite : une par Componant (peu importe) - for (comps.Start(); comps.More(); comps.Next()) { - Handle(Standard_Transient) ent = comps.FirstEntity(); - GC.GetFromEntity(ent); - inp1.GetOneItem(ent); - } -// A present, on retient, parmi les inputs, celles comptees une seule fois -// (N.B.: on prend inp1, qui donne UNE entite par composant, simple ou cycle) - for (inp1.Start(); inp1.More(); inp1.Next()) { - Handle(Standard_Transient) ent = inp1.Value(); - if ((GC.NbTimes(ent) <= 1) == IsDirect()) iter.GetOneItem(ent); - } - return iter; -} - - Standard_Boolean IFSelect_SelectRootComps::HasUniqueResult () const - { return Standard_True; } - - - Standard_Boolean IFSelect_SelectRootComps::Sort - (const Standard_Integer , const Handle(Standard_Transient)& , - const Handle(Interface_InterfaceModel)& ) const - { return Standard_True; } - - TCollection_AsciiString IFSelect_SelectRootComps::ExtractLabel () const -{ return TCollection_AsciiString("Local Root Components"); } diff --git a/src/IFSelect/IFSelect_SelectRootComps.hxx b/src/IFSelect/IFSelect_SelectRootComps.hxx deleted file mode 100644 index ed47750d9c..0000000000 --- a/src/IFSelect/IFSelect_SelectRootComps.hxx +++ /dev/null @@ -1,72 +0,0 @@ -// Created on: 1992-12-02 -// 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 _IFSelect_SelectRootComps_HeaderFile -#define _IFSelect_SelectRootComps_HeaderFile - -#include -#include - -#include -#include -class Interface_EntityIterator; -class Interface_Graph; -class Standard_Transient; -class Interface_InterfaceModel; -class TCollection_AsciiString; - -class IFSelect_SelectRootComps; -DEFINE_STANDARD_HANDLE(IFSelect_SelectRootComps, IFSelect_SelectExtract) - -//! A SelectRootComps sorts the Entities which are part of Strong -//! Components, local roots of a set of Entities : they can be -//! Single Components (containing one Entity) or Cycles -//! This class gives a more secure result than SelectRoots (which -//! considers only Single Components) but is longer to work : it -//! can be used when there can be or there are cycles in a Model -//! For each cycle, one Entity is given arbitrarily -//! Reject works as for SelectRoots : Strong Components defined in -//! the input list which are not local roots are given -class IFSelect_SelectRootComps : public IFSelect_SelectExtract -{ - -public: - - //! Creates a SelectRootComps - Standard_EXPORT IFSelect_SelectRootComps(); - - //! Returns the list of local root strong components, by one Entity per component. - //! It is redefined for a purpose of efficiency : calling a Sort routine for each Entity would - //! cost more resources than to work in once using a Map - //! RootResult takes in account the Direct status - Standard_EXPORT virtual Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns always True, because RootResult has done work - Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : "Local Root Components" - Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE; - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectRootComps,IFSelect_SelectExtract) - -protected: - - //! Returns True, RootResult assuring uniqueness - Standard_EXPORT virtual Standard_Boolean HasUniqueResult() const Standard_OVERRIDE; - -}; - -#endif // _IFSelect_SelectRootComps_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectRoots.cxx b/src/IFSelect/IFSelect_SelectRoots.cxx deleted file mode 100644 index a60c4e6653..0000000000 --- a/src/IFSelect/IFSelect_SelectRoots.cxx +++ /dev/null @@ -1,61 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectRoots,IFSelect_SelectExtract) - -IFSelect_SelectRoots::IFSelect_SelectRoots () { } - - -// Refait pour travailler en une fois - - Interface_EntityIterator IFSelect_SelectRoots::RootResult - (const Interface_Graph& G) const -{ - Interface_EntityIterator input = InputResult(G); - Interface_EntityIterator iter; - IFGraph_Cumulate GC(G); - -// On note dans le graphe : le cumul de chaque ensemble (Entite + Shared tous -// niveaux). Les Roots initiales comptees une seule fois sont bonnes - for (input.Start(); input.More(); input.Next()) { - Handle(Standard_Transient) ent = input.Value(); - GC.GetFromEntity(ent); - } -// A present, on retient, parmi les inputs, celles comptees une seule fois - for (input.Start(); input.More(); input.Next()) { - Handle(Standard_Transient) ent = input.Value(); - if ((GC.NbTimes(ent) <= 1) == IsDirect()) iter.GetOneItem(ent); - } - return iter; -} - - Standard_Boolean IFSelect_SelectRoots::HasUniqueResult () const - { return Standard_True; } - - Standard_Boolean IFSelect_SelectRoots::Sort - (const Standard_Integer , const Handle(Standard_Transient)& , - const Handle(Interface_InterfaceModel)& ) const - { return Standard_True; } - - TCollection_AsciiString IFSelect_SelectRoots::ExtractLabel () const - { return TCollection_AsciiString("Local Roots"); } diff --git a/src/IFSelect/IFSelect_SelectRoots.hxx b/src/IFSelect/IFSelect_SelectRoots.hxx deleted file mode 100644 index 3a1c6d7474..0000000000 --- a/src/IFSelect/IFSelect_SelectRoots.hxx +++ /dev/null @@ -1,66 +0,0 @@ -// Created on: 1992-11-18 -// 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 _IFSelect_SelectRoots_HeaderFile -#define _IFSelect_SelectRoots_HeaderFile - -#include -#include - -#include -#include -class Interface_EntityIterator; -class Interface_Graph; -class Standard_Transient; -class Interface_InterfaceModel; -class TCollection_AsciiString; - -class IFSelect_SelectRoots; -DEFINE_STANDARD_HANDLE(IFSelect_SelectRoots, IFSelect_SelectExtract) - -//! A SelectRoots sorts the Entities which are local roots of a -//! set of Entities (not shared by other Entities inside this set, -//! even if they are shared by other Entities outside it) -class IFSelect_SelectRoots : public IFSelect_SelectExtract -{ - -public: - - //! Creates a SelectRoots - Standard_EXPORT IFSelect_SelectRoots(); - - //! Returns the list of local roots. - //! It is redefined for a purpose of efficiency: - //! calling a Sort routine for each Entity would cost more resources - //! than to work in once using a Map RootResult takes in account the Direct status. - Standard_EXPORT virtual Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns always True, because RootResult has done work - Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : "Local Root Entities" - Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE; - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectRoots,IFSelect_SelectExtract) - -protected: - - //! Returns True, because RootResult assures uniqueness - Standard_EXPORT virtual Standard_Boolean HasUniqueResult() const Standard_OVERRIDE; - -}; - -#endif // _IFSelect_SelectRoots_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectSent.cxx b/src/IFSelect/IFSelect_SelectSent.cxx deleted file mode 100644 index e97dad4ee0..0000000000 --- a/src/IFSelect/IFSelect_SelectSent.cxx +++ /dev/null @@ -1,78 +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 -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectSent,IFSelect_SelectExtract) - -IFSelect_SelectSent::IFSelect_SelectSent - (const Standard_Integer sentcount, const Standard_Boolean atleast) - { thecnt = sentcount; thelst = atleast; } - - Standard_Integer IFSelect_SelectSent::SentCount () const - { return thecnt; } - - Standard_Boolean IFSelect_SelectSent::AtLeast () const - { return thelst; } - - Interface_EntityIterator IFSelect_SelectSent::RootResult - (const Interface_Graph& G) const -{ - Standard_Boolean direct = IsDirect(); - Interface_EntityIterator res; - Interface_EntityIterator inp = InputResult(G); - - for (inp.Start(); inp.More(); inp.Next()) { - Standard_Integer num = G.EntityNumber(inp.Value()); - if (num == 0) continue; - Standard_Integer nb = G.Status(num); // nb sent - Standard_Boolean ok; - if (thecnt == 0) ok = (nb == 0); - else if (thelst) ok = (nb >= thecnt); - else ok = (nb == thecnt); - if (ok == direct) res.AddItem (G.Entity(num)); - } - return res; -} - - Standard_Boolean IFSelect_SelectSent::Sort - (const Standard_Integer , - const Handle(Standard_Transient)&, - const Handle(Interface_InterfaceModel)& ) const - { return Standard_False; } - - - TCollection_AsciiString IFSelect_SelectSent::ExtractLabel () const -{ - char lb[80]; - TCollection_AsciiString lab; - if (thecnt == 0) lab.AssignCat ("Remaining (non-sent) entities"); - if (thecnt == 1 && thelst) lab.AssignCat ("Sent entities"); - if (thecnt == 1 && !thelst) lab.AssignCat ("Sent once (non-duplicated) entities"); - if (thecnt == 2 && thelst) lab.AssignCat ("Sent several times entities"); - if (thecnt == 2 && !thelst) lab.AssignCat ("Sent just twice entities"); - if (thecnt > 2) { - if (thelst) sprintf (lb,"Sent at least %d times entities", thecnt); - else sprintf (lb,"Sent just %d times entities", thecnt); - lab.AssignCat (lb); - } - return lab; -} diff --git a/src/IFSelect/IFSelect_SelectSent.hxx b/src/IFSelect/IFSelect_SelectSent.hxx deleted file mode 100644 index c2dc361239..0000000000 --- a/src/IFSelect/IFSelect_SelectSent.hxx +++ /dev/null @@ -1,114 +0,0 @@ -// Created on: 1995-10-25 -// Created by: Christian CAILLET -// Copyright (c) 1995-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 _IFSelect_SelectSent_HeaderFile -#define _IFSelect_SelectSent_HeaderFile - -#include -#include - -#include -#include -class Interface_EntityIterator; -class Interface_Graph; -class Standard_Transient; -class Interface_InterfaceModel; -class TCollection_AsciiString; - - -class IFSelect_SelectSent; -DEFINE_STANDARD_HANDLE(IFSelect_SelectSent, IFSelect_SelectExtract) - -//! This class returns entities according sending to a file -//! Once a model has been loaded, further sendings are recorded -//! as status in the graph (for each value, a count of sendings) -//! -//! Hence, it is possible to query entities : sent ones (at least -//! once), non-sent (i.e. remaining) ones, duplicated ones, etc... -//! -//! This selection performs this query -class IFSelect_SelectSent : public IFSelect_SelectExtract -{ - -public: - - - //! Creates a SelectSent : - //! sentcount = 0 -> remaining (non-sent) entities - //! sentcount = 1, atleast = True (D) -> sent (at least once) - //! sentcount = 2, atleast = True -> duplicated (sent least twice) - //! etc... - //! sentcount = 1, atleast = False -> sent just once (non-dupl.d) - //! sentcount = 2, atleast = False -> sent just twice - //! etc... - Standard_EXPORT IFSelect_SelectSent(const Standard_Integer sentcount = 1, const Standard_Boolean atleast = Standard_True); - - //! Returns the queried count of sending - Standard_EXPORT Standard_Integer SentCount() const; - - //! Returns the status, True for sending at least the - //! sending count, False for sending exactly the sending count - //! Remark : if SentCount is 0, AtLeast is ignored - Standard_EXPORT Standard_Boolean AtLeast() const; - - //! Returns the list of selected entities. It is redefined to - //! work on the graph itself (not queried by sort) - //! - //! An entity is selected if its count complies to the query in - //! Direct Mode, rejected in Reversed Mode - //! - //! Query works on the sending count recorded as status in Graph - Standard_EXPORT virtual Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns always False because RootResult has done the work - Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : query : - //! SentCount = 0 -> "Remaining (non-sent) entities" - //! SentCount = 1, AtLeast = True -> "Sent entities" - //! SentCount = 1, AtLeast = False -> "Sent once (no duplicated)" - //! SentCount = 2, AtLeast = True -> "Sent several times entities" - //! SentCount = 2, AtLeast = False -> "Sent twice entities" - //! SentCount > 2, AtLeast = True -> "Sent at least times entities" - //! SentCount > 2, AtLeast = False -> "Sent times entities" - Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectSent,IFSelect_SelectExtract) - -protected: - - - - -private: - - - Standard_Integer thecnt; - Standard_Boolean thelst; - - -}; - - - - - - - -#endif // _IFSelect_SelectSent_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectShared.cxx b/src/IFSelect/IFSelect_SelectShared.cxx deleted file mode 100644 index 59e5d7f6d2..0000000000 --- a/src/IFSelect/IFSelect_SelectShared.cxx +++ /dev/null @@ -1,40 +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(IFSelect_SelectShared,IFSelect_SelectDeduct) - -IFSelect_SelectShared::IFSelect_SelectShared () { } - - -// Entites partagees par d autres (a 1 niveau et au sens Strict) - - Interface_EntityIterator IFSelect_SelectShared::RootResult - (const Interface_Graph& G) const -{ - Interface_EntityIterator iter = InputResult(G); - Interface_Graph GG(G); - for (iter.Start(); iter.More(); iter.Next()) { - GG.GetFromIter(G.Shareds(iter.Value()),0); - } - return Interface_GraphContent(GG); -} - - TCollection_AsciiString IFSelect_SelectShared::Label () const - { return TCollection_AsciiString("Shared Entities (one level)"); } diff --git a/src/IFSelect/IFSelect_SelectShared.hxx b/src/IFSelect/IFSelect_SelectShared.hxx deleted file mode 100644 index 955387cfd7..0000000000 --- a/src/IFSelect/IFSelect_SelectShared.hxx +++ /dev/null @@ -1,73 +0,0 @@ -// Created on: 1992-11-18 -// 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 _IFSelect_SelectShared_HeaderFile -#define _IFSelect_SelectShared_HeaderFile - -#include -#include - -#include -class Interface_EntityIterator; -class Interface_Graph; -class TCollection_AsciiString; - - -class IFSelect_SelectShared; -DEFINE_STANDARD_HANDLE(IFSelect_SelectShared, IFSelect_SelectDeduct) - -//! A SelectShared selects Entities which are directly Shared -//! by the Entities of the Input list -class IFSelect_SelectShared : public IFSelect_SelectDeduct -{ - -public: - - - //! Creates a SelectShared; - Standard_EXPORT IFSelect_SelectShared(); - - //! Returns the list of selected entities (list of entities - //! shared by those of input list) - Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : "Shared (one level)" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectShared,IFSelect_SelectDeduct) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SelectShared_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectSharing.cxx b/src/IFSelect/IFSelect_SelectSharing.cxx deleted file mode 100644 index 0bc3715a40..0000000000 --- a/src/IFSelect/IFSelect_SelectSharing.cxx +++ /dev/null @@ -1,40 +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(IFSelect_SelectSharing,IFSelect_SelectDeduct) - -IFSelect_SelectSharing::IFSelect_SelectSharing () { } - - -// Entites en partageant d autres (a 1 niveau et au sens Strict) - - Interface_EntityIterator IFSelect_SelectSharing::RootResult - (const Interface_Graph& G) const -{ - Interface_EntityIterator iter = InputResult(G); - Interface_Graph GG(G); - for (iter.Start(); iter.More(); iter.Next()) { - GG.GetFromIter(G.Sharings(iter.Value()),0); - } - return Interface_GraphContent(GG); -} - - TCollection_AsciiString IFSelect_SelectSharing::Label () const - { return TCollection_AsciiString("Sharing Entities (one level)"); } diff --git a/src/IFSelect/IFSelect_SelectSharing.hxx b/src/IFSelect/IFSelect_SelectSharing.hxx deleted file mode 100644 index f801f47ac1..0000000000 --- a/src/IFSelect/IFSelect_SelectSharing.hxx +++ /dev/null @@ -1,75 +0,0 @@ -// Created on: 1993-11-03 -// 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 _IFSelect_SelectSharing_HeaderFile -#define _IFSelect_SelectSharing_HeaderFile - -#include -#include - -#include -class Interface_EntityIterator; -class Interface_Graph; -class TCollection_AsciiString; - - -class IFSelect_SelectSharing; -DEFINE_STANDARD_HANDLE(IFSelect_SelectSharing, IFSelect_SelectDeduct) - -//! A SelectSharing selects Entities which directly Share (Level -//! One) the Entities of the Input list -//! Remark : if an Entity of the Input List directly shares -//! another one, it is of course present in the Result List -class IFSelect_SelectSharing : public IFSelect_SelectDeduct -{ - -public: - - - //! Creates a SelectSharing; - Standard_EXPORT IFSelect_SelectSharing(); - - //! Returns the list of selected entities (list of entities - //! which share (level one) those of input list) - Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : "Sharing (one level)" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectSharing,IFSelect_SelectDeduct) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SelectSharing_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectSignature.cxx b/src/IFSelect/IFSelect_SelectSignature.cxx deleted file mode 100644 index c19bc5d320..0000000000 --- a/src/IFSelect/IFSelect_SelectSignature.cxx +++ /dev/null @@ -1,171 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectSignature,IFSelect_SelectExtract) - -// theexact : -1 OUI 0 NON une seule valeur > 0 NON nb de valeurs -// signmode : 1 prendre si contenu, 2 refuser si contenu -// 3 prendre si egal, 4 refuser si egal -// ou test numerique, ajouter : 16 < 24 <= 32 > 40 >= -static Standard_Integer multsign - (const TCollection_AsciiString& signtext, - TColStd_SequenceOfAsciiString& signlist, - TColStd_SequenceOfInteger& signmode) -{ - Standard_Integer i, nb = signtext.Length(), mode = 0; - for (i = 1; i <= nb; i ++) { - char unsign = signtext.Value(i); - if (unsign == '|' || unsign == '!' || unsign == '=') { mode = 1; break; } - if (unsign == '<' || unsign == '>') { mode = 1; break; } - } - if (mode == 0) return mode; -// On va tronconner - TCollection_AsciiString item; Standard_Integer imod = 1; - for (i = 1; i <= nb; i ++) { - char unsign = signtext.Value(i); - if (unsign == '|' || unsign == '!') { - if (item.Length() > 0) { - signlist.Append (item); - signmode.Append (imod); - item.Clear(); - mode ++; - } - imod = (unsign == '|' ? 1 : 2); - } - else if (unsign == '<') imod += 16; - else if (unsign == '>') imod += 32; - else if (unsign == '=') { if (imod < 8) imod += 2; else imod += 8; } - else item.AssignCat (unsign); - } - if (item.Length() > 0) { - signlist.Append (item); - signmode.Append (imod); -// mode ++; valait un au depart - } - return mode; -} - - - - IFSelect_SelectSignature::IFSelect_SelectSignature - (const Handle(IFSelect_Signature)& matcher, - const TCollection_AsciiString& signtext, const Standard_Boolean exact) - : thematcher (matcher) , thesigntext (signtext) , theexact (exact ? -1 : 0) -{ if (!exact) theexact = multsign (thesigntext,thesignlist,thesignmode); } - - IFSelect_SelectSignature::IFSelect_SelectSignature - (const Handle(IFSelect_Signature)& matcher, - const Standard_CString signtext, const Standard_Boolean exact) - : thematcher (matcher) , thesigntext (signtext) , theexact (exact ? -1 : 0) -{ if (!exact) theexact = multsign (thesigntext,thesignlist,thesignmode); } - - IFSelect_SelectSignature::IFSelect_SelectSignature - (const Handle(IFSelect_SignCounter)& counter, - const Standard_CString signtext, const Standard_Boolean exact) - : thecounter (counter) , thesigntext (signtext) , theexact (exact ? -1 : 0) -{ if (!exact) theexact = multsign (thesigntext,thesignlist,thesignmode); } - - Handle(IFSelect_Signature) IFSelect_SelectSignature::Signature () const - { return thematcher; } - - Handle(IFSelect_SignCounter) IFSelect_SelectSignature::Counter () const - { return thecounter; } - - - Standard_Boolean IFSelect_SelectSignature::SortInGraph - (const Standard_Integer , const Handle(Standard_Transient)& ent, - const Interface_Graph& G) const -{ - Standard_Boolean res; - Standard_CString txt; - Handle(Interface_InterfaceModel) model = G.Model(); - if (theexact <= 0) { - if (!thematcher.IsNull()) return thematcher->Matches (ent,model,thesigntext, (theexact < 0)); - txt = thecounter->ComputedSign(ent,G); - return IFSelect_Signature::MatchValue (txt,thesigntext , (theexact < 0)); - } - -// sinon : liste -// Analyse en sequence : si alternance prend/prend-pas, le dernier a raison -// en consequence, si que des prend ou que des prend-pas, c est commutatif -// DONC recommendation : mettre les prend-pas en fin - -// AU DEPART : prendre = ne prendre que. prend-pas = prend-tout-sauf ... -// Donc si le premier est un prend-pas, je commence par tout prendre - Standard_Integer hmod = thesignmode.Value(1); - Standard_Integer jmod = hmod/8; - Standard_Integer imod = hmod - (jmod*8); - res = (imod == 2 || imod == 4); - for (Standard_Integer i = 1; i <= theexact; i ++) { - Standard_CString signtext = thesignlist.Value(i).ToCString(); - hmod = thesignmode.Value(i); - jmod = hmod/8; - imod = hmod - (jmod*8); - Standard_Boolean quid; - if (jmod == 0) { - if (!thematcher.IsNull()) quid = thematcher->Matches (ent,model,signtext,(imod > 2)); - else quid = IFSelect_Signature::MatchValue - ( thecounter->ComputedSign(ent,G),signtext, (imod > 2) ); - } - else { - if (!thematcher.IsNull()) txt = thematcher->Value (ent,model); - else txt = thecounter->ComputedSign (ent,G); - - Standard_Integer val = atoi(txt); - Standard_Integer lav = atoi (signtext); - switch (jmod) { - case 2 : quid = (val < lav); break; - case 3 : quid = (val <= lav); break; - case 4 : quid = (val > lav); break; - case 5 : quid = (val >= lav); break; - default : quid = Standard_False; break; - } - } - if ((imod == 1 || imod == 3) && quid) res = Standard_True; - if ((imod == 2 || imod == 4) && quid) res = Standard_False; - } - return res; -} - - Standard_Boolean IFSelect_SelectSignature::Sort - (const Standard_Integer , const Handle(Standard_Transient)& /*ent*/, - const Handle(Interface_InterfaceModel)& /*model*/) const -{ return Standard_True; } - - const TCollection_AsciiString& IFSelect_SelectSignature::SignatureText () const - { return thesigntext; } - - Standard_Boolean IFSelect_SelectSignature::IsExact () const - { return (theexact < 0); } - - TCollection_AsciiString IFSelect_SelectSignature::ExtractLabel () const -{ - TCollection_AsciiString lab; - if (!thematcher.IsNull()) lab.AssignCat (thematcher->Name()); - else lab.AssignCat (thecounter->Name()); - if (theexact < 0) lab.AssignCat(" matching "); - else if (theexact == 0) lab.AssignCat(" containing "); - else lab.AssignCat(" matching list "); - lab.AssignCat(thesigntext); - return lab; -} diff --git a/src/IFSelect/IFSelect_SelectSignature.hxx b/src/IFSelect/IFSelect_SelectSignature.hxx deleted file mode 100644 index ffbd37bd68..0000000000 --- a/src/IFSelect/IFSelect_SelectSignature.hxx +++ /dev/null @@ -1,128 +0,0 @@ -// Created on: 1994-04-21 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_SelectSignature_HeaderFile -#define _IFSelect_SelectSignature_HeaderFile - -#include - -#include -#include -#include -#include -class IFSelect_Signature; -class IFSelect_SignCounter; -class Standard_Transient; -class Interface_Graph; -class Interface_InterfaceModel; - - -class IFSelect_SelectSignature; -DEFINE_STANDARD_HANDLE(IFSelect_SelectSignature, IFSelect_SelectExtract) - -//! A SelectSignature sorts the Entities on a Signature Matching. -//! The signature to match is given at creation time. Also, the -//! required match is given at creation time : exact (IsEqual) or -//! contains (the Type's Name must contain the criterium Text) -//! -//! Remark that no more interpretation is done, it is an -//! alpha-numeric signature : for instance, DynamicType is matched -//! as such, super-types are not considered -//! -//! Also, numeric (integer) comparisons are supported : an item -//! can be val or >=val , val being an Integer -//! -//! A SelectSignature may also be created from a SignCounter, -//! which then just gives its LastValue as SignatureValue -class IFSelect_SelectSignature : public IFSelect_SelectExtract -{ - -public: - - - //! Creates a SelectSignature with its Signature and its Text to - //! Match. - //! if True requires exact match, - //! if False requires to be contained in the Signature - //! of the entity (default is "exact") - Standard_EXPORT IFSelect_SelectSignature(const Handle(IFSelect_Signature)& matcher, const Standard_CString signtext, const Standard_Boolean exact = Standard_True); - - //! As above with an AsciiString - Standard_EXPORT IFSelect_SelectSignature(const Handle(IFSelect_Signature)& matcher, const TCollection_AsciiString& signtext, const Standard_Boolean exact = Standard_True); - - //! Creates a SelectSignature with a Counter, more precisely a - //! SelectSignature. Which is used here to just give a Signature - //! Value (by SignOnly Mode) - //! Matching is the default provided by the class Signature - Standard_EXPORT IFSelect_SelectSignature(const Handle(IFSelect_SignCounter)& matcher, const Standard_CString signtext, const Standard_Boolean exact = Standard_True); - - //! Returns the used Signature, then it is possible to access it, - //! modify it as required. Can be null, hence see Counter - Standard_EXPORT Handle(IFSelect_Signature) Signature() const; - - //! Returns the used SignCounter. Can be used as alternative for - //! Signature - Standard_EXPORT Handle(IFSelect_SignCounter) Counter() const; - - //! Returns True for an Entity (model->Value(num)) of which the - //! signature matches the text given as creation time - //! May also work with a Counter from the Graph - Standard_EXPORT virtual Standard_Boolean SortInGraph (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Interface_Graph& G) const Standard_OVERRIDE; - - //! Not called, defined only to remove a deferred method here - Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - //! Returns Text used to Sort Entity on its Signature or SignCounter - Standard_EXPORT const TCollection_AsciiString& SignatureText() const; - - //! Returns True if match must be exact - Standard_EXPORT Standard_Boolean IsExact() const; - - //! Returns a text defining the criterium. - //! (it refers to the text and exact flag to be matched, and is - //! qualified by the Name provided by the Signature) - Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectSignature,IFSelect_SelectExtract) - -protected: - - - - -private: - - - Handle(IFSelect_Signature) thematcher; - Handle(IFSelect_SignCounter) thecounter; - TCollection_AsciiString thesigntext; - Standard_Integer theexact; - TColStd_SequenceOfAsciiString thesignlist; - TColStd_SequenceOfInteger thesignmode; - - -}; - - - - - - - -#endif // _IFSelect_SelectSignature_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectSignedShared.cxx b/src/IFSelect/IFSelect_SelectSignedShared.cxx deleted file mode 100644 index ccaa577f0e..0000000000 --- a/src/IFSelect/IFSelect_SelectSignedShared.cxx +++ /dev/null @@ -1,71 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectSignedShared,IFSelect_SelectExplore) - -IFSelect_SelectSignedShared::IFSelect_SelectSignedShared - (const Handle(IFSelect_Signature)& matcher, - const Standard_CString signtext, const Standard_Boolean exact, - const Standard_Integer level) - : IFSelect_SelectExplore (level) , - thematcher (matcher) , thesigntext (signtext) , theexact (exact) { } - - Handle(IFSelect_Signature) IFSelect_SelectSignedShared::Signature () const - { return thematcher; } - - const TCollection_AsciiString& IFSelect_SelectSignedShared::SignatureText () const - { return thesigntext; } - - Standard_Boolean IFSelect_SelectSignedShared::IsExact () const - { return theexact; } - - - Standard_Boolean IFSelect_SelectSignedShared::Explore - (const Standard_Integer level, const Handle(Standard_Transient)& ent, - const Interface_Graph& G, Interface_EntityIterator& explored) const -{ - if (thematcher->Matches (ent,G.Model(),thesigntext,theexact)) return Standard_True; - -// sinon, on fait le tri ici - Interface_EntityIterator list = G.Shareds (ent); -// Si plus de Shared, alors c est cuit - if (list.NbEntities() == 0) return Standard_False; - -// Sinon, trier si on est au niveau - if (level < Level()) { explored = list; return Standard_True; } - for (list.Start(); list.More(); list.Next()) { - if (thematcher->Matches (list.Value(),G.Model(),thesigntext,theexact)) - explored.AddItem (list.Value()); - } - return Standard_True; -} - - - TCollection_AsciiString IFSelect_SelectSignedShared::ExploreLabel () const -{ - TCollection_AsciiString lab("Shared,"); - lab.AssignCat (thematcher->Name()); - if (theexact) lab.AssignCat(" matching "); - else lab.AssignCat(" containing "); - lab.AssignCat(thesigntext); - return lab; -} diff --git a/src/IFSelect/IFSelect_SelectSignedShared.hxx b/src/IFSelect/IFSelect_SelectSignedShared.hxx deleted file mode 100644 index fe1fb67f6a..0000000000 --- a/src/IFSelect/IFSelect_SelectSignedShared.hxx +++ /dev/null @@ -1,94 +0,0 @@ -// Created on: 1996-09-25 -// Created by: Christian CAILLET -// Copyright (c) 1996-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 _IFSelect_SelectSignedShared_HeaderFile -#define _IFSelect_SelectSignedShared_HeaderFile - -#include - -#include -#include -#include -class IFSelect_Signature; -class Standard_Transient; -class Interface_Graph; -class Interface_EntityIterator; - - -class IFSelect_SelectSignedShared; -DEFINE_STANDARD_HANDLE(IFSelect_SelectSignedShared, IFSelect_SelectExplore) - -//! In the graph, explore the Shareds of the input entities, -//! until it encounters some which match a given Signature -//! (for a limited level, filters the returned list) -//! By default, fitted for any level -class IFSelect_SelectSignedShared : public IFSelect_SelectExplore -{ - -public: - - - //! Creates a SelectSignedShared, defaulted for any level - //! with a given Signature and text to match - Standard_EXPORT IFSelect_SelectSignedShared(const Handle(IFSelect_Signature)& matcher, const Standard_CString signtext, const Standard_Boolean exact = Standard_True, const Standard_Integer level = 0); - - //! Returns the used Signature, then it is possible to access it, - //! modify it as required - Standard_EXPORT Handle(IFSelect_Signature) Signature() const; - - //! Returns Text used to Sort Entity on its Signature - Standard_EXPORT const TCollection_AsciiString& SignatureText() const; - - //! Returns True if match must be exact - Standard_EXPORT Standard_Boolean IsExact() const; - - //! Explores an entity : its Shared entities - //! to take if it matches the Signature - //! At level max, filters the result. Else gives all Shareds - Standard_EXPORT Standard_Boolean Explore (const Standard_Integer level, const Handle(Standard_Transient)& ent, const Interface_Graph& G, Interface_EntityIterator& explored) const Standard_OVERRIDE; - - //! Returns a text defining the criterium. - //! (it refers to the text and exact flag to be matched, and is - //! qualified by the Name provided by the Signature) - Standard_EXPORT TCollection_AsciiString ExploreLabel() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectSignedShared,IFSelect_SelectExplore) - -protected: - - - - -private: - - - Handle(IFSelect_Signature) thematcher; - TCollection_AsciiString thesigntext; - Standard_Boolean theexact; - - -}; - - - - - - - -#endif // _IFSelect_SelectSignedShared_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectSignedSharing.cxx b/src/IFSelect/IFSelect_SelectSignedSharing.cxx deleted file mode 100644 index dcf39f7eec..0000000000 --- a/src/IFSelect/IFSelect_SelectSignedSharing.cxx +++ /dev/null @@ -1,71 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectSignedSharing,IFSelect_SelectExplore) - -IFSelect_SelectSignedSharing::IFSelect_SelectSignedSharing - (const Handle(IFSelect_Signature)& matcher, - const Standard_CString signtext, const Standard_Boolean exact, - const Standard_Integer level) - : IFSelect_SelectExplore (level) , - thematcher (matcher) , thesigntext (signtext) , theexact (exact) { } - - Handle(IFSelect_Signature) IFSelect_SelectSignedSharing::Signature () const - { return thematcher; } - - const TCollection_AsciiString& IFSelect_SelectSignedSharing::SignatureText () const - { return thesigntext; } - - Standard_Boolean IFSelect_SelectSignedSharing::IsExact () const - { return theexact; } - - - Standard_Boolean IFSelect_SelectSignedSharing::Explore - (const Standard_Integer level, const Handle(Standard_Transient)& ent, - const Interface_Graph& G, Interface_EntityIterator& explored) const -{ - if (thematcher->Matches (ent,G.Model(),thesigntext,theexact)) return Standard_True; - -// sinon, on fait le tri ici - Interface_EntityIterator list = G.Sharings (ent); -// Si plus de Sharing, alors c est cuit - if (list.NbEntities() == 0) return Standard_False; - -// Sinon, trier si on est au niveau - if (level < Level()) { explored = list; return Standard_True; } - for (list.Start(); list.More(); list.Next()) { - if (thematcher->Matches (list.Value(),G.Model(),thesigntext,theexact)) - explored.AddItem (list.Value()); - } - return Standard_True; -} - - - TCollection_AsciiString IFSelect_SelectSignedSharing::ExploreLabel () const -{ - TCollection_AsciiString lab("Sharing,"); - lab.AssignCat (thematcher->Name()); - if (theexact) lab.AssignCat(" matching "); - else lab.AssignCat(" containing "); - lab.AssignCat(thesigntext); - return lab; -} diff --git a/src/IFSelect/IFSelect_SelectSignedSharing.hxx b/src/IFSelect/IFSelect_SelectSignedSharing.hxx deleted file mode 100644 index 95820e094e..0000000000 --- a/src/IFSelect/IFSelect_SelectSignedSharing.hxx +++ /dev/null @@ -1,94 +0,0 @@ -// Created on: 1996-09-25 -// Created by: Christian CAILLET -// Copyright (c) 1996-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 _IFSelect_SelectSignedSharing_HeaderFile -#define _IFSelect_SelectSignedSharing_HeaderFile - -#include - -#include -#include -#include -class IFSelect_Signature; -class Standard_Transient; -class Interface_Graph; -class Interface_EntityIterator; - - -class IFSelect_SelectSignedSharing; -DEFINE_STANDARD_HANDLE(IFSelect_SelectSignedSharing, IFSelect_SelectExplore) - -//! In the graph, explore the sharings of the input entities, -//! until it encounters some which match a given Signature -//! (for a limited level, filters the returned list) -//! By default, fitted for any level -class IFSelect_SelectSignedSharing : public IFSelect_SelectExplore -{ - -public: - - - //! Creates a SelectSignedSharing, defaulted for any level - //! with a given Signature and text to match - Standard_EXPORT IFSelect_SelectSignedSharing(const Handle(IFSelect_Signature)& matcher, const Standard_CString signtext, const Standard_Boolean exact = Standard_True, const Standard_Integer level = 0); - - //! Returns the used Signature, then it is possible to access it, - //! modify it as required - Standard_EXPORT Handle(IFSelect_Signature) Signature() const; - - //! Returns Text used to Sort Entity on its Signature - Standard_EXPORT const TCollection_AsciiString& SignatureText() const; - - //! Returns True if match must be exact - Standard_EXPORT Standard_Boolean IsExact() const; - - //! Explores an entity : its sharing entities - //! to take if it matches the Signature - //! At level max, filters the result. Else gives all sharings - Standard_EXPORT Standard_Boolean Explore (const Standard_Integer level, const Handle(Standard_Transient)& ent, const Interface_Graph& G, Interface_EntityIterator& explored) const Standard_OVERRIDE; - - //! Returns a text defining the criterium. - //! (it refers to the text and exact flag to be matched, and is - //! qualified by the Name provided by the Signature) - Standard_EXPORT TCollection_AsciiString ExploreLabel() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectSignedSharing,IFSelect_SelectExplore) - -protected: - - - - -private: - - - Handle(IFSelect_Signature) thematcher; - TCollection_AsciiString thesigntext; - Standard_Boolean theexact; - - -}; - - - - - - - -#endif // _IFSelect_SelectSignedSharing_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectSuite.cxx b/src/IFSelect/IFSelect_SelectSuite.cxx deleted file mode 100644 index 81a4e94ab3..0000000000 --- a/src/IFSelect/IFSelect_SelectSuite.cxx +++ /dev/null @@ -1,84 +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 -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectSuite,IFSelect_SelectDeduct) - -IFSelect_SelectSuite::IFSelect_SelectSuite () { } - - Standard_Boolean IFSelect_SelectSuite::AddInput - (const Handle(IFSelect_Selection)& item) -{ - if (item.IsNull()) return Standard_False; - Handle(IFSelect_Selection) input = Input(); - if (!input.IsNull()) return Standard_False; - Handle(IFSelect_SelectDeduct) first = Handle(IFSelect_SelectDeduct)::DownCast(item); - if (first.IsNull()) SetInput(item); - else thesel.Prepend (item); - return Standard_True; -} - - void IFSelect_SelectSuite::AddPrevious - (const Handle(IFSelect_SelectDeduct)& item) - { if (!item.IsNull()) thesel.Prepend (item); } - - void IFSelect_SelectSuite::AddNext - (const Handle(IFSelect_SelectDeduct)& item) - { if (!item.IsNull()) thesel.Append (item); } - - Standard_Integer IFSelect_SelectSuite::NbItems () const - { return thesel.Length(); } - - Handle(IFSelect_SelectDeduct) IFSelect_SelectSuite::Item - (const Standard_Integer num) const - { return Handle(IFSelect_SelectDeduct)::DownCast(thesel.Value(num)); } - - void IFSelect_SelectSuite::SetLabel (const Standard_CString lab) - { thelab.Clear(); thelab.AssignCat (lab); } - - - Interface_EntityIterator IFSelect_SelectSuite::RootResult - (const Interface_Graph& G) const -{ - Interface_EntityIterator iter; - Standard_Boolean firstin = (HasInput() || HasAlternate()); - if (firstin) iter = InputResult(G); -// Demarrage : on prend l Input/Alternate SI un des 2 est mis -// Sinon, on demarre sur la definition de base de la premiere selection - - Standard_Integer i, nb = NbItems(); - for (i = 1; i <= nb; i ++) { - Handle(IFSelect_SelectDeduct) anitem = Item(i); - if (firstin) anitem->Alternate()->SetList (iter.Content()); - firstin = Standard_True; // ensuite c est systematique - iter = anitem->UniqueResult(G); - } - return iter; -} - - TCollection_AsciiString IFSelect_SelectSuite::Label () const -{ - if (thelab.Length() > 0) return thelab; - char txt[100]; - sprintf (txt,"Suite of %d Selections",NbItems()); - TCollection_AsciiString lab(txt); - return lab; -} diff --git a/src/IFSelect/IFSelect_SelectSuite.hxx b/src/IFSelect/IFSelect_SelectSuite.hxx deleted file mode 100644 index 9e5907e60f..0000000000 --- a/src/IFSelect/IFSelect_SelectSuite.hxx +++ /dev/null @@ -1,121 +0,0 @@ -// Created on: 1998-10-19 -// Created by: Christian CAILLET -// Copyright (c) 1998-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 _IFSelect_SelectSuite_HeaderFile -#define _IFSelect_SelectSuite_HeaderFile - -#include -#include - -#include -#include -#include -#include -#include -class IFSelect_Selection; -class Interface_EntityIterator; -class Interface_Graph; - - -class IFSelect_SelectSuite; -DEFINE_STANDARD_HANDLE(IFSelect_SelectSuite, IFSelect_SelectDeduct) - -//! A SelectSuite can describe a suite of SelectDeduct as a unique -//! one : in other words, it can be seen as a "macro selection" -//! -//! It works by applying each of its items (which is a -//! SelectDeduct) on the result computed by the previous one -//! (by using Alternate Input) -//! -//! But each of these Selections used as items may be used -//! independently, it will then give its own result -//! -//! Hence, SelectSuite gives a way of defining a new Selection -//! from existing ones, without having to do copies or saves -class IFSelect_SelectSuite : public IFSelect_SelectDeduct -{ - -public: - - - //! Creates an empty SelectSuite - Standard_EXPORT IFSelect_SelectSuite(); - - //! Adds an input selection. I.E. : - //! If is a SelectDeduct, adds it as Previous, not as Input - //! Else, sets it as Input - //! Returns True when done - //! Returns False and refuses to work if Input is already defined - Standard_EXPORT Standard_Boolean AddInput (const Handle(IFSelect_Selection)& item); - - //! Adds a new first item (prepends to the list). The Input is not - //! touched - //! If is null, does nothing - Standard_EXPORT void AddPrevious (const Handle(IFSelect_SelectDeduct)& item); - - //! Adds a new last item (prepends to the list) - //! If is null, does nothing - Standard_EXPORT void AddNext (const Handle(IFSelect_SelectDeduct)& item); - - //! Returns the count of Items - Standard_EXPORT Standard_Integer NbItems() const; - - //! Returns an item from its rank in the list - //! (the Input is always apart) - Standard_EXPORT Handle(IFSelect_SelectDeduct) Item (const Standard_Integer num) const; - - //! Sets a value for the Label - Standard_EXPORT void SetLabel (const Standard_CString lab); - - //! Returns the list of selected entities - //! To do this, once InputResult has been taken (if Input or - //! Alternate has been defined, else the first Item gives it) : - //! this result is set as alternate input for the first item, - //! which computes its result : this result is set as alternate - //! input for the second item, etc... - Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns the Label - //! Either it has been defined by SetLabel, or it will give - //! "Suite of nn Selections" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectSuite,IFSelect_SelectDeduct) - -protected: - - - - -private: - - - TCollection_AsciiString thelab; - TColStd_SequenceOfTransient thesel; - - -}; - - - - - - - -#endif // _IFSelect_SelectSuite_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectType.cxx b/src/IFSelect/IFSelect_SelectType.cxx deleted file mode 100644 index 337bf7634a..0000000000 --- a/src/IFSelect/IFSelect_SelectType.cxx +++ /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. - - -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectType,IFSelect_SelectAnyType) - -IFSelect_SelectType::IFSelect_SelectType () - { thetype = STANDARD_TYPE(Standard_Transient); } - - IFSelect_SelectType::IFSelect_SelectType (const Handle(Standard_Type)& atype) - { thetype = atype; } - - void IFSelect_SelectType::SetType (const Handle(Standard_Type)& atype) - { thetype = atype; } - - Handle(Standard_Type) IFSelect_SelectType::TypeForMatch () const - { return thetype; } - - TCollection_AsciiString IFSelect_SelectType::ExtractLabel () const - { return TCollection_AsciiString(thetype->Name()); } diff --git a/src/IFSelect/IFSelect_SelectType.hxx b/src/IFSelect/IFSelect_SelectType.hxx deleted file mode 100644 index 2940470202..0000000000 --- a/src/IFSelect/IFSelect_SelectType.hxx +++ /dev/null @@ -1,80 +0,0 @@ -// Created on: 1992-11-18 -// 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 _IFSelect_SelectType_HeaderFile -#define _IFSelect_SelectType_HeaderFile - -#include -#include - -#include -#include -class TCollection_AsciiString; - - -class IFSelect_SelectType; -DEFINE_STANDARD_HANDLE(IFSelect_SelectType, IFSelect_SelectAnyType) - -//! A SelectType keeps or rejects Entities of which the Type -//! is Kind of a given Cdl Type -class IFSelect_SelectType : public IFSelect_SelectAnyType -{ - -public: - - - //! Creates a SelectType. Default is no filter - Standard_EXPORT IFSelect_SelectType(); - - //! Creates a SelectType for a given Type - Standard_EXPORT IFSelect_SelectType(const Handle(Standard_Type)& atype); - - //! Sets a TYpe for filter - Standard_EXPORT void SetType (const Handle(Standard_Type)& atype); - - //! Returns the Type to be matched for select : this is the type - //! given at instantiation time - Standard_EXPORT Handle(Standard_Type) TypeForMatch() const Standard_OVERRIDE; - - //! Returns a text defining the criterium. - //! (should by gotten from Type of Entity used for instantiation) - Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectType,IFSelect_SelectAnyType) - -protected: - - - - -private: - - - Handle(Standard_Type) thetype; - - -}; - - - - - - - -#endif // _IFSelect_SelectType_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectUnion.cxx b/src/IFSelect/IFSelect_SelectUnion.cxx deleted file mode 100644 index c38ad3de45..0000000000 --- a/src/IFSelect/IFSelect_SelectUnion.cxx +++ /dev/null @@ -1,38 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectUnion,IFSelect_SelectCombine) - -IFSelect_SelectUnion::IFSelect_SelectUnion () { } - - - Interface_EntityIterator IFSelect_SelectUnion::RootResult - (const Interface_Graph& G) const -{ - IFGraph_Cumulate GC(G); - Standard_Integer nb = NbInputs(); - for (Standard_Integer i = 1; i <= nb; i ++) - GC.GetFromIter(Input(i)->RootResult(G)); - return GC.Result(); -} - - TCollection_AsciiString IFSelect_SelectUnion::Label () const - { return TCollection_AsciiString("Union (OR)"); } diff --git a/src/IFSelect/IFSelect_SelectUnion.hxx b/src/IFSelect/IFSelect_SelectUnion.hxx deleted file mode 100644 index 39acf687f3..0000000000 --- a/src/IFSelect/IFSelect_SelectUnion.hxx +++ /dev/null @@ -1,73 +0,0 @@ -// Created on: 1993-01-11 -// 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 _IFSelect_SelectUnion_HeaderFile -#define _IFSelect_SelectUnion_HeaderFile - -#include -#include - -#include -class Interface_EntityIterator; -class Interface_Graph; -class TCollection_AsciiString; - - -class IFSelect_SelectUnion; -DEFINE_STANDARD_HANDLE(IFSelect_SelectUnion, IFSelect_SelectCombine) - -//! A SelectUnion cumulates the Entities issued from several other -//! Selections (union of results : "OR" operator) -class IFSelect_SelectUnion : public IFSelect_SelectCombine -{ - -public: - - - //! Creates an empty SelectUnion - Standard_EXPORT IFSelect_SelectUnion(); - - //! Returns the list of selected Entities, which is the addition - //! result from all input selections. Uniqueness is guaranteed. - Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : "Union (OR)" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectUnion,IFSelect_SelectCombine) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SelectUnion_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectUnknownEntities.cxx b/src/IFSelect/IFSelect_SelectUnknownEntities.cxx deleted file mode 100644 index c8391a9a4b..0000000000 --- a/src/IFSelect/IFSelect_SelectUnknownEntities.cxx +++ /dev/null @@ -1,31 +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(IFSelect_SelectUnknownEntities,IFSelect_SelectExtract) - -IFSelect_SelectUnknownEntities::IFSelect_SelectUnknownEntities () { } - - Standard_Boolean IFSelect_SelectUnknownEntities::Sort - (const Standard_Integer , const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model) const - { return model->IsUnknownEntity(model->Number(ent)); } - - TCollection_AsciiString IFSelect_SelectUnknownEntities::ExtractLabel () const - { return TCollection_AsciiString("Unrecognized type Entities"); } diff --git a/src/IFSelect/IFSelect_SelectUnknownEntities.hxx b/src/IFSelect/IFSelect_SelectUnknownEntities.hxx deleted file mode 100644 index 7a2c2d7ff1..0000000000 --- a/src/IFSelect/IFSelect_SelectUnknownEntities.hxx +++ /dev/null @@ -1,74 +0,0 @@ -// Created on: 1992-11-18 -// 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 _IFSelect_SelectUnknownEntities_HeaderFile -#define _IFSelect_SelectUnknownEntities_HeaderFile - -#include -#include - -#include -#include -class Standard_Transient; -class Interface_InterfaceModel; -class TCollection_AsciiString; - - -class IFSelect_SelectUnknownEntities; -DEFINE_STANDARD_HANDLE(IFSelect_SelectUnknownEntities, IFSelect_SelectExtract) - -//! A SelectUnknownEntities sorts the Entities which are qualified -//! as "Unknown" (their Type has not been recognized) -class IFSelect_SelectUnknownEntities : public IFSelect_SelectExtract -{ - -public: - - - //! Creates a SelectUnknownEntities - Standard_EXPORT IFSelect_SelectUnknownEntities(); - - //! Returns True for an Entity which is qualified as "Unknown", - //! i.e. if known (through its Number) as Unknown - Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - //! Returns a text defining the criterium : "Recognized Entities" - Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SelectUnknownEntities,IFSelect_SelectExtract) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SelectUnknownEntities_HeaderFile diff --git a/src/IFSelect/IFSelect_Selection.cxx b/src/IFSelect/IFSelect_Selection.cxx deleted file mode 100644 index 0fcc5ef743..0000000000 --- a/src/IFSelect/IFSelect_Selection.cxx +++ /dev/null @@ -1,53 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_Selection,Standard_Transient) - -Standard_Boolean IFSelect_Selection::HasUniqueResult () const - { return Standard_False; } // eminemment redefinissable - -// UniqueResult, c est RootResult passe par une Map (-> mis a plat) - - Interface_EntityIterator IFSelect_Selection::UniqueResult - (const Interface_Graph& G) const -{ - Interface_EntityIterator iter = RootResult(G); - if (HasUniqueResult() || !G.ModeStat()) - return iter; - Interface_Graph GG(G); - GG.GetFromIter(iter,0); - return Interface_GraphContent(GG); // EntityIterator specialise (meme taille) -} - -// CompleteResult, c est RootResult + propagation du partage (Shareds) - - Interface_EntityIterator IFSelect_Selection::CompleteResult - (const Interface_Graph& G) const -{ - Interface_EntityIterator iter = RootResult(G); -// On peut utiliser le Graphe a present - Interface_Graph GG(G); - for (iter.Start(); iter.More(); iter.Next()) { - Handle(Standard_Transient) ent = iter.Value(); - GG.GetFromEntity(ent,Standard_True); // et voila - } - return Interface_GraphContent(GG); // EntityIterator specialise (meme taille) -} diff --git a/src/IFSelect/IFSelect_Selection.hxx b/src/IFSelect/IFSelect_Selection.hxx deleted file mode 100644 index 00e386f4ce..0000000000 --- a/src/IFSelect/IFSelect_Selection.hxx +++ /dev/null @@ -1,83 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_Selection_HeaderFile -#define _IFSelect_Selection_HeaderFile - -#include -#include - -#include -class Interface_EntityIterator; -class Interface_Graph; -class IFSelect_SelectionIterator; -class TCollection_AsciiString; - -class IFSelect_Selection; -DEFINE_STANDARD_HANDLE(IFSelect_Selection, Standard_Transient) - -//! A Selection allows to define a set of Interface Entities. -//! Entities to be put on an output file should be identified in -//! a way as independent from such or such execution as possible. -//! This permits to handle comprehensive criteria, and to replay -//! them when a new variant of an input file has to be processed. -//! -//! Its input can be, either an Interface Model (the very source), -//! or another-other Selection(s) or any other output. -//! All list computations start from an input Graph (from IFGraph) -class IFSelect_Selection : public Standard_Transient -{ - -public: - - //! Returns the list of selected entities, computed from Input - //! given as a Graph. Specific to each class of Selection - //! Note that uniqueness of each entity is not required here - //! This method can raise an exception as necessary - Standard_EXPORT virtual Interface_EntityIterator RootResult (const Interface_Graph& G) const = 0; - - //! Returns the list of selected entities, each of them being - //! unique. Default definition works from RootResult. According - //! HasUniqueResult, UniqueResult returns directly RootResult, - //! or build a Unique Result from it with a Graph. - Standard_EXPORT Interface_EntityIterator UniqueResult (const Interface_Graph& G) const; - - //! Returns the list of entities involved by a Selection, i.e. - //! UniqueResult plus the shared entities (directly or not) - Standard_EXPORT virtual Interface_EntityIterator CompleteResult (const Interface_Graph& G) const; - - //! Puts in an Iterator the Selections from which "me" depends - //! (there can be zero, or one, or a list). - //! Specific to each class of Selection - Standard_EXPORT virtual void FillIterator (IFSelect_SelectionIterator& iter) const = 0; - - //! Returns a text which defines the criterium applied by a - //! Selection (can be used to be printed, displayed ...) - //! Specific to each class - Standard_EXPORT virtual TCollection_AsciiString Label() const = 0; - - DEFINE_STANDARD_RTTIEXT(IFSelect_Selection,Standard_Transient) - -protected: - - //! Returns True if RootResult guarantees uniqueness for each - //! Entity. Called by UniqueResult. - //! Default answer is False. Can be redefined. - Standard_EXPORT virtual Standard_Boolean HasUniqueResult() const; - -}; - -#endif // _IFSelect_Selection_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectionIterator.cxx b/src/IFSelect/IFSelect_SelectionIterator.cxx deleted file mode 100644 index 50a2d93f58..0000000000 --- a/src/IFSelect/IFSelect_SelectionIterator.cxx +++ /dev/null @@ -1,54 +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 - -IFSelect_SelectionIterator::IFSelect_SelectionIterator () -{ - thecurr = 1; - thelist = new IFSelect_HSeqOfSelection(); -} - - IFSelect_SelectionIterator::IFSelect_SelectionIterator - (const Handle(IFSelect_Selection)& sel) -{ - thecurr = 1; - thelist = new IFSelect_HSeqOfSelection(); - sel->FillIterator(*this); -} - - void IFSelect_SelectionIterator::AddFromIter (IFSelect_SelectionIterator& iter) - { for (; iter.More(); iter.Next()) AddItem(iter.Value()); } - - void IFSelect_SelectionIterator::AddItem - (const Handle(IFSelect_Selection)& sel) - { if (!sel.IsNull()) thelist->Append(sel); } - - void IFSelect_SelectionIterator::AddList - (const IFSelect_TSeqOfSelection& list) -{ - Standard_Integer nb = list.Length(); // Pas Handle Handle - for (Standard_Integer i = 1; i <= nb; i ++) thelist->Append(list.Value(i)); -} - - Standard_Boolean IFSelect_SelectionIterator::More () const - { return (thecurr <= thelist->Length()); } - - void IFSelect_SelectionIterator::Next () - { thecurr ++; } - - const Handle(IFSelect_Selection)& IFSelect_SelectionIterator::Value () const - { return thelist->Value(thecurr); } diff --git a/src/IFSelect/IFSelect_SelectionIterator.hxx b/src/IFSelect/IFSelect_SelectionIterator.hxx deleted file mode 100644 index 60b8a79878..0000000000 --- a/src/IFSelect/IFSelect_SelectionIterator.hxx +++ /dev/null @@ -1,71 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_SelectionIterator_HeaderFile -#define _IFSelect_SelectionIterator_HeaderFile - -#include -#include -#include - -#include -#include -#include -class IFSelect_Selection; - -//! Defines an Iterator on a list of Selections -class IFSelect_SelectionIterator -{ -public: - - DEFINE_STANDARD_ALLOC - - //! Creates an empty iterator, ready to be filled - Standard_EXPORT IFSelect_SelectionIterator(); - - //! Creates an iterator from a Selection : it lists the Selections - //! from which depends (given by its method FillIterator) - Standard_EXPORT IFSelect_SelectionIterator(const Handle(IFSelect_Selection)& sel); - - //! Adds to an iterator the content of another one - //! (each selection is present only once in the result) - Standard_EXPORT void AddFromIter (IFSelect_SelectionIterator& iter); - - //! Adds a Selection to an iterator (if not yet noted) - Standard_EXPORT void AddItem (const Handle(IFSelect_Selection)& sel); - - //! Adds a list of Selections to an iterator (this list comes - //! from the description of a Selection or a Dispatch, etc...) - Standard_EXPORT void AddList (const IFSelect_TSeqOfSelection& list); - - //! Returns True if there are more Selections to get - Standard_EXPORT Standard_Boolean More() const; - - //! Sets iterator to the next item - Standard_EXPORT void Next(); - - //! Returns the current Selection being iterated - //! Error if count of Selection has been passed - Standard_EXPORT const Handle(IFSelect_Selection)& Value() const; - -private: - - Standard_Integer thecurr; - Handle(IFSelect_HSeqOfSelection) thelist; - -}; - -#endif // _IFSelect_SelectionIterator_HeaderFile diff --git a/src/IFSelect/IFSelect_SequenceOfAppliedModifiers.hxx b/src/IFSelect/IFSelect_SequenceOfAppliedModifiers.hxx deleted file mode 100644 index c6ae78a2db..0000000000 --- a/src/IFSelect/IFSelect_SequenceOfAppliedModifiers.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// Created on: 1992-09-21 -// 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 IFSelect_SequenceOfAppliedModifiers_HeaderFile -#define IFSelect_SequenceOfAppliedModifiers_HeaderFile - -#include -#include - -typedef NCollection_Sequence IFSelect_SequenceOfAppliedModifiers; - - -#endif diff --git a/src/IFSelect/IFSelect_SequenceOfGeneralModifier.hxx b/src/IFSelect/IFSelect_SequenceOfGeneralModifier.hxx deleted file mode 100644 index ad292c62ce..0000000000 --- a/src/IFSelect/IFSelect_SequenceOfGeneralModifier.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// Created on: 1992-09-21 -// 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 IFSelect_SequenceOfGeneralModifier_HeaderFile -#define IFSelect_SequenceOfGeneralModifier_HeaderFile - -#include -#include - -typedef NCollection_Sequence IFSelect_SequenceOfGeneralModifier; - - -#endif diff --git a/src/IFSelect/IFSelect_SequenceOfInterfaceModel.hxx b/src/IFSelect/IFSelect_SequenceOfInterfaceModel.hxx deleted file mode 100644 index 3ff437ddf8..0000000000 --- a/src/IFSelect/IFSelect_SequenceOfInterfaceModel.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// Created on: 1992-09-21 -// 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 IFSelect_SequenceOfInterfaceModel_HeaderFile -#define IFSelect_SequenceOfInterfaceModel_HeaderFile - -#include -#include - -typedef NCollection_Sequence IFSelect_SequenceOfInterfaceModel; - - -#endif diff --git a/src/IFSelect/IFSelect_SessionDumper.cxx b/src/IFSelect/IFSelect_SessionDumper.cxx deleted file mode 100644 index f94c25c071..0000000000 --- a/src/IFSelect/IFSelect_SessionDumper.cxx +++ /dev/null @@ -1,41 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SessionDumper,Standard_Transient) - -static Handle(IFSelect_SessionDumper) thefirst; -static int cefait = 0; -// On commence la serie avec celui-la - - - IFSelect_SessionDumper::IFSelect_SessionDumper () -{ - if (!cefait) - { cefait = 1; Handle(IFSelect_BasicDumper) bid = new IFSelect_BasicDumper; } - else thenext = thefirst; - thefirst = this; // as Handle -} - - Handle(IFSelect_SessionDumper) IFSelect_SessionDumper::First () - { return thefirst; } - - Handle(IFSelect_SessionDumper) IFSelect_SessionDumper::Next () const - { return thenext; } diff --git a/src/IFSelect/IFSelect_SessionDumper.hxx b/src/IFSelect/IFSelect_SessionDumper.hxx deleted file mode 100644 index 1c89af0096..0000000000 --- a/src/IFSelect/IFSelect_SessionDumper.hxx +++ /dev/null @@ -1,119 +0,0 @@ -// Created on: 1993-11-04 -// 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 _IFSelect_SessionDumper_HeaderFile -#define _IFSelect_SessionDumper_HeaderFile - -#include -#include - -#include -class IFSelect_SessionFile; -class TCollection_AsciiString; - - -class IFSelect_SessionDumper; -DEFINE_STANDARD_HANDLE(IFSelect_SessionDumper, Standard_Transient) - -//! A SessionDumper is called by SessionFile. It takes into -//! account a set of classes (such as Selections, Dispatches ...). -//! SessionFile writes the Type (as defined by cdl) of each Item -//! and its general Parameters. It manages the names of the Items. -//! -//! A SessionDumper must be able to Write the Parameters which are -//! own of each Item it takes into account, given its Class, then -//! to Recognize the Type and Read its Own Parameters to create -//! an Item of this Type with these own Parameters. -//! -//! Then, there must be defined one sub-type of SessionDumper per -//! consistent set of classes (e.g. a package). -//! -//! By Own Parameters, understand Parameters given at Creation Time -//! if there are, or specific of a given class, apart from those -//! defined at superclass levels (e.g. Final Selection for a -//! Dispatch, Input Selection for a SelectExtract or SelectDeduct, -//! Direct Status for a SelectExtract, etc...). -//! -//! The Parameters are those stored in a WorkSession, they can be -//! of Types : IntParam, HAsciiString (for TextParam), Selection, -//! Dispatch. -//! -//! SessionDumpers are organized in a Library which is used by -//! SessionFile. They are put at Creation Time in this Library. -class IFSelect_SessionDumper : public Standard_Transient -{ - -public: - - - //! Returns the First item of the Library of Dumper. The Next ones - //! are then obtained by Next on the returned items - Standard_EXPORT static Handle(IFSelect_SessionDumper) First(); - - //! Returns the Next SesionDumper in the Library. Returns a Null - //! Handle at the End. - Standard_EXPORT Handle(IFSelect_SessionDumper) Next() const; - - //! Writes the Own Parameters of a given Item, if it forecast to - //! manage its Type. - //! Returns True if it has recognized the Type of the Item (in - //! this case, it is assumed to have written the Own Parameters if - //! there are some), False else : in that case, SessionFile will - //! try another SessionDumper in the Library. - //! WriteOwn can use these methods from SessionFile : SendVoid, - //! SendItem, SendText, and if necessary, WorkSession. - Standard_EXPORT virtual Standard_Boolean WriteOwn (IFSelect_SessionFile& file, const Handle(Standard_Transient)& item) const = 0; - - //! Recognizes a Type (given as ) then Creates an Item of - //! this Type with the Own Parameter, as required. - //! Returns True if it has recognized the Type (in this case, it - //! is assumed to have created the Item, returned as ), - //! False else : in that case, SessionFile will try another - //! SessionDumper in the Library. - //! ReadOwn can use these methods from SessionFile to access Own - //! Parameters : NbOwnParams, IsVoid, IsText, TextValue, ItemValue - Standard_EXPORT virtual Standard_Boolean ReadOwn (IFSelect_SessionFile& file, const TCollection_AsciiString& type, Handle(Standard_Transient)& item) const = 0; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SessionDumper,Standard_Transient) - -protected: - - - //! The Initialization puts a just created SessionDumper in the - //! Library of SessionDumper. Then, it suffices to create once - //! a SessionDumper to fill the Library with it - Standard_EXPORT IFSelect_SessionDumper(); - - - -private: - - - Handle(IFSelect_SessionDumper) thenext; - - -}; - - - - - - - -#endif // _IFSelect_SessionDumper_HeaderFile diff --git a/src/IFSelect/IFSelect_SessionFile.cxx b/src/IFSelect/IFSelect_SessionFile.cxx deleted file mode 100644 index 0f60292faf..0000000000 --- a/src/IFSelect/IFSelect_SessionFile.cxx +++ /dev/null @@ -1,883 +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 -static int deja = 0; - - - IFSelect_SessionFile::IFSelect_SessionFile - (const Handle(IFSelect_WorkSession)& WS) -{ - ClearLines(); - themode = Standard_False; - if (!deja) { // au moins celui-la : - Handle(IFSelect_BasicDumper) basedumper = new IFSelect_BasicDumper; - deja = 1; - } - thedone = Standard_False; - thelastgen = 0; - thesess = WS; -} - - IFSelect_SessionFile::IFSelect_SessionFile - (const Handle(IFSelect_WorkSession)& WS, const Standard_CString filename) -{ - ClearLines(); - themode = Standard_True; - if (!deja) { // au moins celui-la : - Handle(IFSelect_BasicDumper) basedumper = new IFSelect_BasicDumper; - deja = 1; - } - thedone = Standard_False; - theownflag = Standard_False; - thelastgen = 0; - thesess = WS; - thedone = (Write (filename) == 0); -// Close fait par Write (selon les cas) -} - - - void IFSelect_SessionFile::ClearLines () - { thelist.Clear(); thenl = 0; } - - Standard_Integer IFSelect_SessionFile::NbLines () const - { return thelist.Length(); } - - - const TCollection_AsciiString& IFSelect_SessionFile::Line - (const Standard_Integer num) const - { return thelist.Value(num); } - - - void IFSelect_SessionFile::AddLine (const Standard_CString line) - { thelist.Append (TCollection_AsciiString(line) ); } - - void IFSelect_SessionFile::RemoveLastLine () - { if (thelist.Length() > 1) thelist.Remove(thelist.Length()); } - - - Standard_Boolean IFSelect_SessionFile::WriteFile - (const Standard_CString filename) -{ - FILE* lefic = OSD_OpenFile(filename,"w"); - Standard_Integer nbl = thelist.Length(); - for (Standard_Integer i = 1; i <= nbl; i ++) - fprintf (lefic,"%s\n",thelist.Value(i).ToCString()); - fclose ( lefic ); - ClearLines(); - return Standard_True; -} - - Standard_Boolean IFSelect_SessionFile::ReadFile - (const Standard_CString filename) -{ - char ligne[201]; - FILE* lefic = OSD_OpenFile(filename,"r"); - if (!lefic) return Standard_False; - ClearLines(); -// read mode : lire les lignes -// On charge le fichier dans "thelist" - Standard_Boolean header = Standard_False; - for(;;) { - ligne[0] = '\0'; - if (fgets(ligne,200,lefic) == NULL - || feof(lefic) != 0) - { - break; - } - if (ligne[0] == '\0') continue; -// D abord ligne initiale ? - if (!header) - { if (!RecognizeFile(ligne)) break; header = Standard_True; } - ligne[200] = '\0'; // fin forcee ... - TCollection_AsciiString onemore(ligne); - thelist.Append(onemore); - } - fclose ( lefic ); - return header; -} - - Standard_Boolean IFSelect_SessionFile::RecognizeFile - (const Standard_CString headerline) -{ - Message_Messenger::StreamBuffer sout = Message::SendInfo(); - - SplitLine (headerline); - if (theline.Length() != 4) { sout<<"File Form Incorrect"<DynamicType(); - if (!theline.Value(1).IsEqual("!XSTEP") || - !theline.Value(2).IsEqual("SESSION") || - !theline.Value(4).IsEqual(sesstype->Name()) ) - { sout<<"Lineno."<MaxIdent(); - thenums = new TColStd_HArray1OfInteger (0,nbidents); thenums->Init(0); - Standard_Integer i; // svv Jan11 2000 : porting on DEC - for ( i = 1; i <= nbidents; i ++) { - Handle(Standard_Transient) item = thesess->Item(i); - if (!item.IsNull()) thenums->SetValue(i,-1); - } - -// ... ECRITURE - sprintf (laligne,"!XSTEP SESSION V1 %s",thesess->DynamicType()->Name()); - WriteLine(laligne,'\n'); - sprintf (laligne,"!GENERALS"); - WriteLine(laligne,'\n'); - sprintf (laligne,"ErrorHandle %d", (thesess->ErrorHandle() ? 1 : 0)); - WriteLine(laligne,'\n'); - Handle(TColStd_HSequenceOfInteger) idents; - Standard_Integer nb; - Handle(TCollection_HAsciiString) name; - - idents = thesess->ItemIdents(STANDARD_TYPE(IFSelect_IntParam)); - nb = idents->Length(); - if (nb > 0) WriteLine ("!INTEGERS",'\n'); - Standard_Integer j; // svv Jan11 2000 : porting on DEC - for (j = 1; j <= nb; j ++) { - i = idents->Value(j); - Handle(IFSelect_IntParam) P = thesess->IntParam(i); - name = thesess->Name(P); - if (name.IsNull()) { - thenewnum ++; idents->SetValue(i,thenewnum); - sprintf(laligne," #%d %d",thenewnum,P->Value()); - } - else sprintf(laligne," %s %d",name->ToCString(),P->Value()); - WriteLine(laligne,'\n'); - } - - idents = thesess->ItemIdents(STANDARD_TYPE(TCollection_HAsciiString)); - nb = idents->Length(); - if (nb > 0) WriteLine ("!TEXTS",'\n'); - for (j = 1; j <= nb; j ++) { - i = idents->Value(j); - Handle(TCollection_HAsciiString) P = thesess->TextParam(i); - name = thesess->Name(P); - if (name.IsNull()) { - thenewnum ++; thenums->SetValue(i,thenewnum); - sprintf(laligne," #%d %s",thenewnum,P->ToCString()); - } - else sprintf(laligne," %s %s",name->ToCString(),P->ToCString()); - WriteLine(laligne,'\n'); - } - - idents = thesess->ItemIdents(STANDARD_TYPE(IFSelect_Selection)); - nb = idents->Length(); - if (nb > 0) WriteLine ("!SELECTIONS",'\n'); - for (j = 1; j <= nb; j ++) { - i = idents->Value(j); - Handle(IFSelect_Selection) P = thesess->Selection(i); - NewItem (i,P); -// .. Ecritures particulieres -// -> Traiter les principaux sous-types : Extract,AnyList,AnyType - DeclareAndCast(IFSelect_SelectExtract,sxt,P); - if (!sxt.IsNull()) { - sprintf(laligne," %c", (sxt->IsDirect() ? 'D' : 'R')); - WriteLine(laligne); - } - DeclareAndCast(IFSelect_SelectAnyList,sli,P); - if (!sli.IsNull()) { - SetOwn(Standard_False); - WriteLine(" LIST"); - SendItem(sli->Lower()); - SendItem(sli->Upper()); - SetOwn(Standard_True); - } -// .. Ecritures specifiques selon dumpers - WriteOwn(P); - WriteLine("",'\n'); - } - - SetOwn(Standard_False); - if (nb > 0) WriteLine ("!SOURCES",'\n'); - for (j = 1; j <= nb; j ++) { - i = idents->Value(j); - Handle(IFSelect_Selection) P = thesess->Selection(i); - Standard_Integer nbs = thesess->NbSources(P); - if (nbs == 0) continue; - name = thesess->Name(P); - if (name.IsNull()) sprintf(laligne," #%d %d",thenums->Value(i),nbs); - else sprintf(laligne," %s %d",name->ToCString(),nbs); - WriteLine(laligne); - for (Standard_Integer k = 1; k <= nbs; k ++) - SendItem (thesess->Source(P,k)); - WriteLine("",'\n'); - } - - idents = thesess->ItemIdents(STANDARD_TYPE(IFSelect_GeneralModifier)); - nb = idents->Length(); - if (nb > 0) WriteLine ("!MODIFIERS",'\n'); - for (j = 1; j <= nb; j ++) { -// Description de base des Modifiers, donc sans Selection ni Dispatch-Rank - i = idents->Value(j); - Handle(IFSelect_GeneralModifier) P = thesess->GeneralModifier(i); - NewItem (i,P); - SetOwn(Standard_True); -// .. Ecritures specifiques selon dumpers - WriteOwn(P); - WriteLine("",'\n'); - } - - idents = thesess->ItemIdents(STANDARD_TYPE(IFSelect_Transformer)); - nb = idents->Length(); - if (nb > 0) WriteLine ("!TRANSFORMERS",'\n'); - for (j = 1; j <= nb; j ++) { -// Description des Transformers - i = idents->Value(j); - Handle(IFSelect_Transformer) P = thesess->Transformer(i); - NewItem (i,P); - SetOwn(Standard_True); -// .. Ecritures specifiques selon dumpers - WriteOwn(P); - WriteLine("",'\n'); - } - - SetOwn(Standard_False); - idents = thesess->ItemIdents(STANDARD_TYPE(IFSelect_Dispatch)); - nb = idents->Length(); - if (nb > 0) WriteLine ("!DISPATCHES",'\n'); - for (j = 1; j <= nb; j ++) { - i = idents->Value(j); - Handle(IFSelect_Dispatch) P = thesess->Dispatch(i); - NewItem (i,P); -// .. Final Selection - SetOwn(Standard_False); - SendItem(P->FinalSelection()); - SetOwn(Standard_True); -// .. Ecritures specifiques selon dumpers - WriteOwn(P); - WriteLine("",'\n'); - } - - WriteLine ("!FILENAMING"); - SetOwn(Standard_False); - Handle(TCollection_HAsciiString) namingpart = thesess->FilePrefix(); - if (namingpart->IsEmpty()) namingpart.Nullify(); - if (namingpart.IsNull()) SendVoid(); - else SendText(namingpart->ToCString()); - namingpart = thesess->DefaultFileRoot(); - if (namingpart->IsEmpty()) namingpart.Nullify(); - if (namingpart.IsNull()) SendVoid(); - else SendText(namingpart->ToCString()); - namingpart = thesess->FileExtension(); - if (namingpart->IsEmpty()) namingpart.Nullify(); - if (namingpart.IsNull()) SendVoid(); - else SendText(namingpart->ToCString()); - WriteLine("",'\n'); - - for (j = 1; j <= nb; j ++) { - i = idents->Value(j); - Handle(IFSelect_Dispatch) P = thesess->Dispatch(i); - if (!P->HasRootName()) continue; - namingpart = P->RootName(); - SetOwn(Standard_False); - SendItem(P); - sprintf(laligne," %s",namingpart->ToCString()); - WriteLine(laligne,' '); - WriteLine("",'\n'); - } - -// Pour les Modifiers, ATTENTION car il faut respecter l ORDRE effectif -// Or il y a deux listes : Model Modifiers; File Modifiers -// Les Modifiers eux-memes ont deja ete ecrits -// Ici, on ecrit simplement leur utilisation dans l envoi final - for (Standard_Integer formod = 1; formod >= 0; formod --) { - idents = thesess->FinalModifierIdents((formod > 0)); // donnes dans l ordre d application - nb = idents->Length(); - if (nb == 0) continue; - if (formod > 0) WriteLine ("!MODELMODIFIERS",'\n'); - else WriteLine ("!FILEMODIFIERS",'\n'); - for (j = 1; j <= nb; j ++) { - i = idents->Value(j); - Handle(IFSelect_GeneralModifier) P = thesess->GeneralModifier(i); - SetOwn(Standard_False); - SendItem(P); - // .. Parametres Generaux (les specifiques ont deja ete envoyes) - SendItem(P->Selection()); - SendItem(P->Dispatch()); - WriteLine("",'\n'); - } - } - -// ... Conclusion - theline.Clear(); - return 0; -} - - Standard_Integer IFSelect_SessionFile::WriteEnd () -{ - WriteLine("!XSTEP END",'\n'); // sinon, cf sous-types de SessionFile ... - return 0; -} - - - void IFSelect_SessionFile::WriteLine - (const Standard_CString line, const Standard_Character follow) -{ - if (line[0] != '\0') thebuff.AssignCat (line); - if (follow == '\0') return; - if (follow != '\n') thebuff.AssignCat(follow); - else { - thelist.Append(thebuff); - thebuff.Clear(); - thenl ++; - } -} - - Standard_Boolean IFSelect_SessionFile::WriteOwn - (const Handle(Standard_Transient)& item) -{ - if (item.IsNull()) return Standard_False; - SetOwn(Standard_True); - Handle(IFSelect_SessionDumper) dumper = IFSelect_SessionDumper::First(); - while (!dumper.IsNull()) { - if (dumper->WriteOwn(*this,item)) break; - dumper = dumper->Next(); - } - SetOwn(Standard_False); - return (!dumper.IsNull()); // IsNull -> echec -} - - - -// ################################################################## -// ######## ReadSession : Lecture du contenu ######## - - Standard_Integer IFSelect_SessionFile::ReadSession () -{ - Message_Messenger::StreamBuffer sout = Message::SendInfo(); - - thedone = Standard_True; -// ... Preparation Specifique - thenums.Nullify(); - thenames.Clear(); -// .. Donnees generales, controle - if (!ReadLine()) return 1; - if (theline.Length() != 4) { sout<<"File Form Incorrect"<DynamicType(); - if (!theline.Value(1).IsEqual("!XSTEP") || - !theline.Value(2).IsEqual("SESSION") || - !theline.Value(4).IsEqual(sesstype->Name()) ) - { sout<<"Lineno."<SetErrorHandle(Standard_False); - else if (theline.Value(2).IsEqual("1")) - thesess->SetErrorHandle(Standard_True); - else { sout<<"Lineno."<SetValue ( atoi(theline.Value(2).ToCString()) ); - AddItem (par); - } - -// .. TextParams (ligne de garde deja lue) - rubr = (theline.Length() == 1 && theline.Value(1).IsEqual("!TEXTS")); - while (rubr) { - if (!ReadLine()) return 1; - if (theline.Value(1).Value(1) == '!') break; // liste suivante - if (theline.Length() != 2) - { sout<<"Lineno."< 0) break; - } - oneline.Remove (1,inc); - AddItem ( new TCollection_HAsciiString (oneline.ToCString()) ); - } - -// .. Selections (ligne de garde deja lue) - rubr = (theline.Length() == 1 && theline.Value(1).IsEqual("!SELECTIONS")); - while (rubr) { - if (!ReadLine()) return 1; - if (theline.Value(1).Value(1) == '!') break; // liste suivante - if (theline.Length() < 2) - { sout<<"Lineno."< 2) { - if (theline.Value(3).IsEqual("D")) direct = 1; - else if (theline.Value(3).IsEqual("R")) direct = -1; - if (direct != 0) firstown ++; - if (firstown+2 <= theline.Length()) { - if (theline.Value(firstown).IsEqual("LIST")) { - numlist = firstown; firstown += 3; - low = GetCasted(IFSelect_IntParam,ItemValue(numlist+1)); - up = GetCasted(IFSelect_IntParam,ItemValue(numlist+2)); - } - } - SetLastGeneral (firstown-1); - } - Handle(Standard_Transient) item; // a fournir ... - ReadOwn(item); - if (item.IsNull()) continue; - DeclareAndCast(IFSelect_SelectExtract,sxt,item); - if (!sxt.IsNull()) { - if (direct == 0) sout<<"Lineno."<SetDirect( (direct > 0) ); - } - DeclareAndCast(IFSelect_SelectAnyList,sli,item); - if (!sli.IsNull()) { - if (numlist == 0) sout<<"Lineno."<SetRange(low,up); - } - AddItem(item); - } - -// .. Sources - rubr = (theline.Length() == 1 && theline.Value(1).IsEqual("!SOURCES")); - while (rubr) { - if (!ReadLine()) return 1; - if (theline.Value(1).Value(1) == '!') break; // liste suivante - if (theline.Length() < 3) - { sout<<"Lineno."< 1) - sout<<"Lineno."<SetInput(source); - } - DeclareAndCast(IFSelect_SelectDeduct,sdt,sel); - if (!sdt.IsNull()) { - if (nbs > 1) - sout<<"Lineno."<SetInput(GetCasted(IFSelect_Selection,ItemValue(3))); - } - DeclareAndCast(IFSelect_SelectControl,sct,sel); - if (!sct.IsNull()) { - if (nbs != 2) - sout<<"Lineno."<SetMainInput (GetCasted(IFSelect_Selection,ItemValue(3))); - sct->SetSecondInput (GetCasted(IFSelect_Selection,ItemValue(4))); - } - DeclareAndCast(IFSelect_SelectCombine,sco,sel); - if (!sco.IsNull()) { - for (Standard_Integer j = 1; j <= nbs; j ++) - sco->Add(GetCasted(IFSelect_Selection,ItemValue(j+2))); - } - } - -// ... Modifiers en tout genre - rubr = (theline.Length() == 1 && theline.Value(1).IsEqual("!MODIFIERS")); - while (rubr) { - if (!ReadLine()) return 1; - if (theline.Value(1).Value(1) == '!') break; // liste suivante - if (theline.Length() < 2) - { sout<<"Lineno."<SetItemSelection(disp,input); - } - -// ... FileNaming (ligne de garde deja lue) -// .. Modifiers deja lus et charges - rubr = (theline.Length() == 4 && theline.Value(1).IsEqual("!FILENAMING")); - if (rubr) { - if (!IsVoid(2)) thesess->SetFilePrefix (TextValue(2).ToCString()); - if (!IsVoid(3)) thesess->SetDefaultFileRoot (TextValue(3).ToCString()); - if (!IsVoid(4)) thesess->SetFileExtension (TextValue(4).ToCString()); - } - while (rubr) { - if (!ReadLine()) return 1; - if (theline.Value(1).Value(1) == '!') break; // liste suivante - if (theline.Length() != 2) - { sout<<"Lineno."<SetFileRoot (disp,theline.Value(2).ToCString()); - } - -// ... Modifiers (ligne de garde deja lue) -// ... Attention, deux listes (MODELMODIFIERS et FILEMODIFIERS) - for (Standard_Integer formod = 1; formod >= 0; formod --) { - rubr = (theline.Length() == 1 && - ( (formod == 1 && theline.Value(1).IsEqual("!MODELMODIFIERS")) || - (formod == 0 && theline.Value(1).IsEqual("!FILEMODIFIERS")) ) ); -// if ( formod == 1 && ( theline.Length() != 1 || -// !theline.Value(1).IsEqual("!MODELMODIFIERS")) ) -// { sout<<"Lineno."<SetItemSelection (modif,input); - if (!disp.IsNull()) thesess->SetAppliedModifier (modif,disp); - else thesess->SetAppliedModifier (modif,thesess->ShareOut()); - } - } - -// ... Conclusion : voir ReadEnd (separe) - return 0; -} - - Standard_Integer IFSelect_SessionFile::ReadEnd () -{ - Message_Messenger::StreamBuffer sout = Message::SendInfo(); - if ( theline.Length() != 2 || - !theline.Value(1).IsEqual("!XSTEP") || - !theline.Value(2).IsEqual("END")) - { sout<<"End of File Incorrect, lineno"<= thelist.Length()) return Standard_False; - thenl ++; - Standard_CString ligne = thelist.Value(thenl).ToCString(); -// Lignes vides ? - if (ligne[0] == '\0') return ReadLine(); - SplitLine (ligne); - return Standard_True; -} - - - void IFSelect_SessionFile::SplitLine (const Standard_CString line) -{ - char mot[80]; - theline.Clear(); - Standard_Integer nbc = 0; - Standard_Boolean word = (line[0] > ' '); - for (Standard_Integer i = 0; line[i] != '\0'; i ++) { - if (line[i] > ' ') { - if (!word) { nbc = 0; word = Standard_True; } - mot[nbc] = line[i]; nbc ++; - } else { - if (word) { - word = Standard_False; - mot[nbc] = '\0'; - theline.Append (TCollection_AsciiString(mot)); - } - if (line[i] == '\0' || line[i] == '\n') break; - } - } - thelastgen = 0; -} - - Standard_Boolean IFSelect_SessionFile::ReadOwn - (Handle(Standard_Transient)& item) -{ - Message_Messenger::StreamBuffer sout = Message::SendInfo(); - - if (theline.Length() < 2) return Standard_False; - const TCollection_AsciiString& type = theline.Value(2); - if (thelastgen < 2) thelastgen = 2; // mini : ident+type d abord -// thelastgen = theline.Length(); -// for (Standard_Integer i = theline.Length(); i > 0; i --) { -// if (theline.Value(i).Value(1) == ':') thelastgen = i - 1; -// } - Handle(IFSelect_SessionDumper) dumper = IFSelect_SessionDumper::First(); - while (!dumper.IsNull()) { - if (dumper->ReadOwn(*this,type,item)) break; - dumper = dumper->Next(); - } - if (dumper.IsNull()) sout<<" -- Lineno."< echec -} - - - void IFSelect_SessionFile::AddItem - (const Handle(Standard_Transient)& item, const Standard_Boolean active) -{ - Message_Messenger::StreamBuffer sout = Message::SendInfo(); - - const TCollection_AsciiString& name = theline.Value(1); - Standard_Integer id = 0; - if (!item.IsNull()) { - if (name.Value(1) == '#') id = thesess->AddItem(item,active); - else if (!thesess->NamedItem(name.ToCString()).IsNull()) id = - thesess->AddItem(item,active); - else id = thesess->AddNamedItem(name.ToCString(),item,active); - } - else sout<<"Lineno."<HasName(par)) { - thenewnum ++; thenums->SetValue(ident,thenewnum); - sprintf(laligne," #%d %s",thenewnum,par->DynamicType()->Name()); - } - else sprintf(laligne," %s %s",thesess->Name(par)->ToCString(), - par->DynamicType()->Name()); - WriteLine(laligne); -} - - void IFSelect_SessionFile::SetOwn (const Standard_Boolean mode) - { theownflag = mode; } - - void IFSelect_SessionFile::SendVoid () -{ -//// if (theownflag) WriteLine(" :$"); - WriteLine(" $"); -} - - void IFSelect_SessionFile::SendItem (const Handle(Standard_Transient)& par) -{ - Message_Messenger::StreamBuffer sout = Message::SendInfo(); - - char laligne[100]; - Standard_Integer filenum = 0; - Standard_Integer id = thesess->ItemIdent(par); - if (id != 0) filenum = thenums->Value(id); - if (filenum == 0) { - if (!par.IsNull()) sout << "Lineno " << thenl << " -- Unknown Item : " - << " Type:" << par->DynamicType()->Name() << std::endl; //sout<Name(par)->ToCString()); - else sprintf(laligne," #%d",filenum); - WriteLine(laligne); -} - - void IFSelect_SessionFile::SendText (const Standard_CString text) -{ - char laligne[100]; -//// if (theownflag) sprintf(laligne," :%s",text); - sprintf(laligne," %s",text); - WriteLine(laligne); -} - - -// ######## Actions Unitaires de LECTURE ######## - - void IFSelect_SessionFile::SetLastGeneral (const Standard_Integer lastgen) - { thelastgen = lastgen; } - - Standard_Integer IFSelect_SessionFile::NbParams () const - { return theline.Length() - thelastgen; } - - - Standard_Boolean IFSelect_SessionFile::IsVoid - (const Standard_Integer num) const -{ - Standard_Integer nm = num + thelastgen; - if (nm <= 0 || nm > theline.Length()) return Standard_True; - const TCollection_AsciiString& term = theline.Value(nm); - return (term.IsEqual ("$") || term.IsEqual (":$") ); -} - - Standard_Boolean IFSelect_SessionFile::IsText - (const Standard_Integer num) const -{ - Standard_Integer nm = num + thelastgen; - if (nm <= 0 || nm > theline.Length()) return Standard_False; - const TCollection_AsciiString& term = theline.Value(nm); - if (term.Value(1) == ':') return Standard_False; - if (term.Value(1) == '#') return Standard_False; - if (term.IsEqual("$")) return Standard_False; - return Standard_True; -} - - const TCollection_AsciiString& IFSelect_SessionFile::ParamValue - (const Standard_Integer num) const - { return theline.Value(num+thelastgen); } - - - TCollection_AsciiString IFSelect_SessionFile::TextValue - (const Standard_Integer num) const -{ - Standard_Integer nm = num + thelastgen; - TCollection_AsciiString res; - if (nm <= 0 || nm > theline.Length()) return res; - res = theline.Value(nm); - if (res.Value( res.Length() ) == '"') res.Remove(res.Length()); - if (res.Value(1) == ':') res.Remove(1); - if (res.Value(1) == '"') res.Remove(1); - return res; -} - - Handle(Standard_Transient) IFSelect_SessionFile::ItemValue - (const Standard_Integer num) const -{ - Message_Messenger::StreamBuffer sout = Message::SendInfo(); - - Handle(Standard_Transient) res; - Standard_Integer nm = num + thelastgen; - if (nm <= 0 || nm > theline.Length()) return res; - Standard_Integer id; - TCollection_AsciiString name = theline.Value(nm); - if (name.Value(1) == ':') name.Remove(1); - if (name.IsEqual("$")) return res; // item non-defini justement - if (!thenames.Find(name, id)) { - sout << " -- Item Unknown in File : " << name - << " lineno " << thenl << " param." << nm << std::endl; - id = 0; - } - return thesess->Item(id); -} - - - void IFSelect_SessionFile::Destroy () -{ } // agit si File non ferme, sinon ne fait rien diff --git a/src/IFSelect/IFSelect_SessionFile.hxx b/src/IFSelect/IFSelect_SessionFile.hxx deleted file mode 100644 index 930efc0859..0000000000 --- a/src/IFSelect/IFSelect_SessionFile.hxx +++ /dev/null @@ -1,288 +0,0 @@ -// Created on: 1993-11-03 -// 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 _IFSelect_SessionFile_HeaderFile -#define _IFSelect_SessionFile_HeaderFile - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -class IFSelect_WorkSession; -class Standard_Transient; - -//! A SessionFile is intended to manage access between a -//! WorkSession and an Ascii Form, to be considered as a Dump. -//! It allows to write the File from the WorkSession, and later -//! read the File to the WorkSession, by keeping required -//! descriptions (such as dependances). -//! -//! The produced File is under an Ascii Form, then it may be -//! easily consulted. -//! It is possible to cumulate reading of several Files. But in -//! case of Names conflict, the newer Names are forgottens. -//! -//! The Dump supports the description of XSTEP functionalities -//! (Sharing an Interface File, with Selections, Dispatches, -//! Modifiers ...) but does not refer to the Interface File -//! which is currently loaded. -//! -//! SessionFile works with a library of SessionDumper type objects -//! -//! The File is Produced as follows : -//! SessionFile produces all general Information (such as Int and -//! Text Parameters, Types and Inputs of Selections, Dispatches, -//! Modifiers ...) and calls the SessionDumpers to produce all -//! the particular Data : creation arguments, parameters to be set -//! It is Read in the same terms : -//! SessionFile reads and interprets all general Information, -//! and calls the SessionDumpers to recognize Types and for a -//! recognized Type create the corresponding Object with its -//! particular parameters as they were written. -//! The best way to work is to have one SessionDumper for each -//! consistent set of classes (e.g. a package). -class IFSelect_SessionFile -{ -public: - - DEFINE_STANDARD_ALLOC - - //! Creates a SessionFile, ready to read Files in order to load - //! them into a given WorkSession. - //! The following Read Operations must then be called. - //! It is also possible to perform a Write, which produces a - //! complete File of all the content of the WorkSession. - Standard_EXPORT IFSelect_SessionFile(const Handle(IFSelect_WorkSession)& WS); - - //! Creates a SessionFile which Writes the content of a WorkSession - //! to a File (directly calls Write) - //! Then, IsDone aknowledges on the result of the Operation. - //! But such a SessionFile may not Read a File to a WorkSession. - Standard_EXPORT IFSelect_SessionFile(const Handle(IFSelect_WorkSession)& WS, const Standard_CString filename); - - //! Clears the lines recorded whatever for writing or for reading - Standard_EXPORT void ClearLines(); - - //! Returns the count of recorded lines - Standard_EXPORT Standard_Integer NbLines() const; - - //! Returns a line given its rank in the list of recorded lines - Standard_EXPORT const TCollection_AsciiString& Line (const Standard_Integer num) const; - - //! Adds a line to the list of recorded lines - Standard_EXPORT void AddLine (const Standard_CString line); - - //! Removes the last line. Can be called recursively. - //! Does nothing if the list is empty - Standard_EXPORT void RemoveLastLine(); - - //! Writes the recorded lines to a file named then clears - //! the list of lines. - //! Returns False (with no clearing) if the file could not be - //! created - Standard_EXPORT Standard_Boolean WriteFile (const Standard_CString name); - - //! Reads the recorded lines from a file named , after - //! having cleared the list (stops if RecognizeFile fails) - //! Returns False (with no clearing) if the file could not be read - Standard_EXPORT Standard_Boolean ReadFile (const Standard_CString name); - - //! Recognizes the header line. returns True if OK, False else - Standard_EXPORT Standard_Boolean RecognizeFile (const Standard_CString headerline); - - //! Performs a Write Operation from a WorkSession to a File - //! i.e. calls WriteSession then WriteEnd, and WriteFile - //! Returned Value is : 0 for OK, -1 File could not be created, - //! >0 Error during Write (see WriteSession) - //! IsDone can be called too (will return True for OK) - Standard_EXPORT Standard_Integer Write (const Standard_CString filename); - - //! Performs a Read Operation from a file to a WorkSession - //! i.e. calls ReadFile, then ReadSession and ReadEnd - //! Returned Value is : 0 for OK, -1 File could not be opened, - //! >0 Error during Read (see WriteSession) - //! IsDone can be called too (will return True for OK) - Standard_EXPORT Standard_Integer Read (const Standard_CString filename); - - //! Prepares the Write operation from a WorkSession (IFSelect) to - //! a File, i.e. fills the list of lines (the file itself remains - //! to be written; or NbLines/Line may be called) - //! Important Remark : this excludes the reading of the last line, - //! which is performed by WriteEnd - //! Returns 0 if OK, status > 0 in case of error - Standard_EXPORT Standard_Integer WriteSession(); - - //! Writes the trailing line. It is separate from WriteSession, - //! in order to allow to redefine WriteSession without touching - //! WriteEnd (WriteSession defines the body of the file) - //! WriteEnd fills the list of lines. Returns a status of error, - //! 0 if OK, >0 else - Standard_EXPORT Standard_Integer WriteEnd(); - - //! Writes a line to the File. If is given, it is added - //! at the following of the line. '\n' must be added for the end. - Standard_EXPORT void WriteLine (const Standard_CString line, const Standard_Character follow = 0); - - //! Writes the Parameters own to each type of Item. Uses the - //! Library of SessionDumpers - //! Returns True if Done, False if could not be treated - //! (hence it remains written with no Own Parameter) - Standard_EXPORT Standard_Boolean WriteOwn (const Handle(Standard_Transient)& item); - - //! Performs a Read Operation from a File to a WorkSession, i.e. - //! reads the list of line (which must have already been loaded, - //! by ReadFile or by calls to AddLine) - //! Important Remark : this excludes the reading of the last line, - //! which is performed by ReadEnd - //! Returns 0 for OK, >0 status for Read Error (not a suitable - //! File, or WorkSession given as Immutable at Creation Time) - //! IsDone can be called too (will return True for OK) - Standard_EXPORT Standard_Integer ReadSession(); - - //! Reads the end of a file (its last line). Returns 0 if OK, - //! status >0 in case of error (not a suitable end line). - Standard_EXPORT Standard_Integer ReadEnd(); - - //! Reads a Line and splits it into a set of alphanumeric items, - //! which can then be queried by NbParams/ParamValue ... - Standard_EXPORT Standard_Boolean ReadLine(); - - //! Internal routine which processes a line into words - //! and prepares its exploration - Standard_EXPORT void SplitLine (const Standard_CString line); - - //! Tries to Read an Item, by calling the Library of Dumpers - //! Sets the list of parameters of the line to be read from the - //! first own one - Standard_EXPORT Standard_Boolean ReadOwn (Handle(Standard_Transient)& item); - - //! Adds an Item to the WorkSession, taken as Name the first - //! item of the read Line. If this Name is not a Name but a Number - //! or if this Name is already recorded in the WorkSession, it - //! adds the Item but with no Name. Then the Name is recorded - //! in order to be used by the method ItemValue - //! commands to make active or not in the session - Standard_EXPORT void AddItem (const Handle(Standard_Transient)& item, const Standard_Boolean active = Standard_True); - - //! Returns True if the last Read or Write operation has been correctly performed. - //! Else returns False. - Standard_EXPORT Standard_Boolean IsDone() const; - - //! Returns the WorkSession on which a SessionFile works. - //! Remark that it is returned as Immutable. - Standard_EXPORT Handle(IFSelect_WorkSession) WorkSession() const; - - //! At beginning of writing an Item, writes its basics : - //! - either its name in the session if it has one - //! - or its relative number of item in the file, else (preceded by a '_') - //! - then, its Dynamic Type (in the sense of cdl : pk_class) - //! This basic description can be followed by the parameters - //! which are used in the definition of the item. - Standard_EXPORT void NewItem (const Standard_Integer ident, const Handle(Standard_Transient)& par); - - //! Sets Parameters to be sent as Own if is True (their - //! Name or Number or Void Mark or Text Value is preceded by a - //! Column sign ':') else they are sent normally - //! Hence, the Own Parameter are clearly identified in the File - Standard_EXPORT void SetOwn (const Standard_Boolean mode); - - //! During a Write action, commands to send a Void Parameter - //! i.e. a Parameter which is present but undefined - //! Its form will be the dollar sign : $ - Standard_EXPORT void SendVoid(); - - //! During a Write action, commands to send the identification of - //! a Parameter : if it is Null (undefined) it is send as Void ($) - //! if it is Named in the WorkSession, its Name is sent preceded - //! by ':', else a relative Ident Number is sent preceded by '#' - //! (relative to the present Write, i.e. starting at one, without - //! skip, and counted part from Named Items) - Standard_EXPORT void SendItem (const Handle(Standard_Transient)& par); - - //! During a Write action, commands to send a Text without - //! interpretation. It will be sent as well - Standard_EXPORT void SendText (const Standard_CString text); - - //! Sets the rank of Last General Parameter to a new value. It is - //! followed by the Fist Own Parameter of the item. - //! Used by SessionFile after reading general parameters. - Standard_EXPORT void SetLastGeneral (const Standard_Integer lastgen); - - //! During a Read operation, SessionFile processes sequentially the Items to read. - //! For each one, it gives access to the list - //! of its Parameters : they were defined by calls to - //! SendVoid/SendParam/SendText during Writing the File. - //! NbParams returns the count of Parameters for the line - //! currently read. - Standard_EXPORT Standard_Integer NbParams() const; - - //! Returns True if a Parameter, given its rank in the Own List - //! (see NbOwnParams), is Void. Returns also True if is - //! out of range (undefined parameters) - Standard_EXPORT Standard_Boolean IsVoid (const Standard_Integer num) const; - - //! Returns True if a Parameter, in the Own List (see NbOwnParams) - //! is a Text (between "..."). Else it is an Item (Parameter, - //! Selection, Dispatch ...), which can be Void. - Standard_EXPORT Standard_Boolean IsText (const Standard_Integer num) const; - - //! Returns a Parameter (alphanumeric item of a line) as it - //! has been read - Standard_EXPORT const TCollection_AsciiString& ParamValue (const Standard_Integer num) const; - - //! Returns the content of a Text Parameter (without the quotes). - //! Returns an empty string if the Parameter is not a Text. - Standard_EXPORT TCollection_AsciiString TextValue (const Standard_Integer num) const; - - //! Returns a Parameter as an Item. Returns a Null Handle if the - //! Parameter is a Text, or if it is defined as Void - Standard_EXPORT Handle(Standard_Transient) ItemValue (const Standard_Integer num) const; - - //! Specific Destructor (closes the File if not yet done) - Standard_EXPORT void Destroy(); -~IFSelect_SessionFile() -{ - Destroy(); -} - -protected: - - Handle(IFSelect_WorkSession) thesess; - Handle(TColStd_HArray1OfInteger) thenums; - NCollection_DataMap thenames; - Standard_Integer thenl; - TColStd_SequenceOfAsciiString theline; - -private: - - Standard_Boolean themode; - TColStd_SequenceOfAsciiString thelist; - TCollection_AsciiString thebuff; - Standard_Integer thelastgen; - Standard_Boolean thedone; - Standard_Boolean theownflag; - Standard_Integer thenewnum; - -}; - -#endif // _IFSelect_SessionFile_HeaderFile diff --git a/src/IFSelect/IFSelect_ShareOut.cxx b/src/IFSelect/IFSelect_ShareOut.cxx deleted file mode 100644 index 3b979ee5d8..0000000000 --- a/src/IFSelect/IFSelect_ShareOut.cxx +++ /dev/null @@ -1,352 +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 -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_ShareOut,Standard_Transient) - -IFSelect_ShareOut::IFSelect_ShareOut () -{ - thedefrt = new TCollection_HAsciiString ("Default"); - thenbdefs = thelastrun = 0; -} - - - void IFSelect_ShareOut::Clear (const Standard_Boolean onlydisp) -{ - thedisps.Clear(); - ClearResult(!onlydisp); - if (onlydisp) return; - themodelmodifiers.Clear(); - thefilemodifiers.Clear(); -} - - Standard_Boolean IFSelect_ShareOut::RemoveItem - (const Handle(Standard_Transient)& item) -{ - DeclareAndCast(IFSelect_GeneralModifier,modifier,item); - if (!modifier.IsNull()) { - Standard_Boolean formodel = modifier->IsKind(STANDARD_TYPE(IFSelect_Modifier)); - Standard_Integer atnum = ModifierRank(modifier); - return RemoveModifier (formodel,atnum); - } - DeclareAndCast(IFSelect_Dispatch,disp,item); - if (!disp.IsNull()) { - Standard_Integer atnum = DispatchRank(disp); - return RemoveDispatch(atnum); - } - return Standard_False; -} - - - void IFSelect_ShareOut::ClearResult (const Standard_Boolean alsoname) -{ - thelastrun = 0; - if (alsoname) thenbdefs = 0; -} - - Standard_Integer IFSelect_ShareOut::LastRun () const - { return thelastrun; } - - void IFSelect_ShareOut::SetLastRun (const Standard_Integer lastrun) - { thelastrun = lastrun; } - -// ####################################################################### -// #### DISPATCHES (ENVOI DES FICHIERS) #### - - Standard_Integer IFSelect_ShareOut::NbDispatches () const - { return thedisps.Length(); } - - Standard_Integer IFSelect_ShareOut::DispatchRank - (const Handle(IFSelect_Dispatch)& disp) const -{ - if (disp.IsNull()) return 0; - for (Standard_Integer i = thedisps.Length(); i >= 1; i --) - if (disp == thedisps.Value(i)) return i; - return 0; -} - - const Handle(IFSelect_Dispatch)& IFSelect_ShareOut::Dispatch - (const Standard_Integer num) const -{ - return thedisps.Value(num); -} - - void IFSelect_ShareOut::AddDispatch - (const Handle(IFSelect_Dispatch)& disp) -{ - if (disp.IsNull()) return; - thedisps.Append(disp); -} - - - Standard_Boolean IFSelect_ShareOut::RemoveDispatch - (const Standard_Integer rank) -{ - if (rank <= thelastrun || rank > thedisps.Length()) return Standard_False; - thedisps.Remove(rank); - return Standard_True; -} - -// ########################################################################## -// #### MODIFIERS #### - - void IFSelect_ShareOut::AddModifier - (const Handle(IFSelect_GeneralModifier)& modifier, - const Standard_Integer atnum) -{ - Standard_Boolean formodel = modifier->IsKind(STANDARD_TYPE(IFSelect_Modifier)); - if (ModifierRank(modifier) == 0) AddModif (modifier,formodel,atnum); - Handle(IFSelect_Dispatch) nuldisp; - modifier->SetDispatch(nuldisp); -} - - void IFSelect_ShareOut::AddModifier - (const Handle(IFSelect_GeneralModifier)& modifier, - const Standard_Integer dispnum, const Standard_Integer atnum) -{ - Standard_Boolean formodel = modifier->IsKind(STANDARD_TYPE(IFSelect_Modifier)); - if (ModifierRank(modifier) == 0) AddModif (modifier,formodel,atnum); - Handle(IFSelect_Dispatch) disp = Dispatch(dispnum); - modifier->SetDispatch(disp); -} - - - void IFSelect_ShareOut::AddModif - (const Handle(IFSelect_GeneralModifier)& modifier, - const Standard_Boolean formodel, const Standard_Integer atnum) -{ - if (formodel) { - if (atnum > 0 && atnum <= themodelmodifiers.Length()) - themodelmodifiers.InsertBefore(atnum,modifier); - else themodelmodifiers.Append(modifier); - } else { - if (atnum > 0 && atnum <= thefilemodifiers.Length()) - thefilemodifiers.InsertBefore(atnum,modifier); - else thefilemodifiers.Append(modifier); - } -} - - Standard_Integer IFSelect_ShareOut::NbModifiers - (const Standard_Boolean formodel) const -{ - if (formodel) return themodelmodifiers.Length(); - else return thefilemodifiers.Length(); -} - - Handle(IFSelect_GeneralModifier) IFSelect_ShareOut::GeneralModifier - (const Standard_Boolean formodel, const Standard_Integer atnum) const -{ - if (formodel) return themodelmodifiers.Value(atnum); - else return thefilemodifiers.Value(atnum); -} - - Handle(IFSelect_Modifier) IFSelect_ShareOut::ModelModifier - (const Standard_Integer num) const -{ return Handle(IFSelect_Modifier)::DownCast(themodelmodifiers.Value(num)); } - - Standard_Integer IFSelect_ShareOut::ModifierRank - (const Handle(IFSelect_GeneralModifier)& modifier) const -{ - Standard_Integer i; - Standard_Boolean formodel = modifier->IsKind(STANDARD_TYPE(IFSelect_Modifier)); - if (formodel) { - for (i = themodelmodifiers.Length(); i >= 1; i --) - if (modifier == themodelmodifiers.Value(i)) return i; - } else { - for (i = thefilemodifiers.Length(); i >= 1; i --) - if (modifier == thefilemodifiers.Value(i)) return i; - } - return 0; -} - - - Standard_Boolean IFSelect_ShareOut::RemoveModifier - (const Standard_Boolean formodel, const Standard_Integer atnum) -{ - if (atnum <= 0) return Standard_False; - if (formodel) { - if (atnum > themodelmodifiers.Length()) return Standard_False; - themodelmodifiers.Remove(atnum); - } else { - if (atnum > thefilemodifiers.Length()) return Standard_False; - thefilemodifiers.Remove(atnum); - } - return Standard_True; -} - - -// ChangeModifierRank revient a une permutation circulaire : -// before est mis en after, ceux qui sont entre tournent - Standard_Boolean IFSelect_ShareOut::ChangeModifierRank - (const Standard_Boolean formodel, - const Standard_Integer before, const Standard_Integer after) -{ - Standard_Integer nb; - if (before <= 0 || after <= 0) return Standard_False; - if (before == after) return Standard_True; - if (formodel) { - nb = themodelmodifiers.Length(); - if (before > nb || after > nb) return Standard_False; - Handle(IFSelect_GeneralModifier) bef = themodelmodifiers.Value(before); - themodelmodifiers.Remove(before); - if (after == nb) themodelmodifiers.Append(bef); - else themodelmodifiers.InsertBefore(after,bef); - } else { - nb = thefilemodifiers.Length(); - if (before > nb || after > nb) return Standard_False; - Handle(IFSelect_GeneralModifier) bef = thefilemodifiers.Value(before); - thefilemodifiers.Remove(before); - if (after == nb) thefilemodifiers.Append(bef); - else thefilemodifiers.InsertBefore(after,bef); - } - return Standard_True; -} - -// ####################################################################### -// #### NOMINATION DES FICHIERS #### -// Rq : thenbdefs s applique tant que l on ne change pas les termes principaux - - Standard_Boolean IFSelect_ShareOut::SetRootName - (const Standard_Integer num, const Handle(TCollection_HAsciiString)& name) -{ - if (num < 1 || num > thedisps.Length()) return Standard_False; - if (RootNumber(name) != 0) return Standard_False; - Dispatch(num)->SetRootName (name); - return Standard_True; -} - - Standard_Boolean IFSelect_ShareOut::HasRootName - (const Standard_Integer num) const -{ - if (num < 1 || num > thedisps.Length()) return Standard_False; - return Dispatch(num)->HasRootName(); -} - - Handle(TCollection_HAsciiString) IFSelect_ShareOut::RootName - (const Standard_Integer num) const -{ - Handle(TCollection_HAsciiString) nulname; - if (num < 1 || num > thedisps.Length()) return nulname; - return Dispatch(num)->RootName(); -} - - Standard_Integer IFSelect_ShareOut::RootNumber - (const Handle(TCollection_HAsciiString)& name) const -{ - if (name.IsNull()) return 0; - if (!thedefrt.IsNull()) { - if (thedefrt->IsSameString(name)) return -1; - } - for (Standard_Integer i = 1; i <= thedisps.Length(); i ++) { - Handle(TCollection_HAsciiString) root = thedisps.Value(i)->RootName(); - if (root.IsNull()) continue; - if (root->IsSameString(name)) return i; - } - return 0; -} - - - void IFSelect_ShareOut::SetPrefix - (const Handle(TCollection_HAsciiString)& pref) - { thepref = pref; thenbdefs = 0; } - - Standard_Boolean IFSelect_ShareOut::SetDefaultRootName - (const Handle(TCollection_HAsciiString)& defrt) -{ - if (RootNumber(defrt) != 0) return Standard_False; - if (thedefrt.IsNull() || !thedefrt->IsSameString(defrt)) thenbdefs = 0; - thedefrt = defrt; - return Standard_True; -} - - void IFSelect_ShareOut::SetExtension - (const Handle(TCollection_HAsciiString)& ext) - { theext = ext; thenbdefs = 0; } - - Handle(TCollection_HAsciiString) IFSelect_ShareOut::Prefix () const -{ - if (thepref.IsNull()) return new TCollection_HAsciiString(""); - return thepref; -} - - Handle(TCollection_HAsciiString) IFSelect_ShareOut::DefaultRootName () const -{ - if (thedefrt.IsNull()) return new TCollection_HAsciiString(""); - return thedefrt; -} - - Handle(TCollection_HAsciiString) IFSelect_ShareOut::Extension () const -{ - if (theext.IsNull()) return new TCollection_HAsciiString(""); - return theext; -} - - - TCollection_AsciiString IFSelect_ShareOut::FileName - (const Standard_Integer dnum, const Standard_Integer pnum, - const Standard_Integer nbpack) -{ - Handle(TCollection_HAsciiString) rot = RootName(dnum); - Standard_Integer num = pnum; - Standard_Integer npac = nbpack; - Standard_Boolean sufnum = (npac > 1 || num > 1); - if (rot.IsNull()) { - rot = thedefrt; - thenbdefs ++; num = thenbdefs; - npac = 0; - sufnum = Standard_True; // numeroter sur noms par defaut, des le 1er sans 0 - } - - TCollection_AsciiString res; - if (!thepref.IsNull()) res.AssignCat (thepref->ToCString()); - if (!rot.IsNull()) res.AssignCat (rot->ToCString()); - -// Suffixe numerique - if (sufnum) { // sinon, pas de suffixe numerique -// Nom du PacketSuffix : _ suivi du numero -// Si nbpack non nul, alors on a un majorant et on peut preceder de zeros -// Ex.: nbpack = 50 (donc 2 chiffres), num = 3, cela donnera _03 -// idnum pas utilise : cette methode peut etre redefinie et utiliser idnum ... -// Si nbpack = 0 ou 1, num = 1 pas de suffixe, sinon suffixe "_num" tel quel -// MODIF du 3-NOV-1995 -> pour eviter toute confusion, num = 1 donne aussi _1 - Standard_Integer nbch = 0; - char format[30],suffixe[30]; format[1] = ' '; - if (npac >= num) { - Standard_Integer nbpa = 1; - while (nbpa <= npac) { nbpa *= 10; nbch ++; } - } - if (nbch > 1) { - sprintf(format,"_ %d.%dd",nbch,nbch); - format[1] = '%'; - } else if (npac >= num || num >= 1) { - sprintf(format,"_ d"); - format[1] = '%'; - } - if (format[1] == '%') { - sprintf (suffixe,format,num); - res.AssignCat (suffixe); - } - } - - if (!theext.IsNull()) res.AssignCat (theext->ToCString()); - return res; -} diff --git a/src/IFSelect/IFSelect_ShareOut.hxx b/src/IFSelect/IFSelect_ShareOut.hxx deleted file mode 100644 index 7125efb9c7..0000000000 --- a/src/IFSelect/IFSelect_ShareOut.hxx +++ /dev/null @@ -1,239 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_ShareOut_HeaderFile -#define _IFSelect_ShareOut_HeaderFile - -#include -#include - -#include -#include -#include -#include -class TCollection_HAsciiString; -class IFSelect_Dispatch; -class IFSelect_GeneralModifier; -class IFSelect_Modifier; -class TCollection_AsciiString; - -class IFSelect_ShareOut; -DEFINE_STANDARD_HANDLE(IFSelect_ShareOut, Standard_Transient) - -//! This class gathers the information required to produce one or -//! several file(s) from the content of an InterfaceModel (passing -//! through the creation of intermediate Models). -//! -//! It can correspond to a complete Divide up of a set of Entities -//! intended to be exhaustive and to limit duplications. Or to a -//! simple Extraction of some Entities, in order to work on them. -//! -//! A ShareOut is composed of a list of Dispatches. -//! To Each Dispatch in the ShareOut, is bound an Id. Number -//! This Id. Number allows to identify a Display inside the -//! ShareOut in a stable way (for instance, to attach file names) -//! -//! ShareOut can be seen as a "passive" description, activated -//! through a ShareOutResult, which gives the InterfaceModel on -//! which to work, as a unique source. Thus it is easy to change -//! it without coherence problems -//! -//! Services about it are provided by the class ShareOutResult -//! which is a service class : simulation (list of files and of -//! entities per file; "forgotten" entities; duplicated entities), -//! exploitation (generation of derivated Models, each of them -//! generating an output file) -class IFSelect_ShareOut : public Standard_Transient -{ - -public: - - //! Creates an empty ShareOut - Standard_EXPORT IFSelect_ShareOut(); - - //! Removes in one operation all the Dispatches with their Idents - //! Also clears all information about Names, and all Results but - //! naming information which are : - //! - kept if is True. - //! - cleared if is False (complete clearing) - //! If is True, that's all. Else, clears also Modifiers - Standard_EXPORT void Clear (const Standard_Boolean onlydisp); - - //! Clears all data produced (apart from Dispatches, etc...) - //! if is True, all is cleared. Else, information - //! about produced Names are kept (to maintain unicity of naming - //! across clearings) - Standard_EXPORT void ClearResult (const Standard_Boolean alsoname); - - //! Removes an item, which can be, either a Dispatch (removed from - //! the list of Dispatches), or a GeneralModifier (removed from - //! the list of Model Modifiers or from the list of File Modifiers - //! according to its type). - //! Returns True if done, False if has not been found or if it is - //! neither a Dispatch, nor a Modifier. - Standard_EXPORT Standard_Boolean RemoveItem (const Handle(Standard_Transient)& item); - - //! Returns the rank of last run item (ClearResult resets it to 0) - Standard_EXPORT Standard_Integer LastRun() const; - - //! Records a new value for the rank of last run item - Standard_EXPORT void SetLastRun (const Standard_Integer last); - - //! Returns the count of Dispatches - Standard_EXPORT Standard_Integer NbDispatches() const; - - //! Returns the Rank of a Dispatch, given its Value (Handle). - //! Returns 0 if the Dispatch is unknown in the ShareOut - Standard_EXPORT Standard_Integer DispatchRank (const Handle(IFSelect_Dispatch)& disp) const; - - //! Returns a Dispatch, given its rank in the list - Standard_EXPORT const Handle(IFSelect_Dispatch)& Dispatch (const Standard_Integer num) const; - - //! Adds a Dispatch to the list - Standard_EXPORT void AddDispatch (const Handle(IFSelect_Dispatch)& disp); - - //! Removes a Dispatch, given its rank in the list - //! Returns True if done, False if rank is not between - //! (LastRun + 1) and (NbDispatches) - Standard_EXPORT Standard_Boolean RemoveDispatch (const Standard_Integer rank); - - //! Sets a Modifier to be applied on all Dispatches to be run - //! If is a ModelModifier, adds it to the list of - //! Model Modifiers; else to the list of File Modifiers - //! By default (atnum = 0) at the end of the list, else at - //! Each Modifier is used, after each copy of a packet of Entities - //! into a Model : its criteria are checked and if they are OK, - //! the method Perform of this Modifier is run. - Standard_EXPORT void AddModifier (const Handle(IFSelect_GeneralModifier)& modifier, const Standard_Integer atnum); - - //! Sets a Modifier to be applied on the Dispatch - //! If is a ModelModifier, adds it to the list of - //! Model Modifiers; else to the list of File Modifiers - //! This is the same list as for all Dispatches, but the - //! Modifier is qualified to be applied to one Dispatch only - //! Then, refers to the entire list - //! By default (atnum = 0) at the end of the list, else at - //! Remark : if the Modifier was already in the list and if - //! = 0, the Modifier is not moved, but only qualified - //! for a Dispatch - Standard_EXPORT void AddModifier (const Handle(IFSelect_GeneralModifier)& modifier, const Standard_Integer dispnum, const Standard_Integer atnum); - - //! Adds a Modifier to the list of Modifiers : Model Modifiers if - //! is True, File Modifiers else (internal). - Standard_EXPORT void AddModif (const Handle(IFSelect_GeneralModifier)& modifier, const Standard_Boolean formodel, const Standard_Integer atnum = 0); - - //! Returns count of Modifiers (which apply to complete Models) : - //! Model Modifiers if is True, File Modifiers else - Standard_EXPORT Standard_Integer NbModifiers (const Standard_Boolean formodel) const; - - //! Returns a Modifier of the list, given its rank : - //! Model Modifiers if is True, File Modifiers else - Standard_EXPORT Handle(IFSelect_GeneralModifier) GeneralModifier (const Standard_Boolean formodel, const Standard_Integer num) const; - - //! Returns a Modifier of the list of Model Modifiers, duely casted - Standard_EXPORT Handle(IFSelect_Modifier) ModelModifier (const Standard_Integer num) const; - - //! Gives the rank of a Modifier in the list, 0 if not in the list - //! Model Modifiers if is kind of ModelModifer, - //! File Modifiers else - Standard_EXPORT Standard_Integer ModifierRank (const Handle(IFSelect_GeneralModifier)& modifier) const; - - //! Removes a Modifier, given it rank in the list : - //! Model Modifiers if is True, File Modifiers else - //! Returns True if done, False if is out of range - Standard_EXPORT Standard_Boolean RemoveModifier (const Standard_Boolean formodel, const Standard_Integer num); - - //! Changes the rank of a modifier in the list : - //! Model Modifiers if is True, File Modifiers else - //! from to - //! Returns True if done, False else (before or after out of range) - Standard_EXPORT Standard_Boolean ChangeModifierRank (const Standard_Boolean formodel, const Standard_Integer befor, const Standard_Integer after); - - //! Attaches a Root Name to a Dispatch given its rank, as an - //! HAsciiString (standard form). A Null Handle resets this name. - //! Returns True if OK, False if this Name is already attached, - //! for a Dispatch or for Default, or out of range - Standard_EXPORT Standard_Boolean SetRootName (const Standard_Integer num, const Handle(TCollection_HAsciiString)& name); - - //! Returns True if the Dispatch of rank has an attached - //! Root Name. False else, or if num is out of range - Standard_EXPORT Standard_Boolean HasRootName (const Standard_Integer num) const; - - //! Returns the Root bound to a Dispatch, given its rank - //! Returns a Null Handle if not defined - Standard_EXPORT Handle(TCollection_HAsciiString) RootName (const Standard_Integer num) const; - - //! Returns an integer value about a given root name : - //! - positive : it's the rank of the Dispatch which has this name - //! - null : this root name is unknown - //! - negative (-1) : this root name is the default root name - Standard_EXPORT Standard_Integer RootNumber (const Handle(TCollection_HAsciiString)& name) const; - - //! Defines or Changes the general Prefix (which is prepended to - //! complete file name generated). If this method is not call, - //! Prefix remains empty - Standard_EXPORT void SetPrefix (const Handle(TCollection_HAsciiString)& pref); - - //! Defines or Changes the Default Root Name to a new value (which - //! is used for dispatches which have no attached root name). - //! If this method is not called, DefaultRootName remains empty - //! Returns True if OK, False if this Name is already attached, - //! for a Dispatch or for Default - Standard_EXPORT Standard_Boolean SetDefaultRootName (const Handle(TCollection_HAsciiString)& defrt); - - //! Defines or Changes the general Extension (which is appended to - //! complete file name generated). If this method is not call, - //! Extension remains empty - Standard_EXPORT void SetExtension (const Handle(TCollection_HAsciiString)& ext); - - //! Returns the general Prefix. Can be empty. - Standard_EXPORT Handle(TCollection_HAsciiString) Prefix() const; - - //! Returns the Default Root Name. Can be empty. - Standard_EXPORT Handle(TCollection_HAsciiString) DefaultRootName() const; - - //! Returns the general Extension. Can be empty (not recommended) - Standard_EXPORT Handle(TCollection_HAsciiString) Extension() const; - - //! Computes the complete file name for a Packet of a Dispatch, - //! given Dispatch Number (Rank), Packet Number, and Count of - //! Packets generated by this Dispatch (0 if unknown) - //! - //! File Name is made of following strings, concatenated : - //! General Prefix, Root Name for Dispatch, Packet Suffix, and - //! General Extension. If no Root Name is specified for a - //! Dispatch, DefaultRootName is considered (and pnum is not used, - //! but is incremented and used - //! Error if no Root is defined for this - Standard_EXPORT TCollection_AsciiString FileName (const Standard_Integer dnum, const Standard_Integer pnum, const Standard_Integer nbpack = 0); - - DEFINE_STANDARD_RTTIEXT(IFSelect_ShareOut,Standard_Transient) - - -private: - - IFSelect_TSeqOfDispatch thedisps; - IFSelect_SequenceOfGeneralModifier themodelmodifiers; - IFSelect_SequenceOfGeneralModifier thefilemodifiers; - Handle(TCollection_HAsciiString) thepref; - Handle(TCollection_HAsciiString) thedefrt; - Handle(TCollection_HAsciiString) theext; - Standard_Integer thenbdefs; - Standard_Integer thelastrun; - -}; - -#endif // _IFSelect_ShareOut_HeaderFile diff --git a/src/IFSelect/IFSelect_ShareOutResult.cxx b/src/IFSelect/IFSelect_ShareOutResult.cxx deleted file mode 100644 index e1159e3f18..0000000000 --- a/src/IFSelect/IFSelect_ShareOutResult.cxx +++ /dev/null @@ -1,218 +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 - -IFSelect_ShareOutResult::IFSelect_ShareOutResult - (const Handle(IFSelect_ShareOut)& sho, - const Handle(Interface_InterfaceModel)& amodel) - : thegraph(amodel) , thedispres(amodel,Standard_False) -{ - theshareout = sho; - theeval = Standard_False; -// thedisplist = new TColStd_SequenceOfInteger(); -} - - IFSelect_ShareOutResult::IFSelect_ShareOutResult - (const Handle(IFSelect_ShareOut)& sho, const Interface_Graph& G) - : thegraph(G) , thedispres(G,Standard_False) -{ - theshareout = sho; - theeval = Standard_False; -// thedisplist = new TColStd_SequenceOfInteger(); -} - - IFSelect_ShareOutResult::IFSelect_ShareOutResult - (const Handle(IFSelect_Dispatch)& disp, - const Handle(Interface_InterfaceModel)& amodel) - : thegraph(amodel) , thedispres(amodel,Standard_False) -{ - thedispatch = disp; - theeval = Standard_False; -// thedisplist = new TColStd_SequenceOfInteger(); -} - - IFSelect_ShareOutResult::IFSelect_ShareOutResult - (const Handle(IFSelect_Dispatch)& disp, const Interface_Graph& G) - : thegraph(G) , thedispres(G,Standard_False) -{ - thedispatch = disp; - theeval = Standard_False; -// thedisplist = new TColStd_SequenceOfInteger(); -} - - - Handle(IFSelect_ShareOut) IFSelect_ShareOutResult::ShareOut () const - { return theshareout; } - - const Interface_Graph& IFSelect_ShareOutResult::Graph () const - { return thegraph; } - - void IFSelect_ShareOutResult::Reset () - { theeval = Standard_False; } - - void IFSelect_ShareOutResult::Evaluate () -{ - if (theeval) return; // deja fait. si pas OK, faire Reset avant - Prepare(); - theeval = Standard_True; -} - - - Handle(IFSelect_PacketList) IFSelect_ShareOutResult::Packets - (const Standard_Boolean complete) -{ - Evaluate(); - Handle(IFSelect_PacketList) list = new IFSelect_PacketList(thegraph.Model()); - Interface_EntityIterator iter; - for ( ; More(); Next()) { - list->AddPacket(); - if (complete) list->AddList (PacketContent().Content()); - else list->AddList (PacketRoot().Content()); - } - return list; -} - - Standard_Integer IFSelect_ShareOutResult::NbPackets () - { Evaluate(); return thedispres.NbParts(); } - - - void IFSelect_ShareOutResult::Prepare () -{ - thedisplist.Clear(); -// On alimente thedispres, thedisplist - thedispres.Reset(); - IFGraph_AllShared A(thegraph); - Handle(IFSelect_Dispatch) disp = thedispatch; - Standard_Integer nb = 1, first = 1; - if (!theshareout.IsNull()) { - nb = theshareout->NbDispatches(); - first = theshareout->LastRun() + 1; - } - Standard_Integer i; // svv Jan11 2000 : porting on DEC - for (i = first; i <= nb; i ++) { - if (!theshareout.IsNull()) disp = theshareout->Dispatch(i); - if (disp->FinalSelection().IsNull()) continue; // Dispatch neutralise - IFGraph_SubPartsIterator packs(thegraph,Standard_False); - disp->Packets(thegraph,packs); - for (packs.Start(); packs.More(); packs.Next()) { - Interface_EntityIterator iter = packs.Entities(); - if (iter.NbEntities() == 0) continue; - thedispres.AddPart(); - thedispres.GetFromIter(iter); // on enregistre ce paquet - A.ResetData(); - A.GetFromIter(iter); - thedisplist.Append(i); // n0 du dispatch producteur - } - } - thedispnum = thepacknum = 1; - thepackdisp = 1; // calcul sur 1er Dispatch - thenbindisp = 0; - for (i = thepacknum; i <= thedisplist.Length(); i ++) { - if (thedisplist.Value(i) != thedispnum) break; - thenbindisp ++; - } -} - - Standard_Boolean IFSelect_ShareOutResult::More () - { return thedispres.More(); } // thepacknum < thedisplist.Length()); - - void IFSelect_ShareOutResult::Next () -{ - thedispres.Next(); - thepacknum ++; - Standard_Integer dispnum; - if (thepacknum <= thedisplist.Length()) - dispnum = thedisplist.Value(thepacknum); - else { - thenbindisp = 0; -#if !defined No_Exception -// std::cout<<" ** ** IFSelect_ShareOutResult::Next, void dispatch ignored"<Dispatch(thedispnum); - } -} - - void IFSelect_ShareOutResult::NextDispatch () -{ - for (; thepacknum <= thedisplist.Length(); thepacknum ++) { - thedispres.Next(); - if (thedispnum != thedisplist.Value(thepacknum)) { - thedispnum = thedisplist.Value(thepacknum); -// Calcul donnees propres au Dispatch - thepackdisp = 1; - thenbindisp = 0; - for (Standard_Integer i = thepacknum; i <= thedisplist.Length(); i ++) { - if (thedisplist.Value(i) != thedispnum) break; - thenbindisp ++; - } - if (!theshareout.IsNull()) thedispatch = theshareout->Dispatch(thedispnum); - return; - } - } - thepacknum = thedisplist.Length() + 1; // no next dispatch ... - thedispnum = thepackdisp = thenbindisp = 0; -} - - Handle(IFSelect_Dispatch) IFSelect_ShareOutResult::Dispatch () const - { return thedispatch; } - - Standard_Integer IFSelect_ShareOutResult::DispatchRank () const - { return thedispnum; } - - void IFSelect_ShareOutResult::PacketsInDispatch - (Standard_Integer& numpack, Standard_Integer& nbpacks) const - { numpack = thepackdisp; nbpacks = thenbindisp; } - - Interface_EntityIterator IFSelect_ShareOutResult::PacketRoot () - { return thedispres.Entities(); } - - Interface_EntityIterator IFSelect_ShareOutResult::PacketContent () -{ -// IFGraph_Cumulate G(thegraph); - Interface_EntityIterator iter = thedispres.Entities(); - Interface_Graph G(thegraph); -// G.GetFromIter(thedispres.Entities(),0); - for (iter.Start(); iter.More(); iter.Next()) - G.GetFromEntity(iter.Value(),Standard_True); - Interface_GraphContent GC(G); - return GC.Result(); -} - - TCollection_AsciiString IFSelect_ShareOutResult::FileName () const -{ - Standard_Integer nd = DispatchRank(); - Standard_Integer np,nbp; - PacketsInDispatch(np,nbp); - return theshareout->FileName(nd,np,nbp); -} diff --git a/src/IFSelect/IFSelect_ShareOutResult.hxx b/src/IFSelect/IFSelect_ShareOutResult.hxx deleted file mode 100644 index 59c1efff44..0000000000 --- a/src/IFSelect/IFSelect_ShareOutResult.hxx +++ /dev/null @@ -1,166 +0,0 @@ -// Created on: 1992-11-17 -// 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 _IFSelect_ShareOutResult_HeaderFile -#define _IFSelect_ShareOutResult_HeaderFile - -#include -#include -#include - -#include -#include -#include -class IFSelect_ShareOut; -class IFSelect_Dispatch; -class Interface_InterfaceModel; -class IFSelect_PacketList; -class Interface_EntityIterator; -class TCollection_AsciiString; - -//! This class gives results computed from a ShareOut : simulation -//! before transfer, helps to list entities ... -//! Transfer itself will later be performed, either by a -//! TransferCopy to simply divide up a file, or a TransferDispatch -//! which can be parametred with more details -class IFSelect_ShareOutResult -{ -public: - - DEFINE_STANDARD_ALLOC - - //! Creates a ShareOutResult from a ShareOut, to work on a Model - //! (without any more precision; uses Active Protocol) - Standard_EXPORT IFSelect_ShareOutResult(const Handle(IFSelect_ShareOut)& sho, const Handle(Interface_InterfaceModel)& mod); - - //! Creates a ShareOutResult from a ShareOut, to work on a Graph - //! already computed, which defines the Input Model and can - //! specialize some Entities - Standard_EXPORT IFSelect_ShareOutResult(const Handle(IFSelect_ShareOut)& sho, const Interface_Graph& G); - - //! Creates a ShareOutResult from a unique Dispatch, to work on - //! a Model. As if it was a ShareOut with only one Dispatch - //! (without any more precision; uses Active Protocol) - //! Allows to compute the effect of a single Dispatch - Standard_EXPORT IFSelect_ShareOutResult(const Handle(IFSelect_Dispatch)& disp, const Handle(Interface_InterfaceModel)& mod); - - //! Creates a ShareOutResult from a unique Dispatch, to work on - //! a Graph. As if it was a ShareOut with only one Dispatch - //! Allows to compute the effect of a single Dispatch - Standard_EXPORT IFSelect_ShareOutResult(const Handle(IFSelect_Dispatch)& disp, const Interface_Graph& G); - - //! Returns the ShareOut used to create the ShareOutResult - //! if creation from a Dispatch, returns a Null Handle - Standard_EXPORT Handle(IFSelect_ShareOut) ShareOut() const; - - //! Returns the Graph used to create theShareOutResult - Standard_EXPORT const Interface_Graph& Graph() const; - - //! Erases computed data, in order to command a new Evaluation - Standard_EXPORT void Reset(); - - //! Evaluates the result of a ShareOut : determines Entities to be - //! forgotten by the ShareOut, Entities to be transferred several - //! times (duplicated), prepares an iteration on the packets to be - //! produced - //! Called the first time anyone question is asked, or after a - //! call to Reset. Works by calling the method Prepare. - Standard_EXPORT void Evaluate(); - - //! Returns the list of recorded Packets, under two modes : - //! - = False, the strict definition of Packets, i.e. - //! for each one, the Root Entities, to be explicitly sent - //! - = True (Default), the completely evaluated list, - //! i.e. which really gives the destination of each entity : - //! this mode allows to evaluate duplications - //! Remark that to send packets, iteration remains preferable - //! (file names are managed) - Standard_EXPORT Handle(IFSelect_PacketList) Packets (const Standard_Boolean complete = Standard_True); - - //! Returns the total count of produced non empty packets - //! (in out : calls Evaluate as necessary) - Standard_EXPORT Standard_Integer NbPackets(); - - //! Prepares the iteration on the packets - //! This method is called by Evaluate, but can be called anytime - //! The iteration consists in taking each Dispatch of the ShareOut - //! beginning by the first one, compute its packets, then iterate - //! on these packets. Once all these packets are iterated, the - //! iteration passes to the next Dispatch, or stops. - //! For a creation from a unique Dispatch, same but with only - //! this Dispatch. - //! Each packet can be listed, or really transferred (producing - //! a derived Model, from which a file can be generated) - //! - //! Prepare sets the iteration to the first Dispatch, first Packet - Standard_EXPORT void Prepare(); - - //! Returns True if there is more packets in the current Dispatch, - //! else if there is more Dispatch in the ShareOut - Standard_EXPORT Standard_Boolean More(); - - //! Passes to the next Packet in the current Dispatch, or if there - //! is none, to the next Dispatch in the ShareOut - Standard_EXPORT void Next(); - - //! Passes to the next Dispatch, regardless about remaining packets - Standard_EXPORT void NextDispatch(); - - //! Returns the current Dispatch - Standard_EXPORT Handle(IFSelect_Dispatch) Dispatch() const; - - //! Returns the Rank of the current Dispatch in the ShareOut - //! Returns Zero if there is none (iteration finished) - Standard_EXPORT Standard_Integer DispatchRank() const; - - //! Returns Number (rank) of current Packet in current Dispatch, - //! and total count of Packets in current Dispatch, as arguments - Standard_EXPORT void PacketsInDispatch (Standard_Integer& numpack, Standard_Integer& nbpacks) const; - - //! Returns the list of Roots of the current Packet (never empty) - //! (i.e. the Entities to be themselves asked for transfer) - //! Error if there is none (iteration finished) - Standard_EXPORT Interface_EntityIterator PacketRoot(); - - //! Returns the complete content of the current Packet (i.e. - //! with shared entities, which will also be put in the file) - Standard_EXPORT Interface_EntityIterator PacketContent(); - - //! Returns the File Name which corresponds to current Packet - //! (computed by ShareOut) - //! If current Packet has no associated name (see ShareOut), - //! the returned value is Null - Standard_EXPORT TCollection_AsciiString FileName() const; - -protected: - - Interface_Graph thegraph; - IFGraph_SubPartsIterator thedispres; - -private: - - Handle(IFSelect_ShareOut) theshareout; - Handle(IFSelect_Dispatch) thedispatch; - Standard_Boolean theeval; - Standard_Integer thedispnum; - Standard_Integer thepacknum; - Standard_Integer thepackdisp; - Standard_Integer thenbindisp; - TColStd_SequenceOfInteger thedisplist; - -}; - -#endif // _IFSelect_ShareOutResult_HeaderFile diff --git a/src/IFSelect/IFSelect_SignAncestor.cxx b/src/IFSelect/IFSelect_SignAncestor.cxx deleted file mode 100644 index 8e11595c3d..0000000000 --- a/src/IFSelect/IFSelect_SignAncestor.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// Created on: 1999-02-17 -// Created by: Pavel DURANDIN -// Copyright (c) 1999-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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SignAncestor,IFSelect_SignType) - -IFSelect_SignAncestor::IFSelect_SignAncestor (const Standard_Boolean nopk) - : IFSelect_SignType (nopk) { } - -Standard_Boolean IFSelect_SignAncestor::Matches(const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& /*model*/, - const TCollection_AsciiString& text, - const Standard_Boolean /*exact*/) const -{ - if (ent.IsNull()) return Standard_False; - DeclareAndCast(Standard_Type,atype,ent); - if (atype.IsNull()) atype = ent->DynamicType(); - return atype->SubType(text.ToCString()); -} - diff --git a/src/IFSelect/IFSelect_SignAncestor.hxx b/src/IFSelect/IFSelect_SignAncestor.hxx deleted file mode 100644 index 688ce6e460..0000000000 --- a/src/IFSelect/IFSelect_SignAncestor.hxx +++ /dev/null @@ -1,65 +0,0 @@ -// Created on: 1999-02-17 -// Created by: Pavel DURANDIN -// Copyright (c) 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 _IFSelect_SignAncestor_HeaderFile -#define _IFSelect_SignAncestor_HeaderFile - -#include - -#include -class Standard_Transient; -class Interface_InterfaceModel; -class TCollection_AsciiString; - - -class IFSelect_SignAncestor; -DEFINE_STANDARD_HANDLE(IFSelect_SignAncestor, IFSelect_SignType) - - -class IFSelect_SignAncestor : public IFSelect_SignType -{ - -public: - - - Standard_EXPORT IFSelect_SignAncestor(const Standard_Boolean nopk = Standard_False); - - Standard_EXPORT virtual Standard_Boolean Matches (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model, const TCollection_AsciiString& text, const Standard_Boolean exact) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SignAncestor,IFSelect_SignType) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SignAncestor_HeaderFile diff --git a/src/IFSelect/IFSelect_SignCategory.cxx b/src/IFSelect/IFSelect_SignCategory.cxx deleted file mode 100644 index c7d7988bb4..0000000000 --- a/src/IFSelect/IFSelect_SignCategory.cxx +++ /dev/null @@ -1,41 +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(IFSelect_SignCategory,IFSelect_Signature) - -static Standard_CString nulsign = ""; - - - IFSelect_SignCategory::IFSelect_SignCategory () - : IFSelect_Signature ("Category") -{ - Interface_Category::Init(); // si pas deja fait - Standard_Integer i, nb = Interface_Category::NbCategories(); - for (i = 1; i <= nb; i ++) AddCase (Interface_Category::Name(i)); -} - - - Standard_CString IFSelect_SignCategory::Value - (const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model) const -{ - if (ent.IsNull() || model.IsNull()) return nulsign; - return Interface_Category::Name(model->CategoryNumber (model->Number(ent))); -} diff --git a/src/IFSelect/IFSelect_SignCategory.hxx b/src/IFSelect/IFSelect_SignCategory.hxx deleted file mode 100644 index 98f510d8b9..0000000000 --- a/src/IFSelect/IFSelect_SignCategory.hxx +++ /dev/null @@ -1,68 +0,0 @@ -// Created on: 1996-01-26 -// Created by: Christian CAILLET -// Copyright (c) 1996-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 _IFSelect_SignCategory_HeaderFile -#define _IFSelect_SignCategory_HeaderFile - -#include - -#include -class Standard_Transient; -class Interface_InterfaceModel; - - -class IFSelect_SignCategory; -DEFINE_STANDARD_HANDLE(IFSelect_SignCategory, IFSelect_Signature) - -//! This Signature returns the Category of an entity, as recorded -//! in the model -class IFSelect_SignCategory : public IFSelect_Signature -{ - -public: - - - //! Returns a SignCategory - Standard_EXPORT IFSelect_SignCategory(); - - //! Returns the Signature for a Transient object, as its Category - //! recorded in the model - Standard_EXPORT Standard_CString Value (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SignCategory,IFSelect_Signature) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SignCategory_HeaderFile diff --git a/src/IFSelect/IFSelect_SignCounter.cxx b/src/IFSelect/IFSelect_SignCounter.cxx deleted file mode 100644 index d0833fb65f..0000000000 --- a/src/IFSelect/IFSelect_SignCounter.cxx +++ /dev/null @@ -1,163 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SignCounter,IFSelect_SignatureList) - -IFSelect_SignCounter::IFSelect_SignCounter - (const Standard_Boolean withmap, const Standard_Boolean withlist) - : IFSelect_SignatureList (withlist) -{ - themapstat = withmap; thenbcomp1 = thenbcomp2 = theselmode = 0; -} - - IFSelect_SignCounter::IFSelect_SignCounter - (const Handle(IFSelect_Signature)& matcher, - const Standard_Boolean withmap, const Standard_Boolean withlist) - : IFSelect_SignatureList (withlist) , thematcher (matcher) -{ - themapstat = withmap; thenbcomp1 = thenbcomp2 = theselmode = 0; - TCollection_AsciiString sign = thematcher->Name(); - SetName (sign.ToCString()); -} - - Handle(IFSelect_Signature) IFSelect_SignCounter::Signature () const - { return thematcher; } - - void IFSelect_SignCounter::SetMap (const Standard_Boolean withmap) - { themapstat = withmap; } - - Standard_Boolean IFSelect_SignCounter::AddEntity - (const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model) -{ - if (themapstat && !ent.IsNull()) { - if (themap.Contains(ent)) return Standard_False; - themap.Add(ent); - } - AddSign (ent,model); - return Standard_True; -} - - void IFSelect_SignCounter::AddSign - (const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model) -{ - char nulsign[2]; - nulsign[0] = '\0'; - if (ent.IsNull() || thematcher.IsNull()) - Add (ent, nulsign); // pour compter les Nuls - else Add (ent, thematcher->Value(ent,model) ); -} - - - void IFSelect_SignCounter::AddList - (const Handle(TColStd_HSequenceOfTransient)& list, - const Handle(Interface_InterfaceModel)& model) -{ - if (list.IsNull()) return; - Standard_Integer nb = list->Length(); - for (Standard_Integer i = 1; i <= nb; i ++) AddEntity(list->Value(i),model); -} - - void IFSelect_SignCounter::AddWithGraph - (const Handle(TColStd_HSequenceOfTransient)& list, - const Interface_Graph& graph) - { AddList (list,graph.Model()); } - - - void IFSelect_SignCounter::AddModel - (const Handle(Interface_InterfaceModel)& model) -{ - if (model.IsNull()) return; - Standard_Integer nb = model->NbEntities(); -// Si on part de vide, on sait que chque entite est unique dans le modele - Standard_Boolean mapstat = themapstat; - if (themap.Extent() == 0) themapstat = Standard_False; - for (Standard_Integer i = 1; i <= nb; i ++) AddEntity(model->Value(i),model); - themapstat = mapstat; -} - - void IFSelect_SignCounter::AddFromSelection - (const Handle(IFSelect_Selection)& sel, const Interface_Graph& G) -{ - Interface_EntityIterator iter = sel->RootResult(G); - AddWithGraph (iter.Content(),G); -} - -// ############# SELECTION ############## - - void IFSelect_SignCounter::SetSelection - (const Handle(IFSelect_Selection)& sel) -{ theselect = sel; SetSelMode(-1); SetSelMode (sel.IsNull() ? 0 : 2); } - - Handle(IFSelect_Selection) IFSelect_SignCounter::Selection () const - { return theselect; } - - void IFSelect_SignCounter::SetSelMode (const Standard_Integer selmode) -{ - if (selmode < 0) thenbcomp1 = thenbcomp2 = 0; - else theselmode = selmode; - if (selmode == 0) theselect.Nullify(); -} - - Standard_Integer IFSelect_SignCounter::SelMode () const - { return theselmode; } - - Standard_Boolean IFSelect_SignCounter::ComputeSelected - (const Interface_Graph& G, const Standard_Boolean forced) -{ - if (theselmode < 2 || theselect.IsNull()) return Standard_False; - Standard_Boolean afaire = forced; - Interface_EntityIterator iter = theselect->RootResult(G); - Standard_Integer nb1 = G.Size(); - Standard_Integer nb2 = iter.NbEntities(); - if (!afaire) afaire = (nb1 != thenbcomp1 || nb2 != thenbcomp2); - thenbcomp1 = nb1; thenbcomp2 = nb2; - if (afaire) AddWithGraph (iter.Content(),G); - return Standard_True; -} - - - Handle(TCollection_HAsciiString) IFSelect_SignCounter::Sign - (const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model) const -{ - Handle(TCollection_HAsciiString) res; - if (ent.IsNull() || thematcher.IsNull()) return res; - res = new TCollection_HAsciiString (thematcher->Value(ent,model)); - return res; -} - - Standard_CString IFSelect_SignCounter::ComputedSign - (const Handle(Standard_Transient)& ent, - const Interface_Graph& G) -{ - Handle(TColStd_HSequenceOfTransient) list = new TColStd_HSequenceOfTransient(); - list->Append (ent); - ModeSignOnly() = Standard_True; - AddWithGraph (list,G); - Standard_CString val = LastValue(); - ModeSignOnly() = Standard_False; - return val; -} diff --git a/src/IFSelect/IFSelect_SignCounter.hxx b/src/IFSelect/IFSelect_SignCounter.hxx deleted file mode 100644 index 7bf1d74d0b..0000000000 --- a/src/IFSelect/IFSelect_SignCounter.hxx +++ /dev/null @@ -1,166 +0,0 @@ -// Created on: 1994-11-07 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_SignCounter_HeaderFile -#define _IFSelect_SignCounter_HeaderFile - -#include -#include - -#include -#include -#include -#include -class IFSelect_Signature; -class IFSelect_Selection; -class Standard_Transient; -class Interface_InterfaceModel; -class Interface_Graph; -class TCollection_HAsciiString; - -class IFSelect_SignCounter; -DEFINE_STANDARD_HANDLE(IFSelect_SignCounter, IFSelect_SignatureList) - -//! SignCounter gives the frame to count signatures associated -//! with entities, deducted from them. Ex.: their Dynamic Type. -//! -//! It can sort a set of Entities according a signature, i.e. : -//! - list of different values found for this Signature -//! - for each one, count and list of entities -//! Results are returned as a SignatureList, which can be queried -//! on the count (list of strings, count per signature, or list of -//! entities per signature) -//! -//! A SignCounter can be filled, either directly from lists, or -//! from the result of a Selection : hence, its content can be -//! automatically recomputed as desired -//! -//! SignCounter works by using a Signature in its method AddSign -//! -//! Methods can be redefined to, either -//! - directly compute the value without a Signature -//! - compute the value in the context of a Graph -class IFSelect_SignCounter : public IFSelect_SignatureList -{ - -public: - - //! Creates a SignCounter, without proper Signature - //! If is True (default), added entities are counted - //! only if they are not yet recorded in the map - //! Map control can be set off if the input guarantees uniqueness of data - //! is transmitted to SignatureList (option to list - //! entities, not only to count them). - Standard_EXPORT IFSelect_SignCounter(const Standard_Boolean withmap = Standard_True, const Standard_Boolean withlist = Standard_False); - - //! Creates a SignCounter, with a predefined Signature - //! Other arguments as for Create without Signature. - Standard_EXPORT IFSelect_SignCounter(const Handle(IFSelect_Signature)& matcher, const Standard_Boolean withmap = Standard_True, const Standard_Boolean withlist = Standard_False); - - //! Returns the Signature used to count entities. It can be null. - Standard_EXPORT Handle(IFSelect_Signature) Signature() const; - - //! Changes the control status. The map is not cleared, simply - //! its use changes - Standard_EXPORT void SetMap (const Standard_Boolean withmap); - - //! Adds an entity by considering its signature, which is given by - //! call to method AddSign - //! Returns True if added, False if already in the map (and - //! map control status set) - Standard_EXPORT virtual Standard_Boolean AddEntity (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model); - - //! Adds an entity (already filtered by Map) with its signature. - //! This signature can be computed with the containing model. - //! Its value is provided by the object Signature given at start, - //! if no Signature is defined, it does nothing. - //! - //! Can be redefined (in this case, see also Sign) - Standard_EXPORT virtual void AddSign (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model); - - //! Adds a list of entities by adding each of the items - Standard_EXPORT void AddList (const Handle(TColStd_HSequenceOfTransient)& list, const Handle(Interface_InterfaceModel)& model); - - //! Adds a list of entities in the context given by the graph - //! Default just call basic AddList - //! Can be redefined to get a signature computed with the graph - Standard_EXPORT virtual void AddWithGraph (const Handle(TColStd_HSequenceOfTransient)& list, const Interface_Graph& graph); - - //! Adds all the entities contained in a Model - Standard_EXPORT void AddModel (const Handle(Interface_InterfaceModel)& model); - - //! Adds the result determined by a Selection from a Graph - //! Remark : does not impact at all data from SetSelection & Co - Standard_EXPORT void AddFromSelection (const Handle(IFSelect_Selection)& sel, const Interface_Graph& G); - - //! Sets a Selection as input : this causes content to be cleared - //! then the Selection to be ready to compute (but not immediately) - Standard_EXPORT void SetSelection (const Handle(IFSelect_Selection)& sel); - - //! Returns the selection, or a null Handle - Standard_EXPORT Handle(IFSelect_Selection) Selection() const; - - //! Changes the mode of working with the selection : - //! -1 just clears optimisation data and nothing else - //! 0 clears it 1 inhibits it for computing (but no clearing) - //! 2 sets it active for computing - //! Default at creation is 0, after SetSelection (not null) is 2 - Standard_EXPORT void SetSelMode (const Standard_Integer selmode); - - //! Returns the mode of working with the selection - Standard_EXPORT Standard_Integer SelMode() const; - - //! Computes from the selection result, if selection is active - //! (mode 2). If selection is not defined (mode 0) or is inhibited - //! (mode 1) does nothing. - //! Returns True if computation is done (or optimised), False else - //! This method is called by ComputeCounter from WorkSession - //! - //! If is True, recomputes systematically - //! Else (D), if the counter was not cleared and if the former - //! computed result started from the same total size of Graph and - //! same count of selected entities : computation is not redone - //! unless is given as True - Standard_EXPORT Standard_Boolean ComputeSelected (const Interface_Graph& G, const Standard_Boolean forced = Standard_False); - - //! Determines and returns the value of the signature for an - //! entity as an HAsciiString. This method works exactly as - //! AddSign, which is optimized - //! - //! Can be redefined, accorded with AddSign - Standard_EXPORT virtual Handle(TCollection_HAsciiString) Sign (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const; - - //! Applies AddWithGraph on one entity, and returns the Signature - //! Value which has been recorded - //! To do this, Add is called with SignOnly Mode True during the - //! call, the returned value is LastValue - Standard_EXPORT Standard_CString ComputedSign (const Handle(Standard_Transient)& ent, const Interface_Graph& G); - - DEFINE_STANDARD_RTTIEXT(IFSelect_SignCounter,IFSelect_SignatureList) - -private: - - Standard_Boolean themapstat; - TColStd_MapOfTransient themap; - Handle(IFSelect_Signature) thematcher; - Handle(IFSelect_Selection) theselect; - Standard_Integer theselmode; - Standard_Integer thenbcomp1; - Standard_Integer thenbcomp2; - -}; - -#endif // _IFSelect_SignCounter_HeaderFile diff --git a/src/IFSelect/IFSelect_SignMultiple.cxx b/src/IFSelect/IFSelect_SignMultiple.cxx deleted file mode 100644 index 3b5c691eb4..0000000000 --- a/src/IFSelect/IFSelect_SignMultiple.cxx +++ /dev/null @@ -1,76 +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(IFSelect_SignMultiple,IFSelect_Signature) - -static TCollection_AsciiString theval; // temporaire pour construire Value - - IFSelect_SignMultiple::IFSelect_SignMultiple (const Standard_CString name) - : IFSelect_Signature (name) { } - - void IFSelect_SignMultiple::Add - (const Handle(IFSelect_Signature)& subsign, - const Standard_Integer tabul, const Standard_Boolean maxi) -{ - if (subsign.IsNull()) return; - thesubs.Append (subsign); - thetabs.Append (maxi ? -tabul : tabul); -} - - Standard_CString IFSelect_SignMultiple::Value - (const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model) const -{ - theval.Clear(); - Standard_Integer i, nb = thesubs.Length(); - for (i = 1; i <= nb; i ++) { - Standard_Integer tabul = thetabs.Value(i); - Standard_Boolean maxi = (tabul < 0); - if (maxi) tabul = -tabul; - Handle(IFSelect_Signature) sign = Handle(IFSelect_Signature)::DownCast(thesubs.Value(i)); - Standard_CString val = sign->Value (ent,model); - TCollection_AsciiString str(val); - Standard_Integer sl = str.Length(); - str.LeftJustify (tabul,' '); - if (sl > tabul && maxi) { - str.Remove (sl+1,tabul-sl); - str.SetValue (sl,'.'); - } - str.AssignCat(" "); - theval.AssignCat (str); - } - return theval.ToCString(); -} - - - Standard_Boolean IFSelect_SignMultiple::Matches - (const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model, - const TCollection_AsciiString& text, const Standard_Boolean exact) const -{ - if (exact) return IFSelect_Signature::Matches (ent,model,text,exact); - Standard_Integer i, nb = thesubs.Length(); - for (i = 1; i <= nb; i ++) { - Handle(IFSelect_Signature) sign = - Handle(IFSelect_Signature)::DownCast(thesubs.Value(i)); - if (sign->Matches (ent,model,text,exact)) return Standard_True; - } - return Standard_False; -} diff --git a/src/IFSelect/IFSelect_SignMultiple.hxx b/src/IFSelect/IFSelect_SignMultiple.hxx deleted file mode 100644 index c0e2925242..0000000000 --- a/src/IFSelect/IFSelect_SignMultiple.hxx +++ /dev/null @@ -1,91 +0,0 @@ -// Created on: 1998-01-28 -// Created by: Christian CAILLET -// Copyright (c) 1998-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 _IFSelect_SignMultiple_HeaderFile -#define _IFSelect_SignMultiple_HeaderFile - -#include - -#include -#include -#include -#include -class Standard_Transient; -class Interface_InterfaceModel; -class TCollection_AsciiString; - - -class IFSelect_SignMultiple; -DEFINE_STANDARD_HANDLE(IFSelect_SignMultiple, IFSelect_Signature) - -//! Multiple Signature : ordered list of other Signatures -//! It concatenates on a same line the result of its sub-items -//! separated by sets of 3 blanks -//! It is possible to define tabulations between sub-items -//! Moreover, match rules are specific -class IFSelect_SignMultiple : public IFSelect_Signature -{ - -public: - - - //! Creates an empty SignMultiple with a Name - //! This name should take expected tabulations into account - Standard_EXPORT IFSelect_SignMultiple(const Standard_CString name); - - //! Adds a Signature. Width, if given, gives the tabulation - //! If is True, it is a forced tabulation (overlength is - //! replaced by a final dot) - //! If is False, just 3 blanks follow an overlength - Standard_EXPORT void Add (const Handle(IFSelect_Signature)& subsign, const Standard_Integer width = 0, const Standard_Boolean maxi = Standard_False); - - //! Concatenates the values of sub-signatures, with their - //! tabulations - Standard_EXPORT Standard_CString Value (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - //! Specialized Match Rule - //! If is False, simply checks if at least one sub-item - //! matches - //! If is True, standard match with Value - //! (i.e. tabulations must be respected) - Standard_EXPORT virtual Standard_Boolean Matches (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model, const TCollection_AsciiString& text, const Standard_Boolean exact) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SignMultiple,IFSelect_Signature) - -protected: - - - - -private: - - - TColStd_SequenceOfTransient thesubs; - TColStd_SequenceOfInteger thetabs; - - -}; - - - - - - - -#endif // _IFSelect_SignMultiple_HeaderFile diff --git a/src/IFSelect/IFSelect_SignType.cxx b/src/IFSelect/IFSelect_SignType.cxx deleted file mode 100644 index bf19e04fd2..0000000000 --- a/src/IFSelect/IFSelect_SignType.cxx +++ /dev/null @@ -1,44 +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(IFSelect_SignType,IFSelect_Signature) - -static Standard_CString nulsign = ""; - - - IFSelect_SignType::IFSelect_SignType (const Standard_Boolean nopk) - : IFSelect_Signature ((Standard_CString ) (nopk ? "Class Type" : "Dynamic Type") ) , - thenopk (nopk) -{} - - Standard_CString IFSelect_SignType::Value - (const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& /*model*/) const -{ - if (ent.IsNull()) return nulsign; - DeclareAndCast(Standard_Type,atype,ent); - if (atype.IsNull()) atype = ent->DynamicType(); - Standard_CString tn = atype->Name(); - if (!thenopk) return tn; - for (int i = 0; tn[i] != '\0'; i ++) { - if (tn[i] == '_') return &tn[i+1]; - } - return tn; -} diff --git a/src/IFSelect/IFSelect_SignType.hxx b/src/IFSelect/IFSelect_SignType.hxx deleted file mode 100644 index 4776b6ae33..0000000000 --- a/src/IFSelect/IFSelect_SignType.hxx +++ /dev/null @@ -1,73 +0,0 @@ -// Created on: 1996-01-29 -// Created by: Christian CAILLET -// Copyright (c) 1996-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 _IFSelect_SignType_HeaderFile -#define _IFSelect_SignType_HeaderFile - -#include - -#include -class Standard_Transient; -class Interface_InterfaceModel; - - -class IFSelect_SignType; -DEFINE_STANDARD_HANDLE(IFSelect_SignType, IFSelect_Signature) - -//! This Signature returns the cdl Type of an entity, under two -//! forms : -//! - complete dynamic type (package and class) -//! - class type, without package name -class IFSelect_SignType : public IFSelect_Signature -{ - -public: - - - //! Returns a SignType - //! false (D) : complete dynamic type (name = Dynamic Type) - //! true : class type without pk (name = Class Type) - Standard_EXPORT IFSelect_SignType(const Standard_Boolean nopk = Standard_False); - - //! Returns the Signature for a Transient object, as its Dynamic - //! Type, with or without package name, according starting option - Standard_EXPORT Standard_CString Value (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SignType,IFSelect_Signature) - -protected: - - - - -private: - - - Standard_Boolean thenopk; - - -}; - - - - - - - -#endif // _IFSelect_SignType_HeaderFile diff --git a/src/IFSelect/IFSelect_SignValidity.cxx b/src/IFSelect/IFSelect_SignValidity.cxx deleted file mode 100644 index 6379970a3a..0000000000 --- a/src/IFSelect/IFSelect_SignValidity.cxx +++ /dev/null @@ -1,80 +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(IFSelect_SignValidity,IFSelect_Signature) - -static Standard_CString nulsign = ""; - - -//======================================================================= -//function : IFSelect_SignValidity -//purpose : -//======================================================================= - -IFSelect_SignValidity::IFSelect_SignValidity() : IFSelect_Signature ("Validity") -{ - AddCase ("UNKNOWN"); - AddCase ("UNLOADED"); - AddCase ("Load-Error"); - AddCase ("Data-Error"); - AddCase ("Load-Warning"); - AddCase ("Data-Warning"); - AddCase ("OK"); -} - - -//======================================================================= -//function : CVal -//purpose : -//======================================================================= - -Standard_CString IFSelect_SignValidity::CVal(const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model) -{ - if (ent.IsNull() || model.IsNull()) return nulsign; - Standard_Integer num = model->Number(ent); - Standard_Integer cas = 0; - if (model->IsUnknownEntity(num)) return "UNKNOWN"; - if (model->IsRedefinedContent(num)) return "UNLOADED"; - - const Handle(Interface_Check) ch1 = model->Check(num,Standard_True); - const Handle(Interface_Check) ch2 = model->Check(num,Standard_False); - if (ch1->NbFails() > 0) return "Load-Error"; - else if (ch1->NbWarnings() > 0) cas = 1; - - if (ch2->NbFails() > 0) return "Data-Error"; - else if (cas == 1) return "Load-Warning"; - else if (ch2->NbWarnings() > 0) return "Data-Warning"; - - return "OK"; -} - - -//======================================================================= -//function : Value -//purpose : -//======================================================================= - -Standard_CString IFSelect_SignValidity::Value - (const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model) const -{ - return IFSelect_SignValidity::CVal(ent,model); -} diff --git a/src/IFSelect/IFSelect_SignValidity.hxx b/src/IFSelect/IFSelect_SignValidity.hxx deleted file mode 100644 index 2a41de18a8..0000000000 --- a/src/IFSelect/IFSelect_SignValidity.hxx +++ /dev/null @@ -1,76 +0,0 @@ -// Created on: 1996-01-26 -// Created by: Christian CAILLET -// Copyright (c) 1996-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 _IFSelect_SignValidity_HeaderFile -#define _IFSelect_SignValidity_HeaderFile - -#include - -#include -class Standard_Transient; -class Interface_InterfaceModel; - - -class IFSelect_SignValidity; -DEFINE_STANDARD_HANDLE(IFSelect_SignValidity, IFSelect_Signature) - -//! This Signature returns the Validity Status of an entity, as -//! deducted from data in the model : it can be -//! "OK" "Unknown" "Unloaded" "Syntactic Fail"(but loaded) -//! "Syntactic Warning" "Semantic Fail" "Semantic Warning" -class IFSelect_SignValidity : public IFSelect_Signature -{ - -public: - - - //! Returns a SignValidity - Standard_EXPORT IFSelect_SignValidity(); - - //! Returns the Signature for a Transient object, as a validity - //! deducted from data (reports) stored in the model. - //! Class method, can be called by any one - Standard_EXPORT static Standard_CString CVal (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model); - - //! Returns the Signature for a Transient object, as a validity - //! deducted from data (reports) stored in the model - //! Calls the class method CVal - Standard_EXPORT Standard_CString Value (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SignValidity,IFSelect_Signature) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _IFSelect_SignValidity_HeaderFile diff --git a/src/IFSelect/IFSelect_Signature.cxx b/src/IFSelect/IFSelect_Signature.cxx deleted file mode 100644 index 29a846078f..0000000000 --- a/src/IFSelect/IFSelect_Signature.cxx +++ /dev/null @@ -1,126 +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 -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_Signature,Interface_SignType) - -// unused -//static Standard_CString nulsign = ""; -static char intval[20]; - - - IFSelect_Signature::IFSelect_Signature (const Standard_CString name) - : thename (name) { thecasi[0] = thecasi[1] = thecasi[2] = 0; } - - void IFSelect_Signature::SetIntCase - (const Standard_Boolean hasmin, const Standard_Integer valmin, - const Standard_Boolean hasmax, const Standard_Integer valmax) -{ - thecasi[0] = 1; - if (hasmin) { thecasi[0] += 2; thecasi[1] = valmin; } - if (hasmax) { thecasi[0] += 4; thecasi[2] = valmax; } -} - - Standard_Boolean IFSelect_Signature::IsIntCase - (Standard_Boolean& hasmin, Standard_Integer& valmin, - Standard_Boolean& hasmax, Standard_Integer& valmax) const -{ - hasmin = hasmax = Standard_False; - valmin = valmax = 0; - if (!thecasi[0]) return Standard_False; - if (thecasi[0] & 2) { hasmin = Standard_True; valmin = thecasi[1]; } - if (thecasi[0] & 4) { hasmax = Standard_True; valmax = thecasi[2]; } - return Standard_True; -} - - void IFSelect_Signature::AddCase (const Standard_CString acase) -{ - if (thecasl.IsNull()) thecasl = new TColStd_HSequenceOfAsciiString(); - TCollection_AsciiString scase(acase); - thecasl->Append(scase); -} - - Handle(TColStd_HSequenceOfAsciiString) IFSelect_Signature::CaseList () const - { return thecasl; } - - - Standard_CString IFSelect_Signature::Name () const - { return thename.ToCString(); } - - TCollection_AsciiString IFSelect_Signature::Label () const -{ - TCollection_AsciiString label("Signature : "); - label.AssignCat(thename); - return label; -} - - - Standard_Boolean IFSelect_Signature::Matches - (const Handle(Standard_Transient)& ent, - const Handle(Interface_InterfaceModel)& model, - const TCollection_AsciiString& text, const Standard_Boolean exact) const - -{ return IFSelect_Signature::MatchValue ( Value(ent,model) , text, exact); } - - - Standard_Boolean IFSelect_Signature::MatchValue - (const Standard_CString val, - const TCollection_AsciiString& text, const Standard_Boolean exact) -{ - if (exact) return text.IsEqual (val); - // NB: no regexp - char cardeb = text.Value(1); - Standard_Integer ln,lnt,i,j; - ln = text.Length(); - lnt = (Standard_Integer)(strlen(val) - ln); - for (i = 0; i <= lnt; i ++) { - if (val[i] == cardeb) { -// un candidat - Standard_Boolean res = Standard_True; - for (j = 1; j < ln; j ++) { - if (val[i+j] != text.Value(j+1)) - { res = Standard_False; break; } - } - if (res) return res; - } - } - return Standard_False; -} - - - Standard_CString IFSelect_Signature::IntValue - (const Standard_Integer val) -{ - switch (val) { - case 0 : return "0"; - case 1 : return "1"; - case 2 : return "2"; - case 3 : return "3"; - case 4 : return "4"; - case 5 : return "5"; - case 6 : return "6"; - case 7 : return "7"; - case 8 : return "8"; - case 9 : return "9"; - default : break; - } - sprintf (intval,"%d",val); - return intval; -} diff --git a/src/IFSelect/IFSelect_Signature.hxx b/src/IFSelect/IFSelect_Signature.hxx deleted file mode 100644 index e99b7cbc7e..0000000000 --- a/src/IFSelect/IFSelect_Signature.hxx +++ /dev/null @@ -1,126 +0,0 @@ -// Created on: 1994-04-21 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_Signature_HeaderFile -#define _IFSelect_Signature_HeaderFile - -#include - -#include -#include -#include -#include -class Standard_Transient; -class Interface_InterfaceModel; - - -class IFSelect_Signature; -DEFINE_STANDARD_HANDLE(IFSelect_Signature, Interface_SignType) - -//! Signature provides the basic service used by the classes -//! SelectSignature and Counter (i.e. Name, Value), which is : -//! - for an entity in a model, give a characteristic string, its -//! signature -//! This string has not to be unique in the model, but gives a -//! value for such or such important feature. -//! Examples : Dynamic Type; Category; etc -class IFSelect_Signature : public Interface_SignType -{ - -public: - - - //! Sets the information data to tell "integer cases" with - //! possible min and max values - //! To be called when creating - Standard_EXPORT void SetIntCase (const Standard_Boolean hasmin, const Standard_Integer valmin, const Standard_Boolean hasmax, const Standard_Integer valmax); - - //! Tells if this Signature gives integer values - //! and returns values from SetIntCase if True - Standard_EXPORT Standard_Boolean IsIntCase (Standard_Boolean& hasmin, Standard_Integer& valmin, Standard_Boolean& hasmax, Standard_Integer& valmax) const; - - //! Adds a possible case - //! To be called when creating, IF the list of possible cases for - //! Value is known when starting - //! For instance, for CDL types, rather do not fill this, - //! but for a specific enumeration (such as a status), can be used - Standard_EXPORT void AddCase (const Standard_CString acase); - - //! Returns the predefined list of possible cases, filled by AddCase - //! Null Handle if no predefined list (hence, to be counted) - //! Useful to filter on really possible vase, for instance, or - //! for a help - Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) CaseList() const; - - //! Returns an identification of the Signature (a word), given at - //! initialization time - //! Returns the Signature for a Transient object. It is specific - //! of each sub-class of Signature. For a Null Handle, it should - //! provide "" - //! It can work with the model which contains the entity - Standard_EXPORT Standard_CString Name() const Standard_OVERRIDE; - - //! The label of a Signature uses its name as follow : - //! "Signature : " - Standard_EXPORT TCollection_AsciiString Label() const; - - //! Tells if the value for in matches a text, with - //! a criterium . - //! The default definition calls MatchValue - //! Can be redefined - Standard_EXPORT virtual Standard_Boolean Matches (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model, const TCollection_AsciiString& text, const Standard_Boolean exact) const; - - //! Default procedure to tell if a value matches a text - //! with a criterium . = True requires equality, - //! else only contained (no reg-exp) - Standard_EXPORT static Standard_Boolean MatchValue (const Standard_CString val, const TCollection_AsciiString& text, const Standard_Boolean exact); - - //! This procedure converts an Integer to a CString - //! It is a convenient way when the value of a signature has the - //! form of a simple integer value - //! The value is to be used immediately (one buffer only, no copy) - Standard_EXPORT static Standard_CString IntValue (const Standard_Integer val); - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_Signature,Interface_SignType) - -protected: - - - //! Initializes a Signature with its name - Standard_EXPORT IFSelect_Signature(const Standard_CString name); - - TCollection_AsciiString thename; - - -private: - - - Standard_Integer thecasi[3]; - Handle(TColStd_HSequenceOfAsciiString) thecasl; - - -}; - - - - - - - -#endif // _IFSelect_Signature_HeaderFile diff --git a/src/IFSelect/IFSelect_SignatureList.cxx b/src/IFSelect/IFSelect_SignatureList.cxx deleted file mode 100644 index a56ab4a48f..0000000000 --- a/src/IFSelect/IFSelect_SignatureList.cxx +++ /dev/null @@ -1,248 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SignatureList,Standard_Transient) - -IFSelect_SignatureList::IFSelect_SignatureList - (const Standard_Boolean withlist) -{ - thesignonly = Standard_False; - thelistat = withlist; - thenbnuls = 0; - SetName("..."); -} - - void IFSelect_SignatureList::SetList - (const Standard_Boolean withlist) - { thelistat = withlist; } - - Standard_Boolean& IFSelect_SignatureList::ModeSignOnly () - { return thesignonly; } - - void IFSelect_SignatureList::Clear () -{ - thelastval.Clear(); - thenbnuls = 0; - thedicount.Clear(); - thediclist.Clear(); -} - - void IFSelect_SignatureList::Add - (const Handle(Standard_Transient)& ent, const Standard_CString sign) -{ - if (thesignonly) { - thelastval.Clear(); - thelastval.AssignCat (sign); - return; - } - - if (sign[0] == '\0') { thenbnuls ++; return; } - - if (thedicount.Contains(sign)) - thedicount.ChangeFromKey(sign)++; - else - thedicount.Add(sign, 1); - - if (thelistat) { - Handle(TColStd_HSequenceOfTransient) alist; - if (thediclist.Contains(sign)) - alist = Handle(TColStd_HSequenceOfTransient)::DownCast(thediclist.FindFromKey(sign)); - else { - alist = new TColStd_HSequenceOfTransient(); - thediclist.Add(sign, alist); - } - alist->Append(ent); - } -} - - Standard_CString IFSelect_SignatureList::LastValue () const - { return thelastval.ToCString(); } - - void IFSelect_SignatureList::Init - (const Standard_CString name, - const NCollection_IndexedDataMap& theCount, - const NCollection_IndexedDataMap& list, - const Standard_Integer nbnuls) -{ - thelastval.Clear(); - thename = new TCollection_HAsciiString (name); - thedicount = theCount; - thediclist = list; - thenbnuls = nbnuls; - if (thediclist.IsEmpty()) thelistat = Standard_False; -} - - - Handle(TColStd_HSequenceOfHAsciiString) IFSelect_SignatureList::List - (const Standard_CString root) const -{ - Handle(TColStd_HSequenceOfHAsciiString) list = - new TColStd_HSequenceOfHAsciiString(); - NCollection_IndexedDataMap::Iterator iter(thedicount); - for (; iter.More(); iter.Next()) { - if (!iter.Key().StartsWith(root)) continue; - - Handle(TCollection_HAsciiString) sign = - new TCollection_HAsciiString (iter.Key()); - list->Append(sign); - } - return list; -} - - - Standard_Boolean IFSelect_SignatureList::HasEntities () const - { return thelistat; } - - Standard_Integer IFSelect_SignatureList::NbNulls () const - { return thenbnuls; } - - Standard_Integer IFSelect_SignatureList::NbTimes - (const Standard_CString sign) const -{ - Standard_Integer nb = 0; - thedicount.FindFromKey(sign, nb); - return nb; -} - - Handle(TColStd_HSequenceOfTransient) IFSelect_SignatureList::Entities - (const Standard_CString sign) const -{ - Handle(TColStd_HSequenceOfTransient) list; - Handle(Standard_Transient) aTList; - if (!thelistat) return list; - if (thediclist.FindFromKey(sign, aTList)) - list = Handle(TColStd_HSequenceOfTransient)::DownCast(aTList); - else - list = new TColStd_HSequenceOfTransient(); - return list; -} - - - void IFSelect_SignatureList::SetName (const Standard_CString name) - { thename = new TCollection_HAsciiString (name); } - - Standard_CString IFSelect_SignatureList::Name () const - { return thename->ToCString(); } - - - void IFSelect_SignatureList::PrintCount (Standard_OStream& S) const -{ - Standard_Integer nbtot = 0, nbsign = 0; - NCollection_IndexedDataMap::Iterator iter(thedicount); - S << " Count "<ToCString()<<"\n ----- -----------"< 0) S << thename->ToCString()<< " Nul : " << thenbnuls <::Iterator iter(thediclist); - for (; iter.More(); iter.Next()) { - DeclareAndCast(TColStd_HSequenceOfTransient,list,iter.Value()); - S<Length(); - S<<" - Nb: "< 5 && mod == IFSelect_ShortByItem) nc = 5; - for (Standard_Integer i = 1; i <= nc; i ++) { - if (list->Value(i).IsNull()) { - S << " 0"; - if (mod == IFSelect_EntitiesByItem) S<<":(Global)"; - continue; - } - Standard_Integer num = model->Number(list->Value(i)); - if (num == IFSelect_ShortByItem) { S<<" ??"; continue; } - S<<" "<PrintLabel(list->Value(i), S); } - } - if (nc < nb) S<<" .. etc"; - S<::Iterator iter(thedicount); - S << " Summary "<ToCString()<<"\n ----- -----------"< maxent) maxent = nbent; - TCollection_AsciiString name = iter.Key(); -// if (!name.IsIntegerValue()) continue; pas bien fiable - Standard_Integer ic, nc = name.Length(); - Standard_Boolean iaint = Standard_True; - for (ic = 1; ic <= nc; ic ++) { - char unc = name.Value(ic); - if (ic == 1 && (unc == ' ' || unc == '+' || unc == '-')) continue; - if (unc >= '0' && unc <= '9') continue; - iaint = Standard_False; break; - } - if (!iaint) continue; - Standard_Integer val = name.IntegerValue(); - if (nbval == 0) { minval = maxval = val; } - if (minval > val) minval = val; - if (maxval < val) maxval = val; - nbval ++; - nbve += nbent; - totval += (val*nbent); - } - S << " Nb Total:"< 0) { - S<<" Summary on Integer Values"< - -#include -#include -#include -#include -#include -#include -class TCollection_HAsciiString; -class Interface_InterfaceModel; - - -class IFSelect_SignatureList; -DEFINE_STANDARD_HANDLE(IFSelect_SignatureList, Standard_Transient) - -//! A SignatureList is given as result from a Counter (any kind) -//! It gives access to a list of signatures, with counts, and -//! optionally with list of corresponding entities -//! -//! It can also be used only to give a signature, through SignOnly -//! Mode. This can be useful for a specific counter (used in a -//! Selection), while it remains better to use a Signature -//! whenever possible -class IFSelect_SignatureList : public Standard_Transient -{ - -public: - - - //! Creates a SignatureList. If is True, entities will - //! be not only counted per signature, but also listed. - Standard_EXPORT IFSelect_SignatureList(const Standard_Boolean withlist = Standard_False); - - //! Changes the record-list status. The list is not cleared but - //! its use changes - Standard_EXPORT void SetList (const Standard_Boolean withlist); - - //! Returns modifiable the SignOnly Mode - //! If False (D), the counter normally counts - //! If True, the counting work is turned off, Add only fills the - //! LastValue, which can be used as signature, when a counter - //! works from data which are not available from a Signature - Standard_EXPORT Standard_Boolean& ModeSignOnly(); - - Standard_EXPORT virtual void Clear(); - - //! Adds an entity with its signature, i.e. : - //! - counts an item more for - //! - if record-list status is set, records the entity - //! Accepts a null entity (the signature is then for the global - //! model). But if the string is empty, counts a Null item. - //! - //! If SignOnly Mode is set, this work is replaced by just - //! setting LastValue - Standard_EXPORT void Add (const Handle(Standard_Transient)& ent, const Standard_CString sign); - - //! Returns the last value recorded by Add (only if SignMode set) - //! Cleared by Clear or Init - Standard_EXPORT Standard_CString LastValue() const; - - //! Aknowledges the list in once. Name identifies the Signature - Standard_EXPORT void Init (const Standard_CString name, const NCollection_IndexedDataMap& count, const NCollection_IndexedDataMap& list, const Standard_Integer nbnuls); - - //! Returns the list of signatures, as a sequence of strings - //! (but without their respective counts). It is ordered. - //! By default, for all the signatures. - //! If is given non empty, for the signatures which - //! begin by - Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) List (const Standard_CString root = "") const; - - //! Returns True if the list of Entities is aknowledged, else - //! the method Entities will always return a Null Handle - Standard_EXPORT Standard_Boolean HasEntities() const; - - //! Returns the count of null entities - Standard_EXPORT Standard_Integer NbNulls() const; - - //! Returns the number of times a signature was counted, - //! 0 if it has not been recorded at all - Standard_EXPORT Standard_Integer NbTimes (const Standard_CString sign) const; - - //! Returns the list of entities attached to a signature - //! It is empty if has not been recorded - //! It is a Null Handle if the list of entities is not known - Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Entities (const Standard_CString sign) const; - - //! Defines a name for a SignatureList (used to print it) - Standard_EXPORT void SetName (const Standard_CString name); - - //! Returns the recorded Name. - //! Remark : default is "..." (no SetName called) - Standard_EXPORT virtual Standard_CString Name() const; - - //! Prints the counts of items (not the list) - Standard_EXPORT virtual void PrintCount (Standard_OStream& S) const; - - //! Prints the lists of items, if they are present (else, prints - //! a message "no list available") - //! Uses to determine for each entity to be listed, its - //! number, and its specific identifier (by PrintLabel) - //! gives a mode for printing : - //! - CountByItem : just count (as PrintCount) - //! - ShortByItem : minimum i.e. count plus 5 first entity numbers - //! - ShortByItem(D) complete list of entity numbers (0: "Global") - //! - EntitiesByItem : list of (entity number/PrintLabel from the model) - //! other modes are ignored - Standard_EXPORT virtual void PrintList (Standard_OStream& S, const Handle(Interface_InterfaceModel)& model, const IFSelect_PrintCount mod = IFSelect_ListByItem) const; - - //! Prints a summary - //! Item which has the greatest count of entities - //! For items which are numeric values : their count, maximum, - //! minimum values, cumul, average - Standard_EXPORT virtual void PrintSum (Standard_OStream& S) const; - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_SignatureList,Standard_Transient) - -protected: - - - - -private: - - - Standard_Boolean thesignonly; - Standard_Boolean thelistat; - Standard_Integer thenbnuls; - Handle(TCollection_HAsciiString) thename; - TCollection_AsciiString thelastval; - NCollection_IndexedDataMap thedicount; - NCollection_IndexedDataMap thediclist; - - -}; - - - - - - - -#endif // _IFSelect_SignatureList_HeaderFile diff --git a/src/IFSelect/IFSelect_TSeqOfDispatch.hxx b/src/IFSelect/IFSelect_TSeqOfDispatch.hxx deleted file mode 100644 index 0ed8437517..0000000000 --- a/src/IFSelect/IFSelect_TSeqOfDispatch.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// Created on: 1992-09-21 -// 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 IFSelect_TSeqOfDispatch_HeaderFile -#define IFSelect_TSeqOfDispatch_HeaderFile - -#include -#include - -typedef NCollection_Sequence IFSelect_TSeqOfDispatch; - - -#endif diff --git a/src/IFSelect/IFSelect_TSeqOfSelection.hxx b/src/IFSelect/IFSelect_TSeqOfSelection.hxx deleted file mode 100644 index 54d631e806..0000000000 --- a/src/IFSelect/IFSelect_TSeqOfSelection.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// Created on: 1992-09-21 -// 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 IFSelect_TSeqOfSelection_HeaderFile -#define IFSelect_TSeqOfSelection_HeaderFile - -#include -#include - -typedef NCollection_Sequence IFSelect_TSeqOfSelection; - - -#endif diff --git a/src/IFSelect/IFSelect_TransformStandard.cxx b/src/IFSelect/IFSelect_TransformStandard.cxx deleted file mode 100644 index ab4572d329..0000000000 --- a/src/IFSelect/IFSelect_TransformStandard.cxx +++ /dev/null @@ -1,214 +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 -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_TransformStandard,IFSelect_Transformer) - -IFSelect_TransformStandard::IFSelect_TransformStandard () - { thecopy = Standard_True; } - - void IFSelect_TransformStandard::SetCopyOption - (const Standard_Boolean option) - { thecopy = option; } - - Standard_Boolean IFSelect_TransformStandard::CopyOption () const - { return thecopy; } - - void IFSelect_TransformStandard::SetSelection - (const Handle(IFSelect_Selection)& sel) - { thesel = sel; } - - Handle(IFSelect_Selection) IFSelect_TransformStandard::Selection () const - { return thesel; } - - Standard_Integer IFSelect_TransformStandard::NbModifiers () const - { return themodifs.Length(); } - - Handle(IFSelect_Modifier) IFSelect_TransformStandard::Modifier - (const Standard_Integer num) const - { return GetCasted(IFSelect_Modifier,themodifs.Value(num)); } - - Standard_Integer IFSelect_TransformStandard::ModifierRank - (const Handle(IFSelect_Modifier)& modif) const -{ - for (Standard_Integer i = themodifs.Length(); i >= 1; i --) - if (modif == themodifs.Value(i)) return i; - return 0; -} - - Standard_Boolean IFSelect_TransformStandard::AddModifier - (const Handle(IFSelect_Modifier)& modif, - const Standard_Integer atnum) -{ - if (atnum < 0 || atnum > themodifs.Length()) return Standard_False; - if (atnum == 0) themodifs.Append(modif); - else themodifs.InsertBefore(atnum,modif); - return Standard_True; -} - - Standard_Boolean IFSelect_TransformStandard::RemoveModifier - (const Handle(IFSelect_Modifier)& modif) -{ - Standard_Integer num = ModifierRank(modif); - return RemoveModifier(num); -} - - - Standard_Boolean IFSelect_TransformStandard::RemoveModifier - (const Standard_Integer num) -{ - if (num <= 0 || num > themodifs.Length()) return Standard_False; - themodifs.Remove(num); - return Standard_True; -} - -// ################################################################# -// ######## ACTION ######## - - Standard_Boolean IFSelect_TransformStandard::Perform - (const Interface_Graph& G, const Handle(Interface_Protocol)& protocol, - Interface_CheckIterator& checks, - Handle(Interface_InterfaceModel)& newmod) -{ - Interface_CopyTool TC(G.Model(),protocol); - themap = TC.Control(); - Copy (G,TC,newmod); - return ApplyModifiers (G,protocol,TC,checks,newmod); -} - - void IFSelect_TransformStandard::Copy - (const Interface_Graph& G, Interface_CopyTool& TC, - Handle(Interface_InterfaceModel)& newmod) const -{ - if (CopyOption()) StandardCopy (G,TC,newmod); - else OnTheSpot (G,TC,newmod); -} - - void IFSelect_TransformStandard::StandardCopy - (const Interface_Graph& G, Interface_CopyTool& TC, - Handle(Interface_InterfaceModel)& newmod) const -{ - Handle(Interface_InterfaceModel) original = G.Model(); - newmod = original->NewEmptyModel(); - TC.Clear(); - Standard_Integer nb = G.Size(); - Handle(TColStd_HArray1OfInteger) remain = - new TColStd_HArray1OfInteger(0,nb+1); remain->Init(0); - for (Standard_Integer i = 1; i <= nb; i ++) { -// if (G.Status(i) == 0) TC.TransferEntity (original->Value(i)); - TC.TransferEntity (original->Value(i)); - } - TC.FillModel(newmod); -} - - void IFSelect_TransformStandard::OnTheSpot - (const Interface_Graph& G, Interface_CopyTool& TC, - Handle(Interface_InterfaceModel)& newmod) const -{ - Standard_Integer nb = G.Size(); - for (Standard_Integer i = 1; i <= nb; i ++) TC.Bind(G.Entity(i),G.Entity(i)); - newmod = G.Model(); -} - - - Standard_Boolean IFSelect_TransformStandard::ApplyModifiers - (const Interface_Graph& G, const Handle(Interface_Protocol)& protocol, - Interface_CopyTool& TC, Interface_CheckIterator& checks, - Handle(Interface_InterfaceModel)& newmod) const -{ - Message_Messenger::StreamBuffer sout = Message::SendInfo(); - Standard_Boolean res = Standard_True; - Standard_Boolean chg = Standard_False; - Standard_Integer nb = NbModifiers(); - Handle(Interface_InterfaceModel) original = G.Model(); - - for (Standard_Integer i = 1; i <= nb; i ++) { - Handle(IFSelect_Modifier) unmod = Modifier(i); - if (unmod->MayChangeGraph()) chg = Standard_True; - -// Appliquer ce Modifier (nb : le Dispatch, on s en moque) -// D abord, la Selection - IFSelect_ContextModif ctx (G,TC); -// Ensuite, la Selection -// S il y en a une ici, elle a priorite. Sinon, chaque Modifier a la sienne - - Handle(IFSelect_Selection) sel = thesel; - if ( sel.IsNull()) sel = unmod->Selection(); - if (!sel.IsNull()) { - Interface_EntityIterator entiter = sel->UniqueResult(G); - ctx.Select (entiter); - } - if (ctx.IsForNone()) continue; - unmod->Perform (ctx,newmod,protocol,TC); - -// Report des Erreurs -// Faut-il les enregistrer dans newmod ? bonne question - Interface_CheckIterator checklist = ctx.CheckList(); - if (!checklist.IsEmpty(Standard_False)) { - checks.Merge(checklist); - sout<<"IFSelect_TransformStandard : Messages from Modifier n0 "<Search(entfrom,entto); -} - - - TCollection_AsciiString IFSelect_TransformStandard::Label () const -{ - char lab[30]; - TCollection_AsciiString labl(""); - if (CopyOption()) labl.AssignCat("Standard Copy"); - else labl.AssignCat("On the spot Edition"); - Standard_Integer nb = NbModifiers(); - if (nb == 0) sprintf(lab," (no Modifier)"); - if (nb == 1) sprintf(lab," - %s",Modifier(1)->Label().ToCString()); - if (nb > 1) sprintf(lab," - %d Modifiers",nb); - labl.AssignCat(lab); - return labl; -} diff --git a/src/IFSelect/IFSelect_TransformStandard.hxx b/src/IFSelect/IFSelect_TransformStandard.hxx deleted file mode 100644 index 1143572d27..0000000000 --- a/src/IFSelect/IFSelect_TransformStandard.hxx +++ /dev/null @@ -1,160 +0,0 @@ -// Created on: 1994-05-27 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_TransformStandard_HeaderFile -#define _IFSelect_TransformStandard_HeaderFile - -#include -#include - -#include -#include -#include -class IFSelect_Selection; -class Interface_CopyControl; -class IFSelect_Modifier; -class Interface_Graph; -class Interface_Protocol; -class Interface_CheckIterator; -class Interface_InterfaceModel; -class Interface_CopyTool; -class Standard_Transient; -class TCollection_AsciiString; - -class IFSelect_TransformStandard; -DEFINE_STANDARD_HANDLE(IFSelect_TransformStandard, IFSelect_Transformer) - -//! This class runs transformations made by Modifiers, as -//! the ModelCopier does when it produces files (the same set -//! of Modifiers can then be used, as to transform the starting -//! Model, as at file sending time). -//! -//! First, considering the resulting model, two options : -//! - modifications are made directly on the starting model -//! (OnTheSpot option), or -//! - data are copied by the standard service Copy, only the -//! remaining (not yet sent in a file) entities are copied -//! (StandardCopy option) -//! -//! If a Selection is set, it forces the list of Entities on which -//! the Modifiers are applied. Else, each Modifier is considered -//! its Selection. By default, it is for the whole Model -//! -//! Then, the Modifiers are sequentially applied -//! If at least one Modifier "May Change Graph", or if the option -//! StandardCopy is selected, the graph will be recomputed -//! (by the WorkSession, see method RunTransformer) -//! -//! Remark that a TransformStandard with option StandardCopy -//! and no Modifier at all has the effect of computing the -//! remaining data (those not yet sent in any output file). -//! Moreover, the Protocol is not changed -class IFSelect_TransformStandard : public IFSelect_Transformer -{ - -public: - - //! Creates a TransformStandard, option StandardCopy, no Modifier - Standard_EXPORT IFSelect_TransformStandard(); - - //! Sets the Copy option to a new value : - //! - True for StandardCopy - False for OnTheSpot - Standard_EXPORT void SetCopyOption (const Standard_Boolean option); - - //! Returns the Copy option - Standard_EXPORT Standard_Boolean CopyOption() const; - - //! Sets a Selection (or unsets if Null) - //! This Selection then defines the list of entities on which the - //! Modifiers will be applied - //! If it is set, it has priority on Selections of Modifiers - //! Else, for each Modifier its Selection is evaluated - //! By default, all the Model is taken - Standard_EXPORT void SetSelection (const Handle(IFSelect_Selection)& sel); - - //! Returns the Selection, Null by default - Standard_EXPORT Handle(IFSelect_Selection) Selection() const; - - //! Returns the count of recorded Modifiers - Standard_EXPORT Standard_Integer NbModifiers() const; - - //! Returns a Modifier given its rank in the list - Standard_EXPORT Handle(IFSelect_Modifier) Modifier (const Standard_Integer num) const; - - //! Returns the rank of a Modifier in the list, 0 if unknown - Standard_EXPORT Standard_Integer ModifierRank (const Handle(IFSelect_Modifier)& modif) const; - - //! Adds a Modifier to the list : - //! - = 0 (default) : at the end of the list - //! - > 0 : at rank - //! Returns True if done, False if is out of range - Standard_EXPORT Standard_Boolean AddModifier (const Handle(IFSelect_Modifier)& modif, const Standard_Integer atnum = 0); - - //! Removes a Modifier from the list - //! Returns True if done, False if not in the list - Standard_EXPORT Standard_Boolean RemoveModifier (const Handle(IFSelect_Modifier)& modif); - - //! Removes a Modifier from the list, given its rank - //! Returns True if done, False if is out of range - Standard_EXPORT Standard_Boolean RemoveModifier (const Standard_Integer num); - - //! Performs the Standard Transformation, by calling Copy then - //! ApplyModifiers (which can return an error status) - Standard_EXPORT Standard_Boolean Perform (const Interface_Graph& G, const Handle(Interface_Protocol)& protocol, Interface_CheckIterator& checks, Handle(Interface_InterfaceModel)& newmod) Standard_OVERRIDE; - - //! This the first operation. It calls StandardCopy or OnTheSpot - //! according the option - Standard_EXPORT void Copy (const Interface_Graph& G, Interface_CopyTool& TC, Handle(Interface_InterfaceModel)& newmod) const; - - //! This is the standard action of Copy : its takes into account - //! only the remaining entities (noted by Graph Status positive) - //! and their proper dependances of course. Produces a new model. - Standard_EXPORT void StandardCopy (const Interface_Graph& G, Interface_CopyTool& TC, Handle(Interface_InterfaceModel)& newmod) const; - - //! This is the OnTheSpot action : each entity is bound with ... - //! itself. The produced model is the same as the starting one. - Standard_EXPORT void OnTheSpot (const Interface_Graph& G, Interface_CopyTool& TC, Handle(Interface_InterfaceModel)& newmod) const; - - //! Applies the modifiers sequentially. - //! For each one, prepares required data (if a Selection is associated as a filter). - //! For the option OnTheSpot, it determines if the graph may be - //! changed and updates if required - //! If a Modifier causes an error (check "HasFailed"), - //! ApplyModifier stops : the following Modifiers are ignored - Standard_EXPORT Standard_Boolean ApplyModifiers (const Interface_Graph& G, const Handle(Interface_Protocol)& protocol, Interface_CopyTool& TC, Interface_CheckIterator& checks, Handle(Interface_InterfaceModel)& newmod) const; - - //! This methods allows to know what happened to a starting - //! entity after the last Perform. It reads result from the map - //! which was filled by Perform. - Standard_EXPORT Standard_Boolean Updated (const Handle(Standard_Transient)& entfrom, Handle(Standard_Transient)& entto) const Standard_OVERRIDE; - - //! Returns a text which defines the way a Transformer works : - //! "On the spot edition" or "Standard Copy" followed by - //! " Modifiers" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - DEFINE_STANDARD_RTTIEXT(IFSelect_TransformStandard,IFSelect_Transformer) - -private: - - Standard_Boolean thecopy; - Handle(IFSelect_Selection) thesel; - IFSelect_SequenceOfGeneralModifier themodifs; - Handle(Interface_CopyControl) themap; - -}; - -#endif // _IFSelect_TransformStandard_HeaderFile diff --git a/src/IFSelect/IFSelect_Transformer.cxx b/src/IFSelect/IFSelect_Transformer.cxx deleted file mode 100644 index aef80c0abc..0000000000 --- a/src/IFSelect/IFSelect_Transformer.cxx +++ /dev/null @@ -1,28 +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 - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_Transformer,Standard_Transient) - -Standard_Boolean IFSelect_Transformer::ChangeProtocol (Handle(Interface_Protocol)& ) const -{ - return Standard_False; // par defaut, protocole inchange -} diff --git a/src/IFSelect/IFSelect_Transformer.hxx b/src/IFSelect/IFSelect_Transformer.hxx deleted file mode 100644 index 1ba50749b0..0000000000 --- a/src/IFSelect/IFSelect_Transformer.hxx +++ /dev/null @@ -1,100 +0,0 @@ -// Created on: 1994-05-27 -// Created by: Christian CAILLET -// Copyright (c) 1994-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 _IFSelect_Transformer_HeaderFile -#define _IFSelect_Transformer_HeaderFile - -#include -#include - -#include -class Interface_Graph; -class Interface_Protocol; -class Interface_CheckIterator; -class Interface_InterfaceModel; -class TCollection_AsciiString; - -class IFSelect_Transformer; -DEFINE_STANDARD_HANDLE(IFSelect_Transformer, Standard_Transient) - -//! A Transformer defines the way an InterfaceModel is transformed -//! (without sending it to a file). -//! In order to work, each type of Transformer defines it method -//! Perform, it can be parametred as needed. -//! -//! It receives a Model (the data set) as input. It then can : -//! - edit this Model on the spot -//! (i.e. alter its content: by editing entities, or adding/replacing some ...) -//! - produce a copied Model, which detains the needed changes -//! (typically on the same type, but some or all entities being -//! rebuilt or converted; or converted from a protocol to another one) -class IFSelect_Transformer : public Standard_Transient -{ - -public: - - //! Performs a Transformation (defined by each sub-class) : - //! gives the input data (especially the starting model) and - //! can be used for queries (by Selections, etc...) - //! allows to work with General Services as necessary - //! (it applies to input data) - //! If the change corresponds to a conversion to a new protocol, - //! see also the method ChangeProtocol - //! stores produced checks messages if any - //! gives the result of the transformation : - //! - if it is Null (i.e. has not been affected), the transformation - //! has been made on the spot, it is assumed to cause no change - //! to the graph of dependances - //! - if it equates the starting Model, it has been transformed on - //! the spot (possibiliy some entities were replaced inside it) - //! - if it is new, it corresponds to a new data set which replaces - //! the starting one - //! - //! is mutable to allow results for ChangeProtocol to be - //! memorized if needed, and to store information useful for - //! the method Updated - //! - //! Returns True if Done, False if an Error occurred: - //! in this case, if a new data set has been produced, the transformation is ignored, - //! else data may be corrupted. - Standard_EXPORT virtual Standard_Boolean Perform (const Interface_Graph& G, const Handle(Interface_Protocol)& protocol, Interface_CheckIterator& checks, Handle(Interface_InterfaceModel)& newmod) = 0; - - //! This methods allows to declare that the Protocol applied to - //! the new Model has changed. It applies to the last call to - //! Perform. - //! - //! Returns True if the Protocol has changed, False else. - //! The provided default keeps the starting Protocol. This method - //! should be redefined as required by the effect of Perform. - Standard_EXPORT virtual Standard_Boolean ChangeProtocol (Handle(Interface_Protocol)& newproto) const; - - //! This method allows to know what happened to a starting - //! entity after the last Perform. If (from starting - //! model) has one and only one known item which corresponds in - //! the new produced model, this method must return True and - //! fill the argument . Else, it returns False. - Standard_EXPORT virtual Standard_Boolean Updated (const Handle(Standard_Transient)& entfrom, Handle(Standard_Transient)& entto) const = 0; - - //! Returns a text which defines the way a Transformer works - //! (to identify the transformation it performs) - Standard_EXPORT virtual TCollection_AsciiString Label() const = 0; - - DEFINE_STANDARD_RTTIEXT(IFSelect_Transformer,Standard_Transient) - - -}; - -#endif // _IFSelect_Transformer_HeaderFile diff --git a/src/IFSelect/IFSelect_WorkSession.hxx b/src/IFSelect/IFSelect_WorkSession.hxx deleted file mode 100644 index c529b7d99e..0000000000 --- a/src/IFSelect/IFSelect_WorkSession.hxx +++ /dev/null @@ -1,1116 +0,0 @@ -// Created on: 1992-12-15 -// 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 _IFSelect_WorkSession_HeaderFile -#define _IFSelect_WorkSession_HeaderFile - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -class IFSelect_ShareOut; -class IFSelect_WorkLibrary; -class Interface_Protocol; -class Interface_InterfaceModel; -class Interface_HGraph; -class Interface_GTool; - -class IFSelect_ModelCopier; -class IFSelect_Signature; -class TCollection_HAsciiString; -class Interface_Graph; -class IFSelect_IntParam; -class IFSelect_Selection; -class Interface_EntityIterator; -class IFSelect_SelectionIterator; -class IFSelect_SignCounter; -class IFSelect_Dispatch; -class IFSelect_GeneralModifier; -class IFSelect_Modifier; -class IFSelect_Transformer; -class IFSelect_PacketList; -class IFSelect_SignatureList; - -class IFSelect_WorkSession; -DEFINE_STANDARD_HANDLE(IFSelect_WorkSession, Standard_Transient) - -//! This class can be used to simply manage a process such as -//! splitting a file, extracting a set of Entities ... -//! It allows to manage different types of Variables : Integer or -//! Text Parameters, Selections, Dispatches, in addition to a -//! ShareOut. To each of these variables, a unique Integer -//! Identifier is attached. A Name can be attached too as desired. -class IFSelect_WorkSession : public Standard_Transient -{ - -public: - - //! Creates a Work Session - //! It provides default, empty ShareOut and ModelCopier, which can - //! be replaced (if required, should be done just after creation). - Standard_EXPORT IFSelect_WorkSession(); - - //! Changes the Error Handler status (by default, it is not set) - Standard_EXPORT void SetErrorHandle (const Standard_Boolean toHandle); - - //! Returns the Error Handler status - Standard_Boolean ErrorHandle() const - { return theerrhand; } - - //! Returns the ShareOut defined at creation time - const Handle(IFSelect_ShareOut) & ShareOut() const - { return theshareout; } - - //! Sets a new ShareOut. Fills Items which its content - //! Warning : data from the former ShareOut are lost - Standard_EXPORT void SetShareOut (const Handle(IFSelect_ShareOut)& shareout); - - //! Set value of mode responsible for presence of selections after loading - //! If mode set to true that different selections will be accessible after loading - //! else selections will be not accessible after loading( for economy memory in applications) - void SetModeStat (const Standard_Boolean theMode) - { themodelstat = theMode; } - - //! Return value of mode defining of filling selection during loading - Standard_Boolean GetModeStat() const - { return themodelstat; } - - //! Sets a WorkLibrary, which will be used to Read and Write Files - void SetLibrary (const Handle(IFSelect_WorkLibrary) &theLib) - { thelibrary = theLib; } - - //! Returns the WorkLibrary. Null Handle if not yet set - //! should be C++ : return const & - const Handle(IFSelect_WorkLibrary) & WorkLibrary() const - { return thelibrary; } - - //! Sets a Protocol, which will be used to determine Graphs, to - //! Read and to Write Files - Standard_EXPORT void SetProtocol (const Handle(Interface_Protocol)& protocol); - - //! Returns the Protocol. Null Handle if not yet set - //! should be C++ : return const & - const Handle(Interface_Protocol) & Protocol() const - { return theprotocol; } - - //! Sets a specific Signature to be the SignType, i.e. the - //! Signature which will determine TypeName from the Model - //! (basic function). It is recorded in the GTool - //! This Signature is also set as "xst-sign-type" (reserved name) - Standard_EXPORT void SetSignType (const Handle(IFSelect_Signature)& signtype); - - //! Returns the current SignType - Standard_EXPORT Handle(IFSelect_Signature) SignType() const; - - //! Returns True is a Model has been set - Standard_Boolean HasModel() const - { return (!myModel.IsNull()); } - - //! Sets a Model as input : this will be the Model from which the - //! ShareOut will work - //! if is True (default) all SelectPointed items - //! are cleared, else they must be managed by the caller - //! Remark : SetModel clears the Graph, recomputes it if a - //! Protocol is set and if the Model is not empty, of course - Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& model, const Standard_Boolean clearpointed = Standard_True); - - //! Returns the Model of the Work Session (Null Handle if none) - //! should be C++ : return const & - const Handle(Interface_InterfaceModel) & Model () const - { return myModel; } - - //! Stores the filename used for read for setting the model - //! It is cleared by SetModel and ClearData(1) - void SetLoadedFile (const Standard_CString theFileName) - { theloaded = theFileName; } - - //! Returns the filename used to load current model - //! empty if unknown - Standard_CString LoadedFile() const - { return theloaded.ToCString(); } - - //! Reads a file with the WorkLibrary (sets Model and LoadedFile) - //! Returns a integer status which can be : - //! RetDone if OK, RetVoid if no Protocol not defined, - //! RetError for file not found, RetFail if fail during read - Standard_EXPORT IFSelect_ReturnStatus ReadFile (const Standard_CString filename); - - //! Reads a file from stream with the WorkLibrary (sets Model and LoadedFile) - //! Returns a integer status which can be : - //! RetDone if OK, RetVoid if no Protocol not defined, - //! RetError for file not found, RetFail if fail during read - Standard_EXPORT IFSelect_ReturnStatus ReadStream (const Standard_CString theName, std::istream& theIStream); - - //! Returns the count of Entities stored in the Model, or 0 - Standard_EXPORT Standard_Integer NbStartingEntities() const; - - //! Returns an Entity stored in the Model of the WorkSession - //! (Null Handle is no Model or num out of range) - Standard_EXPORT Handle(Standard_Transient) StartingEntity (const Standard_Integer num) const; - - //! Returns the Number of an Entity in the Model - //! (0 if no Model set or not in the Model) - Standard_EXPORT Standard_Integer StartingNumber (const Handle(Standard_Transient)& ent) const; - - //! From a given label in Model, returns the corresponding number - //! Starts from first entity by Default, may start after a given - //! number : this number may be given negative, its absolute value - //! is then considered. Hence a loop on NumberFromLabel may be - //! programmed (stop test is : returned value positive or null) - //! - //! Returns 0 if not found, < 0 if more than one found (first - //! found in negative). - //! If just gives an integer value, returns it - Standard_EXPORT Standard_Integer NumberFromLabel (const Standard_CString val, const Standard_Integer afternum = 0) const; - - //! Returns the label for , as the Model does - //! If is not in the Model or if no Model is loaded, a Null - //! Handle is returned - Standard_EXPORT Handle(TCollection_HAsciiString) EntityLabel (const Handle(Standard_Transient)& ent) const; - - //! Returns the Name of an Entity - //! This Name is computed by the general service Name - //! Returns a Null Handle if fails - Standard_EXPORT Handle(TCollection_HAsciiString) EntityName (const Handle(Standard_Transient)& ent) const; - - //! Returns the Category Number determined for an entity - //! it is computed by the class Category - //! An unknown entity (number 0) gives a value -1 - Standard_EXPORT Standard_Integer CategoryNumber (const Handle(Standard_Transient)& ent) const; - - //! Returns the Category Name determined for an entity - //! it is computed by the class Category - //! Remark : an unknown entity gives an empty string - Standard_EXPORT Standard_CString CategoryName (const Handle(Standard_Transient)& ent) const; - - //! Returns the Validity Name determined for an entity - //! it is computed by the class SignValidity - //! Remark : an unknown entity gives an empty string - Standard_EXPORT Standard_CString ValidityName (const Handle(Standard_Transient)& ent) const; - - //! Clears recorded data (not the items) according mode : - //! 1 : all Data : Model, Graph, CheckList, + ClearData 4 - //! 2 : Graph and CheckList (they will then be recomputed later) - //! 3 : CheckList (it will be recomputed by ComputeCheck) - //! 4 : just content of SelectPointed and Counters - //! Plus 0 : does nothing but called by SetModel - //! ClearData is virtual, hence it can be redefined to clear - //! other data of a specialised Work Session - Standard_EXPORT virtual void ClearData (const Standard_Integer mode); - - //! Computes the Graph used for Selections, Displays ... - //! If a HGraph is already set, with same model as given by method - //! Model, does nothing. Else, computes a new Graph. - //! If is given True, computes a new Graph anyway. - //! Remark that a call to ClearGraph will cause ComputeGraph to - //! really compute a new Graph - //! Returns True if Graph is OK, False else (i.e. if no Protocol - //! is set, or if Model is absent or empty). - Standard_EXPORT Standard_Boolean ComputeGraph (const Standard_Boolean enforce = Standard_False); - - //! Returns the Computed Graph as HGraph (Null Handle if not set) - Standard_EXPORT Handle(Interface_HGraph) HGraph(); - - //! Returns the Computed Graph, for Read only - Standard_EXPORT const Interface_Graph& Graph(); - - //! Returns the list of entities shared by (can be empty) - //! Returns a null Handle if is unknown - Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Shareds (const Handle(Standard_Transient)& ent); - - //! Returns the list of entities sharing (can be empty) - //! Returns a null Handle if is unknown - Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Sharings (const Handle(Standard_Transient)& ent); - - //! Returns True if a Model is defined and really loaded (not - //! empty), a Protocol is set and a Graph has been computed. - //! In this case, the WorkSession can start to work - Standard_EXPORT Standard_Boolean IsLoaded() const; - - //! Computes the CheckList for the Model currently loaded - //! It can then be used for displays, queries ... - //! Returns True if OK, False else (i.e. no Protocol set, or Model - //! absent). If is False, works only if not already done - //! or if a new Model has been loaded from last call. - //! Remark : computation is enforced by every call to - //! SetModel or RunTransformer - Standard_EXPORT Standard_Boolean ComputeCheck (const Standard_Boolean enforce = Standard_False); - - //! Returns the Check List for the Model currently loaded : - //! = True : complete (syntactic & semantic messages), - //! computed if not yet done - //! = False : only syntactic (check file form) - Standard_EXPORT Interface_CheckIterator ModelCheckList (const Standard_Boolean complete = Standard_True); - - //! Returns a Check for a single entity, under the form of a - //! CheckIterator (this gives only one form for the user) - //! if is Null or equates the current Model, it gives the - //! Global Check, else the Check for the given entity - //! as for ModelCheckList - Standard_EXPORT Interface_CheckIterator CheckOne (const Handle(Standard_Transient)& ent, const Standard_Boolean complete = Standard_True); - - //! Returns the Check List produced by the last execution of - //! either : EvaluateFile(for Split), SendSplit, SendAll, - //! SendSelected, RunTransformer-RunModifier - //! Cleared by SetModel or ClearData(1) - //! The field is protected, hence a specialized WorkSession may - //! fill it - Interface_CheckIterator LastRunCheckList() const - { return thecheckrun; } - - //! Returns the Maximum Value for an Item Identifier. It can be - //! greater to the count of known Items, because some can have - //! been removed - Standard_EXPORT Standard_Integer MaxIdent() const; - - //! Returns an Item, given its Ident. Returns a Null Handle if - //! no Item corresponds to this Ident. - Standard_EXPORT Handle(Standard_Transient) Item (const Standard_Integer id) const; - - //! Returns the Ident attached to an Item in the WorkSession, or - //! Zero if it is unknown - Standard_EXPORT Standard_Integer ItemIdent (const Handle(Standard_Transient)& item) const; - - //! Returns the Item which corresponds to a Variable, given its - //! Name (whatever the type of this Item). - //! Returns a Null Handle if this Name is not recorded - Standard_EXPORT Handle(Standard_Transient) NamedItem (const Standard_CString name) const; - - //! Same as above, but is given through a Handle - //! Especially useful with methods SelectionNames, etc... - Standard_EXPORT Handle(Standard_Transient) NamedItem (const Handle(TCollection_HAsciiString)& name) const; - - //! Returns the Ident attached to a Name, 0 if name not recorded - Standard_EXPORT Standard_Integer NameIdent (const Standard_CString name) const; - - //! Returns True if an Item of the WorkSession has an attached Name - Standard_EXPORT Standard_Boolean HasName (const Handle(Standard_Transient)& item) const; - - //! Returns the Name attached to an Item as a Variable of this - //! WorkSession. If is Null or not recorded, returns an - //! empty string. - Standard_EXPORT Handle(TCollection_HAsciiString) Name (const Handle(Standard_Transient)& item) const; - - //! Adds an Item and returns its attached Ident. Does nothing - //! if is already recorded (and returns its attached Ident) - //! if True commands call to SetActive (see below) - //! Remark : the determined Ident is used if is a Dispatch, - //! to fill the ShareOut - Standard_EXPORT Standard_Integer AddItem (const Handle(Standard_Transient)& item, const Standard_Boolean active = Standard_True); - - //! Adds an Item with an attached Name. If the Name is already - //! known in the WorkSession, the older item losts it - //! Returns Ident if Done, 0 else, i.e. if is null - //! If is empty, works as AddItem (i.e. with no name) - //! If is already known but with no attached Name, this - //! method tries to attached a Name to it - //! if True commands call to SetActive (see below) - Standard_EXPORT Standard_Integer AddNamedItem (const Standard_CString name, const Handle(Standard_Transient)& item, const Standard_Boolean active = Standard_True); - - //! Following the type of : - //! - Dispatch : Adds or Removes it in the ShareOut & FileNaming - //! - GeneralModifier : Adds or Removes it for final sending - //! (i.e. in the ModelCopier) - //! Returns True if it did something, False else (state unchanged) - Standard_EXPORT Standard_Boolean SetActive (const Handle(Standard_Transient)& item, const Standard_Boolean mode); - - //! Removes an Item from the Session, given its Name - //! Returns True if Done, False else (Name not recorded) - //! (Applies only on Item which are Named) - Standard_EXPORT Standard_Boolean RemoveNamedItem (const Standard_CString name); - - //! Removes a Name without removing the Item - //! Returns True if Done, False else (Name not recorded) - Standard_EXPORT Standard_Boolean RemoveName (const Standard_CString name); - - //! Removes an Item given its Ident. Returns False if is - //! attached to no Item in the WorkSession. For a Named Item, - //! also removes its Name. - Standard_EXPORT Standard_Boolean RemoveItem (const Handle(Standard_Transient)& item); - - //! Clears all the recorded Items : Selections, Dispatches, - //! Modifiers, and Strings & IntParams, with their Idents & Names. - //! Remark that if a Model has been loaded, it is not cleared. - Standard_EXPORT void ClearItems(); - - //! Returns a Label which illustrates the content of an Item, - //! given its Ident. This Label is : - //! - for a Text Parameter, "Text:" - //! - for an Integer Parameter, "Integer:" - //! - for a Selection, a Dispatch or a Modifier, its Label - //! (see these classes) - //! - for any other kind of Variable, its cdl type - Standard_EXPORT Handle(TCollection_HAsciiString) ItemLabel (const Standard_Integer id) const; - - //! Fills a Sequence with the List of Idents attached to the Items - //! of which Type complies with (IsKind) (alphabetic order) - //! Remark : = TYPE(Standard_Transient) gives all the - //! Idents which are suitable in the WorkSession - Standard_EXPORT Handle(TColStd_HSequenceOfInteger) ItemIdents (const Handle(Standard_Type)& type) const; - - //! Fills a Sequence with the list of the Names attached to Items - //! of which Type complies with (IsKind) (alphabetic order) - //! Remark : = TYPE(Standard_Transient) gives all the Names - Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) ItemNames (const Handle(Standard_Type)& type) const; - - //! Fills a Sequence with the NAMES of the control items, of which - //! the label matches