Sprout from V5_1_main 2009-06-16 10:16:24 UTC secher <secher> 'debug MPI Containers'
Delete:
src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx
src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx
src/ResourcesManager/SALOME_ResourcesManager.cxx
src/ResourcesManager/SALOME_ResourcesManager.hxx
src/SALOMEDS/Makefile.am
src/SALOMEDS/README_attributes
src/SALOMEDS/SALOMEDS.cxx
src/SALOMEDS/SALOMEDS.hxx
src/SALOMEDS/SALOMEDS_AttLong_i.cxx
src/SALOMEDS/SALOMEDS_AttLong_i.hxx
src/SALOMEDS/SALOMEDS_AttReal_i.cxx
src/SALOMEDS/SALOMEDS_AttReal_i.hxx
src/SALOMEDS/SALOMEDS_AttributeComment.cxx
src/SALOMEDS/SALOMEDS_AttributeComment.hxx
src/SALOMEDS/SALOMEDS_AttributeComment_i.cxx
src/SALOMEDS/SALOMEDS_AttributeComment_i.hxx
src/SALOMEDS/SALOMEDS_AttributeDrawable.cxx
src/SALOMEDS/SALOMEDS_AttributeDrawable.hxx
src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx
src/SALOMEDS/SALOMEDS_AttributeDrawable_i.hxx
src/SALOMEDS/SALOMEDS_AttributeExpandable.cxx
src/SALOMEDS/SALOMEDS_AttributeExpandable.hxx
src/SALOMEDS/SALOMEDS_AttributeExpandable_i.cxx
src/SALOMEDS/SALOMEDS_AttributeExpandable_i.hxx
src/SALOMEDS/SALOMEDS_AttributeExternalFileDef.cxx
src/SALOMEDS/SALOMEDS_AttributeExternalFileDef.hxx
src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx
src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx
src/SALOMEDS/SALOMEDS_AttributeFileType.cxx
src/SALOMEDS/SALOMEDS_AttributeFileType.hxx
src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx
src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx
src/SALOMEDS/SALOMEDS_AttributeFlags.cxx
src/SALOMEDS/SALOMEDS_AttributeFlags.hxx
src/SALOMEDS/SALOMEDS_AttributeFlags_i.cxx
src/SALOMEDS/SALOMEDS_AttributeFlags_i.hxx
src/SALOMEDS/SALOMEDS_AttributeGraphic.cxx
src/SALOMEDS/SALOMEDS_AttributeGraphic.hxx
src/SALOMEDS/SALOMEDS_AttributeGraphic_i.cxx
src/SALOMEDS/SALOMEDS_AttributeGraphic_i.hxx
src/SALOMEDS/SALOMEDS_AttributeIOR.cxx
src/SALOMEDS/SALOMEDS_AttributeIOR.hxx
src/SALOMEDS/SALOMEDS_AttributeIOR_i.cxx
src/SALOMEDS/SALOMEDS_AttributeIOR_i.hxx
src/SALOMEDS/SALOMEDS_AttributeInteger.cxx
src/SALOMEDS/SALOMEDS_AttributeInteger.hxx
src/SALOMEDS/SALOMEDS_AttributeInteger_i.cxx
src/SALOMEDS/SALOMEDS_AttributeInteger_i.hxx
src/SALOMEDS/SALOMEDS_AttributeLocalID.cxx
src/SALOMEDS/SALOMEDS_AttributeLocalID.hxx
src/SALOMEDS/SALOMEDS_AttributeLocalID_i.cxx
src/SALOMEDS/SALOMEDS_AttributeLocalID_i.hxx
src/SALOMEDS/SALOMEDS_AttributeName.cxx
src/SALOMEDS/SALOMEDS_AttributeName.hxx
src/SALOMEDS/SALOMEDS_AttributeName_i.cxx
src/SALOMEDS/SALOMEDS_AttributeName_i.hxx
src/SALOMEDS/SALOMEDS_AttributeOpened.cxx
src/SALOMEDS/SALOMEDS_AttributeOpened.hxx
src/SALOMEDS/SALOMEDS_AttributeOpened_i.cxx
src/SALOMEDS/SALOMEDS_AttributeOpened_i.hxx
src/SALOMEDS/SALOMEDS_AttributeParameter.cxx
src/SALOMEDS/SALOMEDS_AttributeParameter.hxx
src/SALOMEDS/SALOMEDS_AttributeParameter_i.cxx
src/SALOMEDS/SALOMEDS_AttributeParameter_i.hxx
src/SALOMEDS/SALOMEDS_AttributePersistentRef.cxx
src/SALOMEDS/SALOMEDS_AttributePersistentRef.hxx
src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.cxx
src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.hxx
src/SALOMEDS/SALOMEDS_AttributePixMap.cxx
src/SALOMEDS/SALOMEDS_AttributePixMap.hxx
src/SALOMEDS/SALOMEDS_AttributePixMap_i.cxx
src/SALOMEDS/SALOMEDS_AttributePixMap_i.hxx
src/SALOMEDS/SALOMEDS_AttributePythonObject.cxx
src/SALOMEDS/SALOMEDS_AttributePythonObject.hxx
src/SALOMEDS/SALOMEDS_AttributePythonObject_i.cxx
src/SALOMEDS/SALOMEDS_AttributePythonObject_i.hxx
src/SALOMEDS/SALOMEDS_AttributeReal.cxx
src/SALOMEDS/SALOMEDS_AttributeReal.hxx
src/SALOMEDS/SALOMEDS_AttributeReal_i.cxx
src/SALOMEDS/SALOMEDS_AttributeReal_i.hxx
src/SALOMEDS/SALOMEDS_AttributeSelectable.cxx
src/SALOMEDS/SALOMEDS_AttributeSelectable.hxx
src/SALOMEDS/SALOMEDS_AttributeSelectable_i.cxx
src/SALOMEDS/SALOMEDS_AttributeSelectable_i.hxx
src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger.cxx
src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger.hxx
src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.cxx
src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.hxx
src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal.cxx
src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal.hxx
src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.cxx
src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.hxx
src/SALOMEDS/SALOMEDS_AttributeString.cxx
src/SALOMEDS/SALOMEDS_AttributeString.hxx
src/SALOMEDS/SALOMEDS_AttributeString_i.cxx
src/SALOMEDS/SALOMEDS_AttributeString_i.hxx
src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx
src/SALOMEDS/SALOMEDS_AttributeStudyProperties.hxx
src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx
src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.hxx
src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx
src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.hxx
src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.cxx
src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.hxx
src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx
src/SALOMEDS/SALOMEDS_AttributeTableOfReal.hxx
src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.cxx
src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.hxx
src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx
src/SALOMEDS/SALOMEDS_AttributeTableOfString.hxx
src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.cxx
src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.hxx
src/SALOMEDS/SALOMEDS_AttributeTarget.cxx
src/SALOMEDS/SALOMEDS_AttributeTarget.hxx
src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx
src/SALOMEDS/SALOMEDS_AttributeTarget_i.hxx
src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx
src/SALOMEDS/SALOMEDS_AttributeTextColor.hxx
src/SALOMEDS/SALOMEDS_AttributeTextColor_i.cxx
src/SALOMEDS/SALOMEDS_AttributeTextColor_i.hxx
src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.cxx
src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.hxx
src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.cxx
src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.hxx
src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx
src/SALOMEDS/SALOMEDS_AttributeTreeNode.hxx
src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.cxx
src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.hxx
src/SALOMEDS/SALOMEDS_AttributeUserID.cxx
src/SALOMEDS/SALOMEDS_AttributeUserID.hxx
src/SALOMEDS/SALOMEDS_AttributeUserID_i.cxx
src/SALOMEDS/SALOMEDS_AttributeUserID_i.hxx
src/SALOMEDS/SALOMEDS_Attributes.hxx
src/SALOMEDS/SALOMEDS_BasicAttributeFactory.cxx
src/SALOMEDS/SALOMEDS_BasicAttributeFactory.hxx
src/SALOMEDS/SALOMEDS_BasicAttribute_i.cxx
src/SALOMEDS/SALOMEDS_BasicAttribute_i.hxx
src/SALOMEDS/SALOMEDS_Callback_i.hxx
src/SALOMEDS/SALOMEDS_ChildIterator.cxx
src/SALOMEDS/SALOMEDS_ChildIterator.hxx
src/SALOMEDS/SALOMEDS_ChildIterator_i.cxx
src/SALOMEDS/SALOMEDS_ChildIterator_i.hxx
src/SALOMEDS/SALOMEDS_Client.cxx
src/SALOMEDS/SALOMEDS_ClientAttributes.hxx
src/SALOMEDS/SALOMEDS_Defines.hxx
src/SALOMEDS/SALOMEDS_Driver_i.cxx
src/SALOMEDS/SALOMEDS_Driver_i.hxx
src/SALOMEDS/SALOMEDS_GenericAttribute.cxx
src/SALOMEDS/SALOMEDS_GenericAttribute.hxx
src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx
src/SALOMEDS/SALOMEDS_GenericAttribute_i.hxx
src/SALOMEDS/SALOMEDS_IParameters.cxx
src/SALOMEDS/SALOMEDS_IParameters.hxx
src/SALOMEDS/SALOMEDS_SComponent.cxx
src/SALOMEDS/SALOMEDS_SComponent.hxx
src/SALOMEDS/SALOMEDS_SComponentIterator.cxx
src/SALOMEDS/SALOMEDS_SComponentIterator.hxx
src/SALOMEDS/SALOMEDS_SComponentIterator_i.cxx
src/SALOMEDS/SALOMEDS_SComponentIterator_i.hxx
src/SALOMEDS/SALOMEDS_SComponent_i.cxx
src/SALOMEDS/SALOMEDS_SComponent_i.hxx
src/SALOMEDS/SALOMEDS_SObject.cxx
src/SALOMEDS/SALOMEDS_SObject.hxx
src/SALOMEDS/SALOMEDS_SObject_i.cxx
src/SALOMEDS/SALOMEDS_SObject_i.hxx
src/SALOMEDS/SALOMEDS_Server.cxx
src/SALOMEDS/SALOMEDS_Study.cxx
src/SALOMEDS/SALOMEDS_Study.hxx
src/SALOMEDS/SALOMEDS_StudyBuilder.cxx
src/SALOMEDS/SALOMEDS_StudyBuilder.hxx
src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx
src/SALOMEDS/SALOMEDS_StudyBuilder_i.hxx
src/SALOMEDS/SALOMEDS_StudyManager.cxx
src/SALOMEDS/SALOMEDS_StudyManager.hxx
src/SALOMEDS/SALOMEDS_StudyManager_i.cxx
src/SALOMEDS/SALOMEDS_StudyManager_i.hxx
src/SALOMEDS/SALOMEDS_Study_i.cxx
src/SALOMEDS/SALOMEDS_Study_i.hxx
src/SALOMEDS/SALOMEDS_TMPFile_i.cxx
src/SALOMEDS/SALOMEDS_TMPFile_i.hxx
src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx
src/SALOMEDS/SALOMEDS_UseCaseBuilder.hxx
src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.cxx
src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.hxx
src/SALOMEDS/SALOMEDS_UseCaseIterator.cxx
src/SALOMEDS/SALOMEDS_UseCaseIterator.hxx
src/SALOMEDS/SALOMEDS_UseCaseIterator_i.cxx
src/SALOMEDS/SALOMEDS_UseCaseIterator_i.hxx
src/SALOMEDS/SALOME_DriverPy.py
src/SALOMEDS/Test/Makefile.am
src/SALOMEDS/Test/SALOMEDSTest.cxx
src/SALOMEDS/Test/SALOMEDSTest.hxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeComment.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeDrawable.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeExpandable.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeExternalFileDef.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeFileType.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeFlags.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeGraphic.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeIOR.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeInteger.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeLocalID.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeName.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeOpened.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeParameter.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributePersistentRef.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributePixMap.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributePythonObject.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeReal.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeSelectable.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfReal.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeStudyProperties.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfInteger.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfReal.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfString.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTarget.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTextColor.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTextHighlightColor.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeTreeNode.cxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeUserID.cxx
src/SALOMEDS/Test/SALOMEDSTest_ChildIterator.cxx
src/SALOMEDS/Test/SALOMEDSTest_SComponent.cxx
src/SALOMEDS/Test/SALOMEDSTest_SComponentIterator.cxx
src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx
src/SALOMEDS/Test/SALOMEDSTest_Study.cxx
src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx
src/SALOMEDS/Test/SALOMEDSTest_StudyManager.cxx
src/SALOMEDS/Test/SALOMEDSTest_UseCase.cxx
src/SALOMEDS/Test/TestSALOMEDS.cxx
src/SALOMEDS/Test/TestSALOMEDS.py
src/SALOMEDSClient/Makefile.am
src/SALOMEDSClient/SALOMEDSClient.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeComment.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeDrawable.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeExpandable.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeExternalFileDef.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeFileType.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeFlags.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeGraphic.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeIOR.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeInteger.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeLocalID.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeName.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeOpened.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeParameter.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributePersistentRef.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributePixMap.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributePythonObject.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeReal.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeSelectable.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeSequenceOfInteger.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeSequenceOfReal.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeString.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfInteger.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfReal.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfString.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeTarget.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeTextColor.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeTextHighlightColor.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeTreeNode.hxx
src/SALOMEDSClient/SALOMEDSClient_AttributeUserID.hxx
src/SALOMEDSClient/SALOMEDSClient_ChildIterator.hxx
src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx
src/SALOMEDSClient/SALOMEDSClient_ClientFactory.hxx
src/SALOMEDSClient/SALOMEDSClient_GenericAttribute.hxx
src/SALOMEDSClient/SALOMEDSClient_IParameters.hxx
src/SALOMEDSClient/SALOMEDSClient_SComponent.hxx
src/SALOMEDSClient/SALOMEDSClient_SComponentIterator.hxx
src/SALOMEDSClient/SALOMEDSClient_SObject.hxx
src/SALOMEDSClient/SALOMEDSClient_Study.hxx
src/SALOMEDSClient/SALOMEDSClient_StudyBuilder.hxx
src/SALOMEDSClient/SALOMEDSClient_StudyManager.hxx
src/SALOMEDSClient/SALOMEDSClient_UseCaseBuilder.hxx
src/SALOMEDSClient/SALOMEDSClient_UseCaseIterator.hxx
src/SALOMEDSClient/SALOMEDSClient_definitions.hxx
src/SALOMEDSImpl/Makefile.am
src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.hxx
src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx
src/SALOMEDSImpl/SALOMEDSImpl_Callback.cxx
src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx
src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.cxx
src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.hxx
src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.cxx
src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.hxx
src/SALOMEDSImpl/SALOMEDSImpl_Defines.hxx
src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx
src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx
src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx
src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx
src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.hxx
src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx
src/SALOMEDSImpl/SALOMEDSImpl_IParameters.hxx
src/SALOMEDSImpl/SALOMEDSImpl_SComponent.cxx
src/SALOMEDSImpl/SALOMEDSImpl_SComponent.hxx
src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.cxx
src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.hxx
src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx
src/SALOMEDSImpl/SALOMEDSImpl_SObject.hxx
src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx
src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.hxx
src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx
src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx
src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx
src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx
src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.cxx
src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.hxx
src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx
src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.hxx
src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.cxx
src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx
src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx
src/SALOMEDSImpl/SALOMEDSImpl_Tool.hxx
src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx
src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.hxx
src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.cxx
src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.hxx
src/SALOMEDSImpl/Test/Makefile.am
src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx
src/SALOMEDSImpl/Test/SALOMEDSImplTest.hxx
src/SALOMEDSImpl/Test/TestSALOMEDSImpl.cxx
src/SALOMEDSImpl/Test/TestSALOMEDSImpl.py
src/SALOMEDSImpl/testDS.cxx
src/SALOMELocalTrace/BaseTraceCollector.cxx
src/SALOMELocalTrace/BaseTraceCollector.hxx
src/SALOMELocalTrace/FileTraceCollector.cxx
src/SALOMELocalTrace/FileTraceCollector.hxx
src/SALOMELocalTrace/LocalTraceBufferPool.cxx
src/SALOMELocalTrace/LocalTraceBufferPool.hxx
src/SALOMELocalTrace/LocalTraceCollector.cxx
src/SALOMELocalTrace/LocalTraceCollector.hxx
src/SALOMELocalTrace/Makefile.am
src/SALOMELocalTrace/SALOME_LocalTrace.hxx
src/SALOMELocalTrace/Test/Makefile.am
src/SALOMELocalTrace/Test/SALOMELocalTraceTest.cxx
src/SALOMELocalTrace/Test/SALOMELocalTraceTest.hxx
src/SALOMELocalTrace/Test/TestSALOMELocalTrace.cxx
src/SALOMELocalTrace/Test/TestSALOMELocalTrace.py
src/SALOMELocalTrace/utilities.h
src/SALOMETraceCollector/Makefile.am
src/SALOMETraceCollector/SALOMETraceCollector.cxx
src/SALOMETraceCollector/SALOMETraceCollector.hxx
src/SALOMETraceCollector/Test/Makefile.am
src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx
src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.hxx
src/SALOMETraceCollector/Test/TestSALOMETraceCollector.cxx
src/SALOMETraceCollector/Test/TestSALOMETraceCollector.py
src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.cxx
src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.hxx
src/TOOLSDS/Makefile.am
src/TOOLSDS/SALOMEDS_Tool.cxx
src/TOOLSDS/SALOMEDS_Tool.hxx
src/TestContainer/Makefile.am
src/TestContainer/SALOME_TestComponent.hxx
src/TestContainer/SALOME_TestComponentPy.py
src/TestContainer/SALOME_TestComponent_i.cxx
src/TestContainer/SALOME_TestComponent_i.hxx
src/TestContainer/TestComponentPy.py
src/TestContainer/TestContainer.cxx
src/TestContainer/TestLogger.cxx
src/TestContainer/TestLogger.py
src/TestMPIContainer/Makefile.am
src/TestMPIContainer/TestMPIComponentEngine.cxx
src/TestMPIContainer/TestMPIComponentEngine.hxx
src/TestMPIContainer/TestMPIContainer.cxx
src/UnitTests/Makefile.am
src/UnitTests/UnitTests.cxx
src/UnitTests/UnitTests.py
src/Utils/Makefile.am
src/Utils/OpUtil.cxx
src/Utils/OpUtil.hxx
src/Utils/SALOME_Utils.hxx
src/Utils/SALOME_utilities.py
src/Utils/Test/Makefile.am
src/Utils/Test/TestUtils.cxx
src/Utils/Test/TestUtils.py
src/Utils/Test/UtilsTest.cxx
src/Utils/Test/UtilsTest.hxx
src/Utils/Utils_CommException.cxx
src/Utils/Utils_CommException.hxx
src/Utils/Utils_CorbaException.hxx
src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx
src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx
src/Utils/Utils_ExceptHandlers.cxx
src/Utils/Utils_ExceptHandlers.hxx
src/Utils/Utils_Identity.cxx
src/Utils/Utils_Identity.hxx
src/Utils/Utils_Identity.py
src/Utils/Utils_Mutex.cxx
src/Utils/Utils_Mutex.hxx
src/Utils/Utils_ORB_INIT.cxx
src/Utils/Utils_ORB_INIT.hxx
src/Utils/Utils_SALOME_Exception.cxx
src/Utils/Utils_SALOME_Exception.hxx
src/Utils/Utils_SINGLETON.hxx
src/Utils/Utils_Timer.cxx
src/Utils/Utils_Timer.hxx
src/Utils/duplicate.cxx
src/win32pm/setup.py
src/win32pm/win32pm.c
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "SALOME_ResourcesCatalog_Parser.hxx"
-#include <iostream>
-#include <sstream>
-
-#define NULL_VALUE 0
-
-using namespace std;
-
-unsigned int ResourceDataToSort::_nbOfNodesWanted = NULL_VALUE;
-unsigned int ResourceDataToSort::_nbOfProcPerNodeWanted = NULL_VALUE;
-unsigned int ResourceDataToSort::_CPUFreqMHzWanted = NULL_VALUE;
-unsigned int ResourceDataToSort::_memInMBWanted = NULL_VALUE;
-
-ResourceDataToSort::ResourceDataToSort()
-{}
-
-ResourceDataToSort::ResourceDataToSort(const string& hostname,
- unsigned int nbOfNodes,
- unsigned int nbOfProcPerNode,
- unsigned int CPUFreqMHz,
- unsigned int memInMB):
- _hostName(hostname),
- _nbOfNodes(nbOfNodes),
- _nbOfProcPerNode(nbOfProcPerNode),
- _CPUFreqMHz(CPUFreqMHz),
- _memInMB(memInMB)
-{}
-
-//! Method used by list::sort to sort the resources used in SALOME_ResourcesManager::GetResourcesFitting
-bool ResourceDataToSort::operator< (const ResourceDataToSort& other) const
- {
- unsigned int nbPts = GetNumberOfPoints();
- return nbPts < other.GetNumberOfPoints();
- }
-
-unsigned int ResourceDataToSort::GetNumberOfPoints() const
- {
- unsigned int ret = 0;
- //priority 1 : Nb of nodes
-
- if (_nbOfNodesWanted != NULL_VALUE)
- {
- if (_nbOfNodes == _nbOfNodesWanted)
- ret += 3000;
- else if (_nbOfNodes > _nbOfNodesWanted)
- ret += 2000;
- else
- ret += 1000;
- }
-
- //priority 2 : Nb of proc by node
- if (_nbOfProcPerNodeWanted != NULL_VALUE)
- {
- if (_nbOfProcPerNode == _nbOfProcPerNodeWanted)
- ret += 300;
- else if (_nbOfProcPerNode > _nbOfProcPerNodeWanted)
- ret += 200;
- else
- ret += 100;
- }
-
- //priority 3 : Cpu freq
- if (_CPUFreqMHzWanted != NULL_VALUE)
- {
- if (_CPUFreqMHz == _CPUFreqMHzWanted)
- ret += 30;
- else if (_CPUFreqMHz > _CPUFreqMHzWanted)
- ret += 20;
- else
- ret += 10;
- }
-
- //priority 4 : memory
- if (_memInMBWanted != NULL_VALUE)
- {
- if (_memInMB == _memInMBWanted)
- ret += 3;
- else if (_memInMB > _memInMBWanted)
- ret += 2;
- else
- ret += 1;
- }
-
- return ret;
- }
-
-//! Method used for debug
-void ResourceDataToSort::Print() const
- {
- cout << _nbOfNodes << endl;
- cout << _nbOfProcPerNode << endl;
- cout << _CPUFreqMHz << endl;
- cout << _memInMB << endl;
- }
-
-void ParserResourcesType::Print()
-{
- ostringstream oss;
- oss << endl <<
- "HostName : " << HostName << endl <<
- "Alias : " << Alias << endl <<
- "NbOfNodes : " << DataForSort._nbOfNodes << endl <<
- "NbOfProcPerNode : " << DataForSort._nbOfProcPerNode << endl <<
- "CPUFreqMHz : " << DataForSort._CPUFreqMHz << endl <<
- "MemInMB : " << DataForSort._memInMB << endl <<
- "Protocol : " << Protocol << endl <<
- "Mode : " << Mode << endl <<
- "Batch : " << Batch << endl <<
- "mpi : " << mpi << endl <<
- "UserName : " << UserName << endl <<
- "AppliPath : " << AppliPath << endl <<
- "OS : " << OS << endl <<
- "batchQueue : " << batchQueue << endl <<
- "userCommands : " << userCommands << endl <<
- "use : " << use << endl <<
- "NbOfProc : " << nbOfProc << endl <<
- "Modules : " << endl <<
- "Components : " << endl;
-
- for(int i=0;i<ComponentsList.size();i++)
- oss << "Component " << i+1 << " called : " << ComponentsList[i] << endl;
-
-
- std::list<ParserResourcesClusterMembersType>::iterator it;
- for(it = ClusterMembersList.begin();
- it != ClusterMembersList.end();
- it++)
- {
- oss << "Cluster member called : " << (*it).HostName << endl;
- }
- cout << oss.str() << endl;
-
-}
-
-void ParserResourcesType::Clear()
-{
- DataForSort._hostName = "";
- DataForSort._nbOfNodes = 1;
- DataForSort._nbOfProcPerNode = 1;
- DataForSort._CPUFreqMHz = 0;
- DataForSort._memInMB = 0;
- HostName = "";
- Alias = "";
- Protocol = rsh;
- Mode = interactive;
- Batch = none;
- mpi = nompi;
- UserName = "";
- AppliPath = "";
- batchQueue = "";
- userCommands = "";
- ComponentsList.clear();
- OS = "";
- use = "";
- ClusterMembersList.clear();
- nbOfProc = 1;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
-// File : SALOME_ResourcesCatalog_Parser.hxx
-// Author : Estelle Deville
-// Module : SALOME
-//$Header$
-//
-#ifndef SALOME_RESOURCES_CATALOG_PARSER
-#define SALOME_RESOURCES_CATALOG_PARSER
-
-#include "ResourcesManager_Defs.hxx"
-
-#include <string>
-#include <vector>
-#include <list>
-#include <map>
-#include <iostream>
-
-enum AccessProtocolType {rsh, ssh};
-
-enum AccessModeType {interactive, batch};
-
-enum BatchType {none, pbs, lsf, sge};
-
-enum MpiImplType {nompi, lam, mpich1, mpich2, openmpi, slurm, prun};
-
-class RESOURCESMANAGER_EXPORT ResourceDataToSort
- {
-
- public:
- std::string _hostName;
- unsigned int _nbOfNodes;
- unsigned int _nbOfProcPerNode;
- unsigned int _CPUFreqMHz;
- unsigned int _memInMB;
- static unsigned int _nbOfNodesWanted;
- static unsigned int _nbOfProcPerNodeWanted;
- static unsigned int _CPUFreqMHzWanted;
- static unsigned int _memInMBWanted;
-
- public:
- ResourceDataToSort();
- ResourceDataToSort(const std::string& hostname,
- unsigned int nbOfNodes,
- unsigned int nbOfProcPerNode,
- unsigned int CPUFreqMHz,
- unsigned int memInMB);
- bool operator< (const ResourceDataToSort& other) const;
- void Print() const;
-
- private:
- unsigned int GetNumberOfPoints() const;
- };
-
-struct RESOURCESMANAGER_EXPORT ParserResourcesClusterMembersType
-{
- std::string HostName;
- AccessProtocolType Protocol;
- std::string UserName;
- std::string AppliPath;
- ResourceDataToSort DataForSort;
-};
-
-struct RESOURCESMANAGER_EXPORT ParserResourcesType
-{
- ResourceDataToSort DataForSort;
- std::string HostName;
- std::string Alias;
- AccessProtocolType Protocol;
- AccessModeType Mode;
- BatchType Batch;
- MpiImplType mpi;
- std::string UserName;
- std::string AppliPath;
- std::vector<std::string> ComponentsList;
- std::vector<std::string> ModulesList;
- std::string OS;
- std::string batchQueue;
- std::string userCommands;
- std::string use;
- std::list<ParserResourcesClusterMembersType> ClusterMembersList;
- unsigned int nbOfProc;
-
- void Print();
- void Clear();
-};
-
-typedef std::map<std::string, ParserResourcesType> MapOfParserResourcesType;
-typedef std::map<std::string, ParserResourcesType>::iterator MapOfParserResourcesType_it;
-
-#endif //SALOME_RESOURCES_CATALOG_PARSER
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "SALOME_ResourcesManager.hxx"
-#include "Utils_ExceptHandlers.hxx"
-#include "Utils_CorbaException.hxx"
-#include "OpUtil.hxx"
-
-#include <stdlib.h>
-#include <stdio.h>
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#include <process.h>
-#endif
-#include <fstream>
-#include <iostream>
-#include <sstream>
-#include <string.h>
-#include <map>
-#include <list>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "utilities.h"
-
-#define MAX_SIZE_FOR_HOSTNAME 256;
-
-using namespace std;
-
-const char *SALOME_ResourcesManager::_ResourcesManagerNameInNS = "/ResourcesManager";
-
-//=============================================================================
-/*!
- * just for test
- */
-//=============================================================================
-
-SALOME_ResourcesManager::
-SALOME_ResourcesManager(CORBA::ORB_ptr orb,
- PortableServer::POA_var poa,
- SALOME_NamingService *ns,
- const char *xmlFilePath) : _rm(xmlFilePath)
-{
- MESSAGE("SALOME_ResourcesManager constructor");
- _NS = ns;
- _orb = CORBA::ORB::_duplicate(orb) ;
- _poa = PortableServer::POA::_duplicate(poa) ;
- PortableServer::ObjectId_var id = _poa->activate_object(this);
- CORBA::Object_var obj = _poa->id_to_reference(id);
- Engines::ResourcesManager_var refContMan = Engines::ResourcesManager::_narrow(obj);
- _NS->Register(refContMan,_ResourcesManagerNameInNS);
- MESSAGE("SALOME_ResourcesManager constructor end");
-}
-
-//=============================================================================
-/*!
- * Standard constructor, parse resource file.
- * - if ${APPLI} exists in environment,
- * look for ${HOME}/${APPLI}/CatalogResources.xml
- * - else look for default:
- * ${KERNEL_ROOT_DIR}/share/salome/resources/kernel/CatalogResources.xml
- * - parse XML resource file.
- */
-//=============================================================================
-
-SALOME_ResourcesManager::SALOME_ResourcesManager(CORBA::ORB_ptr orb,
- PortableServer::POA_var poa,
- SALOME_NamingService *ns) : _rm()
-{
- MESSAGE("SALOME_ResourcesManager constructor");
- _NS = ns;
- _orb = CORBA::ORB::_duplicate(orb) ;
- _poa = PortableServer::POA::_duplicate(poa) ;
- PortableServer::ObjectId_var id = _poa->activate_object(this);
- CORBA::Object_var obj = _poa->id_to_reference(id);
- Engines::ResourcesManager_var refContMan = Engines::ResourcesManager::_narrow(obj);
- _NS->Register(refContMan,_ResourcesManagerNameInNS);
-
- MESSAGE("SALOME_ResourcesManager constructor end");
-}
-
-//=============================================================================
-/*!
- * Standard Destructor
- */
-//=============================================================================
-
-SALOME_ResourcesManager::~SALOME_ResourcesManager()
-{
- MESSAGE("SALOME_ResourcesManager destructor");
-}
-
-
-//=============================================================================
-/*! CORBA method:
- * shutdown all the containers, then the ContainerManager servant
- */
-//=============================================================================
-
-void SALOME_ResourcesManager::Shutdown()
-{
- MESSAGE("Shutdown");
- _NS->Destroy_Name(_ResourcesManagerNameInNS);
- PortableServer::ObjectId_var oid = _poa->servant_to_id(this);
- _poa->deactivate_object(oid);
-}
-
-//=============================================================================
-//! get the name of resources fitting the specified constraints (params)
-/*!
- * If hostname specified, check it is local or known in resources catalog.
- *
- * Else
- * - select first machines with corresponding OS (all machines if
- * parameter OS empty),
- * - then select the sublist of machines on which the component is known
- * (if the result is empty, that probably means that the inventory of
- * components is probably not done, so give complete list from previous step)
- */
-//=============================================================================
-
-Engines::MachineList *
-SALOME_ResourcesManager::GetFittingResources(const Engines::MachineParameters& params)
-{
-// MESSAGE("ResourcesManager::GetFittingResources");
- machineParams p;
- p.hostname = params.hostname;
- p.OS = params.OS;
- p.nb_node = params.nb_node;
- p.nb_proc_per_node = params.nb_proc_per_node;
- p.cpu_clock = params.cpu_clock;
- p.mem_mb = params.mem_mb;
- p.parallelLib = params.parallelLib;
- p.nb_component_nodes = params.nb_component_nodes;
-
- for(unsigned int i=0;i<params.componentList.length();i++)
- p.componentList.push_back(string(params.componentList[i]));
-
- for(unsigned int i=0;i<params.computerList.length();i++)
- p.computerList.push_back(string(params.computerList[i]));
-
- Engines::MachineList *ret=new Engines::MachineList;
- try{
- vector <std::string> vec = _rm.GetFittingResources(p);
- ret->length(vec.size());
- for(unsigned int i=0;i<vec.size();i++)
- (*ret)[i] = (vec[i]).c_str();
- }
- catch(const ResourcesException &ex){
- INFOS("Caught exception.");
- THROW_SALOME_CORBA_EXCEPTION(ex.msg.c_str(),SALOME::BAD_PARAM);
- }
-
- return ret;
-}
-
-//=============================================================================
-/*!
- * dynamically obtains the first machines
- */
-//=============================================================================
-
-char *
-SALOME_ResourcesManager::FindFirst(const Engines::MachineList& listOfMachines)
-{
- vector<string> ml;
- for(unsigned int i=0;i<listOfMachines.length();i++)
- ml.push_back(string(listOfMachines[i]));
-
- return CORBA::string_dup(_rm.Find("first",ml).c_str());
-}
-
-char *
-SALOME_ResourcesManager::Find(const char* policy, const Engines::MachineList& listOfMachines)
-{
- vector<string> ml;
- for(unsigned int i=0;i<listOfMachines.length();i++)
- ml.push_back(string(listOfMachines[i]));
- return CORBA::string_dup(_rm.Find(policy,ml).c_str());
-}
-
-Engines::MachineDefinition* SALOME_ResourcesManager::GetMachineParameters(const char *hostname)
-{
- ParserResourcesType resource = _rm.GetResourcesList(string(hostname));
- Engines::MachineDefinition *p_ptr = new Engines::MachineDefinition;
- p_ptr->hostname = CORBA::string_dup(resource.HostName.c_str());
- p_ptr->alias = CORBA::string_dup(resource.Alias.c_str());
- if( resource.Protocol == rsh )
- p_ptr->protocol = "rsh";
- else if( resource.Protocol == ssh )
- p_ptr->protocol = "ssh";
- p_ptr->username = CORBA::string_dup(resource.UserName.c_str());
- p_ptr->applipath = CORBA::string_dup(resource.AppliPath.c_str());
- p_ptr->componentList.length(resource.ComponentsList.size());
- for(unsigned int i=0;i<resource.ComponentsList.size();i++)
- p_ptr->componentList[i] = CORBA::string_dup(resource.ComponentsList[i].c_str());
- p_ptr->OS = CORBA::string_dup(resource.OS.c_str());
- p_ptr->mem_mb = resource.DataForSort._memInMB;
- p_ptr->cpu_clock = resource.DataForSort._CPUFreqMHz;
- p_ptr->nb_proc_per_node = resource.DataForSort._nbOfProcPerNode;
- p_ptr->nb_node = resource.DataForSort._nbOfNodes;
-
- if( resource.mpi == lam )
- p_ptr->mpiImpl = "lam";
- else if( resource.mpi == mpich1 )
- p_ptr->mpiImpl = "mpich1";
- else if( resource.mpi == mpich2 )
- p_ptr->mpiImpl = "mpich2";
- else if( resource.mpi == openmpi )
- p_ptr->mpiImpl = "openmpi";
- else if( resource.mpi == slurm )
- p_ptr->mpiImpl = "slurm";
- else if( resource.mpi == prun )
- p_ptr->mpiImpl = "prun";
-
- if( resource.Batch == pbs )
- p_ptr->batch = "pbs";
- else if( resource.Batch == lsf )
- p_ptr->batch = "lsf";
- else if( resource.Batch == sge )
- p_ptr->batch = "sge";
-
- p_ptr->nb_component_nodes=1;
-
- return p_ptr;
-}
-
-std::string
-SALOME_ResourcesManager::getMachineFile(std::string hostname, CORBA::Long nb_procs,
- std::string parallelLib)
-{
- std::string machine_file_name("");
-
- if (parallelLib == "Dummy")
- {
- MESSAGE("[getMachineFile] parallelLib is Dummy");
- MapOfParserResourcesType resourcesList = _rm.GetList();
- if (resourcesList.find(hostname) != resourcesList.end())
- {
- ParserResourcesType resource = resourcesList[hostname];
-
- // Check if resource is cluster or not
- if (resource.ClusterMembersList.empty())
- {
- //It is not a cluster so we create a cluster with one machine
- ParserResourcesClusterMembersType fake_node;
- fake_node.HostName = resource.HostName;
- fake_node.Protocol = resource.Protocol;
- fake_node.UserName = resource.UserName;
- fake_node.AppliPath = resource.AppliPath;
- fake_node.DataForSort = resource.DataForSort;
-
- resource.ClusterMembersList.push_front(fake_node);
- }
-
- // Creating list of machines for creating the machine file
- std::list<std::string> list_of_machines;
- std::list<ParserResourcesClusterMembersType>::iterator cluster_it =
- resource.ClusterMembersList.begin();
- while (cluster_it != resource.ClusterMembersList.end())
- {
- // For each member of the cluster we add a nbOfNodes * nbOfProcPerNode in the list
- unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes *
- (*cluster_it).DataForSort._nbOfProcPerNode;
- for (unsigned int i = 0; i < number_of_proc; i++)
- list_of_machines.push_back((*cluster_it).HostName);
- cluster_it++;
- }
-
- // Creating machine file
- machine_file_name = tmpnam(NULL);
- std::ofstream machine_file(machine_file_name.c_str(), ios_base::out);
-
- CORBA::Long machine_number = 0;
- std::list<std::string>::iterator it = list_of_machines.begin();
- while (machine_number != nb_procs)
- {
- // Adding a new node to the machine file
- machine_file << *it << endl;
-
- // counting...
- it++;
- if (it == list_of_machines.end())
- it = list_of_machines.begin();
- machine_number++;
- }
- }
- else
- INFOS("[getMachineFile] Error hostname not found in resourcesList -> " << hostname);
- }
- else if (parallelLib == "Mpi")
- {
- MESSAGE("[getMachineFile] parallelLib is Mpi");
-
- MapOfParserResourcesType resourcesList = _rm.GetList();
- if (resourcesList.find(hostname) != resourcesList.end())
- {
- ParserResourcesType resource = resourcesList[hostname];
- // Check if resource is cluster or not
- if (resource.ClusterMembersList.empty())
- {
- //It is not a cluster so we create a cluster with one machine
- ParserResourcesClusterMembersType fake_node;
- fake_node.HostName = resource.HostName;
- fake_node.Protocol = resource.Protocol;
- fake_node.UserName = resource.UserName;
- fake_node.AppliPath = resource.AppliPath;
- fake_node.DataForSort = resource.DataForSort;
-
- resource.ClusterMembersList.push_front(fake_node);
- }
-
- // Choose mpi implementation -> each MPI implementation has is own machinefile...
- if (resource.mpi == lam)
- {
- // Creating machine file
- machine_file_name = tmpnam(NULL);
- std::ofstream machine_file(machine_file_name.c_str(), ios_base::out);
-
- // We add all cluster machines to the file
- std::list<ParserResourcesClusterMembersType>::iterator cluster_it =
- resource.ClusterMembersList.begin();
- while (cluster_it != resource.ClusterMembersList.end())
- {
- unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes *
- (*cluster_it).DataForSort._nbOfProcPerNode;
- machine_file << (*cluster_it).HostName << " cpu=" << number_of_proc << endl;
- cluster_it++;
- }
- }
- else if (resource.mpi == nompi)
- {
- INFOS("[getMachineFile] Error hostname MPI implementation was defined for " << hostname);
- }
- else
- INFOS("[getMachineFile] Error hostname MPI implementation not currenly handled for " << hostname);
- }
- else
- INFOS("[getMachineFile] Error hostname not found in resourcesList -> " << hostname);
- }
- else
- INFOS("[getMachineFile] Error parallelLib is not handled -> " << parallelLib);
-
- return machine_file_name;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef __SALOME_RESOURCESMANAGER_HXX__
-#define __SALOME_RESOURCESMANAGER_HXX__
-
-#include "Utils_SALOME_Exception.hxx"
-#include "utilities.h"
-#include <SALOMEconfig.h>
-#include "SALOME_ResourcesCatalog_Handler.hxx"
-#include "SALOME_LoadRateManager.hxx"
-#include "SALOME_NamingService.hxx"
-#include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
-#include <string>
-#include <fstream>
-#include <vector>
-#include "ResourcesManager.hxx"
-
-
-#ifdef WIN32
-# if defined SALOMERESOURCESMANAGER_EXPORTS || defined SalomeResourcesManager_EXPORTS
-# define SALOMERESOURCESMANAGER_EXPORT __declspec( dllexport )
-# else
-# define SALOMERESOURCESMANAGER_EXPORT __declspec( dllimport )
-# endif
-#else
-# define SALOMERESOURCESMANAGER_EXPORT
-#endif
-
-// --- WARNING ---
-// The call of BuildTempFileToLaunchRemoteContainer and RmTmpFile must be done
-// in a critical section to be sure to be clean.
-// Only one thread should use the SALOME_ResourcesManager class in a SALOME
-// session.
-
-class SALOMERESOURCESMANAGER_EXPORT SALOME_ResourcesManager:
- public POA_Engines::ResourcesManager,
- public PortableServer::RefCountServantBase
- {
-
- public:
-
- SALOME_ResourcesManager(CORBA::ORB_ptr orb, PortableServer::POA_var poa, SALOME_NamingService *ns, const char *xmlFilePath);
- SALOME_ResourcesManager(CORBA::ORB_ptr orb, PortableServer::POA_var poa, SALOME_NamingService *ns);
-
- ~SALOME_ResourcesManager();
-
- // CORBA Methods
- Engines::MachineList *
- GetFittingResources(const Engines::MachineParameters& params);
- char* FindFirst(const Engines::MachineList& listOfMachines);
- char* Find(const char *policy, const Engines::MachineList& listOfMachines);
- Engines::MachineDefinition* GetMachineParameters(const char *hostname);
-
- // Cpp Methods
- void Shutdown();
- ResourcesManager_cpp *GetImpl() { return &_rm; }
- std::string getMachineFile(std::string hostname, CORBA::Long nb_procs,
- std::string parallelLib);
-
-
- static const char *_ResourcesManagerNameInNS;
- protected:
-
- SALOME_NamingService *_NS;
- CORBA::ORB_var _orb;
- PortableServer::POA_var _poa;
-
- //
- //! will contain the informations on the data type catalog(after parsing)
- MapOfParserResourcesType _resourcesBatchList;
-
- ResourcesManager_cpp _rm;
-
- };
-
-#endif // RESSOURCESCATALOG_IMPL_H
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# File : Makefile.am
-# Author : Guillaume Boulant (CSSI)
-# Module : KERNEL
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-#
-# ===============================================================
-# Files to be installed
-# ===============================================================
-#
-# header files
-salomeinclude_HEADERS= \
- SALOMEDS_StudyManager_i.hxx \
- SALOMEDS_Driver_i.hxx \
- SALOMEDS_StudyManager.hxx \
- SALOMEDS_Study_i.hxx \
- SALOMEDS_Study.hxx \
- SALOMEDS_SObject_i.hxx \
- SALOMEDS_SObject.hxx \
- SALOMEDS_SComponent_i.hxx \
- SALOMEDS_SComponent.hxx \
- SALOMEDS_GenericAttribute_i.hxx \
- SALOMEDS_GenericAttribute.hxx \
- SALOMEDS_IParameters.hxx \
- SALOMEDS_Defines.hxx
-
-# Scripts to be installed
-dist_salomescript_PYTHON = SALOME_DriverPy.py
-
-#
-# ===============================================================
-# Local definitions
-# ===============================================================
-#
-
-# This local variable defines the list of CPPFLAGS common to all target in this package.
-COMMON_CPPFLAGS=\
- @BOOST_CPPFLAGS@ \
- -I$(srcdir)/../HDFPersist \
- @HDF5_INCLUDES@ \
- -I$(srcdir)/../Basics \
- -I$(srcdir)/../SALOMELocalTrace \
- -I$(srcdir)/../Utils \
- -I$(srcdir)/../DF \
- -I$(srcdir)/../SALOMEDSImpl \
- -I$(srcdir)/../NamingService \
- -I$(srcdir)/../GenericObj \
- -I$(srcdir)/../SALOMEDSClient \
- -I$(srcdir)/../LifeCycleCORBA \
- -I$(top_builddir)/salome_adm/unix \
- -I$(top_builddir)/idl \
- @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
-
-# This local variable defines the list of dependant libraries common to all target in this package.
-COMMON_LIBS =\
- ../TOOLSDS/libTOOLSDS.la \
- ../NamingService/libSalomeNS.la \
- ../Utils/libOpUtil.la \
- ../SALOMELocalTrace/libSALOMELocalTrace.la \
- ../Basics/libSALOMEBasics.la \
- ../HDFPersist/libSalomeHDFPersist.la \
- ../DF/libDF.la \
- ../SALOMEDSImpl/libSalomeDSImpl.la \
- ../GenericObj/libSalomeGenericObj.la \
- ../LifeCycleCORBA/libSalomeLifeCycleCORBA.la \
- $(top_builddir)/idl/libSalomeIDLKernel.la\
- @HDF5_LIBS@
-
-
-#LDFLAGS+= -lSalomeGenericObj -lSalomeLifeCycleCORBA
-
-#
-# ===============================================================
-# Libraries targets
-# ===============================================================
-#
-lib_LTLIBRARIES = libSalomeDS.la
-libSalomeDS_la_SOURCES = \
- SALOMEDS.cxx \
- SALOMEDS_Driver_i.cxx \
- SALOMEDS_StudyManager_i.cxx \
- SALOMEDS_UseCaseBuilder_i.cxx \
- SALOMEDS_UseCaseIterator_i.cxx \
- SALOMEDS_ChildIterator_i.cxx \
- SALOMEDS_SComponentIterator_i.cxx \
- SALOMEDS_Study_i.cxx \
- SALOMEDS_StudyBuilder_i.cxx \
- SALOMEDS_SObject_i.cxx \
- SALOMEDS_SComponent_i.cxx \
- SALOMEDS_GenericAttribute_i.cxx \
- SALOMEDS_AttributeComment_i.cxx \
- SALOMEDS_AttributeExternalFileDef_i.cxx \
- SALOMEDS_AttributeFileType_i.cxx \
- SALOMEDS_AttributeIOR_i.cxx \
- SALOMEDS_AttributeInteger_i.cxx \
- SALOMEDS_AttributeName_i.cxx \
- SALOMEDS_AttributePersistentRef_i.cxx \
- SALOMEDS_AttributeReal_i.cxx \
- SALOMEDS_AttributeSequenceOfReal_i.cxx \
- SALOMEDS_AttributeSequenceOfInteger_i.cxx \
- SALOMEDS_AttributeDrawable_i.cxx \
- SALOMEDS_AttributeSelectable_i.cxx \
- SALOMEDS_AttributeOpened_i.cxx \
- SALOMEDS_AttributeFlags_i.cxx \
- SALOMEDS_AttributeGraphic_i.cxx \
- SALOMEDS_AttributeExpandable_i.cxx \
- SALOMEDS_AttributeTextColor_i.cxx \
- SALOMEDS_AttributeTextHighlightColor_i.cxx \
- SALOMEDS_AttributePixMap_i.cxx \
- SALOMEDS_AttributeTreeNode_i.cxx \
- SALOMEDS_AttributeLocalID_i.cxx \
- SALOMEDS_AttributeUserID_i.cxx \
- SALOMEDS_AttributeTarget_i.cxx \
- SALOMEDS_AttributeTableOfInteger_i.cxx \
- SALOMEDS_AttributeTableOfReal_i.cxx \
- SALOMEDS_AttributeTableOfString_i.cxx \
- SALOMEDS_AttributeStudyProperties_i.cxx \
- SALOMEDS_AttributePythonObject_i.cxx \
- SALOMEDS_AttributeParameter_i.cxx \
- SALOMEDS_AttributeString_i.cxx \
- SALOMEDS_SObject.cxx \
- SALOMEDS_SComponent.cxx \
- SALOMEDS_GenericAttribute.cxx \
- SALOMEDS_ChildIterator.cxx \
- SALOMEDS_SComponentIterator.cxx \
- SALOMEDS_UseCaseIterator.cxx \
- SALOMEDS_UseCaseBuilder.cxx \
- SALOMEDS_StudyBuilder.cxx \
- SALOMEDS_Study.cxx \
- SALOMEDS_StudyManager.cxx \
- SALOMEDS_AttributeStudyProperties.cxx \
- SALOMEDS_AttributeComment.cxx \
- SALOMEDS_AttributeDrawable.cxx \
- SALOMEDS_AttributeExpandable.cxx \
- SALOMEDS_AttributeExternalFileDef.cxx \
- SALOMEDS_AttributeFileType.cxx \
- SALOMEDS_AttributeFlags.cxx \
- SALOMEDS_AttributeGraphic.cxx \
- SALOMEDS_AttributeIOR.cxx \
- SALOMEDS_AttributeInteger.cxx \
- SALOMEDS_AttributeLocalID.cxx \
- SALOMEDS_AttributeName.cxx \
- SALOMEDS_AttributeOpened.cxx \
- SALOMEDS_AttributePythonObject.cxx \
- SALOMEDS_AttributeReal.cxx \
- SALOMEDS_AttributeSelectable.cxx \
- SALOMEDS_AttributeSequenceOfInteger.cxx \
- SALOMEDS_AttributePersistentRef.cxx \
- SALOMEDS_AttributePixMap.cxx \
- SALOMEDS_AttributeSequenceOfReal.cxx \
- SALOMEDS_AttributeTableOfInteger.cxx \
- SALOMEDS_AttributeTableOfReal.cxx \
- SALOMEDS_AttributeTableOfString.cxx \
- SALOMEDS_AttributeTarget.cxx \
- SALOMEDS_AttributeTextColor.cxx \
- SALOMEDS_AttributeTextHighlightColor.cxx \
- SALOMEDS_AttributeTreeNode.cxx \
- SALOMEDS_AttributeUserID.cxx \
- SALOMEDS_TMPFile_i.cxx \
- SALOMEDS_AttributeParameter.cxx \
- SALOMEDS_AttributeString.cxx \
- SALOMEDS_IParameters.cxx \
- SALOMEDS_AttLong_i.hxx \
- SALOMEDS_AttReal_i.hxx \
- SALOMEDS_AttributeComment.hxx \
- SALOMEDS_AttributeComment_i.hxx \
- SALOMEDS_AttributeDrawable.hxx \
- SALOMEDS_AttributeDrawable_i.hxx \
- SALOMEDS_AttributeExpandable.hxx \
- SALOMEDS_AttributeExpandable_i.hxx \
- SALOMEDS_AttributeExternalFileDef.hxx \
- SALOMEDS_AttributeExternalFileDef_i.hxx \
- SALOMEDS_AttributeFileType.hxx \
- SALOMEDS_AttributeFileType_i.hxx \
- SALOMEDS_AttributeFlags.hxx \
- SALOMEDS_AttributeFlags_i.hxx \
- SALOMEDS_AttributeGraphic.hxx \
- SALOMEDS_AttributeGraphic_i.hxx \
- SALOMEDS_AttributeInteger.hxx \
- SALOMEDS_AttributeInteger_i.hxx \
- SALOMEDS_AttributeIOR.hxx \
- SALOMEDS_AttributeIOR_i.hxx \
- SALOMEDS_AttributeLocalID.hxx \
- SALOMEDS_AttributeLocalID_i.hxx \
- SALOMEDS_AttributeName.hxx \
- SALOMEDS_AttributeName_i.hxx \
- SALOMEDS_AttributeOpened.hxx \
- SALOMEDS_AttributeOpened_i.hxx \
- SALOMEDS_AttributePersistentRef.hxx \
- SALOMEDS_AttributePersistentRef_i.hxx \
- SALOMEDS_AttributePixMap.hxx \
- SALOMEDS_AttributePixMap_i.hxx \
- SALOMEDS_AttributePythonObject.hxx \
- SALOMEDS_AttributePythonObject_i.hxx \
- SALOMEDS_AttributeReal.hxx \
- SALOMEDS_AttributeReal_i.hxx \
- SALOMEDS_AttributeSelectable.hxx \
- SALOMEDS_AttributeSelectable_i.hxx \
- SALOMEDS_AttributeSequenceOfInteger.hxx \
- SALOMEDS_AttributeSequenceOfInteger_i.hxx \
- SALOMEDS_AttributeSequenceOfReal.hxx \
- SALOMEDS_AttributeSequenceOfReal_i.hxx \
- SALOMEDS_Attributes.hxx \
- SALOMEDS_AttributeStudyProperties.hxx \
- SALOMEDS_AttributeStudyProperties_i.hxx \
- SALOMEDS_AttributeTableOfInteger.hxx \
- SALOMEDS_AttributeTableOfInteger_i.hxx \
- SALOMEDS_AttributeTableOfReal.hxx \
- SALOMEDS_AttributeTableOfReal_i.hxx \
- SALOMEDS_AttributeTableOfString.hxx \
- SALOMEDS_AttributeTableOfString_i.hxx \
- SALOMEDS_AttributeTarget.hxx \
- SALOMEDS_AttributeTarget_i.hxx \
- SALOMEDS_AttributeTextColor.hxx \
- SALOMEDS_AttributeTextColor_i.hxx \
- SALOMEDS_AttributeTextHighlightColor.hxx \
- SALOMEDS_AttributeTextHighlightColor_i.hxx \
- SALOMEDS_AttributeTreeNode.hxx \
- SALOMEDS_AttributeTreeNode_i.hxx \
- SALOMEDS_AttributeUserID.hxx \
- SALOMEDS_AttributeUserID_i.hxx \
- SALOMEDS_BasicAttributeFactory.hxx \
- SALOMEDS_BasicAttribute_i.hxx \
- SALOMEDS_Callback_i.hxx \
- SALOMEDS_ChildIterator.hxx \
- SALOMEDS_ChildIterator_i.hxx \
- SALOMEDS_ClientAttributes.hxx \
- SALOMEDS_Driver_i.hxx \
- SALOMEDS_GenericAttribute.hxx \
- SALOMEDS_GenericAttribute_i.hxx \
- SALOMEDS.hxx \
- SALOMEDS_SComponent.hxx \
- SALOMEDS_SComponent_i.hxx \
- SALOMEDS_SComponentIterator.hxx \
- SALOMEDS_SComponentIterator_i.hxx \
- SALOMEDS_SObject.hxx \
- SALOMEDS_SObject_i.hxx \
- SALOMEDS_StudyBuilder.hxx \
- SALOMEDS_StudyBuilder_i.hxx \
- SALOMEDS_Study.hxx \
- SALOMEDS_Study_i.hxx \
- SALOMEDS_StudyManager.hxx \
- SALOMEDS_StudyManager_i.hxx \
- SALOMEDS_UseCaseBuilder.hxx \
- SALOMEDS_UseCaseBuilder_i.hxx \
- SALOMEDS_UseCaseIterator.hxx \
- SALOMEDS_UseCaseIterator_i.hxx \
- SALOMEDS_AttributeParameter.hxx \
- SALOMEDS_AttributeParameter_i.hxx \
- SALOMEDS_AttributeString.hxx \
- SALOMEDS_AttributeString_i.hxx \
- SALOMEDS_TMPFile_i.hxx
-
-libSalomeDS_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSalomeDS_la_LDFLAGS = -Wl,-E -no-undefined -version-info=0:0:0 @LDEXPDYNFLAGS@
-libSalomeDS_la_LIBADD = $(COMMON_LIBS)
-
-#
-# ===============================================================
-# Executables targets
-# ===============================================================
-#
-bin_PROGRAMS = SALOMEDS_Server SALOMEDS_Client
-
-SALOMEDS_Server_SOURCES = SALOMEDS_Server.cxx
-SALOMEDS_Server_CPPFLAGS = $(COMMON_CPPFLAGS)
-SALOMEDS_Server_LDADD = libSalomeDS.la \
- ../Basics/libSALOMEBasics.la \
- $(HDF5_LIBS) \
- $(CORBA_LIBS)
-
-SALOMEDS_Client_SOURCES = SALOMEDS_Client.cxx
-SALOMEDS_Client_CPPFLAGS = $(COMMON_CPPFLAGS)
-SALOMEDS_Client_LDADD = libSalomeDS.la \
- ../Basics/libSALOMEBasics.la \
- $(HDF5_LIBS) \
- $(CORBA_LIBS)
+++ /dev/null
-Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
-Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
------------------------------------------
-
-How to add a new attribute (without WOK):
------------------------------------------
-
-This works only for simple types (ex: string)
-
-example: add attribute FileType (string)
-
-# new files (copied from files specific to ExternalFileDef attribute = string):
-
-? src/SALOMEDS/Handle_SALOMEDS_FileType.hxx <--- Handle_SALOMEDS_ExternalFileDef.hxx
-? src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx <--- SALOMEDS_AttributeExternalFileDef_i.cxx
-? src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx <--- SALOMEDS_AttributeExternalFileDef_i.hxx
-? src/SALOMEDS/SALOMEDS_FileType.cdl <--- SALOMEDS_ExternalFileDef.cdl
-? src/SALOMEDS/SALOMEDS_FileType.cxx <--- SALOMEDS_ExternalFileDef.cxx
-? src/SALOMEDS/SALOMEDS_FileType.hxx <--- SALOMEDS_ExternalFileDef.hxx
-? src/SALOMEDS/SALOMEDS_FileType.ixx <--- SALOMEDS_ExternalFileDef.ixx
-? src/SALOMEDS/SALOMEDS_FileType.jxx <--- SALOMEDS_ExternalFileDef.jxx
-
-# files modified:
-
-M idl/SALOMEDS_Attributes.idl
-M src/SALOMEDS/Makefile.in
-M src/SALOMEDS/SALOMEDS_SObject_i.cxx
-M src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx
-
-# detailled modifications:
-
-- in new files,
-change ExternalFileDef in FileType everywhere
-- in SALOMEDS_FileType.cxx,
-Standard_GUID (Global Universal IDentifier) must be changed.
-To obtain a new GUID, it is possible to use guidgen.exe on windows (with visual C++).
-
-- in src/SALOMEDS/Makefile.in,
-add under LIB_SRC = \
- SALOMEDS_FileType.cxx \
- SALOMEDS_AttributeExternalFileDef_i.cxx \
-
-- in src/SALOMEDS/SALOMEDS_SObject_i.cxx,
-- in src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx,
-- in idl/SALOMEDS_Attributes.idl,
-find portions of code containing ExternalFileDef, duplicate and replace
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDS.cxx
-// Author : Sergey ANIKIN
-// Module : SALOME
-// $Header$
-//
-#include "SALOMEDS.hxx"
-#include "SALOMEDS_StudyManager.hxx"
-#include "SALOMEDS_Study.hxx"
-#include "SALOMEDS_StudyBuilder.hxx"
-#include "SALOMEDS_SObject.hxx"
-#include "SALOMEDS_SComponent.hxx"
-#include "SALOMEDSClient.hxx"
-#include "SALOMEDSClient_IParameters.hxx"
-#include "SALOMEDS_IParameters.hxx"
-#include "SALOMEDS_StudyManager_i.hxx"
-
-#include "SALOMEDS_Defines.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include <SALOME_NamingService.hxx>
-
-using namespace SALOMEDS;
-
-// PAL8065: san -- Global recursive mutex for SALOMEDS methods
-Utils_Mutex Locker::MutexDS;
-
-// PAL8065: san -- Global SALOMEDS locker
-Locker::Locker()
-: Utils_Locker( &MutexDS )
-{}
-
-Locker::~Locker()
-{}
-
-void SALOMEDS::lock()
-{
- Locker::MutexDS.lock();
-}
-
-void SALOMEDS::unlock()
-{
- Locker::MutexDS.unlock();
-}
-
-
-
-// srn: Added new library methods that create basic SALOMEDS objects (StudyManager, Study, SComponent, SObject)
-
-//=============================================================================
-/*!
- * C factory, accessible with dlsym, after dlopen
- */
-//=============================================================================
-
-
-extern "C"
-{
-SALOMEDS_EXPORT
- SALOMEDSClient_StudyManager* StudyManagerFactory()
-{
- return new SALOMEDS_StudyManager();
-}
-SALOMEDS_EXPORT
- SALOMEDSClient_Study* StudyFactory(SALOMEDS::Study_ptr theStudy)
-{
- if(CORBA::is_nil(theStudy)) return NULL;
- return new SALOMEDS_Study(theStudy);
-}
-
-SALOMEDS_EXPORT
- SALOMEDSClient_SObject* SObjectFactory(SALOMEDS::SObject_ptr theSObject)
-{
- if(CORBA::is_nil(theSObject)) return NULL;
- return new SALOMEDS_SObject(theSObject);
-}
-
-SALOMEDS_EXPORT
- SALOMEDSClient_SComponent* SComponentFactory(SALOMEDS::SComponent_ptr theSComponent)
-{
- if(CORBA::is_nil(theSComponent)) return NULL;
- return new SALOMEDS_SComponent(theSComponent);
-}
-
-SALOMEDS_EXPORT
- SALOMEDSClient_StudyBuilder* BuilderFactory(SALOMEDS::StudyBuilder_ptr theBuilder)
-{
- if(CORBA::is_nil(theBuilder)) return NULL;
- return new SALOMEDS_StudyBuilder(theBuilder);
-}
-
-SALOMEDS_EXPORT
- SALOMEDSClient_StudyManager* CreateStudyManager(CORBA::ORB_ptr orb, PortableServer::POA_ptr root_poa)
-{
- SALOME_NamingService namingService(orb);
- CORBA::Object_var obj = namingService.Resolve( "/myStudyManager" );
- SALOMEDS::StudyManager_var theManager = SALOMEDS::StudyManager::_narrow( obj );
- if( CORBA::is_nil(theManager) ) {
- SALOMEDS_StudyManager_i * aStudyManager_i = new SALOMEDS_StudyManager_i(orb, root_poa);
- // Activate the objects. This tells the POA that the objects are ready to accept requests.
- PortableServer::ObjectId_var aStudyManager_iid = root_poa->activate_object(aStudyManager_i);
- //give ownership to the poa : the object will be deleted by the poa
- aStudyManager_i->_remove_ref();
- aStudyManager_i->register_name((char*)"/myStudyManager");
- }
- return new SALOMEDS_StudyManager();
-}
-
-SALOMEDS_EXPORT
- SALOMEDSClient_IParameters* GetIParameters(const _PTR(AttributeParameter)& ap)
-{
- return new SALOMEDS_IParameters(ap);
-}
-
-SALOMEDS_EXPORT
- SALOMEDS::SObject_ptr ConvertSObject(const _PTR(SObject)& theSObject)
-{
-
- SALOMEDS_SObject* so = _CAST(SObject, theSObject);
- if(!theSObject || !so) return SALOMEDS::SObject::_nil();
- return so->GetSObject();
-}
-
-SALOMEDS_EXPORT
- SALOMEDS::Study_ptr ConvertStudy(const _PTR(Study)& theStudy)
-{
- SALOMEDS_Study* study = _CAST(Study, theStudy);
- if(!theStudy || !study) return SALOMEDS::Study::_nil();
- return study->GetStudy();
-}
-
-SALOMEDS_EXPORT
- SALOMEDS::StudyBuilder_ptr ConvertBuilder(const _PTR(StudyBuilder)& theBuilder)
-{
- SALOMEDS_StudyBuilder* builder = _CAST(StudyBuilder, theBuilder);
- if(!theBuilder || !builder) return SALOMEDS::StudyBuilder::_nil();
- return builder->GetBuilder();
-}
-
-
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDS.hxx
-// Author : Sergey ANIKIN
-// Module : SALOME
-// $Header$
-//
-#ifndef SALOMEDS_HeaderFile
-#define SALOMEDS_HeaderFile
-
-#include "SALOMEDS_Defines.hxx"
-
-#include <Utils_Mutex.hxx>
-
-namespace SALOMEDS
-{
- // PAL8065: san -- Implementation of convenient locker based on simple recursive
- // mutex for POSIX platforms.
- // This class is to protect SALOMEDS CORBA methods which deal with OCC calls from
- // parallel access by several threads
- // To protect some method, an instance of Locker class should be created
- // on the stack at the beginning of guarded code:
- //
- // Locker lock;
- //
- class SALOMEDS_EXPORT Locker : public Utils_Locker
- {
- public:
- Locker();
- virtual ~Locker();
-
- private:
- static Utils_Mutex MutexDS;
-
- friend void lock();
- friend void unlock();
- };
-
- // Convenient functions to lock/unlock the global SALOMEDS mutex temporarily.
- // In particular, "unlock-dosomething-lock" scheme should be used, when some non-SALOMEDS
- // CORBA interface is called (component's engine), to avoid deadlocks in case of
- // indirect recursion.
- void lock();
- void unlock();
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDS_AttLong_i.cxx
-// Author : Estelle Deville
-// Module : SALOME
-// $Header$
-//
-#include "SALOMEDS_AttLong_i.hxx"
-#include "utilities.h"
-#include <stdio.h>
-#include <SALOMEDSImpl_AttributeInteger.hxx>
-using namespace std;
-
-//============================================================================
-/*! Function : Set
- * Purpose : Affect a value to the basic attribute
- */
-//============================================================================
-void SALOMEDS_AttLong_i::Set(CORBA::Long i)
-{
- CheckLocked();
- SALOMEDSImpl_AttributeInteger::Set (_Lab,i);
-}
-
-//============================================================================
-/*! Function : Get
- * Purpose : Get basic attribute's value
- */
-//============================================================================
-CORBA::Long SALOMEDS_AttLong_i::Get()
-{
- SALOMEDSImpl_AttributeInteger* Att = NULL;
- CORBA::Long x;
- if ((Att=(SALOMEDSImpl_AttributeInteger*)_Lab.FindAttribute(SALOMEDSImpl_AttributeInteger::GetID())))
- x = Att->Get ();
- return x;
-}
-
-//============================================================================
-/*! Function : Save
- * Purpose :
- */
-//============================================================================
-char* SALOMEDS_AttLong_i::Save()
-{
- BEGIN_OF("SALOMEDS_AttLong_i::Save");
- CORBA::Long x = this->Get();
- char* out= new char[12];
- sprintf(out,"%ld",x);
- return out;
-}
-
-//============================================================================
-/*! Function : Load
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_AttLong_i::Load()
-{
- BEGIN_OF("SALOMEDS_AttLong_i::Load");
-}
-
-//============================================================================
-/*! Function : GetPtr
- * Purpose : return sobject associated to the basic attribute (if exist)
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_AttLong_i::GetPtr(SALOMEDS::SObject_ptr anObject)
-{
- return (_Lab.IsAttribute(SALOMEDSImpl_AttributeInteger::GetID()));
-}
-
-//============================================================================
-/*! Function : GetType
- * Purpose :
- */
-//============================================================================
-char* SALOMEDS_AttLong_i::GetType()
-{
- return CORBA::string_dup(_type);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDS_AttLong_i.hxx
-// Author : Estelle Deville
-// Module : SALOME
-// $Header$
-//
-#ifndef __SALOMEDS_ATTLONG_I_H__
-#define __SALOMEDS_ATTLONG_I_H__
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_AttLong)
-#include "SALOMEDS_BasicAttribute_i.hxx"
-
-class SALOMEDS_AttLong_i: public POA_SALOMEDS::AttLong,
- public SALOMEDS_BasicAttribute_i {
-protected:
- char * _type;
-
-public:
-
- SALOMEDS_AttLong_i() { _type = "AttLong";};
- ~SALOMEDS_AttLong_i() {};
- void Set(CORBA::Long i);
- CORBA::Long Get();
- virtual char* Save();
- virtual void Load();
- CORBA::Boolean GetPtr(SALOMEDS::SObject_ptr so);
- virtual char* GetType();
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDS_AttReal_i.cxx
-// Author : Estelle Deville
-// Module : SALOME
-// $Header$
-//
-#include "SALOMEDS_AttReal_i.hxx"
-#include "utilities.h"
-#include <stdio.h>
-#include <cstring>
-#include <SALOMEDSImpl_AttributeReal.hxx>
-using namespace std;
-
-//============================================================================
-/*! Function : Set
- * Purpose : Affect a value to the basic attribute
- */
-//============================================================================
-void SALOMEDS_AttReal_i::Set(CORBA::Double r)
-{
- CheckLocked();
- SALOMEDSImpl_AttributeReal::Set (_Lab,r);
-}
-
-//============================================================================
-/*! Function : Get
- * Purpose : Get basic attribute's value
- */
-//============================================================================
-CORBA::Double SALOMEDS_AttReal_i::Get()
-{
- SALOMEDSImpl_AttributeReal* Att;
- CORBA::Double x;
- if ((Att=(SALOMEDSImpl_AttributeReal*)_Lab.FindAttribute(TDataStd_Real::GetID())))
- x = Att->Get ();
- return x;
-}
-
-//============================================================================
-/*! Function : Save
- * Purpose :
- */
-//============================================================================
-char* SALOMEDS_AttReal_i::Save()
-{
- BEGIN_OF("SALOMEDS_AttReal_i::Save");
- CORBA::Double x = this->Get();
- char* out= new char[12];
- sprintf(out,"%g",x);
- return out;
-}
-
-//============================================================================
-/*! Function : Load
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_AttReal_i::Load()
-{
- BEGIN_OF("SALOMEDS_AttReal_i::Load");
-}
-
-//============================================================================
-/*! Function : GetPtr
- * Purpose : return sobject associated to the basic attribute (if exist)
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_AttReal_i::GetPtr(SALOMEDS::SObject_ptr anObject)
-{
- return _Lab.IsAttribute(SALOMEDSImpl_AttributeReal::GetID());
-}
-
-//============================================================================
-/*! Function : GetType
- * Purpose :
- */
-//============================================================================
-char* SALOMEDS_AttReal_i::GetType()
-{
- return CORBA::string_dup(_type);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDS_AttReal_i.hxx
-// Author : Estelle Deville
-// Module : SALOME
-// $Header$
-//
-#ifndef __SALOMEDS_ATTREAL_I_H__
-#define __SALOMEDS_ATTREAL_I_H__
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_AttReal)
-#include "SALOMEDS_BasicAttribute_i.hxx"
-
-class SALOMEDS_AttReal_i: public POA_SALOMEDS::AttReal,
- public SALOMEDS_BasicAttribute_i {
-protected:
- char * _type;
-
-public:
-
- SALOMEDS_AttReal_i() { _type = "AttReal";};
- ~SALOMEDS_AttReal_i() {};
- void Set(CORBA::Double r);
- CORBA::Double Get();
- virtual char* Save();
- virtual void Load();
- CORBA::Boolean GetPtr(SALOMEDS::SObject_ptr so);
- virtual char* GetType();
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeComment.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeComment.hxx"
-#include "SALOMEDS.hxx"
-
-#include <string>
-
-SALOMEDS_AttributeComment::SALOMEDS_AttributeComment(SALOMEDSImpl_AttributeComment* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeComment::SALOMEDS_AttributeComment(SALOMEDS::AttributeComment_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeComment::~SALOMEDS_AttributeComment()
-{}
-
-std::string SALOMEDS_AttributeComment::Value()
-{
- std::string aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeComment*>(_local_impl)->Value();
- }
- else aValue = SALOMEDS::AttributeComment::_narrow(_corba_impl)->Value();
- return aValue;
-}
-
-void SALOMEDS_AttributeComment::SetValue(const std::string& value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeComment*>(_local_impl)->SetValue(value);
- }
- else SALOMEDS::AttributeComment::_narrow(_corba_impl)->SetValue(value.c_str());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeComment.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeComment_HeaderFile
-#define SALOMEDS_AttributeComment_HeaderFile
-
-#include "SALOMEDSClient_AttributeComment.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeComment.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeComment: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeComment
-{
-public:
- SALOMEDS_AttributeComment(SALOMEDSImpl_AttributeComment* theAttr);
- SALOMEDS_AttributeComment(SALOMEDS::AttributeComment_ptr theAttr);
- ~SALOMEDS_AttributeComment();
-
- virtual std::string Value();
- virtual void SetValue(const std::string& value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeComment_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeComment_i.hxx"
-
-#include "SALOMEDS_SObject_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-char* SALOMEDS_AttributeComment_i::Value()
-{
- SALOMEDS::Locker lock;
-
- CORBA::String_var c_s =
- CORBA::string_dup(dynamic_cast<SALOMEDSImpl_AttributeComment*>(_impl)->Value().c_str());
- return c_s._retn();
-}
-
-void SALOMEDS_AttributeComment_i::SetValue(const char* value)
-{
- SALOMEDS::Locker lock;
-
- CheckLocked();
- CORBA::String_var Str = CORBA::string_dup(value);
- string aValue((char*)Str.in());
- dynamic_cast<SALOMEDSImpl_AttributeComment*>(_impl)->SetValue(aValue);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeComment_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeComment_i_HeaderFile
-#define SALOMEDS_AttributeComment_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeComment.hxx"
-
-class SALOMEDS_AttributeComment_i: public virtual POA_SALOMEDS::AttributeComment,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
- SALOMEDS_AttributeComment_i(SALOMEDSImpl_AttributeComment* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- virtual ~SALOMEDS_AttributeComment_i() {};
-
- char* Value();
- void SetValue(const char* value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeDrawable.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeDrawable.hxx"
-#include "SALOMEDS.hxx"
-
-SALOMEDS_AttributeDrawable::SALOMEDS_AttributeDrawable(SALOMEDSImpl_AttributeDrawable* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeDrawable::SALOMEDS_AttributeDrawable(SALOMEDS::AttributeDrawable_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeDrawable::~SALOMEDS_AttributeDrawable()
-{}
-
-bool SALOMEDS_AttributeDrawable::IsDrawable()
-{
- bool aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = (bool)dynamic_cast<SALOMEDSImpl_AttributeDrawable*>(_local_impl)->IsDrawable();
- }
- else aValue = SALOMEDS::AttributeDrawable::_narrow(_corba_impl)->IsDrawable();
- return aValue;
-}
-
-void SALOMEDS_AttributeDrawable::SetDrawable(bool value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeDrawable*>(_local_impl)->SetDrawable((int)value);
- }
- else SALOMEDS::AttributeDrawable::_narrow(_corba_impl)->SetDrawable(value);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeDrawable.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeDrawable_HeaderFile
-#define SALOMEDS_AttributeDrawable_HeaderFile
-
-#include "SALOMEDSClient_AttributeDrawable.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeDrawable.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeDrawable: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeDrawable
-{
-public:
- SALOMEDS_AttributeDrawable(SALOMEDSImpl_AttributeDrawable* theAttr);
- SALOMEDS_AttributeDrawable(SALOMEDS::AttributeDrawable_ptr theAttr);
- ~SALOMEDS_AttributeDrawable();
-
- virtual bool IsDrawable();
- virtual void SetDrawable(bool value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeDrawable_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeDrawable_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-CORBA::Boolean SALOMEDS_AttributeDrawable_i::IsDrawable()
-{
- SALOMEDS::Locker lock;
- return (dynamic_cast<SALOMEDSImpl_AttributeDrawable*>(_impl)->IsDrawable() == 1);
-}
-
-void SALOMEDS_AttributeDrawable_i::SetDrawable(CORBA::Boolean value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeDrawable*>(_impl)->SetDrawable(value);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeDrawable_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeDrawable_i_HeaderFile
-#define SALOMEDS_AttributeDrawable_i_HeaderFile
-
-// IDL headers
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeDrawable.hxx"
-
-class SALOMEDS_AttributeDrawable_i: public virtual POA_SALOMEDS::AttributeDrawable,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributeDrawable_i(SALOMEDSImpl_AttributeDrawable* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- virtual ~SALOMEDS_AttributeDrawable_i() {};
- CORBA::Boolean IsDrawable();
- void SetDrawable(CORBA::Boolean value);
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeExpandable.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeExpandable.hxx"
-#include "SALOMEDS.hxx"
-
-SALOMEDS_AttributeExpandable::SALOMEDS_AttributeExpandable(SALOMEDSImpl_AttributeExpandable* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeExpandable::SALOMEDS_AttributeExpandable(SALOMEDS::AttributeExpandable_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeExpandable::~SALOMEDS_AttributeExpandable()
-{}
-
-bool SALOMEDS_AttributeExpandable::IsExpandable()
-{
- bool aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = (bool)dynamic_cast<SALOMEDSImpl_AttributeExpandable*>(_local_impl)->IsExpandable();
- }
- else aValue = SALOMEDS::AttributeExpandable::_narrow(_corba_impl)->IsExpandable();
- return aValue;
-}
-
-void SALOMEDS_AttributeExpandable::SetExpandable(bool value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeExpandable*>(_local_impl)->SetExpandable((int)value);
- }
- else SALOMEDS::AttributeExpandable::_narrow(_corba_impl)->SetExpandable(value);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeExpandable.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeExpandable_HeaderFile
-#define SALOMEDS_AttributeExpandable_HeaderFile
-
-#include "SALOMEDSClient_AttributeExpandable.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeExpandable.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeExpandable: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeExpandable
-{
-public:
- SALOMEDS_AttributeExpandable(SALOMEDSImpl_AttributeExpandable* theAttr);
- SALOMEDS_AttributeExpandable(SALOMEDS::AttributeExpandable_ptr theAttr);
- ~SALOMEDS_AttributeExpandable();
-
- virtual bool IsExpandable();
- virtual void SetExpandable(bool value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeExpandable_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeExpandable_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-CORBA::Boolean SALOMEDS_AttributeExpandable_i::IsExpandable()
-{
- SALOMEDS::Locker lock;
- return (dynamic_cast<SALOMEDSImpl_AttributeExpandable*>(_impl)->IsExpandable() == 1);
-}
-
-void SALOMEDS_AttributeExpandable_i::SetExpandable(CORBA::Boolean value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeExpandable*>(_impl)->SetExpandable(value);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeExpandable_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDS_AttributeExpandable_i_HeaderFile
-#define SALOMEDS_AttributeExpandable_i_HeaderFile
-
-// IDL headers
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeExpandable.hxx"
-
-class SALOMEDS_AttributeExpandable_i: public virtual POA_SALOMEDS::AttributeExpandable,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributeExpandable_i(SALOMEDSImpl_AttributeExpandable* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeExpandable_i() {};
- CORBA::Boolean IsExpandable();
- void SetExpandable(CORBA::Boolean value);
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeExternalFileDef.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeExternalFileDef.hxx"
-#include "SALOMEDS.hxx"
-#include <string>
-
-SALOMEDS_AttributeExternalFileDef::SALOMEDS_AttributeExternalFileDef(SALOMEDSImpl_AttributeExternalFileDef* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeExternalFileDef::SALOMEDS_AttributeExternalFileDef(SALOMEDS::AttributeExternalFileDef_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeExternalFileDef::~SALOMEDS_AttributeExternalFileDef()
-{}
-
-std::string SALOMEDS_AttributeExternalFileDef::Value()
-{
- std::string aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeExternalFileDef*>(_local_impl)->Value();
- }
- else aValue = SALOMEDS::AttributeExternalFileDef::_narrow(_corba_impl)->Value();
- return aValue;
-}
-
-void SALOMEDS_AttributeExternalFileDef::SetValue(const std::string& value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeExternalFileDef*>(_local_impl)->SetValue(value);
- }
- else SALOMEDS::AttributeExternalFileDef::_narrow(_corba_impl)->SetValue(value.c_str());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeExternalFileDef.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeExternalFileDef_HeaderFile
-#define SALOMEDS_AttributeExternalFileDef_HeaderFile
-
-#include "SALOMEDSClient_AttributeExternalFileDef.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeExternalFileDef: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeExternalFileDef
-{
-public:
- SALOMEDS_AttributeExternalFileDef(SALOMEDSImpl_AttributeExternalFileDef* theAttr);
- SALOMEDS_AttributeExternalFileDef(SALOMEDS::AttributeExternalFileDef_ptr theAttr);
- ~SALOMEDS_AttributeExternalFileDef();
-
- virtual std::string Value();
- virtual void SetValue(const std::string& value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeExternalFileDef_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeExternalFileDef_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-char* SALOMEDS_AttributeExternalFileDef_i::Value()
-{
- SALOMEDS::Locker lock;
- CORBA::String_var c_s =
- CORBA::string_dup(dynamic_cast<SALOMEDSImpl_AttributeExternalFileDef*>(_impl)->Value().c_str());
- return c_s._retn();
-}
-
-void SALOMEDS_AttributeExternalFileDef_i::SetValue(const char* value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- CORBA::String_var Str = CORBA::string_dup(value);
- dynamic_cast<SALOMEDSImpl_AttributeExternalFileDef*>(_impl)->SetValue(string(Str));
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeExternalFileDef_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeExternalFileDef_i_HeaderFile
-#define SALOMEDS_AttributeExternalFileDef_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
-
-class SALOMEDS_AttributeExternalFileDef_i: public virtual POA_SALOMEDS::AttributeExternalFileDef,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributeExternalFileDef_i(SALOMEDSImpl_AttributeExternalFileDef* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {}
- ~SALOMEDS_AttributeExternalFileDef_i() {};
-
- char* Value();
- void SetValue(const char* value);
-
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeFileType.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeFileType.hxx"
-#include "SALOMEDS.hxx"
-
-#include <string>
-
-SALOMEDS_AttributeFileType::SALOMEDS_AttributeFileType(SALOMEDSImpl_AttributeFileType* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeFileType::SALOMEDS_AttributeFileType(SALOMEDS::AttributeFileType_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeFileType::~SALOMEDS_AttributeFileType()
-{}
-
-std::string SALOMEDS_AttributeFileType::Value()
-{
- std::string aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeFileType*>(_local_impl)->Value();
- }
- else aValue = SALOMEDS::AttributeFileType::_narrow(_corba_impl)->Value();
- return aValue;
-}
-
-void SALOMEDS_AttributeFileType::SetValue(const std::string& value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeFileType*>(_local_impl)->SetValue(value);
- }
- else SALOMEDS::AttributeFileType::_narrow(_corba_impl)->SetValue(value.c_str());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeFileType.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeFileType_HeaderFile
-#define SALOMEDS_AttributeFileType_HeaderFile
-
-#include "SALOMEDSClient_AttributeFileType.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeFileType.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeFileType: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeFileType
-{
-public:
- SALOMEDS_AttributeFileType(SALOMEDSImpl_AttributeFileType* theAttr);
- SALOMEDS_AttributeFileType(SALOMEDS::AttributeFileType_ptr theAttr);
- ~SALOMEDS_AttributeFileType();
-
- virtual std::string Value();
- virtual void SetValue(const std::string& value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeFileType_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeFileType_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-char* SALOMEDS_AttributeFileType_i::Value()
-{
- SALOMEDS::Locker lock;
- CORBA::String_var c_s =
- CORBA::string_dup(dynamic_cast<SALOMEDSImpl_AttributeFileType*>(_impl)->Value().c_str());
- return c_s._retn();
-}
-
-void SALOMEDS_AttributeFileType_i::SetValue(const char* value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- CORBA::String_var Str = CORBA::string_dup(value);
- string aValue((char*)Str.in());
- dynamic_cast<SALOMEDSImpl_AttributeFileType*>(_impl)->SetValue(aValue);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeFileType_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeFileType_i_HeaderFile
-#define SALOMEDS_AttributeFileType_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeFileType.hxx"
-
-class SALOMEDS_AttributeFileType_i: public virtual POA_SALOMEDS::AttributeFileType,
- public virtual SALOMEDS_GenericAttribute_i {
-public:
-
- SALOMEDS_AttributeFileType_i(SALOMEDSImpl_AttributeFileType* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
- ~SALOMEDS_AttributeFileType_i() {};
-
- char* Value();
- void SetValue(const char* value);
-
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeFlags.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeFlags.hxx"
-#include "SALOMEDS.hxx"
-
-SALOMEDS_AttributeFlags::SALOMEDS_AttributeFlags(SALOMEDSImpl_AttributeFlags* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeFlags::SALOMEDS_AttributeFlags(SALOMEDS::AttributeFlags_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeFlags::~SALOMEDS_AttributeFlags()
-{}
-
-int SALOMEDS_AttributeFlags::GetFlags()
-{
- int aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeFlags*>(_local_impl)->Get();
- }
- else aValue = SALOMEDS::AttributeFlags::_narrow(_corba_impl)->GetFlags();
- return aValue;
-}
-
-void SALOMEDS_AttributeFlags::SetFlags(int theFlags)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeFlags*>(_local_impl)->Set(theFlags);
- }
- else SALOMEDS::AttributeFlags::_narrow(_corba_impl)->SetFlags(theFlags);
-}
-
-bool SALOMEDS_AttributeFlags::Get(int theFlag)
-{
- return (GetFlags() & theFlag) ? true : false;
-}
-
-void SALOMEDS_AttributeFlags::Set(int theFlag, bool theValue)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeFlags* anAttr = dynamic_cast<SALOMEDSImpl_AttributeFlags*>(_local_impl);
- if (theValue)
- anAttr->Set(anAttr->Get() | theFlag);
- else
- anAttr->Set(anAttr->Get() & ~theFlag);
- }
- else SALOMEDS::AttributeFlags::_narrow(_corba_impl)->Set(theFlag, theValue);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeFlags.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeFlags_HeaderFile
-#define SALOMEDS_AttributeFlags_HeaderFile
-
-#include "SALOMEDSClient_AttributeFlags.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeFlags.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeFlags: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeFlags
-{
-public:
- SALOMEDS_AttributeFlags(SALOMEDSImpl_AttributeFlags* theAttr);
- SALOMEDS_AttributeFlags(SALOMEDS::AttributeFlags_ptr theAttr);
- ~SALOMEDS_AttributeFlags();
-
- virtual int GetFlags();
- virtual void SetFlags(int theFlags);
-
- virtual bool Get(int theFlag);
- virtual void Set(int theFlag, bool theValue);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeFlags_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeFlags_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-/*
- Class : SALOMEDS_AttributeFlags_i
- Description : This class is intended for storing different object attributes that
- have only two states (0 and 1).
-
- Avalable attributes:
-
- IS_VISIBLE - is equal to 1 if object is visible in 3D view (0 - overwise).
- This attribute is valid for active view only.
-*/
-
-
-//=======================================================================
-// function : SALOMEDS_AttributeFlags_i::GetFlags
-// purpose : Get all flags as integer value
-//=======================================================================
-CORBA::Long SALOMEDS_AttributeFlags_i::GetFlags()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeFlags*>(_impl)->Get();
-}
-
-//=======================================================================
-// function : SALOMEDS_AttributeFlags_i::SetFlags
-// purpose : Set all flags as integer value
-//=======================================================================
-void SALOMEDS_AttributeFlags_i::SetFlags( CORBA::Long theFlags )
-{
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeFlags*>(_impl)->Set( theFlags );
-}
-
-//=======================================================================
-// function : SALOMEDS_AttributeFlags_i::Get
-// purpose : Get specified flag
-//=======================================================================
-CORBA::Boolean SALOMEDS_AttributeFlags_i::Get( CORBA::Long theFlag )
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeFlags*>(_impl)->Get() & theFlag ? true : false;
-}
-
-//=======================================================================
-// function : SALOMEDS_AttributeFlags_i::Set
-// purpose : Set/Unset specified flag
-//=======================================================================
-void SALOMEDS_AttributeFlags_i::Set( CORBA::Long theFlag, CORBA::Boolean theValue )
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeFlags* anAttr = dynamic_cast<SALOMEDSImpl_AttributeFlags*>(_impl);
- if ( theValue )
- anAttr->Set( anAttr->Get() | theFlag );
- else
- anAttr->Set( anAttr->Get() & ~theFlag );
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeFlags_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDS_AttributeFlags_i_HeaderFile
-#define SALOMEDS_AttributeFlags_i_HeaderFile
-
-// IDL headers
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeFlags.hxx"
-
-/*
- Class : SALOMEDS_AttributeFlags_i
- Description : This class is intended for storing different object attributes that
- have only two states (0 and 1).
-
- Avalable attributes:
-
- IS_VISIBLE - is equal to 1 if object is visible in 3D view (0 - overwise).
- This attribute is valid for active view only.
-*/
-
-class SALOMEDS_AttributeFlags_i: public virtual POA_SALOMEDS::AttributeFlags,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributeFlags_i( SALOMEDSImpl_AttributeFlags* theAttr, CORBA::ORB_ptr orb )
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- virtual ~SALOMEDS_AttributeFlags_i() {};
-
- CORBA::Long GetFlags();
- void SetFlags( CORBA::Long theFlags );
-
- CORBA::Boolean Get( CORBA::Long theFlag );
- void Set( CORBA::Long theFlag, CORBA::Boolean theValue );
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeGraphic.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeGraphic.hxx"
-#include "SALOMEDS.hxx"
-
-SALOMEDS_AttributeGraphic::SALOMEDS_AttributeGraphic(SALOMEDSImpl_AttributeGraphic* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeGraphic::SALOMEDS_AttributeGraphic(SALOMEDS::AttributeGraphic_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeGraphic::~SALOMEDS_AttributeGraphic()
-{}
-
-
-bool SALOMEDS_AttributeGraphic::GetVisibility(int theViewId)
-{
- bool aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = (bool)dynamic_cast<SALOMEDSImpl_AttributeGraphic*>(_local_impl)->GetVisibility(theViewId);
- }
- else aValue = SALOMEDS::AttributeGraphic::_narrow(_corba_impl)->GetVisibility(theViewId);
- return aValue;
-}
-
-void SALOMEDS_AttributeGraphic::SetVisibility(int theViewId, bool theValue)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeGraphic*>(_local_impl)->SetVisibility(theViewId, theValue);
- }
- else SALOMEDS::AttributeGraphic::_narrow(_corba_impl)->SetVisibility(theViewId, theValue);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeGraphic.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeGraphic_HeaderFile
-#define SALOMEDS_AttributeGraphic_HeaderFile
-
-#include "SALOMEDSClient_AttributeGraphic.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeGraphic.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeGraphic: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeGraphic
-{
-public:
- SALOMEDS_AttributeGraphic(SALOMEDSImpl_AttributeGraphic* theAttr);
- SALOMEDS_AttributeGraphic(SALOMEDS::AttributeGraphic_ptr theAttr);
- ~SALOMEDS_AttributeGraphic();
-
- virtual void SetVisibility(int theViewId, bool theValue);
- virtual bool GetVisibility(int theViewId);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeGraphic_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeGraphic_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-/*
- Class : SALOMEDS_AttributeGraphic_i
- Description : This class is intended for storing information about
- graphic representation of objects in dirrent views
-*/
-
-
-//=======================================================================
-// function : SALOMEDS_AttributeGraphic_i::~SetVisibility
-// purpose : Set visibility of object in given view
-//=======================================================================
-void SALOMEDS_AttributeGraphic_i::SetVisibility( CORBA::Long theViewId,
- CORBA::Boolean theValue )
-{
- SALOMEDS::Locker lock;
- if ( _impl )
- dynamic_cast<SALOMEDSImpl_AttributeGraphic*>(_impl)->SetVisibility( theViewId, theValue );
-}
-
-//=======================================================================
-// function : SALOMEDS_AttributeGraphic_i::~SALOMEDS_AttributeGraphic_i
-// purpose : Get visibility of object in given view
-//=======================================================================
-CORBA::Boolean SALOMEDS_AttributeGraphic_i::GetVisibility( CORBA::Long theViewId )
-{
- SALOMEDS::Locker lock;
- return ( _impl ) ? dynamic_cast<SALOMEDSImpl_AttributeGraphic*>(_impl)->GetVisibility( theViewId ) : false;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeFlags_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDS_AttributeGraphic_i_HeaderFile
-#define SALOMEDS_AttributeGraphic_i_HeaderFile
-
-// IDL headers
-
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeGraphic.hxx"
-
-/*
- Class : SALOMEDS_AttributeGraphic_i
- Description : This class is intended for storing information about
- graphic representation of objects in dirrent views
-*/
-
-class SALOMEDS_AttributeGraphic_i: public virtual POA_SALOMEDS::AttributeGraphic,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributeGraphic_i( SALOMEDSImpl_AttributeGraphic* theAttr, CORBA::ORB_ptr orb )
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- virtual ~SALOMEDS_AttributeGraphic_i() {};
-
- void SetVisibility( CORBA::Long theViewId,
- CORBA::Boolean theValue );
- CORBA::Boolean GetVisibility( CORBA::Long theViewId );
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeIOR.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeIOR.hxx"
-#include "SALOMEDS.hxx"
-
-#include <string>
-
-SALOMEDS_AttributeIOR::SALOMEDS_AttributeIOR(SALOMEDSImpl_AttributeIOR* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeIOR::SALOMEDS_AttributeIOR(SALOMEDS::AttributeIOR_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeIOR::~SALOMEDS_AttributeIOR()
-{}
-
-std::string SALOMEDS_AttributeIOR::Value()
-{
- std::string aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeIOR*>(_local_impl)->Value();
- }
- else aValue = SALOMEDS::AttributeIOR::_narrow(_corba_impl)->Value();
- return aValue;
-}
-
-void SALOMEDS_AttributeIOR::SetValue(const std::string& value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeIOR*>(_local_impl)->SetValue(value);
- }
- else SALOMEDS::AttributeIOR::_narrow(_corba_impl)->SetValue(value.c_str());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeIOR.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeIOR_HeaderFile
-#define SALOMEDS_AttributeIOR_HeaderFile
-
-#include "SALOMEDSClient_AttributeIOR.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeIOR.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeIOR: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeIOR
-{
-public:
- SALOMEDS_AttributeIOR(SALOMEDSImpl_AttributeIOR* theAttr);
- SALOMEDS_AttributeIOR(SALOMEDS::AttributeIOR_ptr theAttr);
- ~SALOMEDS_AttributeIOR();
-
- virtual std::string Value();
- virtual void SetValue(const std::string& value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeIOR_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeIOR_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-char* SALOMEDS_AttributeIOR_i::Value()
-{
- SALOMEDS::Locker lock;
- CORBA::String_var c_s =
- CORBA::string_dup(dynamic_cast<SALOMEDSImpl_AttributeIOR*>(_impl)->Value().c_str());
- return c_s._retn();
-}
-
-//To disable automatic management of GenericObj, comment the following line
-#define WITHGENERICOBJ
-
-void SALOMEDS_AttributeIOR_i::SetValue(const char* value)
-{
-#ifdef WITHGENERICOBJ
- CORBA::Object_var obj;
- SALOME::GenericObj_var gobj;
- try
- {
- obj = _orb->string_to_object(value);
- gobj = SALOME::GenericObj::_narrow(obj);
- if(! CORBA::is_nil(gobj) )
- gobj->Register();
- }
- catch(const CORBA::Exception& e)
- {
- }
- //unregister value
- try
- {
- std::string value=dynamic_cast<SALOMEDSImpl_AttributeIOR*>(_impl)->Value();
- if(value != "")
- {
- obj = _orb->string_to_object(value.c_str());
- gobj = SALOME::GenericObj::_narrow(obj);
- if(! CORBA::is_nil(gobj) )
- gobj->Destroy();
- }
- }
- catch(const CORBA::Exception& e)
- {
- }
-#endif
-
- SALOMEDS::Locker lock;
- CheckLocked();
- CORBA::String_var Str = CORBA::string_dup(value);
- string anExtStr((char *)Str.in());
- dynamic_cast<SALOMEDSImpl_AttributeIOR*>(_impl)->SetValue(anExtStr);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeIOR_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeIOR_i_HeaderFile
-#define SALOMEDS_AttributeIOR_i_HeaderFile
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeIOR.hxx"
-
-class SALOMEDS_AttributeIOR_i: public virtual POA_SALOMEDS::AttributeIOR,
- public virtual SALOMEDS_GenericAttribute_i {
-public:
-
- SALOMEDS_AttributeIOR_i(SALOMEDSImpl_AttributeIOR* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeIOR_i() {};
-
- char* Value();
- void SetValue(const char* value);
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeInteger.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeInteger.hxx"
-#include "SALOMEDS.hxx"
-
-SALOMEDS_AttributeInteger::SALOMEDS_AttributeInteger(SALOMEDSImpl_AttributeInteger* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeInteger::SALOMEDS_AttributeInteger(SALOMEDS::AttributeInteger_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeInteger::~SALOMEDS_AttributeInteger()
-{}
-
-int SALOMEDS_AttributeInteger::Value()
-{
- int aValue = 0;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeInteger*>(_local_impl)->Value();
- }
- else {
- aValue = SALOMEDS::AttributeInteger::_narrow(_corba_impl)->Value();
- }
- return aValue;
-}
-
-void SALOMEDS_AttributeInteger::SetValue(int value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeInteger*>(_local_impl)->SetValue(value);
- }
- else SALOMEDS::AttributeInteger::_narrow(_corba_impl)->SetValue(value);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeInteger.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeInteger_HeaderFile
-#define SALOMEDS_AttributeInteger_HeaderFile
-
-#include "SALOMEDSClient_AttributeInteger.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeInteger.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeInteger: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeInteger
-{
-public:
- SALOMEDS_AttributeInteger(SALOMEDSImpl_AttributeInteger* theAttr);
- SALOMEDS_AttributeInteger(SALOMEDS::AttributeInteger_ptr theAttr);
- ~SALOMEDS_AttributeInteger();
-
- virtual int Value();
- virtual void SetValue(int value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeInteger_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeInteger_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-CORBA::Long SALOMEDS_AttributeInteger_i::Value()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeInteger*>(_impl)->Value();
-}
-
-void SALOMEDS_AttributeInteger_i::SetValue(CORBA::Long value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeInteger*>(_impl)->SetValue(value);
-}
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeInteger_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeInteger_i_HeaderFile
-#define SALOMEDS_AttributeInteger_i_HeaderFile
-
-// IDL headers
-
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeInteger.hxx"
-
-class SALOMEDS_AttributeInteger_i: public virtual POA_SALOMEDS::AttributeInteger,
- public virtual SALOMEDS_GenericAttribute_i {
-public:
-
- SALOMEDS_AttributeInteger_i(SALOMEDSImpl_AttributeInteger* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeInteger_i() {};
-
- CORBA::Long Value();
- void SetValue(CORBA::Long value);
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeLocalID.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeLocalID.hxx"
-#include "SALOMEDS.hxx"
-
-
-SALOMEDS_AttributeLocalID::SALOMEDS_AttributeLocalID(SALOMEDSImpl_AttributeLocalID* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeLocalID::SALOMEDS_AttributeLocalID(SALOMEDS::AttributeLocalID_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeLocalID::~SALOMEDS_AttributeLocalID()
-{}
-
-int SALOMEDS_AttributeLocalID::Value()
-{
- int aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeLocalID*>(_local_impl)->Value();
- }
- else aValue = SALOMEDS::AttributeLocalID::_narrow(_corba_impl)->Value();
- return aValue;
-}
-
-void SALOMEDS_AttributeLocalID::SetValue(int value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeLocalID*>(_local_impl)->SetValue(value);
- }
- else SALOMEDS::AttributeLocalID::_narrow(_corba_impl)->SetValue(value);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeLocalID.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeLocalID_HeaderFile
-#define SALOMEDS_AttributeLocalID_HeaderFile
-
-#include "SALOMEDSClient_AttributeLocalID.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeLocalID.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeLocalID: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeLocalID
-{
-public:
- SALOMEDS_AttributeLocalID(SALOMEDSImpl_AttributeLocalID* theAttr);
- SALOMEDS_AttributeLocalID(SALOMEDS::AttributeLocalID_ptr theAttr);
- ~SALOMEDS_AttributeLocalID();
-
- virtual int Value();
- virtual void SetValue(int value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeLocalID_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeLocalID_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-CORBA::Long SALOMEDS_AttributeLocalID_i::Value()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeLocalID*>(_impl)->Value();
-}
-
-void SALOMEDS_AttributeLocalID_i::SetValue(CORBA::Long value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeLocalID*>(_impl)->SetValue(value);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeLocalID_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDS_AttributeLocalID_i_HeaderFile
-#define SALOMEDS_AttributeLocalID_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeLocalID.hxx"
-
-class SALOMEDS_AttributeLocalID_i: public virtual POA_SALOMEDS::AttributeLocalID,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributeLocalID_i(SALOMEDSImpl_AttributeLocalID* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeLocalID_i() {};
-
- CORBA::Long Value();
- void SetValue(CORBA::Long value);
-
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeName.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeName.hxx"
-#include "SALOMEDS.hxx"
-
-#include <string>
-
-SALOMEDS_AttributeName::SALOMEDS_AttributeName(SALOMEDSImpl_AttributeName* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeName::SALOMEDS_AttributeName(SALOMEDS::AttributeName_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeName::~SALOMEDS_AttributeName()
-{}
-
-std::string SALOMEDS_AttributeName::Value()
-{
- std::string aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeName*>(_local_impl)->Value();
- }
- else aValue = SALOMEDS::AttributeName::_narrow(_corba_impl)->Value();
- return aValue;
-}
-
-void SALOMEDS_AttributeName::SetValue(const std::string& value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeName*>(_local_impl)->SetValue(value);
- }
- else SALOMEDS::AttributeName::_narrow(_corba_impl)->SetValue(value.c_str());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeName.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeName_HeaderFile
-#define SALOMEDS_AttributeName_HeaderFile
-
-#include "SALOMEDSClient_AttributeName.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeName.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeName: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeName
-{
-public:
- SALOMEDS_AttributeName(SALOMEDSImpl_AttributeName* theAttr);
- SALOMEDS_AttributeName(SALOMEDS::AttributeName_ptr theAttr);
- ~SALOMEDS_AttributeName();
-
- virtual std::string Value();
- virtual void SetValue(const std::string& value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeName_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeName_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-char* SALOMEDS_AttributeName_i::Value()
-{
- SALOMEDS::Locker lock;
- CORBA::String_var c_s =
- CORBA::string_dup(dynamic_cast<SALOMEDSImpl_AttributeName*>(_impl)->Value().c_str());
- return c_s._retn();
-}
-
-void SALOMEDS_AttributeName_i::SetValue(const char* value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeName*>(_impl)->SetValue(string(value));
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeName_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDS_AttributeName_i_HeaderFile
-#define SALOMEDS_AttributeName_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeName.hxx"
-
-class SALOMEDS_AttributeName_i: public virtual POA_SALOMEDS::AttributeName,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributeName_i(SALOMEDSImpl_AttributeName* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeName_i() {};
-
- char* Value();
- void SetValue(const char* value);
-
-};
-
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeOpened.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeOpened.hxx"
-#include "SALOMEDS.hxx"
-
-SALOMEDS_AttributeOpened::SALOMEDS_AttributeOpened(SALOMEDSImpl_AttributeOpened* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeOpened::SALOMEDS_AttributeOpened(SALOMEDS::AttributeOpened_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeOpened::~SALOMEDS_AttributeOpened()
-{}
-
-bool SALOMEDS_AttributeOpened::IsOpened()
-{
- bool aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = (bool)dynamic_cast<SALOMEDSImpl_AttributeOpened*>(_local_impl)->IsOpened();
- }
- else aValue = SALOMEDS::AttributeOpened::_narrow(_corba_impl)->IsOpened();
- return aValue;
-}
-
-void SALOMEDS_AttributeOpened::SetOpened(bool value)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeOpened*>(_local_impl)->SetOpened((int)value);
- }
- else SALOMEDS::AttributeOpened::_narrow(_corba_impl)->SetOpened(value);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeOpened.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeOpened_HeaderFile
-#define SALOMEDS_AttributeOpened_HeaderFile
-
-#include "SALOMEDSClient_AttributeOpened.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeOpened.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeOpened: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeOpened
-{
-public:
- SALOMEDS_AttributeOpened(SALOMEDSImpl_AttributeOpened* theAttr);
- SALOMEDS_AttributeOpened(SALOMEDS::AttributeOpened_ptr theAttr);
- ~SALOMEDS_AttributeOpened();
-
- virtual bool IsOpened();
- virtual void SetOpened(bool value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeOpened_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeOpened_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-CORBA::Boolean SALOMEDS_AttributeOpened_i::IsOpened()
-{
- SALOMEDS::Locker lock;
- return (dynamic_cast<SALOMEDSImpl_AttributeOpened*>(_impl)->IsOpened() == 1);
-}
-
-void SALOMEDS_AttributeOpened_i::SetOpened(CORBA::Boolean value)
-{
- SALOMEDS::Locker lock;
-
- int val = 0;
- if (value != 0) val = 1;
- dynamic_cast<SALOMEDSImpl_AttributeOpened*>(_impl)->SetOpened(val);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeOpened_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDS_AttributeOpened_i_HeaderFile
-#define SALOMEDS_AttributeOpened_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeOpened.hxx"
-
-class SALOMEDS_AttributeOpened_i: public virtual POA_SALOMEDS::AttributeOpened,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributeOpened_i(SALOMEDSImpl_AttributeOpened* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
- ~SALOMEDS_AttributeOpened_i() {};
-
- CORBA::Boolean IsOpened();
- void SetOpened(CORBA::Boolean value);
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeParameter.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeParameter.hxx"
-#include "SALOMEDS.hxx"
-
-#include <string>
-
-using namespace std;
-
-//=======================================================================
-/*!
- * Function : Constructor
- * Purpose : Creates a new instance of SALOMEDS_AttributeParameter
- */
-//=======================================================================
-SALOMEDS_AttributeParameter::SALOMEDS_AttributeParameter(SALOMEDSImpl_AttributeParameter* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-//=======================================================================
-/*!
- * Function : Constructor
- * Purpose : Creates a new instance of SALOMEDS_AttributeParameter
- */
-//=======================================================================
-SALOMEDS_AttributeParameter::SALOMEDS_AttributeParameter(SALOMEDS::AttributeParameter_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-//=======================================================================
-/*!
- * Function : Destructor
- * Purpose : Destroys the instance of SALOMEDS_AttributeParameter
- */
-//=======================================================================
-SALOMEDS_AttributeParameter::~SALOMEDS_AttributeParameter()
-{}
-
-//=======================================================================
-/*!
- * Function : SetInt
- * Purpose : Associates a integer value with the ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter::SetInt(const string& theID, const int theValue)
-{
- CheckLocked();
-
- if(_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->SetInt(theID, theValue);
- }
- else
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetInt(theID.c_str(), theValue);
-}
-
-//=======================================================================
-/*!
- * Function : GetInt
- * Purpose : Returns a int value associated with the given ID
- */
-//=======================================================================
-int SALOMEDS_AttributeParameter::GetInt(const string& theID)
-{
- int aValue;
- if(_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetInt(theID);
- }
- else
- aValue = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetInt(theID.c_str());
- return aValue;
-}
-
-//=======================================================================
-/*!
- * Function : SetReal
- * Purpose : Associates a double value with the ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter::SetReal(const string& theID, const double& theValue)
-{
- CheckLocked();
-
- if(_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->SetReal(theID, theValue);
- }
- else
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetReal(theID.c_str(), theValue);
-}
-
-//=======================================================================
-/*!
- * Function : GetReal
- * Purpose : Returns a double value associated with the given ID
- */
-//=======================================================================
-double SALOMEDS_AttributeParameter::GetReal(const string& theID)
-{
- double aValue;
- if(_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetReal(theID);
- }
- else
- aValue = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetReal(theID.c_str());
- return aValue;
-}
-
-//=======================================================================
-/*!
- * Function : SetString
- * Purpose : Associates a string with the ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter::SetString(const string& theID, const string& theValue)
-{
- CheckLocked();
-
- if(_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->SetString(theID, theValue);
- }
- else
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetString(theID.c_str(), theValue.c_str());
-}
-
-//=======================================================================
-/*!
- * Function : GetString
- * Purpose : Returns a string associated with the given ID
- */
-//=======================================================================
-string SALOMEDS_AttributeParameter::GetString(const string& theID)
-{
- string aValue;
- if(_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetString(theID);
- }
- else
- aValue = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetString(theID.c_str());
- return aValue;
-}
-
-//=======================================================================
-/*!
- * Function : SetBool
- * Purpose : Associates a bool value with the ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter::SetBool(const string& theID, const bool& theValue)
-{
- CheckLocked();
-
- if(_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->SetBool(theID, theValue);
- }
- else
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetBool(theID.c_str(), theValue);
-}
-
-//=======================================================================
-/*!
- * Function : GetBool
- * Purpose : Returns a bool value associated with the ID
- */
-//=======================================================================
-bool SALOMEDS_AttributeParameter::GetBool(const string& theID)
-{
- if(_isLocal) {
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetBool(theID);
- }
- else
- return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetBool(theID.c_str());
-}
-
-//=======================================================================
-/*!
- * Function : SetRealArray
- * Purpose : Associates an array of double values with the given ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter::SetRealArray(const string& theID, const vector<double>& theArray)
-{
- CheckLocked();
-
- if(_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->SetRealArray(theID, theArray);
- }
- else {
- SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq;
- int length = theArray.size();
- if(length) {
- aSeq->length(length);
- for(int i = 0; i<length; i++) aSeq[i] = theArray[i];
- }
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetRealArray(theID.c_str(), aSeq);
- }
-}
-
-//=======================================================================
-/*!
- * Function : GetRealArray
- * Purpose : Returns an array of double values associated with the ID
- */
-//=======================================================================
-vector<double> SALOMEDS_AttributeParameter::GetRealArray(const string& theID)
-{
- vector<double> v;
- if(_isLocal) {
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetRealArray(theID);
- }
- else {
- SALOMEDS::DoubleSeq_var aSeq = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetRealArray(theID.c_str());
- int length = aSeq->length();
- if(length) {
- v.resize(length);
- for(int i = 0; i < length; i++) v[i] = aSeq[i];
- }
- }
- return v;
-}
-
-//=======================================================================
-/*!
- * Function : SetIntArray
- * Purpose : Associates an array of int values with the given ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter::SetIntArray(const string& theID, const vector<int>& theArray)
-{
- CheckLocked();
-
- if(_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->SetIntArray(theID, theArray);
- }
- else {
- SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq;
- int length = theArray.size();
- if(length) {
- aSeq->length(length);
- for(int i = 0; i<length; i++) aSeq[i] = theArray[i];
- }
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetIntArray(theID.c_str(), aSeq);
- }
-}
-
-//=======================================================================
-/*!
- * Function : GetIntArray
- * Purpose : Returns an array of int values associated with the ID
- */
-//=======================================================================
-vector<int> SALOMEDS_AttributeParameter::GetIntArray(const string& theID)
-{
- vector<int> v;
- if(_isLocal) {
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetIntArray(theID);
- }
- else {
- SALOMEDS::LongSeq_var aSeq = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetIntArray(theID.c_str());
- int length = aSeq->length();
- if(length) {
- v.resize(length);
- for(int i = 0; i < length; i++) v[i] = aSeq[i];
- }
- }
- return v;
-}
-
-//=======================================================================
-/*!
- * Function : SetStrArray
- * Purpose : Associates an array of string values with the given ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter::SetStrArray(const string& theID, const vector<string>& theArray)
-{
- CheckLocked();
-
- if(_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->SetStrArray(theID, theArray);
- }
- else {
- SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq;
- int length = theArray.size();
- if(length) {
- aSeq->length(length);
- for(int i = 0; i<length; i++) aSeq[i] = CORBA::string_dup(theArray[i].c_str());
- }
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetStrArray(theID.c_str(), aSeq);
- }
-}
-
-//=======================================================================
-/*!
- * Function : GetStrArray
- * Purpose : Returns an array of string values associated with the ID
- */
-//=======================================================================
-vector<string> SALOMEDS_AttributeParameter::GetStrArray(const string& theID)
-{
- vector<string> v;
- if(_isLocal) {
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetStrArray(theID);
- }
- else {
- SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetStrArray(theID.c_str());
- int length = aSeq->length();
- if(length) {
- v.resize(length);
- for(int i = 0; i < length; i++) v[i] = string(aSeq[i].in());
- }
- }
- return v;
-}
-
-
-//=======================================================================
-/*!
- * Function : IsSet
- * Purpose : Returns true if for the ID of given type was assigned \n
- * a value in the attribute
- */
-//=======================================================================
-bool SALOMEDS_AttributeParameter::IsSet(const string& theID, const int theType)
-{
- if(_isLocal) {
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->IsSet(theID, (Parameter_Types)theType);
- }
- else
- return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->IsSet(theID.c_str(), theType);
-}
-
-//=======================================================================
-/*!
- * Function : RemoveID
- * Purpose : Removes a parameter with given ID
- */
-//=======================================================================
-bool SALOMEDS_AttributeParameter::RemoveID(const string& theID, const int theType)
-{
- CheckLocked();
-
- if(_isLocal) {
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->RemoveID(theID, (Parameter_Types)theType);
- }
- else
- return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->RemoveID(theID.c_str(), theType);
-}
-
-//=======================================================================
-/*!
- * Function : GetFather
- * Purpose : Returns a father attribute for this attribute
- */
-//=======================================================================
-_PTR(AttributeParameter) SALOMEDS_AttributeParameter::GetFather()
-{
- SALOMEDSClient_AttributeParameter* AP = NULL;
- if(_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeParameter* AP_impl = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetFather();
- if(!AP_impl) return _PTR(AttributeParameter)(AP);
- AP = new SALOMEDS_AttributeParameter(AP_impl);
- }
- else {
- SALOMEDS::AttributeParameter_var AP_impl = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetFather();
- if(CORBA::is_nil(AP_impl)) return _PTR(AttributeParameter)(AP);
- AP = new SALOMEDS_AttributeParameter(AP_impl);
- }
-
- return _PTR(AttributeParameter)(AP);
-}
-
-//=======================================================================
-/*!
- * Function : HasFather
- * Purpose : Returns True if the attribute has a father attribute
- */
-//=======================================================================
-bool SALOMEDS_AttributeParameter::HasFather()
-{
- if(_isLocal) {
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->HasFather();
- }
- else
- return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->HasFather();
-}
-
-//=======================================================================
-/*!
- * Function : IsRoot
- * Purpose : Returns True is the attribute is highest in an hierachy
- */
-//=======================================================================
-bool SALOMEDS_AttributeParameter::IsRoot()
-{
- if(_isLocal) {
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->IsRoot();
- }
- else
- return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->IsRoot();
-}
-
-//=======================================================================
-/*!
- * Function : Clear
- * Purpose : Clears the content of the attribute
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter::Clear()
-{
- if(_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->Clear();
- }
- else
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->Clear();
-}
-
-//=======================================================================
-/*!
- * Function : GetIDs
- * Purpose : Returns an array of all ID's of the given type
- */
-//=======================================================================
-vector<string> SALOMEDS_AttributeParameter::GetIDs(const int theType)
-{
- vector<string> v;
- if(_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeParameter* AP_impl = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl);
- return AP_impl->GetIDs((Parameter_Types)theType);
- }
- else {
- SALOMEDS::AttributeParameter_var AP_impl = SALOMEDS::AttributeParameter::_narrow(_corba_impl);
- SALOMEDS::StringSeq_var CorbaSeq = AP_impl->GetIDs(theType);
- int length = CorbaSeq->length();
- if(length) {
- v.resize(length);
- for(int i = 0; i <length; i++) v[i] = string(CorbaSeq[i].in());
- }
- }
-
- return v;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeParameter.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeParameter_HeaderFile
-#define SALOMEDS_AttributeParameter_HeaderFile
-
-#include "SALOMEDSClient_AttributeParameter.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeParameter.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeParameter: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeParameter
-{
-public:
- SALOMEDS_AttributeParameter(SALOMEDSImpl_AttributeParameter* theAttr);
- SALOMEDS_AttributeParameter(SALOMEDS::AttributeParameter_ptr theAttr);
- ~SALOMEDS_AttributeParameter();
-
- virtual void SetInt(const std::string& theID, const int theValue);
- virtual int GetInt(const std::string& theID);
-
- virtual void SetReal(const std::string& theID, const double& theValue);
- virtual double GetReal(const std::string& theID);
-
- virtual void SetString(const std::string& theID, const std::string& theValue);
- virtual std::string GetString(const std::string& theID);
-
- virtual void SetBool(const std::string& theID, const bool& theValue);
- virtual bool GetBool(const std::string& theID);
-
- virtual void SetRealArray(const std::string& theID, const std::vector<double>& theArray);
- virtual std::vector<double> GetRealArray(const std::string& theID);
-
- virtual void SetIntArray(const std::string& theID, const std::vector<int>& theArray);
- virtual std::vector<int> GetIntArray(const std::string& theID);
-
- virtual void SetStrArray(const std::string& theID, const std::vector<std::string>& theArray);
- virtual std::vector<std::string> GetStrArray(const std::string& theID);
-
- virtual bool IsSet(const std::string& theID, const int theType);
-
- virtual bool RemoveID(const std::string& theID, const int theType);
-
- virtual _PTR(AttributeParameter) GetFather();
- virtual bool HasFather();
- virtual bool IsRoot();
-
- virtual void Clear();
-
- virtual std::vector<std::string> GetIDs(const int theType);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeParameter_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeParameter_i.hxx"
-#include "SALOMEDS.hxx"
-
-#include <vector>
-
-using namespace std;
-
-//=======================================================================
-/*!
- * Function : SetInt
- * Purpose : Associates a integer value with the ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetInt(const char* theID, CORBA::Long theValue)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->SetInt(theID, theValue);
-}
-
-//=======================================================================
-/*!
- * Function : GetInt
- * Purpose : Returns a int value associated with the given ID
- */
-//=======================================================================
-CORBA::Long SALOMEDS_AttributeParameter_i::GetInt(const char* theID)
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetInt(theID);
-}
-
-//=======================================================================
-/*!
- * Function : SetReal
- * Purpose : Associates a double value with the ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetReal(const char* theID, CORBA::Double theValue)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->SetReal(theID, theValue);
-}
-
-//=======================================================================
-/*!
- * Function : GetReal
- * Purpose : Returns a double value associated with the given ID
- */
-//=======================================================================
-CORBA::Double SALOMEDS_AttributeParameter_i::GetReal(const char* theID)
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetReal(theID);
-}
-
-//=======================================================================
-/*!
- * Function : SetString
- * Purpose : Associates a string with the ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetString(const char* theID, const char* theValue)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeParameter* impl = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl);
- impl->SetString(theID, theValue);
-}
-
-//=======================================================================
-/*!
- * Function : GetString
- * Purpose : Returns a string associated with the given ID
- */
-//=======================================================================
-char* SALOMEDS_AttributeParameter_i::GetString(const char* theID)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeParameter* impl = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl);
- CORBA::String_var c_s = CORBA::string_dup(impl->GetString(theID).c_str());
- return c_s._retn();
-}
-
-//=======================================================================
-/*!
- * Function : SetBool
- * Purpose : Associates a bool value with the ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetBool(const char* theID, CORBA::Boolean theValue)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->SetBool(theID, theValue);
-}
-
-//=======================================================================
-/*!
- * Function : GetBool
- * Purpose : Returns a bool value associated with the ID
- */
-//=======================================================================
-CORBA::Boolean SALOMEDS_AttributeParameter_i::GetBool(const char* theID)
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetBool(theID);
-}
-
-//=======================================================================
-/*!
- * Function : SetRealArray
- * Purpose : Associates an array of double values with the given ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetRealArray(const char* theID, const SALOMEDS::DoubleSeq& theArray)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- vector<double> v;
- int length = theArray.length();
- if(length) {
- v.resize(length);
- for(int i = 0; i<length; i++) v[i] = theArray[i];
- }
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->SetRealArray(theID, v);
-}
-
-//=======================================================================
-/*!
- * Function : GetRealArray
- * Purpose : Returns an array of double values associated with the ID
- */
-//=======================================================================
-SALOMEDS::DoubleSeq* SALOMEDS_AttributeParameter_i::GetRealArray(const char* theID)
-{
- SALOMEDS::Locker lock;
- SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq;
- vector<double> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetRealArray(theID);
- int length = v.size();
- if(length) {
- aSeq->length(length);
- for(int i = 0; i<length; i++) aSeq[i] = v[i];
- }
- return aSeq._retn();
-}
-
-//=======================================================================
-/*!
- * Function : SetIntArray
- * Purpose : Associates an array of int values with the given ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetIntArray(const char* theID, const SALOMEDS::LongSeq& theArray)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- vector<int> v;
- int length = theArray.length();
- if(length) {
- v.resize(length);
- for(int i = 0; i<length; i++) v[i] = theArray[i];
- }
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->SetIntArray(theID, v);
-}
-
-//=======================================================================
-/*!
- * Function : GetIntArray
- * Purpose : Returns an array of int values associated with the ID
- */
-//=======================================================================
-SALOMEDS::LongSeq* SALOMEDS_AttributeParameter_i::GetIntArray(const char* theID)
-{
- SALOMEDS::Locker lock;
- SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq;
- vector<int> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIntArray(theID);
- int length = v.size();
- if(length) {
- aSeq->length(length);
- for(int i = 0; i<length; i++) aSeq[i] = v[i];
- }
- return aSeq._retn();
-}
-
-//=======================================================================
-/*!
- * Function : SetStrArray
- * Purpose : Associates an array of string values with the given ID
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetStrArray(const char* theID, const SALOMEDS::StringSeq& theArray)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- vector<string> v;
- int length = theArray.length();
- if(length) {
- v.resize(length);
- for(int i = 0; i<length; i++) v[i] = string(theArray[i].in());
- }
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->SetStrArray(theID, v);
-}
-
-//=======================================================================
-/*!
- * Function : GetStrArray
- * Purpose : Returns an array of string values associated with the ID
- */
-//=======================================================================
-SALOMEDS::StringSeq* SALOMEDS_AttributeParameter_i::GetStrArray(const char* theID)
-{
- SALOMEDS::Locker lock;
- SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq;
- vector<string> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetStrArray(theID);
- int length = v.size();
- if(length) {
- aSeq->length(length);
- for(int i = 0; i<length; i++) aSeq[i] = CORBA::string_dup(v[i].c_str());
- }
- return aSeq._retn();
-}
-
-
-//=======================================================================
-/*!
- * Function : IsSet
- * Purpose : Returns true if for the ID of given type was assigned \n
- * a value in the attribute
- */
-//=======================================================================
-CORBA::Boolean SALOMEDS_AttributeParameter_i::IsSet(const char* theID, CORBA::Long theType)
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->IsSet(theID, (Parameter_Types)theType);
-}
-
-//=======================================================================
-/*!
- * Function : RemoveID
- * Purpose : Removes a parameter with given ID
- */
-//=======================================================================
-CORBA::Boolean SALOMEDS_AttributeParameter_i::RemoveID(const char* theID, CORBA::Long theType)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->RemoveID(theID, (Parameter_Types)theType);
-}
-
-//=======================================================================
-/*!
- * Function : GetFather
- * Purpose : Returns a father attribute for this attribute
- */
-//=======================================================================
-SALOMEDS::AttributeParameter_ptr SALOMEDS_AttributeParameter_i::GetFather()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeParameter* impl = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl);
- SALOMEDS_AttributeParameter_i* attr = new SALOMEDS_AttributeParameter_i(impl, _orb);
- return attr->AttributeParameter::_this();
-}
-
-//=======================================================================
-/*!
- * Function : HasFather
- * Purpose : Returns True if the attribute has a father attribute
- */
-//=======================================================================
-CORBA::Boolean SALOMEDS_AttributeParameter_i::HasFather()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->HasFather();
-}
-
-//=======================================================================
-/*!
- * Function : IsRoot
- * Purpose : Returns True is the attribute is highest in an hierachy
- */
-//=======================================================================
-CORBA::Boolean SALOMEDS_AttributeParameter_i::IsRoot()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->IsRoot();
-}
-
-//=======================================================================
-/*!
- * Function : IsRoot
- * Purpose : Clears the content of the attribute
- */
-//=======================================================================
-void SALOMEDS_AttributeParameter_i::Clear()
-{
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->Clear();
-}
-
-
-//=======================================================================
-/*!
- * Function : GetIDs
- * Purpose : Returns an array of all ID's of the given type
- */
-//=======================================================================
-SALOMEDS::StringSeq* SALOMEDS_AttributeParameter_i::GetIDs(CORBA::Long theType)
-{
- SALOMEDS::Locker lock;
- SALOMEDS::StringSeq_var CorbaSeq = new SALOMEDS::StringSeq;
- vector<string> A = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIDs((Parameter_Types)theType);
-
- if(A.size()) {
- int length = A.size();
- CorbaSeq->length(length);
- for (int i = 0; i < length; i++) CorbaSeq[i] = CORBA::string_dup(A[i].c_str());;
- }
-
- return CorbaSeq._retn();
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeParameter_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDS_AttributeParameter_i_HeaderFile
-#define SALOMEDS_AttributeParameter_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeParameter.hxx"
-
-/*!
- Class: SALOMEDS_AttributeParameter
- Description : AttributeParameter is a universal container of basic types
-*/
-
-class SALOMEDS_AttributeParameter_i: public virtual POA_SALOMEDS::AttributeParameter,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributeParameter_i(SALOMEDSImpl_AttributeParameter* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeParameter_i() {};
-
-
- virtual void SetInt(const char* theID, CORBA::Long theValue);
- virtual CORBA::Long GetInt(const char* theID);
-
- virtual void SetReal(const char* theID, CORBA::Double theValue);
- virtual CORBA::Double GetReal(const char* theID);
-
- virtual void SetString(const char* theID, const char* theValue);
- virtual char* GetString(const char* theID);
-
- virtual void SetBool(const char* theID, CORBA::Boolean theValue);
- virtual CORBA::Boolean GetBool(const char* theID);
-
- virtual void SetRealArray(const char* theID, const SALOMEDS::DoubleSeq& theArray);
- virtual SALOMEDS::DoubleSeq* GetRealArray(const char* theID);
-
- virtual void SetIntArray(const char* theID, const SALOMEDS::LongSeq& theArray);
- virtual SALOMEDS::LongSeq* GetIntArray(const char* theID);
-
- virtual void SetStrArray(const char* theID, const SALOMEDS::StringSeq& theArray);
- virtual SALOMEDS::StringSeq* GetStrArray(const char* theID);
-
- virtual CORBA::Boolean IsSet(const char* theID, CORBA::Long theType);
-
- virtual CORBA::Boolean RemoveID(const char* theID, CORBA::Long theType);
-
- virtual SALOMEDS::AttributeParameter_ptr GetFather();
- virtual CORBA::Boolean HasFather();
- virtual CORBA::Boolean IsRoot();
-
- virtual void Clear();
-
- virtual SALOMEDS::StringSeq* GetIDs(CORBA::Long theType);
-
-};
-
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributePersistentRef.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributePersistentRef.hxx"
-#include "SALOMEDS.hxx"
-
-#include <string>
-
-SALOMEDS_AttributePersistentRef::SALOMEDS_AttributePersistentRef(SALOMEDSImpl_AttributePersistentRef* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributePersistentRef::SALOMEDS_AttributePersistentRef(SALOMEDS::AttributePersistentRef_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributePersistentRef::~SALOMEDS_AttributePersistentRef()
-{}
-
-std::string SALOMEDS_AttributePersistentRef::Value()
-{
- std::string aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributePersistentRef*>(_local_impl)->Value();
- }
- else aValue = SALOMEDS::AttributePersistentRef::_narrow(_corba_impl)->Value();
- return aValue;
-}
-
-void SALOMEDS_AttributePersistentRef::SetValue(const std::string& value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributePersistentRef*>(_local_impl)->SetValue(value);
- }
- else SALOMEDS::AttributePersistentRef::_narrow(_corba_impl)->SetValue(value.c_str());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributePersistentRef.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributePersistentRef_HeaderFile
-#define SALOMEDS_AttributePersistentRef_HeaderFile
-
-#include "SALOMEDSClient_AttributePersistentRef.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributePersistentRef.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributePersistentRef: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributePersistentRef
-{
-public:
- SALOMEDS_AttributePersistentRef(SALOMEDSImpl_AttributePersistentRef* theAttr);
- SALOMEDS_AttributePersistentRef(SALOMEDS::AttributePersistentRef_ptr theAttr);
- ~SALOMEDS_AttributePersistentRef();
-
- virtual std::string Value();
- virtual void SetValue(const std::string& value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributePersistentRef_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributePersistentRef_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-char* SALOMEDS_AttributePersistentRef_i::Value()
-{
- SALOMEDS::Locker lock;
- CORBA::String_var c_s =
- CORBA::string_dup(dynamic_cast<SALOMEDSImpl_AttributePersistentRef*>(_impl)->Value().c_str());
- return c_s._retn();
-}
-
-void SALOMEDS_AttributePersistentRef_i::SetValue(const char* value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- CORBA::String_var Str = CORBA::string_dup(value);
- dynamic_cast<SALOMEDSImpl_AttributePersistentRef*>(_impl)->SetValue(string(Str));
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributePersistentRef_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributePersistentRef_i_HeaderFile
-#define SALOMEDS_AttributePersistentRef_i_HeaderFile
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributePersistentRef.hxx"
-
-class SALOMEDS_AttributePersistentRef_i: public virtual POA_SALOMEDS::AttributePersistentRef,
- public virtual SALOMEDS_GenericAttribute_i {
-public:
-
- SALOMEDS_AttributePersistentRef_i(SALOMEDSImpl_AttributePersistentRef* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributePersistentRef_i() {};
-
- char* Value();
- void SetValue(const char* value);
-
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributePixMap.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributePixMap.hxx"
-#include "SALOMEDS.hxx"
-
-#include <string>
-
-SALOMEDS_AttributePixMap::SALOMEDS_AttributePixMap(SALOMEDSImpl_AttributePixMap* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributePixMap::SALOMEDS_AttributePixMap(SALOMEDS::AttributePixMap_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributePixMap::~SALOMEDS_AttributePixMap()
-{}
-
-bool SALOMEDS_AttributePixMap::HasPixMap()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = dynamic_cast<SALOMEDSImpl_AttributePixMap*>(_local_impl)->HasPixMap();
- }
- else ret = SALOMEDS::AttributePixMap::_narrow(_corba_impl)->HasPixMap();
- return ret;
-}
-
-std::string SALOMEDS_AttributePixMap::GetPixMap()
-{
- std::string aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributePixMap*>(_local_impl)->GetPixMap();
- }
- else aValue = SALOMEDS::AttributePixMap::_narrow(_corba_impl)->GetPixMap();
- return aValue;
-}
-
-void SALOMEDS_AttributePixMap::SetPixMap(const std::string& value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributePixMap*>(_local_impl)->SetPixMap(value);
- }
- else SALOMEDS::AttributePixMap::_narrow(_corba_impl)->SetPixMap(value.c_str());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributePixMap.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributePixMap_HeaderFile
-#define SALOMEDS_AttributePixMap_HeaderFile
-
-#include "SALOMEDSClient_AttributePixMap.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributePixMap.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributePixMap: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributePixMap
-{
-public:
- SALOMEDS_AttributePixMap(SALOMEDSImpl_AttributePixMap* theAttr);
- SALOMEDS_AttributePixMap(SALOMEDS::AttributePixMap_ptr theAttr);
- ~SALOMEDS_AttributePixMap();
-
- virtual bool HasPixMap();
- virtual std::string GetPixMap();
- virtual void SetPixMap(const std::string& value);
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributePixMap_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributePixMap_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-CORBA::Boolean SALOMEDS_AttributePixMap_i::HasPixMap()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributePixMap*>(_impl)->HasPixMap();
-}
-
-char* SALOMEDS_AttributePixMap_i::GetPixMap()
-{
- SALOMEDS::Locker lock;
- CORBA::String_var S =
- CORBA::string_dup(dynamic_cast<SALOMEDSImpl_AttributePixMap*>(_impl)->GetPixMap().c_str());
- return S._retn();
-}
-
-void SALOMEDS_AttributePixMap_i::SetPixMap(const char* value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- CORBA::String_var Str = CORBA::string_dup(value);
- dynamic_cast<SALOMEDSImpl_AttributePixMap*>(_impl)->SetPixMap(string(Str));
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributePixMap_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributePixMap_i_HeaderFile
-#define SALOMEDS_AttributePixMap_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributePixMap.hxx"
-
-class SALOMEDS_AttributePixMap_i: public virtual POA_SALOMEDS::AttributePixMap,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributePixMap_i(SALOMEDSImpl_AttributePixMap* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributePixMap_i() {};
-
- CORBA::Boolean HasPixMap();
- char* GetPixMap();
- void SetPixMap(const char* value);
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributePythonObject.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributePythonObject.hxx"
-#include "SALOMEDS.hxx"
-
-#include <string>
-
-SALOMEDS_AttributePythonObject::SALOMEDS_AttributePythonObject(SALOMEDSImpl_AttributePythonObject* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributePythonObject::SALOMEDS_AttributePythonObject(SALOMEDS::AttributePythonObject_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributePythonObject::~SALOMEDS_AttributePythonObject()
-{}
-
-bool SALOMEDS_AttributePythonObject::IsScript()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(_local_impl)->IsScript();
- }
- else ret = SALOMEDS::AttributePythonObject::_narrow(_corba_impl)->IsScript();
- return ret;
-}
-
-std::string SALOMEDS_AttributePythonObject::GetObject()
-{
- std::string aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(_local_impl)->GetObject().c_str();
- }
- else aValue = SALOMEDS::AttributePythonObject::_narrow(_corba_impl)->GetObject();
- return aValue;
-}
-
-void SALOMEDS_AttributePythonObject::SetObject(const std::string& theSequence, bool IsScript)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(_local_impl)->SetObject(theSequence, IsScript);
- }
- else SALOMEDS::AttributePythonObject::_narrow(_corba_impl)->SetObject(theSequence.c_str(), IsScript);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributePythonObject.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributePythonObject_HeaderFile
-#define SALOMEDS_AttributePythonObject_HeaderFile
-
-#include "SALOMEDSClient_AttributePythonObject.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributePythonObject.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributePythonObject: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributePythonObject
-{
-public:
- SALOMEDS_AttributePythonObject(SALOMEDSImpl_AttributePythonObject* theAttr);
- SALOMEDS_AttributePythonObject(SALOMEDS::AttributePythonObject_ptr theAttr);
- ~SALOMEDS_AttributePythonObject();
-
- virtual void SetObject(const std::string& theSequence, bool IsScript);
- virtual std::string GetObject();
- virtual bool IsScript();
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributePythonObject_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributePythonObject_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-void SALOMEDS_AttributePythonObject_i::SetObject(const char* theSequence, CORBA::Boolean IsScript)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- char *aSeq = CORBA::string_dup(theSequence);
- dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(_impl)->SetObject(aSeq, IsScript);
-}
-
-char* SALOMEDS_AttributePythonObject_i::GetObject()
-{
- SALOMEDS::Locker lock;
- string aSeq(dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(_impl)->GetObject());
- CORBA::String_var aStr = CORBA::string_dup(aSeq.c_str());
- return aStr._retn();
-}
-
-CORBA::Boolean SALOMEDS_AttributePythonObject_i::IsScript()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(_impl)->IsScript();
-}
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributePythonObject_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributePythonObject_i_HeaderFile
-#define SALOMEDS_AttributePythonObject_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributePythonObject.hxx"
-
-class SALOMEDS_AttributePythonObject_i: public virtual POA_SALOMEDS::AttributePythonObject,
- public virtual SALOMEDS_GenericAttribute_i {
-public:
-
- SALOMEDS_AttributePythonObject_i(SALOMEDSImpl_AttributePythonObject* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributePythonObject_i() {};
-
- virtual void SetObject(const char* theSequence, CORBA::Boolean IsScript);
- virtual char* GetObject();
- virtual CORBA::Boolean IsScript();
-
-};
-
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeReal.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeReal.hxx"
-#include "SALOMEDS.hxx"
-
-SALOMEDS_AttributeReal::SALOMEDS_AttributeReal(SALOMEDSImpl_AttributeReal* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeReal::SALOMEDS_AttributeReal(SALOMEDS::AttributeReal_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeReal::~SALOMEDS_AttributeReal()
-{}
-
-double SALOMEDS_AttributeReal::Value()
-{
- double aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeReal*>(_local_impl)->Value();
- }
- else aValue = SALOMEDS::AttributeReal::_narrow(_corba_impl)->Value();
- return aValue;
-}
-
-void SALOMEDS_AttributeReal::SetValue(double value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeReal*>(_local_impl)->SetValue(value);
- }
- else SALOMEDS::AttributeReal::_narrow(_corba_impl)->SetValue(value);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeReal.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeReal_HeaderFile
-#define SALOMEDS_AttributeReal_HeaderFile
-
-#include "SALOMEDSClient_AttributeReal.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeReal.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeReal: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeReal
-{
-public:
- SALOMEDS_AttributeReal(SALOMEDSImpl_AttributeReal* theAttr);
- SALOMEDS_AttributeReal(SALOMEDS::AttributeReal_ptr theAttr);
- ~SALOMEDS_AttributeReal();
-
- virtual double Value();
- virtual void SetValue(double value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeReal_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeReal_i.hxx"
-#include "SALOMEDS_SObject_i.hxx"
-#include "SALOMEDS.hxx"
-#include <sstream>
-
-using namespace std;
-
-CORBA::Double SALOMEDS_AttributeReal_i::Value()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeReal*>(_impl)->Value();
-}
-
-void SALOMEDS_AttributeReal_i::SetValue(CORBA::Double value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeReal*>(_impl)->SetValue(value);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeReal_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeReal_i_HeaderFile
-#define SALOMEDS_AttributeReal_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeReal.hxx"
-
-class SALOMEDS_AttributeReal_i: public virtual POA_SALOMEDS::AttributeReal,
- public virtual SALOMEDS_GenericAttribute_i {
-public:
-
- SALOMEDS_AttributeReal_i(SALOMEDSImpl_AttributeReal* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeReal_i() {};
-
- CORBA::Double Value();
- void SetValue(CORBA::Double value);
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeSelectable.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeSelectable.hxx"
-#include "SALOMEDS.hxx"
-
-SALOMEDS_AttributeSelectable::SALOMEDS_AttributeSelectable(SALOMEDSImpl_AttributeSelectable* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeSelectable::SALOMEDS_AttributeSelectable(SALOMEDS::AttributeSelectable_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeSelectable::~SALOMEDS_AttributeSelectable()
-{}
-
-bool SALOMEDS_AttributeSelectable::IsSelectable()
-{
- bool aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = (bool)dynamic_cast<SALOMEDSImpl_AttributeSelectable*>(_local_impl)->IsSelectable();
- }
- else aValue = SALOMEDS::AttributeSelectable::_narrow(_corba_impl)->IsSelectable();
- return aValue;
-}
-
-void SALOMEDS_AttributeSelectable::SetSelectable(bool value)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeSelectable*>(_local_impl)->SetSelectable((int)value);
- }
- else SALOMEDS::AttributeSelectable::_narrow(_corba_impl)->SetSelectable(value);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeSelectable.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeSelectable_HeaderFile
-#define SALOMEDS_AttributeSelectable_HeaderFile
-
-#include "SALOMEDSClient_AttributeSelectable.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeSelectable.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeSelectable: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeSelectable
-{
-public:
- SALOMEDS_AttributeSelectable(SALOMEDSImpl_AttributeSelectable* theAttr);
- SALOMEDS_AttributeSelectable(SALOMEDS::AttributeSelectable_ptr theAttr);
- ~SALOMEDS_AttributeSelectable();
-
- virtual bool IsSelectable();
- virtual void SetSelectable(bool value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeSelectable_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeSelectable_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-CORBA::Boolean SALOMEDS_AttributeSelectable_i::IsSelectable()
-{
- SALOMEDS::Locker lock;
- return (dynamic_cast<SALOMEDSImpl_AttributeSelectable*>(_impl)->IsSelectable() == 1);
-}
-
-void SALOMEDS_AttributeSelectable_i::SetSelectable(CORBA::Boolean value)
-{
- SALOMEDS::Locker lock;
- int val = 0;
- if (value != 0) val = 1;
- dynamic_cast<SALOMEDSImpl_AttributeSelectable*>(_impl)->SetSelectable(val);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeSelectable_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeSelectable_i_HeaderFile
-#define SALOMEDS_AttributeSelectable_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeSelectable.hxx"
-
-class SALOMEDS_AttributeSelectable_i: public virtual POA_SALOMEDS::AttributeSelectable,
- public virtual SALOMEDS_GenericAttribute_i {
-public:
-
- SALOMEDS_AttributeSelectable_i(SALOMEDSImpl_AttributeSelectable* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeSelectable_i() {};
-
- CORBA::Boolean IsSelectable();
- void SetSelectable(CORBA::Boolean value);
-
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeSequenceOfInteger.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeSequenceOfInteger.hxx"
-#include "SALOMEDS.hxx"
-
-SALOMEDS_AttributeSequenceOfInteger::SALOMEDS_AttributeSequenceOfInteger
- (SALOMEDSImpl_AttributeSequenceOfInteger* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeSequenceOfInteger::SALOMEDS_AttributeSequenceOfInteger
- (SALOMEDS::AttributeSequenceOfInteger_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeSequenceOfInteger::~SALOMEDS_AttributeSequenceOfInteger()
-{}
-
-void SALOMEDS_AttributeSequenceOfInteger::Assign(const std::vector<int>& other)
-{
- int i, aLength = other.size();
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl)->Assign(other);
- }
- else {
- SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = other[i];
- SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->Assign(aSeq);
- }
-}
-
-std::vector<int> SALOMEDS_AttributeSequenceOfInteger::CorbaSequence()
-{
- std::vector<int> aVector;
- int i, aLength;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeSequenceOfInteger* aSeqAttr;
- aSeqAttr = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl);
- aLength = aSeqAttr->Length();
- for (i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i));
- }
- else {
- SALOMEDS::AttributeSequenceOfInteger_var aSeqAttr =
- SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl);
- aLength = aSeqAttr->Length();
- for (i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i));
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeSequenceOfInteger::Add(int value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl)->Add(value);
- }
- else SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->Add(value);
-}
-
-void SALOMEDS_AttributeSequenceOfInteger::Remove(int index)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl)->Remove(index);
- }
- else SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->Remove(index);
-}
-
-void SALOMEDS_AttributeSequenceOfInteger::ChangeValue(int index, int value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl)->ChangeValue(index, value);
- }
- else SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->ChangeValue(index, value);
-}
-
-int SALOMEDS_AttributeSequenceOfInteger::Value(int index)
-{
- int aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl)->Value(index);
- }
- else aValue = SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->Value(index);
- return aValue;
-}
-
-int SALOMEDS_AttributeSequenceOfInteger::Length()
-{
- int aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl)-> Length();
- }
- else aValue = SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)-> Length();
- return aValue;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeSequenceOfInteger.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeSequenceOfInteger_HeaderFile
-#define SALOMEDS_AttributeSequenceOfInteger_HeaderFile
-
-#include "SALOMEDSClient_AttributeSequenceOfInteger.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include <vector>
-
-class SALOMEDS_AttributeSequenceOfInteger: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeSequenceOfInteger
-{
-public:
- SALOMEDS_AttributeSequenceOfInteger(SALOMEDSImpl_AttributeSequenceOfInteger* theAttr);
- SALOMEDS_AttributeSequenceOfInteger(SALOMEDS::AttributeSequenceOfInteger_ptr theAttr);
- ~SALOMEDS_AttributeSequenceOfInteger();
-
- virtual void Assign(const std::vector<int>& other);
- virtual std::vector<int> CorbaSequence();
- virtual void Add(int value);
- virtual void Remove(int index);
- virtual void ChangeValue(int index, int value);
- virtual int Value(int index);
- virtual int Length();
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeSequenceOfInteger_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeSequenceOfInteger_i.hxx"
-#include "SALOMEDS.hxx"
-#include <vector>
-
-
-using namespace std;
-
-
-void SALOMEDS_AttributeSequenceOfInteger_i::Assign(const SALOMEDS::LongSeq& other)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- vector<int> aSeq;
- for(int i = 0, len = other.length(); i<len; i++) aSeq.push_back(other[i]);
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_impl)->Assign(aSeq);
-}
-
-SALOMEDS::LongSeq* SALOMEDS_AttributeSequenceOfInteger_i::CorbaSequence()
-{
- SALOMEDS::Locker lock;
- SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- const vector<int>& CasCadeSeq = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_impl)->Array();
- int len = CasCadeSeq.size();
- CorbaSeq->length(len);
- for (int i = 0; i < len; i++) {
- CorbaSeq[i] = CasCadeSeq[i];
- }
- return CorbaSeq._retn();
-}
-
-void SALOMEDS_AttributeSequenceOfInteger_i::Add(CORBA::Long value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_impl)->Add(value);
-}
-
-void SALOMEDS_AttributeSequenceOfInteger_i::Remove(CORBA::Long index)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_impl)->Remove(index);
-}
-
-void SALOMEDS_AttributeSequenceOfInteger_i::ChangeValue(CORBA::Long index, CORBA::Long value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_impl)->ChangeValue(index, value);
-}
-
-CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Value(CORBA::Short index)
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_impl)->Value(index);
-}
-
-CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Length()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_impl)->Length();
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeSequenceOfInteger_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeSequenceOfInteger_i_HeaderFile
-#define SALOMEDS_AttributeSequenceOfInteger_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx"
-
-class SALOMEDS_AttributeSequenceOfInteger_i: public virtual POA_SALOMEDS::AttributeSequenceOfInteger,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributeSequenceOfInteger_i(SALOMEDSImpl_AttributeSequenceOfInteger* theAttr,CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeSequenceOfInteger_i() {};
-
- void Assign(const SALOMEDS::LongSeq& other);
- SALOMEDS::LongSeq* CorbaSequence();
- void Add(CORBA::Long value);
- void Remove(CORBA::Long index);
- void ChangeValue(CORBA::Long index, CORBA::Long value);
- CORBA::Long Value(CORBA::Short index);
- CORBA::Long Length();
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeSequenceOfReal.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeSequenceOfReal.hxx"
-#include "SALOMEDS.hxx"
-
-SALOMEDS_AttributeSequenceOfReal::SALOMEDS_AttributeSequenceOfReal
- (SALOMEDSImpl_AttributeSequenceOfReal* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeSequenceOfReal::SALOMEDS_AttributeSequenceOfReal
- (SALOMEDS::AttributeSequenceOfReal_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeSequenceOfReal::~SALOMEDS_AttributeSequenceOfReal()
-{}
-
-void SALOMEDS_AttributeSequenceOfReal::Assign(const std::vector<double>& other)
-{
- int i, aLength = other.size();
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_local_impl)->Assign(other);
- }
- else {
- SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = other[i];
- SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)->Assign(aSeq);
- }
-}
-
-std::vector<double> SALOMEDS_AttributeSequenceOfReal::CorbaSequence()
-{
- std::vector<double> aVector;
- int i, aLength;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeSequenceOfReal* aSeqAttr = NULL;
- aSeqAttr = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_local_impl);
- aLength = aSeqAttr->Length();
- for (i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i));
- }
- else {
- SALOMEDS::AttributeSequenceOfReal_var aSeqAttr = SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl);
- aLength = aSeqAttr->Length();
- for (i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i));
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeSequenceOfReal::Add(double value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_local_impl)->Add(value);
- }
- else SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)->Add(value);
-}
-
-void SALOMEDS_AttributeSequenceOfReal::Remove(int index)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_local_impl)->Remove(index);
- }
- else SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)->Remove(index);
-}
-
-void SALOMEDS_AttributeSequenceOfReal::ChangeValue(int index, double value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_local_impl)->ChangeValue(index, value);
- }
- else SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)->ChangeValue(index, value);
-}
-
-double SALOMEDS_AttributeSequenceOfReal::Value(int index)
-{
- double aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_local_impl)->Value(index);
- }
- else aValue = SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)->Value(index);
- return aValue;
-}
-
-int SALOMEDS_AttributeSequenceOfReal::Length()
-{
- int aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_local_impl)-> Length();
- }
- else aValue = SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)-> Length();
- return aValue;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeSequenceOfReal.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeSequenceOfReal_HeaderFile
-#define SALOMEDS_AttributeSequenceOfReal_HeaderFile
-
-#include "SALOMEDSClient_AttributeSequenceOfReal.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeSequenceOfReal.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include <vector>
-
-class SALOMEDS_AttributeSequenceOfReal: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeSequenceOfReal
-{
-public:
- SALOMEDS_AttributeSequenceOfReal(SALOMEDSImpl_AttributeSequenceOfReal* theAttr);
- SALOMEDS_AttributeSequenceOfReal(SALOMEDS::AttributeSequenceOfReal_ptr theAttr);
- ~SALOMEDS_AttributeSequenceOfReal();
-
- virtual void Assign(const std::vector<double>& other);
- virtual std::vector<double> CorbaSequence();
- virtual void Add(double value);
- virtual void Remove(int index);
- virtual void ChangeValue(int index, double value);
- virtual double Value(int index);
- virtual int Length();
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeSequenceOfReal_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeSequenceOfReal_i.hxx"
-#include "SALOMEDS.hxx"
-#include <vector>
-
-using namespace std;
-
-void SALOMEDS_AttributeSequenceOfReal_i::Assign(const SALOMEDS::DoubleSeq& other)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- vector<double> CasCadeSeq;
- for (int i = 0; i < other.length(); i++) {
- CasCadeSeq.push_back(other[i]);
- }
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->Assign(CasCadeSeq);
-}
-
-SALOMEDS::DoubleSeq* SALOMEDS_AttributeSequenceOfReal_i::CorbaSequence()
-{
- SALOMEDS::Locker lock;
- SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq;
- const vector<double>& CasCadeSeq = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->Array();
- int len = CasCadeSeq.size();
- CorbaSeq->length(len);
- for (int i = 0; i < len; i++) {
- CorbaSeq[i] = CasCadeSeq[i];
- }
- return CorbaSeq._retn();
-}
-
-void SALOMEDS_AttributeSequenceOfReal_i::Add(CORBA::Double value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->Add(value);
-}
-
-void SALOMEDS_AttributeSequenceOfReal_i::Remove(CORBA::Long index)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->Remove(index);
-}
-
-void SALOMEDS_AttributeSequenceOfReal_i::ChangeValue(CORBA::Long index, CORBA::Double value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->ChangeValue(index, value);
-}
-
-CORBA::Double SALOMEDS_AttributeSequenceOfReal_i::Value(CORBA::Short index)
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->Value(index);
-}
-
-CORBA::Long SALOMEDS_AttributeSequenceOfReal_i::Length()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->Length();
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeSequenceOfSequenceOfReal_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeSequenceOfSequenceOfReal_i_HeaderFile
-#define SALOMEDS_AttributeSequenceOfSequenceOfReal_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeSequenceOfReal.hxx"
-
-class SALOMEDS_AttributeSequenceOfReal_i: public virtual POA_SALOMEDS::AttributeSequenceOfReal,
- public virtual SALOMEDS_GenericAttribute_i {
-public:
-
- SALOMEDS_AttributeSequenceOfReal_i(SALOMEDSImpl_AttributeSequenceOfReal* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeSequenceOfReal_i() {};
-
- void Assign(const SALOMEDS::DoubleSeq& other);
- SALOMEDS::DoubleSeq* CorbaSequence();
- void Add(CORBA::Double value);
- void Remove(CORBA::Long index);
- void ChangeValue(CORBA::Long index, CORBA::Double value);
- CORBA::Double Value(CORBA::Short index);
- CORBA::Long Length();
-
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeString.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeString.hxx"
-#include "SALOMEDS.hxx"
-
-#include <string>
-
-SALOMEDS_AttributeString::SALOMEDS_AttributeString(SALOMEDSImpl_AttributeString* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeString::SALOMEDS_AttributeString(SALOMEDS::AttributeString_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeString::~SALOMEDS_AttributeString()
-{}
-
-std::string SALOMEDS_AttributeString::Value()
-{
- std::string aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = dynamic_cast<SALOMEDSImpl_AttributeString*>(_local_impl)->Value();
- }
- else aValue = SALOMEDS::AttributeString::_narrow(_corba_impl)->Value();
- return aValue;
-}
-
-void SALOMEDS_AttributeString::SetValue(const std::string& value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeString*>(_local_impl)->SetValue(value);
- }
- else SALOMEDS::AttributeString::_narrow(_corba_impl)->SetValue(value.c_str());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeString.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeString_HeaderFile
-#define SALOMEDS_AttributeString_HeaderFile
-
-#include "SALOMEDSClient_AttributeString.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeString.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeString: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeString
-{
-public:
- SALOMEDS_AttributeString(SALOMEDSImpl_AttributeString* theAttr);
- SALOMEDS_AttributeString(SALOMEDS::AttributeString_ptr theAttr);
- ~SALOMEDS_AttributeString();
-
- virtual std::string Value();
- virtual void SetValue(const std::string& value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeString_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeString_i.hxx"
-
-#include "SALOMEDS_SObject_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-char* SALOMEDS_AttributeString_i::Value()
-{
- SALOMEDS::Locker lock;
-
- CORBA::String_var c_s =
- CORBA::string_dup(dynamic_cast<SALOMEDSImpl_AttributeString*>(_impl)->Value().c_str());
- return c_s._retn();
-}
-
-void SALOMEDS_AttributeString_i::SetValue(const char* value)
-{
- SALOMEDS::Locker lock;
-
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeString*>(_impl)->SetValue(string(value));
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeString_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeString_i_HeaderFile
-#define SALOMEDS_AttributeString_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeString.hxx"
-
-class SALOMEDS_AttributeString_i: public virtual POA_SALOMEDS::AttributeString,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
- SALOMEDS_AttributeString_i(SALOMEDSImpl_AttributeString* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- virtual ~SALOMEDS_AttributeString_i() {};
-
- char* Value();
- void SetValue(const char* value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeStudyProperties.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeStudyProperties.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-SALOMEDS_AttributeStudyProperties::SALOMEDS_AttributeStudyProperties
- (SALOMEDSImpl_AttributeStudyProperties* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeStudyProperties::SALOMEDS_AttributeStudyProperties
- (SALOMEDS::AttributeStudyProperties_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeStudyProperties::~SALOMEDS_AttributeStudyProperties()
-{
-}
-
-void SALOMEDS_AttributeStudyProperties::SetUserName(const std::string& theName)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeStudyProperties* anImpl =
- dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl);
- anImpl->ChangeCreatorName(theName);
- } else
- SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetUserName(theName.c_str());
-}
-
-std::string SALOMEDS_AttributeStudyProperties::GetUserName()
-{
- std::string aName;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aName = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->GetCreatorName();
- }
-#ifndef WIN32
- else aName = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetUserName();
-#else
- else aName = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetUserNameA();
-#endif
- return aName;
-}
-
-void SALOMEDS_AttributeStudyProperties::SetCreationDate
- (int theMinute, int theHour, int theDay, int theMonth, int theYear)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeStudyProperties* anImpl =
- dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl);
- int aTmp;
- if (anImpl->GetCreationDate(aTmp, aTmp, aTmp, aTmp, aTmp)) return;
- string S;
- anImpl->SetModification(S, theMinute, theHour, theDay, theMonth, theYear);
- } else {
- SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetCreationDate(theMinute,
- theHour,
- theDay,
- theMonth,
- theYear);
- }
-}
-
-bool SALOMEDS_AttributeStudyProperties::GetCreationDate(int& theMinute,
- int& theHour,
- int& theDay,
- int& theMonth,
- int& theYear)
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>
- (_local_impl)->GetCreationDate(theMinute, theHour, theDay, theMonth, theYear);
- } else {
- CORBA::Long aMinute, anHour, aDay, aMonth, anYear;
- ret = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetCreationDate(aMinute,
- anHour,
- aDay,
- aMonth,
- anYear);
- theMinute = (int)aMinute;
- theHour = (int)anHour;
- theDay = (int)aDay;
- theMonth = (int)aMonth;
- theYear = (int)anYear;
- }
- return ret;
-}
-
-void SALOMEDS_AttributeStudyProperties::SetCreationMode(const std::string& theMode)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- if (theMode == "from scratch")
- dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->SetCreationMode(1);
- else if (theMode == "copy from")
- dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->SetCreationMode(2);
- else //Not defined
- dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->SetCreationMode(0);
- }
- else SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetCreationMode(theMode.c_str());
-}
-
-std::string SALOMEDS_AttributeStudyProperties::GetCreationMode()
-{
- std::string aMode;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- int mode = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->GetCreationMode();
- if (mode == 1) aMode = "from scratch";
- if (mode == 2) aMode = "copy from";
- }
- else
- aMode = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetCreationMode();
- return aMode;
-}
-
-void SALOMEDS_AttributeStudyProperties::SetModified(int theModified)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->SetModified(theModified);
- }
- else
- SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetModified(theModified);
-}
-
-bool SALOMEDS_AttributeStudyProperties::IsModified()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->IsModified();
- }
- else
- ret = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->IsModified();
- return ret;
-}
-
-int SALOMEDS_AttributeStudyProperties::GetModified()
-{
- int isModified;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- isModified = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->GetModified();
- }
- else
- isModified = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetModified();
- return isModified;
-}
-
-void SALOMEDS_AttributeStudyProperties::SetLocked(bool theLocked)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->SetLocked(theLocked);
- }
- else
- SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetLocked(theLocked);
-}
-
-bool SALOMEDS_AttributeStudyProperties::IsLocked()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->IsLocked();
- }
- else
- ret = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->IsLocked();
- return ret;
-}
-
-void SALOMEDS_AttributeStudyProperties::SetModification(const std::string& theName,
- int theMinute,
- int theHour,
- int theDay,
- int theMonth,
- int theYear)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeStudyProperties* anImpl = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl);
- anImpl->SetModification(theName, theMinute, theHour, theDay, theMonth, theYear);
- } else
- SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetModification(theName.c_str(),
- theMinute,
- theHour,
- theDay,
- theMonth,
- theYear);
-}
-
-void SALOMEDS_AttributeStudyProperties::GetModificationsList(std::vector<std::string>& theNames,
- std::vector<int>& theMinutes,
- std::vector<int>& theHours,
- std::vector<int>& theDays,
- std::vector<int>& theMonths,
- std::vector<int>& theYears,
- bool theWithCreator)
-{
- int i, aLength;
-
- if (_isLocal) {
- SALOMEDS::Locker lock;
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
- SALOMEDSImpl_AttributeStudyProperties* anImpl = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl);
- anImpl->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
- aLength = aNames.size();
- i = ((theWithCreator) ? 1 : 2);
- for (; i <= aLength; i++) {
- theNames.push_back(aNames[i-1]);
- theMinutes.push_back(aMinutes[i-1]);
- theHours.push_back(aHours[i-1]);
- theDays.push_back(aDays[i-1]);
- theMonths.push_back(aMonths[i-1]);
- theYears.push_back(aYears[i-1]);
- }
- } else {
- SALOMEDS::StringSeq_var aNames;
- SALOMEDS::LongSeq_var aMinutes, aHours, aDays, aMonths, aYears;
- SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetModificationsList(aNames.out(),
- aMinutes.out(),
- aHours.out(),
- aDays.out(),
- aMonths.out(),
- aYears.out(),
- theWithCreator);
- aLength = aNames->length();
- for (i = 0; i<aLength; i++) {
- theNames.push_back(aNames[i].in());
- theMinutes.push_back(aMinutes[i]);
- theHours.push_back(aHours[i]);
- theDays.push_back(aDays[i]);
- theMonths.push_back(aMonths[i]);
- theYears.push_back(aYears[i]);
- }
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeStudyProperties.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeStudyProperties_HeaderFile
-#define SALOMEDS_AttributeStudyProperties_HeaderFile
-
-#include "SALOMEDSClient_AttributeStudyProperties.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
-
-#include <vector>
-#include <string>
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#ifdef GetUserName
-#undef GetUserName
-#endif
-
-class Standard_EXPORT SALOMEDS_AttributeStudyProperties: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeStudyProperties
-{
-public:
-
- SALOMEDS_AttributeStudyProperties(SALOMEDSImpl_AttributeStudyProperties* theAttr);
- SALOMEDS_AttributeStudyProperties(SALOMEDS::AttributeStudyProperties_ptr theAttr);
- ~SALOMEDS_AttributeStudyProperties();
-
- virtual void SetUserName(const std::string& theName);
- virtual std::string GetUserName();
- virtual void SetCreationDate(int theMinute, int theHour, int theDay, int theMonth, int theYear);
- virtual bool GetCreationDate(int& theMinute, int& theHour, int& theDay, int& theMonth, int& theYear);
- virtual void SetCreationMode(const std::string& theMode);
- virtual std::string GetCreationMode();
- virtual void SetModified(int theModified);
- virtual bool IsModified();
- virtual int GetModified();
- virtual void SetLocked(bool theLocked);
- virtual bool IsLocked();
- virtual void SetModification(const std::string& theName,
- int theMinute,
- int theHour,
- int theDay,
- int theMonth,
- int theYear);
- virtual void GetModificationsList(std::vector<std::string>& theNames,
- std::vector<int>& theMinutes,
- std::vector<int>& theHours,
- std::vector<int>& theDays,
- std::vector<int>& theMonths,
- std::vector<int>& theYears,
- bool theWithCreator);
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeStudyProperties_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeStudyProperties_i.hxx"
-#include "SALOMEDS.hxx"
-using namespace std;
-
-#define CREATION_MODE_NOTDEFINED 0
-#define CREATION_MODE_SCRATCH 1
-#define CREATION_MODE_COPY 2
-
-void SALOMEDS_AttributeStudyProperties_i::SetUserName(const char* theName)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->ChangeCreatorName((char*)theName);
-}
-
-char* SALOMEDS_AttributeStudyProperties_i::GetUserName()
-{
- SALOMEDS::Locker lock;
- string S = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->GetCreatorName();
- CORBA::String_var c_s = CORBA::string_dup(S.c_str());
- return c_s._retn();
-}
-
-void SALOMEDS_AttributeStudyProperties_i::SetCreationDate(CORBA::Long theMinute,
- CORBA::Long theHour,
- CORBA::Long theDay,
- CORBA::Long theMonth,
- CORBA::Long theYear)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeStudyProperties* aProp = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl);
- int aTmp;
- if (aProp->GetCreationDate(aTmp, aTmp, aTmp, aTmp, aTmp)) return;
- string S;
- aProp->SetModification(S, theMinute, theHour, theDay, theMonth, theYear);
-}
-
-CORBA::Boolean SALOMEDS_AttributeStudyProperties_i::GetCreationDate(CORBA::Long& theMinute,
- CORBA::Long& theHour,
- CORBA::Long& theDay,
- CORBA::Long& theMonth,
- CORBA::Long& theYear)
-{
- SALOMEDS::Locker lock;
- int aMinute;
- int aHour;
- int aDay;
- int aMonth;
- int aYear;
- if (dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->GetCreationDate(aMinute, aHour, aDay, aMonth, aYear)) {
- theMinute = aMinute;
- theHour = aHour;
- theDay = aDay;
- theMonth = aMonth;
- theYear = aYear;
- return true;
- }
- return false;
-}
-
-void SALOMEDS_AttributeStudyProperties_i::SetCreationMode(const char* theMode)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeStudyProperties* aProp = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl);
- if (strcmp(theMode,"from scratch")==0) aProp->SetCreationMode(CREATION_MODE_SCRATCH);
- else if (strcmp(theMode,"copy from")==0) aProp->SetCreationMode(CREATION_MODE_COPY);
- else aProp->SetCreationMode(CREATION_MODE_NOTDEFINED);
-}
-
-char* SALOMEDS_AttributeStudyProperties_i::GetCreationMode()
-{
- SALOMEDS::Locker lock;
- CORBA::String_var c_s;
- switch (dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->GetCreationMode()) {
- case CREATION_MODE_SCRATCH: c_s = "from scratch"; break;
- case CREATION_MODE_COPY: c_s = "copy from"; break;
- default: c_s = "";
- }
- return c_s._retn();
-}
-
-void SALOMEDS_AttributeStudyProperties_i::SetModified(CORBA::Long theModified)
-{
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->SetModified(theModified);
-}
-
-CORBA::Boolean SALOMEDS_AttributeStudyProperties_i::IsModified()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->IsModified();
-}
-
-CORBA::Long SALOMEDS_AttributeStudyProperties_i::GetModified()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->GetModified();
-}
-
-void SALOMEDS_AttributeStudyProperties_i::SetLocked(CORBA::Boolean theLocked)
-{
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->SetLocked(theLocked);
-}
-
-CORBA::Boolean SALOMEDS_AttributeStudyProperties_i::IsLocked()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->IsLocked();
-}
-
-void SALOMEDS_AttributeStudyProperties_i::SetModification(const char* theName,
- CORBA::Long theMinute,
- CORBA::Long theHour,
- CORBA::Long theDay,
- CORBA::Long theMonth,
- CORBA::Long theYear)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeStudyProperties* aProp = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl);
- aProp->SetModification((char*)theName, (int)theMinute, (int)theHour,
- (int)theDay, (int)theMonth, (int)theYear);
-}
-
-void SALOMEDS_AttributeStudyProperties_i::GetModificationsList(SALOMEDS::StringSeq_out theNames,
- SALOMEDS::LongSeq_out theMinutes,
- SALOMEDS::LongSeq_out theHours,
- SALOMEDS::LongSeq_out theDays,
- SALOMEDS::LongSeq_out theMonths,
- SALOMEDS::LongSeq_out theYears,
- CORBA::Boolean theWithCreator)
-{
- SALOMEDS::Locker lock;
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
- SALOMEDSImpl_AttributeStudyProperties* aProp = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl);
- aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
- int aLength = aNames.size();
- int aRetLength = aLength - ((theWithCreator) ? 0 : 1);
- theNames = new SALOMEDS::StringSeq;
- theMinutes = new SALOMEDS::LongSeq;
- theHours = new SALOMEDS::LongSeq;
- theDays = new SALOMEDS::LongSeq;
- theMonths = new SALOMEDS::LongSeq;
- theYears = new SALOMEDS::LongSeq;
- theNames->length(aRetLength);
- theMinutes->length(aRetLength);
- theHours->length(aRetLength);
- theDays->length(aRetLength);
- theMonths->length(aRetLength);
- theYears->length(aRetLength);
- int a = 0, ind = ((theWithCreator) ? 1 : 2);
- for (; ind <= aLength; a++, ind++) {
- (*theNames)[a] = CORBA::string_dup(aNames[ind-1].c_str());
- (*theMinutes)[a] = aMinutes[ind-1];
- (*theHours)[a] = aHours[ind-1];
- (*theDays)[a] = aDays[ind-1];
- (*theMonths)[a] = aMonths[ind-1];
- (*theYears)[a] = aYears[ind-1];
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeStudyProperties_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeStudyProperties_i_HeaderFile
-#define SALOMEDS_AttributeStudyProperties_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
-
-class SALOMEDS_AttributeStudyProperties_i: public virtual POA_SALOMEDS::AttributeStudyProperties,
- public virtual SALOMEDS_GenericAttribute_i {
-public:
-
- SALOMEDS_AttributeStudyProperties_i(SALOMEDSImpl_AttributeStudyProperties* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeStudyProperties_i() {};
-
- virtual void SetUserName(const char* theName);
- virtual char* GetUserName() ;
- virtual void SetCreationDate(CORBA::Long theMinute, CORBA::Long theHour, CORBA::Long theDay, CORBA::Long theMonth, CORBA::Long theYear);
- virtual CORBA::Boolean GetCreationDate(CORBA::Long& theMinute, CORBA::Long& theHour, CORBA::Long& theDay, CORBA::Long& theMonth, CORBA::Long& theYear);
- virtual void SetCreationMode(const char* theMode);
- virtual char* GetCreationMode();
- virtual void SetModified(CORBA::Long theModified);
- virtual CORBA::Boolean IsModified();
- virtual CORBA::Long GetModified();
- virtual void SetLocked(CORBA::Boolean theLocked);
- virtual CORBA::Boolean IsLocked();
- virtual void SetModification(const char* theName,
- CORBA::Long theMinute,
- CORBA::Long theHour,
- CORBA::Long theDay,
- CORBA::Long theMonth,
- CORBA::Long theYear);
- virtual void GetModificationsList(SALOMEDS::StringSeq_out theNames,
- SALOMEDS::LongSeq_out theMinutes,
- SALOMEDS::LongSeq_out theHours,
- SALOMEDS::LongSeq_out theDays,
- SALOMEDS::LongSeq_out theMonths,
- SALOMEDS::LongSeq_out theYears,
- CORBA::Boolean theWithCreator);
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTableOfInteger.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTableOfInteger.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-SALOMEDS_AttributeTableOfInteger::SALOMEDS_AttributeTableOfInteger
- (SALOMEDSImpl_AttributeTableOfInteger* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTableOfInteger::SALOMEDS_AttributeTableOfInteger
- (SALOMEDS::AttributeTableOfInteger_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTableOfInteger::~SALOMEDS_AttributeTableOfInteger()
-{}
-
-
-void SALOMEDS_AttributeTableOfInteger::SetTitle(const std::string& theTitle)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetTitle(theTitle);
- }
- else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetTitle(theTitle.c_str());
-}
-
-std::string SALOMEDS_AttributeTableOfInteger::GetTitle()
-{
- std::string aStr;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aStr = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetTitle();
- }
- else aStr = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetTitle();
- return aStr;
-}
-
-void SALOMEDS_AttributeTableOfInteger::SetRowTitle(int theIndex, const std::string& theTitle)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetRowTitle(theIndex, theTitle);
- }
- else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str());
-}
-
-void SALOMEDS_AttributeTableOfInteger::SetRowTitles(const std::vector<std::string>& theTitles)
-{
- int aLength = theTitles.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- vector<string> aSeq;
- for (i = 0; i < aLength; i++) aSeq.push_back(theTitles[i]);
- dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetRowTitles(aSeq);
- }
- else {
- SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
- aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = theTitles[i].c_str();
- SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowTitles(aSeq);
- }
-
-}
-
-std::vector<std::string> SALOMEDS_AttributeTableOfInteger::GetRowTitles()
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetRowTitles();
- }
- else {
- SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowTitles();
- aLength = aSeq->length();
- for(i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfInteger::SetColumnTitle(int theIndex, const std::string& theTitle)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetColumnTitle(theIndex, theTitle);
- }
- else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str());
-}
-
-void SALOMEDS_AttributeTableOfInteger::SetColumnTitles(const std::vector<std::string>& theTitles)
-{
- int aLength = theTitles.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- vector<string> aSeq;
- for (i = 0; i < aLength; i++) aSeq.push_back(theTitles[i]);
- dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetColumnTitles(aSeq);
- }
- else {
- SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = theTitles[i].c_str();
- SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumnTitles(aSeq);
- }
-}
-
-std::vector<std::string> SALOMEDS_AttributeTableOfInteger::GetColumnTitles()
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetColumnTitles();
- }
- else {
- SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetColumnTitles();
- aLength = aSeq->length();
- for (i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfInteger::SetRowUnit(int theIndex, const std::string& theUnit)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetRowUnit(theIndex, theUnit);
- }
- else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str());
-}
-
-void SALOMEDS_AttributeTableOfInteger::SetRowUnits(const std::vector<std::string>& theUnits)
-{
- int aLength = theUnits.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetRowUnits(theUnits);
- }
- else {
- SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str();
- SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowUnits(aSeq);
- }
-}
-
-std::vector<std::string> SALOMEDS_AttributeTableOfInteger::GetRowUnits()
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetRowUnits();
- }
- else {
- SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowUnits();
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
- }
- return aVector;
-}
-
-int SALOMEDS_AttributeTableOfInteger::GetNbRows()
-{
- int aNb;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aNb = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetNbRows();
- }
- else aNb = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetNbRows();
- return aNb;
-}
-
-int SALOMEDS_AttributeTableOfInteger::GetNbColumns()
-{
- int aNb;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aNb = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetNbColumns();
- }
- else aNb = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetNbColumns();
- return aNb;
-
-}
-
-void SALOMEDS_AttributeTableOfInteger::AddRow(const std::vector<int>& theData)
-{
- int aLength = theData.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl);
- try {
- aTable->SetRowData(aTable->GetNbRows() + 1, theData);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
- }
- }
- else {
- SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq();
- aSeq->length(aLength);
- for(i = 0; i < aLength; i++) aSeq[i] = theData[i];
- SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->AddRow(aSeq);
- }
-}
-
-void SALOMEDS_AttributeTableOfInteger::SetRow(int theRow, const std::vector<int>& theData)
-{
- int aLength = theData.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl);
- try {
- aTable->SetRowData(theRow, theData);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
- }
- }
- else {
- SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = theData[i];
- SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRow(theRow, aSeq);
- }
-}
-
-std::vector<int> SALOMEDS_AttributeTableOfInteger::GetRow(int theRow)
-{
- std::vector<int> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetRowData(theRow);
- }
- else {
- SALOMEDS::LongSeq_var aRow = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRow(theRow);
- aLength = aRow->length();
- for (i = 0; i < aLength; i++) aVector.push_back(aRow[i]);
- }
-
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfInteger::AddColumn(const std::vector<int>& theData)
-{
- int aLength = theData.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl);
- try {
- aTable->SetColumnData(aTable->GetNbColumns() + 1, theData);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
- }
- }
- else {
- SALOMEDS::LongSeq_var aColumn = new SALOMEDS::LongSeq();
- aColumn->length(aLength);
- for(i = 0; i < aLength; i++) aColumn[i] = theData[i];
- SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->AddColumn(aColumn);
- }
-}
-
-void SALOMEDS_AttributeTableOfInteger::SetColumn(int theColumn, const std::vector<int>& theData)
-{
- int aLength = theData.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl);
- try {
- aTable->SetColumnData(theColumn, theData);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
- }
- }
- else {
- SALOMEDS::LongSeq_var aColumn = new SALOMEDS::LongSeq();
- aColumn->length(aLength);
- for (i = 0; i < aLength; i++) aColumn[i] = theData[i];
- SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumn(theColumn, aColumn);
- }
-}
-
-std::vector<int> SALOMEDS_AttributeTableOfInteger::GetColumn(int theColumn)
-{
- std::vector<int> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetColumnData(theColumn);
- }
- else {
- SALOMEDS::LongSeq_var aColumn = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetColumn(theColumn);
- aLength = aColumn->length();
- for (i = 0; i < aLength; i++) aVector.push_back(aColumn[i]);
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfInteger::PutValue(int theValue, int theRow, int theColumn)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- try {
- dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->PutValue(theValue, theRow, theColumn);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
- }
- }
- else {
- SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->PutValue(theValue, theRow, theColumn);
- }
-}
-
-bool SALOMEDS_AttributeTableOfInteger::HasValue(int theRow, int theColumn)
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->HasValue(theRow, theColumn);
- }
- else ret = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->HasValue(theRow, theColumn);
- return ret;
-}
-
-int SALOMEDS_AttributeTableOfInteger::GetValue(int theRow, int theColumn)
-{
- int aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- try {
- aValue = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetValue(theRow, theColumn);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
- }
- }
- else {
- aValue = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetValue(theRow, theColumn);
- }
- return aValue;
-}
-
-std::vector<int> SALOMEDS_AttributeTableOfInteger::GetRowSetIndices(int theRow)
-{
- std::vector<int> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetSetRowIndices(theRow);
- }
- else {
- SALOMEDS::LongSeq_var aSet =
- SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowSetIndices(theRow);
- aLength = aSet->length();
- for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfInteger::SetNbColumns(int theNbColumns)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetNbColumns(theNbColumns);
- }
- else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetNbColumns(theNbColumns);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTableOfInteger.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeTableOfInteger_HeaderFile
-#define SALOMEDS_AttributeTableOfInteger_HeaderFile
-
-#include "SALOMEDSClient_AttributeTableOfInteger.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeTableOfInteger.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include <vector>
-
-class SALOMEDS_AttributeTableOfInteger: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeTableOfInteger
-{
-public:
- SALOMEDS_AttributeTableOfInteger(SALOMEDSImpl_AttributeTableOfInteger* theAttr);
- SALOMEDS_AttributeTableOfInteger(SALOMEDS::AttributeTableOfInteger_ptr theAttr);
- ~SALOMEDS_AttributeTableOfInteger();
-
- virtual void SetTitle(const std::string& theTitle);
- virtual std::string GetTitle();
- virtual void SetRowTitle(int theIndex, const std::string& theTitle);
- virtual void SetRowTitles(const std::vector<std::string>& theTitles);
- virtual std::vector<std::string> GetRowTitles();
- virtual void SetColumnTitle(int theIndex, const std::string& theTitle);
- virtual void SetColumnTitles(const std::vector<std::string>& theTitles);
- virtual std::vector<std::string> GetColumnTitles();
-
- virtual void SetRowUnit(int theIndex, const std::string& theUnit);
- virtual void SetRowUnits(const std::vector<std::string>& theUnits);
- virtual std::vector<std::string> GetRowUnits();
-
- virtual int GetNbRows();
- virtual int GetNbColumns();
- virtual void AddRow(const std::vector<int>& theData);
- virtual void SetRow(int theRow, const std::vector<int>& theData);
- virtual std::vector<int> GetRow(int theRow);
- virtual void AddColumn(const std::vector<int>& theData);
- virtual void SetColumn(int theColumn, const std::vector<int>& theData);
- virtual std::vector<int> GetColumn(int theColumn);
- virtual void PutValue(int theValue, int theRow, int theColumn);
- virtual bool HasValue(int theRow, int theColumn);
- virtual int GetValue(int theRow, int theColumn);
-
- virtual std::vector<int> GetRowSetIndices(int theRow);
- virtual void SetNbColumns(int theNbColumns);
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTableOfInteger_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTableOfInteger_i.hxx"
-#include "SALOMEDS.hxx"
-
-#include "Utils_ExceptHandlers.hxx"
-
-#include <stdexcept>
-#include <sstream>
-#include <string>
-#include <vector>
-
-using namespace std;
-
-UNEXPECT_CATCH(ATI_IncorrectIndex, SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
-UNEXPECT_CATCH(ATI_IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength);
-
-void SALOMEDS_AttributeTableOfInteger_i::SetTitle(const char* theTitle)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- CORBA::String_var aStr = CORBA::string_dup(theTitle);
- dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl)->SetTitle(string(aStr));
-}
-
-char* SALOMEDS_AttributeTableOfInteger_i::GetTitle()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- CORBA::String_var c_s = CORBA::string_dup(aTable->GetTitle().c_str());
- return c_s._retn();
-}
-
-void SALOMEDS_AttributeTableOfInteger_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch (ATI_IncorrectIndex);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
- aTable->SetRowTitle(theIndex, string(theTitle));
-}
-
-void SALOMEDS_AttributeTableOfInteger_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch (ATI_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
- for (int i = 0; i < theTitles.length(); i++) {
- SetRowTitle(i + 1, theTitles[i]);
- }
-}
-
-SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowTitles()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
- aTitles->length(aTable->GetNbRows());
- for(int i = 0; i < aTitles->length(); i++)
- aTitles[i] = CORBA::string_dup(aTable->GetRowTitle(i + 1).c_str());
- return aTitles._retn();
-}
-
-void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch (ATI_IncorrectIndex);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
- CORBA::String_var aStr = CORBA::string_dup(theTitle);
- aTable->SetColumnTitle(theIndex, string(aStr));
-}
-
-void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATI_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
- for (int i = 0; i < theTitles.length(); i++) {
- aTable->SetColumnTitle(i + 1, (char*)theTitles[i].in());
- }
-}
-
-SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumnTitles()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
- aTitles->length(aTable->GetNbColumns());
- for(int i = 0; i < aTitles->length(); i++)
- aTitles[i] = CORBA::string_dup(aTable->GetColumnTitle(i + 1).c_str());
- return aTitles._retn();
-}
-
-//Units support
-void SALOMEDS_AttributeTableOfInteger_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch (ATI_IncorrectIndex);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
- aTable->SetRowUnit(theIndex, string(theUnit));
-}
-
-void SALOMEDS_AttributeTableOfInteger_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch (ATI_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
- for (int i = 0; i < theUnits.length(); i++) {
- aTable->SetRowUnit(i + 1, (char*)theUnits[i].in());
- }
-}
-
-SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowUnits()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq;
- aUnits->length(aTable->GetNbRows());
- for(int i = 0; i < aUnits->length(); i++)
- aUnits[i] = CORBA::string_dup(aTable->GetRowUnit(i + 1).c_str());
- return aUnits._retn();
-}
-
-CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetNbRows()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl)->GetNbRows();
-}
-
-CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetNbColumns()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl)->GetNbColumns();
-}
-
-void SALOMEDS_AttributeTableOfInteger_i::AddRow(const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATI_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
-
- vector<int> aRow;
- for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]);
- try {
- aTable->SetRowData(aTable->GetNbRows() + 1, aRow);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
- }
-}
-
-void SALOMEDS_AttributeTableOfInteger_i::SetRow(CORBA::Long theRow, const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATI_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
-
- vector<int> aRow;
- for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]);
- try {
- aTable->SetRowData(theRow, aRow);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
- }
-}
-
-SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRow(CORBA::Long theRow)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATI_IncorrectIndex);
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
-
- SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- vector<int> aRow = aTable->GetRowData(theRow);
- CorbaSeq->length(aRow.size());
- for (int i = 0; i < aRow.size(); i++) {
- CorbaSeq[i] = aRow[i];
- }
- return CorbaSeq._retn();
-}
-
-void SALOMEDS_AttributeTableOfInteger_i::AddColumn(const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATI_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
-
- vector<int> aColumn;
- for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]);
- try {
- aTable->SetColumnData(aTable->GetNbColumns() + 1, aColumn);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
- }
-}
-
-void SALOMEDS_AttributeTableOfInteger_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATI_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
-
- vector<int> aColumn;
- for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]);
- try {
- aTable->SetColumnData(theColumn, aColumn);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
- }
-}
-
-SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumn(CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATI_IncorrectIndex);
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
-
- SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- vector<int> aColumn = aTable->GetColumnData(theColumn);
- CorbaSeq->length(aColumn.size());
- for (int i = 0; i < aColumn.size(); i++) {
- CorbaSeq[i] = aColumn[i];
- }
- return CorbaSeq._retn();
-}
-
-void SALOMEDS_AttributeTableOfInteger_i::PutValue(CORBA::Long theValue, CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATI_IncorrectIndex);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
-
- try {
- aTable->PutValue(theValue, theRow, theColumn);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
- }
-}
-
-CORBA::Boolean SALOMEDS_AttributeTableOfInteger_i::HasValue(CORBA::Long theRow, CORBA::Long theColumn)
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl)->HasValue(theRow, theColumn);
-}
-
-CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATI_IncorrectIndex);
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
-
- CORBA::Long aValue;
- try {
- aValue = aTable->GetValue(theRow, theColumn);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
- }
- return aValue;
-}
-
-SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowSetIndices(CORBA::Long theRow)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
-
- if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
-
- SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- vector<int> aSeq = aTable->GetSetRowIndices(theRow);
- CorbaSeq->length(aSeq.size());
- for (int i = 0; i < aSeq.size(); i++) {
- CorbaSeq[i] = aSeq[i];
- }
- return CorbaSeq._retn();
-}
-
-
-void SALOMEDS_AttributeTableOfInteger_i::SetNbColumns(CORBA::Long theNbColumns)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
- aTable->SetNbColumns(theNbColumns);
-}
-
-bool SALOMEDS_AttributeTableOfInteger_i::ReadFromFile(const SALOMEDS::TMPFile& theStream)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
-
- string aStream((char*)&theStream[0], theStream.length());
- aTable->Load(aStream);
- return true;
-}
-
-SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfInteger_i::SaveToFile()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
-
- string aString = aTable->Save();
-
- char* aBuffer = (char*)CORBA::string_dup(aString.c_str());
- int aBufferSize = strlen((char*)aBuffer);
-
- CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer;
-
- SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1);
-
- return aStreamFile._retn();
-}
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTableOfInteger_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeTableOfInteger_i_HeaderFile
-#define SALOMEDS_AttributeTableOfInteger_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeTableOfInteger.hxx"
-
-class SALOMEDS_AttributeTableOfInteger_i: public virtual POA_SALOMEDS::AttributeTableOfInteger,
- public virtual SALOMEDS_GenericAttribute_i
-{
-
-public:
-
- SALOMEDS_AttributeTableOfInteger_i(SALOMEDSImpl_AttributeTableOfInteger* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeTableOfInteger_i() {};
-
- virtual void SetTitle(const char* theTitle);
- virtual char* GetTitle();
- virtual void SetRowTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
- virtual void SetRowTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength);
- virtual SALOMEDS::StringSeq* GetRowTitles();
- virtual void SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
- virtual void SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength);
- virtual SALOMEDS::StringSeq* GetColumnTitles();
-
- virtual void SetRowUnit(CORBA::Long theIndex, const char* theUnit)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
- virtual void SetRowUnits(const SALOMEDS::StringSeq& theUnits)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength);
- virtual SALOMEDS::StringSeq* GetRowUnits();
-
- virtual CORBA::Long GetNbRows();
- virtual CORBA::Long GetNbColumns();
- virtual void AddRow(const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength);
- virtual void SetRow(CORBA::Long theRow, const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
- virtual SALOMEDS::LongSeq* GetRow(CORBA::Long theRow)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
- virtual void AddColumn(const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength);
- virtual void SetColumn(CORBA::Long theColumn, const SALOMEDS::LongSeq& theData)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
- virtual SALOMEDS::LongSeq* GetColumn(CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
- virtual void PutValue(CORBA::Long theValue, CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
- virtual CORBA::Boolean HasValue(CORBA::Long theRow, CORBA::Long theColumn);
- virtual CORBA::Long GetValue(CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
-
- virtual SALOMEDS::LongSeq* GetRowSetIndices(CORBA::Long theRow);
- virtual void SetNbColumns(CORBA::Long theNbColumns);
-
- virtual bool ReadFromFile(const SALOMEDS::TMPFile& theStream);
- virtual SALOMEDS::TMPFile* SaveToFile();
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTableOfReal.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTableOfReal.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-SALOMEDS_AttributeTableOfReal::SALOMEDS_AttributeTableOfReal
- (SALOMEDSImpl_AttributeTableOfReal* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTableOfReal::SALOMEDS_AttributeTableOfReal(SALOMEDS::AttributeTableOfReal_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTableOfReal::~SALOMEDS_AttributeTableOfReal()
-{}
-
-
-void SALOMEDS_AttributeTableOfReal::SetTitle(const std::string& theTitle)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetTitle(theTitle);
- }
- else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetTitle(theTitle.c_str());
-}
-
-std::string SALOMEDS_AttributeTableOfReal::GetTitle()
-{
- std::string aStr;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aStr = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetTitle();
- }
- else aStr = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetTitle();
- return aStr;
-}
-
-void SALOMEDS_AttributeTableOfReal::SetRowTitle(int theIndex, const std::string& theTitle)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetRowTitle(theIndex, theTitle);
- }
- else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str());
-}
-
-void SALOMEDS_AttributeTableOfReal::SetRowTitles(const std::vector<std::string>& theTitles)
-{
- CheckLocked();
- int aLength = theTitles.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetRowTitles(theTitles);
- }
- else {
- SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
- SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowTitles(aSeq);
- }
-}
-
-std::vector<std::string> SALOMEDS_AttributeTableOfReal::GetRowTitles()
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetRowTitles();
- }
- else {
- SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowTitles();
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfReal::SetColumnTitle(int theIndex, const std::string& theTitle)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetColumnTitle(theIndex, theTitle);
- }
- else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str());
-}
-
-void SALOMEDS_AttributeTableOfReal::SetColumnTitles(const std::vector<std::string>& theTitles)
-{
- int aLength = theTitles.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetColumnTitles(theTitles);
- }
- else {
- SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
- SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumnTitles(aSeq);
- }
-}
-
-std::vector<std::string> SALOMEDS_AttributeTableOfReal::GetColumnTitles()
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetColumnTitles();
- }
- else {
- SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetColumnTitles();
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfReal::SetRowUnit(int theIndex, const std::string& theUnit)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetRowUnit(theIndex, theUnit);
- }
- else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str());
-}
-
-void SALOMEDS_AttributeTableOfReal::SetRowUnits(const std::vector<std::string>& theUnits)
-{
- int aLength = theUnits.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetRowUnits(theUnits);
- }
- else {
- SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str();
- SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowUnits(aSeq);
- }
-}
-
-std::vector<std::string> SALOMEDS_AttributeTableOfReal::GetRowUnits()
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetRowUnits();
- }
- else {
- SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowUnits();
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back(string(aSeq[i].in()));
- }
- return aVector;
-}
-
-int SALOMEDS_AttributeTableOfReal::GetNbRows()
-{
- int aNb;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aNb = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetNbRows();
- }
- else aNb = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetNbRows();
- return aNb;
-}
-
-int SALOMEDS_AttributeTableOfReal::GetNbColumns()
-{
- int aNb;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aNb = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetNbColumns();
- }
- else aNb = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetNbColumns();
- return aNb;
-}
-
-void SALOMEDS_AttributeTableOfReal::AddRow(const std::vector<double>& theData)
-{
- int aLength = theData.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl);
- try {
- aTable->SetRowData(aTable->GetNbRows() + 1, theData);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
- }
- }
- else {
- SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = theData[i];
- SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->AddRow(aSeq);
- }
-}
-
-void SALOMEDS_AttributeTableOfReal::SetRow(int theRow, const std::vector<double>& theData)
-{
- int aLength = theData.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl);
- try {
- aTable->SetRowData(theRow, theData);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
- }
- }
- else {
- SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = theData[i];
- SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRow(theRow, aSeq);
- }
-}
-
-std::vector<double> SALOMEDS_AttributeTableOfReal::GetRow(int theRow)
-{
- std::vector<double> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetRowData(theRow);
- }
- else {
- SALOMEDS::DoubleSeq_var aRow = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRow(theRow);
- aLength = aRow->length();
- for (i = 0; i < aLength; i++) aVector.push_back(aRow[i]);
- }
-
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfReal::AddColumn(const std::vector<double>& theData)
-{
- int aLength = theData.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl);
- try {
- aTable->SetColumnData(aTable->GetNbColumns() + 1, theData);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
- }
- }
- else {
- SALOMEDS::DoubleSeq_var aColumn = new SALOMEDS::DoubleSeq();
- aColumn->length(aLength);
- for (i = 0; i < aLength; i++) aColumn[i] = theData[i];
- SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->AddColumn(aColumn);
- }
-}
-
-void SALOMEDS_AttributeTableOfReal::SetColumn(int theColumn, const std::vector<double>& theData)
-{
- int aLength = theData.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl);
- try {
- aTable->SetColumnData(theColumn, theData);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
- }
- }
- else {
- SALOMEDS::DoubleSeq_var aColumn = new SALOMEDS::DoubleSeq();
- aColumn->length(aLength);
- for (i = 0; i < aLength; i++) aColumn[i] = theData[i];
- SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumn(theColumn, aColumn);
- }
-}
-
-std::vector<double> SALOMEDS_AttributeTableOfReal::GetColumn(int theColumn)
-{
- std::vector<double> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetColumnData(theColumn);
- }
- else {
- SALOMEDS::DoubleSeq_var aColumn = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetColumn(theColumn);
- aLength = aColumn->length();
- for (i = 0; i < aLength; i++) aVector.push_back(aColumn[i]);
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfReal::PutValue(double theValue, int theRow, int theColumn)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- try {
- dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->PutValue(theValue, theRow, theColumn);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
- }
- }
- else {
- SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->PutValue(theValue, theRow, theColumn);
- }
-}
-
-bool SALOMEDS_AttributeTableOfReal::HasValue(int theRow, int theColumn)
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->HasValue(theRow, theColumn);
- }
- else ret = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->HasValue(theRow, theColumn);
- return ret;
-}
-
-double SALOMEDS_AttributeTableOfReal::GetValue(int theRow, int theColumn)
-{
- double aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- try {
- aValue = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetValue(theRow, theColumn);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
- }
- }
- else {
- aValue = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetValue(theRow, theColumn);
- }
- return aValue;
-}
-
-std::vector<int> SALOMEDS_AttributeTableOfReal::GetRowSetIndices(int theRow)
-{
- std::vector<int> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetSetRowIndices(theRow);
- }
- else {
- SALOMEDS::LongSeq_var aSet = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowSetIndices(theRow);
- aLength = aSet->length();
- for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfReal::SetNbColumns(int theNbColumns)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetNbColumns(theNbColumns);
- }
- else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetNbColumns(theNbColumns);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTableOfReal.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeTableOfReal_HeaderFile
-#define SALOMEDS_AttributeTableOfReal_HeaderFile
-
-#include "SALOMEDSClient_AttributeTableOfReal.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeTableOfReal.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include <vector>
-
-class SALOMEDS_AttributeTableOfReal: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeTableOfReal
-{
-public:
- SALOMEDS_AttributeTableOfReal(SALOMEDSImpl_AttributeTableOfReal* theAttr);
- SALOMEDS_AttributeTableOfReal(SALOMEDS::AttributeTableOfReal_ptr theAttr);
- ~SALOMEDS_AttributeTableOfReal();
-
- virtual void SetTitle(const std::string& theTitle);
- virtual std::string GetTitle();
- virtual void SetRowTitle(int theIndex, const std::string& theTitle);
- virtual void SetRowTitles(const std::vector<std::string>& theTitles);
- virtual std::vector<std::string> GetRowTitles();
- virtual void SetColumnTitle(int theIndex, const std::string& theTitle);
- virtual void SetColumnTitles(const std::vector<std::string>& theTitles);
- virtual std::vector<std::string> GetColumnTitles();
-
- virtual void SetRowUnit(int theIndex, const std::string& theUnit);
- virtual void SetRowUnits(const std::vector<std::string>& theUnits);
- virtual std::vector<std::string> GetRowUnits();
-
- virtual int GetNbRows();
- virtual int GetNbColumns();
- virtual void AddRow(const std::vector<double>& theData);
- virtual void SetRow(int theRow, const std::vector<double>& theData);
- virtual std::vector<double> GetRow(int theRow);
- virtual void AddColumn(const std::vector<double>& theData);
- virtual void SetColumn(int theColumn, const std::vector<double>& theData);
- virtual std::vector<double> GetColumn(int theColumn);
- virtual void PutValue(double theValue, int theRow, int theColumn);
- virtual bool HasValue(int theRow, int theColumn);
- virtual double GetValue(int theRow, int theColumn);
-
- virtual std::vector<int> GetRowSetIndices(int theRow);
- virtual void SetNbColumns(int theNbColumns);
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTableOfReal_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTableOfReal_i.hxx"
-#include "SALOMEDS.hxx"
-
-#include <sstream>
-#include <string>
-#include <vector>
-
-using namespace std;
-
-#include "Utils_ExceptHandlers.hxx"
-UNEXPECT_CATCH(ATR_IncorrectIndex, SALOMEDS::AttributeTableOfReal::IncorrectIndex);
-UNEXPECT_CATCH(ATR_IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength);
-
-void SALOMEDS_AttributeTableOfReal_i::SetTitle(const char* theTitle)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- CORBA::String_var aStr = CORBA::string_dup(theTitle);
- aTable->SetTitle(string(aStr));
-}
-
-char* SALOMEDS_AttributeTableOfReal_i::GetTitle()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- CORBA::String_var c_s = CORBA::string_dup(aTable->GetTitle().c_str());
- return c_s._retn();
-}
-
-void SALOMEDS_AttributeTableOfReal_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch (ATR_IncorrectIndex);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
- aTable->SetRowTitle(theIndex, string(theTitle));
-}
-
-void SALOMEDS_AttributeTableOfReal_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch (ATR_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
- for (int i = 0; i < theTitles.length(); i++) {
- aTable->SetRowTitle(i + 1, (char*)theTitles[i].in());
- }
-}
-
-SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetRowTitles()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
- aTitles->length(aTable->GetNbRows());
- for(int i = 0; i < aTitles->length(); i++)
- aTitles[i] = CORBA::string_dup(aTable->GetRowTitle(i + 1).c_str());
- return aTitles._retn();
-}
-
-void SALOMEDS_AttributeTableOfReal_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch (ATR_IncorrectIndex);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
- CORBA::String_var aStr = CORBA::string_dup(theTitle);
- aTable->SetColumnTitle(theIndex, string(aStr));
-}
-
-void SALOMEDS_AttributeTableOfReal_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATR_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
- for (int i = 0; i < theTitles.length(); i++) {
- aTable->SetColumnTitle(i + 1, (char*)theTitles[i].in());
- }
-}
-
-SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetColumnTitles()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
- aTitles->length(aTable->GetNbColumns());
- for(int i = 0; i < aTitles->length(); i++)
- aTitles[i] = CORBA::string_dup(aTable->GetColumnTitle(i + 1).c_str());
- return aTitles._retn();
-}
-
-//Units support
-void SALOMEDS_AttributeTableOfReal_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch (ATR_IncorrectIndex);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
- aTable->SetRowUnit(theIndex, string(theUnit));
-}
-
-void SALOMEDS_AttributeTableOfReal_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch (ATR_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
- for (int i = 0; i < theUnits.length(); i++) {
- aTable->SetRowUnit(i + 1, (char*)theUnits[i].in());
- }
-}
-
-SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetRowUnits()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq;
- aUnits->length(aTable->GetNbRows());
- for(int i = 0; i < aUnits->length(); i++)
- aUnits[i] = CORBA::string_dup(aTable->GetRowUnit(i + 1).c_str());
- return aUnits._retn();
-}
-
-
-CORBA::Long SALOMEDS_AttributeTableOfReal_i::GetNbRows()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl)->GetNbRows();
-}
-
-CORBA::Long SALOMEDS_AttributeTableOfReal_i::GetNbColumns()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl)->GetNbColumns();
-}
-
-void SALOMEDS_AttributeTableOfReal_i::AddRow(const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATR_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
-
- vector<double> aRow;
- for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]);
- aTable->SetRowData(aTable->GetNbRows() + 1, aRow);
-}
-
-void SALOMEDS_AttributeTableOfReal_i::SetRow(CORBA::Long theRow, const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATR_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
-
- vector<double> aRow;
- for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]);
- aTable->SetRowData(theRow, aRow);
-}
-
-SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetRow(CORBA::Long theRow)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATR_IncorrectIndex);
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
-
- SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq;
- vector<double> aRow = aTable->GetRowData(theRow);
- CorbaSeq->length(aRow.size());
- for (int i = 0; i < aRow.size(); i++) {
- CorbaSeq[i] = aRow[i];
- }
- return CorbaSeq._retn();
-}
-
-void SALOMEDS_AttributeTableOfReal_i::AddColumn(const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATR_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
-
- vector<double> aColumn;
- for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]);
- aTable->SetColumnData(aTable->GetNbColumns() + 1, aColumn);
-}
-
-void SALOMEDS_AttributeTableOfReal_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATR_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
-
- vector<double> aColumn;
- for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]);
- aTable->SetColumnData(theColumn, aColumn);
-}
-
-SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetColumn(CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATR_IncorrectIndex);
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
-
- SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq;
- vector<double> aColumn = aTable->GetColumnData(theColumn);
- CorbaSeq->length(aColumn.size());
- for (int i = 0; i < aColumn.size(); i++) {
- CorbaSeq[i] = aColumn[i];
- }
- return CorbaSeq._retn();
-}
-
-void SALOMEDS_AttributeTableOfReal_i::PutValue(CORBA::Double theValue, CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATR_IncorrectIndex);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
-
- aTable->PutValue(theValue, theRow, theColumn);
-}
-
-CORBA::Boolean SALOMEDS_AttributeTableOfReal_i::HasValue(CORBA::Long theRow, CORBA::Long theColumn)
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl)->HasValue(theRow, theColumn);
-}
-
-CORBA::Double SALOMEDS_AttributeTableOfReal_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATR_IncorrectIndex);
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
-
- CORBA::Double aValue;
-
- try {
- aValue = aTable->GetValue(theRow, theColumn);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
- }
-
- return aValue;
-}
-
-
-SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::GetRowSetIndices(CORBA::Long theRow)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
-
- if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
-
- SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- vector<int> aSeq = aTable->GetSetRowIndices(theRow);
- int len = aSeq.size();
- CorbaSeq->length(len);
- for (int i = 0; i < len; i++) {
- CorbaSeq[i] = aSeq[i];
- }
- return CorbaSeq._retn();
-}
-
-
-void SALOMEDS_AttributeTableOfReal_i::SetNbColumns(CORBA::Long theNbColumns)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
- aTable->SetNbColumns(theNbColumns);
-}
-
-bool SALOMEDS_AttributeTableOfReal_i::ReadFromFile(const SALOMEDS::TMPFile& theStream)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
-
- string aStream((char*)&theStream[0], theStream.length());
- aTable->Load(aStream);
- return true;
-}
-
-SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfReal_i::SaveToFile()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_impl);
-
- string aString = aTable->Save();
- char* aBuffer = (char*)CORBA::string_dup(aString.c_str());
- int aBufferSize = strlen((char*)aBuffer);
-
- CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer;
-
- SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1);
-
- return aStreamFile._retn();
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTableOfReal_i.hxx
-// Author : Michael Ponikarov
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeTableOfReal_i_HeaderFile
-#define SALOMEDS_AttributeTableOfReal_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeTableOfReal.hxx"
-
-class SALOMEDS_AttributeTableOfReal_i: public virtual POA_SALOMEDS::AttributeTableOfReal,
- public virtual SALOMEDS_GenericAttribute_i {
-
-public:
-
- SALOMEDS_AttributeTableOfReal_i(SALOMEDSImpl_AttributeTableOfReal* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeTableOfReal_i() {};
-
- virtual void SetTitle(const char* theTitle);
- virtual char* GetTitle();
- virtual void SetRowTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
- virtual void SetRowTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength);
- virtual SALOMEDS::StringSeq* GetRowTitles();
- virtual void SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
- virtual void SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength);
- virtual SALOMEDS::StringSeq* GetColumnTitles();
-
- virtual void SetRowUnit(CORBA::Long theIndex, const char* theUnit)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
- virtual void SetRowUnits(const SALOMEDS::StringSeq& theUnits)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength);
- virtual SALOMEDS::StringSeq* GetRowUnits();
-
- virtual CORBA::Long GetNbRows();
- virtual CORBA::Long GetNbColumns();
- virtual void AddRow(const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength);
- virtual void SetRow(CORBA::Long theRow, const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectIndex);
- virtual SALOMEDS::DoubleSeq* GetRow(CORBA::Long theRow)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
- virtual void AddColumn(const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength);
- virtual void SetColumn(CORBA::Long theColumn, const SALOMEDS::DoubleSeq& theData)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectIndex);
- virtual SALOMEDS::DoubleSeq* GetColumn(CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
- virtual void PutValue(CORBA::Double theValue, CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
- virtual CORBA::Boolean HasValue(CORBA::Long theRow, CORBA::Long theColumn);
- virtual CORBA::Double GetValue(CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex);
-
- virtual SALOMEDS::LongSeq* GetRowSetIndices(CORBA::Long theRow);
- virtual void SetNbColumns(CORBA::Long theNbColumns);
-
- virtual bool ReadFromFile(const SALOMEDS::TMPFile& theStream);
- virtual SALOMEDS::TMPFile* SaveToFile();
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTableOfString.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTableOfString.hxx"
-#include "SALOMEDS.hxx"
-
-#include <string>
-
-using namespace std;
-
-SALOMEDS_AttributeTableOfString::SALOMEDS_AttributeTableOfString
- (SALOMEDSImpl_AttributeTableOfString* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTableOfString::SALOMEDS_AttributeTableOfString
- (SALOMEDS::AttributeTableOfString_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTableOfString::~SALOMEDS_AttributeTableOfString()
-{}
-
-
-void SALOMEDS_AttributeTableOfString::SetTitle(const std::string& theTitle)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SetTitle(theTitle);
- }
- else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetTitle(theTitle.c_str());
-}
-
-std::string SALOMEDS_AttributeTableOfString::GetTitle()
-{
- std::string aStr;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aStr = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetTitle();
- }
- else aStr = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetTitle();
- return aStr;
-}
-
-void SALOMEDS_AttributeTableOfString::SetRowTitle(int theIndex, const std::string& theTitle)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SetRowTitle(theIndex, theTitle);
- }
- else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str());
-}
-
-void SALOMEDS_AttributeTableOfString::SetRowTitles(const std::vector<std::string>& theTitles)
-{
- int aLength = theTitles.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SetRowTitles(theTitles);
- }
- else {
- SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
- SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowTitles(aSeq);
- }
-}
-
-std::vector<std::string> SALOMEDS_AttributeTableOfString::GetRowTitles()
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetRowTitles();
- }
- else {
- SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRowTitles();
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfString::SetColumnTitle(int theIndex, const std::string& theTitle)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SetColumnTitle(theIndex, theTitle);
- }
- else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str());
-}
-
-void SALOMEDS_AttributeTableOfString::SetColumnTitles(const std::vector<std::string>& theTitles)
-{
- int aLength = theTitles.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SetColumnTitles(theTitles);
- }
- else {
- SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
- SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetColumnTitles(aSeq);
- }
-}
-
-std::vector<std::string> SALOMEDS_AttributeTableOfString::GetColumnTitles()
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetColumnTitles();
- }
- else {
- SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetColumnTitles();
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfString::SetRowUnit(int theIndex, const std::string& theUnit)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SetRowUnit(theIndex, theUnit);
- }
- else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str());
-}
-
-void SALOMEDS_AttributeTableOfString::SetRowUnits(const std::vector<std::string>& theUnits)
-{
- int aLength = theUnits.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SetRowUnits(theUnits);
- }
- else {
- SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str();
- SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowUnits(aSeq);
- }
-}
-
-std::vector<std::string> SALOMEDS_AttributeTableOfString::GetRowUnits()
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetRowUnits();
- }
- else {
- SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRowUnits();
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
- }
- return aVector;
-}
-
-int SALOMEDS_AttributeTableOfString::GetNbRows()
-{
- int aNb;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aNb = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetNbRows();
- }
- else aNb = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetNbRows();
- return aNb;
-}
-
-int SALOMEDS_AttributeTableOfString::GetNbColumns()
-{
- int aNb;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aNb = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetNbColumns();
- }
- else aNb = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetNbColumns();
- return aNb;
-}
-
-void SALOMEDS_AttributeTableOfString::AddRow(const std::vector<std::string>& theData)
-{
- int aLength = theData.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl);
- try {
- aTable->SetRowData(aTable->GetNbRows() + 1, theData);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
- }
- }
- else {
- SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = (char*)theData[i].c_str();
- SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->AddRow(aSeq);
- }
-}
-
-void SALOMEDS_AttributeTableOfString::SetRow(int theRow, const std::vector<std::string>& theData)
-{
- int aLength = theData.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl);
- try {
- aTable->SetRowData(theRow, theData);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
- }
- }
- else {
- SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
- aSeq->length(aLength);
- for (i = 0; i < aLength; i++) aSeq[i] = (char*)theData[i].c_str();
- SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRow(theRow, aSeq);
- }
-}
-
-std::vector<std::string> SALOMEDS_AttributeTableOfString::GetRow(int theRow)
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetRowData(theRow);
- }
- else {
- SALOMEDS::StringSeq_var aRow = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRow(theRow);
- aLength = aRow->length();
- for (i = 0; i < aLength; i++) aVector.push_back((char*)aRow[i].in());
- }
-
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfString::AddColumn(const std::vector<std::string>& theData)
-{
- int aLength = theData.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl);
- try {
- aTable->SetColumnData(aTable->GetNbColumns() + 1, theData);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
- }
- }
- else {
- SALOMEDS::StringSeq_var aColumn = new SALOMEDS::StringSeq();
- aColumn->length(aLength);
- for (i = 0; i < aLength; i++) aColumn[i] = (char*)theData[i].c_str();
- SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->AddColumn(aColumn);
- }
-}
-
-void SALOMEDS_AttributeTableOfString::SetColumn(int theColumn, const std::vector<std::string>& theData)
-{
- int aLength = theData.size(), i;
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl);
- try {
- aTable->SetColumnData(theColumn, theData);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
- }
- }
- else {
- SALOMEDS::StringSeq_var aColumn = new SALOMEDS::StringSeq();
- aColumn->length(aLength);
- for (i = 0; i < aLength; i++) aColumn[i] = (char*)theData[i].c_str();
- SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetColumn(theColumn, aColumn);
- }
-}
-
-std::vector<std::string> SALOMEDS_AttributeTableOfString::GetColumn(int theColumn)
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetColumnData(theColumn);
- }
- else {
- SALOMEDS::StringSeq_var aColumn =
- SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetColumn(theColumn);
- aLength = aColumn->length();
- for (i = 0; i < aLength; i++) aVector.push_back(aColumn[i].in());
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfString::PutValue(const std::string& theValue, int theRow, int theColumn)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- try {
- dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->PutValue(theValue, theRow, theColumn);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
- }
- }
- else {
- SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->PutValue(theValue.c_str(), theRow, theColumn);
- }
-}
-
-bool SALOMEDS_AttributeTableOfString::HasValue(int theRow, int theColumn)
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->HasValue(theRow, theColumn);
- }
- else ret = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->HasValue(theRow, theColumn);
- return ret;
-}
-
-std::string SALOMEDS_AttributeTableOfString::GetValue(int theRow, int theColumn)
-{
- std::string aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- try {
- aValue = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetValue(theRow, theColumn);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
- }
- }
- else {
- aValue = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetValue(theRow, theColumn);
- }
- return aValue;
-}
-
-std::vector<int> SALOMEDS_AttributeTableOfString::GetRowSetIndices(int theRow)
-{
- std::vector<int> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->GetSetRowIndices(theRow);
- }
- else {
- SALOMEDS::LongSeq_var aSet =
- SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRowSetIndices(theRow);
- aLength = aSet->length();
- for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
- }
- return aVector;
-}
-
-void SALOMEDS_AttributeTableOfString::SetNbColumns(int theNbColumns)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_local_impl)->SetNbColumns(theNbColumns);
- }
- else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetNbColumns(theNbColumns);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTableOfString.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeTableOfString_HeaderFile
-#define SALOMEDS_AttributeTableOfString_HeaderFile
-
-#include "SALOMEDSClient_AttributeTableOfString.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeTableOfString.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include <vector>
-
-class SALOMEDS_AttributeTableOfString: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeTableOfString
-{
-public:
- SALOMEDS_AttributeTableOfString(SALOMEDSImpl_AttributeTableOfString* theAttr);
- SALOMEDS_AttributeTableOfString(SALOMEDS::AttributeTableOfString_ptr theAttr);
- ~SALOMEDS_AttributeTableOfString();
-
- virtual void SetTitle(const std::string& theTitle);
- virtual std::string GetTitle();
- virtual void SetRowTitle(int theIndex, const std::string& theTitle);
- virtual void SetRowTitles(const std::vector<std::string>& theTitles);
- virtual std::vector<std::string> GetRowTitles();
- virtual void SetColumnTitle(int theIndex, const std::string& theTitle);
- virtual void SetColumnTitles(const std::vector<std::string>& theTitles);
- virtual std::vector<std::string> GetColumnTitles();
-
- virtual void SetRowUnit(int theIndex, const std::string& theUnit);
- virtual void SetRowUnits(const std::vector<std::string>& theUnits);
- virtual std::vector<std::string> GetRowUnits();
-
- virtual int GetNbRows();
- virtual int GetNbColumns();
- virtual void AddRow(const std::vector<std::string>& theData);
- virtual void SetRow(int theRow, const std::vector<std::string>& theData);
- virtual std::vector<std::string> GetRow(int theRow);
- virtual void AddColumn(const std::vector<std::string>& theData);
- virtual void SetColumn(int theColumn, const std::vector<std::string>& theData);
- virtual std::vector<std::string> GetColumn(int theColumn);
- virtual void PutValue(const std::string& theValue, int theRow, int theColumn);
- virtual bool HasValue(int theRow, int theColumn);
- virtual std::string GetValue(int theRow, int theColumn);
-
- virtual std::vector<int> GetRowSetIndices(int theRow);
- virtual void SetNbColumns(int theNbColumns);
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTableOfString_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTableOfString_i.hxx"
-#include "SALOMEDS.hxx"
-
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "Utils_ExceptHandlers.hxx"
-
-using namespace std;
-
-UNEXPECT_CATCH(ATS_IncorrectIndex, SALOMEDS::AttributeTableOfString::IncorrectIndex);
-UNEXPECT_CATCH(ATS_IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectArgumentLength);
-
-void SALOMEDS_AttributeTableOfString_i::SetTitle(const char* theTitle)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- CORBA::String_var aStr = CORBA::string_dup(theTitle);
- aTable->SetTitle(string(aStr));
-}
-
-char* SALOMEDS_AttributeTableOfString_i::GetTitle()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- CORBA::String_var c_s = CORBA::string_dup(aTable->GetTitle().c_str());
- return c_s._retn();
-}
-
-void SALOMEDS_AttributeTableOfString_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectIndex);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
-
- aTable->SetRowTitle(theIndex, string(theTitle));
-}
-
-void SALOMEDS_AttributeTableOfString_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
- for (int i = 0; i < theTitles.length(); i++) {
- aTable->SetRowTitle(i + 1, string((char*)theTitles[i].in()));
- }
-}
-
-SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRowTitles()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
- aTitles->length(aTable->GetNbRows());
- for(int i = 0; i < aTitles->length(); i++)
- aTitles[i] =CORBA::string_dup(aTable->GetRowTitle(i + 1).c_str());
- return aTitles._retn();
-}
-
-void SALOMEDS_AttributeTableOfString_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectIndex);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
- aTable->SetColumnTitle(theIndex, string((char*)theTitle));
-}
-
-void SALOMEDS_AttributeTableOfString_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
- for (int i = 0; i < theTitles.length(); i++) {
- aTable->SetColumnTitle(i + 1, string((char*)theTitles[i].in()));
- }
-}
-
-SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetColumnTitles()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
- aTitles->length(aTable->GetNbColumns());
- for(int i = 0; i < aTitles->length(); i++)
- aTitles[i] = CORBA::string_dup(aTable->GetColumnTitle(i + 1).c_str());
- return aTitles._retn();
-}
-
-//Units support
-void SALOMEDS_AttributeTableOfString_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectIndex);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
- aTable->SetRowUnit(theIndex, string((char*)theUnit));
-}
-
-void SALOMEDS_AttributeTableOfString_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
- for (int i = 0; i < theUnits.length(); i++) {
- aTable->SetRowUnit(i + 1, string((char*)theUnits[i].in()));
- }
-}
-
-SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRowUnits()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq;
- aUnits->length(aTable->GetNbRows());
- for(int i = 0; i < aUnits->length(); i++)
- aUnits[i] = CORBA::string_dup(aTable->GetRowUnit(i + 1).c_str());
- return aUnits._retn();
-}
-
-
-CORBA::Long SALOMEDS_AttributeTableOfString_i::GetNbRows()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl)->GetNbRows();
-}
-
-CORBA::Long SALOMEDS_AttributeTableOfString_i::GetNbColumns()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl)->GetNbColumns();
-}
-
-void SALOMEDS_AttributeTableOfString_i::AddRow(const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
-
- vector<string> aRow;
- for (int i = 0; i < theData.length(); i++) aRow.push_back(string(CORBA::string_dup(theData[i])));
- aTable->SetRowData(aTable->GetNbRows() + 1, aRow);
-}
-
-void SALOMEDS_AttributeTableOfString_i::SetRow(CORBA::Long theRow, const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
-
- vector<string> aRow;
- for (int i = 0; i < theData.length(); i++) aRow.push_back(string(CORBA::string_dup(theData[i].in())));
- aTable->SetRowData(theRow, aRow);
-}
-
-SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRow(CORBA::Long theRow)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectIndex);
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
-
- SALOMEDS::StringSeq_var CorbaSeq = new SALOMEDS::StringSeq;
- vector<string> aRow = aTable->GetRowData(theRow);
- CorbaSeq->length(aRow.size());
- for (int i = 0; i < aRow.size(); i++) {
- CorbaSeq[i] = CORBA::string_dup(aRow[i].c_str());
- }
- return CorbaSeq._retn();
-}
-
-void SALOMEDS_AttributeTableOfString_i::AddColumn(const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
-
- vector<string> aColumn;
- for (int i = 0; i < theData.length(); i++) aColumn.push_back(string(CORBA::string_dup(theData[i])));
- aTable->SetColumnData(aTable->GetNbColumns() + 1, aColumn);
-}
-
-void SALOMEDS_AttributeTableOfString_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectArgumentLength);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
-
- vector<string> aColumn;
- for (int i = 0; i < theData.length(); i++) aColumn.push_back(string(CORBA::string_dup(theData[i])));
- aTable->SetColumnData(theColumn, aColumn);
-}
-
-SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetColumn(CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectIndex);
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
-
- SALOMEDS::StringSeq_var CorbaSeq = new SALOMEDS::StringSeq;
- vector<string> aColumn = aTable->GetColumnData(theColumn);
- CorbaSeq->length(aColumn.size());
- for (int i = 0; i < aColumn.size(); i++) {
- CorbaSeq[i] = CORBA::string_dup(aColumn[i].c_str());
- }
- return CorbaSeq._retn();
-}
-
-void SALOMEDS_AttributeTableOfString_i::PutValue(const char* theValue, CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectIndex);
- CheckLocked();
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- char* aValue = CORBA::string_dup(theValue);
-
- aTable->PutValue(aValue, theRow, theColumn);
-}
-
-CORBA::Boolean SALOMEDS_AttributeTableOfString_i::HasValue(CORBA::Long theRow, CORBA::Long theColumn)
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl)->HasValue(theRow, theColumn);
-}
-
-char* SALOMEDS_AttributeTableOfString_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(ATS_IncorrectIndex);
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
-
- string aValue;
- try {
- aValue = aTable->GetValue(theRow, theColumn);
- }
- catch(...) {
- throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
- }
-
- return CORBA::string_dup(aValue.c_str());
-}
-
-
-SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::GetRowSetIndices(CORBA::Long theRow)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
-
- if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
-
- SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- vector<int> aSeq = aTable->GetSetRowIndices(theRow);
- CorbaSeq->length(aSeq.size());
- for (int i = 0; i < aSeq.size(); i++) {
- CorbaSeq[i] = aSeq[i];
- }
- return CorbaSeq._retn();
-}
-
-
-void SALOMEDS_AttributeTableOfString_i::SetNbColumns(CORBA::Long theNbColumns)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
- aTable->SetNbColumns(theNbColumns);
-}
-
-bool SALOMEDS_AttributeTableOfString_i::ReadFromFile(const SALOMEDS::TMPFile& theStream)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
-
- string aStream((char*)&theStream[0], theStream.length());
- aTable->Load(aStream);
- return true;
-}
-
-SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfString_i::SaveToFile()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(_impl);
-
- string aString = aTable->Save();
- char* aBuffer = (char*)CORBA::string_dup(aString.c_str());
- int aBufferSize = strlen((char*)aBuffer);
-
- CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer;
-
- SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1);
-
- return aStreamFile._retn();
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTableOfString_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeTableOfString_i_HeaderFile
-#define SALOMEDS_AttributeTableOfString_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeTableOfString.hxx"
-
-class SALOMEDS_AttributeTableOfString_i: public virtual POA_SALOMEDS::AttributeTableOfString,
- public virtual SALOMEDS_GenericAttribute_i {
-
-public:
-
- SALOMEDS_AttributeTableOfString_i(SALOMEDSImpl_AttributeTableOfString* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeTableOfString_i() {};
-
- virtual void SetTitle(const char* theTitle);
- virtual char* GetTitle();
- virtual void SetRowTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
- virtual void SetRowTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength);
- virtual SALOMEDS::StringSeq* GetRowTitles();
- virtual void SetColumnTitle(CORBA::Long theIndex, const char* theTitle)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
- virtual void SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength);
- virtual SALOMEDS::StringSeq* GetColumnTitles();
-
- virtual void SetRowUnit(CORBA::Long theIndex, const char* theUnit)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
- virtual void SetRowUnits(const SALOMEDS::StringSeq& theUnits)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength);
- virtual SALOMEDS::StringSeq* GetRowUnits();
-
- virtual CORBA::Long GetNbRows();
- virtual CORBA::Long GetNbColumns();
- virtual void AddRow(const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength);
- virtual void SetRow(CORBA::Long theRow, const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectIndex);
- virtual SALOMEDS::StringSeq* GetRow(CORBA::Long theRow)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
- virtual void AddColumn(const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength);
- virtual void SetColumn(CORBA::Long theColumn, const SALOMEDS::StringSeq& theData)
- throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectIndex);
- virtual SALOMEDS::StringSeq* GetColumn(CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
- virtual void PutValue(const char* theValue, CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
- virtual CORBA::Boolean HasValue(CORBA::Long theRow, CORBA::Long theColumn);
- virtual char* GetValue(CORBA::Long theRow, CORBA::Long theColumn)
- throw (SALOMEDS::AttributeTableOfString::IncorrectIndex);
-
- virtual SALOMEDS::LongSeq* GetRowSetIndices(CORBA::Long theRow);
- virtual void SetNbColumns(CORBA::Long theNbColumns);
-
- virtual bool ReadFromFile(const SALOMEDS::TMPFile& theStream);
- virtual SALOMEDS::TMPFile* SaveToFile();
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTarget.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTarget.hxx"
-#include "SALOMEDS.hxx"
-
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDS_SObject.hxx"
-
-using namespace std;
-
-SALOMEDS_AttributeTarget::SALOMEDS_AttributeTarget(SALOMEDSImpl_AttributeTarget* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTarget::SALOMEDS_AttributeTarget(SALOMEDS::AttributeTarget_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTarget::~SALOMEDS_AttributeTarget()
-{}
-
-void SALOMEDS_AttributeTarget::Add(const _PTR(SObject)& theObject)
-{
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
-
- if (_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_local_impl)->Add(*(aSO->GetLocalImpl()));
- }
- else SALOMEDS::AttributeTarget::_narrow(_corba_impl)->Add(aSO->GetCORBAImpl());
-}
-
-std::vector<_PTR(SObject)> SALOMEDS_AttributeTarget::Get()
-{
- std::vector<_PTR(SObject)> aVector;
- int aLength, i;
- SALOMEDSClient_SObject* aSO = NULL;
-
- if (_isLocal) {
- SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_SObject> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_local_impl)->Get();
- aLength = aSeq.size();
- for (i = 0; i < aLength; i++) {
- aSO = new SALOMEDS_SObject(aSeq[i]);
- aVector.push_back(_PTR(SObject)(aSO));
- }
- }
- else {
- SALOMEDS::Study::ListOfSObject_var aSeq = SALOMEDS::AttributeTarget::_narrow(_corba_impl)->Get();
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) {
- aSO = new SALOMEDS_SObject(aSeq[i].in());
- aVector.push_back(_PTR(SObject)(aSO));
- }
- }
-
- return aVector;
-}
-
-void SALOMEDS_AttributeTarget::Remove(const _PTR(SObject)& theObject)
-{
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
-
- if (_isLocal) {
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_local_impl)->Remove(*(aSO->GetLocalImpl()));
- }
- else SALOMEDS::AttributeTarget::_narrow(_corba_impl)->Remove(aSO->GetCORBAImpl());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTarget.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeTarget_HeaderFile
-#define SALOMEDS_AttributeTarget_HeaderFile
-
-#include <vector>
-
-#include "SALOMEDSClient.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeTarget.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeTarget: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeTarget
-{
-public:
- SALOMEDS_AttributeTarget(SALOMEDSImpl_AttributeTarget* theAttr);
- SALOMEDS_AttributeTarget(SALOMEDS::AttributeTarget_ptr theAttr);
- ~SALOMEDS_AttributeTarget();
-
- virtual void Add(const _PTR(SObject)& theObject);
- virtual std::vector<_PTR(SObject)> Get();
- virtual void Remove(const _PTR(SObject)& theObject);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTarget_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTarget_i.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-#include "SALOMEDS.hxx"
-#include "DF_Label.hxx"
-
-#include <vector>
-
-using namespace std;
-
-void SALOMEDS_AttributeTarget_i::Add(SALOMEDS::SObject_ptr anObject)
-{
- SALOMEDS::Locker lock;
- DF_Label aLabel = DF_Label::Label(_impl->Label(), anObject->GetID(), 1);
- dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_impl)->Add(SALOMEDSImpl_Study::SObject(aLabel));
-}
-
-SALOMEDS::Study::ListOfSObject* SALOMEDS_AttributeTarget_i::Get()
-{
- SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_SObject> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_impl)->Get();
- SALOMEDS::Study::ListOfSObject_var aSList = new SALOMEDS::Study::ListOfSObject;
- int aLength = aSeq.size(), i;
- if (aLength == 0) return aSList._retn();
- aSList->length(aLength);
- for(i=0; i <aLength; i++) {
- SALOMEDS::SObject_var anSO = SALOMEDS_SObject_i::New(aSeq[i], _orb);
- aSList[i] = anSO;
- }
- return aSList._retn();
-}
-
-void SALOMEDS_AttributeTarget_i::Remove(SALOMEDS::SObject_ptr anObject)
-{
- SALOMEDS::Locker lock;
- DF_Label aLabel = DF_Label::Label(_impl->Label(), anObject->GetID(), 1);
- dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_impl)->Remove(SALOMEDSImpl_Study::SObject(aLabel));
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTarget_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeTarget_i_HeaderFile
-#define SALOMEDS_AttributeTarget_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeTarget.hxx"
-
-class SALOMEDS_AttributeTarget_i: public virtual POA_SALOMEDS::AttributeTarget,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributeTarget_i(SALOMEDSImpl_AttributeTarget* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeTarget_i() {};
-
- virtual void Add(SALOMEDS::SObject_ptr anObject) ;
- virtual SALOMEDS::Study::ListOfSObject* Get();
- virtual void Remove(SALOMEDS::SObject_ptr anObject);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTextColor.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTextColor.hxx"
-#include "SALOMEDS.hxx"
-
-#include <vector>
-
-using namespace std;
-
-SALOMEDS_AttributeTextColor::SALOMEDS_AttributeTextColor(SALOMEDSImpl_AttributeTextColor* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTextColor::SALOMEDS_AttributeTextColor(SALOMEDS::AttributeTextColor_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTextColor::~SALOMEDS_AttributeTextColor()
-{}
-
-
-STextColor SALOMEDS_AttributeTextColor::TextColor()
-{
- STextColor aColor;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- vector<double> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(_local_impl)->TextColor();
- aColor.R = aSeq[0];
- aColor.G = aSeq[1];
- aColor.B = aSeq[2];
- }
- else {
- SALOMEDS::Color anImplColor = SALOMEDS::AttributeTextColor::_narrow(_corba_impl)->TextColor();
- aColor.R = anImplColor.R;
- aColor.G = anImplColor.G;
- aColor.B = anImplColor.B;
- }
- return aColor;
-}
-
-void SALOMEDS_AttributeTextColor::SetTextColor(STextColor value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- vector<double> aSeq;
- aSeq.push_back( value.R );
- aSeq.push_back( value.G );
- aSeq.push_back( value.B );
- dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(_local_impl)->ChangeArray(aSeq);
- }
- else {
- SALOMEDS::Color aColor;
- aColor.R = value.R;
- aColor.G = value.G;
- aColor.B = value.B;
- SALOMEDS::AttributeTextColor::_narrow(_corba_impl)->SetTextColor(aColor);
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTextColor.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeTextColor_HeaderFile
-#define SALOMEDS_AttributeTextColor_HeaderFile
-
-#include "SALOMEDSClient_AttributeTextColor.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeTextColor.hxx"
-#include "SALOMEDSClient_definitions.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include <vector>
-
-class SALOMEDS_AttributeTextColor: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeTextColor
-{
-public:
- SALOMEDS_AttributeTextColor(SALOMEDSImpl_AttributeTextColor* theAttr);
- SALOMEDS_AttributeTextColor(SALOMEDS::AttributeTextColor_ptr theAttr);
- ~SALOMEDS_AttributeTextColor();
-
- virtual STextColor TextColor();
- virtual void SetTextColor(STextColor value);
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTextColor_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTextColor_i.hxx"
-#include "SALOMEDS.hxx"
-#include <vector>
-
-using namespace std;
-
-SALOMEDS::Color SALOMEDS_AttributeTextColor_i::TextColor()
-{
- SALOMEDS::Locker lock;
- SALOMEDS::Color TextColor;
- vector<double> anArray = dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(_impl)->TextColor();
- if (anArray.size()!=3) {
- TextColor.R = 0;
- TextColor.G = 0;
- TextColor.B = 0;
- }
- else {
- TextColor.R = anArray[0];
- TextColor.G = anArray[1];
- TextColor.B = anArray[2];
- }
- return TextColor;
-}
-
-void SALOMEDS_AttributeTextColor_i::SetTextColor(const SALOMEDS::Color& value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- vector<double> anArray;
- anArray.push_back(value.R);
- anArray.push_back(value.G);
- anArray.push_back(value.B);
- dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(_impl)->ChangeArray(anArray);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTextColor_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header$
-//
-#ifndef SALOMEDS_AttributeTextColor_i_HeaderFile
-#define SALOMEDS_AttributeTextColor_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeTextColor.hxx"
-
-class SALOMEDS_AttributeTextColor_i: public virtual POA_SALOMEDS::AttributeTextColor,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributeTextColor_i(SALOMEDSImpl_AttributeTextColor* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeTextColor_i() {};
-
- SALOMEDS::Color TextColor();
- void SetTextColor(const SALOMEDS::Color& value);
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTextHighlightColor.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTextHighlightColor.hxx"
-#include "SALOMEDS.hxx"
-
-#include <vector>
-
-using namespace std;
-
-SALOMEDS_AttributeTextHighlightColor::SALOMEDS_AttributeTextHighlightColor
- (SALOMEDSImpl_AttributeTextHighlightColor* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTextHighlightColor::SALOMEDS_AttributeTextHighlightColor
- (SALOMEDS::AttributeTextHighlightColor_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTextHighlightColor::~SALOMEDS_AttributeTextHighlightColor()
-{}
-
-
-STextColor SALOMEDS_AttributeTextHighlightColor::TextHighlightColor()
-{
- STextColor aColor;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- vector<double> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(_local_impl)->TextHighlightColor();
- aColor.R = aSeq[0];
- aColor.G = aSeq[1];
- aColor.B = aSeq[2];
- }
- else {
- SALOMEDS::Color anImplColor =
- SALOMEDS::AttributeTextHighlightColor::_narrow(_corba_impl)->TextHighlightColor();
- aColor.R = anImplColor.R;
- aColor.G = anImplColor.G;
- aColor.B = anImplColor.B;
- }
- return aColor;
-}
-
-void SALOMEDS_AttributeTextHighlightColor::SetTextHighlightColor(STextColor value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- vector<double> aSeq;
- aSeq.push_back(value.R);
- aSeq.push_back(value.G);
- aSeq.push_back(value.B);
- dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(_local_impl)->ChangeArray(aSeq);
- }
- else {
- SALOMEDS::Color aColor;
- aColor.R = value.R;
- aColor.G = value.G;
- aColor.B = value.B;
- SALOMEDS::AttributeTextHighlightColor::_narrow(_corba_impl)->SetTextHighlightColor(aColor);
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTextHighlightColor.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeTextHighlightColor_HeaderFile
-#define SALOMEDS_AttributeTextHighlightColor_HeaderFile
-
-#include "SALOMEDSClient_AttributeTextHighlightColor.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeTextHighlightColor.hxx"
-#include "SALOMEDSClient_definitions.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include <vector>
-
-class SALOMEDS_AttributeTextHighlightColor: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeTextHighlightColor
-{
-public:
- SALOMEDS_AttributeTextHighlightColor(SALOMEDSImpl_AttributeTextHighlightColor* theAttr);
- SALOMEDS_AttributeTextHighlightColor(SALOMEDS::AttributeTextHighlightColor_ptr theAttr);
- ~SALOMEDS_AttributeTextHighlightColor();
-
- virtual STextColor TextHighlightColor();
- virtual void SetTextHighlightColor(STextColor value);
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTextHighlightColor_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTextHighlightColor_i.hxx"
-#include "SALOMEDS.hxx"
-#include <vector>
-
-using namespace std;
-
-SALOMEDS::Color SALOMEDS_AttributeTextHighlightColor_i::TextHighlightColor()
-{
- SALOMEDS::Locker lock;
- SALOMEDS::Color TextHighlightColor;
- vector<double> anArray = dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(_impl)->TextHighlightColor();
- if (anArray.size()!=3) {
- TextHighlightColor.R = 0;
- TextHighlightColor.G = 0;
- TextHighlightColor.B = 0;
- }
- else {
- TextHighlightColor.R = anArray[0];
- TextHighlightColor.G = anArray[1];
- TextHighlightColor.B = anArray[2];
- }
- return TextHighlightColor;
-}
-
-void SALOMEDS_AttributeTextHighlightColor_i::SetTextHighlightColor(const SALOMEDS::Color& value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- vector<double> anArray;
- anArray.push_back(value.R);
- anArray.push_back(value.G);
- anArray.push_back(value.B);
- dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(_impl)->ChangeArray(anArray);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTextHighlightColor_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeTextHighlightColor_i_HeaderFile
-#define SALOMEDS_AttributeTextHighlightColor_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeTextHighlightColor.hxx"
-
-class SALOMEDS_AttributeTextHighlightColor_i: public virtual POA_SALOMEDS::AttributeTextHighlightColor,
- public virtual SALOMEDS_GenericAttribute_i
-{
-public:
-
- SALOMEDS_AttributeTextHighlightColor_i(SALOMEDSImpl_AttributeTextHighlightColor* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeTextHighlightColor_i() {};
-
- SALOMEDS::Color TextHighlightColor();
- void SetTextHighlightColor(const SALOMEDS::Color& value);
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTreeNode.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTreeNode.hxx"
-#include "SALOMEDS.hxx"
-
-#include <string>
-#include <stdexcept>
-
-#include "SALOMEDSImpl_AttributeTreeNode.hxx"
-#include "SALOMEDS_AttributeTreeNode.hxx"
-
-using namespace std;
-
-SALOMEDS_AttributeTreeNode::SALOMEDS_AttributeTreeNode(SALOMEDSImpl_AttributeTreeNode* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTreeNode::SALOMEDS_AttributeTreeNode(SALOMEDS::AttributeTreeNode_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeTreeNode::~SALOMEDS_AttributeTreeNode()
-{}
-
-void SALOMEDS_AttributeTreeNode::SetFather(const _PTR(AttributeTreeNode)& value)
-{
- SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode *aNode, *aFather;
- aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- aFather = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(aTN->_local_impl);
- aNode->SetFather(aFather);
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- SALOMEDS::AttributeTreeNode_var aFather = SALOMEDS::AttributeTreeNode::_narrow(aTN->_corba_impl);
- aNode->SetFather(aFather);
- }
-}
-
-bool SALOMEDS_AttributeTreeNode::HasFather()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- ret = aNode->HasFather();
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- ret = aNode->HasFather();
- }
- return ret;
-}
-
-_PTR(AttributeTreeNode) SALOMEDS_AttributeTreeNode::GetFather()
-{
- SALOMEDSClient_AttributeTreeNode* aTN = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- aTN = new SALOMEDS_AttributeTreeNode(aNode->GetFather());
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- aTN = new SALOMEDS_AttributeTreeNode(aNode->GetFather());
- }
- return _PTR(AttributeTreeNode)(aTN);
-}
-
-void SALOMEDS_AttributeTreeNode::SetPrevious(const _PTR(AttributeTreeNode)& value)
-{
- SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode *aNode, *aPrev;
- aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- aPrev = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(aTN->_local_impl);
- aNode->SetPrevious(aPrev);
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- SALOMEDS::AttributeTreeNode_var aPrev = SALOMEDS::AttributeTreeNode::_narrow(aTN->_corba_impl);
- aNode->SetPrevious(aPrev);
- }
-}
-
-bool SALOMEDS_AttributeTreeNode::HasPrevious()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- ret = aNode->HasPrevious();
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- ret = aNode->HasPrevious();
- }
- return ret;
-}
-
-_PTR(AttributeTreeNode) SALOMEDS_AttributeTreeNode::GetPrevious()
-{
- SALOMEDSClient_AttributeTreeNode* aTN = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- aTN = new SALOMEDS_AttributeTreeNode(aNode->GetPrevious());
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- aTN = new SALOMEDS_AttributeTreeNode(aNode->GetPrevious());
- }
- return _PTR(AttributeTreeNode)(aTN);
-}
-
-void SALOMEDS_AttributeTreeNode::SetNext(const _PTR(AttributeTreeNode)& value)
-{
- SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode *aNode, *aNext;
- aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- aNext = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(aTN->_local_impl);
- aNode->SetNext(aNext);
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- SALOMEDS::AttributeTreeNode_var aNext = SALOMEDS::AttributeTreeNode::_narrow(aTN->_corba_impl);
- aNode->SetNext(aNext);
- }
-}
-
-bool SALOMEDS_AttributeTreeNode::HasNext()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- ret = aNode->HasNext();
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- ret = aNode->HasNext();
- }
- return ret;
-}
-
-_PTR(AttributeTreeNode) SALOMEDS_AttributeTreeNode::GetNext()
-{
- SALOMEDSClient_AttributeTreeNode* aTN = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- aTN = new SALOMEDS_AttributeTreeNode(aNode->GetNext());
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- aTN = new SALOMEDS_AttributeTreeNode(aNode->GetNext());
- }
- return _PTR(AttributeTreeNode)(aTN);
-}
-
-void SALOMEDS_AttributeTreeNode::SetFirst(const _PTR(AttributeTreeNode)& value)
-{
- SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode *aNode, *aFirst;
- aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- aFirst = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(aTN->_local_impl);
- aNode->SetFirst(aFirst);
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- SALOMEDS::AttributeTreeNode_var aFirst = SALOMEDS::AttributeTreeNode::_narrow(aTN->_corba_impl);
- aNode->SetFirst(aFirst);
- }
-}
-
-bool SALOMEDS_AttributeTreeNode::HasFirst()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- ret = aNode->HasFirst();
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- ret = aNode->HasFirst();
- }
- return ret;
-}
-
-_PTR(AttributeTreeNode) SALOMEDS_AttributeTreeNode::GetFirst()
-{
- SALOMEDSClient_AttributeTreeNode* aTN = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- aTN = new SALOMEDS_AttributeTreeNode(aNode->GetFirst());
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- aTN = new SALOMEDS_AttributeTreeNode(aNode->GetFirst());
- }
- return _PTR(AttributeTreeNode)(aTN);
-}
-
-void SALOMEDS_AttributeTreeNode::SetTreeID(const std::string& value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- aNode->SetTreeID(value);
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- aNode->SetTreeID(value.c_str());
- }
-}
-
-std::string SALOMEDS_AttributeTreeNode::GetTreeID()
-{
- string aGUID;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- aGUID = aNode->GetTreeID();
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- aGUID = aNode->GetTreeID();
- }
-
- return aGUID;
-}
-
-void SALOMEDS_AttributeTreeNode::Append(const _PTR(AttributeTreeNode)& value)
-{
- SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode *aNode, *anOther;
- aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- anOther = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(aTN->_local_impl);
- aNode->Append(anOther);
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- SALOMEDS::AttributeTreeNode_var anOther = SALOMEDS::AttributeTreeNode::_narrow(aTN->_corba_impl);
- aNode->Append(anOther);
- }
-}
-
-void SALOMEDS_AttributeTreeNode::Prepend(const _PTR(AttributeTreeNode)& value)
-{
- SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode *aNode, *anOther;
- aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- anOther = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(aTN->_local_impl);
- aNode->Prepend(anOther);
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- SALOMEDS::AttributeTreeNode_var anOther = SALOMEDS::AttributeTreeNode::_narrow(aTN->_corba_impl);
- aNode->Prepend(anOther);
- }
-}
-
-void SALOMEDS_AttributeTreeNode::InsertBefore(const _PTR(AttributeTreeNode)& value)
-{
- SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode *aNode, *anOther;
- aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- anOther = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(aTN->_local_impl);
- aNode->InsertBefore(anOther);
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- SALOMEDS::AttributeTreeNode_var anOther = SALOMEDS::AttributeTreeNode::_narrow(aTN->_corba_impl);
- aNode->InsertBefore(anOther);
- }
-}
-
-void SALOMEDS_AttributeTreeNode::InsertAfter(const _PTR(AttributeTreeNode)& value)
-{
- SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode *aNode, *anOther;
- aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- anOther = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(aTN->_local_impl);
- aNode->InsertAfter(anOther);
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- SALOMEDS::AttributeTreeNode_var anOther = SALOMEDS::AttributeTreeNode::_narrow(aTN->_corba_impl);
- aNode->InsertAfter(anOther);
- }
-}
-
-void SALOMEDS_AttributeTreeNode::Remove()
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl)->Remove();
- }
- else SALOMEDS::AttributeTreeNode::_narrow(_corba_impl)->Remove();
-}
-
-int SALOMEDS_AttributeTreeNode::Depth()
-{
- int aDepth;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aDepth = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl)->Depth();
- }
- else aDepth = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl)->Depth();
- return aDepth;
-}
-
-bool SALOMEDS_AttributeTreeNode::IsRoot()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl)->IsRoot();
- }
- else ret = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl)->IsRoot();
- return ret;
-}
-
-bool SALOMEDS_AttributeTreeNode::IsDescendant(const _PTR(AttributeTreeNode)& value)
-{
- bool ret;
- SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode *aNode, *anOther;
- aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- anOther = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(aTN->_local_impl);
- ret = aNode->IsDescendant(anOther);
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- SALOMEDS::AttributeTreeNode_var anOther = SALOMEDS::AttributeTreeNode::_narrow(aTN->_corba_impl);
- ret = aNode->IsDescendant(anOther);
- }
- return ret;
-}
-
-bool SALOMEDS_AttributeTreeNode::IsFather(const _PTR(AttributeTreeNode)& value)
-{
- bool ret;
- SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode *aNode, *anOther;
- aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- anOther = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(aTN->_local_impl);
- ret = aNode->IsFather(anOther);
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- SALOMEDS::AttributeTreeNode_var anOther = SALOMEDS::AttributeTreeNode::_narrow(aTN->_corba_impl);
- ret = aNode->IsFather(anOther);
- }
- return ret;
-}
-
-bool SALOMEDS_AttributeTreeNode::IsChild(const _PTR(AttributeTreeNode)& value)
-{
- bool ret;
- SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode *aNode, *anOther;
- aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
- anOther = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(aTN->_local_impl);
- ret = aNode->IsChild(anOther);
- }
- else {
- SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl);
- SALOMEDS::AttributeTreeNode_var anOther = SALOMEDS::AttributeTreeNode::_narrow(aTN->_corba_impl);
- ret = aNode->IsChild(anOther);
- }
- return ret;
-}
-
-std::string SALOMEDS_AttributeTreeNode::Label()
-{
- string aLabel;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aLabel = _local_impl->Label().Entry();
- }
- else aLabel = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl)->Label();
- return aLabel;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTreeNode.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeTreeNode_HeaderFile
-#define SALOMEDS_AttributeTreeNode_HeaderFile
-
-#include "SALOMEDSClient_AttributeTreeNode.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeTreeNode.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeTreeNode: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeTreeNode
-{
-public:
- SALOMEDS_AttributeTreeNode(SALOMEDSImpl_AttributeTreeNode* theAttr);
- SALOMEDS_AttributeTreeNode(SALOMEDS::AttributeTreeNode_ptr theAttr);
- ~SALOMEDS_AttributeTreeNode();
-
- virtual void SetFather(const _PTR(AttributeTreeNode)& value);
- virtual bool HasFather();
- virtual _PTR(AttributeTreeNode) GetFather();
- virtual void SetPrevious(const _PTR(AttributeTreeNode)& value);
- virtual bool HasPrevious();
- virtual _PTR(AttributeTreeNode) GetPrevious();
- virtual void SetNext(const _PTR(AttributeTreeNode)& value);
- virtual bool HasNext();
- virtual _PTR(AttributeTreeNode) GetNext();
- virtual void SetFirst(const _PTR(AttributeTreeNode)& value);
- virtual bool HasFirst();
- virtual _PTR(AttributeTreeNode) GetFirst();
- virtual void SetTreeID(const std::string& value);
- virtual std::string GetTreeID();
- virtual void Append(const _PTR(AttributeTreeNode)& value);
- virtual void Prepend(const _PTR(AttributeTreeNode)& value);
- virtual void InsertBefore(const _PTR(AttributeTreeNode)& value);
- virtual void InsertAfter(const _PTR(AttributeTreeNode)& value);
- virtual void Remove();
- virtual int Depth();
- virtual bool IsRoot();
- virtual bool IsDescendant(const _PTR(AttributeTreeNode)& value);
- virtual bool IsFather(const _PTR(AttributeTreeNode)& value);
- virtual bool IsChild(const _PTR(AttributeTreeNode)& value);
- virtual std::string Label();
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTreeNode_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeTreeNode_i.hxx"
-#include "utilities.h"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-static SALOMEDSImpl_AttributeTreeNode* GetNode(SALOMEDS::AttributeTreeNode_ptr value,
- SALOMEDSImpl_AttributeTreeNode* aNode)
-{
- SALOMEDSImpl_AttributeTreeNode* aResult = NULL;
- DF_Label aLabel = DF_Label::Label(aNode->Label(), value->Label());
- if (aLabel.IsNull()) {
- MESSAGE("SALOMEDS_AttributeTreeNode_i class: no such label")
- MESSAGE("SALOMEDS_AttributeTreeNode_i class: no such label")
- return aResult;
- }
- if (!(aResult=(SALOMEDSImpl_AttributeTreeNode*)aLabel.FindAttribute(aNode->ID()))) {
- MESSAGE("SALOMEDS_AttributeTreeNode_i class: no such attribute")
- MESSAGE("SALOMEDS_AttributeTreeNode_i class: no such attribute")
- }
- return aResult;
-}
-
-void SALOMEDS_AttributeTreeNode_i::SetFather(SALOMEDS::AttributeTreeNode_ptr value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- aNode->SetFather(GetNode(value, aNode));
-}
-
-CORBA::Boolean SALOMEDS_AttributeTreeNode_i::HasFather()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl)->HasFather();
-}
-
-SALOMEDS::AttributeTreeNode_ptr SALOMEDS_AttributeTreeNode_i::GetFather()
-{
- SALOMEDS::Locker lock;
- SALOMEDS_AttributeTreeNode_i* aFather;
- aFather = new SALOMEDS_AttributeTreeNode_i(dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl)->GetFather(), _orb);
-#ifndef WIN32
- return aFather->POA_SALOMEDS::AttributeTreeNode::_this();
-#else
- return aFather->AttributeTreeNode::_this();
-#endif
-}
-
-void SALOMEDS_AttributeTreeNode_i::SetPrevious(SALOMEDS::AttributeTreeNode_ptr value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- aNode->SetPrevious(GetNode(value, aNode));
-}
-
-CORBA::Boolean SALOMEDS_AttributeTreeNode_i::HasPrevious()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl)->HasPrevious();
-}
-
-SALOMEDS::AttributeTreeNode_ptr SALOMEDS_AttributeTreeNode_i::GetPrevious()
-{
- SALOMEDS::Locker lock;
- SALOMEDS_AttributeTreeNode_i* aPrevious;
- aPrevious=new SALOMEDS_AttributeTreeNode_i(dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl)->GetPrevious(), _orb);
-#ifndef WIN32
- return aPrevious->POA_SALOMEDS::AttributeTreeNode::_this();
-#else
- return aPrevious->AttributeTreeNode::_this();
-#endif
-}
-
-void SALOMEDS_AttributeTreeNode_i::SetNext(SALOMEDS::AttributeTreeNode_ptr value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- aNode->SetNext(GetNode(value, aNode));
-}
-
-CORBA::Boolean SALOMEDS_AttributeTreeNode_i::HasNext()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl)->HasNext();
-}
-
-SALOMEDS::AttributeTreeNode_ptr SALOMEDS_AttributeTreeNode_i::GetNext()
-{
- SALOMEDS::Locker lock;
- SALOMEDS_AttributeTreeNode_i* aNext;
- aNext = new SALOMEDS_AttributeTreeNode_i(dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl)->GetNext(), _orb);
-#ifndef WIN32
- return aNext->POA_SALOMEDS::AttributeTreeNode::_this();
-#else
- return aNext->AttributeTreeNode::_this();
-#endif
-}
-
-void SALOMEDS_AttributeTreeNode_i::SetFirst(SALOMEDS::AttributeTreeNode_ptr value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- aNode->SetFirst(GetNode(value, aNode));
-}
-
-CORBA::Boolean SALOMEDS_AttributeTreeNode_i::HasFirst()
-{
- SALOMEDS::Locker lock;
- return dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl)->HasFirst();
-}
-
-SALOMEDS::AttributeTreeNode_ptr SALOMEDS_AttributeTreeNode_i::GetFirst()
-{
- SALOMEDS::Locker lock;
- SALOMEDS_AttributeTreeNode_i* aFirst;
- aFirst = new SALOMEDS_AttributeTreeNode_i(dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl)->GetFirst(), _orb);
-#ifndef WIN32
- return aFirst->POA_SALOMEDS::AttributeTreeNode::_this();
-#else
- return aFirst->AttributeTreeNode::_this();
-#endif
-}
-
-void SALOMEDS_AttributeTreeNode_i::SetTreeID(const char* value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- aNode->SetTreeID(value);
-}
-
-char* SALOMEDS_AttributeTreeNode_i::GetTreeID()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- return CORBA::String_var(CORBA::string_dup(aNode->ID().c_str()))._retn();
-}
-
-void SALOMEDS_AttributeTreeNode_i::Append(SALOMEDS::AttributeTreeNode_ptr value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- aNode->Append(GetNode(value, aNode));
-}
-
-void SALOMEDS_AttributeTreeNode_i::Prepend(SALOMEDS::AttributeTreeNode_ptr value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- aNode->Prepend(GetNode(value, aNode));
-}
-
-void SALOMEDS_AttributeTreeNode_i::InsertBefore(SALOMEDS::AttributeTreeNode_ptr value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- aNode->InsertBefore(GetNode(value, aNode));
-}
-
-void SALOMEDS_AttributeTreeNode_i::InsertAfter(SALOMEDS::AttributeTreeNode_ptr value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- aNode->InsertAfter(GetNode(value, aNode));
-}
-
-void SALOMEDS_AttributeTreeNode_i::Remove()
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- aNode->Remove();
-}
-
-CORBA::Long SALOMEDS_AttributeTreeNode_i::Depth()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- return aNode->Depth();
-}
-
-CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsRoot()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- return aNode->IsRoot();
-}
-
-CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsDescendant(SALOMEDS::AttributeTreeNode_ptr value)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- return aNode->IsDescendant(GetNode(value, aNode));
-}
-
-CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsFather(SALOMEDS::AttributeTreeNode_ptr value)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- return aNode->IsFather(GetNode(value, aNode));
-}
-
-CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsChild(SALOMEDS::AttributeTreeNode_ptr value)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_impl);
- return aNode->IsChild(GetNode(value, aNode));
-}
-
-char* SALOMEDS_AttributeTreeNode_i::Label()
-{
- SALOMEDS::Locker lock;
- return CORBA::String_var(CORBA::string_dup(_impl->Label().Entry().c_str()))._retn();
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeTreeNode_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeTreeNode_i_HeaderFile
-#define SALOMEDS_AttributeTreeNode_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeTreeNode.hxx"
-
-class SALOMEDS_AttributeTreeNode_i: public virtual POA_SALOMEDS::AttributeTreeNode,
- public virtual SALOMEDS_GenericAttribute_i {
-public:
-
- SALOMEDS_AttributeTreeNode_i(SALOMEDSImpl_AttributeTreeNode* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeTreeNode_i() {};
-
- void SetFather(SALOMEDS::AttributeTreeNode_ptr value);
- CORBA::Boolean HasFather();
- SALOMEDS::AttributeTreeNode_ptr GetFather();
- void SetPrevious(SALOMEDS::AttributeTreeNode_ptr value);
- CORBA::Boolean HasPrevious();
- SALOMEDS::AttributeTreeNode_ptr GetPrevious();
- void SetNext(SALOMEDS::AttributeTreeNode_ptr value);
- CORBA::Boolean HasNext();
- SALOMEDS::AttributeTreeNode_ptr GetNext();
- void SetFirst(SALOMEDS::AttributeTreeNode_ptr value);
- CORBA::Boolean HasFirst();
- SALOMEDS::AttributeTreeNode_ptr GetFirst();
- void SetTreeID(const char* value);
- char* GetTreeID();
- void Append(SALOMEDS::AttributeTreeNode_ptr value);
- void Prepend(SALOMEDS::AttributeTreeNode_ptr value);
- void InsertBefore(SALOMEDS::AttributeTreeNode_ptr value);
- void InsertAfter(SALOMEDS::AttributeTreeNode_ptr value);
- void Remove();
- CORBA::Long Depth();
- CORBA::Boolean IsRoot();
- CORBA::Boolean IsDescendant(SALOMEDS::AttributeTreeNode_ptr value);
- CORBA::Boolean IsFather(SALOMEDS::AttributeTreeNode_ptr value);
- CORBA::Boolean IsChild(SALOMEDS::AttributeTreeNode_ptr value);
- char* Label();
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeUserID.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeUserID.hxx"
-#include "SALOMEDS.hxx"
-
-#include <string>
-#include <stdexcept>
-
-SALOMEDS_AttributeUserID::SALOMEDS_AttributeUserID(SALOMEDSImpl_AttributeUserID* theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeUserID::SALOMEDS_AttributeUserID(SALOMEDS::AttributeUserID_ptr theAttr)
-:SALOMEDS_GenericAttribute(theAttr)
-{}
-
-SALOMEDS_AttributeUserID::~SALOMEDS_AttributeUserID()
-{}
-
-std::string SALOMEDS_AttributeUserID::Value()
-{
- std::string aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- // char guid[40];
- aValue = dynamic_cast<SALOMEDSImpl_AttributeUserID*>(_local_impl)->Value();
- }
- else aValue = SALOMEDS::AttributeUserID::_narrow(_corba_impl)->Value();
- return aValue;
-}
-
-void SALOMEDS_AttributeUserID::SetValue(const std::string& value)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
- dynamic_cast<SALOMEDSImpl_AttributeUserID*>(_local_impl)->SetValue(value);
- }
- else SALOMEDS::AttributeUserID::_narrow(_corba_impl)->SetValue(value.c_str());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeUserID.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeUserID_HeaderFile
-#define SALOMEDS_AttributeUserID_HeaderFile
-
-#include "SALOMEDSClient_AttributeUserID.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeUserID.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SALOMEDS_AttributeUserID: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeUserID
-{
-public:
- SALOMEDS_AttributeUserID(SALOMEDSImpl_AttributeUserID* theAttr);
- SALOMEDS_AttributeUserID(SALOMEDS::AttributeUserID_ptr theAttr);
- ~SALOMEDS_AttributeUserID();
-
- virtual std::string Value();
- virtual void SetValue(const std::string& value);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeName_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_AttributeUserID_i.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-char* SALOMEDS_AttributeUserID_i::Value()
-{
- SALOMEDS::Locker lock;
- CORBA::String_var c_s = CORBA::string_dup(dynamic_cast<SALOMEDSImpl_AttributeUserID*>(_impl)->ID().c_str());
- return c_s._retn();
-}
-
-void SALOMEDS_AttributeUserID_i::SetValue(const char* value)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- CORBA::String_var Str = CORBA::string_dup(value);
- dynamic_cast<SALOMEDSImpl_AttributeUserID*>(_impl)->SetValue(string(Str));
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_AttributeUserID_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDS_AttributeUserID_i_HeaderFile
-#define SALOMEDS_AttributeUserID_i_HeaderFile
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDSImpl_AttributeUserID.hxx"
-
-class SALOMEDS_AttributeUserID_i: public virtual POA_SALOMEDS::AttributeUserID,
- public virtual SALOMEDS_GenericAttribute_i {
-public:
-
- SALOMEDS_AttributeUserID_i(SALOMEDSImpl_AttributeUserID* theAttr, CORBA::ORB_ptr orb)
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
-
- ~SALOMEDS_AttributeUserID_i() {};
-
- char* Value();
- void SetValue(const char* value);
-
- static const std::string& DefaultID() {
- return SALOMEDSImpl_AttributeUserID::DefaultID();
- }
-
-};
-
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_Attributes.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_ATTRIBUTES__H__
-#define __SALOMEDS_ATTRIBUTES__H__
-
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeName.hxx"
-#include "SALOMEDSImpl_AttributeComment.hxx"
-#include "SALOMEDSImpl_AttributeInteger.hxx"
-#include "SALOMEDSImpl_AttributeReal.hxx"
-#include "SALOMEDSImpl_AttributeTreeNode.hxx"
-#include "SALOMEDSImpl_AttributeUserID.hxx"
-#include "SALOMEDSImpl_AttributeReference.hxx"
-#include "SALOMEDSImpl_AttributeSequenceOfReal.hxx"
-#include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx"
-#include "SALOMEDSImpl_AttributeIOR.hxx"
-#include "SALOMEDSImpl_AttributePersistentRef.hxx"
-#include "SALOMEDSImpl_AttributeDrawable.hxx"
-#include "SALOMEDSImpl_AttributeSelectable.hxx"
-#include "SALOMEDSImpl_AttributeExpandable.hxx"
-#include "SALOMEDSImpl_AttributeOpened.hxx"
-#include "SALOMEDSImpl_AttributeTextColor.hxx"
-#include "SALOMEDSImpl_AttributeTextHighlightColor.hxx"
-#include "SALOMEDSImpl_AttributePixMap.hxx"
-#include "SALOMEDSImpl_AttributeLocalID.hxx"
-#include "SALOMEDSImpl_AttributeTarget.hxx"
-#include "SALOMEDSImpl_AttributeTableOfInteger.hxx"
-#include "SALOMEDSImpl_AttributeTableOfReal.hxx"
-#include "SALOMEDSImpl_AttributeTableOfString.hxx"
-#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
-#include "SALOMEDSImpl_AttributePythonObject.hxx"
-#include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
-#include "SALOMEDSImpl_AttributeFileType.hxx"
-#include "SALOMEDSImpl_AttributeFlags.hxx"
-#include "SALOMEDSImpl_AttributeGraphic.hxx"
-#include "SALOMEDSImpl_AttributeParameter.hxx"
-#include "SALOMEDSImpl_AttributeString.hxx"
-
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDS_AttributeName_i.hxx"
-#include "SALOMEDS_AttributeComment_i.hxx"
-#include "SALOMEDS_AttributeInteger_i.hxx"
-#include "SALOMEDS_AttributeReal_i.hxx"
-#include "SALOMEDS_AttributeTreeNode_i.hxx"
-#include "SALOMEDS_AttributeUserID_i.hxx"
-#include "SALOMEDS_AttributeSequenceOfReal_i.hxx"
-#include "SALOMEDS_AttributeSequenceOfInteger_i.hxx"
-#include "SALOMEDS_AttributeIOR_i.hxx"
-#include "SALOMEDS_AttributePersistentRef_i.hxx"
-#include "SALOMEDS_AttributeDrawable_i.hxx"
-#include "SALOMEDS_AttributeSelectable_i.hxx"
-#include "SALOMEDS_AttributeExpandable_i.hxx"
-#include "SALOMEDS_AttributeOpened_i.hxx"
-#include "SALOMEDS_AttributeTextColor_i.hxx"
-#include "SALOMEDS_AttributeTextHighlightColor_i.hxx"
-#include "SALOMEDS_AttributePixMap_i.hxx"
-#include "SALOMEDS_AttributeLocalID_i.hxx"
-#include "SALOMEDS_AttributeTarget_i.hxx"
-#include "SALOMEDS_AttributeTableOfInteger_i.hxx"
-#include "SALOMEDS_AttributeTableOfReal_i.hxx"
-#include "SALOMEDS_AttributeTableOfString_i.hxx"
-#include "SALOMEDS_AttributeStudyProperties_i.hxx"
-#include "SALOMEDS_AttributePythonObject_i.hxx"
-#include "SALOMEDS_AttributeExternalFileDef_i.hxx"
-#include "SALOMEDS_AttributeFileType_i.hxx"
-#include "SALOMEDS_AttributeFlags_i.hxx"
-#include "SALOMEDS_AttributeGraphic_i.hxx"
-#include "SALOMEDS_AttributeParameter_i.hxx"
-#include "SALOMEDS_AttributeString_i.hxx"
-
-#define __CreateCORBAAttribute(CORBA_Name) if (strcmp(aTypeOfAttribute, #CORBA_Name) == 0) { \
- SALOMEDSImpl_##CORBA_Name* A = dynamic_cast<SALOMEDSImpl_##CORBA_Name*>(theAttr); \
- SALOMEDS_##CORBA_Name##_i* Attr = new SALOMEDS_##CORBA_Name##_i(A, theOrb); \
- attr_servant = Attr; \
- anAttribute = Attr->CORBA_Name::_this(); \
- }
-
-
-#define __CreateGenericCORBAAttribute \
-__CreateCORBAAttribute(AttributeReal) \
-__CreateCORBAAttribute(AttributeInteger) \
-__CreateCORBAAttribute(AttributeSequenceOfReal) \
-__CreateCORBAAttribute(AttributeSequenceOfInteger) \
-__CreateCORBAAttribute(AttributeName) \
-__CreateCORBAAttribute(AttributeComment) \
-__CreateCORBAAttribute(AttributeIOR) \
-__CreateCORBAAttribute(AttributePixMap) \
-__CreateCORBAAttribute(AttributeLocalID) \
-__CreateCORBAAttribute(AttributeTableOfInteger) \
-__CreateCORBAAttribute(AttributeTableOfReal) \
-__CreateCORBAAttribute(AttributeTableOfString) \
-__CreateCORBAAttribute(AttributePythonObject) \
-__CreateCORBAAttribute(AttributePersistentRef) \
-__CreateCORBAAttribute(AttributeDrawable) \
-__CreateCORBAAttribute(AttributeSelectable) \
-__CreateCORBAAttribute(AttributeExpandable) \
-__CreateCORBAAttribute(AttributeOpened) \
-__CreateCORBAAttribute(AttributeTextColor) \
-__CreateCORBAAttribute(AttributeTextHighlightColor) \
-__CreateCORBAAttribute(AttributeTarget) \
-__CreateCORBAAttribute(AttributeStudyProperties) \
-__CreateCORBAAttribute(AttributeExternalFileDef) \
-__CreateCORBAAttribute(AttributeFileType) \
-__CreateCORBAAttribute(AttributeFlags) \
-__CreateCORBAAttribute(AttributeGraphic) \
-__CreateCORBAAttribute(AttributeTreeNode) \
-__CreateCORBAAttribute(AttributeUserID) \
-__CreateCORBAAttribute(AttributeParameter) \
-__CreateCORBAAttribute(AttributeString)
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDS_BasicAttributeFactory.cxx
-// Author : Estelle Deville, CEA
-// Module : SALOME
-// $Header$
-//
-#include "SALOMEDS_BasicAttributeFactory.hxx"
-#include "utilities.h"
-using namespace std;
-
-//============================================================================
-/*! Function : Create
- * Purpose : create new basic attributes
- */
-//============================================================================
-SALOMEDS_BasicAttribute_i* BasicAttributeFactory::Create(const char* type)
- throw (SALOME_Exception)
-{
- try {
- if (!strcmp(type,"AttReal"))
- {
- SALOMEDS_AttReal_i *A = new SALOMEDS_AttReal_i();
- return A;
- }
- else if(!strcmp(type,"AttLong"))
- {
- SALOMEDS_AttLong_i *A = new SALOMEDS_AttLong_i();
- return A;
- }
- else throw(SALOME_Exception(LOCALIZED("bad attribute type name")));
- } catch (...) {throw(SALOME_Exception(LOCALIZED("Unexpected exception was caught")));}
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDS_BasicAttributeFactory.hxx
-// Author : Estelle Deville, CEA
-// Module : SALOME
-// $Header$
-//
-#ifndef _BASIC_ATTRIBUTEFACTORY_HXX_
-#define _BASIC_ATTRIBUTEFACTORY_HXX_
-#include "SALOMEDS_BasicAttribute_i.hxx"
-// Add new Attribute type here
-#include "SALOMEDS_AttReal_i.hxx"
-#include "SALOMEDS_AttLong_i.hxx"
-
-#include "Utils_SALOME_Exception.hxx"
-
-class BasicAttributeFactory
-{
-public:
- BasicAttributeFactory() {};
- virtual ~BasicAttributeFactory() {};
-
- SALOMEDS_BasicAttribute_i* Create(const char* type)
- throw (SALOME_Exception);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDS_BasicAttribute_i.cxx
-// Author : Estelle Deville, CEA
-// Module : SALOME
-// $Header$
-//
-#include "SALOMEDS_BasicAttribute_i.hxx"
-using namespace std;
-
-//============================================================================
-/*! Function : SetLabel
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_BasicAttribute_i::SetLabel(const DF_Label& Lab)
-{
- _Lab = Lab;
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDS_BasicAttribute_i.hxx
-// Author : Estelle Deville, CEA
-// Module : SALOME
-// $Header$
-//
-#ifndef _BASIC_ATTRIBUTE_I_HXX_
-#define _BASIC_ATTRIBUTE_I_HXX_
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include <DF_Label.hxx>
-
-class SALOMEDS_BasicAttribute_i: public POA_SALOMEDS::BasicAttribute,
- public PortableServer::ServantBase {
-protected:
- DF_Label _Lab;
-
-public:
- SALOMEDS_BasicAttribute_i() {};
-
- ~SALOMEDS_BasicAttribute_i() {};
-
- virtual char * Save() =0;
- virtual void Load () =0;
- CORBA::Boolean GetPtr(SALOMEDS::SObject so);
- void SetLabel(const DF_Label& Lab);
- virtual char* GetType() = 0;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDS_Study_i.hxx
-// Author : Yves FRICAUD
-// Module : SALOME
-//
-#ifndef __SALOMEDS_CALLBACK_I_H__
-#define __SALOMEDS_CALLBACK_I_H__
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-class SALOMEDS_Callback_i: public virtual POA_SALOMEDS::Callback,
- public virtual PortableServer::ServantBase
-{
-private:
- SALOMEDS::UseCaseBuilder_var _builder;
-
-public:
-
- SALOMEDS_Callback_i(SALOMEDS::UseCaseBuilder_ptr theBuilder) {
- _builder = SALOMEDS::UseCaseBuilder::_duplicate(theBuilder);
- }
-
- virtual void OnAddSObject(SALOMEDS::SObject_ptr theObject) {
- if(!_builder->_is_nil() && !theObject->_is_nil()) _builder->Append(theObject);
- }
-
- virtual void OnRemoveSObject(SALOMEDS::SObject_ptr theObject) {
- if(!_builder->_is_nil() && !theObject->_is_nil()) _builder->Remove(theObject);
- }
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_ChildIterator.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_ChildIterator.hxx"
-#include "SALOMEDS_SObject.hxx"
-#include "SALOMEDS.hxx"
-
-using namespace std;
-
-SALOMEDS_ChildIterator::SALOMEDS_ChildIterator(const SALOMEDSImpl_ChildIterator& theIterator)
-{
- SALOMEDS::Locker lock;
-
- _isLocal = true;
- _local_impl = theIterator.GetPersistentCopy();
- _corba_impl = SALOMEDS::ChildIterator::_nil();
-}
-
-SALOMEDS_ChildIterator::SALOMEDS_ChildIterator(SALOMEDS::ChildIterator_ptr theIterator)
-{
- _isLocal = false;
- _corba_impl = SALOMEDS::ChildIterator::_duplicate(theIterator);
-}
-
-SALOMEDS_ChildIterator::~SALOMEDS_ChildIterator()
-{
- if(!_isLocal) _corba_impl->Destroy();
- else if(_local_impl) delete _local_impl;
-}
-
-void SALOMEDS_ChildIterator::Init()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->Init();
- }
- else _corba_impl->Init();
-}
-
-void SALOMEDS_ChildIterator::InitEx(bool theAllLevels)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->InitEx(theAllLevels);
- }
- else _corba_impl->InitEx(theAllLevels);
-}
-
-bool SALOMEDS_ChildIterator::More()
-{
- bool ret = false;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->More();
- }
- else ret = _corba_impl->More();
- return ret;
-}
-
-void SALOMEDS_ChildIterator::Next()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->Next();
- }
- else _corba_impl->Next();
-}
-
-_PTR(SObject) SALOMEDS_ChildIterator::Value()
-{
- SALOMEDSClient_SObject* aSO;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aSO = new SALOMEDS_SObject(_local_impl->Value());
- }
- else aSO = new SALOMEDS_SObject(_corba_impl->Value());
- return _PTR(SObject)(aSO);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_ChildIterator.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_CHILDITERATOR_H__
-#define __SALOMEDS_CHILDITERATOR_H__
-
-#include "SALOMEDSClient.hxx"
-#include "SALOMEDSImpl_ChildIterator.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-class SALOMEDS_ChildIterator: public SALOMEDSClient_ChildIterator
-{
-private:
- bool _isLocal;
- SALOMEDSImpl_ChildIterator* _local_impl;
- SALOMEDS::ChildIterator_var _corba_impl;
-
-public:
-
- SALOMEDS_ChildIterator(const SALOMEDSImpl_ChildIterator& theIterator);
- SALOMEDS_ChildIterator(SALOMEDS::ChildIterator_ptr theIterator);
- ~SALOMEDS_ChildIterator();
-
- virtual void Init();
- virtual void InitEx(bool theAllLevels);
- virtual bool More();
- virtual void Next();
- virtual _PTR(SObject) Value();
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_ChildIterator_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_ChildIterator_i.hxx"
-#include "SALOMEDS_SObject_i.hxx"
-#include "SALOMEDS.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-#include "utilities.h"
-
-using namespace std;
-
-//============================================================================
-/*! Function : constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDS_ChildIterator_i::SALOMEDS_ChildIterator_i(const SALOMEDSImpl_ChildIterator& theImpl,
- CORBA::ORB_ptr orb)
- : _it(theImpl.GetPersistentCopy())
-{
- SALOMEDS::Locker lock;
- _orb = CORBA::ORB::_duplicate(orb);
-}
-
-//============================================================================
-/*! Function : destructor
- * Purpose :
- */
-//============================================================================
-SALOMEDS_ChildIterator_i::~SALOMEDS_ChildIterator_i()
-{
- if(_it) delete _it;
-}
-
-//============================================================================
-/*! Function :Init
- *
- */
-//============================================================================
-void SALOMEDS_ChildIterator_i::Init()
-{
- SALOMEDS::Locker lock;
- _it->Init();
-}
-
-//============================================================================
-/*! Function :InitEx
- *
- */
-//============================================================================
-void SALOMEDS_ChildIterator_i::InitEx(CORBA::Boolean allLevels)
-{
- SALOMEDS::Locker lock;
- _it->InitEx (allLevels);
-}
-
-//============================================================================
-/*! Function : More
- *
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_ChildIterator_i::More()
-{
- SALOMEDS::Locker lock;
- return _it->More();
-}
-
- //============================================================================
-/*! Function : Next
- *
- */
-//============================================================================
-void SALOMEDS_ChildIterator_i::Next()
-{
- SALOMEDS::Locker lock;
- _it->Next();
-}
-
-
-//============================================================================
-/*! Function : Value
- * Purpose :
- */
-//============================================================================
-
-SALOMEDS::SObject_ptr SALOMEDS_ChildIterator_i::Value()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_SObject aSO = _it->Value();
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb);
- return so._retn();
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_ChildIterator_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_CHILDITERATOR_I_H__
-#define __SALOMEDS_CHILDITERATOR_I_H__
-
-// std C++ headers
-#include <iostream>
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include <SALOME_GenericObj_i.hh>
-
-// Cascade headers
-#include "SALOMEDSImpl_ChildIterator.hxx"
-#include <stdio.h>
-
-class SALOMEDS_ChildIterator_i: public virtual POA_SALOMEDS::ChildIterator,
- public virtual PortableServer::ServantBase,
- public virtual SALOME::GenericObj_i
-{
-private:
- CORBA::ORB_ptr _orb;
- SALOMEDSImpl_ChildIterator* _it;
-public:
-
- //! standard constructor
- SALOMEDS_ChildIterator_i(const SALOMEDSImpl_ChildIterator&, CORBA::ORB_ptr);
-
- //! standard destructor
- ~SALOMEDS_ChildIterator_i();
-
- virtual void Init();
- virtual void InitEx(CORBA::Boolean);
- virtual CORBA::Boolean More();
- virtual void Next();
- virtual SALOMEDS::SObject_ptr Value();
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDS_Client.cxx
-// Author : Yves FRICAUD
-// Module : SALOME
-// $Header$
-//
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include "SALOMEDS_StudyManager_i.hxx"
-#include "SALOMEDS_AttributeName_i.hxx"
-#include "utilities.h"
-#include "HDFOI.hxx"
-
-using namespace std;
-
-//============================================================================
-/*! Function :
- * Purpose :
- */
-//============================================================================
-static void DumpComponent(SALOMEDS::Study_ptr Study,SALOMEDS::SObject_ptr SO, int offset) {
- SALOMEDS::SObject_var RefSO;
- SALOMEDS::ChildIterator_var it = Study->NewChildIterator(SO);
- for (; it->More();it->Next()){
- SALOMEDS::SObject_var CSO= it->Value();
- SALOMEDS::GenericAttribute_var anAttr;
- if (CSO->FindAttribute(anAttr,"AttributeName"))
- {
- SALOMEDS::AttributeName_var Name = SALOMEDS::AttributeName::_narrow(anAttr);
- CORBA::String_var Val = Name->Value();
- for (int i = 1; i <= offset ; i++)
- MESSAGE("--");
- MESSAGE(">"<<CSO->GetID()<<Val);
- }
- if (CSO->ReferencedObject(RefSO)) {
- for (int i = 1; i <= offset ; i++)
- MESSAGE(" ");
- MESSAGE("*Reference"<<RefSO->GetID());
- }
- DumpComponent(Study,CSO,offset+2);
- }
-}
-
-//============================================================================
-/*! Function :
- * Purpose :
- */
-//============================================================================
-static void DumpStudy (SALOMEDS::Study_ptr Study) {
- MESSAGE("Explore Study and Write name of each object if it exists");
-
- char* name;
- SALOMEDS::SComponentIterator_var itcomp = Study->NewComponentIterator();
- int offset = 1;
- for (; itcomp->More(); itcomp->Next()) {
- SALOMEDS::SComponent_var SC = itcomp->Value();
- name = SC->ComponentDataType();
- MESSAGE("-> ComponentDataType is "<<name);
- DumpComponent(Study,SC,offset);
- }
-}
-
-//============================================================================
-/*! Function :
- * Purpose :
- */
-//============================================================================
-static void Test(SALOMEDS::StudyManager_ptr myStudyMgr )
-{
- try {
- char* name;
- MESSAGE("Create New Study Study1");
- SALOMEDS::Study_var myStudy = myStudyMgr->NewStudy("Study1");
-
- MESSAGE("Create Builder ");
- SALOMEDS::StudyBuilder_var StudyBuild = myStudy->NewBuilder();
-
-
- // Create new components
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::AttributeName_var Name;
- SALOMEDS::AttributeComment_var Comment;
- SALOMEDS::AttributePersistentRef_var PRef;
-
- // GEOM
- MESSAGE("Add Component GEOM");
- SALOMEDS::SComponent_var Geom = StudyBuild->NewComponent("GEOM");
- MESSAGE("Add attribute name GEOM to component Geom");
- anAttr = StudyBuild->FindOrCreateAttribute(Geom, "AttributeName");
- Name = SALOMEDS::AttributeName::_narrow(anAttr);
- Name->SetValue("Geometry");
-
- // MESH
- MESSAGE("Add Component MESH");
- SALOMEDS::SComponent_var Mesh = StudyBuild->NewComponent("MESH");
- anAttr = StudyBuild->FindOrCreateAttribute(Mesh, "AttributeName");
- Name = SALOMEDS::AttributeName::_narrow(anAttr);
- Name->SetValue("Mesh");
-
- //Create objects
-
- //Value
- //box
- MESSAGE("Add Object box under GEOM");
- SALOMEDS::SObject_var box = StudyBuild->NewObject(Geom);
-
- MESSAGE("Add Attribute Name in object box");
- anAttr = StudyBuild->FindOrCreateAttribute(box, "AttributeName");
- Name = SALOMEDS::AttributeName::_narrow(anAttr);
- Name->SetValue("box_0");
-
- MESSAGE("Add Attribute Comment in object box");
- anAttr = StudyBuild->FindOrCreateAttribute(box, "AttributeComment");
- Comment = SALOMEDS::AttributeComment::_narrow(anAttr);
- Comment->SetValue("this is a box");
-
- //mesh_box
- MESSAGE("Add Object mesh_box under MESH");
- SALOMEDS::SObject_var mesh_box = StudyBuild->NewObject(Mesh);
-
- MESSAGE("Add Attribute Name in object mesh_box");
- anAttr = StudyBuild->FindOrCreateAttribute(mesh_box, "AttributeName");
- Name = SALOMEDS::AttributeName::_narrow(anAttr);
- Name->SetValue("mesh_box_0");
-
- // Test attribute delete
- //MESSAGE("Delete Attribute Name in object mesh_box");
- //StudyBuild->RemoveAttribute (mesh_box,SALOMEDS::Name);
-
- //mesh_box_face
- MESSAGE("Add Object mesh_box_face under mesh_box");
- SALOMEDS::SObject_var mesh_box_face = StudyBuild->NewObject(mesh_box);
-
- MESSAGE("Add Attribute Name in object mesh_box_face");
- anAttr = StudyBuild->FindOrCreateAttribute(mesh_box_face, "AttributeName");
- Name = SALOMEDS::AttributeName::_narrow(anAttr);
- Name->SetValue("mesh_box_face_0");
-
- MESSAGE("Add Reference mesh_box_face to box");
- StudyBuild->Addreference (mesh_box_face,box);
-
- //cylinder
- MESSAGE("Add Object cylinder under GEOM");
- SALOMEDS::SObject_var cylinder = StudyBuild->NewObject(Geom);
-
- MESSAGE("Add Attribute Name in object cylinder");
- anAttr = StudyBuild->FindOrCreateAttribute(cylinder, "AttributeName");
- Name = SALOMEDS::AttributeName::_narrow(anAttr);
- Name->SetValue("cylinder_0");
-
- MESSAGE("Add Attribute Persistent Reference in object cylinder");
- anAttr = StudyBuild->FindOrCreateAttribute(cylinder, "AttributePersistentRef");
- PRef = SALOMEDS::AttributePersistentRef::_narrow(anAttr);
- PRef->SetValue("/HDFROOT/GEOM/cylinder");
-
- // Test Undo
- MESSAGE("Test Undo");
-
- StudyBuild->UndoLimit(3);
- StudyBuild->NewCommand();
- MESSAGE("Add Object mesh_cylinder under MESH");
- SALOMEDS::SObject_var mesh_cylinder = StudyBuild->NewObject(Mesh);
- MESSAGE("Add Attribute Name in object mesh_cylinder");
- anAttr = StudyBuild->FindOrCreateAttribute(mesh_cylinder, "AttributeName");
- Name = SALOMEDS::AttributeName::_narrow(anAttr);
- Name->SetValue("mesh_cylinder_0");
- StudyBuild->CommitCommand();
-
- MESSAGE("Test GetStudy");
- SALOMEDS::Study_var stu = mesh_cylinder->GetStudy();
- MESSAGE ("-> Study Name is "<<stu->Name());
-
- DumpStudy(myStudy);
-
- StudyBuild->Undo();
- // Study should have no trace of object mesh_cylinder
- DumpStudy(myStudy);
-
-
- //myStudyMgr->Open ((char*)name);
- //MESSAGE("Name " << name);
-
- // GetOpenStudies
- MESSAGE("GetOpenStudies list");
- SALOMEDS::ListOfOpenStudies_var _list_open_studies = myStudyMgr->GetOpenStudies();
-
- for (unsigned int ind = 0; ind < _list_open_studies->length();ind++)
- {
- MESSAGE("Open studies list : " << _list_open_studies[ind]);
- }
-
-
- // GetStudyByName
- SALOMEDS::Study_var myStudy1 =myStudyMgr->GetStudyByName(_list_open_studies[0]);
- MESSAGE("GetStudyByName done");
-
- // Save as
- myStudyMgr->SaveAs("/home/edeville/Study1.hdf",myStudy1, false);
-
- // Get Persistent Reference of the study test
- name = myStudy1->GetPersistentReference();
- MESSAGE("Persitent Reference of the study " << name);
-
- // Get Transient Reference of the study test
- name = myStudy1->GetTransientReference();
- MESSAGE("Transient Reference of the study " << name);
-
- // FindComponent Test
- SALOMEDS::SComponent_var compo = myStudy1->FindComponent("GEOM");
- // Get ComponentDataType test
- MESSAGE("Find ComponentDataType of compo");
- name = compo->ComponentDataType();
- MESSAGE("-> ComponentDataType is "<<name);
-
-
- // FindComponentID Test
- SALOMEDS::SComponent_var compo1 = myStudy1->FindComponentID("0:1:2");
- // Get ComponentDataType test
- MESSAGE("Find ComponentDataType of compo1");
- name = compo1->ComponentDataType();
- MESSAGE("-> ComponentDataType is "<<name);
-
- // FindObject Test
- SALOMEDS::SObject_var objn = myStudy1->FindObject("cylinder_0");
- // Test FindAttribute function : get AttributeName attribute
- MESSAGE("Find Name in object objn");
- if (objn->FindAttribute(anAttr, "AttributeName")) {
- Name = SALOMEDS::AttributeName::_narrow(anAttr);
- CORBA::String_var Val = Name->Value();
- MESSAGE("-> Name is "<<Val);
- }
- else {
- MESSAGE("-> Name is not found");
- }
-
- // FindObjectID Test
- SALOMEDS::SObject_var obj = myStudy1->FindObjectID("0:1:2:1:1");
- // Test FindAttribute function : get AttributeName attribute
- MESSAGE("Find Name in object obj");
- if (obj->FindAttribute(anAttr, "AttributeName")) {
- Name = SALOMEDS::AttributeName::_narrow(anAttr);
- CORBA::String_var Val = Name->Value();
- MESSAGE("-> Name is "<<Val);
- }
- else {
- MESSAGE("-> Name is not found");
- }
- //DumpStudy(myStudy1);
- }
- catch(HDFexception)
- {
- MESSAGE( "HDFexception ! " )
- }
-}
-
-///////////////////////////// MAIN ///////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-int main(int argc, char** argv)
-{
- try {
- // Initialise the ORB.
-#if OMNIORB_VERSION >= 4
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, "omniORB4" ) ;
-#else
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, "omniORB3" );
-#endif
-
- // Obtain a reference to the root POA.
- CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
- PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
-
- SALOME_NamingService * salomens = new SALOME_NamingService(orb);
-
- MESSAGE("Find StudyManager ");
- CORBA::Object_ptr obj2 = salomens->Resolve("myStudyManager");
- SALOMEDS::StudyManager_var myStudyMgr = SALOMEDS::StudyManager::_narrow(obj2);
-
- // Obtain a POAManager, and tell the POA to start accepting
- // requests on its objects.
- PortableServer::POAManager_var pman = poa->the_POAManager();
- pman->activate();
-
- // Test basic services
- Test(myStudyMgr);
-
- orb->run();
- orb->destroy();
- }
- catch(CORBA::SystemException&) {
- MESSAGE("Caught CORBA::SystemException." )
- }
- catch(CORBA::Exception&) {
- MESSAGE( "Caught CORBA::Exception." )
- }
- catch(omniORB::fatalException& fe) {
- MESSAGE( "Caught omniORB::fatalException:" )
- MESSAGE( " file: " << fe.file() )
- MESSAGE( " line: " << fe.line() )
- MESSAGE( " mesg: " << fe.errmsg() )
- }
- catch(...) {
- MESSAGE( "Caught unknown exception." )
- }
- return 0;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_Attributes.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSCLIENT_ATTRIBUTES__H__
-#define __SALOMEDSCLIENT_ATTRIBUTES__H__
-
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeName.hxx"
-#include "SALOMEDSImpl_AttributeComment.hxx"
-#include "SALOMEDSImpl_AttributeInteger.hxx"
-#include "SALOMEDSImpl_AttributeReal.hxx"
-#include "SALOMEDSImpl_AttributeTreeNode.hxx"
-#include "SALOMEDSImpl_AttributeUserID.hxx"
-#include "SALOMEDSImpl_AttributeSequenceOfReal.hxx"
-#include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx"
-#include "SALOMEDSImpl_AttributeIOR.hxx"
-#include "SALOMEDSImpl_AttributePersistentRef.hxx"
-#include "SALOMEDSImpl_AttributeDrawable.hxx"
-#include "SALOMEDSImpl_AttributeSelectable.hxx"
-#include "SALOMEDSImpl_AttributeExpandable.hxx"
-#include "SALOMEDSImpl_AttributeOpened.hxx"
-#include "SALOMEDSImpl_AttributeTextColor.hxx"
-#include "SALOMEDSImpl_AttributeTextHighlightColor.hxx"
-#include "SALOMEDSImpl_AttributePixMap.hxx"
-#include "SALOMEDSImpl_AttributeLocalID.hxx"
-#include "SALOMEDSImpl_AttributeTarget.hxx"
-#include "SALOMEDSImpl_AttributeTableOfInteger.hxx"
-#include "SALOMEDSImpl_AttributeTableOfReal.hxx"
-#include "SALOMEDSImpl_AttributeTableOfString.hxx"
-#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
-#include "SALOMEDSImpl_AttributePythonObject.hxx"
-#include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
-#include "SALOMEDSImpl_AttributeFileType.hxx"
-#include "SALOMEDSImpl_AttributeFlags.hxx"
-#include "SALOMEDSImpl_AttributeGraphic.hxx"
-#include "SALOMEDSImpl_AttributeParameter.hxx"
-#include "SALOMEDSImpl_AttributeString.hxx"
-
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDS_AttributeName.hxx"
-#include "SALOMEDS_AttributeComment.hxx"
-#include "SALOMEDS_AttributeInteger.hxx"
-#include "SALOMEDS_AttributeReal.hxx"
-#include "SALOMEDS_AttributeTreeNode.hxx"
-#include "SALOMEDS_AttributeUserID.hxx"
-#include "SALOMEDS_AttributeSequenceOfReal.hxx"
-#include "SALOMEDS_AttributeSequenceOfInteger.hxx"
-#include "SALOMEDS_AttributeIOR.hxx"
-#include "SALOMEDS_AttributePersistentRef.hxx"
-#include "SALOMEDS_AttributeDrawable.hxx"
-#include "SALOMEDS_AttributeSelectable.hxx"
-#include "SALOMEDS_AttributeExpandable.hxx"
-#include "SALOMEDS_AttributeOpened.hxx"
-#include "SALOMEDS_AttributeTextColor.hxx"
-#include "SALOMEDS_AttributeTextHighlightColor.hxx"
-#include "SALOMEDS_AttributePixMap.hxx"
-#include "SALOMEDS_AttributeLocalID.hxx"
-#include "SALOMEDS_AttributeTarget.hxx"
-#include "SALOMEDS_AttributeTableOfInteger.hxx"
-#include "SALOMEDS_AttributeTableOfReal.hxx"
-#include "SALOMEDS_AttributeTableOfString.hxx"
-#include "SALOMEDS_AttributeStudyProperties.hxx"
-#include "SALOMEDS_AttributePythonObject.hxx"
-#include "SALOMEDS_AttributeExternalFileDef.hxx"
-#include "SALOMEDS_AttributeFileType.hxx"
-#include "SALOMEDS_AttributeFlags.hxx"
-#include "SALOMEDS_AttributeGraphic.hxx"
-#include "SALOMEDS_AttributeParameter.hxx"
-#include "SALOMEDS_AttributeString.hxx"
-
-#define __CreateClientAttributeLocal(CORBA_Name) if (strcmp(aTypeOfAttribute.c_str(), #CORBA_Name) == 0) { \
- SALOMEDSImpl_##CORBA_Name* A = dynamic_cast<SALOMEDSImpl_##CORBA_Name*>(theGA); \
- aGA = new SALOMEDS_##CORBA_Name(A); \
- }
-
-#define __CreateClientAttributeCORBA(CORBA_Name) if (strcmp(aTypeOfAttribute.c_str(), #CORBA_Name) == 0) { \
- SALOMEDS::CORBA_Name##_var A = SALOMEDS::CORBA_Name::_narrow(theGA); \
- aGA = new SALOMEDS_##CORBA_Name(A); \
- }
-
-#define __CreateGenericClientAttributeLocal \
-__CreateClientAttributeLocal(AttributeReal) \
-__CreateClientAttributeLocal(AttributeInteger) \
-__CreateClientAttributeLocal(AttributeSequenceOfReal) \
-__CreateClientAttributeLocal(AttributeSequenceOfInteger) \
-__CreateClientAttributeLocal(AttributeName) \
-__CreateClientAttributeLocal(AttributeComment) \
-__CreateClientAttributeLocal(AttributeIOR) \
-__CreateClientAttributeLocal(AttributePixMap) \
-__CreateClientAttributeLocal(AttributeLocalID) \
-__CreateClientAttributeLocal(AttributeTableOfInteger) \
-__CreateClientAttributeLocal(AttributeTableOfReal) \
-__CreateClientAttributeLocal(AttributeTableOfString) \
-__CreateClientAttributeLocal(AttributePythonObject) \
-__CreateClientAttributeLocal(AttributePersistentRef) \
-__CreateClientAttributeLocal(AttributeDrawable) \
-__CreateClientAttributeLocal(AttributeSelectable) \
-__CreateClientAttributeLocal(AttributeExpandable) \
-__CreateClientAttributeLocal(AttributeOpened) \
-__CreateClientAttributeLocal(AttributeTextColor) \
-__CreateClientAttributeLocal(AttributeTextHighlightColor) \
-__CreateClientAttributeLocal(AttributeTarget) \
-__CreateClientAttributeLocal(AttributeStudyProperties) \
-__CreateClientAttributeLocal(AttributeExternalFileDef) \
-__CreateClientAttributeLocal(AttributeFileType) \
-__CreateClientAttributeLocal(AttributeFlags) \
-__CreateClientAttributeLocal(AttributeGraphic) \
-__CreateClientAttributeLocal(AttributeTreeNode) \
-__CreateClientAttributeLocal(AttributeUserID) \
-__CreateClientAttributeLocal(AttributeParameter) \
-__CreateClientAttributeLocal(AttributeString)
-
-#define __CreateGenericClientAttributeCORBA \
-__CreateClientAttributeCORBA(AttributeReal) \
-__CreateClientAttributeCORBA(AttributeInteger) \
-__CreateClientAttributeCORBA(AttributeSequenceOfReal) \
-__CreateClientAttributeCORBA(AttributeSequenceOfInteger) \
-__CreateClientAttributeCORBA(AttributeName) \
-__CreateClientAttributeCORBA(AttributeComment) \
-__CreateClientAttributeCORBA(AttributeIOR) \
-__CreateClientAttributeCORBA(AttributePixMap) \
-__CreateClientAttributeCORBA(AttributeLocalID) \
-__CreateClientAttributeCORBA(AttributeTableOfInteger) \
-__CreateClientAttributeCORBA(AttributeTableOfReal) \
-__CreateClientAttributeCORBA(AttributeTableOfString) \
-__CreateClientAttributeCORBA(AttributePythonObject) \
-__CreateClientAttributeCORBA(AttributePersistentRef) \
-__CreateClientAttributeCORBA(AttributeDrawable) \
-__CreateClientAttributeCORBA(AttributeSelectable) \
-__CreateClientAttributeCORBA(AttributeExpandable) \
-__CreateClientAttributeCORBA(AttributeOpened) \
-__CreateClientAttributeCORBA(AttributeTextColor) \
-__CreateClientAttributeCORBA(AttributeTextHighlightColor) \
-__CreateClientAttributeCORBA(AttributeTarget) \
-__CreateClientAttributeCORBA(AttributeStudyProperties) \
-__CreateClientAttributeCORBA(AttributeExternalFileDef) \
-__CreateClientAttributeCORBA(AttributeFileType) \
-__CreateClientAttributeCORBA(AttributeFlags) \
-__CreateClientAttributeCORBA(AttributeGraphic) \
-__CreateClientAttributeCORBA(AttributeTreeNode) \
-__CreateClientAttributeCORBA(AttributeUserID) \
-__CreateClientAttributeCORBA(AttributeParameter) \
-__CreateClientAttributeCORBA(AttributeString)
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_Defines.hxx
-// Author : Alexander A. BORODIN
-// Module : SALOME
-//
-#ifndef _SALOMEDS_Defines_HXX_
-#define _SALOMEDS_Defines_HXX_
-
-#ifdef WIN32
-# if defined SALOMEDS_EXPORTS || defined SalomeDS_EXPORTS
-# define SALOMEDS_EXPORT __declspec( dllexport )
-# else
-# define SALOMEDS_EXPORT __declspec( dllimport )
-# endif
-#else
-# define SALOMEDS_EXPORT
-#endif
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "SALOMEDS_Driver_i.hxx"
-#include "SALOMEDS_TMPFile_i.hxx"
-#include "utilities.h"
-#include "SALOMEDS_SObject_i.hxx"
-#include "SALOMEDS_SComponent_i.hxx"
-#include "SALOMEDS_Study_i.hxx"
-#include "SALOMEDS.hxx"
-#include <stdlib.h>
-
-using namespace std;
-
-SALOMEDS_Driver_i::~SALOMEDS_Driver_i()
-{
-}
-
-SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::Save(const SALOMEDSImpl_SComponent& theComponent,
- const string& theURL,
- long& theStreamLength,
- bool isMultiFile)
-{
- SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
- CORBA::String_var url = CORBA::string_dup(theURL.c_str());
-
- SALOMEDS::unlock();
- SALOMEDS::TMPFile_var aStream = _driver->Save(sco.in(), url, isMultiFile);
- SALOMEDSImpl_TMPFile* aTMPFile = new SALOMEDS_TMPFile_i(aStream._retn());
- theStreamLength = aTMPFile->Size();
- SALOMEDS::lock();
-
- return aTMPFile;
-}
-
-SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
- const string& theURL,
- long& theStreamLength,
- bool isMultiFile)
-{
- SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
- CORBA::String_var url = CORBA::string_dup(theURL.c_str());
-
- SALOMEDS::unlock();
- SALOMEDS::TMPFile_var aStream = _driver->SaveASCII(sco.in(), url, isMultiFile);
- SALOMEDSImpl_TMPFile* aTMPFile = new SALOMEDS_TMPFile_i(aStream._retn());
- theStreamLength = aTMPFile->Size();
- SALOMEDS::lock();
-
- return aTMPFile;
-}
-
-bool SALOMEDS_Driver_i::Load(const SALOMEDSImpl_SComponent& theComponent,
- const unsigned char* theStream,
- const long theStreamLength,
- const string& theURL,
- bool isMultiFile)
-{
- SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
- CORBA::String_var url = CORBA::string_dup(theURL.c_str());
- CORBA::Octet* anOctetBuf = (CORBA::Octet*)theStream;
-
- SALOMEDS::TMPFile_var aStream;
- if (theStreamLength > 0)
- aStream = new SALOMEDS::TMPFile(theStreamLength, theStreamLength, anOctetBuf, 0);
- else
- aStream = new SALOMEDS::TMPFile(0);
-
- SALOMEDS::unlock();
- bool isOk = _driver->Load(sco.in(), aStream.in(), url, isMultiFile);
- SALOMEDS::lock();
-
- return isOk;
-}
-
-bool SALOMEDS_Driver_i::LoadASCII(const SALOMEDSImpl_SComponent& theComponent,
- const unsigned char* theStream,
- const long theStreamLength,
- const string& theURL,
- bool isMultiFile)
-{
- SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
- CORBA::String_var url = CORBA::string_dup(theURL.c_str());
- CORBA::Octet* anOctetBuf = (CORBA::Octet*)theStream;
-
- SALOMEDS::TMPFile_var aStream;
- if(theStreamLength > 0)
- aStream = new SALOMEDS::TMPFile(theStreamLength, theStreamLength, anOctetBuf, 0);
- else
- aStream = new SALOMEDS::TMPFile(0);
-
- SALOMEDS::unlock();
- bool isOk = _driver->LoadASCII(sco.in(), aStream.in(), url, isMultiFile);
- SALOMEDS::lock();
-
- return isOk;
-}
-
-void SALOMEDS_Driver_i::Close(const SALOMEDSImpl_SComponent& theComponent)
-{
- SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
-
- SALOMEDS::unlock();
- _driver->Close(sco.in());
- SALOMEDS::lock();
-}
-
-
-
-string SALOMEDS_Driver_i::IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
- const string& IORString,
- bool isMultiFile,
- bool isASCII)
-{
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theSObject, _orb);
- CORBA::String_var ior = CORBA::string_dup(IORString.c_str());
-
- SALOMEDS::unlock();
- CORBA::String_var pers_string =_driver->IORToLocalPersistentID(so.in(), ior.in(), isMultiFile, isASCII);
- SALOMEDS::lock();
-
- return string(pers_string);
-}
-
-
-string SALOMEDS_Driver_i::LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theObject,
- const string& aLocalPersistentID,
- bool isMultiFile,
- bool isASCII)
-{
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theObject, _orb);
- CORBA::String_var pers_string = CORBA::string_dup(aLocalPersistentID.c_str());
- SALOMEDS::unlock();
- CORBA::String_var IOR = _driver->LocalPersistentIDToIOR(so.in(), pers_string.in(), isMultiFile, isASCII);
- SALOMEDS::lock();
- return string(IOR);
-}
-
-bool SALOMEDS_Driver_i::CanCopy(const SALOMEDSImpl_SObject& theObject)
-{
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theObject, _orb);
-
- SALOMEDS::unlock();
- bool isOk = _driver->CanCopy(so.in());
- SALOMEDS::lock();
-
- return isOk;
-}
-
-
-SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::CopyFrom(const SALOMEDSImpl_SObject& theObject,
- int& theObjectID,
- long& theStreamLength)
-{
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theObject, _orb);
-
- SALOMEDS::unlock();
- CORBA::Long anObjectID;
- SALOMEDS::TMPFile_var aStream = _driver->CopyFrom(so.in(), anObjectID);
- SALOMEDSImpl_TMPFile* aTMPFile = new SALOMEDS_TMPFile_i(aStream._retn());
- theStreamLength = aTMPFile->Size();
- theObjectID = anObjectID;
- SALOMEDS::lock();
-
- return aTMPFile;
-}
-
-bool SALOMEDS_Driver_i::CanPaste(const string& theComponentName, int theObjectID)
-{
- SALOMEDS::unlock();
- bool canPaste = _driver->CanPaste(theComponentName.c_str(), theObjectID);
- SALOMEDS::lock();
- return canPaste;
-}
-
-string SALOMEDS_Driver_i::PasteInto(const unsigned char* theStream,
- const long theStreamLength,
- int theObjectID,
- const SALOMEDSImpl_SObject& theObject)
-{
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theObject, _orb);
- CORBA::Octet* anOctetBuf = (CORBA::Octet*)theStream;
-
- SALOMEDS::TMPFile_var aStream;
- if(theStreamLength > 0)
- aStream = new SALOMEDS::TMPFile(theStreamLength, theStreamLength, anOctetBuf, 0);
- else
- aStream = new SALOMEDS::TMPFile(0);
-
- SALOMEDS::unlock();
- SALOMEDS::SObject_var ret_so = _driver->PasteInto(aStream.in(), theObjectID, so.in());
- SALOMEDS::lock();
-
- return string(ret_so->GetID());
-}
-
-SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::DumpPython(SALOMEDSImpl_Study* theStudy,
- bool isPublished,
- bool& isValidScript,
- long& theStreamLength)
-{
- SALOMEDS_Study_i * st_servant = new SALOMEDS_Study_i (theStudy, _orb);
- SALOMEDS::Study_var st = SALOMEDS::Study::_narrow(st_servant->_this());
- Engines::Component_ptr aComponent = Engines::Component::_narrow(_driver);
-
- SALOMEDS::unlock();
- CORBA::Boolean aValidScript, aPublished = isPublished;
- Engines::TMPFile_var aStream = aComponent->DumpPython(st.in(), aPublished, aValidScript);
- SALOMEDSImpl_TMPFile* aTMPFile = new Engines_TMPFile_i(aStream._retn());
- theStreamLength = aTMPFile->Size();
- isValidScript = aValidScript;
- SALOMEDS::lock();
-
- return aTMPFile;
-}
-
-//###############################################################################################################
-// SALOMEDS_DriverFactory
-//###############################################################################################################
-
-SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByType(const string& theComponentType)
-{
- CORBA::Object_var obj;
-
- string aFactoryType;
- if (theComponentType == "SUPERV") aFactoryType = "SuperVisionContainer";
- else aFactoryType = "FactoryServer";
-
- SALOMEDS::unlock();
- obj = SALOME_LifeCycleCORBA(_name_service).FindOrLoad_Component(aFactoryType.c_str(), theComponentType.c_str());
- SALOMEDS::lock();
-
- if (CORBA::is_nil(obj)) {
- obj = SALOME_LifeCycleCORBA(_name_service).FindOrLoad_Component("FactoryServerPy", theComponentType.c_str());
- }
-
- if (!CORBA::is_nil(obj)) {
- SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(obj);
- return new SALOMEDS_Driver_i(aDriver, _orb);
- }
-
- return NULL;
-}
-
-SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByIOR(const string& theIOR)
-{
- CORBA::Object_var obj;
- obj = _orb->string_to_object(theIOR.c_str());
-
- if (!CORBA::is_nil(obj)) {
- SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(obj);
- return new SALOMEDS_Driver_i(aDriver, _orb);
- }
-
- return NULL;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef __SALOMEDS_DRIVER_I_H__
-#define __SALOMEDS_DRIVER_I_H__
-
-#include <SALOMEconfig.h>
-
-#include <omniORB4/CORBA.h>
-#include "SALOMEDSImpl_Driver.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOME_Component)
-
-class Standard_EXPORT SALOMEDS_Driver_i : public virtual SALOMEDSImpl_Driver
-{
-protected:
- SALOMEDS::Driver_var _driver;
- CORBA::ORB_var _orb;
-
-public:
-
- SALOMEDS_Driver_i(SALOMEDS::Driver_ptr theDriver, CORBA::ORB_ptr theORB)
- {
- _driver = SALOMEDS::Driver::_duplicate(theDriver);
- _orb = CORBA::ORB::_duplicate(theORB);
- }
-
- ~SALOMEDS_Driver_i();
-
- virtual std::string GetIOR()
- {
- CORBA::String_var ior = _orb->object_to_string(_driver);
- return std::string(ior);
- }
-
- virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent,
- const std::string& theURL,
- long& theStreamLength,
- bool isMultiFile);
-
- virtual SALOMEDSImpl_TMPFile* SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
- const std::string& theURL,
- long& theStreamLength,
- bool isMultiFile);
-
- virtual bool Load(const SALOMEDSImpl_SComponent& theComponent,
- const unsigned char* theStream,
- const long theStreamLength,
- const std::string& theURL,
- bool isMultiFile);
-
- virtual bool LoadASCII(const SALOMEDSImpl_SComponent& theComponent,
- const unsigned char* theStream,
- const long theStreamLength,
- const std::string& theURL,
- bool isMultiFile);
-
- virtual void Close(const SALOMEDSImpl_SComponent& theComponent);
-
- virtual std::string ComponentDataType()
- {
- CORBA::String_var ior = _driver->ComponentDataType();
- return std::string(ior);
- }
-
-
- virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
- const std::string& IORString,
- bool isMultiFile,
- bool isASCII);
-
- virtual std::string LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theSObject,
- const std::string& aLocalPersistentID,
- bool isMultiFile,
- bool isASCII);
-
- virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject);
-
- virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& theObject,
- int& theObjectID,
- long& theStreamLength);
-
- virtual bool CanPaste(const std::string& theComponentName, int theObjectID);
-
- virtual std::string PasteInto(const unsigned char* theStream,
- const long theStreamLength,
- int theObjectID,
- const SALOMEDSImpl_SObject& theObject);
-
- virtual SALOMEDSImpl_TMPFile* DumpPython(SALOMEDSImpl_Study* theStudy,
- bool isPublished,
- bool& isValidScript,
- long& theStreamLength);
-};
-
-#include "SALOME_NamingService.hxx"
-#include "SALOME_LifeCycleCORBA.hxx"
-
-class SALOMEDS_DriverFactory_i : public virtual SALOMEDSImpl_DriverFactory
-{
-protected:
- CORBA::ORB_var _orb;
- SALOME_NamingService* _name_service;
-
-public:
-
- SALOMEDS_DriverFactory_i(CORBA::ORB_ptr theORB)
- {
- _orb = CORBA::ORB::_duplicate(theORB);
- _name_service = new SALOME_NamingService(_orb);
- }
-
-
- ~SALOMEDS_DriverFactory_i()
- {
- delete _name_service;
- }
-
- virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType);
-
- virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_GenericAttribute.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include <string>
-
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDS_SObject.hxx"
-#include "SALOMEDS_ClientAttributes.hxx"
-#include "SALOMEDS.hxx"
-
-#include "Basics_Utils.hxx"
-
-#ifdef WIN32
-#include <process.h>
-#else
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-using namespace std;
-
-SALOMEDS_GenericAttribute::SALOMEDS_GenericAttribute(SALOMEDSImpl_GenericAttribute* theGA)
-{
- _isLocal = true;
- _local_impl = theGA;
- _corba_impl = SALOMEDS::GenericAttribute::_nil();
-}
-
-SALOMEDS_GenericAttribute::SALOMEDS_GenericAttribute(SALOMEDS::GenericAttribute_ptr theGA)
-{
-#ifdef WIN32
- long pid = (long)_getpid();
-#else
- long pid = (long)getpid();
-#endif
-
- CORBA::LongLong addr = theGA->GetLocalImpl(Kernel_Utils::GetHostname().c_str(), pid, _isLocal);
- if(_isLocal) {
- _local_impl = reinterpret_cast<SALOMEDSImpl_GenericAttribute*>(addr);
- _corba_impl = SALOMEDS::GenericAttribute::_nil();
- }
- else {
- _local_impl = NULL;
- _corba_impl = SALOMEDS::GenericAttribute::_duplicate(theGA);
- }
-}
-
-SALOMEDS_GenericAttribute::~SALOMEDS_GenericAttribute()
-{
- if (!_isLocal) {
- _corba_impl->Destroy();
- }
-}
-
-void SALOMEDS_GenericAttribute::CheckLocked()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- try {
- _local_impl->CheckLocked();
- }
- catch(...) {
- throw SALOMEDS::GenericAttribute::LockProtection();
- }
- }
- else {
- _corba_impl->CheckLocked();
- }
-}
-
-std::string SALOMEDS_GenericAttribute::Type()
-{
- std::string aType;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aType = _local_impl->Type();
- }
- else {
- aType = _corba_impl->Type();
- }
- return aType;
-}
-
-std::string SALOMEDS_GenericAttribute::GetClassType()
-{
- std::string aType;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aType = _local_impl->GetClassType();
- }
- else {
- aType = _corba_impl->GetClassType();
- }
- return aType;
-}
-
-_PTR(SObject) SALOMEDS_GenericAttribute::GetSObject()
-{
- SALOMEDSClient_SObject* aSO = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aSO = new SALOMEDS_SObject(_local_impl->GetSObject());
- }
- else {
- aSO = new SALOMEDS_SObject(_corba_impl->GetSObject());
- }
-
- return _PTR(SObject)(aSO);
-}
-
-
-SALOMEDS_GenericAttribute* SALOMEDS_GenericAttribute::CreateAttribute(SALOMEDSImpl_GenericAttribute* theGA)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDS_GenericAttribute* aGA = NULL;
- if(theGA) {
- std::string aTypeOfAttribute = theGA->GetClassType();
- __CreateGenericClientAttributeLocal
- }
- return aGA;
-}
-
-SALOMEDS_GenericAttribute* SALOMEDS_GenericAttribute::CreateAttribute(SALOMEDS::GenericAttribute_ptr theGA)
-{
- SALOMEDS_GenericAttribute* aGA = NULL;
- if(!CORBA::is_nil(theGA)) {
- std::string aTypeOfAttribute = theGA->GetClassType();
- __CreateGenericClientAttributeCORBA
- }
- return aGA;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_GenericAttribute.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _GENERIC_ATTRIBUTE_HXX_
-#define _GENERIC_ATTRIBUTE_HXX_
-
-#include <exception>
-#include "SALOMEDSClient.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-
-class Standard_EXPORT SALOMEDS_GenericAttribute: public virtual SALOMEDSClient_GenericAttribute
-{
-protected:
- bool _isLocal;
- SALOMEDSImpl_GenericAttribute* _local_impl;
- SALOMEDS::GenericAttribute_var _corba_impl;
-
-public:
- SALOMEDS_GenericAttribute(SALOMEDSImpl_GenericAttribute* theGA);
- SALOMEDS_GenericAttribute(SALOMEDS::GenericAttribute_ptr theGA);
- virtual ~SALOMEDS_GenericAttribute();
-
- void CheckLocked();
- std::string Type();
- std::string GetClassType();
- _PTR(SObject) GetSObject();
-
- static SALOMEDS_GenericAttribute* CreateAttribute(SALOMEDSImpl_GenericAttribute* theGA);
- static SALOMEDS_GenericAttribute* CreateAttribute(SALOMEDS::GenericAttribute_ptr theGA);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_GenericAttribute_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "utilities.h"
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDS_Attributes.hxx"
-#include "SALOMEDS.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-#include "Utils_ExceptHandlers.hxx"
-#include "Basics_Utils.hxx"
-#include <map>
-
-#ifdef WIN32
-#include <process.h>
-#else
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-using namespace std;
-
-UNEXPECT_CATCH(GALockProtection, SALOMEDS::GenericAttribute::LockProtection);
-
-SALOMEDS_GenericAttribute_i::SALOMEDS_GenericAttribute_i(DF_Attribute* theImpl, CORBA::ORB_ptr theOrb)
-{
- _orb = CORBA::ORB::_duplicate(theOrb);
- _impl = theImpl;
-}
-
-void SALOMEDS_GenericAttribute_i::CheckLocked() throw (SALOMEDS::GenericAttribute::LockProtection)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(GALockProtection);
-
- if (_impl && !CORBA::is_nil(_orb)) {
- try {
- SALOMEDSImpl_GenericAttribute::Impl_CheckLocked(_impl);
- }
- catch (...) {
- throw SALOMEDS::GenericAttribute::LockProtection();
- }
- }
-}
-
-SALOMEDS::SObject_ptr SALOMEDS_GenericAttribute_i::GetSObject()
-{
- SALOMEDS::Locker lock;
- if (!_impl || _impl->Label().IsNull()) return SALOMEDS::SObject::_nil();
- SALOMEDSImpl_SObject so_impl = SALOMEDSImpl_Study::SObject(_impl->Label());
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (so_impl, _orb);
- return so._retn();
-}
-
-
-char* SALOMEDS_GenericAttribute_i::Type()
-{
- SALOMEDS::Locker lock;
- if (_impl) {
- string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(_impl);
- return CORBA::string_dup(type.c_str());
- }
-
- return (char*)"";
-}
-
-char* SALOMEDS_GenericAttribute_i::GetClassType()
-{
- SALOMEDS::Locker lock;
- if (_impl) {
- string class_type = SALOMEDSImpl_GenericAttribute::Impl_GetClassType(_impl);
- return CORBA::string_dup(class_type.c_str());
- }
-
- return (char*)"";
-}
-
-
-SALOMEDS::GenericAttribute_ptr SALOMEDS_GenericAttribute_i::CreateAttribute
- (DF_Attribute* theAttr,
- CORBA::ORB_ptr theOrb)
-{
- SALOMEDS::Locker lock;
-
- string aClassType = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr)->GetClassType();
- char* aTypeOfAttribute = (char*)aClassType.c_str();
- SALOMEDS::GenericAttribute_var anAttribute;
- SALOMEDS_GenericAttribute_i* attr_servant = NULL;
- __CreateGenericCORBAAttribute
-
- return anAttribute._retn();
-}
-
-//===========================================================================
-// PRIVATE FUNCTIONS
-//===========================================================================
-CORBA::LongLong SALOMEDS_GenericAttribute_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
-{
-#ifdef WIN32
- long pid = (long)_getpid();
-#else
- long pid = (long)getpid();
-#endif
- isLocal = (strcmp(theHostname, Kernel_Utils::GetHostname().c_str()) == 0 && pid == thePID)?1:0;
- return reinterpret_cast<CORBA::LongLong>(_impl);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_GenericAttribute_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _GENERIC_ATTRIBUTE_I_HXX_
-#define _GENERIC_ATTRIBUTE_I_HXX_
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include <SALOME_GenericObj_i.hh>
-#include "DF_Attribute.hxx"
-#include "SALOMEDS_SObject_i.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class Standard_EXPORT SALOMEDS_GenericAttribute_i: public virtual POA_SALOMEDS::GenericAttribute,
- public virtual PortableServer::ServantBase,
- public virtual SALOME::GenericObj_i
-{
-
-protected:
- DF_Attribute* _impl;
- CORBA::ORB_ptr _orb;
-
-public:
- SALOMEDS_GenericAttribute_i(DF_Attribute* theImpl, CORBA::ORB_ptr theOrb);
- virtual ~SALOMEDS_GenericAttribute_i() {};
-
- void CheckLocked() throw (SALOMEDS::GenericAttribute::LockProtection);
-
- virtual char* Type();
-
- char* GetClassType();
-
- SALOMEDS::SObject_ptr GetSObject();
-
- virtual DF_Attribute* GetImpl() { return _impl; }
-
- static SALOMEDS::GenericAttribute_ptr CreateAttribute(DF_Attribute* theAttr, CORBA::ORB_ptr theOrb);
-
- virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "SALOMEDS_IParameters.hxx"
-#include <utilities.h>
-
-using namespace std;
-
-#define PT_INTEGER 0
-#define PT_REAL 1
-#define PT_BOOLEAN 2
-#define PT_STRING 3
-#define PT_REALARRAY 4
-#define PT_INTARRAY 5
-#define PT_STRARRAY 6
-
-#define _AP_LISTS_LIST_ "AP_LISTS_LIST"
-#define _AP_ENTRIES_LIST_ "AP_ENTRIES_LIST"
-#define _AP_PROPERTIES_LIST_ "AP_PROPERTIES_LIST"
-#define _AP_DUMP_PYTHON_ "AP_DUMP_PYTHON"
-
-/*!
- Constructor
-*/
-SALOMEDS_IParameters::SALOMEDS_IParameters(const _PTR(AttributeParameter)& ap)
-{
- if(!ap) return;
- _ap = ap;
- _PTR(SObject) so = _ap->GetSObject();
- _study = so->GetStudy();
-}
-
-SALOMEDS_IParameters::~SALOMEDS_IParameters()
-{
- _compNames.clear();
-}
-
-int SALOMEDS_IParameters::append(const string& listName, const string& value)
-{
- if(!_ap) return -1;
- vector<string> v;
- if(!_ap->IsSet(listName, PT_STRARRAY)) {
- if(!_ap->IsSet(_AP_LISTS_LIST_, PT_STRARRAY)) _ap->SetStrArray(_AP_LISTS_LIST_, v);
- if(listName != _AP_ENTRIES_LIST_ &&
- listName != _AP_PROPERTIES_LIST_) {
- append(_AP_LISTS_LIST_, listName);
- }
- _ap->SetStrArray(listName, v);
- }
- v = _ap->GetStrArray(listName);
- v.push_back(value);
- _ap->SetStrArray(listName, v);
- return (v.size()-1);
-}
-
-int SALOMEDS_IParameters::nbValues(const string& listName)
-{
- if(!_ap) return -1;
- if(!_ap->IsSet(listName, PT_STRARRAY)) return 0;
- vector<string> v = _ap->GetStrArray(listName);
- return v.size();
-}
-
-vector<string> SALOMEDS_IParameters::getValues(const string& listName)
-{
- vector<string> v;
- if(!_ap) return v;
- if(!_ap->IsSet(listName, PT_STRARRAY)) return v;
- return _ap->GetStrArray(listName);
-}
-
-
-string SALOMEDS_IParameters::getValue(const string& listName, int index)
-{
- if(!_ap) return "";
- if(!_ap->IsSet(listName, PT_STRARRAY)) return "";
- vector<string> v = _ap->GetStrArray(listName);
- if(index >= v.size()) return "";
- return v[index];
-}
-
-vector<string> SALOMEDS_IParameters::getLists()
-{
- vector<string> v;
- if(!_ap->IsSet(_AP_LISTS_LIST_, PT_STRARRAY)) return v;
- return _ap->GetStrArray(_AP_LISTS_LIST_);
-}
-
-void SALOMEDS_IParameters::setParameter(const string& entry, const string& parameterName, const string& value)
-{
- if(!_ap) return;
- vector<string> v;
- if(!_ap->IsSet(entry, PT_STRARRAY)) {
- append(_AP_ENTRIES_LIST_, entry); //Add the entry to the internal list of entries
- _ap->SetStrArray(entry, v);
- }
- v = _ap->GetStrArray(entry);
- v.push_back(parameterName);
- v.push_back(value);
- _ap->SetStrArray(entry, v);
-}
-
-
-string SALOMEDS_IParameters::getParameter(const string& entry, const string& parameterName)
-{
- if(!_ap) return "";
- if(!_ap->IsSet(entry, PT_STRARRAY)) return "";
- vector<string> v = _ap->GetStrArray(entry);
- int length = v.size();
- for(int i = 0; i<length; i+=1) {
- if(v[i] == parameterName) return v[i+1];
- }
- return "";
-}
-
-
-vector<string> SALOMEDS_IParameters::getAllParameterNames(const string& entry)
-{
- vector<string> v, names;
- if(!_ap) return v;
- if(!_ap->IsSet(entry, PT_STRARRAY)) return v;
- v = _ap->GetStrArray(entry);
- int length = v.size();
- for(int i = 0; i<length; i+=2) {
- names.push_back(v[i]);
- }
- return names;
-}
-
-vector<string> SALOMEDS_IParameters::getAllParameterValues(const string& entry)
-{
- vector<string> v, values;
- if(!_ap) return v;
- if(!_ap->IsSet(entry, PT_STRARRAY)) return v;
- v = _ap->GetStrArray(entry);
- int length = v.size();
- for(int i = 1; i<length; i+=2) {
- values.push_back(v[i]);
- }
- return values;
-}
-
-int SALOMEDS_IParameters::getNbParameters(const string& entry)
-{
- if(!_ap) return -1;
- if(!_ap->IsSet(entry, PT_STRARRAY)) return -1;
- return _ap->GetStrArray(entry).size()/2;
-}
-
-vector<string> SALOMEDS_IParameters::getEntries()
-{
- vector<string> v;
- if(!_ap) return v;
- if(!_ap->IsSet(_AP_ENTRIES_LIST_, PT_STRARRAY)) return v;
- return _ap->GetStrArray(_AP_ENTRIES_LIST_);
-}
-
-void SALOMEDS_IParameters::setProperty(const string& name, const std::string& value)
-{
- if(!_ap) return;
- if(!_ap->IsSet(name, PT_STRING)) {
- append(_AP_PROPERTIES_LIST_, name); //Add the property to the internal list of properties
- }
- _ap->SetString(name, value);
-}
-
-string SALOMEDS_IParameters::getProperty(const string& name)
-{
- if(!_ap) return "";
- if(!_ap->IsSet(name, PT_STRING)) return "";
- return _ap->GetString(name);
-}
-
-vector<string> SALOMEDS_IParameters::getProperties()
-{
- vector<string> v;
- if(!_ap) return v;
- if(!_ap->IsSet(_AP_PROPERTIES_LIST_, PT_STRARRAY)) return v;
- return _ap->GetStrArray(_AP_PROPERTIES_LIST_);
-}
-
-
-vector<string> SALOMEDS_IParameters::parseValue(const string& value, const char separator, bool fromEnd)
-{
- string val(value);
- vector<string> v;
- int pos;
- if(fromEnd) pos = val.rfind(separator);
- else pos = val.find(separator);
-
- if(pos < 0) {
- v.push_back(value);
- return v;
- }
-
- string part1, part2;
- part1 = val.substr(0, pos);
- part2 = val.substr(pos+1, val.size());
- v.push_back(part1);
- v.push_back(part2);
- return v;
-}
-
-string SALOMEDS_IParameters::encodeEntry(const string& entry, const string& compName)
-{
- string tail(entry, 6, entry.length()-1);
- string newEntry(compName);
- newEntry+=("_"+tail);
- return newEntry;
-}
-
-string SALOMEDS_IParameters::decodeEntry(const string& entry)
-{
- if(!_study) return entry;
- int pos = entry.rfind("_");
- if(pos < 0 || pos >= entry.length()) return entry;
-
- string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1);
-
- if(_compNames.find(compName) == _compNames.end()) {
- _PTR(SObject) so = _study->FindComponent(compName);
- if(!so) return entry;
- compID = so->GetID();
- _compNames[compName] = compID;
- }
- else compID = _compNames[compName];
-
- string newEntry(compID);
- newEntry += (":"+tail);
-
- return newEntry;
-}
-
-void SALOMEDS_IParameters::setDumpPython(_PTR(Study) study, const string& theID)
-{
- string anID;
- if(theID == "") anID = getDefaultVisualComponent();
- else anID = theID;
-
- _PTR(AttributeParameter) ap = study->GetCommonParameters(anID, 0);
- ap->SetBool(_AP_DUMP_PYTHON_, !isDumpPython(study, theID));
-}
-
-bool SALOMEDS_IParameters::isDumpPython(_PTR(Study) study, const string& theID)
-{
- string anID;
- if(theID == "") anID = getDefaultVisualComponent();
- else anID = theID;
-
- _PTR(AttributeParameter) ap = study->GetCommonParameters(anID, 0);
- if(!ap) return false;
- if(!ap->IsSet(_AP_DUMP_PYTHON_, PT_BOOLEAN)) return false;
- return (bool)ap->GetBool(_AP_DUMP_PYTHON_);
-}
-
-string SALOMEDS_IParameters::getDefaultVisualComponent()
-{
- return "Interface Applicative";
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef SALOMEDS_IParameters_H
-#define SALOMEDS_IParameters_H
-
-#include <string>
-#include <vector>
-#include <map>
-
-#include "SALOMEDSClient.hxx"
-#include "SALOMEDSClient_IParameters.hxx"
-
-/*!
- Class which an interface to store the parameters of the objects
-*/
-class SALOMEDS_IParameters: public SALOMEDSClient_IParameters
-{
-public:
- SALOMEDS_IParameters(const _PTR(AttributeParameter)& ap);
-
- virtual ~SALOMEDS_IParameters();
-
- /*!
- Appends a string value to a named list.
- Returns a number of the added value.
- Note: the name of the list MUST be unique
- */
- virtual int append(const std::string& listName, const std::string& value);
-
- /*!
- Returns a number elements in the list
- */
- virtual int nbValues(const std::string& listName);
-
- /*!
- Returns a list of values in the list
- */
- virtual std::vector<std::string> getValues(const std::string& listName);
-
- /*!
- Returns a value with given %index, where %index is in range [0:nbValues-1]
- */
- virtual std::string getValue(const std::string& listName, int index);
-
- /*!
- Returns a list all entries lists
- */
- virtual std::vector<std::string> getLists();
-
- /*!
- Sets a new named parameter value for the given entry
- */
- virtual void setParameter(const std::string& entry, const std::string& parameterName, const std::string& value);
-
- /*!
- Gets a named parameter value for the given entry
- */
- virtual std::string getParameter(const std::string& entry, const std::string& parameterName);
-
- /*!
- Returns all parameter names of the given entry
- */
- virtual std::vector<std::string> getAllParameterNames(const std::string& entry);
-
- /*!
- Returns all parameter values of the given entry
- */
- virtual std::vector<std::string> getAllParameterValues(const std::string& entry);
-
- /*!
- Returns a number of parameters of the given entry
- */
- virtual int getNbParameters(const std::string& entry);
-
- /*!
- Returns a list all entries
- */
- virtual std::vector<std::string> getEntries();
-
- /*!
- Sets a global named property value
- */
- virtual void setProperty(const std::string& name, const std::string& value);
-
- /*!
- Gets a value of global named property
- */
- virtual std::string getProperty(const std::string& name);
-
- /*!
- Returns a list all properties
- */
- virtual std::vector<std::string> getProperties();
-
- /*!
- Breaks a value string in two parts which is divided by %separator.
- If fromEnd is True the search of separator starts from the end of the string
- */
- virtual std::vector<std::string> parseValue(const std::string& value, const char separator, bool fromEnd = true);
-
-
- /*!
- Returns encoded entry that is a relative entry for the component
- */
- virtual std::string encodeEntry(const std::string& entry, const std::string& compName);
-
- /*!
- Returns decoded entry that is an absolute entry
- */
- virtual std::string decodeEntry(const std::string& entry);
-
- /*!
- Enables/Disables the dumping visual parameters
- */
- virtual void setDumpPython(_PTR(Study) study, const std::string& theID = "");
-
- /*!
- Returns whether there is the dumping visual parameters
- */
- virtual bool isDumpPython(_PTR(Study) study, const std::string& theID = "");
-
- /*!
- Returns a default name of the component where the visula parameters are stored.
- */
- virtual std::string getDefaultVisualComponent();
-
-private:
- _PTR(AttributeParameter) _ap;
- _PTR(Study) _study;
- std::map<std::string, std::string> _compNames;
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_SComponent.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_SComponent.hxx"
-
-#include "SALOMEDS.hxx"
-#include "SALOMEDS_SComponent_i.hxx"
-
-#include <string>
-
-using namespace std;
-
-SALOMEDS_SComponent::SALOMEDS_SComponent(SALOMEDS::SComponent_ptr theSComponent)
-:SALOMEDS_SObject(theSComponent)
-{}
-
-SALOMEDS_SComponent::SALOMEDS_SComponent(const SALOMEDSImpl_SComponent& theSComponent)
-:SALOMEDS_SObject(theSComponent)
-{}
-
-SALOMEDS_SComponent::~SALOMEDS_SComponent()
-{}
-
-std::string SALOMEDS_SComponent::ComponentDataType()
-{
- std::string aType;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aType = (dynamic_cast<SALOMEDSImpl_SComponent*>(GetLocalImpl()))->ComponentDataType();
- }
- else aType = (SALOMEDS::SComponent::_narrow(GetCORBAImpl()))->ComponentDataType();
-
- return aType;
-}
-
-bool SALOMEDS_SComponent::ComponentIOR(std::string& theID)
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = (dynamic_cast<SALOMEDSImpl_SComponent*>(GetLocalImpl()))->ComponentIOR(theID);
- }
- else {
- CORBA::String_var anIOR;
- ret = (SALOMEDS::SComponent::_narrow(GetCORBAImpl()))->ComponentIOR(anIOR.out());
- theID = std::string(anIOR.in());
- }
-
- return ret;
-}
-
-SALOMEDS::SComponent_ptr SALOMEDS_SComponent::GetSComponent()
-{
- if(_isLocal) {
- if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::SComponent::_duplicate(SALOMEDS::SComponent::_narrow(GetCORBAImpl()));
- SALOMEDS::SComponent_var aSCO = SALOMEDS_SComponent_i::New(*(dynamic_cast<SALOMEDSImpl_SComponent*>(GetLocalImpl())), _orb);
- _corba_impl = SALOMEDS::SComponent::_duplicate(aSCO);
- return aSCO._retn();
- }
- else {
- return SALOMEDS::SComponent::_duplicate(SALOMEDS::SComponent::_narrow(GetCORBAImpl()));
- }
- return SALOMEDS::SComponent::_nil();
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_SComponent.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_SCOMPONENT_H__
-#define __SALOMEDS_SCOMPONENT_H__
-
-#include "SALOMEDSClient_SComponent.hxx"
-#include "SALOMEDS_SObject.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-class Standard_EXPORT SALOMEDS_SComponent: public SALOMEDS_SObject, public SALOMEDSClient_SComponent
-{
-public:
-
- SALOMEDS_SComponent(const SALOMEDSImpl_SComponent& theSComponent);
- SALOMEDS_SComponent(SALOMEDS::SComponent_ptr theSComponent);
- ~SALOMEDS_SComponent();
-
- virtual std::string ComponentDataType();
- virtual bool ComponentIOR(std::string& theID);
-
- SALOMEDS::SComponent_ptr GetSComponent();
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_SComponentIterator.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_SComponentIterator.hxx"
-
-#include "SALOMEDS.hxx"
-#include "SALOMEDS_SComponent.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-
-SALOMEDS_SComponentIterator::SALOMEDS_SComponentIterator(const SALOMEDSImpl_SComponentIterator& theIterator)
-:_local_impl(theIterator.GetPersistentCopy())
-{
- _isLocal = true;
- _corba_impl = SALOMEDS::SComponentIterator::_nil();
-}
-
-SALOMEDS_SComponentIterator::SALOMEDS_SComponentIterator(SALOMEDS::SComponentIterator_ptr theIterator)
-{
- _isLocal = false;
- _corba_impl = SALOMEDS::SComponentIterator::_duplicate(theIterator);
-}
-
-SALOMEDS_SComponentIterator::~SALOMEDS_SComponentIterator()
-{
- if(!_isLocal) _corba_impl->Destroy();
- else if(_local_impl) delete _local_impl;
-}
-
-void SALOMEDS_SComponentIterator::Init()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->Init();
- }
- else _corba_impl->Init();
-}
-
-bool SALOMEDS_SComponentIterator::More()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->More();
- }
- else ret = _corba_impl->More();
- return ret;
-}
-
-void SALOMEDS_SComponentIterator::Next()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->Next();
- }
- else _corba_impl->Next();
-}
-
-_PTR(SComponent) SALOMEDS_SComponentIterator::Value()
-{
- SALOMEDSClient_SComponent* aSCO = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aSCO = new SALOMEDS_SComponent(_local_impl->Value());
- }
- else aSCO = new SALOMEDS_SComponent(_corba_impl->Value());
- return _PTR(SComponent)(aSCO);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_SComponentIterator.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_SCOMPONENTITERATOR_H__
-#define __SALOMEDS_SCOMPONENTITERATOR_H__
-
-#include "SALOMEDSClient.hxx"
-#include "SALOMEDSImpl_SComponentIterator.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-class SALOMEDS_SComponentIterator: public SALOMEDSClient_SComponentIterator
-{
-public:
- SALOMEDS_SComponentIterator(const SALOMEDSImpl_SComponentIterator& theIterator);
- SALOMEDS_SComponentIterator(SALOMEDS::SComponentIterator_ptr theIterator);
- ~SALOMEDS_SComponentIterator();
-
-private:
- bool _isLocal;
- SALOMEDSImpl_SComponentIterator* _local_impl;
- SALOMEDS::SComponentIterator_var _corba_impl;
-
-public:
- virtual void Init();
- virtual bool More();
- virtual void Next();
- virtual _PTR(SComponent) Value();
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_SComponentIterator_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_SComponentIterator_i.hxx"
-#include "SALOMEDS.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-
-using namespace std;
-
-//============================================================================
-/*! Function : constructor
- *
- */
-//============================================================================
-
-SALOMEDS_SComponentIterator_i::SALOMEDS_SComponentIterator_i(const SALOMEDSImpl_SComponentIterator& theImpl,
- CORBA::ORB_ptr orb)
-{
- _orb = CORBA::ORB::_duplicate(orb);
- _impl = theImpl.GetPersistentCopy();
-}
-
-//============================================================================
-/*! Function : destructor
- *
- */
-//============================================================================
-SALOMEDS_SComponentIterator_i::~SALOMEDS_SComponentIterator_i()
-{
- if(_impl) delete _impl;
-}
-
-//============================================================================
-/*! Function : Init
- *
- */
-//============================================================================
-void SALOMEDS_SComponentIterator_i::Init()
-{
- SALOMEDS::Locker lock;
- _impl->Init();
-}
-
-//============================================================================
-/*! Function : More
- *
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_SComponentIterator_i::More()
-{
- SALOMEDS::Locker lock;
- return _impl->More();
-}
-
- //============================================================================
-/*! Function : Next
- */
-//============================================================================
-void SALOMEDS_SComponentIterator_i::Next()
-{
- SALOMEDS::Locker lock;
- _impl->Next();
-}
-
-
-//============================================================================
-/*! Function : Value
- *
- */
-//============================================================================
-SALOMEDS::SComponent_ptr SALOMEDS_SComponentIterator_i::Value()
-{
- SALOMEDS::Locker lock;
- SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (_impl->Value(), _orb);
- return sco._retn();
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_SComponentIterator_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_SCOMPONENTITERATOR_I_H__
-#define __SALOMEDS_SCOMPONENTITERATOR_I_H__
-
-// std C++ headers
-#include <iostream>
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include <SALOME_GenericObj_i.hh>
-
-//SALOMEDS headers
-#include "SALOMEDS_SComponent_i.hxx"
-#include "SALOMEDSImpl_SComponentIterator.hxx"
-
-class SALOMEDS_SComponentIterator_i:public virtual POA_SALOMEDS::SComponentIterator,
- public virtual PortableServer::ServantBase,
- public virtual SALOME::GenericObj_i
-{
-
-private:
-
- CORBA::ORB_ptr _orb;
- SALOMEDSImpl_SComponentIterator* _impl;
-
-public:
-
- SALOMEDS_SComponentIterator_i(const SALOMEDSImpl_SComponentIterator& theImpl, CORBA::ORB_ptr);
-
- ~SALOMEDS_SComponentIterator_i();
-
- virtual void Init();
- virtual CORBA::Boolean More();
- virtual void Next();
- virtual SALOMEDS::SComponent_ptr Value();
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_SComponent_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_SComponent_i.hxx"
-#include "SALOMEDS.hxx"
-#include "utilities.h"
-#include <map>
-
-using namespace std;
-
-SALOMEDS::SComponent_ptr SALOMEDS_SComponent_i::New(const SALOMEDSImpl_SComponent& theImpl, CORBA::ORB_ptr theORB)
-{
- SALOMEDS_SComponent_i* sco_servant = new SALOMEDS_SComponent_i(theImpl, theORB);
- SALOMEDS::SComponent_var sco = SALOMEDS::SComponent::_narrow(sco_servant->SComponent::_this());
-
- return sco._retn();
-}
-
-//============================================================================
-/*! Function : constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDS_SComponent_i::SALOMEDS_SComponent_i(const SALOMEDSImpl_SComponent& theImpl, CORBA::ORB_ptr orb)
- :SALOMEDS_SObject_i(theImpl, orb)
-{}
-
-//============================================================================
-/*! Function : destructor
- * Purpose :
- */
-//============================================================================
-SALOMEDS_SComponent_i::~SALOMEDS_SComponent_i()
-{}
-
-//============================================================================
-/*! Function : ComponentDataType
- * Purpose :
- */
-//============================================================================
-char* SALOMEDS_SComponent_i::ComponentDataType()
-{
- SALOMEDS::Locker lock;
- string aType = dynamic_cast<SALOMEDSImpl_SComponent*>(_impl)->ComponentDataType();
- return CORBA::string_dup(aType.c_str());
-}
-
-
-//============================================================================
-/*! Function : ComponentIOR
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_SComponent_i::ComponentIOR(CORBA::String_out IOR)
-{
- SALOMEDS::Locker lock;
- string ior;
- if(!dynamic_cast<SALOMEDSImpl_SComponent*>(_impl)->ComponentIOR(ior)) {
- IOR = CORBA::string_dup("");
- return false;
- }
- IOR = CORBA::string_dup(ior.c_str());
- return true;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_SComponent_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_SCOMPONENT_I_H__
-#define __SALOMEDS_SCOMPONENT_I_H__
-
-// std C++ headers
-#include <iostream>
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-//SALOMEDS headers
-#include "SALOMEDS_SObject_i.hxx"
-
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-
-class Standard_EXPORT SALOMEDS_SComponent_i: public POA_SALOMEDS::SComponent,
- public SALOMEDS_SObject_i
-{
-
-public:
-
- static SALOMEDS::SComponent_ptr New(const SALOMEDSImpl_SComponent&, CORBA::ORB_ptr);
-
- SALOMEDS_SComponent_i(const SALOMEDSImpl_SComponent&, CORBA::ORB_ptr);
-
- virtual ~SALOMEDS_SComponent_i();
-
- virtual char* ComponentDataType();
- virtual CORBA::Boolean ComponentIOR(CORBA::String_out theID);
-
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_SObject.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include <string>
-
-#include "SALOMEDS_SObject.hxx"
-
-#include "SALOMEDS.hxx"
-#include "SALOMEDS_SComponent.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDS_Study.hxx"
-#include "SALOMEDS_SObject_i.hxx"
-
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
-
-#include "Basics_Utils.hxx"
-
-#include "utilities.h"
-
-#ifdef WIN32
-#include <windows.h>
-#include <process.h>
-#else
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-
-
-using namespace std;
-
-SALOMEDS_SObject::SALOMEDS_SObject(SALOMEDS::SObject_ptr theSObject)
-{
-#ifdef WIN32
- long pid = (long)_getpid();
-#else
- long pid = (long)getpid();
-#endif
-
- CORBA::LongLong addr = // mpv: fix for IPAL13534: for 64-bit platforms use 8-bytes long for pointer storage
- theSObject->GetLocalImpl(Kernel_Utils::GetHostname().c_str(), pid, _isLocal);
-
- if(_isLocal) {
- _local_impl = reinterpret_cast<SALOMEDSImpl_SObject*>(addr);
- _corba_impl = SALOMEDS::SObject::_duplicate(theSObject);
- }
- else {
- _local_impl = NULL;
- _corba_impl = SALOMEDS::SObject::_duplicate(theSObject);
- }
-
- init_orb();
-}
-
-SALOMEDS_SObject::SALOMEDS_SObject(const SALOMEDSImpl_SObject& theSObject)
-:_isLocal(true)
-{
- _corba_impl = SALOMEDS::SObject::_nil();
-
- if(theSObject.IsComponent()) {
- SALOMEDSImpl_SComponent sco = theSObject;
- _local_impl = sco.GetPersistentCopy();
- }
- else {
- _local_impl = theSObject.GetPersistentCopy();
- }
-
- init_orb();
-}
-
-SALOMEDS_SObject::~SALOMEDS_SObject()
-{
- if (!_isLocal) {
- _corba_impl->Destroy();
- }
- else {
- if(_local_impl) delete _local_impl;
- }
-}
-
-std::string SALOMEDS_SObject::GetID()
-{
- std::string aValue;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aValue = _local_impl->GetID();
- }
- else aValue = _corba_impl->GetID();
- return aValue;
-}
-
-_PTR(SComponent) SALOMEDS_SObject::GetFatherComponent()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- return _PTR(SComponent)(new SALOMEDS_SComponent(_local_impl->GetFatherComponent()));
- }
- return _PTR(SComponent)(new SALOMEDS_SComponent(_corba_impl->GetFatherComponent()));
-}
-
-_PTR(SObject) SALOMEDS_SObject::GetFather()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- return _PTR(SObject)(new SALOMEDS_SObject(_local_impl->GetFather()));
- }
- return _PTR(SObject)(new SALOMEDS_SObject(_corba_impl->GetFather()));
-}
-
-bool SALOMEDS_SObject::FindAttribute(_PTR(GenericAttribute)& anAttribute,
- const std::string& aTypeOfAttribute)
-{
- bool ret = false;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- DF_Attribute* anAttr = NULL;
- ret = _local_impl->FindAttribute(anAttr, aTypeOfAttribute);
- if(ret) {
- SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(anAttr);
- anAttribute = _PTR(GenericAttribute)(SALOMEDS_GenericAttribute::CreateAttribute(ga));
- }
- }
- else {
- SALOMEDS::GenericAttribute_var anAttr;
- ret = _corba_impl->FindAttribute(anAttr.out(), aTypeOfAttribute.c_str());
- if(ret) anAttribute = _PTR(GenericAttribute)(SALOMEDS_GenericAttribute::CreateAttribute(anAttr));
- }
-
- return ret;
-}
-
-bool SALOMEDS_SObject::ReferencedObject(_PTR(SObject)& theObject)
-{
- bool ret = false;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_SObject aSO;
- ret = _local_impl->ReferencedObject(aSO);
- if(ret) theObject = _PTR(SObject)(new SALOMEDS_SObject(aSO));
- }
- else {
- SALOMEDS::SObject_var aSO;
- ret = _corba_impl->ReferencedObject(aSO.out());
- if(ret) theObject = _PTR(SObject)(new SALOMEDS_SObject(aSO));
- }
-
- return ret;
-}
-
-
-bool SALOMEDS_SObject::FindSubObject(int theTag, _PTR(SObject)& theObject)
-{
- bool ret = false;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_SObject aSO;
- ret = _local_impl->FindSubObject(theTag, aSO);
- if(ret) theObject = _PTR(SObject)(new SALOMEDS_SObject(aSO));
- }
- else {
- SALOMEDS::SObject_var aSO;
- ret = _corba_impl->FindSubObject(theTag, aSO.out());
- if(ret) theObject = _PTR(SObject)(new SALOMEDS_SObject(aSO));
- }
-
- return ret;
-}
-
-_PTR(Study) SALOMEDS_SObject::GetStudy()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- return _PTR(Study)(new SALOMEDS_Study(_local_impl->GetStudy()));
- }
- return _PTR(Study)(new SALOMEDS_Study(_corba_impl->GetStudy()));
-}
-
-std::string SALOMEDS_SObject::Name()
-{
- std::string aName;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aName = _local_impl->Name();
- }
- else aName = _corba_impl->Name();
-
- return aName;
-}
-
-void SALOMEDS_SObject::Name(const std::string& theName)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->Name(theName);
- }
- else _corba_impl->Name(theName.c_str());
-}
-
-vector<_PTR(GenericAttribute)> SALOMEDS_SObject::GetAllAttributes()
-{
- vector<_PTR(GenericAttribute)> aVector;
- int aLength = 0;
- SALOMEDSClient_GenericAttribute* anAttr;
-
- if (_isLocal) {
- SALOMEDS::Locker lock;
- vector<DF_Attribute*> aSeq = _local_impl->GetAllAttributes();
- aLength = aSeq.size();
- for (int i = 0; i < aLength; i++) {
- anAttr = SALOMEDS_GenericAttribute::CreateAttribute(dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aSeq[i]));
- aVector.push_back(_PTR(GenericAttribute)(anAttr));
- }
- }
- else {
- SALOMEDS::ListOfAttributes_var aSeq = _corba_impl->GetAllAttributes();
- aLength = aSeq->length();
- for (int i = 0; i < aLength; i++) {
- anAttr = SALOMEDS_GenericAttribute::CreateAttribute(aSeq[i]);
- aVector.push_back(_PTR(GenericAttribute)(anAttr));
- }
- }
-
- return aVector;
-}
-
-std::string SALOMEDS_SObject::GetName()
-{
- std::string aName;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aName = _local_impl->GetName();
- }
- else aName = _corba_impl->GetName();
-
- return aName;
-}
-
-std::string SALOMEDS_SObject::GetComment()
-{
- std::string aComment;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aComment = _local_impl->GetComment();
- }
- else aComment = _corba_impl->GetComment();
-
- return aComment;
-}
-
-std::string SALOMEDS_SObject::GetIOR()
-{
- std::string anIOR;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- anIOR = _local_impl->GetIOR();
- }
- else anIOR = _corba_impl->GetIOR();
-
- return anIOR;
-}
-
-int SALOMEDS_SObject::Tag()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- return _local_impl->Tag();
- }
- return _corba_impl->Tag();
-}
-
-int SALOMEDS_SObject::Depth()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- return _local_impl->Depth();
- }
- return _corba_impl->Depth();
-}
-
-CORBA::Object_ptr SALOMEDS_SObject::GetObject()
-{
- CORBA::Object_var obj;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- std::string anIOR = GetIOR();
- if (!anIOR.empty())
- obj = _orb->string_to_object(anIOR.c_str());
- return obj._retn();
- }
- else {
- obj = _corba_impl->GetObject();
- return obj._retn();
- }
-
- return CORBA::Object::_nil();
-}
-
-SALOMEDS::SObject_ptr SALOMEDS_SObject::GetSObject()
-{
- if(_isLocal) {
- if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::SObject::_duplicate(_corba_impl);
- SALOMEDS::SObject_var aSO = SALOMEDS_SObject_i::New(*_local_impl, _orb);
- _corba_impl = SALOMEDS::SObject::_duplicate(aSO);
- return aSO._retn();
- }
- else {
- return SALOMEDS::SObject::_duplicate(_corba_impl);
- }
- return SALOMEDS::SObject::_nil();
-}
-
-
-void SALOMEDS_SObject::init_orb()
-{
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- _orb = init(0 , 0 ) ;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_SObject.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_SOBJECT_H__
-#define __SALOMEDS_SOBJECT_H__
-
-// std C++ headers
-#include <vector>
-
-#include <SALOMEDSClient.hxx>
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-#include "SALOMEDSImpl_SObject.hxx"
-
-class Standard_EXPORT SALOMEDS_SObject: public virtual SALOMEDSClient_SObject
-{
-protected:
-
- bool _isLocal;
- SALOMEDSImpl_SObject* _local_impl;
- SALOMEDS::SObject_var _corba_impl;
- CORBA::ORB_var _orb;
-
-public:
-
- SALOMEDS_SObject(SALOMEDS::SObject_ptr theSObject);
- SALOMEDS_SObject(const SALOMEDSImpl_SObject& theSObject);
- virtual ~SALOMEDS_SObject();
-
- virtual std::string GetID();
- virtual _PTR(SComponent) GetFatherComponent();
- virtual _PTR(SObject) GetFather();
- virtual bool FindAttribute(_PTR(GenericAttribute)& anAttribute, const std::string& aTypeOfAttribute);
- virtual bool ReferencedObject(_PTR(SObject)& theObject);
- virtual bool FindSubObject(int theTag, _PTR(SObject)& theObject);
- virtual _PTR(Study) GetStudy();
- virtual std::string Name();
- virtual void Name(const std::string& theName);
- virtual std::vector<_PTR(GenericAttribute)> GetAllAttributes();
- virtual std::string GetName();
- virtual std::string GetComment();
- virtual std::string GetIOR();
- virtual int Tag();
- virtual int Depth();
-
- CORBA::Object_ptr GetObject();
- SALOMEDS::SObject_ptr GetSObject();
-
- SALOMEDS::SObject_ptr GetCORBAImpl() { return SALOMEDS::SObject::_duplicate(_corba_impl); }
- SALOMEDSImpl_SObject* GetLocalImpl() { return _local_impl; }
-
-private:
- void init_orb();
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_SObject_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "utilities.h"
-#include "SALOMEDS_SObject_i.hxx"
-#include "SALOMEDS_SComponent_i.hxx"
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDS_StudyManager_i.hxx"
-#include "SALOMEDS.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-#include "SALOMEDSImpl_AttributeIOR.hxx"
-#include "Basics_Utils.hxx"
-
-#include <map>
-
-#ifdef WIN32
-#include <process.h>
-#else
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-using namespace std;
-
-SALOMEDS::SObject_ptr SALOMEDS_SObject_i::New(const SALOMEDSImpl_SObject& theImpl, CORBA::ORB_ptr theORB)
-{
- SALOMEDS_SObject_i* so_servant = new SALOMEDS_SObject_i(theImpl, theORB);
- SALOMEDS::SObject_var so = SALOMEDS::SObject::_narrow(so_servant->_this());
-
- return so._retn();
-}
-
-
-//============================================================================
-/*! Function : constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDS_SObject_i::SALOMEDS_SObject_i(const SALOMEDSImpl_SObject& impl, CORBA::ORB_ptr orb)
-{
- if(!impl.IsNull()) {
- if(impl.IsComponent()) {
- SALOMEDSImpl_SComponent sco = impl;
- _impl = sco.GetPersistentCopy();
- }
- else {
- _impl = impl.GetPersistentCopy();
- }
- }
- _orb = CORBA::ORB::_duplicate(orb);
- //SALOME::GenericObj_i::myPOA = SALOMEDS_StudyManager_i::GetPOA(GetStudy());
-}
-
-
-//============================================================================
-/*! Function : destructor
- * Purpose :
- */
-//============================================================================
-SALOMEDS_SObject_i::~SALOMEDS_SObject_i()
-{
- if(_impl) delete _impl;
-}
-
-
-//============================================================================
-/*! Function :GetID
- * Purpose :
- */
-//============================================================================
-char* SALOMEDS_SObject_i::GetID()
-{
- SALOMEDS::Locker lock;
- return CORBA::string_dup(_impl->GetID().c_str());
-}
-
-//============================================================================
-/*! Function : GetFatherComponent
- * Purpose :
- */
-//============================================================================
-SALOMEDS::SComponent_ptr SALOMEDS_SObject_i::GetFatherComponent()
-{
- SALOMEDS::Locker lock;
- SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (_impl->GetFatherComponent(), _orb);
- return sco._retn();
-}
-
-//============================================================================
-/*! Function : GetFather
- * Purpose :
- */
-//============================================================================
-SALOMEDS::SObject_ptr SALOMEDS_SObject_i::GetFather()
-{
- SALOMEDS::Locker lock;
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (_impl->GetFather(), _orb);
- return so._retn();
-}
-
-//============================================================================
-/*! Function :
- * Purpose :
- */
-//============================================================================
-SALOMEDS::Study_ptr SALOMEDS_SObject_i::GetStudy()
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_Study* aStudy = _impl->GetStudy();
- if(!aStudy) {
- MESSAGE("Problem GetStudy");
- return SALOMEDS::Study::_nil();
- }
-
- string IOR = aStudy->GetTransientReference();
- CORBA::Object_var obj = _orb->string_to_object(IOR.c_str());
- SALOMEDS::Study_var Study = SALOMEDS::Study::_narrow(obj) ;
- ASSERT(!CORBA::is_nil(Study));
- return SALOMEDS::Study::_duplicate(Study);
-}
-
-//============================================================================
-/*! Function : FindAttribute
- * Purpose : Find attribute of given type on this SObject
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_SObject_i::FindAttribute (SALOMEDS::GenericAttribute_out anAttribute,
- const char* aTypeOfAttribute)
-{
- SALOMEDS::Locker lock;
- DF_Attribute* anAttr = NULL;
- if(_impl->FindAttribute(anAttr, (char*)aTypeOfAttribute)) {
- anAttribute = SALOMEDS::GenericAttribute::_duplicate(SALOMEDS_GenericAttribute_i::CreateAttribute(anAttr, _orb));
- return true;
- }
-
- return false;
-}
-
-//============================================================================
-/*! Function : GetAllAttributes
- * Purpose : Returns list of all attributes for this sobject
- */
-//============================================================================
-
-SALOMEDS::ListOfAttributes* SALOMEDS_SObject_i::GetAllAttributes()
-{
- SALOMEDS::Locker lock;
- vector<DF_Attribute*> aSeq = _impl->GetAllAttributes();
- SALOMEDS::ListOfAttributes_var SeqOfAttr = new SALOMEDS::ListOfAttributes;
- int length = aSeq.size();
-
- SeqOfAttr->length(length);
-
- if (length != 0) {
- for(int i = 0; i < length; i++) {
- SALOMEDSImpl_GenericAttribute* anAttr = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aSeq[i]);
- SALOMEDS::GenericAttribute_var anAttribute;
- anAttribute = SALOMEDS::GenericAttribute::_duplicate(SALOMEDS_GenericAttribute_i::CreateAttribute(anAttr, _orb));
- if (!CORBA::is_nil(anAttribute)) {
- SeqOfAttr[i] = anAttribute;
- }
- }
- }
- return SeqOfAttr._retn();
-}
-
-
-//============================================================================
-/*! Function : ReferencedObject
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_SObject_i::ReferencedObject(SALOMEDS::SObject_out obj)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_SObject aRefObj;
- if(!_impl->ReferencedObject(aRefObj)) return false;
-
- obj = SALOMEDS_SObject_i::New (aRefObj, _orb);
- return true;
-}
-
-//============================================================================
-/*! Function : FindSubObject
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_SObject_i::FindSubObject(CORBA::Long atag, SALOMEDS::SObject_out obj)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_SObject aSubObj;
- if(!_impl->FindSubObject(atag, aSubObj)) return false;
-
- obj = SALOMEDS_SObject_i::New (aSubObj, _orb);
- return true;
-
-}
-
-//============================================================================
-/*! Function : Name
- * Purpose : gets a name
- */
-//============================================================================
-char* SALOMEDS_SObject_i::Name()
-{
- SALOMEDS::Locker lock;
- return CORBA::string_dup(_impl->Name().c_str());
-}
-
-//============================================================================
-/*! Function : Name
- * Purpose : sets a name
- */
-//============================================================================
-void SALOMEDS_SObject_i::Name(const char* name)
-{
- SALOMEDS::Locker lock;
- string aName((char*)name);
- _impl->Name(aName);
-}
-
-//============================================================================
-/*! Function : Tag
- * Purpose :
- */
-//============================================================================
-CORBA::Short SALOMEDS_SObject_i::Tag()
-{
- SALOMEDS::Locker lock;
- return _impl->Tag();
-}
-
-//============================================================================
-/*! Function : Depth
- * Purpose :
- */
-//============================================================================
-CORBA::Short SALOMEDS_SObject_i::Depth()
-{
- SALOMEDS::Locker lock;
- return _impl->Depth();
-}
-
-//============================================================================
-/*! Function : GetObject
- * Purpose :
- */
-//============================================================================
-CORBA::Object_ptr SALOMEDS_SObject_i::GetObject()
-{
- SALOMEDS::Locker lock;
- CORBA::Object_ptr obj = CORBA::Object::_nil();
- try {
- string IOR = _impl->GetIOR();
- char* c_ior = CORBA::string_dup(IOR.c_str());
- obj = _orb->string_to_object(c_ior);
- CORBA::string_free(c_ior);
- } catch(...) {}
- return obj;
-}
-
-//============================================================================
-/*! Function : GetName
- * Purpose :
- */
-//============================================================================
-char* SALOMEDS_SObject_i::GetName()
-{
- SALOMEDS::Locker lock;
- CORBA::String_var aStr = CORBA::string_dup(_impl->GetName().c_str());
- return aStr._retn();
-}
-
-//============================================================================
-/*! Function : GetComment
- * Purpose :
- */
-//============================================================================
-char* SALOMEDS_SObject_i::GetComment()
-{
- SALOMEDS::Locker lock;
- CORBA::String_var aStr = CORBA::string_dup(_impl->GetComment().c_str());
- return aStr._retn();
-}
-
-//============================================================================
-/*! Function : GetIOR
- * Purpose :
- */
-//============================================================================
-char* SALOMEDS_SObject_i::GetIOR()
-{
- SALOMEDS::Locker lock;
- CORBA::String_var aStr = CORBA::string_dup(_impl->GetIOR().c_str());
- return aStr._retn();
-}
-
-//===========================================================================
-// PRIVATE FUNCTIONS
-//===========================================================================
-CORBA::LongLong SALOMEDS_SObject_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
-{
-#ifdef WIN32
- long pid = (long)_getpid();
-#else
- long pid = (long)getpid();
-#endif
- isLocal = (strcmp(theHostname, Kernel_Utils::GetHostname().c_str()) == 0 && pid == thePID)?1:0;
- return reinterpret_cast<CORBA::LongLong>(_impl);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_SObject_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_SOBJECT_I_H__
-#define __SALOMEDS_SOBJECT_I_H__
-
-// std C++ headers
-#include <iostream>
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include <SALOME_GenericObj_i.hh>
-
-// Cascade headers
-#include "SALOMEDSImpl_SObject.hxx"
-
-class Standard_EXPORT SALOMEDS_SObject_i: public virtual POA_SALOMEDS::SObject,
- public virtual PortableServer::ServantBase,
- public virtual SALOME::GenericObj_i
-{
-protected:
- CORBA::ORB_ptr _orb;
- SALOMEDSImpl_SObject* _impl;
-
-public:
-
- static SALOMEDS::SObject_ptr New(const SALOMEDSImpl_SObject&, CORBA::ORB_ptr);
-
- SALOMEDS_SObject_i(const SALOMEDSImpl_SObject&, CORBA::ORB_ptr);
-
- virtual ~SALOMEDS_SObject_i();
-
- virtual char* GetID();
- virtual SALOMEDS::SComponent_ptr GetFatherComponent();
- virtual SALOMEDS::SObject_ptr GetFather() ;
- virtual CORBA::Boolean FindAttribute(SALOMEDS::GenericAttribute_out anAttribute, const char* aTypeOfAttribute);
- virtual CORBA::Boolean ReferencedObject(SALOMEDS::SObject_out obj) ;
- virtual CORBA::Boolean FindSubObject(CORBA::Long atag, SALOMEDS::SObject_out obj );
-
- virtual SALOMEDS::Study_ptr GetStudy() ;
- virtual char* Name();
- virtual void Name(const char*);
- virtual SALOMEDS::ListOfAttributes* GetAllAttributes();
-
- virtual CORBA::Object_ptr GetObject();
-
- virtual char* GetName();
- virtual char* GetComment();
- virtual char* GetIOR();
-
- virtual CORBA::Short Tag();
- virtual CORBA::Short Depth();
-
- virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDS_Server.cxx
-// Author : Yves FRICAUD
-// Module : SALOME
-// $Header$
-//
-#include "utilities.h"
-#include "Utils_SINGLETON.hxx"
-
-#include "SALOME_NamingService.hxx"
-#include "SALOMEDS_StudyManager_i.hxx"
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-#ifdef CHECKTIME
-#include <Utils_Timer.hxx>
-#endif
-using namespace std;
-
-// extern "C"
-// { // for ccmalloc memory debug
-// void ccmalloc_static_initialization(void);
-// }
-
-///////////////////////////// MAIN ///////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-int main(int argc, char** argv)
-{
- // ccmalloc_static_initialization();
-
- MESSAGE("SALOMEDS_Server - main");
- try
- {
- // Initialise the ORB.
-#if OMNIORB_VERSION >= 4
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, "omniORB4" ) ;
-#else
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, "omniORB3" );
-#endif
- // Obtain a reference to the root POA.
- long TIMESleep = 500000000;
- int NumberOfTries = 40;
- int a;
- timespec ts_req;
- ts_req.tv_nsec=TIMESleep;
- ts_req.tv_sec=0;
- timespec ts_rem;
- ts_rem.tv_nsec=0;
- ts_rem.tv_sec=0;
- CosNaming::NamingContext_var inc;
- PortableServer::POA_var poa;
- CORBA::Object_var theObj;
- CORBA::Object_var obj;
- CORBA::Object_var object;
- int SALOMEDS=0;
- const char * Env = getenv("USE_LOGGER");
- int EnvL =0;
- if ((Env!=NULL) && (strlen(Env)))
- EnvL=1;
- CosNaming::Name name;
- name.length(1);
- name[0].id=CORBA::string_dup("Logger");
- PortableServer::POAManager_var pman;
- for (int i = 1; i<=NumberOfTries; i++)
- {
- if (i!=1)
-#ifndef WIN32
- a=nanosleep(&ts_req,&ts_rem);
-#else
- Sleep(TIMESleep/1000000);
-#endif
- try
- {
- obj = orb->resolve_initial_references("RootPOA");
- if(!CORBA::is_nil(obj))
- poa = PortableServer::POA::_narrow(obj);
- if(!CORBA::is_nil(poa))
- pman = poa->the_POAManager();
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- if (!CORBA::is_nil(theObj)){
- inc = CosNaming::NamingContext::_narrow(theObj);
- if(!CORBA::is_nil(inc))
- {
- MESSAGE( "SalomeDS Server: Naming Service was found" );
- if(EnvL==1)
- {
- CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
- SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
- NS.init_orb( orb1 ) ;
- for(int j=1; j<=NumberOfTries; j++)
- {
- if (j!=1)
-#ifndef WIN32
- a=nanosleep(&ts_req, &ts_rem);
-#else
- Sleep(TIMESleep/1000000);
-#endif
- try
- {
- object = inc->resolve(name);
- }
- catch(CosNaming::NamingContext::NotFound)
- {
- MESSAGE( "SalomeDS Server: Logger Server wasn't found" ); }
-
- catch(...)
- {
- MESSAGE( "SalomeDS Server: Unknown exception" );
- }
- if (!CORBA::is_nil(object))
- {
- MESSAGE( "SalomeDS Server: Logger Server was found" );
- SALOMEDS=1;
- break;
- }
- }
- }
- }
- }
-
- }
- catch( const SALOME_Exception &ex )
- {
- MESSAGE( "Communication Error : " << ex.what() );
- return EXIT_FAILURE ;
- }
- if ((SALOMEDS==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
- break;
- }
-
- // We allocate the objects on the heap. Since these are reference
- // counted objects, they will be deleted by the POA when they are no
- // longer needed.
- SALOMEDS_StudyManager_i * myStudyManager_i = new SALOMEDS_StudyManager_i(orb,poa);
-
- // Activate the objects. This tells the POA that the objects are
- // ready to accept requests.
- PortableServer::ObjectId_var myStudyManager_iid = poa->activate_object(myStudyManager_i);
- myStudyManager_i->register_name("/myStudyManager");
- myStudyManager_i->_remove_ref();
-
- // Obtain a POAManager, and tell the POA to start accepting
- // requests on its objects.
- pman = poa->the_POAManager();
- pman->activate();
-
-#ifdef CHECKTIME
- Utils_Timer timer;
- timer.Start();
- timer.Stop();
- MESSAGE("SALOME_Registry_Server.cxx - orb->run()");
- timer.ShowAbsolute();
-#endif
- orb->run();
- orb->destroy();
- }
- catch(CORBA::SystemException&)
- {
- MESSAGE( "Caught CORBA::SystemException." );
- }
- catch(CORBA::Exception&)
- {
- MESSAGE( "Caught CORBA::Exception." );
- }
- catch(omniORB::fatalException& fe)
- {
- MESSAGE( "Caught omniORB::fatalException:" );
- MESSAGE( " file: " << fe.file() );
- MESSAGE( " line: " << fe.line() );
- MESSAGE( " mesg: " << fe.errmsg() );
- }
- catch(...)
- {
- MESSAGE( "Caught unknown exception." );
- }
- return 0;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_Study.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "utilities.h"
-
-#include "SALOMEDS_Study.hxx"
-
-#include "SALOMEDS.hxx"
-#include "SALOMEDS_SComponent.hxx"
-#include "SALOMEDS_SObject.hxx"
-#include "SALOMEDS_StudyBuilder.hxx"
-#include "SALOMEDS_ChildIterator.hxx"
-#include "SALOMEDS_SComponentIterator.hxx"
-#include "SALOMEDS_AttributeStudyProperties.hxx"
-#include "SALOMEDS_AttributeParameter.hxx"
-#include "SALOMEDS_UseCaseBuilder.hxx"
-
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_StudyBuilder.hxx"
-#include "SALOMEDSImpl_ChildIterator.hxx"
-#include "SALOMEDSImpl_SComponentIterator.hxx"
-#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
-#include "SALOMEDSImpl_AttributeParameter.hxx"
-#include "SALOMEDSImpl_GenericVariable.hxx"
-#include "SALOMEDSImpl_UseCaseBuilder.hxx"
-
-#include "SALOMEDS_Driver_i.hxx"
-#include "SALOMEDS_Study_i.hxx"
-
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
-
-#include "Basics_Utils.hxx"
-
-#ifdef WIN32
-#include <process.h>
-#else
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-using namespace std;
-
-SALOMEDS_Study::SALOMEDS_Study(SALOMEDSImpl_Study* theStudy)
-{
- _isLocal = true;
- _local_impl = theStudy;
- _corba_impl = SALOMEDS::Study::_nil();
- init_orb();
-}
-
-SALOMEDS_Study::SALOMEDS_Study(SALOMEDS::Study_ptr theStudy)
-{
-#ifdef WIN32
- long pid = (long)_getpid();
-#else
- long pid = (long)getpid();
-#endif
-
- long addr = theStudy->GetLocalImpl(Kernel_Utils::GetHostname().c_str(), pid, _isLocal);
- if(_isLocal) {
- _local_impl = reinterpret_cast<SALOMEDSImpl_Study*>(addr);
- _corba_impl = SALOMEDS::Study::_duplicate(theStudy);
- }
- else {
- _local_impl = NULL;
- _corba_impl = SALOMEDS::Study::_duplicate(theStudy);
- }
-
- init_orb();
-}
-
-SALOMEDS_Study::~SALOMEDS_Study()
-{
-}
-
-std::string SALOMEDS_Study::GetPersistentReference()
-{
- std::string aRef;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aRef = _local_impl->GetPersistentReference();
- }
- else aRef = _corba_impl->GetPersistentReference();
- return aRef;
-}
-
-std::string SALOMEDS_Study::GetTransientReference()
-{
- std::string aRef;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aRef = _local_impl->GetTransientReference();
- }
- else aRef = _corba_impl->GetTransientReference();
- return aRef;
-}
-
-bool SALOMEDS_Study::IsEmpty()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->IsEmpty();
- }
- else ret = _corba_impl->IsEmpty();
- return ret;
-}
-
-_PTR(SComponent) SALOMEDS_Study::FindComponent (const std::string& aComponentName)
-{
- SALOMEDSClient_SComponent* aSCO = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SComponent aSCO_impl = _local_impl->FindComponent(aComponentName);
- if (!aSCO_impl) return _PTR(SComponent)(aSCO);
- aSCO = new SALOMEDS_SComponent(aSCO_impl);
- }
- else {
- SALOMEDS::SComponent_var aSCO_impl = _corba_impl->FindComponent((char*)aComponentName.c_str());
- if (CORBA::is_nil(aSCO_impl)) return _PTR(SComponent)(aSCO);
- aSCO = new SALOMEDS_SComponent(aSCO_impl);
- }
- return _PTR(SComponent)(aSCO);
-}
-
-_PTR(SComponent) SALOMEDS_Study::FindComponentID(const std::string& aComponentID)
-{
- SALOMEDSClient_SComponent* aSCO = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SComponent aSCO_impl = _local_impl->FindComponentID(aComponentID);
- if (!aSCO_impl) return _PTR(SComponent)(aSCO);
- aSCO = new SALOMEDS_SComponent(aSCO_impl);
- }
- else {
- SALOMEDS::SComponent_var aSCO_impl = _corba_impl->FindComponentID((char*)aComponentID.c_str());
- if(CORBA::is_nil(aSCO_impl)) return _PTR(SComponent)(aSCO);
- aSCO = new SALOMEDS_SComponent(aSCO_impl);
- }
- return _PTR(SComponent)(aSCO);
-}
-
-_PTR(SObject) SALOMEDS_Study::FindObject(const std::string& anObjectName)
-{
- SALOMEDSClient_SObject* aSO = NULL;
-
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO_impl = _local_impl->FindObject(anObjectName);
- if (!aSO_impl) return _PTR(SObject)(aSO);
- if(aSO_impl.IsComponent()) {
- SALOMEDSImpl_SComponent aSCO_impl = aSO_impl;
- return _PTR(SObject)(new SALOMEDS_SComponent(aSCO_impl));
- }
- aSO = new SALOMEDS_SObject(aSO_impl);
- }
- else {
- SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObject((char*)anObjectName.c_str());
- if (CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO);
- SALOMEDS::SComponent_var aSCO_impl = SALOMEDS::SComponent::_narrow(aSO_impl);
- if (!CORBA::is_nil(aSCO_impl)) return _PTR(SObject)(new SALOMEDS_SComponent(aSCO_impl));
- aSO = new SALOMEDS_SObject(aSO_impl);
- }
-
- return _PTR(SObject)(aSO);
-}
-
-std::vector<_PTR(SObject)> SALOMEDS_Study::FindObjectByName(const std::string& anObjectName,
- const std::string& aComponentName)
-{
- std::vector<_PTR(SObject)> aVector;
- int i, aLength = 0;
-
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- vector<SALOMEDSImpl_SObject> aSeq = _local_impl->FindObjectByName(anObjectName, aComponentName);
- aLength = aSeq.size();
- for (i = 0; i< aLength; i++)
- aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i])));
- }
- else {
- SALOMEDS::Study::ListOfSObject_var aSeq = _corba_impl->FindObjectByName((char*)anObjectName.c_str(),
- (char*)aComponentName.c_str());
- aLength = aSeq->length();
- for (i = 0; i< aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i])));
- }
-
- return aVector;
-}
-
-_PTR(SObject) SALOMEDS_Study::FindObjectID(const std::string& anObjectID)
-{
- SALOMEDSClient_SObject* aSO = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO_impl = _local_impl->FindObjectID(anObjectID);
- if(!aSO_impl) return _PTR(SObject)(aSO);
- return _PTR(SObject)(new SALOMEDS_SObject(aSO_impl));
- }
- else {
- SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectID((char*)anObjectID.c_str());
- if(CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO);
- return _PTR(SObject)(new SALOMEDS_SObject(aSO_impl));
- }
- return _PTR(SObject)(aSO);
-}
-
-_PTR(SObject) SALOMEDS_Study::CreateObjectID(const std::string& anObjectID)
-{
- SALOMEDSClient_SObject* aSO = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_SObject aSO_impl = _local_impl->CreateObjectID(anObjectID);
- if(!aSO_impl) return _PTR(SObject)(aSO);
- aSO = new SALOMEDS_SObject(aSO_impl);
- }
- else {
- SALOMEDS::SObject_var aSO_impl = _corba_impl->CreateObjectID((char*)anObjectID.c_str());
- if(CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO);
- aSO = new SALOMEDS_SObject(aSO_impl);
- }
- return _PTR(SObject)(aSO);
-}
-
-_PTR(SObject) SALOMEDS_Study::FindObjectIOR(const std::string& anObjectIOR)
-{
- SALOMEDSClient_SObject* aSO = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO_impl = _local_impl->FindObjectIOR(anObjectIOR);
- if (!aSO_impl) return _PTR(SObject)(aSO);
- aSO = new SALOMEDS_SObject(aSO_impl);
- }
- else {
- SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectIOR((char*)anObjectIOR.c_str());
- if (CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO);
- aSO = new SALOMEDS_SObject(aSO_impl);
- }
- return _PTR(SObject)(aSO);
-}
-
-_PTR(SObject) SALOMEDS_Study::FindObjectByPath(const std::string& thePath)
-{
- SALOMEDSClient_SObject* aSO = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO_impl = _local_impl->FindObjectByPath(thePath);
- if (!aSO_impl) return _PTR(SObject)(aSO);
- aSO = new SALOMEDS_SObject(aSO_impl);
- }
- else {
- SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectByPath((char*)thePath.c_str());
- if (CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO);
- aSO = new SALOMEDS_SObject(aSO_impl);
- }
- return _PTR(SObject)(aSO);
-}
-
-std::string SALOMEDS_Study::GetObjectPath(const _PTR(SObject)& theSO)
-{
- if(!theSO) return "";
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- std::string aPath;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aPath = _local_impl->GetObjectPath(*(aSO->GetLocalImpl()));
- }
- else aPath = _corba_impl->GetObjectPath(aSO->GetCORBAImpl());
- return aPath;
-}
-
-void SALOMEDS_Study::SetContext(const std::string& thePath)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->SetContext(thePath);
- }
- else _corba_impl->SetContext((char*)thePath.c_str());
-}
-
-std::string SALOMEDS_Study::GetContext()
-{
- std::string aPath;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aPath = _local_impl->GetContext();
- }
- else aPath = _corba_impl->GetContext();
- return aPath;
-}
-
-std::vector<std::string> SALOMEDS_Study::GetObjectNames(const std::string& theContext)
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = _local_impl->GetObjectNames(theContext);
- }
- else {
- SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetObjectNames((char*)theContext.c_str());
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back(std::string((std::string)aSeq[i].in()));
- }
- return aVector;
-}
-
-std::vector<std::string> SALOMEDS_Study::GetDirectoryNames(const std::string& theContext)
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = _local_impl->GetDirectoryNames(theContext);
- }
- else {
- SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetDirectoryNames((char*)theContext.c_str());
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
- }
- return aVector;
-}
-
-std::vector<std::string> SALOMEDS_Study::GetFileNames(const std::string& theContext)
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = _local_impl->GetFileNames(theContext);
- }
- else {
- SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetFileNames((char*)theContext.c_str());
- aLength = aSeq->length();
-
- for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
- }
- return aVector;
-}
-
-std::vector<std::string> SALOMEDS_Study::GetComponentNames(const std::string& theContext)
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = _local_impl->GetComponentNames(theContext);
- }
- else {
- SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetComponentNames((char*)theContext.c_str());
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
- }
- return aVector;
-}
-
-_PTR(ChildIterator) SALOMEDS_Study::NewChildIterator(const _PTR(SObject)& theSO)
-{
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- SALOMEDSClient_ChildIterator* aCI = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- SALOMEDSImpl_ChildIterator aCIimpl = _local_impl->NewChildIterator(*(aSO->GetLocalImpl()));
- aCI = new SALOMEDS_ChildIterator(aCIimpl);
- }
- else {
- SALOMEDS::ChildIterator_var aCIimpl = _corba_impl->NewChildIterator(aSO->GetCORBAImpl());
- aCI = new SALOMEDS_ChildIterator(aCIimpl);
- }
-
- return _PTR(ChildIterator)(aCI);
-}
-
-_PTR(SComponentIterator) SALOMEDS_Study::NewComponentIterator()
-{
- SALOMEDSClient_SComponentIterator* aCI = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SComponentIterator aCIimpl = _local_impl->NewComponentIterator();
- aCI = new SALOMEDS_SComponentIterator(aCIimpl);
- }
- else {
- SALOMEDS::SComponentIterator_var aCIimpl = _corba_impl->NewComponentIterator();
- aCI = new SALOMEDS_SComponentIterator(aCIimpl);
- }
-
- return _PTR(SComponentIterator)(aCI);
-}
-
-_PTR(StudyBuilder) SALOMEDS_Study::NewBuilder()
-{
- SALOMEDSClient_StudyBuilder* aSB = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_StudyBuilder* aSBimpl = _local_impl->NewBuilder();
- aSB = new SALOMEDS_StudyBuilder(aSBimpl);
- }
- else {
- SALOMEDS::StudyBuilder_var aSBimpl = _corba_impl->NewBuilder();
- aSB = new SALOMEDS_StudyBuilder(aSBimpl);
- }
-
- return _PTR(StudyBuilder)(aSB);
-}
-
-std::string SALOMEDS_Study::Name()
-{
- std::string aName;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aName = _local_impl->Name();
- }
- else aName = _corba_impl->Name();
- return aName;
-}
-
-void SALOMEDS_Study::Name(const std::string& theName)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->Name(theName);
- }
- else _corba_impl->Name((char*)theName.c_str());
-}
-
-bool SALOMEDS_Study::IsSaved()
-{
- bool isSaved;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- isSaved = _local_impl->IsSaved();
- }
- else isSaved = _corba_impl->IsSaved();
- return isSaved;
-}
-
-void SALOMEDS_Study::IsSaved(bool save)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->IsSaved(save);
- }
- else _corba_impl->IsSaved(save);
-}
-
-bool SALOMEDS_Study::IsModified()
-{
- bool isModified;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- isModified = _local_impl->IsModified();
- }
- else isModified = _corba_impl->IsModified();
- return isModified;
-}
-
-void SALOMEDS_Study::Modified()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->Modify();
- }
- else _corba_impl->Modified();
-}
-
-
-std::string SALOMEDS_Study::URL()
-{
- std::string aURL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aURL = _local_impl->URL();
- }
- else aURL = _corba_impl->URL();
- return aURL;
-}
-
-void SALOMEDS_Study::URL(const std::string& url)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->URL(url);
- }
- else _corba_impl->URL((char*)url.c_str());
-}
-
-int SALOMEDS_Study::StudyId()
-{
- int anID;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- anID = _local_impl->StudyId();
- }
- else anID = _corba_impl->StudyId();
- return anID;
-}
-
-void SALOMEDS_Study::StudyId(int id)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->StudyId(id);
- }
- else _corba_impl->StudyId(id);
-}
-
-std::vector<_PTR(SObject)> SALOMEDS_Study::FindDependances(const _PTR(SObject)& theSO)
-{
- std::vector<_PTR(SObject)> aVector;
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- vector<SALOMEDSImpl_SObject> aSeq = _local_impl->FindDependances(*(aSO->GetLocalImpl()));
- if (aSeq.size()) {
- aLength = aSeq.size();
- for (i = 0; i < aLength; i++)
- aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i])));
- }
- }
- else {
- SALOMEDS::Study::ListOfSObject_var aSeq = _corba_impl->FindDependances(aSO->GetCORBAImpl());
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i])));
- }
- return aVector;
-}
-
-_PTR(AttributeStudyProperties) SALOMEDS_Study::GetProperties()
-{
- SALOMEDSClient_AttributeStudyProperties* aProp;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aProp = new SALOMEDS_AttributeStudyProperties(_local_impl->GetProperties());
- }
- else aProp = new SALOMEDS_AttributeStudyProperties(_corba_impl->GetProperties());
- return _PTR(AttributeStudyProperties)(aProp);
-}
-
-std::string SALOMEDS_Study::GetLastModificationDate()
-{
- std::string aDate;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aDate = _local_impl->GetLastModificationDate();
- }
- else aDate = _corba_impl->GetLastModificationDate();
- return aDate;
-}
-
-std::vector<std::string> SALOMEDS_Study::GetModificationsDate()
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = _local_impl->GetModificationsDate();
- }
- else {
- SALOMEDS::ListOfDates_var aSeq = _corba_impl->GetModificationsDate();
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
- }
- return aVector;
-}
-
-_PTR(UseCaseBuilder) SALOMEDS_Study::GetUseCaseBuilder()
-{
- SALOMEDSClient_UseCaseBuilder* aUB = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_UseCaseBuilder* aUBimpl = _local_impl->GetUseCaseBuilder();
- aUB = new SALOMEDS_UseCaseBuilder(aUBimpl);
- }
- else {
- SALOMEDS::UseCaseBuilder_var aUBimpl = _corba_impl->GetUseCaseBuilder();
- aUB = new SALOMEDS_UseCaseBuilder(aUBimpl);
- }
-
- return _PTR(UseCaseBuilder)(aUB);
-}
-
-void SALOMEDS_Study::Close()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->Close();
- }
- else _corba_impl->Close();
-}
-
-void SALOMEDS_Study::EnableUseCaseAutoFilling(bool isEnabled)
-{
- if(_isLocal) _local_impl->EnableUseCaseAutoFilling(isEnabled);
- else _corba_impl->EnableUseCaseAutoFilling(isEnabled);
-}
-
-bool SALOMEDS_Study::DumpStudy(const string& thePath, const string& theBaseName, bool isPublished)
-{
- //SRN: Pure CORBA DumpStudy as it does more cleaning than the local one
- if(CORBA::is_nil(_corba_impl)) GetStudy(); //If CORBA implementation is null then retrieve it
- bool ret = _corba_impl->DumpStudy(thePath.c_str(), theBaseName.c_str(), isPublished);
- return ret;
-}
-
-void SALOMEDS_Study::SetStudyLock(const string& theLockerID)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->SetStudyLock(theLockerID.c_str());
- }
- else _corba_impl->SetStudyLock((char*)theLockerID.c_str());
-}
-
-bool SALOMEDS_Study::IsStudyLocked()
-{
- bool isLocked;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- isLocked = _local_impl->IsStudyLocked();
- }
- else isLocked = _corba_impl->IsStudyLocked();
- return isLocked;
-}
-
-void SALOMEDS_Study::UnLockStudy(const string& theLockerID)
-{
- if(_isLocal) _local_impl->UnLockStudy(theLockerID.c_str());
- else _corba_impl->UnLockStudy((char*)theLockerID.c_str());
-}
-
-vector<string> SALOMEDS_Study::GetLockerID()
-{
- std::vector<std::string> aVector;
- int aLength, i;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = _local_impl->GetLockerID();
- }
- else {
- SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetLockerID();
- aLength = aSeq->length();
- for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
- }
- return aVector;
-}
-
-
-void SALOMEDS_Study::SetReal(const string& theVarName, const double theValue)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->SetVariable(theVarName,
- theValue,
- SALOMEDSImpl_GenericVariable::REAL_VAR);
- }
- else
- _corba_impl->SetReal((char*)theVarName.c_str(),theValue);
-}
-
-void SALOMEDS_Study::SetInteger(const string& theVarName, const int theValue)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->SetVariable(theVarName,
- theValue,
- SALOMEDSImpl_GenericVariable::INTEGER_VAR);
- }
- else
- _corba_impl->SetInteger((char*)theVarName.c_str(),theValue);
-}
-
-void SALOMEDS_Study::SetBoolean(const string& theVarName, const bool theValue)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->SetVariable(theVarName,
- theValue,
- SALOMEDSImpl_GenericVariable::BOOLEAN_VAR);
- }
- else
- _corba_impl->SetBoolean((char*)theVarName.c_str(),theValue);
-}
-
-double SALOMEDS_Study::GetReal(const string& theVarName)
-{
- double aResult;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aResult = _local_impl->GetVariableValue(theVarName);
- }
- else
- aResult = _corba_impl->GetReal((char*)theVarName.c_str());
- return aResult;
-}
-
-int SALOMEDS_Study::GetInteger(const string& theVarName)
-{
- int aResult;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aResult = (int) _local_impl->GetVariableValue(theVarName);
- }
- else
- aResult = _corba_impl->GetInteger((char*)theVarName.c_str());
- return aResult;
-}
-
-bool SALOMEDS_Study::GetBoolean(const string& theVarName)
-{
- bool aResult;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aResult = (bool) _local_impl->GetVariableValue(theVarName);
- }
- else
- aResult = _corba_impl->GetBoolean((char*)theVarName.c_str());
- return aResult;
-}
-
-bool SALOMEDS_Study::IsReal(const string& theVarName)
-{
- bool aResult;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aResult = _local_impl->IsTypeOf(theVarName,
- SALOMEDSImpl_GenericVariable::REAL_VAR);
- }
- else
- aResult = _corba_impl->IsReal((char*)theVarName.c_str());
- return aResult;
-}
-
-bool SALOMEDS_Study::IsInteger(const string& theVarName)
-{
- bool aResult;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aResult = _local_impl->IsTypeOf(theVarName,
- SALOMEDSImpl_GenericVariable::INTEGER_VAR);
- }
- else
- aResult = _corba_impl->IsInteger((char*)theVarName.c_str());
- return aResult;
-}
-
-bool SALOMEDS_Study::IsBoolean(const string& theVarName)
-{
- bool aResult;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aResult = _local_impl->IsTypeOf(theVarName,
- SALOMEDSImpl_GenericVariable::BOOLEAN_VAR);
- }
- else
- aResult = _corba_impl->IsBoolean((char*)theVarName.c_str());
- return aResult;
-}
-
-bool SALOMEDS_Study::IsVariable(const string& theVarName)
-{
- bool aResult;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aResult = _local_impl->IsVariable(theVarName);
- }
- else
- aResult = _corba_impl->IsVariable((char*)theVarName.c_str());
- return aResult;
-}
-
-vector<string> SALOMEDS_Study::GetVariableNames()
-{
- vector<string> aVector;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aVector = _local_impl->GetVariableNames();
- }
- else {
- SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetVariableNames();
- int aLength = aSeq->length();
- for (int i = 0; i < aLength; i++)
- aVector.push_back( string(aSeq[i].in()) );
- }
- return aVector;
-}
-
-bool SALOMEDS_Study::RemoveVariable(const string& theVarName)
-{
- bool aResult;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aResult = _local_impl->RemoveVariable(theVarName);
- }
- else
- aResult = _corba_impl->RemoveVariable((char*)theVarName.c_str());
- return aResult;
-}
-
-bool SALOMEDS_Study::RenameVariable(const string& theVarName, const string& theNewVarName)
-{
- bool aResult;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aResult = _local_impl->RenameVariable(theVarName, theNewVarName);
- }
- else
- aResult = _corba_impl->RenameVariable((char*)theVarName.c_str(), (char*)theNewVarName.c_str());
- return aResult;
-}
-
-bool SALOMEDS_Study::IsVariableUsed(const string& theVarName)
-{
- bool aResult;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aResult = _local_impl->IsVariableUsed(theVarName);
- }
- else
- aResult = _corba_impl->IsVariableUsed((char*)theVarName.c_str());
- return aResult;
-}
-
-vector< vector<string> > SALOMEDS_Study::ParseVariables(const string& theVars)
-{
- vector< vector<string> > aResult;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aResult = _local_impl->ParseVariables(theVars);
- }
- else {
- SALOMEDS::ListOfListOfStrings_var aSeq = _corba_impl->ParseVariables(theVars.c_str());
- for (int i = 0, n = aSeq->length(); i < n; i++) {
- vector<string> aVector;
- SALOMEDS::ListOfStrings aSection = aSeq[i];
- for (int j = 0, m = aSection.length(); j < m; j++) {
- aVector.push_back( string(aSection[j].in()) );
- }
- aResult.push_back( aVector );
- }
- }
- return aResult;
-}
-
-std::string SALOMEDS_Study::ConvertObjectToIOR(CORBA::Object_ptr theObject)
-{
- return _orb->object_to_string(theObject);
-}
-
-CORBA::Object_ptr SALOMEDS_Study::ConvertIORToObject(const std::string& theIOR)
-{
- return _orb->string_to_object(theIOR.c_str());
-}
-
-void SALOMEDS_Study::init_orb()
-{
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- _orb = init(0 , 0 ) ;
-}
-
-SALOMEDS::Study_ptr SALOMEDS_Study::GetStudy()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- if (!CORBA::is_nil(_corba_impl)) return SALOMEDS::Study::_duplicate(_corba_impl);
- std::string anIOR = _local_impl->GetTransientReference();
- SALOMEDS::Study_var aStudy;
- if (!_local_impl->IsError() && anIOR != "") {
- aStudy = SALOMEDS::Study::_narrow(_orb->string_to_object(anIOR.c_str()));
- }
- else {
- SALOMEDS_Study_i *aStudy_servant = new SALOMEDS_Study_i(_local_impl, _orb);
- aStudy = aStudy_servant->_this();
- _local_impl->SetTransientReference(_orb->object_to_string(aStudy));
- }
- _corba_impl = SALOMEDS::Study::_duplicate(aStudy);
- return aStudy._retn();
- }
- else {
- return SALOMEDS::Study::_duplicate(_corba_impl);
- }
-
- return SALOMEDS::Study::_nil();
-}
-
-
-_PTR(AttributeParameter) SALOMEDS_Study::GetCommonParameters(const string& theID, int theSavePoint)
-{
- SALOMEDSClient_AttributeParameter* AP = NULL;
- if(theSavePoint >= 0) {
- if (_isLocal) {
- SALOMEDS::Locker lock;
- AP = new SALOMEDS_AttributeParameter(_local_impl->GetCommonParameters(theID.c_str(), theSavePoint));
- }
- else {
- AP = new SALOMEDS_AttributeParameter(_corba_impl->GetCommonParameters(theID.c_str(), theSavePoint));
- }
- }
- return _PTR(AttributeParameter)(AP);
-}
-
-_PTR(AttributeParameter) SALOMEDS_Study::GetModuleParameters(const string& theID,
- const string& theModuleName, int theSavePoint)
-{
- SALOMEDSClient_AttributeParameter* AP = NULL;
- if(theSavePoint > 0) {
- if (_isLocal) {
- SALOMEDS::Locker lock;
- AP = new SALOMEDS_AttributeParameter(_local_impl->GetModuleParameters(theID.c_str(), theModuleName.c_str(), theSavePoint));
- }
- else {
- AP = new SALOMEDS_AttributeParameter(_corba_impl->GetModuleParameters(theID.c_str(), theModuleName.c_str(), theSavePoint));
- }
- }
- return _PTR(AttributeParameter)(AP);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_Study.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_STUDY_H__
-#define __SALOMEDS_STUDY_H__
-
-#include <vector>
-#include <string>
-
-#include "SALOMEDSClient.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-class Standard_EXPORT SALOMEDS_Study: public SALOMEDSClient_Study
-{
-
-private:
- bool _isLocal;
- SALOMEDSImpl_Study* _local_impl;
- SALOMEDS::Study_var _corba_impl;
- CORBA::ORB_var _orb;
-
-public:
-
- SALOMEDS_Study(SALOMEDSImpl_Study* theStudy);
- SALOMEDS_Study(SALOMEDS::Study_ptr theStudy);
- ~SALOMEDS_Study();
-
- virtual std::string GetPersistentReference();
- virtual std::string GetTransientReference();
- virtual bool IsEmpty();
- virtual _PTR(SComponent) FindComponent (const std::string& aComponentName);
- virtual _PTR(SComponent) FindComponentID(const std::string& aComponentID);
- virtual _PTR(SObject) FindObject(const std::string& anObjectName);
- virtual std::vector<_PTR(SObject)> FindObjectByName( const std::string& anObjectName, const std::string& aComponentName ) ;
- virtual _PTR(SObject) FindObjectID(const std::string& anObjectID);
- virtual _PTR(SObject) CreateObjectID(const std::string& anObjectID);
- virtual _PTR(SObject) FindObjectIOR(const std::string& anObjectIOR);
- virtual _PTR(SObject) FindObjectByPath(const std::string& thePath);
- virtual std::string GetObjectPath(const _PTR(SObject)& theSO);
- virtual void SetContext(const std::string& thePath);
- virtual std::string GetContext();
- virtual std::vector<std::string> GetObjectNames(const std::string& theContext);
- virtual std::vector<std::string> GetDirectoryNames(const std::string& theContext);
- virtual std::vector<std::string> GetFileNames(const std::string& theContext);
- virtual std::vector<std::string> GetComponentNames(const std::string& theContext);
- virtual _PTR(ChildIterator) NewChildIterator(const _PTR(SObject)& theSO);
- virtual _PTR(SComponentIterator) NewComponentIterator();
- virtual _PTR(StudyBuilder) NewBuilder();
- virtual std::string Name();
- virtual void Name(const std::string& name);
- virtual bool IsSaved();
- virtual void IsSaved(bool save);
- virtual bool IsModified();
- virtual void Modified();
- virtual std::string URL();
- virtual void URL(const std::string& url);
- virtual int StudyId();
- virtual void StudyId(int id);
- virtual std::vector<_PTR(SObject)> FindDependances(const _PTR(SObject)& theSO);
- virtual _PTR(AttributeStudyProperties) GetProperties();
- virtual std::string GetLastModificationDate();
- virtual std::vector<std::string> GetModificationsDate();
- virtual _PTR(UseCaseBuilder) GetUseCaseBuilder();
- virtual void Close();
- virtual void EnableUseCaseAutoFilling(bool isEnabled);
- virtual bool DumpStudy(const std::string& thePath,const std::string& theBaseName,bool isPublished);
- virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint);
- virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID,
- const std::string& theModuleName, int theSavePoint);
- virtual void SetStudyLock(const std::string& theLockerID);
- virtual bool IsStudyLocked();
- virtual void UnLockStudy(const std::string& theLockerID);
- virtual std::vector<std::string> GetLockerID();
-
- virtual void SetReal(const std::string& theVarName, const double theValue);
- virtual void SetInteger(const std::string& theVarName, const int theValue);
- virtual void SetBoolean(const std::string& theVarName, const bool theValue);
-
- virtual double GetReal(const std::string& theVarName);
- virtual int GetInteger(const std::string& theVarName);
- virtual bool GetBoolean(const std::string& theVarName);
-
- virtual bool IsReal(const std::string& theVarName);
- virtual bool IsInteger(const std::string& theVarName);
- virtual bool IsBoolean(const std::string& theVarName);
-
- virtual bool IsVariable(const std::string& theVarName);
- virtual std::vector<std::string> GetVariableNames();
-
- virtual bool RemoveVariable(const std::string& theVarName);
- virtual bool RenameVariable(const std::string& theVarName, const std::string& theNewVarName);
- virtual bool IsVariableUsed(const std::string& theVarName);
- virtual std::vector< std::vector<std::string> > ParseVariables(const std::string& theVars);
-
- std::string ConvertObjectToIOR(CORBA::Object_ptr theObject);
- CORBA::Object_ptr ConvertIORToObject(const std::string& theIOR);
-
- SALOMEDS::Study_ptr GetStudy();
-
-private:
- void init_orb();
-
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_StudyBuilder.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "utilities.h"
-
-#include "SALOMEDS_StudyBuilder.hxx"
-
-#include "SALOMEDS.hxx"
-#include "SALOMEDS_SObject.hxx"
-#include "SALOMEDS_SComponent.hxx"
-#include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDS_StudyManager.hxx"
-#include "SALOMEDS_StudyBuilder_i.hxx"
-
-#include "SALOMEDS_Driver_i.hxx"
-
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-#include <string>
-#include <stdexcept>
-
-#include "DF_Attribute.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
-
-using namespace std;
-
-SALOMEDS_StudyBuilder::SALOMEDS_StudyBuilder(SALOMEDSImpl_StudyBuilder* theBuilder)
-{
- _isLocal = true;
- _local_impl = theBuilder;
- _corba_impl = SALOMEDS::StudyBuilder::_nil();
-
- init_orb();
-}
-
-SALOMEDS_StudyBuilder::SALOMEDS_StudyBuilder(SALOMEDS::StudyBuilder_ptr theBuilder)
-{
- _isLocal = false;
- _local_impl = NULL;
- _corba_impl = SALOMEDS::StudyBuilder::_duplicate(theBuilder);
-
- init_orb();
-}
-
-SALOMEDS_StudyBuilder::~SALOMEDS_StudyBuilder()
-{
-}
-
-_PTR(SComponent) SALOMEDS_StudyBuilder::NewComponent(const std::string& ComponentDataType)
-{
- SALOMEDSClient_SComponent* aSCO = NULL;
-
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SComponent aSCO_impl =_local_impl->NewComponent(ComponentDataType);
- if(!aSCO_impl) return _PTR(SComponent)(aSCO);
- aSCO = new SALOMEDS_SComponent(aSCO_impl);
- }
- else {
- SALOMEDS::SComponent_var aSCO_impl = _corba_impl->NewComponent((char*)ComponentDataType.c_str());
- if(CORBA::is_nil(aSCO_impl)) return _PTR(SComponent)(aSCO);
- aSCO = new SALOMEDS_SComponent(aSCO_impl);
- }
-
- return _PTR(SComponent)(aSCO);
-}
-
-void SALOMEDS_StudyBuilder::DefineComponentInstance (const _PTR(SComponent)& theSCO,
- const std::string& ComponentIOR)
-{
- if(!theSCO) return;
-
- SALOMEDS_SComponent* aSCO = dynamic_cast<SALOMEDS_SComponent*>(theSCO.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- _local_impl->DefineComponentInstance(*(dynamic_cast<SALOMEDSImpl_SComponent*>(aSCO->GetLocalImpl())),
- ComponentIOR);
- }
- else {
- CORBA::Object_var obj = _orb->string_to_object(ComponentIOR.c_str());
- _corba_impl->DefineComponentInstance(SALOMEDS::SComponent::_narrow(aSCO->GetCORBAImpl()), obj);
- }
-}
-
-void SALOMEDS_StudyBuilder::RemoveComponent(const _PTR(SComponent)& theSCO)
-{
- if(!theSCO) return;
- SALOMEDS_SComponent* aSCO = dynamic_cast<SALOMEDS_SComponent*>(theSCO.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- _local_impl->RemoveComponent(*(dynamic_cast<SALOMEDSImpl_SComponent*>(aSCO->GetLocalImpl())));
- }
- else _corba_impl->RemoveComponent(SALOMEDS::SComponent::_narrow(aSCO->GetCORBAImpl()));
-}
-
-_PTR(SObject) SALOMEDS_StudyBuilder::NewObject(const _PTR(SObject)& theFatherObject)
-{
- CheckLocked();
-
- SALOMEDSClient_SObject* aSO = NULL;
- SALOMEDS_SObject* father = dynamic_cast< SALOMEDS_SObject*>(theFatherObject.get());
- if (father == NULL) return _PTR(SObject)(aSO);
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO_impl = _local_impl->NewObject(*(father->GetLocalImpl()));
- if(!aSO_impl) return _PTR(SObject)(aSO);
- aSO = new SALOMEDS_SObject(aSO_impl);
- }
- else {
- SALOMEDS::SObject_var aSO_impl = _corba_impl->NewObject(father->GetCORBAImpl());
- if(CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO);
- aSO = new SALOMEDS_SObject(aSO_impl);
- }
-
- return _PTR(SObject)(aSO);
-}
-
-_PTR(SObject) SALOMEDS_StudyBuilder::NewObjectToTag(const _PTR(SObject)& theFatherObject, int theTag)
-{
- CheckLocked();
-
- SALOMEDSClient_SObject* aSO = NULL;
- SALOMEDS_SObject* father = dynamic_cast< SALOMEDS_SObject*>(theFatherObject.get());
- if (father == NULL) return _PTR(SObject)(aSO);
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO_impl = _local_impl->NewObjectToTag(*(father->GetLocalImpl()), theTag);
- if(aSO_impl.IsNull()) return _PTR(SObject)(aSO);
- aSO = new SALOMEDS_SObject(aSO_impl);
- }
- else {
- SALOMEDS::SObject_var aSO_impl = _corba_impl->NewObjectToTag(father->GetCORBAImpl(), theTag);
- if(CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO);
- aSO = new SALOMEDS_SObject(aSO_impl);
- }
-
- return _PTR(SObject)(aSO);
-}
-
-void SALOMEDS_StudyBuilder::AddDirectory(const std::string& thePath)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- _local_impl->AddDirectory((char*)thePath.c_str());
- if (_local_impl->IsError()) {
- std::string anErrorCode = _local_impl->GetErrorCode();
- if (anErrorCode == "StudyNameAlreadyUsed") throw SALOMEDS::Study::StudyNameAlreadyUsed();
- if (anErrorCode == "StudyInvalidDirectory") throw SALOMEDS::Study::StudyInvalidDirectory();
- if (anErrorCode == "StudyInvalidComponent") throw SALOMEDS::Study::StudyInvalidComponent();
- }
- }
- else _corba_impl->AddDirectory((char*)thePath.c_str());
-}
-
-void SALOMEDS_StudyBuilder::LoadWith(const _PTR(SComponent)& theSCO, const std::string& theIOR)
-{
- if(!theSCO) return;
-
- SALOMEDS_SComponent* aSCO = dynamic_cast<SALOMEDS_SComponent*>(theSCO.get());
- CORBA::Object_var obj = _orb->string_to_object(theIOR.c_str());
- SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(obj);
-
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDS_Driver_i* drv = new SALOMEDS_Driver_i(aDriver, _orb);
- SALOMEDSImpl_SComponent aSCO_impl = *(dynamic_cast<SALOMEDSImpl_SComponent*>(aSCO->GetLocalImpl()));
- bool isDone = _local_impl->LoadWith(aSCO_impl, drv);
- delete drv;
- if(!isDone && _local_impl->IsError())
- THROW_SALOME_CORBA_EXCEPTION(_local_impl->GetErrorCode().c_str(),SALOME::BAD_PARAM);
- }
- else {
- _corba_impl->LoadWith(SALOMEDS::SComponent::_narrow(aSCO->GetCORBAImpl()), aDriver);
- }
-}
-
-void SALOMEDS_StudyBuilder::Load(const _PTR(SObject)& theSCO)
-{
- SALOMEDS_SComponent* aSCO = dynamic_cast<SALOMEDS_SComponent*>(theSCO.get());
- if (_isLocal) _local_impl->Load(*(dynamic_cast<SALOMEDSImpl_SComponent*>(aSCO->GetLocalImpl())));
- else _corba_impl->Load(SALOMEDS::SComponent::_narrow(aSCO->GetCORBAImpl()));
-}
-
-void SALOMEDS_StudyBuilder::RemoveObject(const _PTR(SObject)& theSO)
-{
- if(!theSO) return;
-
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- _local_impl->RemoveObject(*(aSO->GetLocalImpl()));
- }
- else _corba_impl->RemoveObject(aSO->GetCORBAImpl());
-}
-
-void SALOMEDS_StudyBuilder::RemoveObjectWithChildren(const _PTR(SObject)& theSO)
-{
- if(!theSO) return;
-
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- _local_impl->RemoveObjectWithChildren(*(aSO->GetLocalImpl()));
- }
- else _corba_impl->RemoveObjectWithChildren(aSO->GetCORBAImpl());
-}
-
-_PTR(GenericAttribute) SALOMEDS_StudyBuilder::FindOrCreateAttribute(const _PTR(SObject)& theSO,
- const std::string& aTypeOfAttribute)
-{
- SALOMEDSClient_GenericAttribute* anAttr = NULL;
- if(!theSO) return _PTR(GenericAttribute)(anAttr);
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_GenericAttribute* aGA;
- try {
- aGA = dynamic_cast<SALOMEDSImpl_GenericAttribute*>
- (_local_impl->FindOrCreateAttribute(*(aSO->GetLocalImpl()), aTypeOfAttribute));
- }
- catch (...) {
- throw SALOMEDS::StudyBuilder::LockProtection();
- }
- anAttr = SALOMEDS_GenericAttribute::CreateAttribute(aGA);
- }
- else {
- SALOMEDS::GenericAttribute_var aGA =
- _corba_impl->FindOrCreateAttribute(aSO->GetCORBAImpl(), (char*)aTypeOfAttribute.c_str());
- anAttr = SALOMEDS_GenericAttribute::CreateAttribute(aGA);
- }
-
- return _PTR(GenericAttribute)(anAttr);
-}
-
-bool SALOMEDS_StudyBuilder::FindAttribute(const _PTR(SObject)& theSO,
- _PTR(GenericAttribute)& anAttribute,
- const std::string& aTypeOfAttribute)
-{
- bool ret;
-
- if(!theSO) return false;
-
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- DF_Attribute* anAttr = NULL;
- ret = _local_impl->FindAttribute(*(aSO->GetLocalImpl()), anAttr, aTypeOfAttribute);
- if(ret) {
- SALOMEDSImpl_GenericAttribute* aGA = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(anAttr);
- anAttribute = _PTR(GenericAttribute)(SALOMEDS_GenericAttribute::CreateAttribute(aGA));
- }
- }
- else {
- SALOMEDS::GenericAttribute_var aGA;
- ret = _corba_impl->FindAttribute(aSO->GetCORBAImpl(), aGA.out(), (char*)aTypeOfAttribute.c_str());
- if(ret) anAttribute = _PTR(GenericAttribute)(SALOMEDS_GenericAttribute::CreateAttribute(aGA));
- }
-
- return ret;
-}
-
-void SALOMEDS_StudyBuilder::RemoveAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute)
-{
- if(!theSO) return;
-
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- _local_impl->RemoveAttribute(*(aSO->GetLocalImpl()), (char*)aTypeOfAttribute.c_str());
- }
- else _corba_impl->RemoveAttribute(aSO->GetCORBAImpl(), (char*)aTypeOfAttribute.c_str());
-}
-
-void SALOMEDS_StudyBuilder::Addreference(const _PTR(SObject)& me, const _PTR(SObject)& thereferencedObject)
-{
- if(!me || !thereferencedObject) {
- throw DFexception("Invalid arguments");
- }
-
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(me.get());
- SALOMEDS_SObject* aRefSO = dynamic_cast<SALOMEDS_SObject*>(thereferencedObject.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- _local_impl->Addreference(*(aSO->GetLocalImpl()), *(aRefSO->GetLocalImpl()));
- }
- else _corba_impl->Addreference(aSO->GetCORBAImpl(), aRefSO->GetCORBAImpl());
-}
-
-void SALOMEDS_StudyBuilder::RemoveReference(const _PTR(SObject)& me)
-{
- if(!me) return;
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(me.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- _local_impl->RemoveReference(*(aSO->GetLocalImpl()));
- }
- else _corba_impl->RemoveReference(aSO->GetCORBAImpl());
-}
-
-void SALOMEDS_StudyBuilder::SetGUID(const _PTR(SObject)& theSO, const std::string& theGUID)
-{
- if(!theSO) return;
-
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- _local_impl->SetGUID(*(aSO->GetLocalImpl()), theGUID);
- }
- else _corba_impl->SetGUID(aSO->GetCORBAImpl(), (char*)theGUID.c_str());
-}
-
-bool SALOMEDS_StudyBuilder::IsGUID(const _PTR(SObject)& theSO, const std::string& theGUID)
-{
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- ret = _local_impl->IsGUID(*(aSO->GetLocalImpl()), (char*)theGUID.c_str());
- }
- else ret = _corba_impl->IsGUID(aSO->GetCORBAImpl(), (char*)theGUID.c_str());
-
- return ret;
-}
-
-void SALOMEDS_StudyBuilder::NewCommand()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->NewCommand();
- }
- else _corba_impl->NewCommand();
-}
-
-void SALOMEDS_StudyBuilder::CommitCommand()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- try {
- _local_impl->CommitCommand();
- }
- catch(...) {
- throw SALOMEDS::StudyBuilder::LockProtection();
- }
- }
- else _corba_impl->CommitCommand();
-}
-
-bool SALOMEDS_StudyBuilder::HasOpenCommand()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->HasOpenCommand();
- }
- else ret = _corba_impl->HasOpenCommand();
- return ret;
-}
-
-void SALOMEDS_StudyBuilder::AbortCommand()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- _local_impl->AbortCommand();
- }
- else _corba_impl->AbortCommand();
-}
-
-void SALOMEDS_StudyBuilder::Undo()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- try {
- _local_impl->Undo();
- }
- catch(...) {
- throw SALOMEDS::StudyBuilder::LockProtection();
- }
- }
- else _corba_impl->Undo();
-}
-
-void SALOMEDS_StudyBuilder::Redo()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- try {
- _local_impl->Redo();
- }
- catch(...) {
- throw SALOMEDS::StudyBuilder::LockProtection();
- }
- }
- else _corba_impl->Redo();
-}
-
-bool SALOMEDS_StudyBuilder::GetAvailableUndos()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->GetAvailableUndos();
- }
- else ret = _corba_impl->GetAvailableUndos();
- return ret;
-}
-
-bool SALOMEDS_StudyBuilder::GetAvailableRedos()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->GetAvailableRedos();
- }
- else ret = _corba_impl->GetAvailableRedos();
- return ret;
-}
-
-int SALOMEDS_StudyBuilder::UndoLimit()
-{
- int aLimit;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aLimit = _local_impl->UndoLimit();
- }
- else aLimit = _corba_impl->UndoLimit();
- return aLimit;
-}
-
-void SALOMEDS_StudyBuilder::UndoLimit(int theLimit)
-{
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- _local_impl->UndoLimit(theLimit);
- }
- else _corba_impl->UndoLimit(theLimit);
-}
-
-void SALOMEDS_StudyBuilder::CheckLocked()
-{
- //There is only local part as CORBA part throws the correct exeception
- if (_isLocal) {
- SALOMEDS::Locker lock;
- try {
- _local_impl->CheckLocked();
- }
- catch(...) {
- throw SALOMEDS::StudyBuilder::LockProtection();
- }
- }
-}
-
-void SALOMEDS_StudyBuilder::SetName(const _PTR(SObject)& theSO, const std::string& theValue)
-{
- if(!theSO) return;
-
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- _local_impl->SetName(*(aSO->GetLocalImpl()), theValue);
- }
- else _corba_impl->SetName(aSO->GetCORBAImpl(), (char*)theValue.c_str());
-}
-
-void SALOMEDS_StudyBuilder::SetComment(const _PTR(SObject)& theSO, const std::string& theValue)
-{
- if(!theSO) return;
-
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- _local_impl->SetComment(*(aSO->GetLocalImpl()), theValue);
- }
- else _corba_impl->SetComment(aSO->GetCORBAImpl(), (char*)theValue.c_str());
-}
-
-void SALOMEDS_StudyBuilder::SetIOR(const _PTR(SObject)& theSO, const std::string& theValue)
-{
- if(!theSO) return;
-
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- if (_isLocal) {
- CheckLocked();
- SALOMEDS::Locker lock;
-
- _local_impl->SetIOR(*(aSO->GetLocalImpl()), theValue);
- }
- else _corba_impl->SetIOR(aSO->GetCORBAImpl(), (char*)theValue.c_str());
-}
-
-SALOMEDS::StudyBuilder_ptr SALOMEDS_StudyBuilder::GetBuilder()
-{
- if(_isLocal) {
- if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::StudyBuilder::_duplicate(_corba_impl);
- SALOMEDS_StudyBuilder_i* servant = new SALOMEDS_StudyBuilder_i(_local_impl, _orb);
- SALOMEDS::StudyBuilder_var aBuilder = servant->StudyBuilder::_this();
- _corba_impl = SALOMEDS::StudyBuilder::_duplicate(aBuilder);
- return aBuilder._retn();
- }
- else {
- return SALOMEDS::StudyBuilder::_duplicate(_corba_impl);
- }
- return SALOMEDS::StudyBuilder::_nil();
-}
-
-void SALOMEDS_StudyBuilder::init_orb()
-{
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- _orb = init(0 , 0 );
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_StudyBuilder.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_STUDYBUILDER_H__
-#define __SALOMEDS_STUDYBUILDER_H__
-
-#include "SALOMEDS_Defines.hxx"
-
-#include "SALOMEDSClient.hxx"
-#include "SALOMEDSImpl_StudyBuilder.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-class SALOMEDS_EXPORT SALOMEDS_StudyBuilder: public SALOMEDSClient_StudyBuilder
-{
-private:
- bool _isLocal;
- SALOMEDSImpl_StudyBuilder* _local_impl;
- SALOMEDS::StudyBuilder_var _corba_impl;
- CORBA::ORB_var _orb;
-
-public:
-
- SALOMEDS_StudyBuilder(SALOMEDSImpl_StudyBuilder* theBuilder);
- SALOMEDS_StudyBuilder(SALOMEDS::StudyBuilder_ptr theBuilder);
- ~SALOMEDS_StudyBuilder();
-
- virtual _PTR(SComponent) NewComponent(const std::string& ComponentDataType);
- virtual void DefineComponentInstance (const _PTR(SComponent)&, const std::string& ComponentIOR);
- virtual void RemoveComponent(const _PTR(SComponent)& theSCO);
- virtual _PTR(SObject) NewObject(const _PTR(SObject)& theFatherObject);
- virtual _PTR(SObject) NewObjectToTag(const _PTR(SObject)& theFatherObject, int theTag);
- virtual void AddDirectory(const std::string& thePath);
- virtual void LoadWith(const _PTR(SComponent)& theSCO, const std::string& theIOR);
- virtual void Load(const _PTR(SObject)& theSCO);
- virtual void RemoveObject(const _PTR(SObject)& theSO);
- virtual void RemoveObjectWithChildren(const _PTR(SObject)& theSO);
- virtual _PTR(GenericAttribute) FindOrCreateAttribute(const _PTR(SObject)& theSO,
- const std::string& aTypeOfAttribute);
- virtual bool FindAttribute(const _PTR(SObject)& theSO,
- _PTR(GenericAttribute)& theAttribute,
- const std::string& aTypeOfAttribute);
- virtual void RemoveAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute);
- virtual void Addreference(const _PTR(SObject)& me, const _PTR(SObject)& thereferencedObject);
- virtual void RemoveReference(const _PTR(SObject)& me);
- virtual void SetGUID(const _PTR(SObject)& theSO, const std::string& theGUID);
- virtual bool IsGUID(const _PTR(SObject)& theSO, const std::string& theGUID);
- virtual void NewCommand();
- virtual void CommitCommand();
- virtual bool HasOpenCommand();
- virtual void AbortCommand();
- virtual void Undo();
- virtual void Redo();
- virtual bool GetAvailableUndos();
- virtual bool GetAvailableRedos();
- virtual int UndoLimit();
- virtual void UndoLimit(int theLimit);
- virtual void SetName(const _PTR(SObject)& theSO, const std::string& theValue);
- virtual void SetComment(const _PTR(SObject)& theSO, const std::string& theValue);
- virtual void SetIOR(const _PTR(SObject)& theSO, const std::string& theValue);
-
- SALOMEDS::StudyBuilder_ptr GetBuilder();
-
-private:
- void CheckLocked();
- void init_orb();
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_StudyBuilder_i.cxx
-// Author : Seregy RUIN
-// Module : SALOME
-//
-#include "utilities.h"
-#include "SALOMEDS_StudyBuilder_i.hxx"
-#include "SALOMEDS_Study_i.hxx"
-#include "SALOMEDS_SObject_i.hxx"
-#include "SALOMEDS_SComponent_i.hxx"
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDS_Driver_i.hxx"
-#include "SALOMEDS.hxx"
-
-#include "SALOMEDSImpl_Study.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "Utils_ExceptHandlers.hxx"
-
-#include <DF_Attribute.hxx>
-#include <DF_Document.hxx>
-#include <stdlib.h>
-
-using namespace std;
-
-UNEXPECT_CATCH(SBSalomeException, SALOME::SALOME_Exception);
-UNEXPECT_CATCH(SBLockProtection, SALOMEDS::StudyBuilder::LockProtection);
-
-//============================================================================
-/*! Function : constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDS_StudyBuilder_i::SALOMEDS_StudyBuilder_i(SALOMEDSImpl_StudyBuilder* theImpl,
- CORBA::ORB_ptr orb)
-{
- _orb = CORBA::ORB::_duplicate(orb);
- _impl = theImpl;
-}
-
-//============================================================================
-/*! Function : destructor
- * Purpose :
- */
-//============================================================================
-SALOMEDS_StudyBuilder_i::~SALOMEDS_StudyBuilder_i()
-{}
-
-//============================================================================
-/*! Function : NewComponent
- * Purpose : Create a new component (Scomponent)
- */
-//============================================================================
-SALOMEDS::SComponent_ptr SALOMEDS_StudyBuilder_i::NewComponent(const char* DataType)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- //char* aDataType = CORBA::string_dup(DataType);
- SALOMEDSImpl_SComponent aSCO = _impl->NewComponent(string(DataType));
- //CORBA::free_string(aDataType);
- if(aSCO.IsNull()) return SALOMEDS::SComponent::_nil();
-
- SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (aSCO,_orb);
- return sco._retn();
-}
-
-//============================================================================
-/*! Function : DefineComponentInstance
- * Purpose : Add IOR attribute of a Scomponent
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::DefineComponentInstance(SALOMEDS::SComponent_ptr aComponent,
- CORBA::Object_ptr IOR)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_SComponent aSCO = _impl->GetOwner()->GetSComponent(aComponent->GetID());
-
- CORBA::String_var iorstr = _orb->object_to_string(IOR);
- _impl->DefineComponentInstance(aSCO, (char*)iorstr.in());
-}
-
-//============================================================================
-/*! Function : RemoveComponent
- * Purpose : Delete a Scomponent
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::RemoveComponent(SALOMEDS::SComponent_ptr aComponent)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- ASSERT(!CORBA::is_nil(aComponent));
- SALOMEDSImpl_SComponent aSCO = _impl->GetOwner()->GetSComponent(aComponent->GetID());
- _impl->RemoveComponent(aSCO);
-}
-
-//============================================================================
-/*! Function : NewObject
- * Purpose : Create a new SObject
- */
-//============================================================================
-SALOMEDS::SObject_ptr SALOMEDS_StudyBuilder_i::NewObject(SALOMEDS::SObject_ptr theFatherObject)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
-
- SALOMEDSImpl_SObject aFO, aSO;
- aFO = _impl->GetOwner()->GetSObject(theFatherObject->GetID());
- aSO = _impl->NewObject(aFO);
- if(aSO.IsNull()) return SALOMEDS::SObject::_nil();
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO,_orb);
-
- return so._retn();
-}
-
-//============================================================================
-/*! Function : NewObjectToTag
- * Purpose :
- */
-//============================================================================
-SALOMEDS::SObject_ptr SALOMEDS_StudyBuilder_i::NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject,
- CORBA::Long atag)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_SObject aFO, aSO;
- aFO = _impl->GetOwner()->GetSObject(theFatherObject->GetID());
- aSO = _impl->NewObjectToTag(aFO, atag);
- if(aSO.IsNull()) return SALOMEDS::SObject::_nil();
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb);
- return so._retn();
-}
-
-//============================================================================
-/*! Function : RemoveObject
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::RemoveObject(SALOMEDS::SObject_ptr anObject)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anObject->GetID());
- _impl->RemoveObject(aSO);
-}
-
-//============================================================================
-/*! Function : RemoveObjectWithChildren
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::RemoveObjectWithChildren(SALOMEDS::SObject_ptr anObject)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anObject->GetID());
- _impl->RemoveObjectWithChildren(aSO);
-}
-
-//============================================================================
-/*! Function : LoadWith
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::LoadWith(SALOMEDS::SComponent_ptr anSCO,
- SALOMEDS::Driver_ptr aDriver) throw(SALOME::SALOME_Exception)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(SBSalomeException);
-
- SALOMEDSImpl_SComponent aSCO = _impl->GetOwner()->GetSComponent(anSCO->GetID());
- SALOMEDS_Driver_i* driver = new SALOMEDS_Driver_i(aDriver, _orb);
- bool isDone = _impl->LoadWith(aSCO, driver);
- delete driver;
-
- if(!isDone && _impl->IsError()) {
- THROW_SALOME_CORBA_EXCEPTION(_impl->GetErrorCode().c_str(),SALOME::BAD_PARAM);
- }
-}
-
-
-//============================================================================
-/*! Function : Load
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::Load(SALOMEDS::SObject_ptr sco)
-{
- MESSAGE ( "This function is not yet implemented");
-}
-
-//============================================================================
-/*! Function : FindOrCreateAttribute
- * Purpose : Add attribute of given type to SObject, if there is attribute of such type, returns
- * existing one
- */
-//============================================================================
-SALOMEDS::GenericAttribute_ptr SALOMEDS_StudyBuilder_i::FindOrCreateAttribute(SALOMEDS::SObject_ptr anObject,
- const char* aTypeOfAttribute)
-{
- SALOMEDS::Locker lock;
- CORBA::String_var anID = anObject->GetID();
- SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.inout());
- DF_Attribute* anAttr;
- try {
- anAttr = _impl->FindOrCreateAttribute(aSO, string(aTypeOfAttribute));
- }
- catch (...) {
- throw SALOMEDS::StudyBuilder::LockProtection();
- }
-
- SALOMEDS::GenericAttribute_var anAttribute;
-
- if(anAttr)
- anAttribute = SALOMEDS::GenericAttribute::_duplicate(SALOMEDS_GenericAttribute_i::CreateAttribute(anAttr, _orb));
-
- return anAttribute._retn();
-}
-
-//============================================================================
-/*! Function : FindAttribute
- * Purpose : Find attribute of given type assigned SObject, returns true if it is found
- */
-//============================================================================
-
-CORBA::Boolean SALOMEDS_StudyBuilder_i::FindAttribute(SALOMEDS::SObject_ptr anObject,
- SALOMEDS::GenericAttribute_out anAttribute,
- const char* aTypeOfAttribute)
-{
- SALOMEDS::Locker lock;
- ASSERT(!CORBA::is_nil(anObject));
- SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anObject->GetID());
- DF_Attribute* anAttr;
-
- if(!_impl->FindAttribute(aSO, anAttr, string(aTypeOfAttribute))) return false;
-
- anAttribute = SALOMEDS::GenericAttribute::_duplicate(SALOMEDS_GenericAttribute_i::CreateAttribute(anAttr, _orb));
- return true;
-}
-
-//============================================================================
-/*! Function : RemoveAttribute
- * Purpose : Remove attribute of given type assigned SObject
- */
-//============================================================================
-
-void SALOMEDS_StudyBuilder_i::RemoveAttribute(SALOMEDS::SObject_ptr anObject,
- const char* aTypeOfAttribute)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- ASSERT(!CORBA::is_nil(anObject));
- SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anObject->GetID());
- _impl->RemoveAttribute(aSO, string(aTypeOfAttribute));
-}
-
-//============================================================================
-/*! Function : Addreference
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::Addreference(SALOMEDS::SObject_ptr me,
- SALOMEDS::SObject_ptr theReferencedObject)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- ASSERT(!CORBA::is_nil(me));
- ASSERT(!CORBA::is_nil(theReferencedObject));
-
- SALOMEDSImpl_SObject aSO, aRefSO;
- aSO = _impl->GetOwner()->GetSObject(me->GetID());
- aRefSO = _impl->GetOwner()->GetSObject(theReferencedObject->GetID());
- _impl->Addreference(aSO, aRefSO);
-}
-
-//============================================================================
-/*! Function : RemoveReference
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::RemoveReference(SALOMEDS::SObject_ptr me)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- ASSERT(!CORBA::is_nil(me));
- SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(me->GetID());
- _impl->RemoveReference(aSO);
-}
-
-
-//============================================================================
-/*! Function : AddDirectory
- * Purpose : adds a new directory with a path = thePath
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::AddDirectory(const char* thePath)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- if(thePath == NULL || strlen(thePath) == 0) throw SALOMEDS::Study::StudyInvalidDirectory();
- if(!_impl->AddDirectory(string(thePath))) {
- string anErrorCode = _impl->GetErrorCode();
- if(anErrorCode == "StudyNameAlreadyUsed") throw SALOMEDS::Study::StudyNameAlreadyUsed();
- if(anErrorCode == "StudyInvalidDirectory") throw SALOMEDS::Study::StudyInvalidDirectory();
- if(anErrorCode == "StudyInvalidComponent") throw SALOMEDS::Study::StudyInvalidComponent();
- }
-}
-
-
-//============================================================================
-/*! Function : SetGUID
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::SetGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- ASSERT(!CORBA::is_nil(anObject));
- SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anObject->GetID());
- _impl->SetGUID(aSO, string(theGUID));
-}
-
-//============================================================================
-/*! Function : IsGUID
- * Purpose :
- */
-//============================================================================
-bool SALOMEDS_StudyBuilder_i::IsGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID)
-{
- SALOMEDS::Locker lock;
- ASSERT(!CORBA::is_nil(anObject));
- SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anObject->GetID());
- return _impl->IsGUID(aSO, string(theGUID));
-}
-
-
-//============================================================================
-/*! Function : NewCommand
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::NewCommand()
-{
- SALOMEDS::Locker lock;
- _impl->NewCommand();
-}
-
-//============================================================================
-/*! Function : CommitCommand
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::CommitCommand() throw (SALOMEDS::StudyBuilder::LockProtection)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(SBLockProtection);
- try {
- _impl->CommitCommand();
- }
- catch(...) {
- MESSAGE("Locked document modification !!!");
- throw SALOMEDS::StudyBuilder::LockProtection();
- }
-}
-
-//============================================================================
-/*! Function : HasOpenCommand
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_StudyBuilder_i::HasOpenCommand()
-{
- SALOMEDS::Locker lock;
- return _impl->HasOpenCommand();
-}
-
-//============================================================================
-/*! Function : AbortCommand
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::AbortCommand()
-{
- SALOMEDS::Locker lock;
- _impl->AbortCommand();
-}
-
-//============================================================================
-/*! Function : Undo
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::Undo() throw (SALOMEDS::StudyBuilder::LockProtection)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(SBLockProtection);
- try {
- _impl->Undo();
- }
- catch(...) {
- MESSAGE("Locked document modification !!!");
- throw SALOMEDS::StudyBuilder::LockProtection();
- }
-}
-
-//============================================================================
-/*! Function : Redo
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::Redo() throw (SALOMEDS::StudyBuilder::LockProtection)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(SBLockProtection);
- try {
- _impl->Redo();
- }
- catch(...) {
- MESSAGE("Locked document modification !!!");
- throw SALOMEDS::StudyBuilder::LockProtection();
- }
-}
-
-//============================================================================
-/*! Function : GetAvailableUndos
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_StudyBuilder_i::GetAvailableUndos()
-{
- SALOMEDS::Locker lock;
- return _impl->GetAvailableUndos();
-}
-
-//============================================================================
-/*! Function : GetAvailableRedos
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_StudyBuilder_i::GetAvailableRedos()
-{
- SALOMEDS::Locker lock;
- return _impl->GetAvailableRedos();
-}
-
-//============================================================================
-/*! Function : UndoLimit
- * Purpose :
- */
-//============================================================================
-CORBA::Long SALOMEDS_StudyBuilder_i::UndoLimit()
-{
- SALOMEDS::Locker lock;
- return _impl->UndoLimit();
-}
-
-//============================================================================
-/*! Function : UndoLimit
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::UndoLimit(CORBA::Long n)
-{
- SALOMEDS::Locker lock;
- CheckLocked();
- _impl->UndoLimit(n);
-}
-
-//============================================================================
-/*! Function : CheckLocked
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::CheckLocked() throw (SALOMEDS::StudyBuilder::LockProtection)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(SBLockProtection);
- try {
- _impl->CheckLocked();
- }
- catch(...) {
- throw SALOMEDS::StudyBuilder::LockProtection();
- }
-}
-
-//============================================================================
-/*! Function : SetName
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::SetName(SALOMEDS::SObject_ptr theSO, const char* theValue)
- throw(SALOMEDS::StudyBuilder::LockProtection)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(SBLockProtection);
- CheckLocked();
-
- SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(theSO->GetID());
- _impl->SetName(aSO, string(theValue));
-}
-
-//============================================================================
-/*! Function : SetComment
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::SetComment(SALOMEDS::SObject_ptr theSO, const char* theValue)
- throw(SALOMEDS::StudyBuilder::LockProtection)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(SBLockProtection);
- CheckLocked();
-
- SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(theSO->GetID());
- _impl->SetComment(aSO, string(theValue));
-}
-
-//============================================================================
-/*! Function : SetIOR
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_StudyBuilder_i::SetIOR(SALOMEDS::SObject_ptr theSO, const char* theValue)
- throw(SALOMEDS::StudyBuilder::LockProtection)
-{
- SALOMEDS::Locker lock;
- Unexpect aCatch(SBLockProtection);
- CheckLocked();
-
- SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(theSO->GetID());
- _impl->SetIOR(aSO, string(theValue));
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_StudyBuilder_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_STUDYBUILDER_I_H__
-#define __SALOMEDS_STUDYBUILDER_I_H__
-
-// std C++ headers
-#include <iostream>
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-#include "SALOMEDSImpl_StudyBuilder.hxx"
-
-class SALOMEDS_StudyBuilder_i: public POA_SALOMEDS::StudyBuilder
-{
-private:
- CORBA::ORB_ptr _orb;
- SALOMEDSImpl_StudyBuilder* _impl;
-public:
-
- SALOMEDS_StudyBuilder_i(SALOMEDSImpl_StudyBuilder*, CORBA::ORB_ptr);
-
- ~SALOMEDS_StudyBuilder_i();
-
- //! NewComponent
- /*!
- \param ComponentDataType
- \return <ReturnValue>
- */
- virtual SALOMEDS::SComponent_ptr NewComponent(const char* ComponentDataType);
-
- //! DefineComponentInstance
- /*!
- \param SComponent_ptr
- \param ComponentIOR
- */
- virtual void DefineComponentInstance (SALOMEDS::SComponent_ptr, CORBA::Object_ptr ComponentIOR);
-
- //!
- /*!
- <long-description>
-
- \param aComponent
- */
- virtual void RemoveComponent(SALOMEDS::SComponent_ptr aComponent);
-
- //!
- /*!
- <long-description>
-
- \param theFatherObject
- \return <ReturnValue>
- */
- virtual SALOMEDS::SObject_ptr NewObject(SALOMEDS::SObject_ptr theFatherObject);
- //!
- /*!
- <long-description>
-
- \param theFatherObject
- \param atag
- \return <ReturnValue>
- */
- virtual SALOMEDS::SObject_ptr NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject, CORBA::Long atag);
-
- /*!
- The methods adds a new subdirectory, the path can be absolute or relative (then the current context is used)
- */
- virtual void AddDirectory(const char* thePath);
-
- virtual void LoadWith(SALOMEDS::SComponent_ptr sco, SALOMEDS::Driver_ptr Engine)
- throw(SALOME::SALOME_Exception);
- virtual void Load(SALOMEDS::SObject_ptr sco);
-
- virtual void RemoveObject(SALOMEDS::SObject_ptr anObject);
- virtual void RemoveObjectWithChildren(SALOMEDS::SObject_ptr anObject);
-
- virtual SALOMEDS::GenericAttribute_ptr FindOrCreateAttribute(SALOMEDS::SObject_ptr anObject, const char* aTypeOfAttribute);
- virtual CORBA::Boolean FindAttribute(SALOMEDS::SObject_ptr anObject, SALOMEDS::GenericAttribute_out anAttribute, const char* aTypeOfAttribute);
- virtual void RemoveAttribute(SALOMEDS::SObject_ptr anObject, const char* aTypeOfAttribute);
-
- virtual void Addreference(SALOMEDS::SObject_ptr me, SALOMEDS::SObject_ptr thereferencedObject);
-
- virtual void RemoveReference(SALOMEDS::SObject_ptr me);
-
- virtual void SetGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID);
- virtual bool IsGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID);
-
- virtual void NewCommand();
- virtual void CommitCommand() throw(SALOMEDS::StudyBuilder::LockProtection);
- virtual CORBA::Boolean HasOpenCommand();
- virtual void AbortCommand();
- virtual void Undo() throw(SALOMEDS::StudyBuilder::LockProtection);
- virtual void Redo() throw(SALOMEDS::StudyBuilder::LockProtection);
- CORBA::Boolean GetAvailableUndos();
- CORBA::Boolean GetAvailableRedos();
- CORBA::Boolean IsSaved();
- CORBA::Boolean IsModified();
- virtual CORBA::Long UndoLimit();
- virtual void UndoLimit(CORBA::Long);
-
- void CheckLocked() throw (SALOMEDS::StudyBuilder::LockProtection);
-
- virtual void SetName(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
- virtual void SetComment(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
- virtual void SetIOR(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
-
- SALOMEDSImpl_StudyBuilder* GetImpl() { return _impl; }
-
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_StudyManager.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_StudyManager.hxx"
-
-#include "SALOMEDS.hxx"
-#include "SALOMEDS_Study.hxx"
-#include "SALOMEDS_SObject.hxx"
-
-#include "SALOMEDS_Driver_i.hxx"
-
-#include "SALOMEDSImpl_Study.hxx"
-
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
-
-#include "Basics_Utils.hxx"
-
-#ifdef WIN32
-#include <process.h>
-#else
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-using namespace std;
-
-SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_ptr orb);
-
-SALOMEDS_StudyManager::SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManager)
-{
-
-#ifdef WIN32
- long pid = (long)_getpid();
-#else
- long pid = (long)getpid();
-#endif
-
- CORBA::LongLong addr = theManager->GetLocalImpl(Kernel_Utils::GetHostname().c_str(), pid, _isLocal);
- if(_isLocal) {
- _local_impl = reinterpret_cast<SALOMEDSImpl_StudyManager*>(addr);
- _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager);
- }
- else {
- _local_impl = NULL;
- _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager);
- }
-
- init_orb();
-}
-
-SALOMEDS_StudyManager::SALOMEDS_StudyManager()
-{
- init_orb();
-
- SALOME_NamingService namingService(_orb);
- CORBA::Object_var obj = namingService.Resolve( "/myStudyManager" );
- SALOMEDS::StudyManager_var theManager = SALOMEDS::StudyManager::_narrow( obj );
- ASSERT( !CORBA::is_nil(theManager) );
-
-#ifdef WIN32
- long pid = (long)_getpid();
-#else
- long pid = (long)getpid();
-#endif
-
- CORBA::LongLong addr = theManager->GetLocalImpl(Kernel_Utils::GetHostname().c_str(), pid, _isLocal);
- if(_isLocal) {
- _local_impl = reinterpret_cast<SALOMEDSImpl_StudyManager*>(addr);
- _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager);
- }
- else {
- _local_impl = NULL;
- _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager);
- }
-}
-
-SALOMEDS_StudyManager::~SALOMEDS_StudyManager()
-{
-}
-
-_PTR(Study) SALOMEDS_StudyManager::NewStudy(const std::string& study_name)
-{
- //SRN: Pure CORBA NewStudy as it does more initialization than the local one
- SALOMEDSClient_Study* aStudy = NULL;
-
- SALOMEDS::Study_var aStudy_impl = _corba_impl->NewStudy((char*)study_name.c_str());
- if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy);
- aStudy = new SALOMEDS_Study(aStudy_impl);
-
- return _PTR(Study)(aStudy);
-}
-
-_PTR(Study) SALOMEDS_StudyManager::Open(const std::string& theStudyUrl)
-{
- //SRN: Pure CORBA Open as it does more initialization than the local one
- SALOMEDSClient_Study* aStudy = NULL;
-
- SALOMEDS::Study_var aStudy_impl = _corba_impl->Open((char*)theStudyUrl.c_str());
- if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy);
-
- aStudy = new SALOMEDS_Study(aStudy_impl.in());
-
- return _PTR(Study)(aStudy);
-}
-
-void SALOMEDS_StudyManager::Close(const _PTR(Study)& theStudy)
-{
- //SRN: Pure CORBA close as it does more cleaning than the local one
- SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId());
- _corba_impl->Close(aStudy);
-}
-
-bool SALOMEDS_StudyManager::Save(const _PTR(Study)& theStudy, bool theMultiFile)
-{
- //SRN: Pure CORBA save as the save operation require CORBA in any case
- SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId());
- return _corba_impl->Save(aStudy, theMultiFile);
-}
-
-bool SALOMEDS_StudyManager::SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile)
-{
- //SRN: Pure CORBA save as the save operation require CORBA in any case
- SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId());
- return _corba_impl->SaveASCII(aStudy, theMultiFile);
-}
-
-bool SALOMEDS_StudyManager::SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile)
-{
- //SRN: Pure CORBA save as the save operation require CORBA in any case
- SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId());
- return _corba_impl->SaveAs((char*)theUrl.c_str(), aStudy, theMultiFile);
-}
-
-bool SALOMEDS_StudyManager::SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile)
-{
- //SRN: Pure CORBA save as the save operation require CORBA in any case
- SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId());
- return _corba_impl->SaveAsASCII((char*)theUrl.c_str(), aStudy, theMultiFile);
-}
-
-std::vector<std::string> SALOMEDS_StudyManager::GetOpenStudies()
-{
- std::vector<std::string> aVector;
- int aLength, i;
-
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- vector<SALOMEDSImpl_Study*> aSeq = _local_impl->GetOpenStudies();
- aLength = aSeq.size();
- for(i = 0; i < aLength; i++)
- aVector.push_back(aSeq[i]->Name());
- }
- else {
- SALOMEDS::ListOfOpenStudies_var aSeq = _corba_impl->GetOpenStudies();
- aLength = aSeq->length();
- for(i = 0; i < aLength; i++)
- aVector.push_back(aSeq[i].in());
- }
- return aVector;
-}
-
-_PTR(Study) SALOMEDS_StudyManager::GetStudyByName(const std::string& theStudyName)
-{
- SALOMEDSClient_Study* aStudy = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_Study* aStudy_impl = _local_impl->GetStudyByName(theStudyName);
- if(!aStudy_impl) return _PTR(Study)(aStudy);
- aStudy = new SALOMEDS_Study(aStudy_impl);
- }
- else {
- SALOMEDS::Study_var aStudy_impl = _corba_impl->GetStudyByName((char*)theStudyName.c_str());
- if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy);
- aStudy = new SALOMEDS_Study(aStudy_impl);
- }
- return _PTR(Study)(aStudy);
-}
-
-_PTR(Study) SALOMEDS_StudyManager::GetStudyByID(int theStudyID)
-{
- SALOMEDSClient_Study* aStudy = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_Study* aStudy_impl = _local_impl->GetStudyByID(theStudyID);
- if(!aStudy_impl) return _PTR(Study)(aStudy);
- aStudy = new SALOMEDS_Study(aStudy_impl);
- }
- else {
- SALOMEDS::Study_var aStudy_impl = _corba_impl->GetStudyByID(theStudyID);
- if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy);
- aStudy = new SALOMEDS_Study(aStudy_impl);
- }
- return _PTR(Study)(aStudy);
-}
-
-bool SALOMEDS_StudyManager::CanCopy(const _PTR(SObject)& theSO)
-{
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- bool ret;
-
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO_impl = *(aSO->GetLocalImpl());
- SALOMEDS_Driver_i* aDriver = GetDriver(aSO_impl, _orb);
- ret = _local_impl->CanCopy(aSO_impl, aDriver);
- delete aDriver;
- }
- else {
- ret = _corba_impl->CanCopy(aSO->GetCORBAImpl());
- }
-
- return ret;
-}
-
-bool SALOMEDS_StudyManager::Copy(const _PTR(SObject)& theSO)
-{
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO_impl = *(aSO->GetLocalImpl());
- SALOMEDS_Driver_i* aDriver = GetDriver(aSO_impl, _orb);
- ret = _local_impl->Copy(aSO_impl, aDriver);
- delete aDriver;
- }
- else {
- ret = _corba_impl->Copy(aSO->GetCORBAImpl());
- }
- return ret;
-}
-
-bool SALOMEDS_StudyManager::CanPaste(const _PTR(SObject)& theSO)
-{
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- bool ret;
-
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO_impl = *(aSO->GetLocalImpl());
- SALOMEDS_Driver_i* aDriver = GetDriver(aSO_impl, _orb);
- ret = _local_impl->CanPaste(aSO_impl, aDriver);
- delete aDriver;
- }
- else {
- ret = _corba_impl->CanPaste(aSO->GetCORBAImpl());
- }
-
- return ret;
-}
-
-_PTR(SObject) SALOMEDS_StudyManager::Paste(const _PTR(SObject)& theSO)
-{
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
- SALOMEDSClient_SObject* aResult = NULL;
-
- if (_isLocal) {
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO_impl = *(aSO->GetLocalImpl());
- SALOMEDS_Driver_i* aDriver = GetDriver(aSO_impl, _orb);
- SALOMEDSImpl_SObject aNewSO = _local_impl->Paste(aSO_impl, aDriver);
- delete aDriver;
- if(aNewSO.IsNull()) return _PTR(SObject)(aResult);
- aResult = new SALOMEDS_SObject(aNewSO);
- }
- else {
- SALOMEDS::SObject_ptr aNewSO = _corba_impl->Paste(aSO->GetCORBAImpl());
- if(CORBA::is_nil(aNewSO)) return _PTR(SObject)(aResult);
- aResult = new SALOMEDS_SObject(aNewSO);
- }
-
- return _PTR(SObject)(aResult);
-}
-
-
-void SALOMEDS_StudyManager::init_orb()
-{
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- _orb = init(0 , 0 );
-}
-
-SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_ptr orb)
-{
- SALOMEDS_Driver_i* driver = NULL;
-
- SALOMEDSImpl_SComponent aSCO = theObject.GetFatherComponent();
- if(!aSCO.IsNull()) {
- string IOREngine = aSCO.GetIOR();
- if(!IOREngine.empty()) {
- CORBA::Object_var obj = orb->string_to_object(IOREngine.c_str());
- SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ;
- driver = new SALOMEDS_Driver_i(Engine, orb);
- }
- }
-
- return driver;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_StudyManager.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_STUDYMANAGER_H__
-#define __SALOMEDS_STUDYMANAGER_H__
-
-#include <vector>
-#include <string>
-
-#include "SALOMEDSClient.hxx"
-#include "SALOMEDSImpl_StudyManager.hxx"
-
-// IDL headers
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-class Standard_EXPORT SALOMEDS_StudyManager: public SALOMEDSClient_StudyManager
-{
-private:
- bool _isLocal;
- SALOMEDSImpl_StudyManager* _local_impl;
- SALOMEDS::StudyManager_var _corba_impl;
- CORBA::ORB_var _orb;
-
-public:
-
- SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManager);
- SALOMEDS_StudyManager();
- ~SALOMEDS_StudyManager();
-
- virtual _PTR(Study) NewStudy(const std::string& study_name);
- virtual _PTR(Study) Open(const std::string& theStudyUrl);
- virtual void Close(const _PTR(Study)& theStudy);
- virtual bool Save(const _PTR(Study)& theStudy, bool theMultiFile);
- virtual bool SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile);
- virtual bool SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile);
- virtual bool SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile);
- virtual std::vector<std::string> GetOpenStudies();
- virtual _PTR(Study) GetStudyByName(const std::string& theStudyName) ;
- virtual _PTR(Study) GetStudyByID(int theStudyID) ;
- virtual bool CanCopy(const _PTR(SObject)& theSO);
- virtual bool Copy(const _PTR(SObject)& theSO);
- virtual bool CanPaste(const _PTR(SObject)& theSO);
- virtual _PTR(SObject) Paste(const _PTR(SObject)& theSO);
-
-private:
- void init_orb();
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_StudyManager_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "utilities.h"
-#include "SALOME_LifeCycleCORBA.hxx"
-#include "SALOMEDS_StudyManager_i.hxx"
-#include "SALOMEDS_Study_i.hxx"
-#include "SALOMEDS_SComponent_i.hxx"
-#include "SALOMEDS_Driver_i.hxx"
-#include "SALOMEDS.hxx"
-
-#include "SALOMEDSImpl_Study.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_AttributeIOR.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "Utils_ExceptHandlers.hxx"
-#include "Basics_Utils.hxx"
-#include "SALOME_GenericObj_i.hh"
-
-#include <sstream>
-#include <vector>
-#include <map>
-
-#ifdef WIN32
-#include <process.h>
-#else
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-using namespace std;
-
-UNEXPECT_CATCH(SalomeException,SALOME::SALOME_Exception);
-UNEXPECT_CATCH(LockProtection, SALOMEDS::StudyBuilder::LockProtection);
-
-static SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_ptr orb);
-
-static std::map<int, PortableServer::POA_ptr> _mapOfPOA;
-
-//============================================================================
-/*! Function : SALOMEDS_StudyManager_i
- * Purpose : SALOMEDS_StudyManager_i constructor
- */
-//============================================================================
-SALOMEDS_StudyManager_i::SALOMEDS_StudyManager_i(CORBA::ORB_ptr orb, PortableServer::POA_ptr thePOA)
-{
- _orb = CORBA::ORB::_duplicate(orb);
- _poa = PortableServer::POA::_duplicate(thePOA);
- _name_service = new SALOME_NamingService(_orb);
- // Study directory creation in the naming service : to register all
- // open studies in the session
- _name_service->Create_Directory("/Study");
- _impl = new SALOMEDSImpl_StudyManager;
- _factory = new SALOMEDS_DriverFactory_i(_orb);
-}
-
-//============================================================================
-/*! Function : ~SALOMEDS_StudyManager_i
- * Purpose : SALOMEDS_StudyManager_i destructor
- */
-//============================================================================
-SALOMEDS_StudyManager_i::~SALOMEDS_StudyManager_i()
-{
- // Destroy directory to register open studies
- _name_service->Destroy_Directory("/Study");
- delete _name_service;
- delete _factory;
- delete _impl;
-}
-
-//============================================================================
-/*! Function : register_name
- * Purpose : Register the study Manager in the naming service under the
- * context name
- */
-//============================================================================
-void SALOMEDS_StudyManager_i::register_name(const char * name)
-{
- SALOMEDS::StudyManager_var aManager(_this());
- _name_service->Register(aManager.in(), name);
-}
-
-
-//============================================================================
-/*! Function : NewStudy
- * Purpose : Create a New Study of name study_name
- */
-//============================================================================
-SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::NewStudy(const char* study_name)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_Study* aStudyImpl = _impl->NewStudy(study_name);
- if(!aStudyImpl) {
- MESSAGE("NewStudy : Error : " << _impl->GetErrorCode());
- return SALOMEDS::Study::_nil();
- }
-
- MESSAGE("NewStudy : Creating the CORBA servant holding it... ");
-
- SALOMEDS_Study_i *Study_servant = new SALOMEDS_Study_i(aStudyImpl, _orb);
- SALOMEDS::Study_var Study = SALOMEDS::Study::_narrow(Study_servant->_this());
-
- // Register study in the naming service
- // Path to acces the study
- if(!_name_service->Change_Directory("/Study"))
- MESSAGE( "Unable to access the study directory" )
- else
- _name_service->Register(Study, study_name);
-
- // Assign the value of the IOR in the study->root
- CORBA::String_var IORStudy = _orb->object_to_string(Study);
-
- aStudyImpl->SetTransientReference((char*)IORStudy.in());
-
- _mapOfPOA[Study->StudyId()] = _poa;
-
- return Study;
-}
-
-//============================================================================
-/*! Function : Open
- * Purpose : Open a Study from it's persistent reference
- */
-//============================================================================
-SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::Open(const char* aUrl)
- throw(SALOME::SALOME_Exception)
-{
- SALOMEDS::Locker lock;
-
- Unexpect aCatch(SalomeException);
- MESSAGE("Begin of SALOMEDS_StudyManager_i::Open");
-
- SALOMEDSImpl_Study* aStudyImpl = _impl->Open(string(aUrl));
-
- if ( !aStudyImpl )
- THROW_SALOME_CORBA_EXCEPTION("Impossible to Open study from file", SALOME::BAD_PARAM)
-
- MESSAGE("Open : Creating the CORBA servant holding it... ");
-
- // Temporary aStudyUrl in place of study name
- SALOMEDS_Study_i * Study_servant = new SALOMEDS_Study_i(aStudyImpl, _orb);
- SALOMEDS::Study_var Study = SALOMEDS::Study::_narrow(Study_servant->_this());
-
- // Assign the value of the IOR in the study->root
- CORBA::String_var IORStudy = _orb->object_to_string(Study);
- aStudyImpl->SetTransientReference((char*)IORStudy.in());
-
- // Register study in the naming service
- // Path to acces the study
- if(!_name_service->Change_Directory("/Study")) MESSAGE( "Unable to access the study directory" )
- else _name_service->Register(Study, CORBA::string_dup(aStudyImpl->Name().c_str()));
-
- return Study;
-}
-
-
-
-//============================================================================
-/*! Function : Close
- * Purpose : Close a study.
- * If the study hasn't been saved, ask the user to confirm the
- * close action without saving
- */
-//============================================================================
-void SALOMEDS_StudyManager_i::Close(SALOMEDS::Study_ptr aStudy)
-{
- SALOMEDS::Locker lock;
-
- if(aStudy->_is_nil()) return;
-
- // Destroy study name in the naming service
- if(_name_service->Change_Directory("/Study")){
- CORBA::String_var aString(aStudy->Name());
- _name_service->Destroy_Name(aString.in());
- }
-
- SALOMEDS::unlock();
- aStudy->Close();
- SALOMEDS::lock();
-}
-
-//============================================================================
-/*! Function : Save
- * Purpose : Save a Study to it's persistent reference
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_StudyManager_i::Save(SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
-{
- SALOMEDS::Locker lock;
-
- if(aStudy->_is_nil()) {
- MESSAGE("Save error: Study is null");
- return false;
- }
-
- SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- return _impl->Save(aStudyImpl, _factory, theMultiFile);
-}
-
-CORBA::Boolean SALOMEDS_StudyManager_i::SaveASCII(SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
-{
- SALOMEDS::Locker lock;
-
- if(aStudy->_is_nil()) {
- MESSAGE("SaveASCII error: Study is null");
- return false;
- }
-
- SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- return _impl->SaveASCII(aStudyImpl, _factory, theMultiFile);
-}
-
-//=============================================================================
-/*! Function : SaveAs
- * Purpose : Save a study to the persistent reference aUrl
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_StudyManager_i::SaveAs(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
-{
- SALOMEDS::Locker lock;
-
- if(aStudy->_is_nil()) {
- MESSAGE("SaveASCII error: Study is null");
- return false;
- }
-
- SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- return _impl->SaveAs(string(aUrl), aStudyImpl, _factory, theMultiFile);
-}
-
-CORBA::Boolean SALOMEDS_StudyManager_i::SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
-{
- SALOMEDS::Locker lock;
-
- if(aStudy->_is_nil()) {
- MESSAGE("SaveASCII error: Study is null");
- return false;
- }
-
- SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- return _impl->SaveAsASCII(string(aUrl), aStudyImpl, _factory, theMultiFile);
-}
-
-//============================================================================
-/*! Function : GetOpenStudies
- * Purpose : Get name list of open studies in the session
- */
-//============================================================================
-SALOMEDS::ListOfOpenStudies* SALOMEDS_StudyManager_i::GetOpenStudies()
-{
- SALOMEDS::Locker lock;
-
- vector<SALOMEDSImpl_Study*> anOpened = _impl->GetOpenStudies();
- int aLength = anOpened.size();
-
- SALOMEDS::ListOfOpenStudies_var _list_open_studies = new SALOMEDS::ListOfOpenStudies;
- _list_open_studies->length(aLength);
-
- if(!aLength)
- {
- MESSAGE("No active study in this session");
- }
- else
- {
- for (unsigned int ind=0; ind < aLength; ind++)
- {
- _list_open_studies[ind] = CORBA::string_dup(anOpened[ind]->Name().c_str());
- SCRUTE(_list_open_studies[ind]) ;
- }
- }
- return _list_open_studies._retn();
-}
-
-//============================================================================
-/*! Function : GetStudyByName
- * Purpose : Get a study from its name
- */
-//============================================================================
-SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::GetStudyByName(const char* aStudyName)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByName(string(aStudyName));
-
- if (!aStudyImpl)
- {
- MESSAGE(_impl->GetErrorCode().c_str());
- return SALOMEDS::Study::_nil();
- }
-
- SALOMEDS_Study_i* aStudy_servant = new SALOMEDS_Study_i(aStudyImpl, _orb);
- SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(aStudy_servant->_this());
-
- return aStudy._retn();
-}
-
-//============================================================================
-/*! Function : GetStudyByID
- * Purpose : Get a study from its ID
- */
-//============================================================================
-SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::GetStudyByID(CORBA::Short aStudyID)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudyID);
-
- if (!aStudyImpl)
- {
- MESSAGE(_impl->GetErrorCode().c_str());
- return SALOMEDS::Study::_nil();
- }
-
- SALOMEDS_Study_i* aStudy_servant = new SALOMEDS_Study_i(aStudyImpl, _orb);
- CORBA::Object_var obj = aStudy_servant->_this();
- SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(obj);
-
- return aStudy._retn();
-}
-
-
-//============================================================================
-/*! Function : CanCopy
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_StudyManager_i::CanCopy(SALOMEDS::SObject_ptr theObject)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDS::Study_var aStudy = theObject->GetStudy();
- SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- SALOMEDSImpl_SObject anObject = aStudyImpl->GetSObject(theObject->GetID());
-
- SALOMEDS_Driver_i* aDriver = GetDriver(anObject, _orb);
- bool ret = _impl->CanCopy(anObject, aDriver);
- delete aDriver;
- return ret;
-}
-
-//============================================================================
-/*! Function : Copy
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_StudyManager_i::Copy(SALOMEDS::SObject_ptr theObject)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDS::Study_var aStudy = theObject->GetStudy();
- SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- SALOMEDSImpl_SObject anObject = aStudyImpl->GetSObject(theObject->GetID());
-
- SALOMEDS_Driver_i* aDriver = GetDriver(anObject, _orb);
- bool ret = _impl->Copy(anObject, aDriver);
- delete aDriver;
- return ret;
-}
-
-//============================================================================
-/*! Function : CanPaste
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_StudyManager_i::CanPaste(SALOMEDS::SObject_ptr theObject)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDS::Study_var aStudy = theObject->GetStudy();
- SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- SALOMEDSImpl_SObject anObject = aStudyImpl->GetSObject(theObject->GetID());
-
- SALOMEDS_Driver_i* aDriver = GetDriver(anObject, _orb);
- bool ret = _impl->CanPaste(anObject, aDriver);
- delete aDriver;
- return ret;
-}
-
-//============================================================================
-/*! Function : Paste
- * Purpose :
- */
-//============================================================================
-SALOMEDS::SObject_ptr SALOMEDS_StudyManager_i::Paste(SALOMEDS::SObject_ptr theObject)
- throw(SALOMEDS::StudyBuilder::LockProtection)
-{
- SALOMEDS::Locker lock;
-
- Unexpect aCatch(LockProtection);
- SALOMEDS::Study_var aStudy = theObject->GetStudy();
-
- SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- SALOMEDSImpl_SObject anObject = aStudyImpl->GetSObject(theObject->GetID());
- SALOMEDSImpl_SObject aNewSO;
-
- try {
- SALOMEDS_Driver_i* aDriver = GetDriver(anObject, _orb);
- aNewSO = _impl->Paste(anObject, aDriver);
- delete aDriver;
- }
- catch (...) {
- throw SALOMEDS::StudyBuilder::LockProtection();
- }
-
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aNewSO, _orb);
- return so._retn();
-}
-
-
-SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_ptr orb)
-{
- SALOMEDS_Driver_i* driver = NULL;
-
- SALOMEDSImpl_SComponent aSCO = theObject.GetFatherComponent();
- if(!aSCO.IsNull()) {
- string IOREngine = aSCO.GetIOR();
- if(!IOREngine.empty()) {
- CORBA::Object_var obj = orb->string_to_object(IOREngine.c_str());
- SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ;
- driver = new SALOMEDS_Driver_i(Engine, orb);
- }
- }
-
- return driver;
-}
-
-PortableServer::POA_ptr SALOMEDS_StudyManager_i::GetPOA(const SALOMEDS::Study_ptr theStudy) {
- if (_mapOfPOA.find(theStudy->StudyId()) != _mapOfPOA.end()) return _mapOfPOA[theStudy->StudyId()];
- return PortableServer::POA::_nil();
-}
-
-CORBA::Long SALOMEDS_StudyManager_i::getPID()
-{
-#ifdef WIN32
- return (CORBA::Long)_getpid();
-#else
- return (CORBA::Long)getpid();
-#endif
-}
-
-void SALOMEDS_StudyManager_i::ShutdownWithExit()
-{
- exit( EXIT_SUCCESS );
-}
-
-//===========================================================================
-// PRIVATE FUNCTIONS
-//===========================================================================
-CORBA::LongLong SALOMEDS_StudyManager_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
-{
-#ifdef WIN32
- long pid = (long)_getpid();
-#else
- long pid = (long)getpid();
-#endif
- isLocal = (strcmp(theHostname, Kernel_Utils::GetHostname().c_str()) == 0 && pid == thePID)?1:0;
- return reinterpret_cast<CORBA::LongLong>(_impl);
-}
-
-//===========================================================================
-namespace SALOMEDS
-{
- PortableServer::ServantBase_var
- GetServant(CORBA::Object_ptr theObject, PortableServer::POA_ptr thePOA)
- {
- if(CORBA::is_nil(theObject))
- return NULL;
- try{
- return thePOA->reference_to_servant(theObject);
- }catch(...){
- return NULL;
- }
- }
-
-}
-
-//===========================================================================
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_StudyManager_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_STUDYMANAGER_I_H__
-#define __SALOMEDS_STUDYMANAGER_I_H__
-
-// std C++ headers
-#include <iostream>
-
-#ifndef WIN32
-#include <unistd.h>
-#endif
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-// Naming Service header
-#include "SALOME_NamingService.hxx"
-
-#include <stdlib.h>
-
-#include "SALOMEDS_Driver_i.hxx"
-#include "SALOMEDSImpl_StudyManager.hxx"
-
-namespace SALOMEDS{
-
- // To convert CORBA::Object to PortableServer::ServantBase
- PortableServer::ServantBase_var GetServant(CORBA::Object_ptr, PortableServer::POA_ptr);
-
-}
-
-class Standard_EXPORT SALOMEDS_StudyManager_i: public POA_SALOMEDS::StudyManager
-{
-private:
-
- CORBA::ORB_var _orb;
- PortableServer::POA_var _poa;
- SALOMEDSImpl_StudyManager* _impl;
- SALOME_NamingService* _name_service;
- SALOMEDS_DriverFactory_i* _factory;
-
-public:
-
- //! standard constructor
- SALOMEDS_StudyManager_i(CORBA::ORB_ptr orb, PortableServer::POA_ptr thePOA);
-
- //! standard destructor
- virtual ~SALOMEDS_StudyManager_i();
-
- //! method to Register study Manager in the naming service
- /*!
- \param char* arguments, the context to register the study manager in the NS
- */
- void register_name(const char * name);
-
- //! method to Create a New Study of name study_name
- /*!
- \param char* arguments, the new study name
- \return Study_ptr arguments
- */
- virtual SALOMEDS::Study_ptr NewStudy(const char* study_name);
-
- //! method to Open a Study from it's persistent reference
- /*!
- \param char* arguments, the study URL
- \return Study_ptr arguments
- */
- virtual SALOMEDS::Study_ptr Open(const char* aStudyUrl) throw (SALOME::SALOME_Exception);
-
-
- //! method to close a Study
- /*!
- \param Study_ptr arguments
- */
- virtual void Close( SALOMEDS::Study_ptr aStudy);
-
- //! method to save a Study
- /*!
- \param Study_ptr arguments
- */
- virtual CORBA::Boolean Save( SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
-
- virtual CORBA::Boolean SaveASCII( SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
-
- //! method to save a Study to the persistent reference aUrl
- /*!
- \param char* arguments, the new URL of the study
- \param Study_ptr arguments
- */
- virtual CORBA::Boolean SaveAs(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
- virtual CORBA::Boolean SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
-
- //! method to Get name list of open studies in the session
- /*!
- \return ListOfOpenStudies* arguments
- */
- virtual SALOMEDS::ListOfOpenStudies* GetOpenStudies();
-
- //! method to get a Study from it's name
- /*!
- \param char* arguments, the study name
- \return Study_ptr arguments
- */
- virtual SALOMEDS::Study_ptr GetStudyByName(const char* aStudyName) ;
-
- //! method to get a Study from it's ID
- /*!
- \param char* arguments, the study ID
- \return Study_ptr arguments
- */
- virtual SALOMEDS::Study_ptr GetStudyByID(CORBA::Short aStudyID) ;
-
- virtual CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
- virtual CORBA::Boolean Copy(SALOMEDS::SObject_ptr theObject);
- virtual CORBA::Boolean CanPaste(SALOMEDS::SObject_ptr theObject);
- virtual SALOMEDS::SObject_ptr Paste(SALOMEDS::SObject_ptr theObject) throw(SALOMEDS::StudyBuilder::LockProtection);
-
- virtual char* ConvertObjectToIOR(CORBA::Object_ptr theObject) {return _orb->object_to_string(theObject); }
- virtual CORBA::Object_ptr ConvertIORToObject(const char* theIOR) { return _orb->string_to_object(theIOR); };
-
- void ping(){};
- CORBA::Long getPID();
- void ShutdownWithExit();
-
- virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
-
- static PortableServer::POA_ptr GetPOA(const SALOMEDS::Study_ptr theStudy);
-
- void Shutdown() { if(!CORBA::is_nil(_orb)) _orb->shutdown(0); }
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_Study_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "utilities.h"
-#include "SALOMEDS_Study_i.hxx"
-#include "SALOMEDS_UseCaseIterator_i.hxx"
-#include "SALOMEDS_GenericAttribute_i.hxx"
-#include "SALOMEDS_AttributeStudyProperties_i.hxx"
-#include "SALOMEDS_AttributeParameter_i.hxx"
-#include "SALOMEDS_ChildIterator_i.hxx"
-#include "SALOMEDS_Driver_i.hxx"
-#include "SALOMEDS.hxx"
-
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_UseCaseBuilder.hxx"
-#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
-#include "SALOMEDSImpl_AttributeParameter.hxx"
-#include "SALOMEDSImpl_ChildIterator.hxx"
-#include "SALOMEDSImpl_IParameters.hxx"
-
-#include "DF_Label.hxx"
-#include "DF_Attribute.hxx"
-
-#include "Basics_Utils.hxx"
-
-#ifdef WIN32
-#include <process.h>
-#else
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-using namespace std;
-
-//============================================================================
-/*! Function : SALOMEDS_Study_i
- * Purpose : SALOMEDS_Study_i constructor
- */
-//============================================================================
-SALOMEDS_Study_i::SALOMEDS_Study_i(SALOMEDSImpl_Study* theImpl,
- CORBA::ORB_ptr orb)
-{
- _orb = CORBA::ORB::_duplicate(orb);
- _impl = theImpl;
-
- _builder = new SALOMEDS_StudyBuilder_i(_impl->NewBuilder(), _orb);
-}
-
-//============================================================================
-/*! Function : ~SALOMEDS_Study_i
- * Purpose : SALOMEDS_Study_i destructor
- */
-//============================================================================
-SALOMEDS_Study_i::~SALOMEDS_Study_i()
-{
-}
-
-//============================================================================
-/*! Function : GetPersistentReference
- * Purpose : Get persistent reference of study (idem URL())
- */
-//============================================================================
-char* SALOMEDS_Study_i::GetPersistentReference()
-{
- SALOMEDS::Locker lock;
- return CORBA::string_dup(_impl->GetPersistentReference().c_str());
-}
-//============================================================================
-/*! Function : GetTransientReference
- * Purpose : Get IOR of the Study (registred in OCAF document in doc->Root)
- */
-//============================================================================
-char* SALOMEDS_Study_i::GetTransientReference()
-{
- SALOMEDS::Locker lock;
- return CORBA::string_dup(_impl->GetTransientReference().c_str());
-}
-
-//============================================================================
-/*! Function : IsEmpty
- * Purpose : Detect if study is empty
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_Study_i::IsEmpty()
-{
- SALOMEDS::Locker lock;
- return _impl->IsEmpty();
-}
-
-//============================================================================
-/*! Function : FindComponent
- * Purpose : Find a Component with ComponentDataType = aComponentName
- */
-//============================================================================
-SALOMEDS::SComponent_ptr SALOMEDS_Study_i::FindComponent (const char* aComponentName)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SComponent aCompImpl = _impl->FindComponent(string(aComponentName));
- if(aCompImpl.IsNull()) return SALOMEDS::SComponent::_nil();
-
- SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (aCompImpl, _orb);
- return sco._retn();
-}
-
-//============================================================================
-/*! Function : FindComponentID
- * Purpose : Find a Component from it's ID
- */
-//============================================================================
-SALOMEDS::SComponent_ptr SALOMEDS_Study_i::FindComponentID(const char* aComponentID)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SComponent aCompImpl = _impl->FindComponentID(string((char*)aComponentID));
- if(aCompImpl.IsNull()) return SALOMEDS::SComponent::_nil();
-
- SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (aCompImpl, _orb);
- return sco._retn();
-}
-
-//============================================================================
-/*! Function : FindObject
- * Purpose : Find an Object with SALOMEDS::Name = anObjectName
- */
-//============================================================================
-SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObject(const char* anObjectName)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO = _impl->FindObject(string((char*)anObjectName));
- if(aSO.IsNull()) return SALOMEDS::SObject::_nil();
-
- if(aSO.IsComponent()) {
- SALOMEDSImpl_SComponent aSCO = aSO;
- SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (aSCO, _orb);
- return sco._retn();
- }
-
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb);
-
- return so._retn();
-}
-
-//============================================================================
-/*! Function : FindObjectID
- * Purpose : Find an Object with ID = anObjectID
- */
-//============================================================================
-SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectID(const char* anObjectID)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO = _impl->FindObjectID(string((char*)anObjectID));
- if(aSO.IsNull()) return SALOMEDS::SObject::_nil();
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb);
- return so._retn();
-}
-
-//============================================================================
-/*! Function : CreateObjectID
- * Purpose : Creates an Object with ID = anObjectID
- */
-//============================================================================
-SALOMEDS::SObject_ptr SALOMEDS_Study_i::CreateObjectID(const char* anObjectID)
-{
- SALOMEDS::Locker lock;
-
- if(!anObjectID || strlen(anObjectID) == 0) return SALOMEDS::SObject::_nil();
-
- SALOMEDSImpl_SObject aSO = _impl->CreateObjectID((char*)anObjectID);
- if(aSO.IsNull()) return SALOMEDS::SObject::_nil();
-
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb);
- return so._retn();
-}
-
-//============================================================================
-/*! Function : FindObjectByName
- * Purpose : Find Objects with SALOMEDS::Name = anObjectName in a Component
- * : with ComponentDataType = aComponentName
- */
-//============================================================================
-SALOMEDS::Study::ListOfSObject* SALOMEDS_Study_i::FindObjectByName( const char* anObjectName,
- const char* aComponentName )
-{
- SALOMEDS::Locker lock;
-
- vector<SALOMEDSImpl_SObject> aSeq = _impl->FindObjectByName(string((char*)anObjectName),
- string((char*)aComponentName));
- int aLength = aSeq.size();
- SALOMEDS::Study::ListOfSObject_var listSO = new SALOMEDS::Study::ListOfSObject ;
- listSO->length(aLength);
- for(int i = 0; i<aLength; i++) {
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSeq[i], _orb);
- listSO[i] = so ;
- }
- return listSO._retn() ;
-}
-
-//============================================================================
-/*! Function : FindObjectIOR
- * Purpose : Find an Object with IOR = anObjectIOR
- */
-//============================================================================
-SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectIOR(const char* anObjectIOR)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO = _impl->FindObjectIOR(string((char*)anObjectIOR));
- if(aSO.IsNull()) return SALOMEDS::SObject::_nil();
-
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb);
- return so._retn();
-}
-
-//============================================================================
-/*! Function : FindObjectByPath
- * Purpose : Find an Object by its path = thePath
- */
-//============================================================================
-SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectByPath(const char* thePath)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO = _impl->FindObjectByPath(string((char*)thePath));
- if(aSO.IsNull()) return SALOMEDS::SObject::_nil();
-
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb);
- return so._retn();
-}
-
-//============================================================================
-/*! Function : GetObjectPath
- * Purpose :
- */
-//============================================================================
-char* SALOMEDS_Study_i::GetObjectPath(CORBA::Object_ptr theObject)
-{
- SALOMEDS::Locker lock;
-
- string aPath("");
- if(CORBA::is_nil(theObject)) return CORBA::string_dup(aPath.c_str());
- SALOMEDSImpl_SObject aSO;
- SALOMEDS::SObject_var aSObj = SALOMEDS::SObject::_narrow(theObject);
-
- if(!CORBA::is_nil(aSObj)) {
- aSO = _impl->FindObjectID(aSObj->GetID());
- }
- else {
- aSO = _impl->FindObjectIOR(_orb->object_to_string(theObject));
- }
-
- if(aSO.IsNull()) return CORBA::string_dup(aPath.c_str());
-
- aPath = _impl->GetObjectPath(aSO);
- return CORBA::string_dup(aPath.c_str());
-}
-
-
-//============================================================================
-/*! Function : SetContext
- * Purpose : Sets the current context
- */
-//============================================================================
-void SALOMEDS_Study_i::SetContext(const char* thePath)
-{
- SALOMEDS::Locker lock;
-
- _impl->SetContext(string((char*)thePath));
- if(_impl->IsError() && _impl->GetErrorCode() == "InvalidContext")
- throw SALOMEDS::Study::StudyInvalidContext();
-}
-
-//============================================================================
-/*! Function : GetContext
- * Purpose : Gets the current context
- */
-//============================================================================
-char* SALOMEDS_Study_i::GetContext()
-{
- SALOMEDS::Locker lock;
-
- if(!_impl->HasCurrentContext()) throw SALOMEDS::Study::StudyInvalidContext();
- return CORBA::string_dup(_impl->GetContext().c_str());
-}
-
-//============================================================================
-/*! Function : GetObjectNames
- * Purpose : method to get all object names in the given context (or in the current context, if 'theContext' is empty)
- */
-//============================================================================
-SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetObjectNames(const char* theContext)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
-
- if (strlen(theContext) == 0 && !_impl->HasCurrentContext())
- throw SALOMEDS::Study::StudyInvalidContext();
-
- vector<string> aSeq = _impl->GetObjectNames(string((char*)theContext));
- if (_impl->GetErrorCode() == "InvalidContext")
- throw SALOMEDS::Study::StudyInvalidContext();
-
- int aLength = aSeq.size();
- aResult->length(aLength);
- for (int anIndex = 0; anIndex < aLength; anIndex++) {
- aResult[anIndex] = CORBA::string_dup(aSeq[anIndex].c_str());
- }
-
- return aResult._retn();
-}
-
-//============================================================================
-/*! Function : GetDirectoryNames
- * Purpose : method to get all directory names in the given context (or in the current context, if 'theContext' is empty)
- */
-//============================================================================
-SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetDirectoryNames(const char* theContext)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
-
- if (strlen(theContext) == 0 && !_impl->HasCurrentContext())
- throw SALOMEDS::Study::StudyInvalidContext();
-
- vector<string> aSeq = _impl->GetDirectoryNames(string((char*)theContext));
- if (_impl->GetErrorCode() == "InvalidContext")
- throw SALOMEDS::Study::StudyInvalidContext();
-
- int aLength = aSeq.size();
- aResult->length(aLength);
- for (int anIndex = 0; anIndex < aLength; anIndex++) {
- aResult[anIndex] = CORBA::string_dup(aSeq[anIndex].c_str());
- }
-
- return aResult._retn();
-}
-
-//============================================================================
-/*! Function : GetFileNames
- * Purpose : method to get all file names in the given context (or in the current context, if 'theContext' is empty)
- */
-//============================================================================
-SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetFileNames(const char* theContext)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
-
- if (strlen(theContext) == 0 && !_impl->HasCurrentContext())
- throw SALOMEDS::Study::StudyInvalidContext();
-
- vector<string> aSeq = _impl->GetFileNames(string((char*)theContext));
- if (_impl->GetErrorCode() == "InvalidContext")
- throw SALOMEDS::Study::StudyInvalidContext();
-
- int aLength = aSeq.size();
- aResult->length(aLength);
- for (int anIndex = 0; anIndex < aLength; anIndex++) {
- aResult[anIndex] = CORBA::string_dup(aSeq[anIndex].c_str());
- }
-
- return aResult._retn();
-}
-
-//============================================================================
-/*! Function : GetComponentNames
- * Purpose : method to get all components names
- * SRN: Note, theContext can be any, it doesn't matter
- */
-//============================================================================
-SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetComponentNames(const char* theContext)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
-
- vector<string> aSeq = _impl->GetComponentNames(string((char*)theContext));
-
- int aLength = aSeq.size();
- aResult->length(aLength);
- for(int anIndex = 0; anIndex < aLength; anIndex++) {
- aResult[anIndex] = CORBA::string_dup(aSeq[anIndex].c_str());
- }
-
- return aResult._retn();
-}
-
-//============================================================================
-/*! Function : NewChildIterator
- * Purpose : Create a ChildIterator from an SObject
- */
-//============================================================================
-SALOMEDS::ChildIterator_ptr SALOMEDS_Study_i::NewChildIterator(SALOMEDS::SObject_ptr theSO)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_SObject aSO = _impl->GetSObject(theSO->GetID());
- SALOMEDSImpl_ChildIterator anItr(aSO);
-
- //Create iterator
- SALOMEDS_ChildIterator_i* it_servant = new SALOMEDS_ChildIterator_i(anItr, _orb);
- SALOMEDS::ChildIterator_var it = SALOMEDS::ChildIterator::_narrow(it_servant->_this());
-
- return it;
-}
-
-
-//============================================================================
-/*! Function : NewComponentIterator
- * Purpose : Create a SComponentIterator
- */
-//============================================================================
-SALOMEDS::SComponentIterator_ptr SALOMEDS_Study_i::NewComponentIterator()
-{
- SALOMEDS::Locker lock;
- SALOMEDS_SComponentIterator_i* _it = new SALOMEDS_SComponentIterator_i(_impl->NewComponentIterator(), _orb);
- _it->Init();
- return _it->_this();
-}
-
-
-//============================================================================
-/*! Function : NewBuilder
- * Purpose : Create a StudyBuilder
- */
-//============================================================================
-SALOMEDS::StudyBuilder_ptr SALOMEDS_Study_i::NewBuilder()
-{
- SALOMEDS::Locker lock;
- return _builder->_this();
-}
-
-//============================================================================
-/*! Function : Name
- * Purpose : get study name
- */
-//============================================================================
-char* SALOMEDS_Study_i::Name()
-{
- SALOMEDS::Locker lock;
- return CORBA::string_dup(_impl->Name().c_str());
-}
-
-//============================================================================
-/*! Function : Name
- * Purpose : set study name
- */
-//============================================================================
-void SALOMEDS_Study_i::Name(const char* name)
-{
- SALOMEDS::Locker lock;
- _impl->Name(string((char*)name));
-}
-
-//============================================================================
-/*! Function : IsSaved
- * Purpose : get if study has been saved
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_Study_i::IsSaved()
-{
- SALOMEDS::Locker lock;
- return _impl->IsSaved();
-}
-
-//============================================================================
-/*! Function : IsSaved
- * Purpose : set if study has been saved
- */
-//============================================================================
-void SALOMEDS_Study_i::IsSaved(CORBA::Boolean save)
-{
- SALOMEDS::Locker lock;
- _impl->IsSaved(save);
-}
-
-//============================================================================
-/*! Function : IsModified
- * Purpose : Detect if a Study has been modified since it has been saved
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_Study_i::IsModified()
-{
- SALOMEDS::Locker lock;
- return _impl->IsModified();
-}
-
-//============================================================================
-/*! Function : Modified
- * Purpose : Sets a Modified flag of a Study to True
- */
-//============================================================================
-void SALOMEDS_Study_i::Modified()
-{
- SALOMEDS::Locker lock;
- return _impl->Modify();
-}
-
-
-//============================================================================
-/*! Function : URL
- * Purpose : get URL of the study (persistent reference of the study)
- */
-//============================================================================
-char* SALOMEDS_Study_i::URL()
-{
- SALOMEDS::Locker lock;
- return CORBA::string_dup(_impl->URL().c_str());
-}
-
-//============================================================================
-/*! Function : URL
- * Purpose : set URL of the study (persistent reference of the study)
- */
-//============================================================================
-void SALOMEDS_Study_i::URL(const char* url)
-{
- SALOMEDS::Locker lock;
- _impl->URL(string((char*)url));
-}
-
-
-CORBA::Short SALOMEDS_Study_i::StudyId()
-{
- SALOMEDS::Locker lock;
- return _impl->StudyId();
-}
-
-void SALOMEDS_Study_i::StudyId(CORBA::Short id)
-{
- SALOMEDS::Locker lock;
- _impl->StudyId(id);
-}
-
-void SALOMEDS_Study_i::UpdateIORLabelMap(const char* anIOR,const char* anEntry)
-{
- SALOMEDS::Locker lock;
- _impl->UpdateIORLabelMap(string((char*)anIOR), string((char*)anEntry));
-}
-
-SALOMEDS::Study_ptr SALOMEDS_Study_i::GetStudy(const DF_Label& theLabel, CORBA::ORB_ptr orb)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_AttributeIOR* Att = NULL;
- if ((Att=(SALOMEDSImpl_AttributeIOR*)theLabel.Root().FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))){
- char* IOR = CORBA::string_dup(Att->Value().c_str());
- CORBA::Object_var obj = orb->string_to_object(IOR);
- SALOMEDS::Study_ptr aStudy = SALOMEDS::Study::_narrow(obj) ;
- ASSERT(!CORBA::is_nil(aStudy));
- return SALOMEDS::Study::_duplicate(aStudy);
- } else {
- MESSAGE("GetStudy: Problem to get study");
- }
- return SALOMEDS::Study::_nil();
-}
-
-void SALOMEDS_Study_i::IORUpdated(SALOMEDSImpl_AttributeIOR* theAttribute)
-{
- SALOMEDS::Locker lock;
- SALOMEDSImpl_Study::IORUpdated(theAttribute);
-}
-
-SALOMEDS::Study::ListOfSObject* SALOMEDS_Study_i::FindDependances(SALOMEDS::SObject_ptr anObject)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDS::GenericAttribute_ptr aTarget;
- if (anObject->FindAttribute(aTarget,"AttributeTarget")) {
- return SALOMEDS::AttributeTarget::_narrow(aTarget)->Get();
- }
- SALOMEDS::Study::ListOfSObject* aList = new SALOMEDS::Study::ListOfSObject;
- aList->length(0);
- return aList;
-}
-
-
-SALOMEDS::AttributeStudyProperties_ptr SALOMEDS_Study_i::GetProperties()
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_AttributeStudyProperties* anAttr = _impl->GetProperties();
- SALOMEDS_AttributeStudyProperties_i* SP = new SALOMEDS_AttributeStudyProperties_i(anAttr, _orb);
- return SP->AttributeStudyProperties::_this();
-}
-
-char* SALOMEDS_Study_i::GetLastModificationDate()
-{
- SALOMEDS::Locker lock;
- return CORBA::string_dup(_impl->GetLastModificationDate().c_str());
-}
-
-SALOMEDS::ListOfDates* SALOMEDS_Study_i::GetModificationsDate()
-{
- SALOMEDS::Locker lock;
-
- vector<string> aSeq = _impl->GetModificationsDate();
- int aLength = aSeq.size();
- SALOMEDS::ListOfDates_var aDates = new SALOMEDS::ListOfDates;
- aDates->length(aLength);
-
- for(int anIndex = 0; anIndex < aLength; anIndex++) {
- aDates[anIndex] = CORBA::string_dup(aSeq[anIndex].c_str());
- }
- return aDates._retn();
-}
-
-
-
-//============================================================================
-/*! Function : GetUseCaseBuilder
- * Purpose : Returns a UseCase builder
- */
-//============================================================================
-SALOMEDS::UseCaseBuilder_ptr SALOMEDS_Study_i::GetUseCaseBuilder()
-{
- SALOMEDS::Locker lock;
- SALOMEDS_UseCaseBuilder_i* UCBuilder = new SALOMEDS_UseCaseBuilder_i(_impl->GetUseCaseBuilder(), _orb);
- return UCBuilder->_this();
-}
-
-
-//============================================================================
-/*! Function : Close
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_Study_i::Close()
-{
- SALOMEDS::Locker lock;
-
- RemovePostponed(-1);
-
- SALOMEDS::SComponentIterator_var itcomponent = NewComponentIterator();
- for (; itcomponent->More(); itcomponent->Next()) {
- SALOMEDS::SComponent_var sco = itcomponent->Value();
- MESSAGE ( "Look for an engine for data type :"<< sco->ComponentDataType());
- // if there is an associated Engine call its method for closing
- CORBA::String_var IOREngine;
- if (sco->ComponentIOR(IOREngine)) {
- // we have found the associated engine to write the data
- MESSAGE ( "We have found an engine for data type :"<< sco->ComponentDataType());
- //_narrow can throw a corba exception
- try
- {
- CORBA::Object_var obj = _orb->string_to_object(IOREngine);
- if (!CORBA::is_nil(obj))
- {
- SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_narrow(obj) ;
- if (!anEngine->_is_nil())
- {
- SALOMEDS::unlock();
- anEngine->Close(sco);
- SALOMEDS::lock();
- }
- }
- }
- catch (CORBA::Exception&)
- {/*pass*/ }
- }
- }
-
- _impl->Close();
-}
-
-//============================================================================
-/*! Function : AddPostponed
- * Purpose :
- */
- //============================================================================
-void SALOMEDS_Study_i::AddPostponed(const char* theIOR)
-{
- SALOMEDS::Locker lock;
- //Not implemented
-}
-
-void SALOMEDS_Study_i::AddCreatedPostponed(const char* theIOR)
-{
- SALOMEDS::Locker lock;
- //Not implemented
-}
-
-//============================================================================
-/*! Function : RemovePostponed
- * Purpose :
- */
-//============================================================================
-#ifndef WIN32
-void SALOMEDS_Study_i::RemovePostponed(const CORBA::Long /*theUndoLimit*/)
-#else
-void SALOMEDS_Study_i::RemovePostponed(CORBA::Long /*theUndoLimit*/)
-#endif
-{
- SALOMEDS::Locker lock;
-
- vector<string> anIORs = _impl->GetIORs();
- int i, aSize = (int)anIORs.size();
-
- for(i = 0; i < aSize; i++) {
- try {
- CORBA::Object_var obj = _orb->string_to_object(anIORs[i].c_str());
- SALOME::GenericObj_var aGeneric = SALOME::GenericObj::_narrow(obj);
- if (!CORBA::is_nil(aGeneric)) aGeneric->Destroy();
- } catch (...) {}
- }
-
- //Not implemented
-}
-
-//============================================================================
-/*! Function : UndoPostponed
- * Purpose :
- */
-//============================================================================
-#ifndef WIN32
-void SALOMEDS_Study_i::UndoPostponed(const CORBA::Long theWay)
-#else
-void SALOMEDS_Study_i::UndoPostponed(CORBA::Long theWay)
-#endif
-{
- SALOMEDS::Locker lock;
- //Not implemented
-}
-
-
-//============================================================================
-/*! Function : DumpStudy
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_Study_i::DumpStudy(const char* thePath,
- const char* theBaseName,
- CORBA::Boolean isPublished)
-{
- SALOMEDS::Locker lock;
-
- string aPath((char*)thePath), aBaseName((char*)theBaseName);
- SALOMEDS_DriverFactory_i* factory = new SALOMEDS_DriverFactory_i(_orb);
- CORBA::Boolean ret = _impl->DumpStudy(aPath, aBaseName, isPublished, factory);
- delete factory;
- return ret;
-}
-
-//============================================================================
-/*! Function : GetCommonParameters
- * Purpose :
- */
-//============================================================================
-SALOMEDS::AttributeParameter_ptr SALOMEDS_Study_i::GetCommonParameters(const char* theID, CORBA::Long theSavePoint)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_AttributeParameter* anAttr = _impl->GetCommonParameters(theID, theSavePoint);
- SALOMEDS_AttributeParameter_i* SP = new SALOMEDS_AttributeParameter_i(anAttr, _orb);
- return SP->AttributeParameter::_this();
-}
-
-//============================================================================
-/*! Function : GetCommonModuleParameters
- * Purpose :
- */
-//============================================================================
-SALOMEDS::AttributeParameter_ptr SALOMEDS_Study_i::GetModuleParameters(const char* theID,
- const char* theModuleName,
- CORBA::Long theSavePoint)
-{
- SALOMEDS::Locker lock;
-
- SALOMEDSImpl_AttributeParameter* anAttr = _impl->GetModuleParameters(theID, theModuleName, theSavePoint);
- SALOMEDS_AttributeParameter_i* SP = new SALOMEDS_AttributeParameter_i(anAttr, _orb);
- return SP->AttributeParameter::_this();
-}
-
-//============================================================================
-/*! Function : SetStudyLock
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_Study_i::SetStudyLock(const char* theLockerID)
-{
- SALOMEDS::Locker lock;
- _impl->SetStudyLock(theLockerID);
-}
-
-//============================================================================
-/*! Function : IsStudyLocked
- * Purpose :
- */
-//============================================================================
-bool SALOMEDS_Study_i::IsStudyLocked()
-{
- SALOMEDS::Locker lock;
- return _impl->IsStudyLocked();
-}
-
-//============================================================================
-/*! Function : UnLockStudy
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_Study_i::UnLockStudy(const char* theLockerID)
-{
- SALOMEDS::Locker lock;
- _impl->UnLockStudy(theLockerID);
-}
-
-//============================================================================
-/*! Function : GetLockerID
- * Purpose :
- */
-//============================================================================
-SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetLockerID()
-{
- SALOMEDS::Locker lock;
-
- SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
-
- vector<string> aSeq = _impl->GetLockerID();
-
- int aLength = aSeq.size();
- aResult->length(aLength);
- for(int anIndex = 0; anIndex < aLength; anIndex++) {
- aResult[anIndex] = CORBA::string_dup(aSeq[anIndex].c_str());
- }
- return aResult._retn();
-}
-//============================================================================
-/*! Function : SetReal
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_Study_i::SetReal(const char* theVarName, CORBA::Double theValue)
-{
- _impl->SetVariable(string(theVarName),
- theValue,
- SALOMEDSImpl_GenericVariable::REAL_VAR);
-}
-
-//============================================================================
-/*! Function : SetInteger
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_Study_i::SetInteger(const char* theVarName, CORBA::Long theValue)
-{
- _impl->SetVariable(string(theVarName),
- theValue,
- SALOMEDSImpl_GenericVariable::INTEGER_VAR);
-}
-
-//============================================================================
-/*! Function : SetBoolean
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_Study_i::SetBoolean(const char* theVarName, CORBA::Boolean theValue)
-{
- _impl->SetVariable(string(theVarName),
- theValue,
- SALOMEDSImpl_GenericVariable::BOOLEAN_VAR);
-}
-
-//============================================================================
-/*! Function : GetReal
- * Purpose :
- */
-//============================================================================
-CORBA::Double SALOMEDS_Study_i::GetReal(const char* theVarName)
-{
- return _impl->GetVariableValue(string(theVarName));
-}
-
-//============================================================================
-/*! Function : GetInteger
- * Purpose :
- */
-//============================================================================
-CORBA::Long SALOMEDS_Study_i::GetInteger(const char* theVarName)
-{
- return (int)_impl->GetVariableValue(string(theVarName));
-}
-
-//============================================================================
-/*! Function : GetBoolean
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_Study_i::GetBoolean(const char* theVarName)
-{
- return (bool)_impl->GetVariableValue(string(theVarName));
-}
-
-//============================================================================
-/*! Function : IsReal
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_Study_i::IsReal(const char* theVarName)
-{
- return _impl->IsTypeOf(string(theVarName),
- SALOMEDSImpl_GenericVariable::REAL_VAR);
-}
-
-//============================================================================
-/*! Function : IsInteger
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_Study_i::IsInteger(const char* theVarName)
-{
- return _impl->IsTypeOf(string(theVarName),
- SALOMEDSImpl_GenericVariable::INTEGER_VAR);
-}
-
-//============================================================================
-/*! Function : IsBoolean
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_Study_i::IsBoolean(const char* theVarName)
-{
- return _impl->IsTypeOf(string(theVarName),
- SALOMEDSImpl_GenericVariable::BOOLEAN_VAR);
-}
-
-//============================================================================
-/*! Function : IsVariable
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_Study_i::IsVariable(const char* theVarName)
-{
- return _impl->IsVariable(string(theVarName));
-}
-
-//============================================================================
-/*! Function : GetVariableNames
- * Purpose :
- */
-//============================================================================
-SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetVariableNames()
-{
- vector<string> aVarNames = _impl->GetVariableNames();
- SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
-
- int aLen = aVarNames.size();
- aResult->length(aLen);
-
- for (int anInd = 0; anInd < aLen; anInd++)
- aResult[anInd] = CORBA::string_dup(aVarNames[anInd].c_str());
-
- return aResult._retn();
-}
-
-//============================================================================
-/*! Function : RemoveVariable
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_Study_i::RemoveVariable(const char* theVarName)
-{
- return _impl->RemoveVariable(string(theVarName));
-}
-
-//============================================================================
-/*! Function : RenameVariable
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_Study_i::RenameVariable(const char* theVarName, const char* theNewVarName)
-{
- return _impl->RenameVariable(string(theVarName), string(theNewVarName));
-}
-
-//============================================================================
-/*! Function : IsVariableUsed
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_Study_i::IsVariableUsed(const char* theVarName)
-{
- return _impl->IsVariableUsed(string(theVarName));
-}
-
-
-//============================================================================
-/*! Function : ParseVariables
- * Purpose :
- */
-//============================================================================
-SALOMEDS::ListOfListOfStrings* SALOMEDS_Study_i::ParseVariables(const char* theVarName)
-{
- vector< vector<string> > aSections = _impl->ParseVariables(string(theVarName));
-
- SALOMEDS::ListOfListOfStrings_var aResult = new SALOMEDS::ListOfListOfStrings;
-
- int aSectionsLen = aSections.size();
- aResult->length(aSectionsLen);
-
- for (int aSectionInd = 0; aSectionInd < aSectionsLen; aSectionInd++) {
- vector<string> aVarNames = aSections[aSectionInd];
-
- SALOMEDS::ListOfStrings_var aList = new SALOMEDS::ListOfStrings;
-
- int aLen = aVarNames.size();
- aList->length(aLen);
-
- for (int anInd = 0; anInd < aLen; anInd++)
- aList[anInd] = CORBA::string_dup(aVarNames[anInd].c_str());
-
- aResult[aSectionInd] = aList;
- }
-
- return aResult._retn();
-}
-
-//============================================================================
-/*! Function : GetDefaultScript
- * Purpose :
- */
-//============================================================================
-char* SALOMEDS_Study_i::GetDefaultScript(const char* theModuleName, const char* theShift)
-{
- SALOMEDS::Locker lock;
-
- string script = SALOMEDSImpl_IParameters::getDefaultScript(_impl, theModuleName, theShift);
- return CORBA::string_dup(script.c_str());
-}
-
-//============================================================================
-/*! Function : EnableUseCaseAutoFilling
- * Purpose :
- */
-//============================================================================
-void SALOMEDS_Study_i::EnableUseCaseAutoFilling(CORBA::Boolean isEnabled)
-{
- _impl->EnableUseCaseAutoFilling(isEnabled);
- SALOMEDSImpl_StudyBuilder* builder = _builder->GetImpl();
- if(builder) {
- if(isEnabled) {
- builder->SetOnAddSObject(_impl->GetCallback());
- builder->SetOnRemoveSObject(_impl->GetCallback());
- }
- else {
- builder->SetOnAddSObject(NULL);
- builder->SetOnRemoveSObject(NULL);
- }
- }
-}
-
-//===========================================================================
-// PRIVATE FUNCTIONS
-//===========================================================================
-CORBA::LongLong SALOMEDS_Study_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
-{
-#ifdef WIN32
- long pid = (long)_getpid();
-#else
- long pid = (long)getpid();
-#endif
- isLocal = (strcmp(theHostname, Kernel_Utils::GetHostname().c_str()) == 0 && pid == thePID)?1:0;
- return reinterpret_cast<CORBA::LongLong>(_impl);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_Study_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_STUDY_I_H__
-#define __SALOMEDS_STUDY_I_H__
-
-// std C++ headers
-#include <iostream>
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOME_GenericObj)
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-#include <stdio.h>
-
-//SALOMEDS headers
-#include "SALOMEDS_SComponentIterator_i.hxx"
-#include "SALOMEDS_StudyBuilder_i.hxx"
-#include "SALOMEDS_SObject_i.hxx"
-#include "SALOMEDS_UseCaseBuilder_i.hxx"
-
-#include "SALOMEDSImpl_Study.hxx"
-#include "SALOMEDSImpl_AttributeIOR.hxx"
-
-class Standard_EXPORT SALOMEDS_Study_i: public POA_SALOMEDS::Study
-{
-private:
- CORBA::ORB_ptr _orb;
- SALOMEDSImpl_Study* _impl;
- SALOMEDS_StudyBuilder_i* _builder;
-
-public:
-
- //! standard constructor
- SALOMEDS_Study_i(SALOMEDSImpl_Study*, CORBA::ORB_ptr);
-
- //! standard destructor
- virtual ~SALOMEDS_Study_i();
-
- //! method to Get persistent reference of study (idem URL())
- /*!
- \sa URL()
- \return char* arguments, the persistent reference of the study
- */
- virtual char* GetPersistentReference();
-
-
- //! method to Get transient reference of study
- /*!
- \return char* arguments, the transient reference of the study
- */
- virtual char* GetTransientReference();
-
- //! method to detect if a study is empty
- /*!
- \return bool arguments, true if study is empty
- */
- virtual CORBA::Boolean IsEmpty();
-
- //! method to Find a Component with ComponentDataType = aComponentName
- /*!
- \param aComponentName char* arguments
- \return SComponent_ptr arguments, the component found
- */
- virtual SALOMEDS::SComponent_ptr FindComponent (const char* aComponentName);
-
- //! method to Find a Component Find a Component from it's ID
- /*!
- \param aComponentID char* arguments
- \return SComponent_ptr arguments, the component found
- */
- virtual SALOMEDS::SComponent_ptr FindComponentID(const char* aComponentID);
-
- //! method to Find an Object with SALOMEDS::Name = anObjectName
- /*!
- \param anObjectName char* arguments
- \return SObject_ptr arguments, the object found
- */
- virtual SALOMEDS::SObject_ptr FindObject(const char* anObjectName);
-
-
- //! method to Find Object(s) with SALOMEDS::Name = anObjectName in a component with ComponentDataType = aComponentName
- /*!
- \param anObjectName char* arguments
- \param aComponentName char* arguments
- \return ListOfSObject_ptr arguments, a list of objects found
- */
-
- virtual SALOMEDS::Study::ListOfSObject* FindObjectByName( const char* anObjectName, const char* aComponentName ) ;
-
- //! method to Find an Object with ID = anObjectID
- /*!
- \param anObjectID char* arguments
- \return SObject_ptr arguments, the object found
- */
- virtual SALOMEDS::SObject_ptr FindObjectID(const char* anObjectID);
-
- //! method to Create an Object with ID = anObjectID
- /*!
- \param anObjectID char* arguments
- \return SObject_ptr arguments, the object found
- */
- virtual SALOMEDS::SObject_ptr CreateObjectID(const char* anObjectID);
-
- //! method to Find an Object with ID = anObjectIOR
- /*!
- \param anObjectIOR char* arguments
- \return SObject_ptr arguments, the object found
- */
- virtual SALOMEDS::SObject_ptr FindObjectIOR(const char* anObjectIOR);
-
- //! method to Find an Object by its path
- /*!
- \param thePath char* arguments
- \return SObject_ptr arguments, the object found
- */
- virtual SALOMEDS::SObject_ptr FindObjectByPath(const char* thePath);
-
- //! method to get a path of SObject
- /*!
- \param aSO SObject_ptr arguments
- \return char* arguments, the path of the SObject
- */
- virtual char* GetObjectPath(CORBA::Object_ptr theObject);
-
- //! method to set a context: root ('/') is UserData component
- /*!
- */
- virtual void SetContext(const char* thePath);
-
- //! method to get a context
- /*!
- */
- virtual char* GetContext();
-
- //! method to get all object names in the given context (or in the current context, if 'theContext' is empty)
- /*!
- */
- virtual SALOMEDS::ListOfStrings* GetObjectNames(const char* theContext);
-
- //! method to get all directory names in the given context (or in the current context, if 'theContext' is empty)
- /*!
- */
- virtual SALOMEDS::ListOfStrings* GetDirectoryNames(const char* theContext);
-
- //! method to get all file names in the given context (or in the current context, if 'theContext' is empty)
- /*!
- */
- virtual SALOMEDS::ListOfStrings* GetFileNames(const char* theContext);
-
- //! method to get all components names
- /*!
- */
- virtual SALOMEDS::ListOfStrings* GetComponentNames(const char* theContext);
-
- //! method to Create a ChildIterator from an SObject
- /*!
- \param aSO SObject_ptr arguments
- \return ChildIterator_ptr arguments, the created ChildIterator
- */
- virtual SALOMEDS::ChildIterator_ptr NewChildIterator(SALOMEDS::SObject_ptr aSO);
-
- //! method to Create a SComponentIterator
- /*!
- \return SComponentIterator_ptr arguments, the created SComponentIterator
- */
- virtual SALOMEDS::SComponentIterator_ptr NewComponentIterator();
-
- //! method to Create a StudyBuilder
- /*!
- \return StudyBuilder_ptr arguments, the created StudyBuilder
- */
- virtual SALOMEDS::StudyBuilder_ptr NewBuilder();
-
- //! method to get study name
- /*!
- \return char* arguments, the study name
- */
- virtual char* Name();
-
- //! method to set study name
- /*!
- \param name char* arguments, the study name
- */
- virtual void Name(const char* name);
-
- //! method to get if study has been saved
- /*!
- \return bool arguments
- */
- virtual CORBA::Boolean IsSaved();
-
- //! method to set if study has been saved
- /*!
- \param save bool arguments
- */
- virtual void IsSaved(CORBA::Boolean save);
-
- //! method to Detect if a Study has been modified since it has been saved
- /*!
- \return bool arguments
- */
- virtual CORBA::Boolean IsModified();
-
- //! method to set Modified flag of a Study to True
- virtual void Modified();
-
- //! method to get URL of the study (idem GetPersistentReference)
- /*!
- \return char* arguments, the study URL
- */
- virtual char* URL();
-
- //! method to set URL of the study
- /*!
- \param url char* arguments, the study URL
- */
- virtual void URL(const char* url);
-
- virtual CORBA::Short StudyId();
- virtual void StudyId(CORBA::Short id);
-
- static SALOMEDS::Study_ptr GetStudy(const DF_Label& theLabel, CORBA::ORB_ptr orb);
-
- static void IORUpdated(SALOMEDSImpl_AttributeIOR* theAttribute);
-
- virtual void UpdateIORLabelMap(const char* anIOR, const char* aLabel);
-
- virtual SALOMEDS::Study::ListOfSObject* FindDependances(SALOMEDS::SObject_ptr anObject);
-
- virtual SALOMEDS::AttributeStudyProperties_ptr GetProperties();
-
- virtual char* GetLastModificationDate();
-
- virtual SALOMEDS::ListOfDates* GetModificationsDate();
-
- virtual char* ConvertObjectToIOR(CORBA::Object_ptr theObject) {return _orb->object_to_string(theObject); }
- virtual CORBA::Object_ptr ConvertIORToObject(const char* theIOR) { return _orb->string_to_object(theIOR); };
-
- virtual SALOMEDS::UseCaseBuilder_ptr GetUseCaseBuilder();
-
- virtual void Close();
-
- void EnableUseCaseAutoFilling(CORBA::Boolean isEnabled);
-
- // postponed destroying of CORBA object functionality
- virtual void AddPostponed(const char* theIOR);
-
- virtual void AddCreatedPostponed(const char* theIOR);
-
-#ifndef WIN32
- virtual void RemovePostponed(const CORBA::Long theUndoLimit); // removes postponed IORs of old transaction
- // if theUndoLimit==0, removes all
- virtual void UndoPostponed(const CORBA::Long theWay); // theWay = 1: resurrect objects,
- // theWay = -1: get back to the list of postponed
-#else
- virtual void RemovePostponed(CORBA::Long theUndoLimit); // removes postponed IORs of old transaction
- // if theUndoLimit==0, removes all
- virtual void UndoPostponed(CORBA::Long theWay); // theWay = 1: resurrect objects,
- // theWay = -1: get back to the list of postponed
-#endif
-
- virtual SALOMEDS::AttributeParameter_ptr GetCommonParameters(const char* theID, CORBA::Long theSavePoint);
- virtual SALOMEDS::AttributeParameter_ptr GetModuleParameters(const char* theID,
- const char* theModuleName,
- CORBA::Long theSavePoint);
-
- virtual void SetStudyLock(const char* theLockerID);
-
- virtual bool IsStudyLocked();
-
- virtual void UnLockStudy(const char* theLockerID);
-
- virtual SALOMEDS::ListOfStrings* GetLockerID();
-
- virtual void SetReal(const char* theVarName, CORBA::Double theValue);
-
- virtual void SetInteger(const char* theVarName, CORBA::Long theValue);
-
- virtual void SetBoolean(const char* theVarName, CORBA::Boolean theValue);
-
- virtual CORBA::Double GetReal(const char* theVarName);
-
- virtual CORBA::Long GetInteger(const char* theVarName);
-
- virtual CORBA::Boolean GetBoolean(const char* theVarName);
-
- virtual CORBA::Boolean IsReal(const char* theVarName);
-
- virtual CORBA::Boolean IsInteger(const char* theVarName);
-
- virtual CORBA::Boolean IsBoolean(const char* theVarName);
-
- virtual CORBA::Boolean IsVariable(const char* theVarName);
-
- virtual SALOMEDS::ListOfStrings* GetVariableNames();
-
- virtual CORBA::Boolean RemoveVariable(const char* theVarName);
-
- virtual CORBA::Boolean RenameVariable(const char* theVarName, const char* theNewVarName);
-
- virtual CORBA::Boolean IsVariableUsed(const char* theVarName);
-
- virtual SALOMEDS::ListOfListOfStrings* ParseVariables(const char* theVars);
-
- virtual char* GetDefaultScript(const char* theModuleName, const char* theShift);
-
- virtual CORBA::Boolean DumpStudy(const char* thePath, const char* theBaseName, CORBA::Boolean isPublished);
-
- virtual SALOMEDSImpl_Study* GetImpl() { return _impl; }
-
- virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDSImpl_SObject.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_TMPFile_i.hxx"
-
-#include <stdexcept>
-
-SALOMEDS_TMPFile_i
-::SALOMEDS_TMPFile_i(SALOMEDS::TMPFile* theStream):
- myStream(theStream)
-{}
-
-size_t
-SALOMEDS_TMPFile_i
-::Size()
-{
- if(!&myStream.in())
- return 0;
-
- return myStream->length();
-}
-
-SALOMEDSImpl_TMPFile::TOctet&
-SALOMEDS_TMPFile_i
-::Get(size_t theIndex)
-{
- if(!&myStream.in())
- throw std::out_of_range("SALOMEDS_TMPFile_i::Get(size_t) const - !&myStream.in()");
-
- if(theIndex < 0 || theIndex >= myStream->length())
- throw std::out_of_range("SALOMEDS_TMPFile_i::Get(size_t) const - theIndex < 0 || theIndex >= myStream->length()");
-
- return myStream[theIndex];
-}
-
-
-//-----------------------------------------------------------------------------
-Engines_TMPFile_i
-::Engines_TMPFile_i(Engines::TMPFile* theStream):
- myStream(theStream)
-{}
-
-size_t
-Engines_TMPFile_i
-::Size()
-{
- if(!&myStream.in())
- return 0;
-
- return myStream->length();
-}
-
-SALOMEDSImpl_TMPFile::TOctet&
-Engines_TMPFile_i
-::Get(size_t theIndex)
-{
- if(!&myStream.in())
- throw std::out_of_range("Engines_TMPFile_i::Get(size_t) const - !&myStream.in()");
-
- if(theIndex < 0 || theIndex >= myStream->length())
- throw std::out_of_range("Engines_TMPFile_i::Get(size_t) const - theIndex < 0 || theIndex >= myStream->length()");
-
- return myStream[theIndex];
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef __SALOMEDSIMPL_TMPFILE_I_H__
-#define __SALOMEDSIMPL_TMPFILE_I_H__
-
-// IDL headers
-#include "SALOMEconfig.h"
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOME_Component)
-
-#include "SALOMEDSImpl_TMPFile.hxx"
-
-
-//-----------------------------------------------------------------------------
-
-class SALOMEDS_TMPFile_i : public SALOMEDSImpl_TMPFile
-{
-public:
- SALOMEDS_TMPFile_i(SALOMEDS::TMPFile* theStream);
-
- virtual size_t Size();
-
- virtual TOctet& Get(size_t);
-
-protected:
- SALOMEDS::TMPFile_var myStream;
-};
-
-
-//-----------------------------------------------------------------------------
-
-class Engines_TMPFile_i : public SALOMEDSImpl_TMPFile
-{
-public:
- Engines_TMPFile_i(Engines::TMPFile* theStream);
-
- virtual size_t Size();
-
- virtual TOctet& Get(size_t);
-
-protected:
- Engines::TMPFile_var myStream;
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_UseCaseBuilder.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_UseCaseBuilder.hxx"
-
-#include "SALOMEDS.hxx"
-#include "SALOMEDS_SObject.hxx"
-#include "SALOMEDS_UseCaseIterator.hxx"
-
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_UseCaseIterator.hxx"
-
-#include <string>
-
-using namespace std;
-
-SALOMEDS_UseCaseBuilder::SALOMEDS_UseCaseBuilder(SALOMEDSImpl_UseCaseBuilder* theBuilder)
-{
- _isLocal = true;
- _local_impl = theBuilder;
- _corba_impl = SALOMEDS::UseCaseBuilder::_nil();
-}
-
-SALOMEDS_UseCaseBuilder::SALOMEDS_UseCaseBuilder(SALOMEDS::UseCaseBuilder_ptr theBuilder)
-{
- _isLocal = false;
- _local_impl = NULL;
- _corba_impl = SALOMEDS::UseCaseBuilder::_duplicate(theBuilder);
-}
-
-SALOMEDS_UseCaseBuilder::~SALOMEDS_UseCaseBuilder()
-{
- if(!_isLocal) _corba_impl->Destroy();
-}
-
-bool SALOMEDS_UseCaseBuilder::Append(const _PTR(SObject)& theObject)
-{
- bool ret;
- SALOMEDS_SObject* obj = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->Append(*(obj->GetLocalImpl()));
- }
- else ret = _corba_impl->Append(obj->GetCORBAImpl());
- return ret;
-}
-
-bool SALOMEDS_UseCaseBuilder::Remove(const _PTR(SObject)& theObject)
-{
- bool ret;
- SALOMEDS_SObject* obj = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->Remove(*(obj->GetLocalImpl()));
- }
- else ret = _corba_impl->Remove(obj->GetCORBAImpl());
- return ret;
-}
-
-bool SALOMEDS_UseCaseBuilder::AppendTo(const _PTR(SObject)& theFather, _PTR(SObject) theObject)
-{
- bool ret;
- SALOMEDS_SObject* father = dynamic_cast<SALOMEDS_SObject*>(theFather.get());
- SALOMEDS_SObject* obj = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->AppendTo(*(father->GetLocalImpl()), *(obj->GetLocalImpl()));
- }
- else ret = _corba_impl->AppendTo(father->GetCORBAImpl(), obj->GetCORBAImpl());
- return ret;
-}
-
-bool SALOMEDS_UseCaseBuilder::InsertBefore(const _PTR(SObject)& theFirst, _PTR(SObject) theNext)
-{
- bool ret;
- SALOMEDS_SObject* first = dynamic_cast<SALOMEDS_SObject*>(theFirst.get());
- SALOMEDS_SObject* next = dynamic_cast<SALOMEDS_SObject*>(theNext.get());
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->InsertBefore(*(first->GetLocalImpl()), *(next->GetLocalImpl()));
- }
- else ret = _corba_impl->InsertBefore(first->GetCORBAImpl(), next->GetCORBAImpl());
- return ret;
-}
-
-bool SALOMEDS_UseCaseBuilder::SetCurrentObject(const _PTR(SObject)& theObject)
-{
- bool ret;
- SALOMEDS_SObject* obj = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->SetCurrentObject(*(obj->GetLocalImpl()));
- }
- else ret = _corba_impl->SetCurrentObject(obj->GetCORBAImpl());
- return ret;
-}
-
-bool SALOMEDS_UseCaseBuilder::SetRootCurrent()
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->SetRootCurrent();
- }
- else ret = _corba_impl->SetRootCurrent();
- return ret;
-}
-
-bool SALOMEDS_UseCaseBuilder::HasChildren(const _PTR(SObject)& theObject)
-{
- bool ret;
- SALOMEDS_SObject* obj = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->HasChildren(*(obj->GetLocalImpl()));
- }
- else ret = _corba_impl->HasChildren(obj->GetCORBAImpl());
- return ret;
-}
-
-bool SALOMEDS_UseCaseBuilder::IsUseCase(const _PTR(SObject)& theObject)
-{
- bool ret;
- SALOMEDS_SObject* obj = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->IsUseCase(*(obj->GetLocalImpl()));
- }
- else ret = _corba_impl->IsUseCase(obj->GetCORBAImpl());
- return ret;
-}
-
-bool SALOMEDS_UseCaseBuilder::SetName(const std::string& theName)
-{
- bool ret;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- ret = _local_impl->SetName(theName);
- }
- else ret = _corba_impl->SetName((char*)theName.c_str());
- return ret;
-}
-
-_PTR(SObject) SALOMEDS_UseCaseBuilder::GetCurrentObject()
-{
- SALOMEDS_SObject* obj = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- obj = new SALOMEDS_SObject(_local_impl->GetCurrentObject());
- }
- else obj = new SALOMEDS_SObject(_corba_impl->GetCurrentObject());
- return _PTR(SObject)(obj);
-}
-
-std::string SALOMEDS_UseCaseBuilder::GetName()
-{
- std::string aName;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- aName = _local_impl->GetName();
- }
- else aName = _corba_impl->GetName();
- return aName;
-}
-
-_PTR(SObject) SALOMEDS_UseCaseBuilder::AddUseCase(const std::string& theName)
-{
- SALOMEDS_SObject* obj = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- obj = new SALOMEDS_SObject(_local_impl->AddUseCase(theName));
- }
- else obj = new SALOMEDS_SObject(_corba_impl->AddUseCase((char*)theName.c_str()));
- return _PTR(SObject)(obj);
-}
-
-_PTR(UseCaseIterator) SALOMEDS_UseCaseBuilder::GetUseCaseIterator(const _PTR(SObject)& theObject)
-{
- SALOMEDS_UseCaseIterator* it = NULL;
- SALOMEDS_SObject* obj = (theObject)?dynamic_cast<SALOMEDS_SObject*>(theObject.get()):NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- if(obj)
- it = new SALOMEDS_UseCaseIterator(_local_impl->GetUseCaseIterator(*(obj->GetLocalImpl())));
- else
- it = new SALOMEDS_UseCaseIterator(_local_impl->GetUseCaseIterator(SALOMEDSImpl_SObject()));
- }
- else {
- if(obj)
- it = new SALOMEDS_UseCaseIterator(_corba_impl->GetUseCaseIterator(obj->GetCORBAImpl()));
- else
- it = new SALOMEDS_UseCaseIterator(_corba_impl->GetUseCaseIterator(SALOMEDS::SObject::_nil()));
- }
- return _PTR(UseCaseIterator)(it);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_UseCaseBuilder.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_USECaseBuilder_H__
-#define __SALOMEDS_USECaseBuilder_H__
-
-#include "SALOMEDSClient.hxx"
-#include "SALOMEDSImpl_UseCaseBuilder.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-class SALOMEDS_UseCaseBuilder: public SALOMEDSClient_UseCaseBuilder
-{
-
-private:
- bool _isLocal;
- SALOMEDSImpl_UseCaseBuilder* _local_impl;
- SALOMEDS::UseCaseBuilder_var _corba_impl;
-
-public:
-
- SALOMEDS_UseCaseBuilder(SALOMEDSImpl_UseCaseBuilder* theBuilder);
- SALOMEDS_UseCaseBuilder(SALOMEDS::UseCaseBuilder_ptr theBuilder);
- ~SALOMEDS_UseCaseBuilder();
-
- virtual bool Append(const _PTR(SObject)& theObject);
- virtual bool Remove(const _PTR(SObject)& theObject);
- virtual bool AppendTo(const _PTR(SObject)& theFather, _PTR(SObject) theObject);
- virtual bool InsertBefore(const _PTR(SObject)& theFirst, _PTR(SObject) theNext);
- virtual bool SetCurrentObject(const _PTR(SObject)& theObject);
- virtual bool SetRootCurrent();
- virtual bool HasChildren(const _PTR(SObject)& theObject);
- virtual bool IsUseCase(const _PTR(SObject)& theObject);
- virtual bool SetName(const std::string& theName);
- virtual _PTR(SObject) GetCurrentObject();
- virtual std::string GetName();
- virtual _PTR(SObject) AddUseCase(const std::string& theName);
- virtual _PTR(UseCaseIterator) GetUseCaseIterator(const _PTR(SObject)& anObject);
-
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_UseCaseBuilder_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_UseCaseBuilder_i.hxx"
-#include "SALOMEDS_UseCaseIterator_i.hxx"
-#include "SALOMEDS_SObject_i.hxx"
-#include "SALOMEDS.hxx"
-
-#include "utilities.h"
-
-using namespace std;
-
-//============================================================================
-/*! Function : constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDS_UseCaseBuilder_i::SALOMEDS_UseCaseBuilder_i(SALOMEDSImpl_UseCaseBuilder* theImpl,
- CORBA::ORB_ptr orb)
-{
- _orb = CORBA::ORB::_duplicate(orb);
- _impl = theImpl;
-}
-
-//============================================================================
-/*! Function : destructor
- * Purpose :
- */
-//============================================================================
-SALOMEDS_UseCaseBuilder_i::~SALOMEDS_UseCaseBuilder_i()
-{
-}
-
-
-//============================================================================
-/*! Function : Append
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_UseCaseBuilder_i::Append(SALOMEDS::SObject_ptr theObject)
-{
- SALOMEDS::Locker lock;
- if(!_impl || theObject->_is_nil()) return 0;
- return _impl->Append(_impl->GetSObject(theObject->GetID()));
-}
-
- //============================================================================
-/*! Function : Remove
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_UseCaseBuilder_i::Remove(SALOMEDS::SObject_ptr theObject)
-{
- SALOMEDS::Locker lock;
- if(!_impl || theObject->_is_nil()) return 0;
- return _impl->Remove(_impl->GetSObject(theObject->GetID()));
-}
-
-
-//============================================================================
-/*! Function : AppendTo
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_UseCaseBuilder_i::AppendTo(SALOMEDS::SObject_ptr theFather,
- SALOMEDS::SObject_ptr theObject)
-{
- SALOMEDS::Locker lock;
- if(!_impl || theFather->_is_nil() || theObject->_is_nil()) return 0;
- return _impl->AppendTo(_impl->GetSObject(theFather->GetID()), _impl->GetSObject(theObject->GetID()));
-}
-
-//============================================================================
-/*! Function : InsertBefore
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_UseCaseBuilder_i::InsertBefore(SALOMEDS::SObject_ptr theFirst,
- SALOMEDS::SObject_ptr theNext)
-{
- SALOMEDS::Locker lock;
- if(!_impl || theFirst->_is_nil() || theNext->_is_nil()) return 0;
- return _impl->InsertBefore(_impl->GetSObject(theFirst->GetID()), _impl->GetSObject(theNext->GetID()));
-}
-
-
-//============================================================================
-/*! Function : SetCurrentObject
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_UseCaseBuilder_i::SetCurrentObject(SALOMEDS::SObject_ptr theObject)
-{
- SALOMEDS::Locker lock;
- if(!_impl || theObject->_is_nil()) return 0;
- return _impl->SetCurrentObject(_impl->GetSObject(theObject->GetID()));
-}
-
-//============================================================================
-/*! Function : SetRootCurrent
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_UseCaseBuilder_i::SetRootCurrent()
-{
- SALOMEDS::Locker lock;
- if(!_impl) return 0;
- return _impl->SetRootCurrent();
-}
-
-//============================================================================
-/*! Function : HasChildren
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_UseCaseBuilder_i::HasChildren(SALOMEDS::SObject_ptr theObject)
-{
- SALOMEDS::Locker lock;
- if(!_impl) return 0;
- return _impl->HasChildren(_impl->GetSObject(theObject->GetID()));
-}
-
-//============================================================================
-/*! Function : SetName
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_UseCaseBuilder_i::SetName(const char* theName)
-{
- SALOMEDS::Locker lock;
- if(!_impl) return 0;
- return _impl->SetName((char*)theName);
-}
-
-
-//============================================================================
-/*! Function : GetCurrentObject
- * Purpose :
- */
-//============================================================================
-SALOMEDS::SObject_ptr SALOMEDS_UseCaseBuilder_i::GetCurrentObject()
-{
- SALOMEDS::Locker lock;
-
- if(!_impl) return NULL;
- SALOMEDSImpl_SObject aSO = _impl->GetCurrentObject();
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb);
- return so._retn();
-}
-
-//============================================================================
-/*! Function : GetName
- * Purpose :
- */
-//============================================================================
-char* SALOMEDS_UseCaseBuilder_i::GetName()
-{
- SALOMEDS::Locker lock;
- return CORBA::string_dup(_impl->GetName().c_str());
-}
-
-//============================================================================
-/*! Function : IsUseCase
- * Purpose :
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_UseCaseBuilder_i::IsUseCase(SALOMEDS::SObject_ptr theObject)
-{
- SALOMEDS::Locker lock;
-
- if(!_impl || theObject->_is_nil()) return false;
- return _impl->IsUseCase(_impl->GetSObject(theObject->GetID()));
-}
-
-//============================================================================
-/*! Function : NewUseCase
- * Purpose :
- */
-//============================================================================
-SALOMEDS::SObject_ptr SALOMEDS_UseCaseBuilder_i::AddUseCase(const char* theName)
-{
- SALOMEDS::Locker lock;
-
- if(!_impl) return SALOMEDS::SObject::_nil();
- SALOMEDSImpl_SObject aSO = _impl->AddUseCase((char*)theName);
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb);
- return so._retn();
-}
-
-//============================================================================
-/*! Function : GetUseCaseIterator
- * Purpose : Creates a new UseCase iterator, if anObject is null all use cases are iterated
- */
-//============================================================================
-SALOMEDS::UseCaseIterator_ptr SALOMEDS_UseCaseBuilder_i::GetUseCaseIterator(SALOMEDS::SObject_ptr theObject)
-{
- SALOMEDS::Locker lock;
-
- if(!_impl) return SALOMEDS::UseCaseIterator::_nil();
- SALOMEDSImpl_UseCaseIterator anItr;
- if(!CORBA::is_nil(theObject)) anItr = _impl->GetUseCaseIterator(_impl->GetSObject(theObject->GetID()));
- else anItr = _impl->GetUseCaseIterator(SALOMEDSImpl_SObject());
- SALOMEDS_UseCaseIterator_i* aServant = new SALOMEDS_UseCaseIterator_i(anItr, _orb);
- SALOMEDS::UseCaseIterator_var anIterator = SALOMEDS::UseCaseIterator::_narrow(aServant->_this());
- return anIterator._retn();
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_UseCaseBuilder_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_USECaseBuilder_I_H__
-#define __SALOMEDS_USECaseBuilder_I_H__
-
-// std C++ headers
-#include <iostream>
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-#include <SALOME_GenericObj_i.hh>
-
-#include <stdio.h>
-
-#include "SALOMEDSImpl_UseCaseIterator.hxx"
-#include "SALOMEDSImpl_UseCaseBuilder.hxx"
-
-class SALOMEDS_UseCaseBuilder_i: public virtual POA_SALOMEDS::UseCaseBuilder,
- public virtual PortableServer::ServantBase,
- public virtual SALOME::GenericObj_i
-{
-private:
-
- CORBA::ORB_ptr _orb;
- SALOMEDSImpl_UseCaseBuilder* _impl;
-
-public:
-
- //! standard constructor
- SALOMEDS_UseCaseBuilder_i(SALOMEDSImpl_UseCaseBuilder* theDocument,
- CORBA::ORB_ptr);
-
- //! standard destructor
- ~SALOMEDS_UseCaseBuilder_i();
-
- virtual CORBA::Boolean Append(SALOMEDS::SObject_ptr theObject);
-
- virtual CORBA::Boolean Remove(SALOMEDS::SObject_ptr theObject);
-
- virtual CORBA::Boolean AppendTo(SALOMEDS::SObject_ptr theFather, SALOMEDS::SObject_ptr theObject);
-
- virtual CORBA::Boolean InsertBefore(SALOMEDS::SObject_ptr theFirst, SALOMEDS::SObject_ptr theNext);
-
- virtual CORBA::Boolean SetCurrentObject(SALOMEDS::SObject_ptr theObject);
-
- virtual CORBA::Boolean SetRootCurrent();
-
- virtual CORBA::Boolean HasChildren(SALOMEDS::SObject_ptr theObject);
-
- virtual CORBA::Boolean IsUseCase(SALOMEDS::SObject_ptr theObject);
-
- virtual CORBA::Boolean SetName(const char* theName);
-
- virtual SALOMEDS::SObject_ptr GetCurrentObject();
-
- virtual char* GetName();
-
- virtual SALOMEDS::SObject_ptr AddUseCase(const char* theName);
-
- virtual SALOMEDS::UseCaseIterator_ptr GetUseCaseIterator(SALOMEDS::SObject_ptr anObject);
-
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_UseCaseIterator.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_UseCaseIterator.hxx"
-
-#include "SALOMEDS.hxx"
-#include "SALOMEDS_SObject.hxx"
-
-using namespace std;
-
-SALOMEDS_UseCaseIterator::SALOMEDS_UseCaseIterator(const SALOMEDSImpl_UseCaseIterator& theIterator)
-{
- _isLocal = true;
- _local_impl = theIterator.GetPersistentCopy();
- _corba_impl = SALOMEDS::UseCaseIterator::_nil();
-}
-
-SALOMEDS_UseCaseIterator::SALOMEDS_UseCaseIterator(SALOMEDS::UseCaseIterator_ptr theIterator)
-{
- _isLocal = false;
- _corba_impl = SALOMEDS::UseCaseIterator::_duplicate(theIterator);
-}
-
-SALOMEDS_UseCaseIterator::~SALOMEDS_UseCaseIterator()
-{
- if(!_isLocal) _corba_impl->Destroy();
- else if(_local_impl) delete _local_impl;
-}
-
-void SALOMEDS_UseCaseIterator::Init(bool theAllLevels)
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- if(_local_impl) _local_impl->Init(theAllLevels);
- }
- else _corba_impl->Init(theAllLevels);
-}
-
-bool SALOMEDS_UseCaseIterator::More()
-{
- bool ret = false;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- if(_local_impl) ret = _local_impl->More();
- }
- else ret = _corba_impl->More();
- return ret;
-}
-
-void SALOMEDS_UseCaseIterator::Next()
-{
- if (_isLocal) {
- SALOMEDS::Locker lock;
- if(_local_impl) _local_impl->Next();
- }
- else _corba_impl->Next();
-}
-
-_PTR(SObject) SALOMEDS_UseCaseIterator::Value()
-{
- SALOMEDS_SObject* aSO = NULL;
- if (_isLocal) {
- SALOMEDS::Locker lock;
- if(_local_impl) aSO = new SALOMEDS_SObject(_local_impl->Value());
- }
- else aSO = new SALOMEDS_SObject(_corba_impl->Value());
- return _PTR(SObject)(aSO);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_UseCaseIterator.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_USECASEITERATOR_H__
-#define __SALOMEDS_USECASEITERATOR_H__
-
-#include "SALOMEDSClient_UseCaseIterator.hxx"
-#include "SALOMEDSClient_SObject.hxx"
-#include "SALOMEDSImpl_UseCaseIterator.hxx"
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-class SALOMEDS_UseCaseIterator: public SALOMEDSClient_UseCaseIterator
-{
-private:
- bool _isLocal;
- SALOMEDSImpl_UseCaseIterator* _local_impl;
- SALOMEDS::UseCaseIterator_var _corba_impl;
-
-public:
-
- SALOMEDS_UseCaseIterator(const SALOMEDSImpl_UseCaseIterator& theIterator);
- SALOMEDS_UseCaseIterator(SALOMEDS::UseCaseIterator_ptr theIterator);
- ~SALOMEDS_UseCaseIterator();
-
- virtual void Init(bool theAllLevels);
- virtual bool More();
- virtual void Next();
- virtual _PTR(SObject) Value();
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_UseCaseIterator_i.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDS_UseCaseIterator_i.hxx"
-#include "SALOMEDS_SObject_i.hxx"
-#include "SALOMEDS.hxx"
-
-#include "SALOMEDSImpl_SObject.hxx"
-#include "utilities.h"
-
-using namespace std;
-
-//============================================================================
-/*! Function : constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDS_UseCaseIterator_i::SALOMEDS_UseCaseIterator_i(const SALOMEDSImpl_UseCaseIterator& theImpl,
- CORBA::ORB_ptr orb)
-{
- _orb = CORBA::ORB::_duplicate(orb);
- _impl = theImpl.GetPersistentCopy();
-}
-
-//============================================================================
-/*! Function : destructor
- * Purpose :
- */
-//============================================================================
-SALOMEDS_UseCaseIterator_i::~SALOMEDS_UseCaseIterator_i()
-{
- if(_impl) delete _impl;
-}
-
-//============================================================================
-/*! Function :Init
- *
- */
-//============================================================================
-void SALOMEDS_UseCaseIterator_i::Init(CORBA::Boolean allLevels)
-{
- SALOMEDS::Locker lock;
- if(_impl) _impl->Init(allLevels);
-}
-
-//============================================================================
-/*! Function : More
- *
- */
-//============================================================================
-CORBA::Boolean SALOMEDS_UseCaseIterator_i::More()
-{
- SALOMEDS::Locker lock;
- if(!_impl) return false;
- return _impl->More();
-}
-
-//============================================================================
-/*! Function : Next
- *
- */
-//============================================================================
-void SALOMEDS_UseCaseIterator_i::Next()
-{
- SALOMEDS::Locker lock;
- if(_impl) _impl->Next();
-}
-
-
-//============================================================================
-/*! Function :
- * Purpose :
- */
-//============================================================================
-SALOMEDS::SObject_ptr SALOMEDS_UseCaseIterator_i::Value()
-{
- SALOMEDS::Locker lock;
- if(!_impl) return SALOMEDS::SObject::_nil();
- SALOMEDSImpl_SObject aSO = _impl->Value();
- SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb);
- return so._retn();
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_UseCaseIterator_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDS_USECASEITERATOR_I_H__
-#define __SALOMEDS_USECASEITERATOR_I_H__
-
-// std C++ headers
-#include <iostream>
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include <SALOME_GenericObj_i.hh>
-
-#include "SALOMEDSImpl_UseCaseIterator.hxx"
-
-class SALOMEDS_UseCaseIterator_i: public virtual POA_SALOMEDS::UseCaseIterator,
- public virtual PortableServer::ServantBase,
- public virtual SALOME::GenericObj_i
-{
-private:
- CORBA::ORB_ptr _orb;
- SALOMEDSImpl_UseCaseIterator* _impl;
-
-public:
-
- //! standard constructor
- SALOMEDS_UseCaseIterator_i(const SALOMEDSImpl_UseCaseIterator& theImpl,
- CORBA::ORB_ptr);
-
- //! standard destructor
- ~SALOMEDS_UseCaseIterator_i();
-
- virtual void Init(CORBA::Boolean);
- virtual CORBA::Boolean More();
- virtual void Next();
- virtual SALOMEDS::SObject_ptr Value();
-};
-#endif
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-## @package SALOME_DriverPy
-# \brief python implementation of SALOMEDS::Driver interface
-#
-#
-import SALOMEDS__POA
-
-## Python implementation of generic SALOMEDS::Driver.
-#
-#
-class SALOME_DriverPy_i(SALOMEDS__POA.Driver):
- """
- Should be inherited by any Python module's engine
- to provide persistence mechanism.
- """
- def __init__ (self, componentDataType):
- print "SALOME_DriverPy.__init__: ",componentDataType
- self._ComponentDataType = componentDataType
-
- def IORToLocalPersistentID(self, theSObject, IORString, isMultiFile, isASCII):
- return theSObject.GetID()
-
- def LocalPersistentIDToIOR(self, theSObject, PersistentID, isMultiFile, isASCII):
- return ""
-
- def ComponentDataType(self):
- return self._ComponentDataType
-
- def Save(self, theComponent, theURL, isMultiFile):
- return ""
-
- def SaveASCII(self, theComponent, theURL, isMultiFile):
- return self.Save(theComponent, theURL, isMultiFile)
-
- def Load(self, theComponent, theStream, theURL, isMultiFile):
- return 1
-
- def LoadASCII(self, theComponent, theStream, theURL, isMultiFile):
- return self.Load(theComponent, theStream, theURL, isMultiFile)
-
- def Close(self, theComponent):
- pass
-
- def CanPublishInStudy(self, theIOR):
- return 1
-
- def PublishInStudy(self, theStudy, theSObject, theObject, theName):
- return None
-
- def CanCopy(self, theObject):
- return 0
-
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# File : Makefile.am
-# Author : Paul RASCLE
-# Module : KERNEL
-# $Header$
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-#
-# ===============================================================
-# Files to be installed
-# ===============================================================
-#
-# header files
-salomeinclude_HEADERS= SALOMEDSTest.hxx
-
-# Scripts to be installed
-dist_salomescript_PYTHON = TestSALOMEDS.py
-
-#
-# ===============================================================
-# Local definitions
-# ===============================================================
-#
-
-# This directory defines the subdirectory src in the top source directory.
-RPATH=../..
-
-# This local variable defines the list of CPPFLAGS common to all target in this package.
-COMMON_CPPFLAGS=\
- @CPPUNIT_INCLUDES@ \
- -I$(srcdir)/$(RPATH)/Basics -I$(srcdir)/$(RPATH)/Basics/Test \
- -I$(srcdir)/$(RPATH)/SALOMELocalTrace -I$(srcdir)/$(RPATH)/SALOMELocalTrace/Test \
- -I$(srcdir)/$(RPATH)/SALOMETraceCollector -I$(srcdir)/$(RPATH)/SALOMETraceCollector/Test \
- -I$(srcdir)/$(RPATH)/NamingService -I$(srcdir)/$(RPATH)/NamingService/Test \
- -I$(srcdir)/$(RPATH)/Utils -I$(srcdir)/$(RPATH)/Utils/Test \
- -I$(srcdir)/$(RPATH)/ResourcesManager \
- -I$(srcdir)/$(RPATH)/LifeCycleCORBA \
- -I$(srcdir)/$(RPATH)/SALOMEDS \
- -I$(srcdir)/$(RPATH)/SALOMEDSClient \
- -I$(srcdir)/$(RPATH)/DF \
- -I$(srcdir)/$(RPATH)/SALOMEDSImpl -I$(srcdir)/$(RPATH)/SALOMEDSImpl/Test \
- -I$(top_builddir)/salome_adm/unix \
- -I$(top_builddir)/idl \
- @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @BOOST_CPPFLAGS@
-
-# This local variable defines the list of dependant libraries common to all target in this package.
-COMMON_LIBS =\
- @CPPUNIT_LIBS@ \
- $(RPATH)/Basics/libSALOMEBasics.la \
- $(RPATH)/ResourcesManager/libSalomeResourcesManager.la \
- $(RPATH)/Container/libSalomeContainer.la \
- $(RPATH)/NamingService/libSalomeNS.la \
- $(RPATH)/Registry/libRegistry.la \
- $(RPATH)/Notification/libSalomeNotification.la \
- $(RPATH)/Utils/Test/libUtilsTest.la \
- $(RPATH)/Utils/libOpUtil.la \
- $(RPATH)/SALOMELocalTrace/Test/libSALOMELocalTraceTest.la \
- $(RPATH)/SALOMELocalTrace/libSALOMELocalTrace.la \
- $(RPATH)/SALOMETraceCollector/Test/libSALOMETraceCollectorTest.la \
- $(RPATH)/SALOMEDSImpl/Test/libSALOMEDSImplTest.la \
- $(RPATH)/DF/libDF.la \
- $(RPATH)/SALOMEDSImpl/libSalomeDSImpl.la \
- $(RPATH)/SALOMEDSClient/libSalomeDSClient.la \
- $(RPATH)/SALOMEDS/libSalomeDS.la \
- $(top_builddir)/idl/libSalomeIDLKernel.la
-
-#
-# ===============================================================
-# Libraries targets
-# ===============================================================
-#
-lib_LTLIBRARIES = libSALOMEDSTest.la
-dist_libSALOMEDSTest_la_SOURCES = SALOMEDSTest.cxx
-libSALOMEDSTest_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSALOMEDSTest_la_LDFLAGS = -no-undefined -version-info=0:0:0
-libSALOMEDSTest_la_LIBADD = $(COMMON_LIBS)
-
-EXTRA_DIST = \
- SALOMEDSTest_AttributeComment.cxx \
- SALOMEDSTest_AttributeDrawable.cxx \
- SALOMEDSTest_AttributeExpandable.cxx \
- SALOMEDSTest_AttributeExternalFileDef.cxx \
- SALOMEDSTest_AttributeFileType.cxx \
- SALOMEDSTest_AttributeFlags.cxx \
- SALOMEDSTest_AttributeGraphic.cxx \
- SALOMEDSTest_AttributeInteger.cxx \
- SALOMEDSTest_AttributeIOR.cxx \
- SALOMEDSTest_AttributeLocalID.cxx \
- SALOMEDSTest_AttributeName.cxx \
- SALOMEDSTest_AttributeOpened.cxx \
- SALOMEDSTest_AttributeParameter.cxx \
- SALOMEDSTest_AttributePersistentRef.cxx \
- SALOMEDSTest_AttributePixMap.cxx \
- SALOMEDSTest_AttributePythonObject.cxx \
- SALOMEDSTest_AttributeReal.cxx \
- SALOMEDSTest_AttributeSelectable.cxx \
- SALOMEDSTest_AttributeSequenceOfInteger.cxx \
- SALOMEDSTest_AttributeSequenceOfReal.cxx \
- SALOMEDSTest_AttributeStudyProperties.cxx \
- SALOMEDSTest_AttributeTableOfInteger.cxx \
- SALOMEDSTest_AttributeTableOfReal.cxx \
- SALOMEDSTest_AttributeTableOfString.cxx \
- SALOMEDSTest_AttributeTarget.cxx \
- SALOMEDSTest_AttributeTextColor.cxx \
- SALOMEDSTest_AttributeTextHighlightColor.cxx\
- SALOMEDSTest_AttributeTreeNode.cxx \
- SALOMEDSTest_AttributeUserID.cxx \
- SALOMEDSTest_ChildIterator.cxx \
- SALOMEDSTest_SComponent.cxx \
- SALOMEDSTest_SComponentIterator.cxx \
- SALOMEDSTest_SObject.cxx \
- SALOMEDSTest_StudyBuilder.cxx \
- SALOMEDSTest_Study.cxx \
- SALOMEDSTest_StudyManager.cxx \
- SALOMEDSTest_UseCase.cxx
-
-#
-# ===============================================================
-# Executables targets
-# ===============================================================
-#
-bin_PROGRAMS = TestSALOMEDS
-dist_TestSALOMEDS_SOURCES = TestSALOMEDS.cxx
-TestSALOMEDS_CPPFLAGS = $(COMMON_CPPFLAGS)
-TestSALOMEDS_LDADD = libSALOMEDSTest.la \
- $(RPATH)/Basics/libSALOMEBasics.la \
- $(CORBA_LIBS)
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "SALOMEDSTest.hxx"
-
-
-#include "SALOMEDS_StudyManager_i.hxx"
-#include "utilities.h"
-#include "Utils_SINGLETON.hxx"
-#include "Utils_ORB_INIT.hxx"
-#include "SALOME_NamingService.hxx"
-#include "SALOME_LifeCycleCORBA.hxx"
-
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <vector>
-#include <cstdlib>
-
-#include "SALOMEDSClient.hxx"
-#include "SALOMEDS_StudyManager_i.hxx"
-#include "SALOMEDS_StudyManager.hxx"
-#include "SALOMEDS_SObject.hxx"
-
-
-using namespace std;
-
-// ============================================================================
-/*!
- * Set up the environment
- */
-// ============================================================================
-
-void SALOMEDSTest::setUp()
-{
- int argc = 1;
- char* argv[] = {(char*)""};
-
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- _orb = init(argc , argv ) ;
- SALOME_NamingService NS(_orb);
- CORBA::Object_var obj = NS.Resolve( "/myStudyManager" );
- _sm = SALOMEDS::StudyManager::_narrow( obj );
-
- CPPUNIT_ASSERT( !CORBA::is_nil(_sm) );
-}
-
-// ============================================================================
-/*!
- * - delete trace classes
- */
-// ============================================================================
-
-void SALOMEDSTest::tearDown()
-{
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
- vector<string> v = sm->GetOpenStudies();
- for(int i = 0; i<v.size(); i++) {
- _PTR(Study) study = sm->GetStudyByName(v[i]);
- if(study)
- sm->Close(study);
- }
-}
-
-#include "SALOMEDSTest_AttributeComment.cxx"
-#include "SALOMEDSTest_AttributeDrawable.cxx"
-#include "SALOMEDSTest_AttributeExpandable.cxx"
-#include "SALOMEDSTest_AttributeExternalFileDef.cxx"
-#include "SALOMEDSTest_AttributeFileType.cxx"
-#include "SALOMEDSTest_AttributeFlags.cxx"
-#include "SALOMEDSTest_AttributeGraphic.cxx"
-#include "SALOMEDSTest_AttributeIOR.cxx"
-#include "SALOMEDSTest_AttributeInteger.cxx"
-#include "SALOMEDSTest_AttributeLocalID.cxx"
-#include "SALOMEDSTest_AttributeName.cxx"
-#include "SALOMEDSTest_AttributeOpened.cxx"
-#include "SALOMEDSTest_AttributeParameter.cxx"
-#include "SALOMEDSTest_AttributePersistentRef.cxx"
-#include "SALOMEDSTest_AttributePixMap.cxx"
-#include "SALOMEDSTest_AttributePythonObject.cxx"
-#include "SALOMEDSTest_AttributeReal.cxx"
-#include "SALOMEDSTest_AttributeSelectable.cxx"
-#include "SALOMEDSTest_AttributeSequenceOfInteger.cxx"
-#include "SALOMEDSTest_AttributeSequenceOfReal.cxx"
-#include "SALOMEDSTest_AttributeStudyProperties.cxx"
-#include "SALOMEDSTest_AttributeTableOfInteger.cxx"
-#include "SALOMEDSTest_AttributeTableOfReal.cxx"
-#include "SALOMEDSTest_AttributeTableOfString.cxx"
-#include "SALOMEDSTest_AttributeTarget.cxx"
-#include "SALOMEDSTest_AttributeTextColor.cxx"
-#include "SALOMEDSTest_AttributeTextHighlightColor.cxx"
-#include "SALOMEDSTest_AttributeTreeNode.cxx"
-#include "SALOMEDSTest_AttributeUserID.cxx"
-#include "SALOMEDSTest_ChildIterator.cxx"
-#include "SALOMEDSTest_SComponent.cxx"
-#include "SALOMEDSTest_SComponentIterator.cxx"
-#include "SALOMEDSTest_SObject.cxx"
-#include "SALOMEDSTest_Study.cxx"
-#include "SALOMEDSTest_StudyBuilder.cxx"
-#include "SALOMEDSTest_StudyManager.cxx"
-#include "SALOMEDSTest_UseCase.cxx"
-
-
-// ============================================================================
-/*!
- * Set up the environment
- */
-// ============================================================================
-
-void SALOMEDSTest_Embedded::setUp()
-{
- int argc = 1;
- char* argv[] = {(char*)""};
-
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- _orb = init(argc , argv ) ;
- SALOME_NamingService NS(_orb);
- CORBA::Object_var obj = NS.Resolve( "/myStudyManager_embedded" );
- _sm = SALOMEDS::StudyManager::_narrow( obj );
-
- CPPUNIT_ASSERT( !CORBA::is_nil(_sm) );
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef _SALOMEDSTEST_HXX_
-#define _SALOMEDSTEST_HXX_
-
-#include <cppunit/extensions/HelperMacros.h>
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-class SALOMEDSTest : public CppUnit::TestFixture
-{
- CPPUNIT_TEST_SUITE( SALOMEDSTest );
-
- //Attributes' tests
-
- CPPUNIT_TEST( testAttributeComment );
- CPPUNIT_TEST( testAttributeDrawable );
- CPPUNIT_TEST( testAttributeExpandable );
- CPPUNIT_TEST( testAttributeExternalFileDef );
- CPPUNIT_TEST( testAttributeFileType );
- CPPUNIT_TEST( testAttributeFlags );
- CPPUNIT_TEST( testAttributeGraphic );
- CPPUNIT_TEST( testAttributeIOR );
- CPPUNIT_TEST( testAttributeInteger );
- CPPUNIT_TEST( testAttributeLocalID );
- CPPUNIT_TEST( testAttributeName );
- CPPUNIT_TEST( testAttributeOpened );
- CPPUNIT_TEST( testAttributeParameter );
- CPPUNIT_TEST( testAttributePersistentRef );
- CPPUNIT_TEST( testAttributePixMap );
- CPPUNIT_TEST( testAttributePythonObject );
- CPPUNIT_TEST( testAttributeReal );
- CPPUNIT_TEST( testAttributeSelectable );
- CPPUNIT_TEST( testAttributeSequenceOfInteger );
- CPPUNIT_TEST( testAttributeSequenceOfReal );
- CPPUNIT_TEST( testAttributeStudyProperties );
- CPPUNIT_TEST( testAttributeTableOfInteger );
- CPPUNIT_TEST( testAttributeTableOfReal );
- CPPUNIT_TEST( testAttributeTableOfString );
- CPPUNIT_TEST( testAttributeTarget );
- CPPUNIT_TEST( testAttributeTextColor );
- CPPUNIT_TEST( testAttributeTextHighlightColor );
- CPPUNIT_TEST( testAttributeTreeNode );
- CPPUNIT_TEST( testAttributeUserID );
- CPPUNIT_TEST( testChildIterator );
- CPPUNIT_TEST( testSComponent );
- CPPUNIT_TEST( testSComponentIterator );
- CPPUNIT_TEST( testSObject );
- CPPUNIT_TEST( testStudy );
- CPPUNIT_TEST( testStudyBuilder );
- CPPUNIT_TEST( testStudyManager );
- CPPUNIT_TEST( testUseCase );
-
-
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
- virtual void setUp();
- virtual void tearDown();
-
- //Attributes
- void testAttributeComment();
- void testAttributeDrawable();
- void testAttributeExpandable();
- void testAttributeExternalFileDef();
- void testAttributeFileType();
- void testAttributeFlags();
- void testAttributeGraphic();
- void testAttributeIOR();
- void testAttributeInteger();
- void testAttributeLocalID();
- void testAttributeName();
- void testAttributeOpened();
- void testAttributeParameter();
- void testAttributePersistentRef();
- void testAttributePixMap();
- void testAttributePythonObject();
- void testAttributeReal();
- void testAttributeSelectable();
- void testAttributeSequenceOfInteger();
- void testAttributeSequenceOfReal();
- void testAttributeStudyProperties();
- void testAttributeTableOfInteger();
- void testAttributeTableOfReal();
- void testAttributeTableOfString();
- void testAttributeTarget();
- void testAttributeTextColor();
- void testAttributeTextHighlightColor();
- void testAttributeTreeNode();
- void testAttributeUserID();
-
- //Objects
- void testChildIterator();
- void testSComponent();
- void testSComponentIterator();
- void testSObject();
- void testStudy();
- void testStudyBuilder();
- void testStudyManager();
- void testUseCase();
-
-protected:
-
-SALOMEDS::StudyManager_var _sm;
-CORBA::ORB_var _orb;
-
-};
-
-
-
-class SALOMEDSTest_Embedded : public SALOMEDSTest
-{
- CPPUNIT_TEST_SUITE( SALOMEDSTest_Embedded );
-
- //Attributes' tests
-
- CPPUNIT_TEST( testAttributeComment );
- CPPUNIT_TEST( testAttributeDrawable );
- CPPUNIT_TEST( testAttributeExpandable );
- CPPUNIT_TEST( testAttributeExternalFileDef );
- CPPUNIT_TEST( testAttributeFileType );
- CPPUNIT_TEST( testAttributeFlags );
- CPPUNIT_TEST( testAttributeGraphic );
- CPPUNIT_TEST( testAttributeIOR );
- CPPUNIT_TEST( testAttributeInteger );
- CPPUNIT_TEST( testAttributeLocalID );
- CPPUNIT_TEST( testAttributeName );
- CPPUNIT_TEST( testAttributeOpened );
- CPPUNIT_TEST( testAttributeParameter );
- CPPUNIT_TEST( testAttributePersistentRef );
- CPPUNIT_TEST( testAttributePixMap );
- CPPUNIT_TEST( testAttributePythonObject );
- CPPUNIT_TEST( testAttributeReal );
- CPPUNIT_TEST( testAttributeSelectable );
- CPPUNIT_TEST( testAttributeSequenceOfInteger );
- CPPUNIT_TEST( testAttributeSequenceOfReal );
- CPPUNIT_TEST( testAttributeStudyProperties );
- CPPUNIT_TEST( testAttributeTableOfInteger );
- CPPUNIT_TEST( testAttributeTableOfReal );
- CPPUNIT_TEST( testAttributeTableOfString );
- CPPUNIT_TEST( testAttributeTarget );
- CPPUNIT_TEST( testAttributeTextColor );
- CPPUNIT_TEST( testAttributeTextHighlightColor );
- CPPUNIT_TEST( testAttributeTreeNode );
- CPPUNIT_TEST( testAttributeUserID );
- CPPUNIT_TEST( testChildIterator );
- CPPUNIT_TEST( testSComponent );
- CPPUNIT_TEST( testSComponentIterator );
- CPPUNIT_TEST( testSObject );
- CPPUNIT_TEST( testStudy );
- CPPUNIT_TEST( testStudyBuilder );
- CPPUNIT_TEST( testChildIterator );
- CPPUNIT_TEST( testStudyManager );
- CPPUNIT_TEST( testUseCase );
-
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
- virtual void setUp();
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeComment
- * Use code of SALOMEDS_AttributeComment.cxx
- */
-
-void SALOMEDSTest::testAttributeComment()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm(new SALOMEDS_StudyManager(_sm));
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeComment
- _PTR(AttributeComment) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeComment");
-
- CPPUNIT_ASSERT(_attr);
-
- //Check method Value
- string value = _attr->Value();
-
- CPPUNIT_ASSERT(value.empty());
-
- value = "Test string!";
-
- //Check method SetValue
- _attr->SetValue(value);
-
- CPPUNIT_ASSERT(value == _attr->Value());
-
- //Try to set empty string
- _attr->SetValue("");
- CPPUNIT_ASSERT(_attr->Value() == "");
-
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeDrawable
- * Use code of SALOMEDS_AttributeDrawable.cxx
- */
-
-void SALOMEDSTest::testAttributeDrawable()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm(new SALOMEDS_StudyManager(_sm));
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeDrawable
- _PTR(AttributeDrawable) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeDrawable");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method IsDrawable
- bool isDrawable = _attr->IsDrawable();
-
- CPPUNIT_ASSERT(!isDrawable);
-
- //Check method SetDrawable
- _attr->SetDrawable(true);
-
- CPPUNIT_ASSERT(_attr->IsDrawable());
-
- _attr->SetDrawable(false);
-
- CPPUNIT_ASSERT(!_attr->IsDrawable());
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeExpandable
- * Use code of SALOMEDS_AttributeExpandable.cxx
- */
-void SALOMEDSTest::testAttributeExpandable()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeExpandable
- _PTR(AttributeExpandable) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeExpandable");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method IsExpandable
- bool isExpandable = _attr->IsExpandable();
-
- CPPUNIT_ASSERT(isExpandable);
-
- //Check method SetExpandable
- _attr->SetExpandable(false);
-
- CPPUNIT_ASSERT(!_attr->IsExpandable());
-
- _attr->SetExpandable(true);
-
- CPPUNIT_ASSERT(_attr->IsExpandable());
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeExternalFileDef
- * Use code of SALOMEDS_AttributeExternalFileDef.cxx
- */
-void SALOMEDSTest::testAttributeExternalFileDef()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeExternalFileDef
- _PTR(AttributeExternalFileDef) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeExternalFileDef");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method Value
- string value = _attr->Value();
-
- CPPUNIT_ASSERT(value.empty());
-
- value = "Test string!";
-
- //Check method SetValue
- _attr->SetValue(value);
-
- CPPUNIT_ASSERT(value == _attr->Value());
-
- //Try to set empty string
- _attr->SetValue("");
- CPPUNIT_ASSERT(_attr->Value() == "");
-
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeFileType
- * Use code of SALOMEDS_AttributeFileType.cxx
- */
-void SALOMEDSTest::testAttributeFileType()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeFileType
- _PTR(AttributeFileType) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeFileType");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method Value
- string value = _attr->Value();
-
- CPPUNIT_ASSERT(value.empty());
-
- value = "Test string!";
-
- //Check method SetValue
- _attr->SetValue(value);
-
- CPPUNIT_ASSERT(value == _attr->Value());
-
- //Try to set empty string
- _attr->SetValue("");
- CPPUNIT_ASSERT(_attr->Value() == "");
-
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeFlags
- * Use code of SALOMEDS_AttributeFlags.cxx
- */
-void SALOMEDSTest::testAttributeFlags()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeFlags
- _PTR(AttributeFlags) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeFlags");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method Set
- _attr->Set(2, true);
-
- CPPUNIT_ASSERT(_attr->Get(2));
-
- _attr->Set(4, false);
-
- //Check method Get
- CPPUNIT_ASSERT(!_attr->Get(4));
-
- //Check method GetFlags
- int flags = _attr->GetFlags();
-
- _attr->SetFlags(flags);
-
- CPPUNIT_ASSERT(_attr->Get(2));
-
- CPPUNIT_ASSERT(!_attr->Get(4));
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeGraphic
- * Use code of SALOMEDS_AttributeGraphic.cxx
- */
-void SALOMEDSTest::testAttributeGraphic()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeGraphic
- _PTR(AttributeGraphic) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeGraphic");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method SetVisibility
- _attr->SetVisibility(1, true);
-
- //Check method GetVisibility
- CPPUNIT_ASSERT(_attr->GetVisibility(1));
-
- _attr->SetVisibility(2, false);
-
- CPPUNIT_ASSERT(!_attr->GetVisibility(2) && _attr->GetVisibility(1));
-
- //Check visibility for 0 and -1
- _attr->SetVisibility(0, false);
- CPPUNIT_ASSERT(!_attr->GetVisibility(0));
- _attr->SetVisibility(-1, true);
- CPPUNIT_ASSERT(_attr->GetVisibility(-1));
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeIOR
- * Use code of SALOMEDS_AttributeIOR.cxx
- */
-void SALOMEDSTest::testAttributeIOR()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeIOR
- _PTR(AttributeIOR) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeIOR");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method Value
- string value = _attr->Value();
-
- CPPUNIT_ASSERT(value.empty());
-
- string ior = _orb->object_to_string(_sm);
-
- //Check method SetValue
- _attr->SetValue(ior);
-
- CPPUNIT_ASSERT(ior == _attr->Value());
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeInteger
- * Use code of SALOMEDS_AttributeInteger.cxx
- */
-void SALOMEDSTest::testAttributeInteger()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeInteger
- _PTR(AttributeInteger) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeInteger");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- int value = 10;
-
- //Check method SetValue
- _attr->SetValue(value);
-
- //Check method Value
- CPPUNIT_ASSERT(_attr->Value() == value);
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeLocalID
- * Use code of SALOMEDS_AttributeLocalID.cxx
- */
-void SALOMEDSTest::testAttributeLocalID()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeLocalID
- _PTR(AttributeLocalID) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeLocalID");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- int value = 10;
-
- //Check method SetValue
- _attr->SetValue(value);
-
- //Check method Value
- CPPUNIT_ASSERT(_attr->Value() == value);
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeName
- * Use code of SALOMEDS_AttributeName.cxx
- */
-void SALOMEDSTest::testAttributeName()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeName
- _PTR(AttributeName) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeName");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method Value
- string value = _attr->Value();
-
- CPPUNIT_ASSERT(value.empty());
-
- value = "Test string!";
-
- //Check method SetValue
- _attr->SetValue(value);
-
- CPPUNIT_ASSERT(value == _attr->Value());
-
- //Try to set empty string
- _attr->SetValue("");
- CPPUNIT_ASSERT(_attr->Value() == "");
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeOpened
- * Use code of SALOMEDS_AttributeOpened.cxx
- */
-void SALOMEDSTest::testAttributeOpened()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeOpened
- _PTR(AttributeOpened) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeOpened");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method IsOpened
- bool isOpened = _attr->IsOpened();
-
- CPPUNIT_ASSERT(!isOpened);
-
- //Check method SetOpened
- _attr->SetOpened(true);
-
- CPPUNIT_ASSERT(_attr->IsOpened());
-
- _attr->SetOpened(false);
-
- CPPUNIT_ASSERT(!_attr->IsOpened());
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#define PT_INTEGER 0
-#define PT_REAL 1
-#define PT_BOOLEAN 2
-#define PT_STRING 3
-#define PT_REALARRAY 4
-#define PT_INTARRAY 5
-#define PT_STRARRAY 6
-
-/*!
- * Check all methods of SALOMEDS_AttributeParameter
- * Use code of SALOMEDS_AttributeParameter.cxx
- */
-void SALOMEDSTest::testAttributeParameter()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeParameter
- _PTR(AttributeParameter) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeParameter");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Try to retreive a value with invalid ID
- bool isRaised = false;
- CPPUNIT_ASSERT(!_attr->IsSet("invalid ID", PT_INTEGER));
- try {
- _attr->GetInt("invalid ID");
- }
- catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
-
- //Check method SetInt and GetInt
- _attr->SetInt("IntValue", 1);
- CPPUNIT_ASSERT(_attr->IsSet("IntValue", PT_INTEGER));
- CPPUNIT_ASSERT(_attr->GetInt("IntValue") == 1);
-
- //Check method SetReal an GetReal
- _attr->SetReal("RealValue", 1.2);
- CPPUNIT_ASSERT(_attr->IsSet("RealValue", PT_REAL));
- CPPUNIT_ASSERT(_attr->GetReal("RealValue") == 1.2);
-
- //Check method SetString and GetString
- _attr->SetString("StringValue", "hello");
- CPPUNIT_ASSERT(_attr->IsSet("StringValue", PT_STRING));
- CPPUNIT_ASSERT(_attr->GetString("StringValue") == "hello");
-
- //Check method SetBool and GetBool
- _attr->SetBool("BoolValue", 0);
- CPPUNIT_ASSERT(_attr->IsSet("BoolValue", PT_BOOLEAN));
- CPPUNIT_ASSERT(!_attr->GetBool("BoolValue"));
-
- _attr->SetBool("BoolValue", 0);
- CPPUNIT_ASSERT(_attr->IsSet("BoolValue", PT_BOOLEAN));
- CPPUNIT_ASSERT(!_attr->GetBool("BoolValue"));
-
- vector<int> intArray;
- intArray.push_back(0);
- intArray.push_back(1);
-
- //Check method SetIntArray and GetIntArray
- _attr->SetIntArray("IntArray", intArray);
- CPPUNIT_ASSERT(_attr->IsSet("IntArray", PT_INTARRAY));
- CPPUNIT_ASSERT(_attr->GetIntArray("IntArray")[0] == 0);
- CPPUNIT_ASSERT(_attr->GetIntArray("IntArray")[1] == 1);
-
- vector<double> realArray;
- realArray.push_back(0.0);
- realArray.push_back(1.1);
-
- //Check method SetRealArray and GetRealArray
- _attr->SetRealArray("RealArray", realArray);
- CPPUNIT_ASSERT(_attr->IsSet("RealArray", PT_REALARRAY));
- CPPUNIT_ASSERT(_attr->GetRealArray("RealArray")[0] == 0.0);
- CPPUNIT_ASSERT(_attr->GetRealArray("RealArray")[1] == 1.1);
-
- vector<string> strArray;
- strArray.push_back("hello");
- strArray.push_back("world");
-
- //Check method SetStrArray and GetStrArray
- _attr->SetStrArray("StrArray", strArray);
- CPPUNIT_ASSERT(_attr->IsSet("StrArray", PT_STRARRAY));
- CPPUNIT_ASSERT(_attr->GetStrArray("StrArray")[0] == "hello");
- CPPUNIT_ASSERT(_attr->GetStrArray("StrArray")[1] == "world");
-
- /*
- string saved = _attr->Save();
- _attr->Load(saved);
-
- CPPUNIT_ASSERT(_attr->IsSet("IntValue", PT_INTEGER) && _attr->GetInt("IntValue") == 1);
- CPPUNIT_ASSERT(_attr->IsSet("RealValue", PT_REAL) && _attr->GetReal("IntValue") == 1.2);
- CPPUNIT_ASSERT(_attr->IsSet("StringValue", PT_STRING) && _attr->GetString("StringValue") == "hello");
- CPPUNIT_ASSERT(_attr->IsSet("BoolValue", PT_BOOLEAN) && _attr->GetBool("BoolValue") == 0);
- CPPUNIT_ASSERT(_attr->IsSet("IntArray", PT_INTARRAY) && _attr->GetIntArray("IntArray")[0] == 0);
- CPPUNIT_ASSERT(_attr->IsSet("IntArray", PT_INTARRAY) && _attr->GetIntArray("IntArray")[1] == 1);
- CPPUNIT_ASSERT(_attr->IsSet("RealArray", PT_REALARRAY) && _attr->GetRealArray("RealArray")[0] == 0.0);
- CPPUNIT_ASSERT(_attr->IsSet("RealArray", PT_REALARRAY) && _attr->GetRealArray("RealArray")[1] == 1.1);
- CPPUNIT_ASSERT(_attr->IsSet("StrArray", PT_STRARRAY) && _attr->GetStrArray("StrArray")[0] == "hello");
- CPPUNIT_ASSERT(_attr->IsSet("StrArray", PT_STRARRAY) && _attr->GetStrArray("StrArray")[1] == "world");
- */
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributePersistentRef
- * Use code of SALOMEDS_AttributePersistentRef.cxx
- */
-void SALOMEDSTest::testAttributePersistentRef()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributePersistentRef
- _PTR(AttributePersistentRef) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributePersistentRef");
-
- CPPUNIT_ASSERT(_attr);
-
- //Check method Value
- string value = _attr->Value();
-
- CPPUNIT_ASSERT(value.empty());
-
- value = "Test string!";
-
- //Check method SetValue
- _attr->SetValue(value);
-
- CPPUNIT_ASSERT(value == _attr->Value());
-
- //Try to set empty string
- _attr->SetValue("");
- CPPUNIT_ASSERT(_attr->Value() == "");
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributePixMap
- * Use code of SALOMEDS_AttributePixMap.cxx
- */
-void SALOMEDSTest::testAttributePixMap()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributePixMap
- _PTR(AttributePixMap) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributePixMap");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method HasPixMap
- CPPUNIT_ASSERT(!_attr->HasPixMap());
-
- //Check method SetPixMap
- string pixmap = "something";
- _attr->SetPixMap(pixmap);
-
- CPPUNIT_ASSERT(_attr->HasPixMap());
-
- //Check method GetPixMap
- CPPUNIT_ASSERT(_attr->GetPixMap() == pixmap);
-
- //Check empty PixMap assigning and retreival
- _attr->SetPixMap("");
- CPPUNIT_ASSERT(_attr->GetPixMap() == "");
-
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributePythonObject
- * Use code of SALOMEDS_AttributePythonObject.cxx
- */
-void SALOMEDSTest::testAttributePythonObject()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributePythonObject
- _PTR(AttributePythonObject) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributePythonObject");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method IsScript
- CPPUNIT_ASSERT(!_attr->IsScript());
-
- string pyobj = "some object!";
-
- //Check method SetObject
- _attr->SetObject(pyobj, true);
-
- CPPUNIT_ASSERT(_attr->IsScript());
-
- //Check method GetObject
- CPPUNIT_ASSERT(_attr->GetObject() == pyobj);
-
- //Check setting and retreival of empty object
- _attr->SetObject("", true);
- CPPUNIT_ASSERT(_attr->GetObject() == "" && _attr->IsScript());
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeReal
- * Use code of SALOMEDS_AttributeReal.cxx
- */
-void SALOMEDSTest::testAttributeReal()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeReal
- _PTR(AttributeReal) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeReal");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- double value = 10.12;
-
- //Check method SetValue
- _attr->SetValue(value);
-
- //Check method Value
- CPPUNIT_ASSERT(_attr->Value() == value);
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeSelectable
- * Use code of SALOMEDS_AttributeSelectable.cxx
- */
-void SALOMEDSTest::testAttributeSelectable()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeSelectable
- _PTR(AttributeSelectable) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeSelectable");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method IsSelectable
- bool isSelectable = _attr->IsSelectable();
-
- CPPUNIT_ASSERT(isSelectable);
-
- //Check method SetSelectable
- _attr->SetSelectable(false);
-
- CPPUNIT_ASSERT(!_attr->IsSelectable());
-
- _attr->SetSelectable(true);
-
- CPPUNIT_ASSERT(_attr->IsSelectable());
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeSequenceOfInteger
- * Use code of SALOMEDS_AttributeSequenceOfInteger.cxx
- */
-void SALOMEDSTest::testAttributeSequenceOfInteger()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeSequenceOfInteger
- _PTR(AttributeSequenceOfInteger) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeSequenceOfInteger");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method Length
- CPPUNIT_ASSERT(_attr->Length() == 0);
-
- //Check method Add
- _attr->Add(1);
-
- _attr->Add(2);
-
- _attr->Add(3);
-
- _attr->Add(4);
-
- CPPUNIT_ASSERT(_attr->Length() == 4);
-
- CPPUNIT_ASSERT(_attr->Value(2) == 2);
-
- //Check method Remove
- _attr->Remove(3);
-
- //Check method Value
- CPPUNIT_ASSERT(_attr->Value(3) == 4);
-
- //Check method ChangeValue
- _attr->ChangeValue(3, 3);
-
- CPPUNIT_ASSERT(_attr->Value(3) == 3);
-
- //Check method CorbaSequence
- vector<int> v = _attr->CorbaSequence();
- CPPUNIT_ASSERT(v.size() == 3);
-
-
- for(int i = 0; i<v.size(); i++)
- CPPUNIT_ASSERT((i+1) == v[i]);
-
- v.push_back(5);
-
- //Check method Assign
- _attr->Assign(v);
-
- CPPUNIT_ASSERT(_attr->Length() == 4);
-
- CPPUNIT_ASSERT(_attr->Value(4) == 5);
-
- //Check processing of invalid indicies
- bool isRaised = false;
- try {
- _attr->Value(-1);
- }
- catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
- isRaised = false;
- try {
- _attr->ChangeValue(12, 1);
- }
- catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
- isRaised = false;
- try {
- _attr->Remove(10);
- }
- catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeSequenceOfReal
- * Use code of SALOMEDS_AttributeSequenceOfReal.cxx
- */
-void SALOMEDSTest::testAttributeSequenceOfReal()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeSequenceOfReal
- _PTR(AttributeSequenceOfReal) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeSequenceOfReal");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method Length
- CPPUNIT_ASSERT(_attr->Length() == 0);
-
- //Check method Add
- _attr->Add(1.1);
-
- _attr->Add(2.2);
-
- _attr->Add(3.3);
-
- _attr->Add(4.4);
-
- CPPUNIT_ASSERT(_attr->Length() == 4);
-
- CPPUNIT_ASSERT(_attr->Value(2) == 2.2);
-
- //Check method Remove
- _attr->Remove(3);
-
- CPPUNIT_ASSERT(_attr->Value(3) == 4.4);
-
- //Check method ChangeValue
- _attr->ChangeValue(3, 3.3);
-
- CPPUNIT_ASSERT(_attr->Value(3) == 3.3);
-
- //Check method CorbaSequence
- vector<double> v = _attr->CorbaSequence();
- CPPUNIT_ASSERT(v.size() == 3);
-
- v.push_back(5.5);
-
- _attr->Assign(v);
-
- CPPUNIT_ASSERT(_attr->Length() == 4);
-
- CPPUNIT_ASSERT(_attr->Value(4) == 5.5);
-
- //Check processing of invalid indicies
- bool isRaised = false;
- try {
- _attr->Value(-1);
- }
- catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
- isRaised = false;
- try {
- _attr->ChangeValue(12, 1);
- }
- catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
- isRaised = false;
- try {
- _attr->Remove(10);
- }
- catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeStudyProperties
- * Use code of SALOMEDS_AttributeStudyProperties.cxx
- */
-void SALOMEDSTest::testAttributeStudyProperties()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeStudyProperties
- _PTR(AttributeStudyProperties) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeStudyProperties");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method SetCreationDate
- _attr->SetCreationDate(1, 2, 3, 4, 5);
-
- //Check method GetCreationDate
- int MN, H, D, MH, Y;
- _attr->GetCreationDate(MN, H, D, MH, Y);
-
- CPPUNIT_ASSERT(MN == 1 && H == 2 && D == 3 && MH == 4 && Y == 5);
-
- //Check method SetUserName
- _attr->SetUserName("srn");
-
- //Check method GetUserName
- CPPUNIT_ASSERT(_attr->GetUserName() == "srn");
-
- //Check method SetCreationMode
- string value = "from scratch";
- _attr->SetCreationMode(value);
-
- //Check method GetCreationMode
- CPPUNIT_ASSERT(_attr->GetCreationMode() == value);
-
- //Check method SetModified
- _attr->SetModified(2);
-
- //Check method IsModified
- CPPUNIT_ASSERT(_attr->IsModified());
-
- //Check method GetModified
- CPPUNIT_ASSERT(_attr->GetModified() == 2);
-
- //Check method SetLocked
- _attr->SetLocked(true);
-
- //Check method IsLocked
- CPPUNIT_ASSERT(_attr->IsLocked());
-
- _attr->SetLocked(false);
-
- CPPUNIT_ASSERT(!_attr->IsLocked());
-
- //Check method SetModification
- _attr->SetModification("srn2", 6, 7, 8, 9, 10);
-
- //Check method GetModificationsList
- vector<string> vs;
- vector<int> vi[5];
- _attr->GetModificationsList(vs, vi[0], vi[1], vi[2], vi[3], vi[4], false);
- CPPUNIT_ASSERT(vs[0] == "srn2" && vi[0][0] == 6 && vi[1][0] == 7 && vi[2][0] == 8 && vi[3][0] == 9 && vi[4][0] == 10);
-
- vs.clear();
- for(int i=0; i<5; i++) vi[i].clear();
-
- _attr->GetModificationsList(vs, vi[0], vi[1], vi[2], vi[3], vi[4], true);
- CPPUNIT_ASSERT(vs[0] == "srn" && vi[0][0] == 1 && vi[1][0] == 2 && vi[2][0] == 3 && vi[3][0] == 4 && vi[4][0] == 5);
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeTableOfInteger
- * Use code of SALOMEDS_AttributeTableOfInteger.cxx
- */
-void SALOMEDSTest::testAttributeTableOfInteger()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeTableOfInteger
- _PTR(AttributeTableOfInteger) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeTableOfInteger");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method SetTitle
- _attr->SetTitle("Table_1");
-
- //Check method GetTitle
- CPPUNIT_ASSERT(_attr->GetTitle() == "Table_1");
-
- //Check method SetNbColumns
- _attr->SetNbColumns(2);
-
- //Check method GetNbColumns
- CPPUNIT_ASSERT(_attr->GetNbColumns() == 2);
-
- //Check method HasValue
- CPPUNIT_ASSERT(!_attr->HasValue(1, 1));
-
- bool isCaught = false;
- try {
- _attr->GetValue(1, 1);
- }
- catch(...) {
- isCaught = true;
- }
- CPPUNIT_ASSERT(isCaught);
-
- //Check method PutValue
- _attr->PutValue(23, 1,1);
-
- CPPUNIT_ASSERT(_attr->HasValue(1, 1));
-
- //Check method GetValue
- CPPUNIT_ASSERT(_attr->GetValue(1, 1) == 23);
-
- //Check method GetRowSetIndices
- vector<int> rs = _attr->GetRowSetIndices(1);
-
- CPPUNIT_ASSERT(rs.size() == 1 && rs[0] == 1);
-
- _attr->PutValue(32, 2,2);
- CPPUNIT_ASSERT(_attr->HasValue(2, 2));
-
- vector<string> rowTitles;
- rowTitles.push_back("title1");
- rowTitles.push_back("title2");
-
- //Check method SetRowTitles
- _attr->SetRowTitles(rowTitles);
-
- //Check method SetRowTitle
- _attr->SetRowTitle(1, "new_title");
-
- //Check method GetRowTitles
- vector<string> rt = _attr->GetRowTitles();
-
- CPPUNIT_ASSERT(rt.size() == 2 && rt[0] == "new_title" && rt[1] == "title2");
-
- vector<string> colTitles;
- colTitles.push_back("title1");
- colTitles.push_back("title2");
-
- //Check method SetColumnTitles
- _attr->SetColumnTitles(colTitles);
-
- //Check method SetColumnTitle
- _attr->SetColumnTitle(1, "new_title");
-
- //Check method GetColumnTitles
- vector<string> ct = _attr->GetColumnTitles();
-
- CPPUNIT_ASSERT(ct.size() == 2 && ct[0] == "new_title" && ct[1] == "title2");
-
- vector<string> rowUnits;
- rowUnits.push_back("unit1");
- rowUnits.push_back("unit2");
-
- //Check method SetRowUnits
- _attr->SetRowUnits(rowUnits);
-
- //Check method SetRowUnit
- _attr->SetRowUnit(1, "new_unit");
-
- //Check method GetRowUnits
- vector<string> ru = _attr->GetRowUnits();
-
- CPPUNIT_ASSERT(ru.size() == 2 && ru[0] == "new_unit" && ru[1] == "unit2");
-
- //Check method GetNbColumns
- CPPUNIT_ASSERT(_attr->GetNbColumns() == 2);
-
- //Check method AddRow
- vector<int> data;
- data.push_back(11);
- data.push_back(22);
-
- _attr->AddRow(data);
-
- CPPUNIT_ASSERT(_attr->GetNbRows() == 3);
-
- //Check method GetRow
- vector<int> data2 = _attr->GetRow(3);
-
- CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == 11 && data2[1] == 22);
-
- //Check method SetRow
- data[0] = 33;
- _attr->SetRow(3, data);
-
- data2 = _attr->GetRow(3);
-
- CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == 33 && data2[1] == 22);
-
- //Check method AddColumn
- data[0] = -11;
- data[1] = -22;
- data.push_back(-33);
-
- _attr->AddColumn(data);
-
-
- CPPUNIT_ASSERT(_attr->GetNbColumns() == 3);
-
- //Check method GetColumn
- data2 = _attr->GetColumn(3);
-
- CPPUNIT_ASSERT(data2.size() == 3 && data2[0] == -11 && data2[1] == -22 && data2[2] == -33);
-
- //Check method SetColumn
- data[0] = 11;
- _attr->SetColumn(3, data);
-
- data2 = _attr->GetColumn(3);
-
- CPPUNIT_ASSERT(data2.size() == 3 && data2[0] == 11 && data2[1] == -22 && data2[2] == -33);
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeTableOfReal
- * Use code of SALOMEDS_AttributeTableOfReal.cxx
- */
-void SALOMEDSTest::testAttributeTableOfReal()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeTableOfReal
- _PTR(AttributeTableOfReal) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeTableOfReal");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method SetTitle
- _attr->SetTitle("Table_1");
-
- //Check method GetTitle
- CPPUNIT_ASSERT(_attr->GetTitle() == "Table_1");
-
- //Check method SetNbColumns
- _attr->SetNbColumns(2);
-
- //Check method GetNbColumns
- CPPUNIT_ASSERT(_attr->GetNbColumns() == 2);
-
- //Check method HasValue
- CPPUNIT_ASSERT(!_attr->HasValue(1, 1));
-
- bool isCaught = false;
- try {
- _attr->GetValue(1, 1);
- }
- catch(...) {
- isCaught = true;
- }
- CPPUNIT_ASSERT(isCaught);
-
- //Check method PutValue
- _attr->PutValue(23.23, 1,1);
-
- CPPUNIT_ASSERT(_attr->HasValue(1, 1));
-
- //Check method GetValue
- CPPUNIT_ASSERT(_attr->GetValue(1, 1) == 23.23);
-
- //Check method GetRowSetIndices
- vector<int> rs = _attr->GetRowSetIndices(1);
-
- CPPUNIT_ASSERT(rs.size() == 1 && rs[0] == 1);
-
- _attr->PutValue(32.32, 2,2);
- CPPUNIT_ASSERT(_attr->HasValue(2, 2));
-
- vector<string> rowTitles;
- rowTitles.push_back("title1");
- rowTitles.push_back("title2");
-
- //Check method SetRowTitles
- _attr->SetRowTitles(rowTitles);
-
- //Check method SetRowTitle
- _attr->SetRowTitle(1, "new_title");
-
- //Check method GetRowTitles
- vector<string> rt = _attr->GetRowTitles();
-
- CPPUNIT_ASSERT(rt.size() == 2 && rt[0] == "new_title" && rt[1] == "title2");
-
- vector<string> colTitles;
- colTitles.push_back("title1");
- colTitles.push_back("title2");
-
- //Check method SetColumnTitles
- _attr->SetColumnTitles(colTitles);
-
- //Check method SetColumnTitle
- _attr->SetColumnTitle(1, "new_title");
-
- //Check method GetColumnTitles
- vector<string> ct = _attr->GetColumnTitles();
-
- CPPUNIT_ASSERT(ct.size() == 2 && ct[0] == "new_title" && ct[1] == "title2");
-
- vector<string> rowUnits;
- rowUnits.push_back("unit1");
- rowUnits.push_back("unit2");
-
- //Check method SetRowUnits
- _attr->SetRowUnits(rowUnits);
-
- //Check method SetRowUnit
- _attr->SetRowUnit(1, "new_unit");
-
- //Check method GetRowUnits
- vector<string> ru = _attr->GetRowUnits();
-
- CPPUNIT_ASSERT(ru.size() == 2 && ru[0] == "new_unit" && ru[1] == "unit2");
-
- //Check method GetNbColumns
- CPPUNIT_ASSERT(_attr->GetNbColumns() == 2);
-
- //Check method AddRow
- vector<double> data;
- data.push_back(11.11);
- data.push_back(22.22);
-
- _attr->AddRow(data);
-
- CPPUNIT_ASSERT(_attr->GetNbRows() == 3);
-
- //Check method GetRow
- vector<double> data2 = _attr->GetRow(3);
-
- CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == 11.11 && data2[1] == 22.22);
-
- //Check method SetRow
- data[0] = 33.33;
- _attr->SetRow(3, data);
-
- data2 = _attr->GetRow(3);
-
- CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == 33.33 && data2[1] == 22.22);
-
- //Check method AddColumn
- data[0] = -11.11;
- data[1] = -22.22;
- data.push_back(-33.33);
-
- _attr->AddColumn(data);
-
- CPPUNIT_ASSERT(_attr->GetNbColumns() == 3);
-
- //Check method GetColumn
- data2 = _attr->GetColumn(3);
-
- CPPUNIT_ASSERT(data2.size() == 3 && data2[0] == -11.11 && data2[1] == -22.22 && data2[2] == -33.33);
-
- //Check method SetColumn
- data[0] = 11.11;
- _attr->SetColumn(3, data);
-
- data2 = _attr->GetColumn(3);
-
- CPPUNIT_ASSERT(data2.size() == 3 && data2[0] == 11.11 && data2[1] == -22.22 && data2[2] == -33.33);
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeTableOfString
- * Use code of SALOMEDS_AttributeTableOfString.cxx
- */
-void SALOMEDSTest::testAttributeTableOfString()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeTableOfString
- _PTR(AttributeTableOfString) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeTableOfString");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
- //Check method SetTitle
- _attr->SetTitle("Table_1");
-
- //Check method GetTitle
- CPPUNIT_ASSERT(_attr->GetTitle() == "Table_1");
-
- //Check method SetNbColumns
- _attr->SetNbColumns(2);
-
- //Check method GetNbColumns
- CPPUNIT_ASSERT(_attr->GetNbColumns() == 2);
-
- //Check method HasValue
- CPPUNIT_ASSERT(!_attr->HasValue(1, 1));
-
- bool isCaught = false;
- try {
- _attr->GetValue(1, 1);
- }
- catch(...) {
- isCaught = true;
- }
- CPPUNIT_ASSERT(isCaught);
-
-
- //Check method PutValue
- _attr->PutValue("23", 1,1);
-
- CPPUNIT_ASSERT(_attr->HasValue(1, 1));
-
- //Check method GetValue
- CPPUNIT_ASSERT(_attr->GetValue(1, 1) == "23");
-
- //Check method GetRowSetIndices
- vector<int> rs = _attr->GetRowSetIndices(1);
-
- CPPUNIT_ASSERT(rs.size() == 1 && rs[0] == 1);
-
- _attr->PutValue("32", 2,2);
- CPPUNIT_ASSERT(_attr->HasValue(2, 2));
-
- vector<string> rowTitles;
- rowTitles.push_back("title1");
- rowTitles.push_back("title2");
-
- //Check method SetRowTitles
- _attr->SetRowTitles(rowTitles);
-
- //Check method SetRowTitle
- _attr->SetRowTitle(1, "new_title");
-
- //Check method GetRowTitles
- vector<string> rt = _attr->GetRowTitles();
-
- CPPUNIT_ASSERT(rt.size() == 2 && rt[0] == "new_title" && rt[1] == "title2");
-
-
- vector<string> colTitles;
- colTitles.push_back("title1");
- colTitles.push_back("title2");
-
- //Check method SetColumnTitles
- _attr->SetColumnTitles(colTitles);
-
- //Check method SetColumnTitle
- _attr->SetColumnTitle(1, "new_title");
-
- //Check method GetColumnTitles
- vector<string> ct = _attr->GetColumnTitles();
-
- CPPUNIT_ASSERT(ct.size() == 2 && ct[0] == "new_title" && ct[1] == "title2");
-
- vector<string> rowUnits;
- rowUnits.push_back("unit1");
- rowUnits.push_back("unit2");
-
- //Check method SetRowUnits
- _attr->SetRowUnits(rowUnits);
-
- //Check method SetRowUnit
- _attr->SetRowUnit(1, "new_unit");
-
- //Check method GetRowUnits
- vector<string> ru = _attr->GetRowUnits();
-
- CPPUNIT_ASSERT(ru.size() == 2 && ru[0] == "new_unit" && ru[1] == "unit2");
-
- //Check method GetNbColumns
- CPPUNIT_ASSERT(_attr->GetNbColumns() == 2);
-
- //Check method AddRow
- vector<string> data;
- data.push_back("11");
- data.push_back("22");
-
- _attr->AddRow(data);
-
- CPPUNIT_ASSERT(_attr->GetNbRows() == 3);
-
- //Check method GetRow
- vector<string> data2 = _attr->GetRow(3);
-
- CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == "11" && data2[1] == "22");
-
- //Check method SetRow
- data[0] = "33";
- _attr->SetRow(3, data);
-
- data2 = _attr->GetRow(3);
-
- CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == "33" && data2[1] == "22");
-
- //Check method AddColumn
- data[0] = "-11";
- data[1] = "-22";
- data.push_back("-33");
-
- _attr->AddColumn(data);
-
- CPPUNIT_ASSERT(_attr->GetNbColumns() == 3);
-
- //Check method GetColumn
- data2 = _attr->GetColumn(3);
-
- CPPUNIT_ASSERT(data2.size() == 3 && data2[0] == "-11" && data2[1] == "-22" && data2[2] == "-33");
-
- //Check method SetColumn
- data[0] = "11";
- _attr->SetColumn(3, data);
-
- data2 = _attr->GetColumn(3);
-
- CPPUNIT_ASSERT(data2.size() == 3 && data2[0] == "11" && data2[1] == "-22" && data2[2] == "-33");
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeTarget
- * Use code of SALOMEDS_AttributeTarget.cxx
- */
-void SALOMEDSTest::testAttributeTarget()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeTarget
- _PTR(AttributeTarget) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeTarget");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method Get
- CPPUNIT_ASSERT(_attr->Get().size() == 0);
-
- _PTR(SObject) so1 = study->CreateObjectID("0:1:2");
- studyBuilder->Addreference(so1, so);
-
- _PTR(SObject) so2 = study->CreateObjectID("0:1:3");
- studyBuilder->Addreference(so2, so1);
-
- //Check method Add
- _attr->Add(so1);
-
- _attr->Add(so2);
-
- //Check method Get
- vector< _PTR(SObject) > v = _attr->Get();
-
- CPPUNIT_ASSERT(v.size() == 2);
-
- CPPUNIT_ASSERT(v[0]->GetID() == "0:1:2");
-
- CPPUNIT_ASSERT(v[1]->GetID() == "0:1:3");
-
- //Check method Remove
- _attr->Remove(so1);
-
- v = _attr->Get();
-
- CPPUNIT_ASSERT(v.size() == 1);
-
- CPPUNIT_ASSERT(v[0]->GetID() == "0:1:3");
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeTextColor
- * Use code of SALOMEDS_AttributeTextColor.cxx
- */
-void SALOMEDSTest::testAttributeTextColor()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeTextColor
- _PTR(AttributeTextColor) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeTextColor");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- STextColor color;
- color.R = 0;
- color.G = 1;
- color.B = 2;
-
- //Check method SetTextColor
- _attr->SetTextColor(color);
-
- //Check method TextColor
- STextColor color2 = _attr->TextColor();
-
- CPPUNIT_ASSERT(color.R == color2.R);
-
- CPPUNIT_ASSERT(color.G == color2.G);
-
- CPPUNIT_ASSERT(color.B == color2.B);
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeTextHighlightColor
- * Use code of SALOMEDS_AttributeTextHighlightColor.cxx
- */
-void SALOMEDSTest::testAttributeTextHighlightColor()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeTextHighlightColor
- _PTR(AttributeTextHighlightColor) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeTextHighlightColor");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- STextColor color;
- color.R = 0;
- color.G = 1;
- color.B = 2;
-
- //Check method SetTextHighlightColor
- _attr->SetTextHighlightColor(color);
-
- //Check method TextHighlightColor
- STextColor color2 = _attr->TextHighlightColor();
-
- CPPUNIT_ASSERT(color.R == color2.R);
-
- CPPUNIT_ASSERT(color.G == color2.G);
-
- CPPUNIT_ASSERT(color.B == color2.B);
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeTreeNode
- * Use code of SALOMEDS_AttributeTreeNode.cxx
- */
-#define SALOMEDS_ALL_TESTS
-void SALOMEDSTest::testAttributeTreeNode()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeTreeNode
- _PTR(AttributeTreeNode) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeTreeNode");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- string TreeNodeID = "0e1c36e6-379b-4d90-ab3b-17a14310e648";
-
- _PTR(SObject) so1 = study->CreateObjectID("0:1:2");
-
- _PTR(AttributeTreeNode) _attr1 = studyBuilder->FindOrCreateAttribute(so1, "AttributeTreeNode");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr1);
-
- //Check method Label
- CPPUNIT_ASSERT(_attr1->Label() == "0:1:2");
-
- _PTR(SObject) so2 = study->CreateObjectID("0:1:3");
-
- _PTR(AttributeTreeNode) _attr2 = studyBuilder->FindOrCreateAttribute(so2, "AttributeTreeNode");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr2);
-
- //Check method SetFather
- _attr1->SetFather(_attr);
-
- //Check method HasFather
- CPPUNIT_ASSERT(_attr1->HasFather());
-
-#ifdef SALOMEDS_ALL_TESTS
- //Check method GetFather
- CPPUNIT_ASSERT(_attr1->GetFather()->Label() == _attr->Label());
-
- //Check method Append
- _attr->Append(_attr1);
-
- //Check possibility to Append to itself
- bool isRaised = false;
- try {
- _attr->Append(_attr);
- }catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
-
- _attr->Append(_attr2);
-
- //Check method HasNext
- CPPUNIT_ASSERT(_attr1->HasNext());
-
- //Check method GetNext
- CPPUNIT_ASSERT(_attr1->GetNext()->Label() == _attr2->Label());
-
- //Check method HasPrevious
- CPPUNIT_ASSERT(_attr2->HasPrevious());
-
- //Check method GetPrevious
- CPPUNIT_ASSERT(_attr2->GetPrevious()->Label() == _attr1->Label());
-
- //Check method Depth
- CPPUNIT_ASSERT(_attr->Depth() == 1 && _attr1->Depth() == 2);
-
- //Check method IsRoot
- CPPUNIT_ASSERT(_attr->IsRoot());
-
- //Check method IsFather
- CPPUNIT_ASSERT(_attr->IsFather(_attr1));
-
- //Check method IsDescendant
- CPPUNIT_ASSERT(_attr2->IsDescendant(_attr));
-
- //Check method GetFirst
- CPPUNIT_ASSERT(_attr->GetFirst()->Label() == _attr1->Label());
-
- _attr2->Remove();
-
- //Check method Prepend
- _attr->Prepend(_attr2);
-
- CPPUNIT_ASSERT(_attr->GetFirst()->Label() == _attr2->Label());
-
- //Check possibility to Prepend to itself
- isRaised = false;
- try {
- _attr->Prepend(_attr);
- }catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
-
- _attr1->Remove();
-
- //Check method InsertBefore
- _attr2->InsertBefore(_attr1);
-
- CPPUNIT_ASSERT(_attr->GetFirst()->Label() == _attr1->Label());
-
- //Check possibility to InsertBefore to itself
- isRaised = false;
- try {
- _attr->InsertBefore(_attr);
- }catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
-
- _attr1->Remove();
-
- //Check method InsertAfter
- _attr2->InsertAfter(_attr1);
-
- CPPUNIT_ASSERT(_attr->GetFirst()->Label() == _attr2->Label());
-
- //Check possibility to InsertAfter to itself
- isRaised = false;
- try {
- _attr->InsertAfter(_attr);
- }catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
-
- //Check method Remove
- _attr2->Remove();
-
- CPPUNIT_ASSERT(_attr->GetFirst()->Label() == _attr1->Label());
-
- //Check method SetTreeID and GetTreeID
- _attr2->SetTreeID(TreeNodeID);
-
- CPPUNIT_ASSERT(_attr2->GetTreeID() == TreeNodeID);
-#else
- cout << endl << "THE TEST IS NOT COMPLETE !!!" << endl;
-#endif
-
-
- //Try to create the attribute with given TreeID
- string value = "0e1c36e6-1111-4d90-ab3b-18a14310e648";
- _PTR(AttributeTreeNode) _attr_guid = studyBuilder->FindOrCreateAttribute(so, "AttributeTreeNodeGUID"+value);
- CPPUNIT_ASSERT(_attr_guid && _attr_guid->GetTreeID() == value);
-
- sm->Close(study);
-}
-#undef SALOMEDS_ALL_TESTS
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_AttributeUserID
- * Use code of SALOMEDS_AttributeUserID.cxx
- */
-void SALOMEDSTest::testAttributeUserID()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- //Create an attribute AttributeUserID
- _PTR(AttributeUserID) _attr = studyBuilder->FindOrCreateAttribute(so, "AttributeUserID");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- string value = "0e1c36e6-379b-4d90-ab3b-17a14310e648";
-
- //Check method SetValue
- _attr->SetValue(value);
-
- //Check method Value
- CPPUNIT_ASSERT(value == _attr->Value());
-
- //Try to create the attribute with given UserID
- value = "0e1c36e6-379b-4d90-ab3b-18a14310e648";
- _PTR(AttributeUserID) _attr2 = studyBuilder->FindOrCreateAttribute(so, "AttributeUserID"+value);
- CPPUNIT_ASSERT(_attr2 && _attr2->Value() == value);
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_ChildIterator
- * Use code of SALOMEDS_ChildIterator.cxx
- */
-void SALOMEDSTest::testChildIterator()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a SObject with entry 0:1:1
- _PTR(SObject) so = study->CreateObjectID("0:1:1");
-
- CPPUNIT_ASSERT(so);
-
- _PTR(SObject) so1 = studyBuilder->NewObjectToTag(so, 1);
- studyBuilder->NewObjectToTag(so1, 2);
-
- _PTR(ChildIterator) ci = study->NewChildIterator(so);
-
- //Check the creation of the ChildIterator
- CPPUNIT_ASSERT(ci);
-
- int count = 0;
- for(; ci->More(); ci->Next()) {
- //Check method Value
- CPPUNIT_ASSERT(ci->Value()->Tag() == 1);
- count++;
- }
-
- //Check that there is only one SObject on the first level of so
- CPPUNIT_ASSERT(count == 1);
-
- count = 0;
- int i = 1;
- for(ci->InitEx(true); ci->More(); ci->Next(), i++) {
- CPPUNIT_ASSERT(ci->Value()->Tag() == i);
- count++;
- }
-
- //Check that there are two SObject under so
- CPPUNIT_ASSERT(count == 2);
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_SComponent
- * Use code of SALOMEDS_SComponent.cxx
- */
-void SALOMEDSTest::testSComponent()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- _PTR(SComponent) sco = studyBuilder->NewComponent("Test");
-
- //Check the creation of the SComponent
- CPPUNIT_ASSERT(sco);
-
- //Create an attribute AttributeIOR
- _PTR(AttributeIOR) _attr = studyBuilder->FindOrCreateAttribute(sco, "AttributeIOR");
-
- //Check the attribute creation
- CPPUNIT_ASSERT(_attr);
-
- //Check method ComponentIOR
-
- string ior = _orb->object_to_string(_sm);
-
- _attr->SetValue(ior);
- string new_ior;
- CPPUNIT_ASSERT(sco->ComponentIOR(new_ior));
-
- CPPUNIT_ASSERT(new_ior == ior);
-
- //Check method ComponentDataType
- CPPUNIT_ASSERT(sco->ComponentDataType() == "Test");
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_SComponentIterator
- * Use code of SALOMEDS_SComponentIterator.cxx
- */
-void SALOMEDSTest::testSComponentIterator()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create two SComponents
- studyBuilder->NewComponent("Test1");
- studyBuilder->NewComponent("Test2");
-
- vector<string> v;
- v.push_back("Test1");
- v.push_back("Test2");
-
- _PTR(SComponentIterator) ci = study->NewComponentIterator();
-
- //Check the creation of the SComponentIterator
- CPPUNIT_ASSERT(ci);
-
- for(int i = 0; ci->More(); ci->Next(), i++) {
- //Check method Value
- CPPUNIT_ASSERT(i<2);
- CPPUNIT_ASSERT(ci->Value()->ComponentDataType() == v[i]);
- }
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_SObject
- * Use code of SALOMEDS_SObject.cxx
- */
-
-void SALOMEDSTest::testSObject()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("TestSObject");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a new SComponent
- _PTR(SComponent) sco = studyBuilder->NewComponent("Test");
-
- //Create new SObject
- _PTR(SObject) so = studyBuilder->NewObjectToTag(sco, 2);
-
- //Check the creation of the SObject
- CPPUNIT_ASSERT(so);
-
- //Check method GetID
- CPPUNIT_ASSERT(so->GetID() == "0:1:1:2");
-
- //Check method Tag
- CPPUNIT_ASSERT(so->Tag() == 2);
-
- //Check method GetFatherComponent
- _PTR(SComponent) father = so->GetFatherComponent();
- CPPUNIT_ASSERT(father->GetID() == sco->GetID());
-
- //Check method GetFather
- _PTR(SObject) so1 = studyBuilder->NewObject(so);
- CPPUNIT_ASSERT(so1->GetFather()->GetID() == so->GetID());
-
- //Check method FindAttribute
-
- _PTR(AttributeIOR) _attrIOR = studyBuilder->FindOrCreateAttribute(so, "AttributeIOR");
- _PTR(AttributeName) _attrName = studyBuilder->FindOrCreateAttribute(so, "AttributeName");
- _PTR(AttributeComment) _attrComment = studyBuilder->FindOrCreateAttribute(so, "AttributeComment");
-
- string ior = _orb->object_to_string(_sm);
- _attrIOR->SetValue(ior);
- _attrName->SetValue("SO name");
- _attrComment->SetValue("SO comment");
-
- _PTR(GenericAttribute) ga;
- CPPUNIT_ASSERT(so->FindAttribute(ga, "AttributeIOR"));
-
- //Try to find attribute with empty type
- CPPUNIT_ASSERT(!so->FindAttribute(ga, ""));
-
- //Check method ReferencedObject
- studyBuilder->Addreference(so1, so);
- _PTR(SObject) so2;
- CPPUNIT_ASSERT(so1->ReferencedObject(so2));
- CPPUNIT_ASSERT(so2->GetID() == so->GetID());
-
- //Check method FindSubObject
- CPPUNIT_ASSERT(so->FindSubObject(1, so2));
- CPPUNIT_ASSERT(so2->GetID() == so1->GetID());
-
- //Check method GetStudy
- CPPUNIT_ASSERT(so->GetStudy()->StudyId() == study->StudyId());
-
- //Check methods Name
- so->Name("test");
- CPPUNIT_ASSERT(so->Name() == "test");
-
- //Check method GetAllAttributes
- vector< _PTR(GenericAttribute) > v = so->GetAllAttributes();
-
- CPPUNIT_ASSERT(v.size() == 5); //+AttributeTarget +AttributeTreeNode
-
- //Check method GetName
- CPPUNIT_ASSERT(so->GetName() == "SO name");
-
- //Check method GetComment
- CPPUNIT_ASSERT(so->GetComment() == "SO comment");
-
- //Check method GetIOR
- CPPUNIT_ASSERT(so->GetIOR() == ior);
-
- //Check method Depth
- CPPUNIT_ASSERT(so->Depth() == 3);
-
- //Check method GetObject
- CORBA::Object_var obj = dynamic_cast<SALOMEDS_SObject*>(so.get())->GetObject();
- CPPUNIT_ASSERT(!CORBA::is_nil(obj));
-
- sm->Close(study);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_Study
- * Use code of SALOMEDS_Study.cxx
- */
-
-void SALOMEDSTest::testStudy()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("Test");
-
- //Check the creation of the study
- CPPUNIT_ASSERT(study);
-
- //Check method NewBuilder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
- CPPUNIT_ASSERT(studyBuilder);
-
- //Check method NewComponentIterator
- _PTR(SComponentIterator) componentIterator = study->NewComponentIterator();
-
- CPPUNIT_ASSERT(componentIterator);
-
- //Check method GetTransientReference
- CPPUNIT_ASSERT(!study->GetTransientReference().empty());
-
- //Check method StudyId
- CPPUNIT_ASSERT(study->StudyId() > 0);
-
- //Check method Name (get/set)
- CPPUNIT_ASSERT(study->Name() == "Test");
- study->Name("New name");
- CPPUNIT_ASSERT(study->Name() == "New name");
- study->Name("Test");
-
- //Check method URL (get/set)
- study->URL("");
- CPPUNIT_ASSERT(study->URL() == "");
- study->URL("some url");
- CPPUNIT_ASSERT(study->URL() == "some url");
-
- //Check method GetPersistentReference == URL
- CPPUNIT_ASSERT(study->GetPersistentReference() == "some url");
-
- //Check method IsSaved (get/set)
- study->IsSaved(true);
- CPPUNIT_ASSERT(study->IsSaved());
- study->IsSaved(false);
- CPPUNIT_ASSERT(!study->IsSaved());
-
- //Check method CreateObjectID
- _PTR(SObject) so = study->CreateObjectID("0:2:1:3");
- CPPUNIT_ASSERT(so);
-
- //Try to create SObject with empty and invalid entries
- CPPUNIT_ASSERT(!study->CreateObjectID(""));
- CPPUNIT_ASSERT(!study->CreateObjectID("entry"));
-
- //Check method NewChildIterator
- _PTR(ChildIterator) childIterator = study->NewChildIterator(so);
- CPPUNIT_ASSERT(childIterator);
-
- //Check method IsEmpty
- CPPUNIT_ASSERT(!study->IsEmpty());
-
- //Check method FindComponent
- _PTR(SComponent) sco1 = studyBuilder->NewComponent("test1");
- _PTR(SComponent) sco2 = study->FindComponent("test1");
- CPPUNIT_ASSERT(sco1 && sco2);
- CPPUNIT_ASSERT(sco1->GetID() == sco2->GetID());
- _PTR(AttributeName) name_attr_sco1 = studyBuilder->FindOrCreateAttribute(sco1, "AttributeName");
- CPPUNIT_ASSERT(name_attr_sco1);
- name_attr_sco1->SetValue("sco1");
-
- //Try to find component with empty type
- CPPUNIT_ASSERT(!study->FindComponent(""));
-
- //Check method GetComponentNames
- vector<string> components = study->GetComponentNames(""); //The context doesn't matter
- CPPUNIT_ASSERT(components.size() == 1 && components[0] == "sco1");
-
- //Check method FindComponentID
- _PTR(SComponent) sco3 = study->FindComponentID(sco1->GetID());
- CPPUNIT_ASSERT(sco3 && sco3->GetID() == sco1->GetID());
-
- //Try to find component with empty id
- CPPUNIT_ASSERT(!study->FindComponentID(""));
-
- _PTR(SObject) so1 = studyBuilder->NewObject(sco1);
- CPPUNIT_ASSERT(so1);
- _PTR(AttributeName) name_attr_so1 = studyBuilder->FindOrCreateAttribute(so1, "AttributeName");
- CPPUNIT_ASSERT(name_attr_so1);
- name_attr_so1->SetValue("so1");
-
- //Create an attribute AttributeIOR
- _PTR(AttributeIOR) ior_attr_so1 = studyBuilder->FindOrCreateAttribute(so1, "AttributeIOR");
- CPPUNIT_ASSERT(ior_attr_so1);
-
- string ior = _orb->object_to_string(_sm);
- ior_attr_so1->SetValue(ior);
-
- _PTR(SObject) so2 = studyBuilder->NewObject(so1);
- CPPUNIT_ASSERT(so2);
- _PTR(AttributeName) name_attr_so2 = studyBuilder->FindOrCreateAttribute(so2, "AttributeName");
- CPPUNIT_ASSERT(name_attr_so2);
- name_attr_so2->SetValue("so2");
-
- //Check method FindObject
- _PTR(SObject) so3 = study->FindObject("so1");
- CPPUNIT_ASSERT(so3 && so3->GetID() == so1->GetID());
-
- //Try to find SObject with empty name
- CPPUNIT_ASSERT(!study->FindObject(""));
-
- //Check method FindObjectID
- _PTR(SObject) so4 = study->FindObjectID(so1->GetID());
- CPPUNIT_ASSERT(so4 && so4->GetID() == so1->GetID());
-
- //Try to find SObject with empty ID
- CPPUNIT_ASSERT(!study->FindObjectID(""));
-
- //Check method FindObjectByName
- vector< _PTR(SObject) > v = study->FindObjectByName("so1", sco1->ComponentDataType());
- CPPUNIT_ASSERT(v.size()==1 && v[0]->GetID() == so1->GetID());
-
- //Try to find SObject with empty name and empty component type
- CPPUNIT_ASSERT((study->FindObjectByName("", "")).size() == 0);
-
- //Check method FindObjectByPath
- _PTR(SObject) path_so = study->FindObjectByPath("/"+sco1->GetName()+"/"+so1->GetName());
- CPPUNIT_ASSERT(path_so && path_so->GetID() == so1->GetID());
-
- //Check method FindObjectIOR
- _PTR(SObject) so5 = study->FindObjectIOR(ior);
- CPPUNIT_ASSERT(so5 && so5->GetID() == so1->GetID());
-
- //Try to find SObject with empty IOR
- CPPUNIT_ASSERT(!study->FindObjectIOR(""));
-
- //Check method GetObjectPath
- string path = study->GetObjectPath(so2);
-
- //Try to get path of NULL SObject
- _PTR(SObject) emptySO;
- path = study->GetObjectPath(emptySO);
- CPPUNIT_ASSERT(path.empty());
-
- //Check method SetContext
- study->SetContext("/sco1");
- CPPUNIT_ASSERT(study->GetContext() == "/sco1");
-
- //Check method FindObjectByPath
- _PTR(SObject) so6 = study->FindObjectByPath("so1");
- CPPUNIT_ASSERT(so6 && so6->GetID() == so1->GetID());
-
-
- //Try to find SObject with empty path
- _PTR(SObject) tmp = study->FindObjectByPath(""); //Must return the Context SObject
- CPPUNIT_ASSERT(tmp && tmp->GetID() == sco1->GetID());
-
- study->SetContext("/"); //Root
-
- //Check method GetObjectNames
- vector<string> vs = study->GetObjectNames("/sco1");
- CPPUNIT_ASSERT(vs.size() == 2);
-
- //Check method GetDirectoryNames
- _PTR(AttributeLocalID) locid_attr_sco1 = studyBuilder->FindOrCreateAttribute(sco1, "AttributeLocalID");
- CPPUNIT_ASSERT(locid_attr_sco1);
- locid_attr_sco1->SetValue(16661); //DIRECTORYID
- _PTR(AttributeLocalID) locid_attr_so1 = studyBuilder->FindOrCreateAttribute(so1, "AttributeLocalID");
- CPPUNIT_ASSERT(locid_attr_so1);
- locid_attr_so1->SetValue(16661); //DIRECTORYID
- vs = study->GetDirectoryNames(""); //Empty context (the current is taken)
- CPPUNIT_ASSERT(vs.size() == 2);
-
- //Check method GetFileNames
- locid_attr_sco1->SetValue(26662); //FILELOCALID
- _PTR(AttributePersistentRef) persref_attr_sco1 = studyBuilder->FindOrCreateAttribute(sco1, "AttributePersistentRef");
- CPPUNIT_ASSERT(persref_attr_sco1);
- persref_attr_sco1->SetValue("FILE: filename1");
- locid_attr_so1->SetValue(26662); //FILELOCALID
- _PTR(AttributePersistentRef) persref_attr_so1 = studyBuilder->FindOrCreateAttribute(so1, "AttributePersistentRef");
- CPPUNIT_ASSERT(persref_attr_so1);
- persref_attr_so1->SetValue("FILE: filename2");
- vs = study->GetFileNames("");
- CPPUNIT_ASSERT(vs.size() == 2 && vs[0] == "filename1" && vs[1] == "filename2");
-
- //Check method StudyId (get/set)
- int id = study->StudyId();
- study->StudyId(-1);
- CPPUNIT_ASSERT(study->StudyId() == -1);
- study->StudyId(id);
-
- //Check method FindDependances
- studyBuilder->Addreference(so2, so1);
- studyBuilder->Addreference(sco1, so1);
- vector< _PTR(SObject) > vso = study->FindDependances(so1);
- CPPUNIT_ASSERT(vso.size() == 2 && vso[0]->GetID() == so2->GetID() && vso[1]->GetID() == sco1->GetID());
-
- //Check method GetProperties
- _PTR(AttributeStudyProperties) sp = study->GetProperties();
- CPPUNIT_ASSERT(sp);
-
- //Check Lock functionality
- sp->SetLocked(true);
- bool isLockRaised = false;
- try {
- name_attr_so1->SetValue("test");
- }
- catch(...) {
- isLockRaised = true;
- }
- CPPUNIT_ASSERT(isLockRaised);
-
- sp->SetLocked(false);
- isLockRaised = false;
- try {
- name_attr_so1->SetValue("test");
- }
- catch(...) {
- isLockRaised = true;
- }
- CPPUNIT_ASSERT(!isLockRaised);
-
- //Check method GetLastModificationDate
- sp->SetModification("srn", 1, 2, 3, 4, 5);
- sp->SetModification("srn", 6, 7, 8, 9, 10);
- string date = study->GetLastModificationDate();
-
- CPPUNIT_ASSERT(date == "08/09/0010 07:06");
-
- //Check method GetModificationsDate
- vs = study->GetModificationsDate();
- CPPUNIT_ASSERT(vs.size() == 2 && vs[0] == "03/04/0005 02:01" && vs[1] == "08/09/0010 07:06");
-
- //Check method GetCommonParameters
- _PTR(AttributeParameter) cp = study->GetCommonParameters("id", 1); //Save point = 1
- CPPUNIT_ASSERT(cp);
- cp->SetBool("test_true", true);
- cp->SetBool("test_false", false);
- _PTR(AttributeParameter) cp2 = study->GetCommonParameters("id", 1); //Save point = 1
- CPPUNIT_ASSERT(cp2);
- CPPUNIT_ASSERT(cp2->GetBool("test_true") && !cp2->GetBool("test_false"));
- _PTR(AttributeParameter) cp21 = study->GetCommonParameters("id", 2); //Save point = 2
- CPPUNIT_ASSERT(cp21);
- CPPUNIT_ASSERT(!cp21->IsSet("test_true", PT_BOOLEAN) && !cp21->IsSet("test_false", PT_BOOLEAN));
-
- //Check method GetModuleParameters
- _PTR(AttributeParameter) cp3 = study->GetModuleParameters("id", "module name", 1); //Save point = 1, name = "module name"
- CPPUNIT_ASSERT(cp3);
- cp3->SetBool("test_true", true);
- cp3->SetBool("test_false", false);
- _PTR(AttributeParameter) cp4 = study->GetModuleParameters("id", "module name", 1); //Save point = 1, name = "module name"
- CPPUNIT_ASSERT(cp4);
- CPPUNIT_ASSERT(cp4->GetBool("test_true") && !cp4->GetBool("test_false"));
- _PTR(AttributeParameter) cp5 = study->GetModuleParameters("id", "module name 2", 1); //Save point = 1, name = "module name 2"
- CPPUNIT_ASSERT(cp5);
- CPPUNIT_ASSERT(!cp5->IsSet("test_true", PT_BOOLEAN) && !cp5->IsSet("test_false", PT_BOOLEAN));
- _PTR(AttributeParameter) cp6 = study->GetModuleParameters("id", "module name", 2); //Save point = 2, name = "module name"
- CPPUNIT_ASSERT(cp6);
- CPPUNIT_ASSERT(!cp6->IsSet("test_true", PT_BOOLEAN) && !cp6->IsSet("test_false", PT_BOOLEAN));
-
- //Check method GetUseCaseBuilder
- _PTR(UseCaseBuilder) ub = study->GetUseCaseBuilder();
- CPPUNIT_ASSERT(ub);
-
- //Check method SetStudyLock
- study->SetStudyLock("locker1");
-
- //Check method IsStudyLocked
- CPPUNIT_ASSERT(study->IsStudyLocked());
-
- //Check method GetLockerID
- study->SetStudyLock("locker2");
- vs = study->GetLockerID();
- CPPUNIT_ASSERT(vs.size() == 2 && vs[0] == "locker1" && vs[1] == "locker2");
-
- //Check method UnLockStudy
- study->UnLockStudy("locker1");
- CPPUNIT_ASSERT(study->IsStudyLocked());
- vs = study->GetLockerID();
- CPPUNIT_ASSERT(vs.size() == 1 && vs[0] == "locker2");
- study->UnLockStudy("locker2");
- CPPUNIT_ASSERT(!study->IsStudyLocked());
- vs = study->GetLockerID();
- CPPUNIT_ASSERT(vs.size() == 0);
-
- //Check method EnableUseCaseAutoFilling
- study->EnableUseCaseAutoFilling(false);
- _PTR(SObject) uso1 = study->NewBuilder()->NewObject(sco1);
- vector< _PTR(GenericAttribute) > va1 = uso1->GetAllAttributes();
- CPPUNIT_ASSERT(va1.size() == 0);
-
- study->EnableUseCaseAutoFilling(true);
- _PTR(SObject) uso2 = study->NewBuilder()->NewObject(sco1);
- vector< _PTR(GenericAttribute) > va2 = uso2->GetAllAttributes();
- CPPUNIT_ASSERT(va2.size() == 1); // +AttributeTreeNode
-
- //Check method DumpStudy
- study->DumpStudy(".", "SRN", false);
-
- fstream f("SRN.py");
- char buffer[128];
- buffer[81] = (char)0;
- f.getline(buffer, 80);
- string line(buffer);
-
- f.close();
- system("rm -f SRN.py");
- CPPUNIT_ASSERT(line == "### This file is generated by SALOME automatically by dump python functionality");
-
- //Check method Close
- bool isException = false;
- try {
- sm->Close(study); //Close is called inside StudyManager::Close
- }
- catch(...) {
- isException = true;
- }
- CPPUNIT_ASSERT(!isException);
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_StudyBuilder
- * Use code of SALOMEDS_StudyBuilder.cxx
- */
-
-void SALOMEDSTest::testStudyBuilder()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("TestStudyBuilder");
-
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
-
- //Check the StudyBuilder creation
- CPPUNIT_ASSERT(studyBuilder);
-
- //Check method NewComponent
- _PTR(SComponent) sco1 = studyBuilder->NewComponent("Test");
- CPPUNIT_ASSERT(sco1 && sco1->ComponentDataType() == "Test");
-
- //Check method DefineComponentInstance
- string ior = _orb->object_to_string(_sm);
- studyBuilder->DefineComponentInstance(sco1, ior);
- string newior;
- sco1->ComponentIOR(newior);
- CPPUNIT_ASSERT(newior == ior);
-
- //Check method RemoveComponent
- studyBuilder->RemoveComponent(sco1);
- _PTR(SComponent) sco2 = study->FindComponent("Test");
- CPPUNIT_ASSERT(!sco2);
-
- //Try to create and find the component with empty type
- _PTR(SComponent) sco_empty = studyBuilder->NewComponent("");
- CPPUNIT_ASSERT(!sco_empty);
-
- _PTR(SComponent) sco3 = studyBuilder->NewComponent("NewComp");
- CPPUNIT_ASSERT(sco3);
-
- //Check method NewObject
- _PTR(SObject) so1 = studyBuilder->NewObject(sco3);
- CPPUNIT_ASSERT(so1);
- string id1 = so1->GetID();
-
- //Check method NewObjectToTag
- _PTR(SObject) so2 = studyBuilder->NewObjectToTag(so1, 2);
- CPPUNIT_ASSERT(so2 && so2->Tag() == 2);
- string id2 = so2->GetID();
-
- //Check method FindOrCreateAttribute
- _PTR(SObject) so3 = studyBuilder->NewObject(sco3);
- CPPUNIT_ASSERT(so3);
- _PTR(AttributeName) an3 = studyBuilder->FindOrCreateAttribute(so3, "AttributeName");
- CPPUNIT_ASSERT(an3);
-
- //Try to create attribute with invalid type
- CPPUNIT_ASSERT(!studyBuilder->FindOrCreateAttribute(so3, "invalid type"));
-
- //Check method FindAttribute
- _PTR(GenericAttribute) ga;
- CPPUNIT_ASSERT(studyBuilder->FindAttribute(so3, ga, "AttributeName"));
-
- //Try to find attribute with invalid type
- CPPUNIT_ASSERT(!studyBuilder->FindAttribute(so3, ga, "invalid type"));
-
- //Check method RemoveObject
- studyBuilder->RemoveObject(so3);
- CPPUNIT_ASSERT(!studyBuilder->FindAttribute(so3, ga, "AttributeName"));
-
- //Check method RemoveObjectWithChildren
- _PTR(AttributeName) an2 = studyBuilder->FindOrCreateAttribute(so2, "AttributeName");
- CPPUNIT_ASSERT(an2);
- studyBuilder->RemoveObjectWithChildren(so1);
- CPPUNIT_ASSERT(!studyBuilder->FindAttribute(so2, ga, "AttributeName"));
-
- //Check method RemoveAttribute
- _PTR(AttributeName) an1 = studyBuilder->FindOrCreateAttribute(so1, "AttributeName");
- CPPUNIT_ASSERT(an1);
- CPPUNIT_ASSERT(studyBuilder->FindAttribute(so1, ga, "AttributeName"));
- studyBuilder->RemoveAttribute(so1, "AttributeName");
- CPPUNIT_ASSERT(!studyBuilder->FindAttribute(so1, ga, "AttributeName"));
-
- //Check method Addreference
- studyBuilder->Addreference(so2, so1);
- _PTR(SObject) refSO;
- CPPUNIT_ASSERT(so2->ReferencedObject(refSO) && refSO->GetID() == so1->GetID());
-
- //Try to set reference to NULL SObject
- bool isRaised = false;
- _PTR(SObject) empty_so;
- try {
- studyBuilder->Addreference(so2, empty_so);
- }
- catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
-
- //Check method RemoveReference
- studyBuilder->RemoveReference(so2);
- CPPUNIT_ASSERT(!so2->ReferencedObject(refSO));
-
- //Check method SetGUID and IsGUID
- string value = "0e1c36e6-379b-4d90-ab3b-17a14310e648";
- studyBuilder->SetGUID(so1, value);
-
- CPPUNIT_ASSERT(studyBuilder->IsGUID(so1, value));
-
-/* Not implemented
- //Check method UndoLimit (set/get)
- studyBuilder->UndoLimit(10);
- CPPUNIT_ASSERT(studyBuilder->UndoLimit() == 10);
-*/
-
- //Check method SetName
- studyBuilder->SetName(so1, "new name");
- CPPUNIT_ASSERT(so1->GetName() == "new name");
-
- //Try to set empty Name
- studyBuilder->SetName(so1, "");
- CPPUNIT_ASSERT(so1->GetName() == "");
-
- //Check method SetComment
- studyBuilder->SetComment(so1, "new comment");
- CPPUNIT_ASSERT(so1->GetComment() == "new comment");
-
- //Check method empty Comment
- studyBuilder->SetComment(so1, "");
- CPPUNIT_ASSERT(so1->GetComment() == "");
-
- //Try to set empty IOR
- studyBuilder->SetIOR(so1, "");
- CPPUNIT_ASSERT(so1->GetIOR() == "");
-
- //Check method SetIOR
- studyBuilder->SetIOR(so1, ior);
- CPPUNIT_ASSERT(so1->GetIOR() == ior);
-
- sm->Close(study);
-
- //Check method LoadWith
- _PTR(Study) study2 = sm->NewStudy("Study2");
-
- SALOME_NamingService NS(_orb);
- CORBA::Object_var obj = SALOME_LifeCycleCORBA(&NS).FindOrLoad_Component("FactoryServer", "SMESH");
- CPPUNIT_ASSERT(!CORBA::is_nil(obj));
-
- MESSAGE("Created a new SMESH component");
-
- SALOMEDS::Driver_var drv = SALOMEDS::Driver::_narrow(obj);
- CPPUNIT_ASSERT(!CORBA::is_nil(drv));
-
- _PTR(StudyBuilder) sb2 = study2->NewBuilder();
- _PTR(SComponent) sco = sb2->NewComponent("SMESH");
-
- ior = _orb->object_to_string(drv);
- sb2->DefineComponentInstance(sco, ior);
-
- sm->SaveAs("srn_SALOMEDS_UnitTests.hdf", study2, false);
- sm->Close(study2);
-
- _PTR(Study) study3 = sm->Open("srn_SALOMEDS_UnitTests.hdf");
- _PTR(StudyBuilder) sb3 = study3->NewBuilder();
- _PTR(SComponent) aComp = study3->FindComponent("SMESH");
- CPPUNIT_ASSERT(aComp);
-
- CORBA::Object_var obj2 = SALOME_LifeCycleCORBA(&NS).FindOrLoad_Component("FactoryServer", "SMESH");
- CPPUNIT_ASSERT(!CORBA::is_nil(obj2));
- SALOMEDS::Driver_var drv2 = SALOMEDS::Driver::_narrow(obj2);
- ior = _orb->object_to_string(drv2);
-
- isRaised = false;
- try {
- //getchar();
- sb3->LoadWith(aComp, ior);
- }
- catch(...) {
- isRaised = true;
- }
-
-
- CPPUNIT_ASSERT(!isRaised);
-
- ior = "";
- aComp->ComponentIOR(ior);
- CPPUNIT_ASSERT(!ior.empty());
-
- system("rm -f srn_SALOMEDS_UnitTests.hdf");
-
- //Check method AddDirectory
- _PTR(AttributeName) na1 = sb3->FindOrCreateAttribute(aComp, "AttributeName");
- na1->SetValue("Component");
-
- isRaised = false;
- try {
- sb3->AddDirectory("/Component/Dir1");
- } catch(...) {
- isRaised = true;
- }
-
-
- CPPUNIT_ASSERT(!isRaised);
- _PTR(SObject) so5 = study3->FindObjectByPath("/Component/Dir1");
- CPPUNIT_ASSERT(so5);
-
- isRaised = false;
- try {
- sb3->AddDirectory("/Component/Dir1"); //Attempt to create the same directory
- } catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
-
- isRaised = false;
- try {
- sb3->AddDirectory("/MyComponent/Dir1"); //Attempt to create the invalid directory
- } catch(...) {
- isRaised = true;
- }
- CPPUNIT_ASSERT(isRaised);
-
- sm->Close(study3);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_StudyManager
- * Use code of SALOMEDS_StudyManager.cxx
- */
-void SALOMEDSTest::testStudyManager()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
-
- CPPUNIT_ASSERT(sm);
-
- //Check method NewStudy
- _PTR(Study) study1 = sm->NewStudy("Study1");
- CPPUNIT_ASSERT(study1);
-
- _PTR(Study) study2 = sm->NewStudy("Study2");
- CPPUNIT_ASSERT(study2);
-
- //Check method GetStudyByName
- _PTR(Study) study3 = sm->GetStudyByName("Study1");
- CPPUNIT_ASSERT(study3->StudyId() == study1->StudyId());
- CPPUNIT_ASSERT(study3->Name() == study1->Name());
-
- //Check method GetStudyByName with empty name
- CPPUNIT_ASSERT(!sm->GetStudyByName(""));
-
- //Try to create Study with empty name
- _PTR(Study) study_empty = sm->NewStudy("");
- CPPUNIT_ASSERT(study_empty);
- CPPUNIT_ASSERT(sm->GetStudyByName(""));
- sm->Close(study_empty);
-
- //Check method FindStudyByID
- _PTR(Study) study4 = sm->GetStudyByID(study2->StudyId());
- CPPUNIT_ASSERT(study4->StudyId() == study2->StudyId());
- CPPUNIT_ASSERT(study4->Name() == study2->Name());
-
- //Check method GetOpenStudies
- vector<string> v = sm->GetOpenStudies();
- CPPUNIT_ASSERT(v.size() == 2);
-
- //Check method Close
- int id = study2->StudyId();
- sm->Close(study2);
- CPPUNIT_ASSERT(!sm->GetStudyByID(id));
-
- //Check method GetStudyByID for invalid ID
- CPPUNIT_ASSERT(!sm->GetStudyByID(-1));
-
- //Check methods CanPaste, CanCopy, Copy, Paste
- _PTR(StudyBuilder) sb1 = study1->NewBuilder();
- _PTR(SComponent) sco1 = sb1->NewComponent("Test");
- _PTR(SObject) so1 = sb1->NewObject(sco1);
- _PTR(AttributeName) na1 = sb1->FindOrCreateAttribute(so1, "AttributeName");
- CPPUNIT_ASSERT(na1);
- na1->SetValue("Some name");
-
- CPPUNIT_ASSERT(!sm->CanCopy(so1)); //The father component has no IOR
-
- CPPUNIT_ASSERT(sm->Copy(so1));
-
- CPPUNIT_ASSERT(!sm->CanPaste(so1)); //The father component has no IOR
-
- _PTR(SObject) so1_2 = sb1->NewObject(sco1);
- _PTR(SObject) pasted_so = sm->Paste(so1_2);
- CPPUNIT_ASSERT(pasted_so);
-
- _PTR(AttributeName) na2 = sb1->FindOrCreateAttribute(pasted_so, "AttributeName");
- CPPUNIT_ASSERT(na2 && na2->Value() == "Some name");
-
-
- //Check method SaveAs
- sm->SaveAs("srn_UnitTest_Save.hdf", study1, false);
- string url = study1->URL();
- sm->Close(study1);
-
- //Check method Open
- _PTR(Study) study1_opened = sm->Open("srn_UnitTest_Save.hdf"); //Contains Test component
- system("rm -f srn_UnitTest_Save.hdf");
- url = study1->URL();
- CPPUNIT_ASSERT(study1_opened);
- CPPUNIT_ASSERT(url == "srn_UnitTest_Save.hdf");
-
- //Check method Save
- _PTR(StudyBuilder) sb3 = study1_opened->NewBuilder();
- _PTR(SComponent) sco3 = study1_opened->FindComponent("Test");
- CPPUNIT_ASSERT(sco3);
- // Add a new SObject with AttributeName that contains "Saved study" string
- _PTR(SObject) so3 = sb3->NewObject(sco3);
- string soID = so3->GetID();
- _PTR(AttributeName) na3 = sb3->FindOrCreateAttribute(so3, "AttributeName");
- CPPUNIT_ASSERT(na3);
-
- na3->SetValue("Saved study");
-
- // Save and close the study
- sm->Save(study1_opened, false);
-
- sm->Close(study1_opened);
-
- // Open saved study and find the created SObject with AttributeName, then compare the stored string
- _PTR(Study) study2_opened = sm->Open("srn_UnitTest_Save.hdf");
-
- system("rm -f srn_UnitTest_Save.hdf");
-
- CPPUNIT_ASSERT(study2_opened);
-
- _PTR(SObject) so4 = study2_opened->CreateObjectID(soID);
- _PTR(StudyBuilder) sb4 = study2_opened->NewBuilder();
- _PTR(AttributeName) na4 = sb4->FindOrCreateAttribute(so4, "AttributeName");
- CPPUNIT_ASSERT(na4 && na4->Value() == "Saved study"); //Compare the value of restored attribute with string that has to be saved.
-
- //Check method SaveAsASCII
- sm->SaveAsASCII("srn_UnitTest_SaveASCII.hdf", study2_opened, false);
- url = study2_opened->URL();
- sm->Close(study2_opened);
-
- _PTR(Study) study3_opened = sm->Open("srn_UnitTest_SaveASCII.hdf"); //Contains Test component
- system("rm -f srn_UnitTest_SaveASCII.hdf");
- CPPUNIT_ASSERT(study3_opened);
- CPPUNIT_ASSERT(url == "srn_UnitTest_SaveASCII.hdf");
-
- //Check method SaveASCII
- _PTR(StudyBuilder) sb5 = study3_opened->NewBuilder();
- _PTR(SComponent) sco5 = study3_opened->FindComponent("Test");
- CPPUNIT_ASSERT(sco5);
- // Add a new SObject with AttributeName that contains "Saved study" string
- _PTR(SObject) so5 = sb5->NewObject(sco5);
- soID = so5->GetID();
- _PTR(AttributeName) na5 = sb5->FindOrCreateAttribute(so5, "AttributeName");
- CPPUNIT_ASSERT(na5);
- na5->SetValue("Saved study ASCII");
- // Save and close the study
- sm->Save(study3_opened, false);
- sm->Close(study3_opened);
-
- // Open saved study and find the created SObject with AttributeName, then compare the stored string
- _PTR(Study) study4_opened = sm->Open("srn_UnitTest_SaveASCII.hdf");
- system("rm -f srn_UnitTest_SaveASCII.hdf");
- CPPUNIT_ASSERT(study4_opened);
- _PTR(SObject) so6 = study4_opened->CreateObjectID(soID);
- _PTR(StudyBuilder) sb6 = study4_opened->NewBuilder();
- _PTR(AttributeName) na6 = sb6->FindOrCreateAttribute(so6, "AttributeName");
- CPPUNIT_ASSERT(na6 && na6->Value() == "Saved study ASCII"); //Compare the value of restored attribute with string that has to be saved.
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-/*!
- * Check all methods of SALOMEDS_UseCaseBuilder and UseCaseIterator
- * Use code of SALOMEDS_UseCaseBuilder.cxx and SALOMEDS_UseCaseIterator.cxx
- */
-
-#define SALOMEDS_ALL_TESTS
-
-void SALOMEDSTest::testUseCase()
-{
- //Create or find the Study manager
- _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
- CPPUNIT_ASSERT(sm);
-
- //Create a new study
- _PTR(Study) study = sm->NewStudy("TestSObject");
- CPPUNIT_ASSERT(study);
-
- //Create Study Builder
- _PTR(StudyBuilder) studyBuilder = study->NewBuilder();
- CPPUNIT_ASSERT(studyBuilder);
-
- //Create a new UseCaseBuilder
- _PTR(UseCaseBuilder) builder = study->GetUseCaseBuilder();
- CPPUNIT_ASSERT(builder);
-
- //Check method AddUseCase
- _PTR(SObject) root1 = builder->AddUseCase("UseCase_1");
- _PTR(SObject) root2 = builder->AddUseCase("UseCase_2");
- CPPUNIT_ASSERT(root1 && root2);
-
- //Check method SetCurrentObject
- builder->SetCurrentObject(root1);
-
- //Check method GetCurrentObject
- CPPUNIT_ASSERT(builder->GetCurrentObject() && builder->GetCurrentObject()->GetID() == root1->GetID());
-
- //Check method SetRootCurrent
- CPPUNIT_ASSERT(builder->SetRootCurrent());
- CPPUNIT_ASSERT(builder->GetCurrentObject()->GetID() == "0:2"); //Root in UseCases is always placed at label 0:2
-
- //Check method IsUseCase
- CPPUNIT_ASSERT(builder->IsUseCase(root1) && builder->IsUseCase(root2));
-
- //Check method SetName
- builder->SetName("A root use case");
-
- //Check method GetName
- CPPUNIT_ASSERT(builder->GetName() == "A root use case");
-
-#ifdef SALOMEDS_ALL_TESTS
- //Check method GetUseCaseIterator
- builder->SetRootCurrent();
- _PTR(SObject) nullObject;
- _PTR(UseCaseIterator) root_it = builder->GetUseCaseIterator(nullObject); //The iterator on all UseCases
- root_it->Init(false); //Only the first level
- CPPUNIT_ASSERT(root_it->More());
- CPPUNIT_ASSERT(root_it->Value()->GetID() == root1->GetID());
- root_it->Next();
- CPPUNIT_ASSERT(root_it->More());
- CPPUNIT_ASSERT(root_it->Value()->GetID() == root2->GetID());
- root_it->Next();
- CPPUNIT_ASSERT(!root_it->More());
-#else
- cout << endl << "THE TEST IS NOT COMPLETE !!!" << endl;
-#endif
-
- builder->SetCurrentObject(root1);
- _PTR(UseCaseIterator) it = builder->GetUseCaseIterator(root1); //The iterator on the given UseCase
-
- //Check method Append
- _PTR(SObject) so1 = study->CreateObjectID("0:1:1");
- _PTR(SObject) so2 = study->CreateObjectID("0:1:2");
- CPPUNIT_ASSERT(builder->Append(so1));
-
- //Check methods Init, More, Next and Value of UseCaseIterator
- it->Init(false);
- CPPUNIT_ASSERT(it->More());
- CPPUNIT_ASSERT(it->Value()->GetID() == so1->GetID());
- it->Next();
- CPPUNIT_ASSERT(!it->More());
-
- //Check method AppendTo
- CPPUNIT_ASSERT(builder->AppendTo(so1, so2));
-
- //Check method HasChildren
- CPPUNIT_ASSERT(builder->HasChildren(so1));
- CPPUNIT_ASSERT(!builder->HasChildren(so2));
-
- //Check method Init of UseCaseIterator
- it->Init(false); //Only the first level
- CPPUNIT_ASSERT(it->More());
- CPPUNIT_ASSERT(it->Value()->GetID() == so1->GetID());
- it->Next();
- CPPUNIT_ASSERT(!it->More());
-
- it->Init(true); //All levels
- CPPUNIT_ASSERT(it->More());
- CPPUNIT_ASSERT(it->Value()->GetID() == so1->GetID());
- it->Next();
- CPPUNIT_ASSERT(it->More());
- CPPUNIT_ASSERT(it->Value()->GetID() == so2->GetID());
- it->Next();
- CPPUNIT_ASSERT(!it->More());
-
- //Check method Remove
- CPPUNIT_ASSERT(builder->Remove(so2));
- it->Init(true);
- CPPUNIT_ASSERT(it->More());
- CPPUNIT_ASSERT(it->Value()->GetID() == so1->GetID());
- it->Next();
- CPPUNIT_ASSERT(!it->More());
-
- CPPUNIT_ASSERT(builder->Append(so2));
-
- //Check method InsertBefore
- CPPUNIT_ASSERT(builder->InsertBefore(so2, so1));
-
- it->Init(false);
- CPPUNIT_ASSERT(it->More());
- CPPUNIT_ASSERT(it->Value()->GetID() == so2->GetID());
- it->Next();
- CPPUNIT_ASSERT(it->More());
- CPPUNIT_ASSERT(it->Value()->GetID() == so1->GetID());
-
- sm->Close(study);
-}
-#undef SALOMEDS_ALL_TESTS
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// --- include all SALOMEDS Test from basics until the present directory
-//
-#include "SALOMELocalTraceTest.hxx"
-#include "SALOMEDSImplTest.hxx"
-#include "SALOMEDSTest.hxx"
-
-// --- Registers the fixture into the 'registry'
-
-CPPUNIT_TEST_SUITE_REGISTRATION( SALOMEDSTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( SALOMEDSTest_Embedded );
-
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TextTestProgressListener.h>
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestRunner.h>
-#include <stdexcept>
-
-#include <iostream>
-#include <fstream>
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include "utilities.h"
-#include "Utils_SINGLETON.hxx"
-#include "Utils_ORB_INIT.hxx"
-#include "Basics_Utils.hxx"
-#include "SALOME_NamingService.hxx"
-#include "NamingService_WaitForServerReadiness.hxx"
-#include "SALOMEDS_StudyManager_i.hxx"
-
-using namespace std;
-
-// ============================================================================
-/*!
- * Main program source for Unit Tests with cppunit package does not depend
- * on actual tests, so we use the same for all partial unit tests.
- */
-// ============================================================================
-
-int main(int argc, char* argv[])
-{
- // --- Run Salome without GUI
-
- setenv("SALOME_trace", "file:./traceUnitTest.log", 1); // 1: overwrite
-
- system("runSalome -t &");
-
- // --- Wait till SALOMEDS server is launched
-
- char hostname[511];
- int size;
- gethostname(hostname, size);
- char* chr_port = getenv("SALOMEDS_UNITTESTS_PORT");
- string port;
- if(chr_port) port = chr_port;
- if(port.empty()) port = "2810";
- string cfg_file = string(getenv("HOME"))+"/.omniORB_"+string(hostname)+"_"+port+".cfg";
- setenv("OMNIORB_CONFIG", cfg_file.c_str(), 1);
-
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- CORBA::ORB_var orb = init(argc , argv ) ;
-
- sleep(15);
-
- string host; // = Kernel_Utils::GetHostname();
- char* wait_Superv = getenv("SALOMEDS_UNITTESTS_WAIT_SUPERVISOR");
- if(wait_Superv) host = Kernel_Utils::GetHostname();
-
- SALOME_NamingService NS(orb);
- if(host.empty())
- NamingService_WaitForServerReadiness(&NS, "/myStudyManager");
- else {
- string serverName = "/Containers/"+host+"/SuperVisionContainer";
- NamingService_WaitForServerReadiness(&NS, serverName);
- }
-
- CORBA::Object_var obj = NS.Resolve( "/myStudyManager" );
- if(CORBA::is_nil(obj)) {
- system("killSalome.py");
- return 1;
- }
-
- //Set up the environement for Embedded case
- string kernel_root = getenv("KERNEL_ROOT_DIR");
- CPPUNIT_ASSERT(!kernel_root.empty());
- kernel_root+="/share/salome/resources/kernel";
-
- CORBA::Object_var poaObj = orb->resolve_initial_references("RootPOA");
- if(!CORBA::is_nil(poaObj)) {
- PortableServer::POA_var poa = PortableServer::POA::_narrow(poaObj);
-
- SALOMEDS_StudyManager_i * aStudyManager_i = new SALOMEDS_StudyManager_i(orb, poa);
- // Activate the objects. This tells the POA that the objects are ready to accept requests.
- PortableServer::ObjectId_var aStudyManager_iid = poa->activate_object(aStudyManager_i);
- aStudyManager_i->register_name("/myStudyManager_embedded");
-
- // Obtain a POAManager, and tell the POA to start accepting
- // requests on its objects.
- PortableServer::POAManager_var pman = poa->the_POAManager();
- pman->activate();
- }
-
-
- // --- Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // --- Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // --- Add a listener that print dots as test run.
-#ifdef WIN32
- CPPUNIT_NS::TextTestProgressListener progress;
-#else
- CPPUNIT_NS::BriefTestProgressListener progress;
-#endif
- controller.addListener( &progress );
-
- // --- Get the top level suite from the registry
-
- CPPUNIT_NS::Test *suite =
- CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();
-
- // --- Adds the test to the list of test to run
-
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( suite );
- runner.run( controller);
-
- // --- Print test in a compiler compatible format.
-
- std::ofstream testFile;
- testFile.open("UnitTestsResult", std::ios::out | std::ios::trunc);
- //CPPUNIT_NS::CompilerOutputter outputter( &result, std::cerr );
- CPPUNIT_NS::CompilerOutputter outputter( &result, testFile );
- outputter.write();
-
- // --- Run the tests.
-
- bool wasSucessful = result.wasSuccessful();
- testFile.close();
-
- // --- Kill all created Salome process
-
- system("killSalome.py");
-
- // --- Return error code 1 if the one of test failed.
-
- return wasSucessful ? 0 : 1;
-}
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-import sys, os,signal,string,commands
-import runSalome
-import orbmodule
-import TestKiller
-
-# get SALOME environment :
-
-args, modules_list, modules_root_dir = runSalome.get_config()
-runSalome.set_env(args, modules_list, modules_root_dir)
-
-# launch CORBA naming server
-
-clt=orbmodule.client()
-
-# launch CORBA logger server
-
-myServer=runSalome.LoggerServer(args)
-myServer.run()
-clt.waitLogger("Logger")
-
-# execute Unit Test
-
-command = ['TestSALOMEDS']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
-
-# kill Test process
-
-TestKiller.killProcess(runSalome.process_id)
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# SALOMEDSClient: client interface of SALOMEDS
-# File : Makefile.am
-# Author : Guillaume Boulant (CSSI)
-# Module : KERNEL
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-salomeinclude_HEADERS=\
- SALOMEDSClient_definitions.hxx \
- SALOMEDSClient_AttributeComment.hxx \
- SALOMEDSClient_AttributeDrawable.hxx \
- SALOMEDSClient_AttributeExpandable.hxx \
- SALOMEDSClient_AttributeExternalFileDef.hxx \
- SALOMEDSClient_AttributeFileType.hxx \
- SALOMEDSClient_AttributeFlags.hxx \
- SALOMEDSClient_AttributeGraphic.hxx \
- SALOMEDSClient_AttributeIOR.hxx \
- SALOMEDSClient_AttributeInteger.hxx \
- SALOMEDSClient_AttributeLocalID.hxx \
- SALOMEDSClient_AttributeName.hxx \
- SALOMEDSClient_AttributeOpened.hxx \
- SALOMEDSClient_AttributePersistentRef.hxx \
- SALOMEDSClient_AttributePixMap.hxx \
- SALOMEDSClient_AttributePythonObject.hxx \
- SALOMEDSClient_AttributeReal.hxx \
- SALOMEDSClient_AttributeSelectable.hxx \
- SALOMEDSClient_AttributeSequenceOfInteger.hxx \
- SALOMEDSClient_AttributeSequenceOfReal.hxx \
- SALOMEDSClient_AttributeStudyProperties.hxx \
- SALOMEDSClient_AttributeTableOfInteger.hxx \
- SALOMEDSClient_AttributeTableOfReal.hxx \
- SALOMEDSClient_AttributeTableOfString.hxx \
- SALOMEDSClient_AttributeTarget.hxx \
- SALOMEDSClient_AttributeTextColor.hxx \
- SALOMEDSClient_AttributeTextHighlightColor.hxx \
- SALOMEDSClient_AttributeTreeNode.hxx \
- SALOMEDSClient_AttributeUserID.hxx \
- SALOMEDSClient_AttributeParameter.hxx \
- SALOMEDSClient_AttributeString.hxx \
- SALOMEDSClient_ChildIterator.hxx \
- SALOMEDSClient_GenericAttribute.hxx \
- SALOMEDSClient_SComponent.hxx \
- SALOMEDSClient_SComponentIterator.hxx \
- SALOMEDSClient_SObject.hxx \
- SALOMEDSClient_Study.hxx \
- SALOMEDSClient_StudyBuilder.hxx \
- SALOMEDSClient_StudyManager.hxx \
- SALOMEDSClient_UseCaseBuilder.hxx \
- SALOMEDSClient_UseCaseIterator.hxx \
- SALOMEDSClient_ClientFactory.hxx \
- SALOMEDSClient_IParameters.hxx \
- SALOMEDSClient.hxx
-
-#
-# ===============================================================
-# Local definitions
-# ===============================================================
-#
-
-# This local variable defines the list of CPPFLAGS common to all target in this package.
-COMMON_CPPFLAGS= \
- @BOOST_CPPFLAGS@ \
- -I$(top_builddir)/salome_adm/unix \
- -I$(top_builddir)/idl \
- @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
-
-
-
-# This local variable defines the list of dependant libraries common to all target in this package.
-COMMON_LIBS = $(top_builddir)/idl/libSalomeIDLKernel.la
-
-#
-# ===============================================================
-# Libraries targets
-# ===============================================================
-#
-lib_LTLIBRARIES = libSalomeDSClient.la
-libSalomeDSClient_la_SOURCES = \
- SALOMEDSClient_ClientFactory.cxx
-
-
-libSalomeDSClient_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSalomeDSClient_la_LDFLAGS = -Wl,-E -no-undefined -version-info=0:0:0
-libSalomeDSClient_la_LIBADD = $(COMMON_LIBS)
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef SALOMEDSCLIENT_HXX
-#define SALOMEDSCLIENT_HXX
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_AttributeComment.hxx"
-#include "SALOMEDSClient_AttributeDrawable.hxx"
-#include "SALOMEDSClient_AttributeExpandable.hxx"
-#include "SALOMEDSClient_AttributeExternalFileDef.hxx"
-#include "SALOMEDSClient_AttributeFileType.hxx"
-#include "SALOMEDSClient_AttributeFlags.hxx"
-#include "SALOMEDSClient_AttributeGraphic.hxx"
-#include "SALOMEDSClient_AttributeIOR.hxx"
-#include "SALOMEDSClient_AttributeInteger.hxx"
-#include "SALOMEDSClient_AttributeLocalID.hxx"
-#include "SALOMEDSClient_AttributeName.hxx"
-#include "SALOMEDSClient_AttributeOpened.hxx"
-#include "SALOMEDSClient_AttributePersistentRef.hxx"
-#include "SALOMEDSClient_AttributePixMap.hxx"
-#include "SALOMEDSClient_AttributePythonObject.hxx"
-#include "SALOMEDSClient_AttributeReal.hxx"
-#include "SALOMEDSClient_AttributeSelectable.hxx"
-#include "SALOMEDSClient_AttributeSequenceOfInteger.hxx"
-#include "SALOMEDSClient_AttributeSequenceOfReal.hxx"
-#include "SALOMEDSClient_AttributeStudyProperties.hxx"
-#include "SALOMEDSClient_AttributeTableOfInteger.hxx"
-#include "SALOMEDSClient_AttributeTableOfReal.hxx"
-#include "SALOMEDSClient_AttributeTableOfString.hxx"
-#include "SALOMEDSClient_AttributeTarget.hxx"
-#include "SALOMEDSClient_AttributeTextColor.hxx"
-#include "SALOMEDSClient_AttributeTextHighlightColor.hxx"
-#include "SALOMEDSClient_AttributeTreeNode.hxx"
-#include "SALOMEDSClient_AttributeUserID.hxx"
-#include "SALOMEDSClient_AttributeParameter.hxx"
-#include "SALOMEDSClient_AttributeString.hxx"
-#include "SALOMEDSClient_ChildIterator.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include "SALOMEDSClient_SComponent.hxx"
-#include "SALOMEDSClient_SComponentIterator.hxx"
-#include "SALOMEDSClient_SObject.hxx"
-#include "SALOMEDSClient_Study.hxx"
-#include "SALOMEDSClient_StudyBuilder.hxx"
-#include "SALOMEDSClient_StudyManager.hxx"
-#include "SALOMEDSClient_UseCaseBuilder.hxx"
-#include "SALOMEDSClient_UseCaseIterator.hxx"
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeComment.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeComment_HeaderFile
-#define SALOMEDSClient_AttributeComment_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include <string>
-
-class SALOMEDSClient_AttributeComment: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
- virtual std::string Value() = 0;
- virtual void SetValue(const std::string& value) = 0;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeDrawable.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeDrawable_HeaderFile
-#define SALOMEDSClient_AttributeDrawable_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeDrawable: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
- virtual bool IsDrawable() = 0;
- virtual void SetDrawable(bool value) = 0;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeExpandable.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDSClient_AttributeExpandable_HeaderFile
-#define SALOMEDSClient_AttributeExpandable_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeExpandable: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
- virtual bool IsExpandable() = 0;
- virtual void SetExpandable(bool value) = 0;
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeExternalFileDef.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeExternalFileDef_HeaderFile
-#define SALOMEDSClient_AttributeExternalFileDef_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include <string>
-
-class SALOMEDSClient_AttributeExternalFileDef: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
- virtual std::string Value() = 0;
- virtual void SetValue(const std::string& value) = 0;
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeFileType.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeFileType_HeaderFile
-#define SALOMEDSClient_AttributeFileType_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include <string>
-
-class SALOMEDSClient_AttributeFileType: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
- virtual std::string Value() = 0;
- virtual void SetValue(const std::string& value) = 0;
-
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeFlags.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDSClient_AttributeFlags_HeaderFile
-#define SALOMEDSClient_AttributeFlags_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeFlags: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual int GetFlags() = 0;
- virtual void SetFlags(int theFlags) = 0;
-
- virtual bool Get(int theFlag) = 0;
- virtual void Set(int theFlag, bool theValue) = 0;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeFlags.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDSClient_AttributeGraphic_HeaderFile
-#define SALOMEDSClient_AttributeGraphic_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeGraphic: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual void SetVisibility(int theViewId, bool theValue) = 0;
- virtual bool GetVisibility(int theViewId) = 0;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeIOR.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeIOR_HeaderFile
-#define SALOMEDSClient_AttributeIOR_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include <string>
-
-class SALOMEDSClient_AttributeIOR: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual std::string Value() = 0;
- virtual void SetValue(const std::string& value) = 0;
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeInteger.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeInteger_HeaderFile
-#define SALOMEDSClient_AttributeInteger_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeInteger: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual int Value() = 0;
- virtual void SetValue(int value) = 0;
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeLocalID.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDSClient_AttributeLocalID_HeaderFile
-#define SALOMEDSClient_AttributeLocalID_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeLocalID: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
- virtual int Value() = 0;
- virtual void SetValue(int value) = 0;
-
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeName.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDSClient_AttributeName_HeaderFile
-#define SALOMEDSClient_AttributeName_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include <string>
-
-class SALOMEDSClient_AttributeName: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual std::string Value() = 0;
- virtual void SetValue(const std::string& value) = 0;
-
-};
-
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeOpened.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDSClient_AttributeOpened_HeaderFile
-#define SALOMEDSClient_AttributeOpened_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeOpened: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual bool IsOpened() = 0;
- virtual void SetOpened(bool value) = 0;
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeIOR.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSClient_AttributeParameter_HeaderFile
-#define _SALOMEDSClient_AttributeParameter_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include <string>
-#include <vector>
-
-class SALOMEDSClient_AttributeParameter : public virtual SALOMEDSClient_GenericAttribute
-{
-
-public:
-
- virtual void SetInt(const std::string& theID, const int theValue) = 0;
- virtual int GetInt(const std::string& theID) = 0;
-
- virtual void SetReal(const std::string& theID, const double& theValue) = 0;
- virtual double GetReal(const std::string& theID) = 0;
-
- virtual void SetString(const std::string& theID, const std::string& theValue) = 0;
- virtual std::string GetString(const std::string& theID) = 0;
-
- virtual void SetBool(const std::string& theID, const bool& theValue) = 0;
- virtual bool GetBool(const std::string& theID) = 0;
-
- virtual void SetRealArray(const std::string& theID, const std::vector<double>& theArray) = 0;
- virtual std::vector<double> GetRealArray(const std::string& theID) = 0;
-
- virtual void SetIntArray(const std::string& theID, const std::vector<int>& theArray) = 0;
- virtual std::vector<int> GetIntArray(const std::string& theID) = 0;
-
- virtual void SetStrArray(const std::string& theID, const std::vector<std::string>& theArray) = 0;
- virtual std::vector<std::string> GetStrArray(const std::string& theID) = 0;
-
- virtual bool IsSet(const std::string& theID, const int theType) = 0;
-
- virtual bool RemoveID(const std::string& theID, const int theType) = 0;
-
- virtual _PTR(AttributeParameter) GetFather() = 0;
- virtual bool HasFather() = 0;
- virtual bool IsRoot() = 0;
-
- virtual void Clear() = 0;
-
- virtual std::vector<std::string> GetIDs(const int theType) = 0;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributePersistentRef.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributePersistentRef_HeaderFile
-#define SALOMEDSClient_AttributePersistentRef_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include <string>
-
-class SALOMEDSClient_AttributePersistentRef: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual std::string Value() = 0;
- virtual void SetValue(const std::string& value) = 0;
-
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributePixMap.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributePixMap_HeaderFile
-#define SALOMEDSClient_AttributePixMap_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include <string>
-
-class SALOMEDSClient_AttributePixMap: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual bool HasPixMap() = 0;
- virtual std::string GetPixMap() = 0;
- virtual void SetPixMap(const std::string& value) = 0;
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributePythonObject.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributePythonObject_HeaderFile
-#define SALOMEDSClient_AttributePythonObject_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include <string>
-
-class SALOMEDSClient_AttributePythonObject: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual void SetObject(const std::string& theSequence, bool IsScript) = 0;
- virtual std::string GetObject() = 0;
- virtual bool IsScript() = 0;
-
-};
-
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeReal.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeReal_HeaderFile
-#define SALOMEDSClient_AttributeReal_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeReal: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual double Value() = 0;
- virtual void SetValue(double value) = 0;
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeSelectable.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeSelectable_HeaderFile
-#define SALOMEDSClient_AttributeSelectable_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeSelectable: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual bool IsSelectable() = 0;
- virtual void SetSelectable(bool value) = 0;
-
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeSequenceOfInteger.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeSequenceOfInteger_HeaderFile
-#define SALOMEDSClient_AttributeSequenceOfInteger_HeaderFile
-
-#include <vector>
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeSequenceOfInteger: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual void Assign(const std::vector<int>& other) = 0;
- virtual std::vector<int> CorbaSequence() = 0;
- virtual void Add(int value) = 0;
- virtual void Remove(int index) = 0;
- virtual void ChangeValue(int index, int value) = 0;
- virtual int Value(int index) = 0;
- virtual int Length() = 0;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeSequenceOfSequenceOfReal.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeSequenceOfSequenceOfReal_HeaderFile
-#define SALOMEDSClient_AttributeSequenceOfSequenceOfReal_HeaderFile
-
-#include <vector>
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeSequenceOfReal: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual void Assign(const std::vector<double>& other) = 0;
- virtual std::vector<double> CorbaSequence() = 0;
- virtual void Add(double value) = 0;
- virtual void Remove(int index) = 0;
- virtual void ChangeValue(int index, double value) = 0;
- virtual double Value(int index) = 0;
- virtual int Length() = 0;
-
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeString.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeString_HeaderFile
-#define SALOMEDSClient_AttributeString_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include <string>
-
-class SALOMEDSClient_AttributeString: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
- virtual std::string Value() = 0;
- virtual void SetValue(const std::string& value) = 0;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeStudyProperties.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeStudyProperties_HeaderFile
-#define SALOMEDSClient_AttributeStudyProperties_HeaderFile
-
-#include <vector>
-#include <string>
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeStudyProperties: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual void SetUserName(const std::string& theName) = 0;
- virtual std::string GetUserName() = 0;
- virtual void SetCreationDate(int theMinute, int theHour, int theDay, int theMonth, int theYear) = 0;
- virtual bool GetCreationDate(int& theMinute, int& theHour, int& theDay, int& theMonth, int& theYear) = 0;
- virtual void SetCreationMode(const std::string& theMode) = 0;
- virtual std::string GetCreationMode() = 0;
- virtual void SetModified(int theModified) = 0;
- virtual bool IsModified() = 0;
- virtual int GetModified() = 0;
- virtual void SetLocked(bool theLocked) = 0;
- virtual bool IsLocked() = 0;
- virtual void SetModification(const std::string& theName,
- int theMinute,
- int theHour,
- int theDay,
- int theMonth,
- int theYear) = 0;
- virtual void GetModificationsList(std::vector<std::string>& theNames,
- std::vector<int>& theMinutes,
- std::vector<int>& theHours,
- std::vector<int>& theDays,
- std::vector<int>& theMonths,
- std::vector<int>& theYears,
- bool theWithCreator) = 0;
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeTableOfInteger.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeTableOfInteger_HeaderFile
-#define SALOMEDSClient_AttributeTableOfInteger_HeaderFile
-
-#include <vector>
-#include <string>
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeTableOfInteger: public virtual SALOMEDSClient_GenericAttribute
-{
-
-public:
-
- virtual void SetTitle(const std::string& theTitle) = 0;
- virtual std::string GetTitle() = 0;
- virtual void SetRowTitle(int theIndex, const std::string& theTitle) = 0;
- virtual void SetRowTitles(const std::vector<std::string>& theTitles) = 0;
- virtual std::vector<std::string> GetRowTitles() = 0;
- virtual void SetColumnTitle(int theIndex, const std::string& theTitle) = 0;
- virtual void SetColumnTitles(const std::vector<std::string>& theTitles) = 0;
- virtual std::vector<std::string> GetColumnTitles() = 0;
-
- virtual void SetRowUnit(int theIndex, const std::string& theUnit) = 0;
- virtual void SetRowUnits(const std::vector<std::string>& theUnits) = 0;
- virtual std::vector<std::string> GetRowUnits() = 0;
-
- virtual int GetNbRows() = 0;
- virtual int GetNbColumns() = 0;
- virtual void AddRow(const std::vector<int>& theData) = 0;
- virtual void SetRow(int theRow, const std::vector<int>& theData) = 0;
- virtual std::vector<int> GetRow(int theRow) = 0;
- virtual void AddColumn(const std::vector<int>& theData) = 0;
- virtual void SetColumn(int theColumn, const std::vector<int>& theData) = 0;
- virtual std::vector<int> GetColumn(int theColumn) = 0;
- virtual void PutValue(int theValue, int theRow, int theColumn) = 0;
- virtual bool HasValue(int theRow, int theColumn) = 0;
- virtual int GetValue(int theRow, int theColumn) = 0;
-
- virtual std::vector<int> GetRowSetIndices(int theRow) = 0;
- virtual void SetNbColumns(int theNbColumns) = 0;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeTableOfReal.hxx
-// Author : Michael Ponikarov
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeTableOfReal_HeaderFile
-#define SALOMEDSClient_AttributeTableOfReal_HeaderFile
-
-#include <vector>
-#include <string>
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeTableOfReal: public virtual SALOMEDSClient_GenericAttribute
-{
-
-public:
-
- virtual void SetTitle(const std::string& theTitle) = 0;
- virtual std::string GetTitle() = 0;
- virtual void SetRowTitle(int theIndex, const std::string& theTitle) = 0;
- virtual void SetRowTitles(const std::vector<std::string>& theTitles) = 0;
- virtual std::vector<std::string> GetRowTitles() = 0;
- virtual void SetColumnTitle(int theIndex, const std::string& theTitle) = 0;
- virtual void SetColumnTitles(const std::vector<std::string>& theTitles) = 0;
- virtual std::vector<std::string> GetColumnTitles() = 0;
- virtual void SetRowUnit(int theIndex, const std::string& theUnit) = 0;
- virtual void SetRowUnits(const std::vector<std::string>& theUnits) = 0;
- virtual std::vector<std::string> GetRowUnits() = 0;
-
- virtual int GetNbRows() = 0;
- virtual int GetNbColumns() = 0;
- virtual void AddRow(const std::vector<double>& theData) = 0;
- virtual void SetRow(int theRow, const std::vector<double>& theData) = 0;
- virtual std::vector<double> GetRow(int theRow) = 0;
- virtual void AddColumn(const std::vector<double>& theData) = 0;
- virtual void SetColumn(int theColumn, const std::vector<double>& theData) = 0;
- virtual std::vector<double> GetColumn(int theColumn) = 0;
- virtual void PutValue(double theValue, int theRow, int theColumn) = 0;
- virtual bool HasValue(int theRow, int theColumn) = 0;
- virtual double GetValue(int theRow, int theColumn) = 0;
-
- virtual std::vector<int> GetRowSetIndices(int theRow) = 0;
- virtual void SetNbColumns(int theNbColumns) = 0;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeTableOfString.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeTableOfString_HeaderFile
-#define SALOMEDSClient_AttributeTableOfString_HeaderFile
-
-#include <vector>
-#include <string>
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeTableOfString: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual void SetTitle(const std::string& theTitle) = 0;
- virtual std::string GetTitle() = 0;
- virtual void SetRowTitle(int theIndex, const std::string& theTitle) = 0;
- virtual void SetRowTitles(const std::vector<std::string>& theTitles) = 0;
- virtual std::vector<std::string> GetRowTitles() = 0;
- virtual void SetColumnTitle(int theIndex, const std::string& theTitle) = 0;
- virtual void SetColumnTitles(const std::vector<std::string>& theTitles) = 0;
- virtual std::vector<std::string> GetColumnTitles() = 0;
-
- virtual void SetRowUnit(int theIndex, const std::string& theUnit) = 0;
- virtual void SetRowUnits(const std::vector<std::string>& theUnits) = 0;
- virtual std::vector<std::string> GetRowUnits() = 0;
-
- virtual int GetNbRows() = 0;
- virtual int GetNbColumns() = 0;
- virtual void AddRow(const std::vector<std::string>& theData) = 0;
- virtual void SetRow(int theRow, const std::vector<std::string>& theData) = 0;
- virtual std::vector<std::string> GetRow(int theRow) = 0;
- virtual void AddColumn(const std::vector<std::string>& theData) = 0;
- virtual void SetColumn(int theColumn, const std::vector<std::string>& theData) = 0;
- virtual std::vector<std::string> GetColumn(int theColumn) = 0;
- virtual void PutValue(const std::string& theValue, int theRow, int theColumn) = 0;
- virtual bool HasValue(int theRow, int theColumn) = 0;
- virtual std::string GetValue(int theRow, int theColumn) = 0;
-
- virtual std::vector<int> GetRowSetIndices(int theRow) = 0;
- virtual void SetNbColumns(int theNbColumns) = 0;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeTarget.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeTarget_HeaderFile
-#define SALOMEDSClient_AttributeTarget_HeaderFile
-
-#include <vector>
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_SObject.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeTarget: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
- virtual void Add(const _PTR(SObject)& theObject) = 0;
- virtual std::vector<_PTR(SObject)> Get() = 0;
- virtual void Remove(const _PTR(SObject)& theObject) = 0;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeTextColor.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeTextColor_HeaderFile
-#define SALOMEDSClient_AttributeTextColor_HeaderFile
-
-#include <vector>
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include "SALOMEDSClient_definitions.hxx"
-
-class SALOMEDSClient_AttributeTextColor: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual STextColor TextColor() = 0;
- virtual void SetTextColor(STextColor value) = 0;
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeTextHighlightColor.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeTextHighlightColor_HeaderFile
-#define SALOMEDSClient_AttributeTextHighlightColor_HeaderFile
-
-#include <vector>
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include "SALOMEDSClient_definitions.hxx"
-
-class SALOMEDSClient_AttributeTextHighlightColor: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
- virtual STextColor TextHighlightColor() = 0;
- virtual void SetTextHighlightColor(STextColor value) = 0;
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeTreeNode.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeTreeNode_HeaderFile
-#define SALOMEDSClient_AttributeTreeNode_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-
-class SALOMEDSClient_AttributeTreeNode: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual void SetFather(const _PTR(AttributeTreeNode)& value) = 0;
- virtual bool HasFather() = 0;
- virtual _PTR(AttributeTreeNode) GetFather() = 0;
- virtual void SetPrevious(const _PTR(AttributeTreeNode)& value) = 0;
- virtual bool HasPrevious() = 0;
- virtual _PTR(AttributeTreeNode) GetPrevious() = 0;
- virtual void SetNext(const _PTR(AttributeTreeNode)& value) = 0;
- virtual bool HasNext() = 0;
- virtual _PTR(AttributeTreeNode) GetNext() = 0;
- virtual void SetFirst(const _PTR(AttributeTreeNode)& value) = 0;
- virtual bool HasFirst() = 0;
- virtual _PTR(AttributeTreeNode) GetFirst() = 0;
- virtual void SetTreeID(const std::string& value) = 0;
- virtual std::string GetTreeID() = 0;
- virtual void Append(const _PTR(AttributeTreeNode)& value) = 0;
- virtual void Prepend(const _PTR(AttributeTreeNode)& value) = 0;
- virtual void InsertBefore(const _PTR(AttributeTreeNode)& value) = 0;
- virtual void InsertAfter(const _PTR(AttributeTreeNode)& value) = 0;
- virtual void Remove() = 0;
- virtual int Depth() = 0;
- virtual bool IsRoot() = 0;
- virtual bool IsDescendant(const _PTR(AttributeTreeNode)& value) = 0;
- virtual bool IsFather(const _PTR(AttributeTreeNode)& value) = 0;
- virtual bool IsChild(const _PTR(AttributeTreeNode)& value) = 0;
- virtual std::string Label() = 0;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_AttributeUserID.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSClient_AttributeUserID_HeaderFile
-#define SALOMEDSClient_AttributeUserID_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include <string>
-
-class SALOMEDSClient_AttributeUserID: public virtual SALOMEDSClient_GenericAttribute
-{
-public:
-
- virtual std::string Value() = 0;
- virtual void SetValue(const std::string& value) = 0;
-
-};
-
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_ChildIterator.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSClient_CHILDITERATOR_H__
-#define __SALOMEDSClient_CHILDITERATOR_H__
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_SObject.hxx"
-
-class SALOMEDSClient_ChildIterator
-{
-public:
- virtual ~SALOMEDSClient_ChildIterator() {}
-
- virtual void Init() = 0;
- virtual void InitEx(bool) = 0;
- virtual bool More() = 0;
- virtual void Next() = 0;
- virtual _PTR(SObject) Value() = 0;
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "SALOMEDSClient_ClientFactory.hxx"
-
-#ifdef WIN32
-#include <windows.h>
-static HMODULE _libHandle = 0;
-#define SALOMEDS_LIB_NAME "SalomeDS.dll"
-#else
-#include <dlfcn.h>
-static void* _libHandle = NULL;
-#define SALOMEDS_LIB_NAME "libSalomeDS.so"
-#endif
-
-#define SOBJECT_FACTORY "SObjectFactory"
-#define SCOMPONENT_FACTORY "SComponentFactory"
-#define STUDY_FACTORY "StudyFactory"
-#define BUILDER_FACTORY "BuilderFactory"
-#define STUDYMANAGER_FACTORY "StudyManagerFactory"
-#define STUDYMANAGER_CREATE "CreateStudyManager"
-#define GET_PARAMETERS "GetIParameters"
-#define CONVERT_SOBJECT "ConvertSObject"
-#define CONVERT_STUDY "ConvertStudy"
-#define CONVERT_BUILDER "ConvertBuilder"
-
-typedef SALOMEDSClient_SObject* (*SOBJECT_FACTORY_FUNCTION) (SALOMEDS::SObject_ptr);
-typedef SALOMEDSClient_SComponent* (*SCOMPONENT_FACTORY_FUNCTION) (SALOMEDS::SComponent_ptr);
-typedef SALOMEDSClient_Study* (*STUDY_FACTORY_FUNCTION) (SALOMEDS::Study_ptr);
-typedef SALOMEDSClient_StudyManager* (*STUDYMANAGER_FACTORY_FUNCTION) ();
-typedef SALOMEDSClient_StudyBuilder* (*BUILDER_FACTORY_FUNCTION) (SALOMEDS::StudyBuilder_ptr);
-typedef SALOMEDSClient_StudyManager* (*STUDYMANAGER_CREATE_FUNCTION) (CORBA::ORB_ptr, PortableServer::POA_ptr);
-typedef SALOMEDSClient_IParameters* (*GET_PARAMETERS_FACTORY) (const _PTR(AttributeParameter)&);
-typedef SALOMEDS::SObject_ptr (*CONVERT_SOBJECT_FUNCTION) (const _PTR(SObject)&);
-typedef SALOMEDS::Study_ptr (*CONVERT_STUDY_FUNCTION) (const _PTR(Study)&);
-typedef SALOMEDS::StudyBuilder_ptr (*CONVERT_BUILDER_FUNCTION) (const _PTR(StudyBuilder)&);
-
-
-static SOBJECT_FACTORY_FUNCTION aSObjectFactory = NULL;
-static SCOMPONENT_FACTORY_FUNCTION aSComponentFactory = NULL;
-static STUDY_FACTORY_FUNCTION aStudyFactory = NULL;
-static BUILDER_FACTORY_FUNCTION aBuilderFactory = NULL;
-static STUDYMANAGER_FACTORY_FUNCTION aManagerFactory = NULL;
-static STUDYMANAGER_CREATE_FUNCTION aCreateFactory = NULL;
-static GET_PARAMETERS_FACTORY aGetIParameters = NULL;
-static CONVERT_SOBJECT_FUNCTION aConvertSObject = NULL;
-static CONVERT_STUDY_FUNCTION aConvertStudy = NULL;
-static CONVERT_BUILDER_FUNCTION aConvertBuilder = NULL;
-
-using namespace std;
-
-_PTR(SObject) ClientFactory::SObject(SALOMEDS::SObject_ptr theSObject)
-{
- SALOMEDSClient_SObject* so = NULL;
-
-#ifdef WIN32
- if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
- if(!aSObjectFactory) aSObjectFactory = (SOBJECT_FACTORY_FUNCTION)::GetProcAddress(_libHandle, SOBJECT_FACTORY);
-#else
- if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
- if(!aSObjectFactory) aSObjectFactory = (SOBJECT_FACTORY_FUNCTION) dlsym(_libHandle, SOBJECT_FACTORY);
-#endif
-
- if(aSObjectFactory) so = aSObjectFactory(theSObject);
- return _PTR(SObject)(so);
-}
-
-_PTR(SComponent) ClientFactory::SComponent(SALOMEDS::SComponent_ptr theSComponent)
-{
- SALOMEDSClient_SComponent* sco = NULL;
-
-#ifdef WIN32
- if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
- if(!aSComponentFactory) aSComponentFactory = (SCOMPONENT_FACTORY_FUNCTION)::GetProcAddress(_libHandle, SCOMPONENT_FACTORY);
-#else
- if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
- if(!aSComponentFactory) aSComponentFactory = (SCOMPONENT_FACTORY_FUNCTION) dlsym(_libHandle, SCOMPONENT_FACTORY);
-#endif
-
- if(aSComponentFactory) sco = aSComponentFactory(theSComponent);
- return _PTR(SComponent)(sco);
-}
-
-_PTR(Study) ClientFactory::Study(SALOMEDS::Study_ptr theStudy)
-{
- SALOMEDSClient_Study* study = NULL;
-
-#ifdef WIN32
- if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
- if(!aStudyFactory) aStudyFactory = (STUDY_FACTORY_FUNCTION)::GetProcAddress(_libHandle, STUDY_FACTORY);
-#else
- if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
- if(!aStudyFactory) aStudyFactory = (STUDY_FACTORY_FUNCTION) dlsym(_libHandle, STUDY_FACTORY);
-#endif
-
- if(aStudyFactory) study = aStudyFactory(theStudy);
- return _PTR(Study)(study);
-}
-
-_PTR(StudyBuilder) ClientFactory::StudyBuilder(SALOMEDS::StudyBuilder_ptr theStudyBuilder)
-{
- SALOMEDSClient_StudyBuilder* studyBuilder = NULL;
-
-#ifdef WIN32
- if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
- if(!aBuilderFactory) aBuilderFactory = (BUILDER_FACTORY_FUNCTION)::GetProcAddress(_libHandle, BUILDER_FACTORY);
-#else
- if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
- if(!aBuilderFactory) aBuilderFactory = (BUILDER_FACTORY_FUNCTION) dlsym(_libHandle, BUILDER_FACTORY);
-#endif
-
- if(aBuilderFactory) studyBuilder = aBuilderFactory(theStudyBuilder);
- return _PTR(StudyBuilder)(studyBuilder);
-}
-
-_PTR(StudyManager) ClientFactory::StudyManager()
-{
- SALOMEDSClient_StudyManager* manager = NULL;
-
-#ifdef WIN32
- if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
- if(!aManagerFactory) aManagerFactory = (STUDYMANAGER_FACTORY_FUNCTION)::GetProcAddress(_libHandle, STUDYMANAGER_FACTORY);
-#else
- if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
- if(!aManagerFactory) aManagerFactory = (STUDYMANAGER_FACTORY_FUNCTION) dlsym(_libHandle, STUDYMANAGER_FACTORY);
-#endif
-
- if(aManagerFactory) manager = aManagerFactory();
- return _PTR(StudyManager)(manager);
-}
-
-_PTR(StudyManager) ClientFactory::createStudyManager(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa)
-{
- SALOMEDSClient_StudyManager* manager = NULL;
-
-#ifdef WIN32
- if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
- if(!aCreateFactory) aCreateFactory = (STUDYMANAGER_CREATE_FUNCTION)::GetProcAddress(_libHandle, STUDYMANAGER_CREATE);
-#else
- if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
- if(!aCreateFactory) aCreateFactory = (STUDYMANAGER_CREATE_FUNCTION) dlsym(_libHandle, STUDYMANAGER_CREATE);
-#endif
-
- if(aCreateFactory) manager = aCreateFactory(orb, poa);
- return _PTR(StudyManager)(manager);
-}
-
-_PTR(IParameters) ClientFactory::getIParameters(const _PTR(AttributeParameter)& ap)
-{
- SALOMEDSClient_IParameters* interface = NULL;
-
-#ifdef WIN32
- if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
- if(!aGetIParameters) aGetIParameters = (GET_PARAMETERS_FACTORY)::GetProcAddress(_libHandle, GET_PARAMETERS);
-#else
- if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
- if(!aGetIParameters) aGetIParameters = (GET_PARAMETERS_FACTORY) dlsym(_libHandle, GET_PARAMETERS);
-#endif
-
- if(aGetIParameters) interface = aGetIParameters(ap);
- return _PTR(IParameters)(interface);
-}
-
-SALOMEDS::SObject_ptr ClientFactory::crbSObject(const _PTR(SObject)& theSObject)
-{
- SALOMEDS::SObject_var so;
-
-#ifdef WIN32
- if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
- if(!aConvertSObject) aConvertSObject = (CONVERT_SOBJECT_FUNCTION)::GetProcAddress(_libHandle, CONVERT_SOBJECT);
-#else
- if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
- if(!aConvertSObject) aConvertSObject = (CONVERT_SOBJECT_FUNCTION) dlsym(_libHandle, CONVERT_SOBJECT);
-#endif
-
- if(aConvertSObject) so = aConvertSObject(theSObject);
-
- if(CORBA::is_nil(so)) return SALOMEDS::SObject::_nil();
- return so._retn();
-}
-
-
-SALOMEDS::Study_ptr ClientFactory::crbStudy(const _PTR(Study)& theStudy)
-{
- SALOMEDS::Study_var study;
-
-#ifdef WIN32
- if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
- if(!aConvertStudy) aConvertStudy = (CONVERT_STUDY_FUNCTION)::GetProcAddress(_libHandle, CONVERT_STUDY);
-#else
- if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
- if(!aConvertStudy) aConvertStudy = (CONVERT_STUDY_FUNCTION) dlsym(_libHandle, CONVERT_STUDY);
-#endif
-
- if(aConvertStudy) study = aConvertStudy(theStudy);
-
- if(CORBA::is_nil(study)) return SALOMEDS::Study::_nil();
- return study._retn();
-}
-
-SALOMEDS::StudyBuilder_ptr ClientFactory::crbStudyBuilder(const _PTR(StudyBuilder)& theStudyBuilder)
-{
- SALOMEDS::StudyBuilder_var studyBuilder;
-
-#ifdef WIN32
- if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
- if(!aConvertBuilder)aConvertBuilder = (CONVERT_BUILDER_FUNCTION)::GetProcAddress(_libHandle, CONVERT_BUILDER);
-#else
- if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
- if(!aConvertBuilder) aConvertBuilder = (CONVERT_BUILDER_FUNCTION) dlsym(_libHandle, CONVERT_BUILDER);
-#endif
-
- if(aConvertBuilder) studyBuilder = aConvertBuilder(theStudyBuilder);
-
- if(CORBA::is_nil(studyBuilder)) return SALOMEDS::StudyBuilder::_nil();
- return studyBuilder._retn();
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_ClientFactory.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-// $Header:
-//
-#ifndef SALOMEDSClient_ClientFactory_HeaderFile
-#define SALOMEDSClient_ClientFactory_HeaderFile
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_SObject.hxx"
-#include "SALOMEDSClient_SComponent.hxx"
-#include "SALOMEDSClient_Study.hxx"
-#include "SALOMEDSClient_StudyManager.hxx"
-#include "SALOMEDSClient_IParameters.hxx"
-
-#include <string>
-
-// IDL headers
-#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(SALOMEDS)
-
-class SALOMEDSCLIENT_EXPORT ClientFactory {
-
-public:
- /*!
- * Returns a client SObject wrapper that corresponds %theSObject
- */
- static _PTR(SObject) SObject(SALOMEDS::SObject_ptr theSObject);
-
- /*!
- * Returns a client SComponent wrapper that corresponds %theSComponent
- */
- static _PTR(SComponent) SComponent(SALOMEDS::SComponent_ptr theSComponent);
-
- /*!
- * Returns a client Study wrapper that corresponds %theStudy
- */
- static _PTR(Study) Study(SALOMEDS::Study_ptr theStudy);
-
- /*!
- * Returns a client StudyBuilder wrapper that corresponds %theStudy
- */
- static _PTR(StudyBuilder) StudyBuilder(SALOMEDS::StudyBuilder_ptr theBuilder);
-
- /*!
- * Returns a client StudyManager wrapper
- */
- static _PTR(StudyManager) StudyManager();
-
- /*!
- * Creates and returns a client StudyManager wrapper
- */
- static _PTR(StudyManager) createStudyManager(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);
-
- /*!
- * Returns an IParameters interface
- */
- static _PTR(IParameters) getIParameters(const _PTR(AttributeParameter)& ap);
-
-
- /*!
- * Returns a CORBA SObject that corresponds %theStudy
- */
- static SALOMEDS::SObject_ptr crbSObject(const _PTR(SObject)& theSObject);
-
- /*!
- * Returns a CORBA Study that corresponds %theStudy
- */
- static SALOMEDS::Study_ptr crbStudy(const _PTR(Study)& theStudy);
-
- /*!
- * Returns a CORBA StudyBuilder that corresponds %theStudyBuilder
- */
- static SALOMEDS::StudyBuilder_ptr crbStudyBuilder(const _PTR(StudyBuilder)& theStudyBuilder);
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient__GenericAttribute.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _GENERICCLIENT_ATTRIBUTE_HXX_
-#define _GENERICCLIENT_ATTRIBUTE_HXX_
-
-#include <string>
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_SObject.hxx"
-
-class SALOMEDSClient_GenericAttribute
-{
-public:
- virtual ~SALOMEDSClient_GenericAttribute() {}
-
- virtual void CheckLocked() = 0;
- virtual std::string Type() = 0;
- virtual std::string GetClassType() = 0;
- virtual _PTR(SObject) GetSObject() = 0;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef SALOMEDSClient_IParameters_H
-#define SALOMEDSClient_IParameters_H
-
-#include <string>
-#include <vector>
-#include <map>
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_AttributeParameter.hxx"
-
-/*!
- Class which an interface to store the parameters of the objects
-*/
-class SALOMEDSClient_IParameters
-{
-public:
-
- virtual ~SALOMEDSClient_IParameters() {}
-
- /*!
- Appends a string value to a named list.
- Returns a number of the added value.
- Note: the name of the list MUST be unique
- */
- virtual int append(const std::string& listName, const std::string& value) = 0;
-
- /*!
- Returns a number elements in the list
- */
- virtual int nbValues(const std::string& listName) = 0;
-
- /*!
- Returns a list of values in the list
- */
- virtual std::vector<std::string> getValues(const std::string& listName) = 0;
-
- /*!
- Returns a value with given %index, where %index is in range [0:nbValues-1]
- */
- virtual std::string getValue(const std::string& listName, int index) = 0;
-
- /*!
- Returns a list all entries lists
- */
- virtual std::vector<std::string> getLists() = 0;
-
- /*!
- Sets a new named parameter value for the given entry
- */
- virtual void setParameter(const std::string& entry, const std::string& parameterName, const std::string& value) = 0;
-
- /*!
- Gets a named parameter value for the given entry
- */
- virtual std::string getParameter(const std::string& entry, const std::string& parameterName) = 0;
-
- /*!
- Returns all parameter names of the given entry
- */
- virtual std::vector<std::string> getAllParameterNames(const std::string& entry) = 0;
-
- /*!
- Returns all parameter values of the given entry
- */
- virtual std::vector<std::string> getAllParameterValues(const std::string& entry) = 0;
-
- /*!
- Returns a number of parameters of the given entry
- */
- virtual int getNbParameters(const std::string& entry) = 0;
-
- /*!
- Returns a list all entries
- */
- virtual std::vector<std::string> getEntries() = 0;
-
- /*!
- Sets a global named property value
- */
- virtual void setProperty(const std::string& name, const std::string& value) = 0;
-
- /*!
- Gets a value of global named property
- */
- virtual std::string getProperty(const std::string& name) = 0;
-
- /*!
- Returns a list all properties
- */
- virtual std::vector<std::string> getProperties() = 0;
-
- /*!
- Breaks a value string in two parts which is divided by %separator.
- If fromEnd is True the search of separator starts from the end of the string
- */
- virtual std::vector<std::string> parseValue(const std::string& value, const char separator, bool fromEnd = true) = 0;
-
-
- /*!
- Returns encoded entry that is a relative entry for the component
- */
- virtual std::string encodeEntry(const std::string& entry, const std::string& compName) = 0;
-
- /*!
- Returns decoded entry that is an absolute entry
- */
- virtual std::string decodeEntry(const std::string& entry) = 0;
-
- /*!
- Enables/Disables the dumping visual parameters, static implementation is supposed
- */
- virtual void setDumpPython(_PTR(Study) study, const std::string& theID = "") = 0;
-
- /*!
- Returns whether there is the dumping visual parameters, static implementation is supposed
- */
- virtual bool isDumpPython(_PTR(Study) study, const std::string& theID = "") = 0;
-
- /*!
- Returns a default name of the component where the visula parameters are stored.
- Static implementation is supposed
- */
- virtual std::string getDefaultVisualComponent() = 0;
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_SComponent.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSCLIENT_SCOMPONENT_H__
-#define __SALOMEDSCLIENT_SCOMPONENT_H__
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_SObject.hxx"
-#include <string>
-
-class SALOMEDSClient_SComponent: public virtual SALOMEDSClient_SObject
-{
-public:
- virtual ~SALOMEDSClient_SComponent() {}
-
- virtual std::string ComponentDataType() = 0;
- virtual bool ComponentIOR(std::string& theID) = 0;
-
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_SComponentIterator.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSClient_SCOMPONENTITERATOR_H__
-#define __SALOMEDSClient_SCOMPONENTITERATOR_H__
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_SComponent.hxx"
-
-class SALOMEDSClient_SComponentIterator
-{
-public:
- virtual ~SALOMEDSClient_SComponentIterator() {}
-
- virtual void Init() = 0;
- virtual bool More() = 0;
- virtual void Next() = 0;
- virtual _PTR(SComponent) Value() = 0;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_SObject.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSCLIENT_SOBJECT_H__
-#define __SALOMEDSCLIENT_SOBJECT_H__
-
-// std C++ headers
-#include <vector>
-#include <string>
-
-#include "SALOMEDSClient_definitions.hxx"
-
-class SALOMEDSClient_Study;
-class SALOMEDSClient_SComponent;
-class SALOMEDSClient_GenericAttribute;
-
-class SALOMEDSClient_SObject
-{
-public:
- virtual ~SALOMEDSClient_SObject() {}
-
- virtual std::string GetID() = 0;
- virtual _PTR(SComponent) GetFatherComponent() = 0;
- virtual _PTR(SObject) GetFather() = 0;
- virtual bool FindAttribute(_PTR(GenericAttribute)& anAttribute, const std::string& aTypeOfAttribute) = 0;
- virtual bool ReferencedObject(_PTR(SObject)& theObject) = 0;
- virtual bool FindSubObject(int theTag, _PTR(SObject)& theObject) = 0;
- virtual _PTR(Study) GetStudy() = 0;
- virtual std::string Name() = 0;
- virtual void Name(const std::string& theName) = 0;
- virtual std::vector<_PTR(GenericAttribute)> GetAllAttributes() = 0;
- virtual std::string GetName() = 0;
- virtual std::string GetComment() = 0;
- virtual std::string GetIOR() = 0;
- virtual int Tag() = 0;
- virtual int Depth() = 0;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_Study.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSClient_STUDY_H__
-#define __SALOMEDSClient_STUDY_H__
-
-#include <vector>
-#include <string>
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_SComponentIterator.hxx"
-#include "SALOMEDSClient_StudyBuilder.hxx"
-#include "SALOMEDSClient_AttributeParameter.hxx"
-#include "SALOMEDSClient_SObject.hxx"
-#include "SALOMEDSClient_SComponent.hxx"
-#include "SALOMEDSClient_UseCaseBuilder.hxx"
-#include "SALOMEDSClient_AttributeStudyProperties.hxx"
-#include "SALOMEDSClient_ChildIterator.hxx"
-
-class SALOMEDSClient_Study
-{
-
-public:
- virtual ~SALOMEDSClient_Study() {}
-
- virtual std::string GetPersistentReference() = 0;
- virtual std::string GetTransientReference() = 0;
- virtual bool IsEmpty() = 0;
- virtual _PTR(SComponent) FindComponent (const std::string& aComponentName) = 0;
- virtual _PTR(SComponent) FindComponentID(const std::string& aComponentID) = 0;
- virtual _PTR(SObject) FindObject(const std::string& anObjectName) = 0;
- virtual std::vector<_PTR(SObject)> FindObjectByName( const std::string& anObjectName, const std::string& aComponentName ) = 0;
- virtual _PTR(SObject) FindObjectID(const std::string& anObjectID) = 0;
- virtual _PTR(SObject) CreateObjectID(const std::string& anObjectID) = 0;
- virtual _PTR(SObject) FindObjectIOR(const std::string& anObjectIOR) = 0;
- virtual _PTR(SObject) FindObjectByPath(const std::string& thePath) = 0;
- virtual std::string GetObjectPath(const _PTR(SObject)& theSO) = 0;
- virtual void SetContext(const std::string& thePath) = 0;
- virtual std::string GetContext() = 0;
- virtual std::vector<std::string> GetObjectNames(const std::string& theContext) = 0;
- virtual std::vector<std::string> GetDirectoryNames(const std::string& theContext) = 0;
- virtual std::vector<std::string> GetFileNames(const std::string& theContext) = 0;
- virtual std::vector<std::string> GetComponentNames(const std::string& theContext) = 0;
- virtual _PTR(ChildIterator) NewChildIterator(const _PTR(SObject)& theSO) = 0;
- virtual _PTR(SComponentIterator) NewComponentIterator() = 0;
- virtual _PTR(StudyBuilder) NewBuilder() = 0;
- virtual std::string Name() = 0;
- virtual void Name(const std::string& name) = 0;
- virtual bool IsSaved() = 0;
- virtual void IsSaved(bool save) = 0;
- virtual bool IsModified() = 0;
- virtual void Modified() = 0;
- virtual std::string URL() = 0;
- virtual void URL(const std::string& url) = 0;
- virtual int StudyId() = 0;
- virtual void StudyId(int id) = 0;
- virtual std::vector<_PTR(SObject)> FindDependances(const _PTR(SObject)& theSO) = 0;
- virtual _PTR(AttributeStudyProperties) GetProperties() = 0;
- virtual std::string GetLastModificationDate() = 0;
- virtual std::vector<std::string> GetModificationsDate() = 0;
- virtual _PTR(UseCaseBuilder) GetUseCaseBuilder() = 0;
- virtual void Close() = 0;
- virtual void EnableUseCaseAutoFilling(bool isEnabled) = 0;
- virtual bool DumpStudy(const std::string& thePath,
- const std::string& theBaseName,
- bool isPublished) = 0;
- virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint) = 0;
- virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID,
- const std::string& theModuleName, int theSavePoint) = 0;
- virtual void SetStudyLock(const std::string& theLockerID) = 0;
- virtual bool IsStudyLocked() = 0;
- virtual void UnLockStudy(const std::string& theLockerID) = 0;
- virtual std::vector<std::string> GetLockerID() = 0;
-
- virtual void SetReal(const std::string& theVarName, const double theValue) = 0;
- virtual void SetInteger(const std::string& theVarName, const int theValue) = 0;
- virtual void SetBoolean(const std::string& theVarName, const bool theValue) = 0;
-
- virtual double GetReal(const std::string& theVarName) = 0;
- virtual int GetInteger(const std::string& theVarName) = 0;
- virtual bool GetBoolean(const std::string& theVarName) = 0;
-
- virtual bool IsReal(const std::string& theVarName) = 0;
- virtual bool IsInteger(const std::string& theVarName) = 0;
- virtual bool IsBoolean(const std::string& theVarName) = 0;
-
- virtual bool IsVariable(const std::string& theVarName) = 0;
- virtual std::vector<std::string> GetVariableNames() = 0;
-
- virtual bool RemoveVariable(const std::string& theVarName) = 0;
- virtual bool RenameVariable(const std::string& theVarName,
- const std::string& theNewVarName) = 0;
- virtual bool IsVariableUsed(const std::string& theVarName) = 0;
-
- virtual std::vector< std::vector<std::string> > ParseVariables(const std::string& theVars) = 0;
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_StudyBuilder.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSClient_STUDYBUILDER_H__
-#define __SALOMEDSClient_STUDYBUILDER_H__
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_SObject.hxx"
-#include "SALOMEDSClient_SComponent.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include <string>
-
-class SALOMEDSClient_StudyBuilder
-{
-public:
- virtual ~SALOMEDSClient_StudyBuilder() {}
-
- virtual _PTR(SComponent) NewComponent(const std::string& ComponentDataType) = 0;
- virtual void DefineComponentInstance (const _PTR(SComponent)&, const std::string& ComponentIOR) = 0;
- virtual void RemoveComponent(const _PTR(SComponent)& theSCO) = 0;
- virtual _PTR(SObject) NewObject(const _PTR(SObject)& theFatherObject) = 0;
- virtual _PTR(SObject) NewObjectToTag(const _PTR(SObject)& theFatherObject, int theTag) = 0;
- virtual void AddDirectory(const std::string& thePath) = 0;
- virtual void LoadWith(const _PTR(SComponent)& theSCO, const std::string& theIOR) = 0;
- virtual void Load(const _PTR(SObject)& theSCO) = 0;
- virtual void RemoveObject(const _PTR(SObject)& theSO) = 0;
- virtual void RemoveObjectWithChildren(const _PTR(SObject)& theSO) = 0;
- virtual _PTR(GenericAttribute) FindOrCreateAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute) = 0;
- virtual bool FindAttribute(const _PTR(SObject)& theSO,
- _PTR(GenericAttribute)& theAttribute,
- const std::string& aTypeOfAttribute) = 0;
- virtual void RemoveAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute) = 0;
- virtual void Addreference(const _PTR(SObject)& me, const _PTR(SObject)& thereferencedObject) = 0;
- virtual void RemoveReference(const _PTR(SObject)& me) = 0;
- virtual void SetGUID(const _PTR(SObject)& theSO, const std::string& theGUID) = 0;
- virtual bool IsGUID(const _PTR(SObject)& theSO, const std::string& theGUID) = 0;
- virtual void NewCommand() = 0;
- virtual void CommitCommand()= 0;
- virtual bool HasOpenCommand() = 0;
- virtual void AbortCommand() = 0;
- virtual void Undo() = 0;
- virtual void Redo() = 0;
- virtual bool GetAvailableUndos() = 0;
- virtual bool GetAvailableRedos() = 0;
- virtual int UndoLimit() = 0;
- virtual void UndoLimit(int theLimit) = 0;
- virtual void SetName(const _PTR(SObject)& theSO, const std::string& theValue) = 0;
- virtual void SetComment(const _PTR(SObject)& theSO, const std::string& theValue) = 0;
- virtual void SetIOR(const _PTR(SObject)& theSO, const std::string& theValue) = 0;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_StudyManager.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSClient_STUDYMANAGER_H__
-#define __SALOMEDSClient_STUDYMANAGER_H__
-
-#include <vector>
-#include <string>
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_Study.hxx"
-
-class SALOMEDSClient_StudyManager
-{
-public:
- virtual ~SALOMEDSClient_StudyManager() {}
-
- virtual _PTR(Study) NewStudy(const std::string& study_name) = 0;
- virtual _PTR(Study) Open(const std::string& theStudyUrl) = 0;
- virtual void Close(const _PTR(Study)& theStudy) = 0;
- virtual bool Save(const _PTR(Study)& theStudy, bool theMultiFile) = 0;
- virtual bool SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile) = 0;
- virtual bool SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) = 0;
- virtual bool SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) = 0;
- virtual std::vector<std::string> GetOpenStudies() = 0;
- virtual _PTR(Study) GetStudyByName(const std::string& theStudyName) = 0;
- virtual _PTR(Study) GetStudyByID(int theStudyID) = 0;
- virtual bool CanCopy(const _PTR(SObject)& theSO) = 0;
- virtual bool Copy(const _PTR(SObject)& theSO) = 0;
- virtual bool CanPaste(const _PTR(SObject)& theSO) = 0;
- virtual _PTR(SObject) Paste(const _PTR(SObject)& theSO) = 0;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_UseCaseBuilder.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSClient_USECaseBuilder_H__
-#define __SALOMEDSClient_USECaseBuilder_H__
-
-#include <string>
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_UseCaseIterator.hxx"
-#include "SALOMEDSClient_SObject.hxx"
-
-class SALOMEDSClient_UseCaseBuilder
-{
-public:
- virtual ~SALOMEDSClient_UseCaseBuilder() {}
-
- virtual bool Append(const _PTR(SObject)& theObject) = 0;
- virtual bool Remove(const _PTR(SObject)& theObject) = 0;
- virtual bool AppendTo(const _PTR(SObject)& theFather, _PTR(SObject) theObject) = 0;
- virtual bool InsertBefore(const _PTR(SObject)& theFirst, _PTR(SObject) theNext) = 0;
- virtual bool SetCurrentObject(const _PTR(SObject)& theObject) = 0;
- virtual bool SetRootCurrent() = 0;
- virtual bool HasChildren(const _PTR(SObject)& theObject) = 0;
- virtual bool IsUseCase(const _PTR(SObject)& theObject) = 0;
- virtual bool SetName(const std::string& theName) = 0;
- virtual _PTR(SObject) GetCurrentObject() = 0;
- virtual std::string GetName() = 0;
- virtual _PTR(SObject) AddUseCase(const std::string& theName) = 0;
- virtual _PTR(UseCaseIterator) GetUseCaseIterator(const _PTR(SObject)& anObject) = 0;
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSClient_UseCaseIterator.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSClient_USECASEITERATOR_H__
-#define __SALOMEDSClient_USECASEITERATOR_H__
-
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOMEDSClient_SObject.hxx"
-
-class SALOMEDSClient_UseCaseIterator
-{
-
-public:
- virtual ~SALOMEDSClient_UseCaseIterator() {}
-
- virtual void Init(bool) = 0;
- virtual bool More() = 0;
- virtual void Next() = 0;
- virtual _PTR(SObject) Value() = 0;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef SALOMEDSCLIENT_DEF_HXX
-#define SALOMEDSCLIENT_DEF_HXX
-
-#ifdef WIN32
-# if defined SALOMEDSCLIENT_EXPORTS || defined SalomeDSClient_EXPORTS
-# define SALOMEDSCLIENT_EXPORT __declspec( dllexport )
-# else
-# define SALOMEDSCLIENT_EXPORT __declspec( dllimport )
-# endif
-#else
-# define SALOMEDSCLIENT_EXPORT
-#endif
-
-#include <boost/shared_ptr.hpp>
-
-template<class T> class clt_shared_ptr: public boost::shared_ptr<T>
-{
-public:
- clt_shared_ptr() {}
-
- template<class Y>
- explicit clt_shared_ptr(Y * p)
- {
- boost::shared_ptr<T>::reset(p);
- }
-
- template<class Y>
- clt_shared_ptr(clt_shared_ptr<Y> const & r):
- boost::shared_ptr<T>(r,boost::detail::dynamic_cast_tag())
- {}
-
- template<class Y>
- clt_shared_ptr & operator=(clt_shared_ptr<Y> const & r)
- {
- clt_shared_ptr<T>(r).swap(*this);
- return *this;
- }
-
- template<class Y> clt_shared_ptr& operator()(Y * p) // Y must be complete
- {
- if(T* pt = dynamic_cast<T*>(p))
- boost::shared_ptr<T>::reset(pt);
- else
- boost::throw_exception(std::bad_cast());
- return *this;
- }
-
-};
-
-#define _PTR(Class) clt_shared_ptr<SALOMEDSClient_##Class>
-#define _CAST(Class, shared_ptr_Obj) dynamic_cast<SALOMEDS_##Class*>(shared_ptr_Obj.get())
-
-struct STextColor
-{
- double R;
- double G;
- double B;
-};
-
-#endif
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# File : Makefile.am
-# Author : Guillaume Boulant (CSSI)
-# Module : KERNEL
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-#
-# ===============================================================
-# Files to be installed
-# ===============================================================
-#
-# header files
-salomeinclude_HEADERS= \
- SALOMEDSImpl_Attributes.hxx \
- SALOMEDSImpl_SObject.hxx \
- SALOMEDSImpl_SComponent.hxx \
- SALOMEDSImpl_Driver.hxx \
- SALOMEDSImpl_Callback.hxx \
- SALOMEDSImpl_ChildIterator.hxx \
- SALOMEDSImpl_GenericAttribute.hxx \
- SALOMEDSImpl_AttributeIOR.hxx \
- SALOMEDSImpl_AttributeExternalFileDef.hxx \
- SALOMEDSImpl_AttributeFileType.hxx \
- SALOMEDSImpl_AttributePersistentRef.hxx \
- SALOMEDSImpl_AttributeSequenceOfReal.hxx \
- SALOMEDSImpl_AttributeSequenceOfInteger.hxx \
- SALOMEDSImpl_AttributeDrawable.hxx \
- SALOMEDSImpl_AttributeSelectable.hxx \
- SALOMEDSImpl_AttributeExpandable.hxx \
- SALOMEDSImpl_AttributeOpened.hxx \
- SALOMEDSImpl_AttributeFlags.hxx \
- SALOMEDSImpl_AttributeGraphic.hxx \
- SALOMEDSImpl_AttributeTextColor.hxx \
- SALOMEDSImpl_AttributeTextHighlightColor.hxx \
- SALOMEDSImpl_AttributePixMap.hxx \
- SALOMEDSImpl_AttributeLocalID.hxx \
- SALOMEDSImpl_AttributeTarget.hxx \
- SALOMEDSImpl_AttributeTableOfInteger.hxx \
- SALOMEDSImpl_AttributeTableOfReal.hxx \
- SALOMEDSImpl_AttributeTableOfString.hxx \
- SALOMEDSImpl_AttributeStudyProperties.hxx \
- SALOMEDSImpl_AttributePythonObject.hxx \
- SALOMEDSImpl_AttributeReal.hxx \
- SALOMEDSImpl_AttributeInteger.hxx \
- SALOMEDSImpl_AttributeUserID.hxx \
- SALOMEDSImpl_AttributeTreeNode.hxx \
- SALOMEDSImpl_AttributeName.hxx \
- SALOMEDSImpl_AttributeComment.hxx \
- SALOMEDSImpl_AttributeReference.hxx \
- SALOMEDSImpl_AttributeParameter.hxx \
- SALOMEDSImpl_AttributeString.hxx \
- SALOMEDSImpl_UseCaseBuilder.hxx \
- SALOMEDSImpl_UseCaseIterator.hxx \
- SALOMEDSImpl_SComponentIterator.hxx \
- SALOMEDSImpl_StudyBuilder.hxx \
- SALOMEDSImpl_Study.hxx \
- SALOMEDSImpl_StudyManager.hxx \
- SALOMEDSImpl_ChildNodeIterator.hxx \
- SALOMEDSImpl_Defines.hxx \
- SALOMEDSImpl_IParameters.hxx \
- SALOMEDSImpl_TMPFile.hxx \
- SALOMEDSImpl_GenericVariable.hxx \
- SALOMEDSImpl_ScalarVariable.hxx
-
-#
-# ===============================================================
-# Local definitions
-# ===============================================================
-#
-
-# This local variable defines the list of CPPFLAGS common to all target in this package.
-COMMON_CPPFLAGS=\
- -I$(srcdir)/../Basics \
- -I$(srcdir)/../SALOMELocalTrace \
- -I$(srcdir)/../HDFPersist \
- -I$(srcdir)/../DF \
- @HDF5_INCLUDES@ \
- @BOOST_CPPFLAGS@
-
-# This local variable defines the list of dependant libraries common to all target in this package.
-COMMON_LIBS =\
- ../HDFPersist/libSalomeHDFPersist.la \
- ../DF/libDF.la \
- @HDF5_LIBS@
-
-
-#
-# ===============================================================
-# Libraries targets
-# ===============================================================
-#
-lib_LTLIBRARIES = libSalomeDSImpl.la
-libSalomeDSImpl_la_SOURCES =\
- SALOMEDSImpl_Tool.cxx \
- SALOMEDSImpl_Callback.cxx \
- SALOMEDSImpl_StudyHandle.cxx \
- SALOMEDSImpl_GenericAttribute.cxx \
- SALOMEDSImpl_SObject.cxx \
- SALOMEDSImpl_SComponent.cxx \
- SALOMEDSImpl_ChildIterator.cxx \
- SALOMEDSImpl_AttributeIOR.cxx \
- SALOMEDSImpl_AttributeExternalFileDef.cxx \
- SALOMEDSImpl_AttributeFileType.cxx \
- SALOMEDSImpl_AttributePersistentRef.cxx \
- SALOMEDSImpl_AttributeSequenceOfReal.cxx \
- SALOMEDSImpl_AttributeSequenceOfInteger.cxx \
- SALOMEDSImpl_AttributeDrawable.cxx \
- SALOMEDSImpl_AttributeSelectable.cxx \
- SALOMEDSImpl_AttributeExpandable.cxx \
- SALOMEDSImpl_AttributeOpened.cxx \
- SALOMEDSImpl_AttributeFlags.cxx \
- SALOMEDSImpl_AttributeGraphic.cxx \
- SALOMEDSImpl_AttributeTextColor.cxx \
- SALOMEDSImpl_AttributeTextHighlightColor.cxx \
- SALOMEDSImpl_AttributePixMap.cxx \
- SALOMEDSImpl_AttributeLocalID.cxx \
- SALOMEDSImpl_AttributeTarget.cxx \
- SALOMEDSImpl_AttributeTableOfInteger.cxx \
- SALOMEDSImpl_AttributeTableOfReal.cxx \
- SALOMEDSImpl_AttributeTableOfString.cxx \
- SALOMEDSImpl_AttributeStudyProperties.cxx \
- SALOMEDSImpl_AttributePythonObject.cxx \
- SALOMEDSImpl_AttributeReal.cxx \
- SALOMEDSImpl_AttributeInteger.cxx \
- SALOMEDSImpl_AttributeUserID.cxx \
- SALOMEDSImpl_AttributeTreeNode.cxx \
- SALOMEDSImpl_AttributeName.cxx \
- SALOMEDSImpl_AttributeComment.cxx \
- SALOMEDSImpl_AttributeReference.cxx \
- SALOMEDSImpl_AttributeParameter.cxx \
- SALOMEDSImpl_AttributeString.cxx \
- SALOMEDSImpl_ChildNodeIterator.cxx \
- SALOMEDSImpl_UseCaseBuilder.cxx \
- SALOMEDSImpl_UseCaseIterator.cxx \
- SALOMEDSImpl_SComponentIterator.cxx \
- SALOMEDSImpl_StudyBuilder.cxx \
- SALOMEDSImpl_Study.cxx \
- SALOMEDSImpl_StudyManager.cxx \
- SALOMEDSImpl_IParameters.cxx \
- SALOMEDSImpl_TMPFile.cxx \
- SALOMEDSImpl_GenericVariable.cxx \
- SALOMEDSImpl_ScalarVariable.cxx \
- \
- SALOMEDSImpl_AttributeComment.hxx \
- SALOMEDSImpl_AttributeDrawable.hxx \
- SALOMEDSImpl_AttributeExpandable.hxx \
- SALOMEDSImpl_AttributeExternalFileDef.hxx \
- SALOMEDSImpl_AttributeFileType.hxx \
- SALOMEDSImpl_AttributeFlags.hxx \
- SALOMEDSImpl_AttributeGraphic.hxx \
- SALOMEDSImpl_AttributeInteger.hxx \
- SALOMEDSImpl_AttributeIOR.hxx \
- SALOMEDSImpl_AttributeLocalID.hxx \
- SALOMEDSImpl_AttributeName.hxx \
- SALOMEDSImpl_AttributeOpened.hxx \
- SALOMEDSImpl_AttributePersistentRef.hxx \
- SALOMEDSImpl_AttributePixMap.hxx \
- SALOMEDSImpl_AttributePythonObject.hxx \
- SALOMEDSImpl_AttributeReal.hxx \
- SALOMEDSImpl_AttributeReference.hxx \
- SALOMEDSImpl_AttributeSelectable.hxx \
- SALOMEDSImpl_AttributeSequenceOfInteger.hxx \
- SALOMEDSImpl_AttributeSequenceOfReal.hxx \
- SALOMEDSImpl_Attributes.hxx \
- SALOMEDSImpl_AttributeStudyProperties.hxx \
- SALOMEDSImpl_AttributeTableOfInteger.hxx \
- SALOMEDSImpl_AttributeTableOfReal.hxx \
- SALOMEDSImpl_AttributeTableOfString.hxx \
- SALOMEDSImpl_AttributeTarget.hxx \
- SALOMEDSImpl_AttributeTextColor.hxx \
- SALOMEDSImpl_AttributeTextHighlightColor.hxx \
- SALOMEDSImpl_AttributeTreeNode.hxx \
- SALOMEDSImpl_AttributeUserID.hxx \
- SALOMEDSImpl_AttributeParameter.hxx \
- SALOMEDSImpl_AttributeString.hxx \
- SALOMEDSImpl_Callback.hxx \
- SALOMEDSImpl_ChildIterator.hxx \
- SALOMEDSImpl_ChildNodeIterator.hxx \
- SALOMEDSImpl_Defines.hxx \
- SALOMEDSImpl_Driver.hxx \
- SALOMEDSImpl_GenericAttribute.hxx \
- SALOMEDSImpl_SComponent.hxx \
- SALOMEDSImpl_SComponentIterator.hxx \
- SALOMEDSImpl_SObject.hxx \
- SALOMEDSImpl_StudyBuilder.hxx \
- SALOMEDSImpl_StudyHandle.hxx \
- SALOMEDSImpl_Study.hxx \
- SALOMEDSImpl_StudyManager.hxx \
- SALOMEDSImpl_Tool.hxx \
- SALOMEDSImpl_UseCaseBuilder.hxx \
- SALOMEDSImpl_UseCaseIterator.hxx \
- SALOMEDSImpl_GenericVariable.hxx \
- SALOMEDSImpl_ScalarVariable.hxx
-
-libSalomeDSImpl_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSalomeDSImpl_la_LDFLAGS = -no-undefined -version-info=0:0:0
-libSalomeDSImpl_la_LIBADD = $(COMMON_LIBS)
-
-#
-# ===============================================================
-# Executables targets
-# ===============================================================
-#
-bin_PROGRAMS = testDS
-testDS_SOURCES = testDS.cxx
-testDS_CPPFLAGS = $(COMMON_CPPFLAGS)
-testDS_LDADD = libSalomeDSImpl.la \
- $(HDF5_LIBS)
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeComment.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeComment.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-const string& SALOMEDSImpl_AttributeComment::GetID ()
-{
- static string CommentID ("7AF2F7CC-1CA2-4476-BE95-8ACC996BC7B9");
- return CommentID;
-}
-
-SALOMEDSImpl_AttributeComment* SALOMEDSImpl_AttributeComment::Set (const DF_Label& L,
- const string& Val)
-{
- SALOMEDSImpl_AttributeComment* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeComment*)L.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) {
- A = new SALOMEDSImpl_AttributeComment();
- L.AddAttribute(A);
- }
-
- A->SetValue(Val);
-
- return A;
-}
-
-//=======================================================================
-//function : SetValue
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeComment::SetValue (const string& S)
-{
- CheckLocked();
-
- if(myString == S) return;
-
- Backup();
-
- myString = S;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-const string& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); }
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-DF_Attribute* SALOMEDSImpl_AttributeComment::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeComment();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeComment::Restore(DF_Attribute* with)
-{
- myString = dynamic_cast<SALOMEDSImpl_AttributeComment*>(with)->Value ();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeComment::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeComment*>(into)->SetValue(myString);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeIOR.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeComment_HeaderFile
-#define _SALOMEDSImpl_AttributeComment_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-
-#include <string>
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeComment :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
-
- std::string myString;
-
-public:
-
- static const std::string& GetID() ;
-
- SALOMEDSImpl_AttributeComment() :SALOMEDSImpl_GenericAttribute("AttributeComment") {}
-
- static SALOMEDSImpl_AttributeComment* Set(const DF_Label& L, const std::string& Val);
- void SetValue (const std::string& S);
- std::string Value() const { return myString; }
-
- virtual std::string Save() { return myString; }
- virtual void Load(const std::string& theValue) { myString = theValue; }
-
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
-
- ~SALOMEDSImpl_AttributeComment() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeDrawable.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeDrawable.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeDrawable::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeDrawableID ("12837184-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeDrawableID;
-}
-
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-
-SALOMEDSImpl_AttributeDrawable* SALOMEDSImpl_AttributeDrawable::Set (const DF_Label& L,
- const int value)
-{
- SALOMEDSImpl_AttributeDrawable* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeDrawable*)L.FindAttribute(SALOMEDSImpl_AttributeDrawable::GetID()))) {
- A = new SALOMEDSImpl_AttributeDrawable();
- L.AddAttribute(A);
- }
-
- A->SetDrawable (value);
- return A;
-}
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeDrawable::SALOMEDSImpl_AttributeDrawable()
-:SALOMEDSImpl_GenericAttribute("AttributeDrawable")
-{
- myValue = 0;
-}
-
-//=======================================================================
-//function : SetDrawable
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeDrawable::SetDrawable(const int theValue)
-{
- CheckLocked();
-
- Backup();
-
- (theValue!=0)?myValue=1:myValue=0;
-}
-
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeDrawable::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributeDrawable::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeDrawable();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeDrawable::Restore(DF_Attribute* with)
-{
- myValue = dynamic_cast<SALOMEDSImpl_AttributeDrawable*>(with)->IsDrawable ();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeDrawable::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeDrawable*>(into)->SetDrawable (myValue);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeDrawable.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeDrawable_HeaderFile
-#define _SALOMEDSImpl_AttributeDrawable_HeaderFile
-
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeDrawable :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
- int myValue;
-
-public:
- virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; }
- virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; }
-
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeDrawable* Set(const DF_Label& label,const int value) ;
-
- void SetDrawable(const int theValue);
- int IsDrawable() const { return myValue; }
- SALOMEDSImpl_AttributeDrawable();
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeDrawable() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeExpandable.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeExpandable.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeExpandable::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeExpandableID ("12837185-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeExpandableID;
-}
-
-
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeExpandable* SALOMEDSImpl_AttributeExpandable::Set (const DF_Label& L,
- const int value)
-{
- SALOMEDSImpl_AttributeExpandable* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeExpandable*)L.FindAttribute(SALOMEDSImpl_AttributeExpandable::GetID()))) {
- A = new SALOMEDSImpl_AttributeExpandable();
- L.AddAttribute(A);
- }
-
- A->SetExpandable(value);
- return A;
-}
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeExpandable::SALOMEDSImpl_AttributeExpandable()
-:SALOMEDSImpl_GenericAttribute("AttributeExpandable")
-{
- myValue = 1;
-}
-
-//=======================================================================
-//function : SetExpandable
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeExpandable::SetExpandable(const int theValue)
-{
- CheckLocked();
-
- Backup();
-
- (theValue!=0)?myValue=1:myValue=0;
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeExpandable::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributeExpandable::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeExpandable();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeExpandable::Restore(DF_Attribute* with)
-{
- myValue = dynamic_cast<SALOMEDSImpl_AttributeExpandable*>(with)->IsExpandable ();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeExpandable::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeExpandable*>(into)->SetExpandable (myValue);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeExpandable.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeExpandable_HeaderFile
-#define _SALOMEDSImpl_AttributeExpandable_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeExpandable :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
- int myValue;
-
-public:
-
- virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; }
- virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; }
-
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeExpandable* Set(const DF_Label& label,const int value) ;
- SALOMEDSImpl_AttributeExpandable();
- void SetExpandable(const int value);
- int IsExpandable() const { return myValue; }
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeExpandable() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeExternalFileDef.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeExternalFileDef::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeExternalFileDefID ("7123AD4C-ACDB-4e3a-8FDC-70EA164D2CBE");
- return SALOMEDSImpl_AttributeExternalFileDefID;
-}
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeExternalFileDef*
-SALOMEDSImpl_AttributeExternalFileDef::Set (const DF_Label& L, const std::string& S)
-{
-
- SALOMEDSImpl_AttributeExternalFileDef* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeExternalFileDef*)L.FindAttribute(SALOMEDSImpl_AttributeExternalFileDef::GetID()))) {
- A = new SALOMEDSImpl_AttributeExternalFileDef();
- L.AddAttribute(A);
- }
-
- A->SetValue (S);
- return A;
-}
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeExternalFileDef::SALOMEDSImpl_AttributeExternalFileDef()
-:SALOMEDSImpl_GenericAttribute("AttributeExternalFileDef")
-{
-}
-
-//=======================================================================
-//function : SetValue
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeExternalFileDef::SetValue (const std::string& S)
-{
- CheckLocked();
-
- if(myString == S) return;
-
- Backup();
-
- myString = S;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeExternalFileDef::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-DF_Attribute* SALOMEDSImpl_AttributeExternalFileDef::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeExternalFileDef();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeExternalFileDef::Restore(DF_Attribute* with)
-{
- myString = dynamic_cast<SALOMEDSImpl_AttributeExternalFileDef*>(with)->Value ();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeExternalFileDef::Paste (DF_Attribute* into)
-{
- SALOMEDSImpl_AttributeExternalFileDef* anAttr = dynamic_cast<SALOMEDSImpl_AttributeExternalFileDef*>(into);
- anAttr->SetValue(myString);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef _SALOMEDSImpl_AttributeExternalFileDef_HeaderFile
-#define _SALOMEDSImpl_AttributeExternalFileDef_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeExternalFileDef :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
-
- std::string myString;
-
-public:
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeExternalFileDef* Set(const DF_Label& label,
- const std::string& Name);
- SALOMEDSImpl_AttributeExternalFileDef();
- void SetValue(const std::string& value);
- std::string Value() const { return myString; }
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeExternalFileDef() {}
-
- virtual std::string Save() { return myString; }
- virtual void Load(const std::string& theValue) { myString = theValue; }
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeFileType.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeFileType.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeFileType::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeFileTypeID ("0181B525-3F15-4ab2-9DE3-5E2F54B5F340");
- return SALOMEDSImpl_AttributeFileTypeID;
-}
-
-
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-
-SALOMEDSImpl_AttributeFileType* SALOMEDSImpl_AttributeFileType::Set (const DF_Label& L,
- const std::string& S)
-{
-
- SALOMEDSImpl_AttributeFileType* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeFileType*)L.FindAttribute(SALOMEDSImpl_AttributeFileType::GetID()))) {
- A = new SALOMEDSImpl_AttributeFileType();
- L.AddAttribute(A);
- }
-
- A->SetValue (S);
- return A;
-}
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeFileType::SALOMEDSImpl_AttributeFileType()
-:SALOMEDSImpl_GenericAttribute("AttributeFileType")
-{
-}
-
-//=======================================================================
-//function : SetValue
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeFileType::SetValue (const std::string& S)
-{
- CheckLocked();
-
- if(myString == S) return;
-
- Backup();
-
- myString = S;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeFileType::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributeFileType::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeFileType();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeFileType::Restore(DF_Attribute* with)
-{
- myString = dynamic_cast<SALOMEDSImpl_AttributeFileType*>(with)->Value ();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeFileType::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeFileType*>(into)->SetValue (myString);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef _SALOMEDSImpl_AttributeFileType_HeaderFile
-#define _SALOMEDSImpl_AttributeFileType_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeFileType :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
-
- std::string myString;
-
-public:
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeFileType* Set(const DF_Label& label,
- const std::string& Name) ;
- SALOMEDSImpl_AttributeFileType();
- void SetValue(const std::string& value);
- std::string Value() const { return myString; }
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeFileType() {}
-
- virtual std::string Save() { return myString; }
- virtual void Load(const std::string& theValue) { myString = theValue; }
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeFlags.cxx
-// Author : Sergey LITONIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeFlags.hxx"
-
-using namespace std;
-
-
-/*
- Class : SALOMEDSImpl_AttributeFlags
- Description : This class is intended for storing different object attributes that
- have only two states (0 and 1).
-*/
-
-//=======================================================================
-//function : SALOMEDSImpl_AttributeFlags::GetID
-//purpose : Get GUID of this attribute
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeFlags::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeFlagsID( "866EEC9F-A517-4cb4-88E6-E208DB8FC96F" );
- return SALOMEDSImpl_AttributeFlagsID;
-}
-
-//=======================================================================
-//function : SALOMEDSImpl_AttributeFlags::Set
-//purpose : Set value of the attribute
-//=======================================================================
-SALOMEDSImpl_AttributeFlags* SALOMEDSImpl_AttributeFlags::Set(const DF_Label& L,
- const int value )
-{
- SALOMEDSImpl_AttributeFlags* A = NULL;
- if ( !(A=(SALOMEDSImpl_AttributeFlags*)L.FindAttribute(SALOMEDSImpl_AttributeFlags::GetID())) )
- {
- A = new SALOMEDSImpl_AttributeFlags();
- L.AddAttribute( A );
- }
-
- A->Set( value );
- return A;
-}
-
-//=======================================================================
-//function : SALOMEDSImpl_AttributeFlags::SALOMEDSImpl_AttributeFlags
-//purpose : Constructor
-//=======================================================================
-SALOMEDSImpl_AttributeFlags::SALOMEDSImpl_AttributeFlags()
-:SALOMEDSImpl_GenericAttribute("AttributeFlags")
-{
- myValue = 0;
-}
-
-SALOMEDSImpl_AttributeFlags::~SALOMEDSImpl_AttributeFlags()
-{
-}
-
-//=======================================================================
-//function : SALOMEDSImpl_AttributeFlags::ID
-//purpose : Get GUID of this attribute
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeFlags::ID () const
-{
- return GetID();
-}
-
-//=======================================================================
-//function : SALOMEDSImpl_AttributeFlags::NewEmpty
-//purpose : Create new empty attribute
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributeFlags::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeFlags();
-}
-
-//=======================================================================
-//function : SALOMEDSImpl_AttributeFlags::Restore
-//purpose : Assign given value to the attribute
-//=======================================================================
-void SALOMEDSImpl_AttributeFlags::Restore( DF_Attribute* with )
-{
- myValue = dynamic_cast<SALOMEDSImpl_AttributeFlags*>( with )->Get();
- return;
-}
-
-//=======================================================================
-//function : SALOMEDSImpl_AttributeFlags::Paste
-//purpose : Assign internal value to the given attribute
-//=======================================================================
-void SALOMEDSImpl_AttributeFlags::Paste( DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeFlags*>( into )->Set( myValue );
-}
-
-//=======================================================================
-//function : SALOMEDSImpl_AttributeFlags::Set
-//purpose : Set value
-//=======================================================================
-void SALOMEDSImpl_AttributeFlags::Set( const int v )
-{
- Backup();
- myValue=v;
-}
-
-//=======================================================================
-//function : SALOMEDSImpl_AttributeFlags::Get
-//purpose : GetValue
-//=======================================================================
-int SALOMEDSImpl_AttributeFlags::Get() const
-{
- return myValue;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeFlags.hxx
-// Author : Sergey LITONIN
-// Module : SALOME
-//
-#ifndef SALOMEDSImpl_AttributeFlags_HeaderFile
-#define SALOMEDSImpl_AttributeFlags_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-
-
-/*
-Class : SALOMEDSImpl_AttributeFlags
-Description : This class is intended for storing different object attributes that
-have only two states (0 and 1).
-*/
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeFlags :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
- int myValue;
-
-public:
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeFlags* Set(const DF_Label&, const int theValue );
-
- SALOMEDSImpl_AttributeFlags();
- virtual ~SALOMEDSImpl_AttributeFlags();
-
- const std::string& ID() const;
- void Restore( DF_Attribute* with );
- DF_Attribute* NewEmpty() const;
- void Paste( DF_Attribute* into);
- void Set( const int );
- int Get() const;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeGraphic.cxx
-// Author : Sergey LITONIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeGraphic.hxx"
-#include "DF_Attribute.hxx"
-
-using namespace std;
-
-/*
- Class : SALOMEDSImpl_AttributeGraphic
- Description : This class is intended for storing information about
- graphic representation of objects in dirrent views
-*/
-
-//=======================================================================
-//function : GetID
-//purpose : Get GUID of this attribute
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeGraphic::GetID()
-{
- static std::string SALOMEDSImpl_AttributeGraphicID( "F17AE8F0-E354-4d6f-8E42-38385C36E67E" );
- return SALOMEDSImpl_AttributeGraphicID;
-}
-
-//=======================================================================
-//function : SALOMEDSImpl_AttributeGraphic
-//purpose : Empty Constructor
-//=======================================================================
-SALOMEDSImpl_AttributeGraphic::SALOMEDSImpl_AttributeGraphic()
-:SALOMEDSImpl_GenericAttribute("AttributeGraphic")
-{
-}
-
-//=======================================================================
-//function : ~SALOMEDSImpl_AttributeGraphic
-//purpose : Destructor
-//=======================================================================
-SALOMEDSImpl_AttributeGraphic::~SALOMEDSImpl_AttributeGraphic()
-{
-}
-
-//=======================================================================
-//function : SetVisibility
-//purpose : Set visibility of object in given view
-//=======================================================================
-void SALOMEDSImpl_AttributeGraphic::SetVisibility(const int theViewId,
- const bool theValue )
-{
- if ( myVisibility.find( theViewId ) != myVisibility.end() && myVisibility[theViewId] == theValue )
- return;
-
- Backup();
- myVisibility[ theViewId ] = theValue ? 1 : 0;
-}
-
-
-//=======================================================================
-//function : Get
-//purpose : Get visibility of object in given view
-//=======================================================================
-bool SALOMEDSImpl_AttributeGraphic::GetVisibility(const int theViewId )
-{
- bool isVisible = false;
- if(myVisibility.find( theViewId )!=myVisibility.end())
- isVisible = (bool)myVisibility[theViewId];
- else
- isVisible = false;
-
- return isVisible;
-}
-
-
-//=======================================================================
-//function : ID
-//purpose : Get GUID of this attribute
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeGraphic::ID () const
-{
- return GetID();
-}
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose : Create new empty attribute
-//=======================================================================
-DF_Attribute* SALOMEDSImpl_AttributeGraphic::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeGraphic ();
-}
-
-//=======================================================================
-//function : SetVisibility
-//purpose : Set visibility of object in all views
-//=======================================================================
-void SALOMEDSImpl_AttributeGraphic::SetVisibility( const map<int, int>& theMap )
-{
- myVisibility = theMap;
-}
-
-//=======================================================================
-//function : SetVisibility
-//purpose : Get visibility of object in all views
-//=======================================================================
-const map<int, int>& SALOMEDSImpl_AttributeGraphic::GetVisibility()
-{
- return myVisibility;
-}
-
-//=======================================================================
-//function : Restore
-//purpose : Restore value of attribute with value of theWith one
-//=======================================================================
-void SALOMEDSImpl_AttributeGraphic::Restore( DF_Attribute* theWith )
-{
- SALOMEDSImpl_AttributeGraphic* anAttr =
- dynamic_cast<SALOMEDSImpl_AttributeGraphic*>( theWith );
-
- if ( anAttr )
- SetVisibility( anAttr->GetVisibility() );
-}
-
-//=======================================================================
-//function : Paste
-//purpose : Paste value of current attribute to the value of entry one
-//=======================================================================
-void SALOMEDSImpl_AttributeGraphic::Paste( DF_Attribute* theInto)
-{
- SALOMEDSImpl_AttributeGraphic* anAttr =
- dynamic_cast<SALOMEDSImpl_AttributeGraphic*>( theInto );
-
- if ( anAttr )
- anAttr->SetVisibility( myVisibility );
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeGraphic.hxx
-// Author : Sergey LITONIN
-// Module : SALOME
-//
-#ifndef SALOMEDSImpl_AttributeGraphic_HeaderFile
-#define SALOMEDSImpl_AttributeGraphic_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <map>
-
-/*
-Class : SALOMEDSImpl_AttributeGraphic
-Description : This class is intended for storing information about
-graphic representation of objects in dirrent views
-*/
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeGraphic :
- public SALOMEDSImpl_GenericAttribute
-{
-
-public:
- SALOMEDSImpl_AttributeGraphic();
- ~SALOMEDSImpl_AttributeGraphic();
-
- static const std::string& GetID() ;
-
- void SetVisibility( const int, const bool );
- bool GetVisibility( const int );
- const std::string& ID() const;
- void Restore( DF_Attribute* theWith );
- DF_Attribute* NewEmpty() const;
- void Paste( DF_Attribute* theInto);
-
- void SetVisibility( const std::map<int, int>& );
-
- const std::map<int, int>& GetVisibility();
-
-private:
- std::map<int, int> myVisibility;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeIOR.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeIOR.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeIOR::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeIORID ("92888E01-7074-11d5-A690-0800369C8A03");
- return SALOMEDSImpl_AttributeIORID;
-}
-
-
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-
-SALOMEDSImpl_AttributeIOR* SALOMEDSImpl_AttributeIOR::Set (const DF_Label& L,
- const std::string& S)
-{
- SALOMEDSImpl_AttributeIOR* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeIOR*)L.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) {
- A = new SALOMEDSImpl_AttributeIOR();
- L.AddAttribute(A);
- }
-
- A->SetValue(S);
- SALOMEDSImpl_Study::IORUpdated(A);
- return A;
-}
-
-//=======================================================================
-//function : SetValue
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeIOR::SetValue(const std::string& theValue)
-{
- CheckLocked();
-
- SALOMEDSImpl_Study::GetStudy(Label());
-
- Backup();
- myString = theValue;
-
- SALOMEDSImpl_Study::IORUpdated(this);
-}
-
-//=======================================================================
-//function : Value
-//purpose :
-//=======================================================================
-std::string SALOMEDSImpl_AttributeIOR::Value() const
-{
- return myString;
-}
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeIOR::SALOMEDSImpl_AttributeIOR()
-:SALOMEDSImpl_GenericAttribute("AttributeIOR")
-{
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeIOR::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributeIOR::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeIOR();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeIOR::Restore( DF_Attribute* with)
-{
- myString = dynamic_cast<SALOMEDSImpl_AttributeIOR*>(with)->Value();
- return;
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeIOR::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeIOR*>(into)->SetValue(myString);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeIOR.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeIOR_HeaderFile
-#define _SALOMEDSImpl_AttributeIOR_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include <string>
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeIOR :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
-
- std::string myString;
-
-public:
-
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeIOR* Set(const DF_Label& label,
- const std::string& IOR);
- SALOMEDSImpl_AttributeIOR();
- const std::string& ID() const;
- void SetValue(const std::string& theValue);
- std::string Value() const ;
- void Restore(DF_Attribute* with);
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeIOR() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeInteger.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeInteger.hxx"
-
-#include <stdlib.h>
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeInteger::GetID ()
-{
- static std::string IntegerID ("8CC3E213-C9B4-47e4-8496-DD5E62E22018");
- return IntegerID;
-}
-
-SALOMEDSImpl_AttributeInteger* SALOMEDSImpl_AttributeInteger::Set (const DF_Label& L, int Val)
-{
- SALOMEDSImpl_AttributeInteger* A = NULL;
- if (!(A = (SALOMEDSImpl_AttributeInteger*)L.FindAttribute(SALOMEDSImpl_AttributeInteger::GetID()))) {
- A = new SALOMEDSImpl_AttributeInteger();
- L.AddAttribute(A);
- }
-
- A->SetValue(Val);
- return A;
-}
-
-//=======================================================================
-//function : Value
-//purpose :
-//=======================================================================
-int SALOMEDSImpl_AttributeInteger::Value() const
-{
- return myValue;
-}
-
-//=======================================================================
-//function : SetValue
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeInteger::SetValue(const int v)
-{
- if(myValue == v) return;
-
- Backup();
- myValue = v;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeInteger::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-DF_Attribute* SALOMEDSImpl_AttributeInteger::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeInteger();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeInteger::Restore(DF_Attribute* With)
-{
- myValue = dynamic_cast<SALOMEDSImpl_AttributeInteger*>(With)->Value();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeInteger::Paste (DF_Attribute* Into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeInteger*>(Into)->SetValue(myValue);
-}
-
-//=======================================================================
-//function : Save
-//purpose :
-//=======================================================================
-string SALOMEDSImpl_AttributeInteger::Save()
-{
- char buffer[128];
- sprintf(buffer, "%d", myValue);
- return string(buffer);
-}
-
-//=======================================================================
-//function : Load
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeInteger::Load(const string& theValue)
-{
- myValue = atoi(theValue.c_str());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeInteger.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeInteger_HeaderFile
-#define _SALOMEDSImpl_AttributeInteger_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include <string>
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeInteger : public SALOMEDSImpl_GenericAttribute
-{
-private:
- int myValue;
-
-public:
- static const std::string& GetID() ;
-
- SALOMEDSImpl_AttributeInteger():SALOMEDSImpl_GenericAttribute("AttributeInteger") {}
- static SALOMEDSImpl_AttributeInteger* Set (const DF_Label& L, int Val);
- void SetValue(const int theVal);
- int Value() const;
- virtual std::string Save();
- virtual void Load(const std::string& theValue);
-
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeInteger() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeLocalID.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeLocalID.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeLocalID::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeLocalID ("12837196-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeLocalID;
-}
-
-
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-
-SALOMEDSImpl_AttributeLocalID* SALOMEDSImpl_AttributeLocalID::Set (const DF_Label& L,
- const int value)
-{
- SALOMEDSImpl_AttributeLocalID* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeLocalID*)L.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID()))) {
- A = new SALOMEDSImpl_AttributeLocalID();
- L.AddAttribute(A);
- }
-
- A->SetValue(value);
- return A;
-}
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeLocalID::SALOMEDSImpl_AttributeLocalID()
-:SALOMEDSImpl_GenericAttribute("AttributeLocalID")
-{
- myValue = 0;
-}
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeLocalID::SetValue(const int theValue)
-{
- CheckLocked();
-
- Backup();
-
- myValue = theValue;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeLocalID::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributeLocalID::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeLocalID();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeLocalID::Restore(DF_Attribute* with)
-{
- myValue = dynamic_cast<SALOMEDSImpl_AttributeLocalID*>(with)->Value();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeLocalID::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeLocalID*>(into)->SetValue(myValue);
-}
-
-//=======================================================================
-//function : Save
-//purpose :
-//=======================================================================
-string SALOMEDSImpl_AttributeLocalID::Save()
-{
- char buffer[128];
- sprintf(buffer, "%d", myValue);
- return string(buffer);
-}
-
-//=======================================================================
-//function : Load
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeLocalID::Load(const string& theValue)
-{
- myValue = atoi(theValue.c_str());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeLocalID.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeLocalID_HeaderFile
-#define _SALOMEDSImpl_AttributeLocalID_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include <string>
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeLocalID :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
- int myValue;
-
-public:
-
- virtual std::string Save();
- virtual void Load(const std::string& theValue);
-
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeLocalID* Set(const DF_Label& label,const int value) ;
- void SetValue(const int value);
- int Value() const { return myValue; }
- SALOMEDSImpl_AttributeLocalID();
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute*);
- ~SALOMEDSImpl_AttributeLocalID() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeName.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeName.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeName::GetID ()
-{
- static std::string NameID ("8650000D-63A0-4651-B621-CC95C9308598");
- return NameID;
-}
-
-SALOMEDSImpl_AttributeName* SALOMEDSImpl_AttributeName::Set (const DF_Label& L,
- const std::string& Val)
-{
- SALOMEDSImpl_AttributeName* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeName*)L.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) {
- A = new SALOMEDSImpl_AttributeName();
- L.AddAttribute(A);
- }
-
- A->SetValue(Val);
- return A;
-}
-
-//=======================================================================
-//function : SetValue
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeName::SetValue (const std::string& S)
-{
- CheckLocked();
-
- if(myString == S) return;
-
- Backup();
-
- myString = S;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeName::ID () const { return GetID(); }
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-DF_Attribute* SALOMEDSImpl_AttributeName::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeName();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeName::Restore(DF_Attribute* with)
-{
- myString = dynamic_cast<SALOMEDSImpl_AttributeName*>(with)->Value ();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeName::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeName*>(into)->SetValue(myString);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeIOR.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeName_HeaderFile
-#define _SALOMEDSImpl_AttributeName_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include <string>
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeName :
- public SALOMEDSImpl_GenericAttribute
-{
-
-private:
-
- std::string myString;
-
-public:
- static const std::string& GetID() ;
-
- SALOMEDSImpl_AttributeName():SALOMEDSImpl_GenericAttribute("AttributeName") {}
- static SALOMEDSImpl_AttributeName* Set (const DF_Label& L, const std::string& Val);
- void SetValue(const std::string& theVal);
- std::string Value() const { return myString; }
-
- virtual std::string Save() { return myString; }
- virtual void Load(const std::string& theValue) { myString = theValue; }
-
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
-
- ~SALOMEDSImpl_AttributeName() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeOpened.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeOpened.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeOpened::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeOpenedID ("12837186-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeOpenedID;
-}
-
-
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-
-SALOMEDSImpl_AttributeOpened* SALOMEDSImpl_AttributeOpened::Set (const DF_Label& L,
- const int value)
-{
- SALOMEDSImpl_AttributeOpened* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeOpened*)L.FindAttribute(SALOMEDSImpl_AttributeOpened::GetID()))) {
- A = new SALOMEDSImpl_AttributeOpened();
- L.AddAttribute(A);
- }
-
- A->SetOpened (value);
- return A;
-}
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeOpened::SALOMEDSImpl_AttributeOpened()
-:SALOMEDSImpl_GenericAttribute("AttributeOpened")
-{
- myValue = 0;
-}
-
-//=======================================================================
-//function : SetOpened
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeOpened::SetOpened(const int theValue)
-{
- Backup();
-
- (theValue!=0)?myValue=1:myValue=0;
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeOpened::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributeOpened::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeOpened();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeOpened::Restore(DF_Attribute* with)
-{
- myValue = dynamic_cast<SALOMEDSImpl_AttributeOpened*>(with)->IsOpened ();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeOpened::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeOpened*>(into)->SetOpened (myValue);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeOpened.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeOpened_HeaderFile
-#define _SALOMEDSImpl_AttributeOpened_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include <string>
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeOpened :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
- int myValue;
-
-public:
-
- virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; }
- virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; }
-
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeOpened* Set(const DF_Label& label,const int value) ;
- SALOMEDSImpl_AttributeOpened();
- void SetOpened(const int value);
- int IsOpened() const { return myValue; }
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeOpened() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeParameter.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeParameter.hxx"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sstream>
-#include <sstream>
-
-using namespace std;
-
-
-
-// Purpose: Each character in the string is replaced by 3 characters: '%' and hex number
-// of the character (2 characters)
-string convertString(const string& S)
-{
- int length = S.size();
- const char *s = S.c_str();
- char *c = new char[3], *buffer = new char[length*3+1];
- buffer[length*3] = (char)0;
- for(int i = 0, pos = 0; i<length; i++, pos+=3) {
- int val = (int)s[i];
- buffer[pos] = '%';
- sprintf(c, "%.2x", val);
- buffer[pos+1] = c[0];
- buffer[pos+2] = c[1];
- }
-
- string RS(buffer);
- delete c;
- delete buffer;
- return RS;
-}
-
-//Restors a string converted by the function convertString
-string restoreString(const string& S)
-{
- int length = S.size();
- char *c = new char[3], *buffer = new char[length/3+1];
- buffer[length/3] = (char)0;
- const char *s = S.c_str();
- for(int i = 0, pos = 0; i<length; i+=3, pos++) {
- c[0] = s[i+1];
- c[1] = s[i+2];
- c[2] = (char)0;
- int val = strtol(c, NULL, 16);
- buffer[pos] = (char)val;
- }
-
- string RS(buffer);
- delete c;
- delete buffer;
- return RS;
-}
-
-//=======================================================================
-/*!
- * Function : GetID
- * Purpose : Returns GUID of the attribute
- */
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeParameter::GetID ()
-{
- static std::string ParemeterID ("BA75F3A1-E40B-46b8-8D24-B1D3C3BB1A8C");
- return ParemeterID;
-}
-
-//=======================================================================
-/*!
- * Function : Set
- * Purpose : Adds an attribute to the label
- */
-//=======================================================================
-SALOMEDSImpl_AttributeParameter* SALOMEDSImpl_AttributeParameter::Set (const DF_Label& L)
-{
- SALOMEDSImpl_AttributeParameter* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeParameter*)L.FindAttribute(SALOMEDSImpl_AttributeParameter::GetID()))) {
- A = new SALOMEDSImpl_AttributeParameter();
- L.AddAttribute(A);
- }
-
- return A;
-}
-
-//=======================================================================
-/*!
- * Function : SetInt
- * Purpose : Associates a integer value with the ID
- */
-//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetInt(const string& theID, const int& theValue)
-{
- CheckLocked();
-
- if(theID.size() == 0) return;
-
- Backup();
-
- _ints[theID] = theValue;
-
- SetModifyFlag();
-}
-
-//=======================================================================
-/*!
- * Function : GetInt
- * Purpose : Returns a int value associated with the given ID
- */
-//=======================================================================
-int SALOMEDSImpl_AttributeParameter::GetInt(const string& theID)
-{
- if(!IsSet(theID, PT_INTEGER)) throw DFexception("Invalid ID");
- return _ints[theID];
-}
-
-//=======================================================================
-/*!
- * Function : SetReal
- * Purpose : Associates a double value with the ID
- */
-//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetReal(const string& theID, const double& theValue)
-{
- CheckLocked();
-
- if(theID.size() == 0) return;
-
- Backup();
-
- _reals[theID] = theValue;
-
- SetModifyFlag();
-}
-
-//=======================================================================
-/*!
- * Function : GetReal
- * Purpose : Returns a double value associated with the given ID
- */
-//=======================================================================
-double SALOMEDSImpl_AttributeParameter::GetReal(const string& theID)
-{
- if(!IsSet(theID, PT_REAL)) throw DFexception("Invalid ID");
- return _reals[theID];
-}
-
-//=======================================================================
-/*!
- * Function : SetString
- * Purpose : Associates a string with the ID
- */
-//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetString(const string& theID, const string& theValue)
-{
- CheckLocked();
-
- if(theID.size() == 0) return;
-
- Backup();
-
- _strings[theID] = theValue;
-
- SetModifyFlag();
-}
-
-//=======================================================================
-/*!
- * Function : GetString
- * Purpose : Returns a string associated with the given ID
- */
-//=======================================================================
-string SALOMEDSImpl_AttributeParameter::GetString(const string& theID)
-{
- if(!IsSet(theID, PT_STRING)) throw DFexception("Invalid ID");
- return _strings[theID];
-}
-
-//=======================================================================
-/*!
- * Function : SetBool
- * Purpose : Associates a bool value with the ID
- */
-//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetBool(const string& theID, const bool& theValue)
-{
- CheckLocked();
-
- if(theID.size() == 0) return;
-
- Backup();
-
- _bools[theID] = theValue;
-
- SetModifyFlag();
-}
-
-//=======================================================================
-/*!
- * Function : GetBool
- * Purpose : Returns a bool value associated with the ID
- */
-//=======================================================================
-bool SALOMEDSImpl_AttributeParameter::GetBool(const string& theID)
-{
- if(!IsSet(theID, PT_BOOLEAN)) throw DFexception("Invalid ID");
- return _bools[theID];
-}
-
-//=======================================================================
-/*!
- * Function : SetRealArray
- * Purpose : Associates an array of double values with the given ID
- */
-//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetRealArray(const string& theID, const vector<double>& theArray)
-{
- CheckLocked();
-
- if(theID.size() == 0) return;
-
- Backup();
-
- _realarrays[theID] = theArray;
-
- SetModifyFlag();
-}
-
-//=======================================================================
-/*!
- * Function : GetRealArray
- * Purpose : Returns double values associated with the ID
- */
-//=======================================================================
-vector<double> SALOMEDSImpl_AttributeParameter::GetRealArray(const string& theID)
-{
- if(!IsSet(theID, PT_REALARRAY)) throw DFexception("Invalid ID");
- return _realarrays[theID];
-}
-
-
-//=======================================================================
-/*!
- * Function : SetIntArray
- * Purpose : Associates an array of int values with the given ID
- */
-//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetIntArray(const string& theID, const vector<int>& theArray)
-{
- CheckLocked();
-
- if(theID.size() == 0) return;
-
- Backup();
-
- _intarrays[theID] = theArray;
-
- SetModifyFlag();
-}
-
-//=======================================================================
-/*!
- * Function : GetIntArray
- * Purpose : Returns int values associated with the ID
- */
-//=======================================================================
-vector<int> SALOMEDSImpl_AttributeParameter::GetIntArray(const string& theID)
-{
- if(!IsSet(theID, PT_INTARRAY)) throw DFexception("Invalid ID");
- return _intarrays[theID];
-}
-
-
-//=======================================================================
-/*!
- * Function : SetStrArray
- * Purpose : Associates an array of string values with the given ID
- */
-//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetStrArray(const string& theID, const vector<string>& theArray)
-{
- CheckLocked();
-
- if(theID.size() == 0) return;
-
- Backup();
-
- _strarrays[theID] = theArray;
-
- SetModifyFlag();
-}
-
-//=======================================================================
-/*!
- * Function : GetStrArray
- * Purpose : Returns string values associated with the ID
- */
-//=======================================================================
-vector<string> SALOMEDSImpl_AttributeParameter::GetStrArray(const string& theID)
-{
- if(!IsSet(theID, PT_STRARRAY)) throw DFexception("Invalid ID");
- return _strarrays[theID];
-}
-
-
-//=======================================================================
-/*!
- * Function : IsSet
- * Purpose : Returns true if for the ID of given type was assigned \n
- * a value in the attribute
- */
-//=======================================================================
-bool SALOMEDSImpl_AttributeParameter::IsSet(const string& theID, const Parameter_Types theType)
-{
- switch(theType) {
- case PT_INTEGER: {
- if(_ints.find(theID) != _ints.end()) return true;
- break;
- }
- case PT_REAL: {
- if(_reals.find(theID) != _reals.end()) return true;
- break;
- }
- case PT_BOOLEAN: {
- if(_bools.find(theID) != _bools.end()) return true;
- break;
- }
- case PT_STRING: {
- if(_strings.find(theID) != _strings.end()) return true;
- break;
- }
- case PT_REALARRAY: {
- if(_realarrays.find(theID) != _realarrays.end()) return true;
- break;
- }
- case PT_INTARRAY: {
- if(_intarrays.find(theID) != _intarrays.end()) return true;
- break;
- }
- case PT_STRARRAY: {
- if(_strarrays.find(theID) != _strarrays.end()) return true;
- break;
- }
- default: return false;
- }
-
- return false;
-}
-
-//=======================================================================
-/*!
- * Function : RemoveID
- * Purpose : Removes a parameter with given ID
- */
-//=======================================================================
-bool SALOMEDSImpl_AttributeParameter::RemoveID(const string& theID, const Parameter_Types theType)
-{
- Backup();
- SetModifyFlag();
-
- switch(theType) {
- case PT_INTEGER: {
- if(_ints.erase(theID)) return true;
- break;
- }
- case PT_REAL: {
- if(_reals.erase(theID)) return true;
- break;
- }
- case PT_BOOLEAN: {
- if(_bools.erase(theID)) return true;
- break;
- }
- case PT_STRING: {
- if(_strings.erase(theID)) return true;
- break;
- }
- case PT_REALARRAY: {
- if(_realarrays.erase(theID)) return true;
- break;
- }
- case PT_INTARRAY: {
- if(_intarrays.erase(theID)) return true;
- break;
- }
- case PT_STRARRAY: {
- if(_strarrays.erase(theID)) return true;
- break;
- }
- default: return false;
- }
-
-
- return false;
-}
-
-
-//=======================================================================
-/*!
- * Function : GetFather
- * Purpose : Returns a father attribute for this attribute
- */
-//=======================================================================
-SALOMEDSImpl_AttributeParameter* SALOMEDSImpl_AttributeParameter::GetFather()
-{
- SALOMEDSImpl_AttributeParameter* aFather;
- DF_Label L = Label();
- if(L.IsRoot()) return aFather;
-
- while(!L.IsRoot()) {
- L = L.Father();
- if((aFather=(SALOMEDSImpl_AttributeParameter*)L.FindAttribute(SALOMEDSImpl_AttributeParameter::GetID()))) break;
- }
-
- return aFather;
-}
-
-//=======================================================================
-/*!
- * Function : HasFather
- * Purpose : Returns True if the attribute has a father attribute
- */
-//=======================================================================
-bool SALOMEDSImpl_AttributeParameter::HasFather()
-{
- DF_Label L = Label();
- if(L.IsRoot()) return false;
- while(!L.IsRoot()) {
- L = L.Father();
- if(L.IsAttribute(SALOMEDSImpl_AttributeParameter::GetID())) return true;
- }
-
- return false;
-}
-
-//=======================================================================
-/*!
- * Function : IsRoot
- * Purpose : Returns True is the attribute is highest in an hierachy
- */
-//=======================================================================
-bool SALOMEDSImpl_AttributeParameter::IsRoot()
-{
- return ((HasFather())?false:true);
-}
-
-//=======================================================================
-/*!
- * Function : Clear
- * Purpose : Clears the content of the attribute
- */
-//=======================================================================
-void SALOMEDSImpl_AttributeParameter::Clear()
-{
- Backup();
-
- _ints.clear();
- _reals.clear();
- _bools.clear();
- _strings.clear();
- _realarrays.clear();
- _intarrays.clear();
- _strarrays.clear();
-
- SetModifyFlag();
-}
-
-//=======================================================================
-/*!
- * Function : GetIDs
- * Purpose : Returns an array of all ID's of the given type
- */
-//=======================================================================
-vector<string> SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types theType)
-{
-
- vector<string> anArray;
- int i = 0;
-
- switch(theType) {
- case PT_INTEGER: {
- if(_ints.size()) {
- anArray.resize(_ints.size());
- for(map<string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++)
- anArray[i] = p->first;
- }
- break;
- }
- case PT_REAL: {
- if(_reals.size()) {
- anArray.resize(_reals.size());
- for(map<string,double>::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++)
- anArray[i] = p->first;
- }
- break;
- }
- case PT_BOOLEAN: {
- if(_bools.size()) {
- anArray.resize(_bools.size());
- for(map<string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++)
- anArray[i] = p->first;
- }
- break;
- }
- case PT_STRING: {
- if(_strings.size()) {
- anArray.resize(_strings.size());
- for(map<string,string>::const_iterator p = _strings.begin(); p!= _strings.end(); p++)
- anArray[i] = p->first;
- }
- break;
- }
- case PT_REALARRAY: {
- if(_realarrays.size()) {
- anArray.resize(_realarrays.size());
- for(map< string, vector<double> >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++)
- anArray[i] = p->first;
- }
- break;
- }
- case PT_INTARRAY: {
- if(_intarrays.size()) {
- anArray.resize(_intarrays.size());
- for(map< string, vector<int> >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++)
- anArray[i] = p->first;
- }
- break;
- }
- case PT_STRARRAY: {
- if(_strarrays.size()) {
- anArray.resize(_strarrays.size());
- for(map< string, vector<string> >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++)
- anArray[i] = p->first;
- }
- break;
- }
- default: return anArray;
- }
-
- return anArray;
-}
-
-//=======================================================================
-/*!
- * Function : ID
- * Purpose : Rteurns an GUID of the attribute
- */
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeParameter::ID () const { return GetID(); }
-
-
-DF_Attribute* SALOMEDSImpl_AttributeParameter::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeParameter();
-}
-
-//=======================================================================
-/*!
- * Function : Restore
- * Purpose : Restors the content of the attribute from another
- */
-//=======================================================================
-void SALOMEDSImpl_AttributeParameter::Restore(DF_Attribute* with)
-{
- SALOMEDSImpl_AttributeParameter* A = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(with);
- _ints.clear();
- _reals.clear();
- _bools.clear();
- _strings.clear();
- _realarrays.clear();
- _intarrays.clear();
- _strarrays.clear();
-
- for(map<string,int>::const_iterator p = A->_ints.begin(); p!= A->_ints.end(); p++)
- if(p->first.size()) _ints[p->first] = p->second;
- for(map<string,double>::const_iterator p = A->_reals.begin(); p!= A->_reals.end(); p++)
- if(p->first.size()) _reals[p->first] = p->second;
- for(map<string,bool>::const_iterator p = A->_bools.begin(); p!= A->_bools.end(); p++)
- if(p->first.size()) _bools[p->first] = p->second;
- for(map<string,string>::const_iterator p = A->_strings.begin(); p!= A->_strings.end(); p++)
- if(p->first.size()) _strings[p->first] = p->second;
- for(map< string,vector<double> >::const_iterator p = A->_realarrays.begin(); p!= A->_realarrays.end(); p++)
- if(p->first.size()) _realarrays[p->first] = p->second;
- for(map< string,vector<int> >::const_iterator p = A->_intarrays.begin(); p!= A->_intarrays.end(); p++)
- if(p->first.size()) _intarrays[p->first] = p->second;
- for(map< string,vector<string> >::const_iterator p = A->_strarrays.begin(); p!= A->_strarrays.end(); p++)
- if(p->first.size()) _strarrays[p->first] = p->second;
-}
-
-//=======================================================================
-/*!
- * Function : Paste
- * Purpose : Pastes the content of attribute to another
- */
-//=======================================================================
-void SALOMEDSImpl_AttributeParameter::Paste (DF_Attribute* into)
-{
- into->Restore(this);
-}
-
-//=======================================================================
-/*!
- * Function : Save
- * Purpose : Saves a content of the attribute as a string
- */
-//=======================================================================
-string SALOMEDSImpl_AttributeParameter::Save()
-{
- ostringstream buffer;
- char *tmpBuffer = new char[255];
-
- buffer << _ints.size() << " ";
-
- for(map<string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++) {
- buffer << convertString(p->first) << " " << p->second << " ";
- }
-
- buffer << _reals.size() << " ";
- for(map<string,double>::const_iterator p =_reals.begin(); p != _reals.end(); p++) {
- sprintf(tmpBuffer, "%.64e", p->second);
- buffer << convertString(p->first) << " " << tmpBuffer << " ";
- }
-
- buffer << _bools.size() << " ";
- for(map<string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++) {
- buffer << convertString(p->first) << " " << p->second << " ";
- }
-
- buffer << _strings.size() << " ";
- for(map<string,string>::const_iterator p = _strings.begin(); p != _strings.end(); p++) {
- buffer << convertString(p->first) << " " << convertString(p->second) << " ";
- }
-
- buffer << _realarrays.size() << " ";
- for(map< string,vector<double> >::const_iterator p = _realarrays.begin(); p != _realarrays.end(); p++) {
- vector<double> v(p->second);
- sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
- buffer << tmpBuffer;
- for(int i = 0; i<v.size(); i++) {
- sprintf(tmpBuffer, " %.64e ", v[i]);
- buffer << tmpBuffer;
- }
- }
-
- buffer << _intarrays.size() << " ";
- for(map< string,vector<int> >::const_iterator p = _intarrays.begin(); p != _intarrays.end(); p++) {
- vector<int> v(p->second);
- sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
- buffer << tmpBuffer;
- for(int i = 0; i<v.size(); i++) {
- sprintf(tmpBuffer, " %d ", v[i]);
- buffer << tmpBuffer;
- }
- }
-
- buffer << _strarrays.size() << " ";
- for(map< string,vector<string> >::const_iterator p = _strarrays.begin(); p != _strarrays.end(); p++) {
- vector<string> v(p->second);
- sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
- buffer << tmpBuffer;
- for(int i = 0; i<v.size(); i++) {
- buffer << " " << convertString(v[i]) << " ";
- }
- }
-
- delete tmpBuffer;
-
- string AS = buffer.str();
-
- return AS;
-}
-
-//=======================================================================
-/*!
- * Function : Load
- * Purpose : Restores the attribute from the string
- */
-//=======================================================================
-void SALOMEDSImpl_AttributeParameter::Load(const string& theValue)
-{
- Backup();
-
- _ints.clear();
- _reals.clear();
- _bools.clear();
- _strings.clear();
- _realarrays.clear();
- _intarrays.clear();
-
- istringstream buffer(theValue.c_str());
-
- int size, val, ival;
- double val2;
- string s, id;
-
- buffer >> size;
- for(int i = 1; i<=size; i++) {
- buffer >> id >> val;
- _ints[restoreString(id)] = val;
- }
-
- buffer >> size;
- for(int i = 1; i<=size; i++) {
- buffer >> id >> val2;
- _reals[restoreString(id)] = val2;
- }
-
- buffer >> size;
- for(int i = 1; i<=size; i++) {
- buffer >> id >> val;
- _bools[restoreString(id)] = val;
- }
-
- buffer >> size;
- for(int i = 1; i<=size; i++) {
- buffer >> id >> s;
- _strings[restoreString(id)] = restoreString(s);
- }
-
- buffer >> size;
- for(int i = 1; i<=size; i++) {
- buffer >> id >> val;
- vector<double> v;
- v.resize(val);
- for(int j = 0; j<val; j++) {
- buffer >> val2;
- v[j] = val2;
- }
- _realarrays[restoreString(id)] = v;
- }
-
- buffer >> size;
- for(int i = 1; i<=size; i++) {
- buffer >> id >> val;
- vector<int> v;
- v.resize(val);
- for(int j = 0; j<val; j++) {
- buffer >> ival;
- v[j] = ival;
- }
- _intarrays[restoreString(id)] = v;
- }
-
- buffer >> size;
- for(int i = 1; i<=size; i++) {
- buffer >> id >> val;
- vector<string> v;
- v.resize(val);
- for(int j = 0; j<val; j++) {
- buffer >> s;
- v[j] = restoreString(s);
- }
- _strarrays[restoreString(id)] = v;
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeIOR.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeParameter_HeaderFile
-#define _SALOMEDSImpl_AttributeParameter_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-#include <vector>
-#include <string>
-#include <map>
-
-enum Parameter_Types {PT_INTEGER, PT_REAL, PT_BOOLEAN, PT_STRING, PT_REALARRAY, PT_INTARRAY, PT_STRARRAY};
-
-/*!
-Class: SALOMEDSImpl_AttributeParameter
-Description : AttributeParameter is a universal container of basic types
-*/
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeParameter :
- public SALOMEDSImpl_GenericAttribute
-{
-
-private:
-
- std::map<std::string, int> _ints;
- std::map<std::string, double> _reals;
- std::map<std::string, std::string> _strings;
- std::map<std::string, bool> _bools;
- std::map< std::string, std::vector<double> > _realarrays;
- std::map< std::string, std::vector<int> > _intarrays;
- std::map< std::string, std::vector<std::string> > _strarrays;
-
-public:
-
- static const std::string& GetID() ;
-
- SALOMEDSImpl_AttributeParameter():SALOMEDSImpl_GenericAttribute("AttributeParameter") {}
- static SALOMEDSImpl_AttributeParameter* Set (const DF_Label& L);
-
- void SetInt(const std::string& theID, const int& theValue);
- int GetInt(const std::string& theID);
-
- void SetReal(const std::string& theID, const double& theValue);
- double GetReal(const std::string& theID);
-
- void SetString(const std::string& theID, const std::string& theValue);
- std::string GetString(const std::string& theID);
-
- void SetBool(const std::string& theID, const bool& theValue);
- bool GetBool(const std::string& theID);
-
- void SetRealArray(const std::string& theID, const std::vector<double>& theArray);
- std::vector<double> GetRealArray(const std::string& theID);
-
- void SetIntArray(const std::string& theID, const std::vector<int>& theArray);
- std::vector<int> GetIntArray(const std::string& theID);
-
- void SetStrArray(const std::string& theID, const std::vector<std::string>& theArray);
- std::vector<std::string> GetStrArray(const std::string& theID);
-
- bool IsSet(const std::string& theID, const Parameter_Types theType);
-
- bool RemoveID(const std::string& theID, const Parameter_Types theType);
-
- SALOMEDSImpl_AttributeParameter* GetFather();
- bool HasFather();
- bool IsRoot();
-
- std::vector<std::string> GetIDs(const Parameter_Types theType);
-
- void Clear();
-
- virtual std::string Save();
- virtual void Load(const std::string& theValue);
-
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
-
- ~SALOMEDSImpl_AttributeParameter() {}
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributePersistentRef.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributePersistentRef.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributePersistentRef::GetID ()
-{
- static std::string SALOMEDSImpl_AttributePersistentRefID ("92888E06-7074-11d5-A690-0800369C8A03");
- return SALOMEDSImpl_AttributePersistentRefID;
-}
-
-
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-
-SALOMEDSImpl_AttributePersistentRef* SALOMEDSImpl_AttributePersistentRef::Set (const DF_Label& L,
- const std::string& S)
-{
- SALOMEDSImpl_AttributePersistentRef* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributePersistentRef*)L.FindAttribute(SALOMEDSImpl_AttributePersistentRef::GetID()))) {
- A = new SALOMEDSImpl_AttributePersistentRef();
- L.AddAttribute(A);
- }
-
- A->SetValue (S);
- return A;
-}
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributePersistentRef::SALOMEDSImpl_AttributePersistentRef()
-:SALOMEDSImpl_GenericAttribute("AttributePersistentRef")
-{
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributePersistentRef::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : SetValue
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributePersistentRef::SetValue (const std::string& S)
-{
- CheckLocked();
-
- if(myString == S) return;
-
- Backup();
-
- myString = S;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributePersistentRef::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributePersistentRef();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributePersistentRef::Restore(DF_Attribute* with)
-{
- myString = dynamic_cast<SALOMEDSImpl_AttributePersistentRef*>(with)->Value ();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributePersistentRef::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributePersistentRef*>(into)->SetValue(myString);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributePersistentRef.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributePersistentRef_HeaderFile
-#define _SALOMEDSImpl_AttributePersistentRef_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include <string>
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributePersistentRef :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
- std::string myString;
-
-public:
-
- virtual std::string Save() { return myString; }
- virtual void Load(const std::string& theValue) { myString = theValue; }
-
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributePersistentRef* Set(const DF_Label& label,
- const std::string& value) ;
- SALOMEDSImpl_AttributePersistentRef();
- const std::string& ID() const;
- void SetValue(const std::string& value);
- std::string Value() const { return myString; }
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributePersistentRef() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributePixMap.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributePixMap.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributePixMap::GetID ()
-{
- static std::string SALOMEDSImpl_AttributePixMapID ("12837187-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributePixMapID;
-}
-
-
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-
-SALOMEDSImpl_AttributePixMap* SALOMEDSImpl_AttributePixMap::Set (const DF_Label& L,
- const std::string& S)
-{
- SALOMEDSImpl_AttributePixMap* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributePixMap*)L.FindAttribute(SALOMEDSImpl_AttributePixMap::GetID()))) {
- A = new SALOMEDSImpl_AttributePixMap();
- L.AddAttribute(A);
- }
-
- A->SetPixMap (S);
- return A;
-}
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributePixMap::SALOMEDSImpl_AttributePixMap()
-:SALOMEDSImpl_GenericAttribute("AttributePixMap")
-{
- myString = "None";
-}
-
-//=======================================================================
-//function : SetPixMap
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributePixMap::SetPixMap (const std::string& S)
-{
- CheckLocked();
-
- if(myString == S) return;
-
- Backup();
-
- myString = S;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributePixMap::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributePixMap::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributePixMap();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributePixMap::Restore(DF_Attribute* with)
-{
- myString = dynamic_cast<SALOMEDSImpl_AttributePixMap*>(with)->GetPixMap ();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributePixMap::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributePixMap*>(into)->SetPixMap (myString);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributePixMap.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributePixMap_HeaderFile
-#define _SALOMEDSImpl_AttributePixMap_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include <string>
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributePixMap :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
-
- std::string myString;
-public:
-
- virtual std::string Save() { return myString; }
- virtual void Load(const std::string& theValue) { myString = theValue; }
-
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributePixMap* Set(const DF_Label& label,
- const std::string& string) ;
- SALOMEDSImpl_AttributePixMap();
- const std::string& ID() const;
- void SetPixMap(const std::string& value);
- std::string GetPixMap() const { return myString; }
- bool HasPixMap() const { return (myString != "None"); }
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributePixMap() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributePythonObject.cxx
-// Author : Michael Ponikarov
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributePythonObject.hxx"
-
-using namespace std;
-
-const std::string& SALOMEDSImpl_AttributePythonObject::GetID()
-{
- static std::string SALOMEDSImpl_AttributePythonObjectID ("128371A3-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributePythonObjectID;
-}
-
-SALOMEDSImpl_AttributePythonObject* SALOMEDSImpl_AttributePythonObject::Set(const DF_Label& label)
-{
- SALOMEDSImpl_AttributePythonObject* A = NULL;
- if (!(A = (SALOMEDSImpl_AttributePythonObject*)label.FindAttribute(SALOMEDSImpl_AttributePythonObject::GetID()))) {
- A = new SALOMEDSImpl_AttributePythonObject();
- label.AddAttribute(A);
- }
- return A;
-}
-
-SALOMEDSImpl_AttributePythonObject::SALOMEDSImpl_AttributePythonObject()
-:SALOMEDSImpl_GenericAttribute("AttributePythonObject")
-{
- myIsScript = false;
-}
-
-void SALOMEDSImpl_AttributePythonObject::SetObject(const string& theSequence,
- const bool theScript)
-{
- CheckLocked();
- Backup();
- mySequence = theSequence;
- myIsScript = theScript;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-string SALOMEDSImpl_AttributePythonObject::GetObject() const
-{
- return mySequence;
-}
-
-bool SALOMEDSImpl_AttributePythonObject::IsScript() const
-{
- return myIsScript;
-}
-
-int SALOMEDSImpl_AttributePythonObject::GetLength() const
-{
- return mySequence.size();
-}
-
-const std::string& SALOMEDSImpl_AttributePythonObject::ID() const
-{
- return GetID();
-}
-
-void SALOMEDSImpl_AttributePythonObject::Restore(DF_Attribute* with)
-{
- SALOMEDSImpl_AttributePythonObject* anObj = dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(with);
- SetObject(anObj->GetObject(),anObj->IsScript());
-}
-
-DF_Attribute* SALOMEDSImpl_AttributePythonObject::NewEmpty() const
-{
- return new SALOMEDSImpl_AttributePythonObject();
-}
-
-void SALOMEDSImpl_AttributePythonObject::Paste(DF_Attribute* into)
-{
- SALOMEDSImpl_AttributePythonObject* anObj = dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(into);
- anObj->SetObject(GetObject(),IsScript());
-}
-
-
-string SALOMEDSImpl_AttributePythonObject::Save()
-{
- string aString = GetObject();
- string aResult = IsScript()?"s":"n";
- aResult += aString;
-
- return aResult;
-}
-
-void SALOMEDSImpl_AttributePythonObject::Load(const string& value)
-{
- char* aString = (char*)value.c_str();
- SetObject(aString + 1, aString[0]=='s');
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributePythonObject.hxx
-// Author : Michael Ponikarov
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributePythonObject_HeaderFile
-#define _SALOMEDSImpl_AttributePythonObject_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-#ifdef GetObject
-#undef GetObject
-#endif
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributePythonObject :
- public SALOMEDSImpl_GenericAttribute
-{
-
-public:
- virtual std::string Save();
- virtual void Load(const std::string&);
-
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributePythonObject* Set(const DF_Label& label) ;
- SALOMEDSImpl_AttributePythonObject();
- void SetObject(const std::string& theSequence, const bool theScript) ;
- std::string GetObject() const;
- bool IsScript() const;
- int GetLength() const;
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributePythonObject() {}
-
-private:
-
- std::string mySequence;
- bool myIsScript;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeReal.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeReal.hxx"
-
-using namespace std;
-
-#include <stdlib.h>
-
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeReal::GetID ()
-{
- static std::string realID ("1D1992F0-56F4-46b4-8065-CDEA68061CAB");
- return realID;
-}
-
-SALOMEDSImpl_AttributeReal* SALOMEDSImpl_AttributeReal::Set (const DF_Label& L, const double& Val)
-{
- SALOMEDSImpl_AttributeReal* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeReal*)L.FindAttribute(SALOMEDSImpl_AttributeReal::GetID()))) {
- A = new SALOMEDSImpl_AttributeReal();
- L.AddAttribute(A);
- }
-
- A->SetValue(Val);
- return A;
-}
-
-//=======================================================================
-//function : SetValue
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeReal::SetValue(const double& v)
-{
- CheckLocked();
-
- if( myValue == v) return;
-
- Backup();
- myValue = v;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeReal::ID () const
-{
- return GetID();
-}
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-DF_Attribute* SALOMEDSImpl_AttributeReal::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeReal();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeReal::Restore(DF_Attribute* with)
-{
- myValue = dynamic_cast<SALOMEDSImpl_AttributeReal*>(with)->Value ();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeReal::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeReal*>(into)->SetValue(myValue);
-}
-
-//=======================================================================
-//function : Save
-//purpose :
-//=======================================================================
-string SALOMEDSImpl_AttributeReal::Save()
-{
- char buffer[255];
- sprintf(buffer, "%.64e", myValue);
- return string(buffer);
-}
-
-//=======================================================================
-//function : Load
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeReal::Load(const string& theValue)
-{
- myValue = atof(theValue.c_str());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeReal.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeReal_HeaderFile
-#define _SALOMEDSImpl_AttributeReal_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include <string>
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeReal :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
- double myValue;
-public:
-
- static const std::string& GetID() ;
-
- SALOMEDSImpl_AttributeReal():SALOMEDSImpl_GenericAttribute("AttributeReal") {}
- static SALOMEDSImpl_AttributeReal* Set (const DF_Label& L, const double& Val);
- void SetValue(const double& theVal);
- double Value() const { return myValue; }
- virtual std::string Save();
- virtual void Load(const std::string& theValue);
-
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeReal() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeReference.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeReference.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeReference::GetID ()
-{
- static std::string refID ("D913E0B3-0A9F-4ea6-9480-18A9B72D9D86");
- return refID;
-}
-
-SALOMEDSImpl_AttributeReference* SALOMEDSImpl_AttributeReference::Set(const DF_Label& theLabel,
- const DF_Label& theRefLabel)
-{
- SALOMEDSImpl_AttributeReference* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeReference*)theLabel.FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
- A = new SALOMEDSImpl_AttributeReference();
- theLabel.AddAttribute(A);
- }
-
- A->Set(theRefLabel);
- return A;
-}
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeReference::Set(const DF_Label& Origin)
-{
- CheckLocked();
-
- if(myLabel == Origin) return;
-
- Backup();
- myLabel = Origin;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeReference::ID () const { return GetID(); }
-
-
-string SALOMEDSImpl_AttributeReference::Save()
-{
- return myLabel.Entry();
-}
-
-void SALOMEDSImpl_AttributeReference::Load(const string& value)
-{
- myLabel = DF_Label::Label(Label(), value, true);
-}
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-DF_Attribute* SALOMEDSImpl_AttributeReference::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeReference();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeReference::Restore(DF_Attribute* With)
-{
- myLabel = dynamic_cast<SALOMEDSImpl_AttributeReference*>(With)->Get ();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeReference::Paste (DF_Attribute* Into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeReference*>(Into)->Set(myLabel);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeIOR.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeReference_HeaderFile
-#define _SALOMEDSImpl_AttributeReference_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeReference :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
- DF_Label myLabel;
-
-public:
-
- static const std::string& GetID() ;
-
- SALOMEDSImpl_AttributeReference():SALOMEDSImpl_GenericAttribute("AttributeReference") {}
- static SALOMEDSImpl_AttributeReference* Set(const DF_Label& theLabel, const DF_Label& theRefLabel);
- void Set(const DF_Label& theLabel);
- DF_Label Get() const { return myLabel; }
- virtual std::string Save();
- virtual void Load(const std::string& theValue);
-
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
-
- ~SALOMEDSImpl_AttributeReference() {}
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeSelectable.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeSelectable.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeSelectable::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeSelectableID ("12837188-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeSelectableID;
-}
-
-
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-
-SALOMEDSImpl_AttributeSelectable* SALOMEDSImpl_AttributeSelectable::Set (const DF_Label& L,
- const int value)
-{
- SALOMEDSImpl_AttributeSelectable* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeSelectable*)L.FindAttribute(SALOMEDSImpl_AttributeSelectable::GetID()))) {
- A = new SALOMEDSImpl_AttributeSelectable();
- L.AddAttribute(A);
- }
-
- A->SetSelectable (value);
- return A;
-}
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeSelectable::SALOMEDSImpl_AttributeSelectable()
-:SALOMEDSImpl_GenericAttribute("AttributeSelectable")
-{
- myValue = 1;
-}
-
-//=======================================================================
-//function : SetSelectable
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeSelectable::SetSelectable(const int theValue)
-{
- Backup();
-
- (theValue!=0)?myValue=1:myValue=0;
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeSelectable::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributeSelectable::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeSelectable();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeSelectable::Restore(DF_Attribute* with)
-{
- myValue = dynamic_cast<SALOMEDSImpl_AttributeSelectable*>(with)->IsSelectable ();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeSelectable::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeSelectable*>(into)->SetSelectable (myValue);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeSelectable.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeSelectable_HeaderFile
-#define _SALOMEDSImpl_AttributeSelectable_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeSelectable :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
- int myValue;
-
-public:
-
- virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; }
- virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; }
-
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeSelectable* Set(const DF_Label& label,const int value) ;
- SALOMEDSImpl_AttributeSelectable();
- void SetSelectable(const int value);
- int IsSelectable() const { return myValue; }
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeSelectable() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeSequenceOfInteger.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx"
-#include <string.h>
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeSequenceOfInteger::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeSequenceOfIntegerID ("12837182-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeSequenceOfIntegerID;
-}
-
-
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-
-SALOMEDSImpl_AttributeSequenceOfInteger* SALOMEDSImpl_AttributeSequenceOfInteger::Set (const DF_Label& L)
-{
- SALOMEDSImpl_AttributeSequenceOfInteger* A = NULL;
- if (!(A = (SALOMEDSImpl_AttributeSequenceOfInteger*)L.FindAttribute(SALOMEDSImpl_AttributeSequenceOfInteger::GetID()))) {
- A = new SALOMEDSImpl_AttributeSequenceOfInteger();
- L.AddAttribute(A);
- }
- return A;
-}
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeSequenceOfInteger::SALOMEDSImpl_AttributeSequenceOfInteger()
-:SALOMEDSImpl_GenericAttribute("AttributeSequenceOfInteger")
-{}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeSequenceOfInteger::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributeSequenceOfInteger::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeSequenceOfInteger();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeSequenceOfInteger::Restore(DF_Attribute* with)
-{
- SALOMEDSImpl_AttributeSequenceOfInteger* anSeq = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(with);
- myValue.clear();
- for(int i = 0, len = anSeq->Length(); i<len; i++)
- myValue.push_back(anSeq->myValue[i]);
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeSequenceOfInteger::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(into)->Assign(myValue);
-}
-
-void SALOMEDSImpl_AttributeSequenceOfInteger::Assign(const vector<int>& other)
-{
- CheckLocked();
- Backup();
-
- myValue = other;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeSequenceOfInteger::ChangeValue(const int Index,const int Value)
-{
- CheckLocked();
- Backup();
-
- if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range");
-
- myValue[Index-1] = Value;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeSequenceOfInteger::Add(const int Value)
-{
- CheckLocked();
- Backup();
- myValue.push_back(Value);
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeSequenceOfInteger::Remove(const int Index)
-{
- CheckLocked();
- Backup();
-
- if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range");
-
- typedef vector<int>::iterator VI;
- int i = 1;
- for(VI p = myValue.begin(); p!=myValue.end(); p++, i++) {
- if(i == Index) {
- myValue.erase(p);
- break;
- }
- }
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-int SALOMEDSImpl_AttributeSequenceOfInteger::Length()
-{
- return myValue.size();
-}
-int SALOMEDSImpl_AttributeSequenceOfInteger::Value(const int Index)
-{
- if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range");
-
- return myValue[Index-1];
-}
-
-
-
-string SALOMEDSImpl_AttributeSequenceOfInteger::Save()
-{
- int aLength = Length();
- char* aResult = new char[aLength * 25];
- aResult[0] = 0;
- int aPosition = 0;
- for (int i = 1; i <= aLength; i++) {
- sprintf(aResult + aPosition , "%d ", Value(i));
- aPosition += strlen(aResult + aPosition);
- }
- string ret(aResult);
- delete aResult;
-
- return ret;
-}
-
-void SALOMEDSImpl_AttributeSequenceOfInteger::Load(const string& value)
-{
- char* aCopy = (char*)value.c_str();
- char* adr = strtok(aCopy, " ");
- while (adr) {
- int l = atol(adr);
- Add(l);
- adr = strtok(NULL, " ");
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeSequenceOfInteger.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeSequenceOfInteger_HeaderFile
-#define _SALOMEDSImpl_AttributeSequenceOfInteger_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <vector>
-#include <string>
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeSequenceOfInteger :
- public SALOMEDSImpl_GenericAttribute
-{
-
-public:
-
- virtual std::string Save();
- virtual void Load(const std::string&);
-
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeSequenceOfInteger* Set(const DF_Label& label) ;
- SALOMEDSImpl_AttributeSequenceOfInteger();
- void Assign(const std::vector<int>& other) ;
- void ChangeValue(const int Index,const int Value) ;
- void Add(const int value) ;
- int Value(const int Index) ;
- void Remove(const int Index) ;
- int Length() ;
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeSequenceOfInteger() {}
- const std::vector<int>& Array() { return myValue; }
-
-private:
- std::vector<int> myValue;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeSequenceOfReal.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeSequenceOfReal.hxx"
-#include <string.h>
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeSequenceOfReal::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeSequenceOfRealID ("12837183-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeSequenceOfRealID;
-}
-
-
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-
-SALOMEDSImpl_AttributeSequenceOfReal* SALOMEDSImpl_AttributeSequenceOfReal::Set (const DF_Label& L)
-{
- SALOMEDSImpl_AttributeSequenceOfReal* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeSequenceOfReal*)L.FindAttribute(SALOMEDSImpl_AttributeSequenceOfReal::GetID()))) {
- A = new SALOMEDSImpl_AttributeSequenceOfReal();
- L.AddAttribute(A);
- }
- return A;
-}
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeSequenceOfReal::SALOMEDSImpl_AttributeSequenceOfReal()
-:SALOMEDSImpl_GenericAttribute("AttributeSequenceOfReal")
-{
- myValue.clear();
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeSequenceOfReal::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributeSequenceOfReal::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeSequenceOfReal();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeSequenceOfReal::Restore(DF_Attribute* with)
-{
- SALOMEDSImpl_AttributeSequenceOfReal* anSeq = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(with);
- myValue.clear();
- for(int i = 0, len = anSeq->Length(); i<len; i++)
- myValue.push_back(anSeq->myValue[i]);
- return;
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeSequenceOfReal::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(into)->Assign(myValue);
-}
-
-void SALOMEDSImpl_AttributeSequenceOfReal::Assign(const vector<double>& other)
-{
- CheckLocked();
- Backup();
- myValue = other;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeSequenceOfReal::ChangeValue(const int Index,const double& Value)
-{
- CheckLocked();
- Backup();
-
- if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range");
-
- myValue[Index-1] = Value;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeSequenceOfReal::Add(const double& Value)
-{
- CheckLocked();
- Backup();
- myValue.push_back(Value);
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeSequenceOfReal::Remove(const int Index)
-{
- CheckLocked();
- Backup();
-
- if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range");
-
- typedef vector<double>::iterator VI;
- int i = 1;
- for(VI p = myValue.begin(); p!=myValue.end(); p++, i++) {
- if(i == Index) {
- myValue.erase(p);
- break;
- }
- }
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-int SALOMEDSImpl_AttributeSequenceOfReal::Length()
-{
- return myValue.size();
-}
-
-double SALOMEDSImpl_AttributeSequenceOfReal::Value(const int Index)
-{
- if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range");
- return myValue[Index-1];
-}
-
-
-string SALOMEDSImpl_AttributeSequenceOfReal::Save()
-{
- int aLength = Length();
- char* aResult = new char[aLength * 127];
- aResult[0] = 0;
- int aPosition = 0;
- for (int i = 1; i <= aLength; i++) {
- sprintf(aResult + aPosition , "%.64e ", Value(i));
- aPosition += strlen(aResult + aPosition);
- }
- string ret(aResult);
- delete aResult;
-
- return ret;
-}
-
-void SALOMEDSImpl_AttributeSequenceOfReal::Load(const string& value)
-{
-
- char* aCopy = (char*)value.c_str();
- char* adr = strtok(aCopy, " ");
- char *err = NULL;
- while (adr) {
- double r = strtod(adr, &err);
- Add(r);
- adr = strtok(NULL, " ");
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeSequenceOfReal.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeSequenceOfReal_HeaderFile
-#define _SALOMEDSImpl_AttributeSequenceOfReal_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-#include <vector>
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeSequenceOfReal :
- public SALOMEDSImpl_GenericAttribute
-{
-
-public:
-
- virtual std::string Save();
- virtual void Load(const std::string&);
-
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeSequenceOfReal* Set(const DF_Label& label) ;
- SALOMEDSImpl_AttributeSequenceOfReal();
- void Assign(const std::vector<double>& other) ;
- void ChangeValue(const int Index,const double& Value) ;
- void Add(const double& Value) ;
- double Value(const int Index) ;
- void Remove(const int Index) ;
- int Length() ;
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeSequenceOfReal() {}
- const std::vector<double>& Array() { return myValue; }
-
-private:
- std::vector<double> myValue;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeString.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeString.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeString::GetID ()
-{
- static std::string CommentID ("1808A12F-AD0E-4a6a-B58A-395DCF469FE9");
- return CommentID;
-}
-
-SALOMEDSImpl_AttributeString* SALOMEDSImpl_AttributeString::Set (const DF_Label& L,
- const std::string& Val)
-{
- SALOMEDSImpl_AttributeString* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeString*)L.FindAttribute(SALOMEDSImpl_AttributeString::GetID()))) {
- A = new SALOMEDSImpl_AttributeString();
- L.AddAttribute(A);
- }
-
- A->SetValue(Val);
-
- return A;
-}
-
-//=======================================================================
-//function : SetValue
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeString::SetValue (const std::string& S)
-{
- CheckLocked();
-
- if(myString == S) return;
-
- Backup();
-
- myString = S;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeString::ID () const { return GetID(); }
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-DF_Attribute* SALOMEDSImpl_AttributeString::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeString();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeString::Restore(DF_Attribute* with)
-{
- myString = dynamic_cast<SALOMEDSImpl_AttributeString*>(with)->Value ();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeString::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeString*>(into)->SetValue(myString);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeIOR.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeString_HeaderFile
-#define _SALOMEDSImpl_AttributeString_HeaderFile
-
-#include "DF_Attribute.hxx"
-#include <string>
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-
-class SALOMEDSImpl_AttributeString : public SALOMEDSImpl_GenericAttribute
-{
-private:
-
- std::string myString;
-
-public:
-
-Standard_EXPORT static const std::string& GetID() ;
-
-Standard_EXPORT SALOMEDSImpl_AttributeString() :SALOMEDSImpl_GenericAttribute("AttributeString") {}
-
-Standard_EXPORT static SALOMEDSImpl_AttributeString* Set(const DF_Label& L, const std::string& Val);
-Standard_EXPORT void SetValue (const std::string& S);
-Standard_EXPORT std::string Value() const { return myString; }
-
-Standard_EXPORT virtual std::string Save() { return myString; }
-Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; }
-
-Standard_EXPORT const std::string& ID() const;
-Standard_EXPORT void Restore(DF_Attribute* with) ;
-Standard_EXPORT DF_Attribute* NewEmpty() const;
-Standard_EXPORT void Paste(DF_Attribute* into);
-Standard_EXPORT ~SALOMEDSImpl_AttributeString() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeStudyProperties.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
-#include <string.h>
-
-using namespace std;
-
-
-const std::string& SALOMEDSImpl_AttributeStudyProperties::GetID()
-{
- static std::string SALOMEDSImpl_AttributeStudyPropertiesID ("128371A2-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeStudyPropertiesID;
-}
-
-SALOMEDSImpl_AttributeStudyProperties* SALOMEDSImpl_AttributeStudyProperties::Set(const DF_Label& label)
-{
- SALOMEDSImpl_AttributeStudyProperties* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeStudyProperties*)label.FindAttribute(SALOMEDSImpl_AttributeStudyProperties::GetID()))) {
- A = new SALOMEDSImpl_AttributeStudyProperties();
- label.AddAttribute(A);
- }
- return A;
-}
-
-SALOMEDSImpl_AttributeStudyProperties::SALOMEDSImpl_AttributeStudyProperties()
-:SALOMEDSImpl_GenericAttribute("AttributeStudyProperties")
-{
- myLocked = false;
- myLockChanged = false;
- Init();
-}
-
-void SALOMEDSImpl_AttributeStudyProperties::Init()
-{
- myUserName.clear();
- myMinute.clear();
- myHour.clear();
- myDay.clear();
- myMonth.clear();
- myYear.clear();
- myMode = 0; // none
-}
-
-void SALOMEDSImpl_AttributeStudyProperties::SetModification(const std::string& theUserName,
- const int theMinute,
- const int theHour,
- const int theDay,
- const int theMonth,
- const int theYear)
-{
- if (theMinute<0 || theMinute>60 || theHour<0 || theHour>24 ||
- theDay<0 || theDay>31 || theMonth<0 || theMonth>12)
- return;
-
- CheckLocked();
- Backup();
-
- myUserName.push_back(theUserName);
- myMinute.push_back(theMinute);
- myHour.push_back(theHour);
- myDay.push_back(theDay);
- myMonth.push_back(theMonth);
- myYear.push_back(theYear);
-}
-
-void SALOMEDSImpl_AttributeStudyProperties::GetModifications
- (vector<string>& theUserNames,
- vector<int>& theMinutes,
- vector<int>& theHours,
- vector<int>& theDays,
- vector<int>& theMonths,
- vector<int>& theYears) const
-{
- theUserNames = myUserName;
- theMinutes = myMinute;
- theHours = myHour;
- theDays = myDay;
- theMonths = myMonth;
- theYears = myYear;
-}
-
-std::string SALOMEDSImpl_AttributeStudyProperties::GetCreatorName() const
-{
- if (myUserName.size() == 0)
- return std::string("");
- return myUserName[0];
-}
-
-bool SALOMEDSImpl_AttributeStudyProperties::GetCreationDate
- (int& theMinute,
- int& theHour,
- int& theDay,
- int& theMonth,
- int& theYear) const
-{
- if (myMinute.size() != 0) {
- theMinute = myMinute[0];
- theHour = myHour[0];
- theDay = myDay[0];
- theMonth = myMonth[0];
- theYear = myYear[0];
- return true;
- }
- return false;
-}
-
-void SALOMEDSImpl_AttributeStudyProperties::ChangeCreatorName(const std::string& theName)
-{
- if (myUserName.size() > 0) {
- CheckLocked();
- Backup();
- myUserName[0] = theName;
- }
-}
-
-void SALOMEDSImpl_AttributeStudyProperties::SetCreationMode(const int theMode)
-{
- CheckLocked();
- Backup();
- myMode = theMode;
-}
-
-int SALOMEDSImpl_AttributeStudyProperties::GetCreationMode() const
-{
- return myMode;
-}
-
-void SALOMEDSImpl_AttributeStudyProperties::SetModified(const int theModified)
-{
- myModified = theModified;
-}
-
-bool SALOMEDSImpl_AttributeStudyProperties::IsModified() const
-{
- return (myModified != 0);
-}
-
-int SALOMEDSImpl_AttributeStudyProperties::GetModified() const
-{
- return myModified;
-}
-
-void SALOMEDSImpl_AttributeStudyProperties::SetLocked(const bool theLocked)
-{
-// Backup();
- if (myLocked != theLocked) {
- myLockChanged = true;
- myLocked = theLocked;
- }
-}
-
-bool SALOMEDSImpl_AttributeStudyProperties::IsLocked() const
-{
- return myLocked;
-}
-
-bool SALOMEDSImpl_AttributeStudyProperties::IsLockChanged(const bool theErase) {
- if (!myLockChanged) return false;
- if (theErase) myLockChanged = false;
- return true;
-}
-
-const std::string& SALOMEDSImpl_AttributeStudyProperties::ID() const
-{
- return GetID();
-}
-
-void SALOMEDSImpl_AttributeStudyProperties::Restore(DF_Attribute* with)
-{
- SALOMEDSImpl_AttributeStudyProperties* aProp =
- dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(with);
-
- Init();
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
- aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
- for (int i = 0, len = aNames.size(); i < len; i++) {
- myUserName.push_back(aNames[i]);
- myMinute.push_back(aMinutes[i]);
- myHour.push_back(aHours[i]);
- myDay.push_back(aDays[i]);
- myMonth.push_back(aMonths[i]);
- myYear.push_back(aYears[i]);
- }
- myMode = aProp->GetCreationMode();
-// myModified = aProp->GetModified();
-// myLocked = aProp->IsLocked();
-}
-
-DF_Attribute* SALOMEDSImpl_AttributeStudyProperties::NewEmpty() const
-{
- return new SALOMEDSImpl_AttributeStudyProperties();
-}
-
-void SALOMEDSImpl_AttributeStudyProperties::Paste(DF_Attribute* into)
-{
- SALOMEDSImpl_AttributeStudyProperties* aProp =
- dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(into);
- aProp->Init();
-
- int i;
- for(i = 0; i < myUserName.size(); i++) {
- aProp->SetModification(myUserName[i],
- myMinute[i], myHour[i],
- myDay[i], myMonth[i], myYear[i]);
- }
-
- aProp->SetCreationMode(myMode);
-// aProp->SetModified(myModified);
-// aProp->SetLocked(myLocked);
-}
-
-
-string SALOMEDSImpl_AttributeStudyProperties::Save()
-{
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
- GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
-
- int aLength, anIndex;
- for (aLength = 0, anIndex = aNames.size()-1; anIndex >= 0; anIndex--)
- aLength += aNames[anIndex].size() + 1;
-
- char* aProperty = new char[3 + aLength + 12 * aNames.size()];
-
- char crMode = (char)GetCreationMode();
-
- sprintf(aProperty,"%c%c", crMode, IsLocked()?'l':'u');
-
- aLength = aNames.size();
- int a = 2;
- for (anIndex = 0; anIndex < aLength; anIndex++) {
- sprintf(&(aProperty[a]),"%2d%2d%2d%2d%4d%s",
- (int)(aMinutes[anIndex]),
- (int)(aHours[anIndex]),
- (int)(aDays[anIndex]),
- (int)(aMonths[anIndex]),
- (int)(aYears[anIndex]),
- (char*)(aNames[anIndex].c_str()));
- a = strlen(aProperty);
- aProperty[a++] = 1;
- }
- aProperty[a] = 0;
- string prop(aProperty);
- delete aProperty;
-
- return prop;
-}
-
-void SALOMEDSImpl_AttributeStudyProperties::Load(const string& value)
-{
- char* aCopy = (char*)value.c_str();
-
- int crMode = (int)aCopy[0];
- SetCreationMode(crMode);
-
- int anIndex;
- for (anIndex = 2; anIndex + 2 < value.size() ;) {
- char str[10];
- int aMinute, aHour, aDay, aMonth, aYear;
- str[0] = aCopy[anIndex++];
- str[1] = aCopy[anIndex++];
- str[2] = 0;
- aMinute = atoi(str);
- str[0] = aCopy[anIndex++];
- str[1] = aCopy[anIndex++];
- aHour = atoi(str);
- str[0] = aCopy[anIndex++];
- str[1] = aCopy[anIndex++];
- aDay = atoi(str);
- str[0] = aCopy[anIndex++];
- str[1] = aCopy[anIndex++];
- aMonth = atoi(str);
- str[0] = aCopy[anIndex++];
- str[1] = aCopy[anIndex++];
- str[2] = aCopy[anIndex++];
- str[3] = aCopy[anIndex++];
- str[4] = 0;
- aYear = atoi(str);
-
- int aNameSize;
- for(aNameSize = 0; aCopy[anIndex+aNameSize]!=1; aNameSize++);
- char *aName = new char[aNameSize+1];
- strncpy(aName, &(aCopy[anIndex]), aNameSize);
- aName[aNameSize] = 0;
- SetModification(aName,aMinute,aHour,aDay,aMonth,aYear);
- delete [] (aName);
- anIndex += aNameSize + 1;
- }
- if (aCopy[1] == 'l') {
- SetLocked(true);
- }
- SetModified(0);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeStudyProperties.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeStudyProperties_HeaderFile
-#define _SALOMEDSImpl_AttributeStudyProperties_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-#include <vector>
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeStudyProperties : public SALOMEDSImpl_GenericAttribute
-{
-public:
- SALOMEDSImpl_AttributeStudyProperties();
- ~SALOMEDSImpl_AttributeStudyProperties() {}
-
- static const std::string& GetID();
- const std::string& ID() const;
-
- static SALOMEDSImpl_AttributeStudyProperties* Set(const DF_Label& label);
-
- void Init();
-
- virtual std::string Save();
- virtual void Load(const std::string&);
-
- void SetModification(const std::string& theUserName,
- const int theMinute,
- const int theHour,
- const int theDay,
- const int theMonth,
- const int theYear);
- void GetModifications(std::vector<std::string>& theUserNames,
- std::vector<int>& theMinutes,
- std::vector<int>& theHours,
- std::vector<int>& theDays,
- std::vector<int>& theMonths,
- std::vector<int>& theYears) const;
-
- std::string GetCreatorName() const;
- bool GetCreationDate(int& theMinute,
- int& theHour,
- int& theDay,
- int& theMonth,
- int& theYear) const;
-
- void ChangeCreatorName(const std::string& theUserName);
-
- void SetCreationMode(const int theMode);
- int GetCreationMode() const;
-
- void SetModified(const int theModified);
- bool IsModified() const;
- int GetModified() const;
-
- void SetLocked(const bool theLocked);
- bool IsLocked() const;
- bool IsLockChanged(const bool theErase);
-
- void Restore(DF_Attribute* with);
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
-
-private:
-
- std::vector<std::string> myUserName;
- std::vector<int> myMinute;
- std::vector<int> myHour;
- std::vector<int> myDay;
- std::vector<int> myMonth;
- std::vector<int> myYear;
- int myMode;
- int myModified;
- bool myLocked;
- bool myLockChanged;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeTableOfInteger.cxx
-// Author : Michael Ponikarov
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeTableOfInteger.hxx"
-#include <sstream>
-
-using namespace std;
-
-#define SEPARATOR '\1'
-typedef map<int, int>::const_iterator MI;
-
-static std::string getUnit(std::string theString)
-{
- std::string aString(theString);
- int aPos = aString.find(SEPARATOR);
- if(aPos <= 0 || aPos == aString.size() ) return std::string();
- return aString.substr(aPos+1, aString.size());
-}
-
-static std::string getTitle(std::string theString)
-{
- std::string aString(theString);
- int aPos = aString.find(SEPARATOR);
- if(aPos < 1) return aString;
- if(aPos == 0) return std::string();
- return aString.substr(0, aPos);
-}
-
-const std::string& SALOMEDSImpl_AttributeTableOfInteger::GetID()
-{
- static std::string SALOMEDSImpl_AttributeTableOfIntegerID ("128371A0-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeTableOfIntegerID;
-}
-
-SALOMEDSImpl_AttributeTableOfInteger* SALOMEDSImpl_AttributeTableOfInteger::Set(const DF_Label& label)
-{
- SALOMEDSImpl_AttributeTableOfInteger* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeTableOfInteger*)label.FindAttribute(SALOMEDSImpl_AttributeTableOfInteger::GetID()))) {
- A = new SALOMEDSImpl_AttributeTableOfInteger();
- label.AddAttribute(A);
- }
- return A;
-}
-
-SALOMEDSImpl_AttributeTableOfInteger::SALOMEDSImpl_AttributeTableOfInteger()
-:SALOMEDSImpl_GenericAttribute("AttributeTableOfInteger")
-{
- myNbRows = 0;
- myNbColumns = 0;
-}
-
-void SALOMEDSImpl_AttributeTableOfInteger::SetNbColumns(const int theNbColumns)
-{
- CheckLocked();
- Backup();
-
- map<int, int> aMap;
- aMap = myTable;
- myTable.clear();
-
-
- for(MI p = aMap.begin(); p != aMap.end(); p++) {
- int aRow = (int)(p->first/myNbColumns) + 1;
- int aCol = (int)(p->first - myNbColumns*(aRow-1));
- if(aCol == 0) { aCol = myNbColumns; aRow--; }
- if(aCol > theNbColumns) continue;
- int aKey = (aRow-1)*theNbColumns+aCol;
- myTable[aKey] = p->second;
- }
-
- myNbColumns = theNbColumns;
-
- while (myCols.size() < myNbColumns) { // append empty columns titles
- myCols.push_back(std::string(""));
- }
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-
-}
-
-void SALOMEDSImpl_AttributeTableOfInteger::SetTitle(const std::string& theTitle)
-{
- CheckLocked();
- Backup();
- myTitle = theTitle;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-std::string SALOMEDSImpl_AttributeTableOfInteger::GetTitle() const
-{
- return myTitle;
-}
-
-void SALOMEDSImpl_AttributeTableOfInteger::SetRowData(const int theRow,
- const vector<int>& theData)
-{
- CheckLocked();
- if(theData.size() > myNbColumns) SetNbColumns(theData.size());
-
- Backup();
-
- while (myRows.size() < theRow) { // append new row titles
- myRows.push_back(std::string(""));
- }
-
- int i, aShift = (theRow-1)*myNbColumns, aLength = theData.size();
- for(i = 1; i <= aLength; i++) {
- myTable[aShift + i] = theData[i-1];
- }
-
- if(theRow > myNbRows) myNbRows = theRow;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-vector<int> SALOMEDSImpl_AttributeTableOfInteger::GetRowData(const int theRow)
-{
- vector<int> aSeq;
- int i, aShift = (theRow-1)*myNbColumns;
- for(i = 1; i <= myNbColumns; i++) {
- if(myTable.find(aShift+i) != myTable.end())
- aSeq.push_back(myTable[aShift+i]);
- else
- aSeq.push_back(0);
- }
-
- return aSeq;
-}
-
-void SALOMEDSImpl_AttributeTableOfInteger::SetRowTitle(const int theRow,
- const std::string& theTitle)
-{
- CheckLocked();
- Backup();
- string aTitle(theTitle), aUnit = GetRowUnit(theRow);
- if(aUnit.size()>0) {
- aTitle += SEPARATOR;
- aTitle += aUnit;
- }
- myRows[theRow-1] = aTitle;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnit(const int theRow,
- const std::string& theUnit)
-{
- CheckLocked();
- Backup();
- std::string aTitle = GetRowTitle(theRow);
- aTitle += SEPARATOR;
- aTitle += theUnit;
-
- myRows[theRow-1] = aTitle;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnits(const vector<string>& theUnits)
-{
- if (theUnits.size() != GetNbRows()) throw DFexception("Invalid number of rows");
- int aLength = theUnits.size(), i;
- for(i = 1; i <= aLength; i++) SetRowUnit(i, theUnits[i-1]);
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-vector<string> SALOMEDSImpl_AttributeTableOfInteger::GetRowUnits()
-{
- vector<string> aSeq;
- int aLength = myRows.size(), i;
- for(i=0; i<aLength; i++) aSeq.push_back(getUnit(myRows[i]));
- return aSeq;
-}
-
-void SALOMEDSImpl_AttributeTableOfInteger::SetRowTitles(const vector<string>& theTitles)
-{
- if (theTitles.size() != GetNbRows()) throw DFexception("Invalid number of rows");
- int aLength = theTitles.size(), i;
- for(i = 1; i <= aLength; i++) SetRowTitle(i, theTitles[i-1]);
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-vector<string> SALOMEDSImpl_AttributeTableOfInteger::GetRowTitles()
-{
- vector<string> aSeq;
- int aLength = myRows.size(), i;
- for(i=0; i<aLength; i++) aSeq.push_back(getTitle(myRows[i]));
- return aSeq;
-}
-
-
-std::string SALOMEDSImpl_AttributeTableOfInteger::GetRowTitle(const int theRow) const
-{
- return getTitle(myRows[theRow-1]);
-}
-
-
-std::string SALOMEDSImpl_AttributeTableOfInteger::GetRowUnit(const int theRow) const
-{
- return getUnit(myRows[theRow-1]);
-}
-
-
-void SALOMEDSImpl_AttributeTableOfInteger::SetColumnData(const int theColumn,
- const vector<int>& theData)
-{
- CheckLocked();
- if(theColumn > myNbColumns) SetNbColumns(theColumn);
-
- Backup();
-
- int i, aLength = theData.size();
- for(i = 1; i <= aLength; i++) {
- myTable[myNbColumns*(i-1)+theColumn] = theData[i-1];
- }
-
- if(aLength > myNbRows) {
- myNbRows = aLength;
- while (myRows.size() < myNbRows) { // append empty row titles
- myRows.push_back(std::string(""));
- }
- }
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-
-vector<int> SALOMEDSImpl_AttributeTableOfInteger::GetColumnData(const int theColumn)
-{
- vector<int> aSeq;
- int i, anIndex;
- for(i = 1; i <= myNbRows; i++) {
- anIndex = myNbColumns*(i-1) + theColumn;
- if(myTable.find(anIndex) != myTable.end())
- aSeq.push_back(myTable[anIndex]);
- else
- aSeq.push_back(0);
- }
-
- return aSeq;
-}
-
-void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitle(const int theColumn,
- const std::string& theTitle)
-{
- CheckLocked();
- Backup();
- while(myCols.size() < theColumn) myCols.push_back(std::string(""));
- myCols[theColumn-1] = theTitle;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-std::string SALOMEDSImpl_AttributeTableOfInteger::GetColumnTitle(const int theColumn) const
-{
- if(myCols.empty()) return "";
- if(myCols.size() < theColumn) return "";
- return myCols[theColumn-1];
-}
-
-void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitles(const vector<string>& theTitles)
-{
- if (theTitles.size() != myNbColumns) throw DFexception("Invalid number of columns");
- int aLength = theTitles.size(), i;
- for(i = 0; i < aLength; i++) myCols[i] = theTitles[i];
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-vector<string> SALOMEDSImpl_AttributeTableOfInteger::GetColumnTitles()
-{
- vector<string> aSeq;
- int aLength = myCols.size(), i;
- for(i=0; i<aLength; i++) aSeq.push_back(myCols[i]);
- return aSeq;
-}
-
-int SALOMEDSImpl_AttributeTableOfInteger::GetNbRows() const
-{
- return myNbRows;
-}
-
-int SALOMEDSImpl_AttributeTableOfInteger::GetNbColumns() const
-{
- return myNbColumns;
-}
-
-void SALOMEDSImpl_AttributeTableOfInteger::PutValue(const int theValue,
- const int theRow,
- const int theColumn)
-{
- CheckLocked();
- if(theColumn > myNbColumns) SetNbColumns(theColumn);
-
- int anIndex = (theRow-1)*myNbColumns + theColumn;
- myTable[anIndex] = theValue;
-
- if(theRow > myNbRows) {
- while (myRows.size() < theRow) { // append empty row titles
- myRows.push_back(std::string(""));
- }
- myNbRows = theRow;
- }
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-bool SALOMEDSImpl_AttributeTableOfInteger::HasValue(const int theRow,
- const int theColumn)
-{
- if(theRow > myNbRows || theRow < 1) return false;
- if(theColumn > myNbColumns || theColumn < 1) return false;
- int anIndex = (theRow-1)*myNbColumns + theColumn;
- return (myTable.find(anIndex) != myTable.end());
-}
-
-int SALOMEDSImpl_AttributeTableOfInteger::GetValue(const int theRow,
- const int theColumn)
-{
- if(theRow > myNbRows || theRow < 1) throw DFexception("Invalid cell index");
- if(theColumn > myNbColumns || theColumn < 1) DFexception("Invalid cell index");
-
- int anIndex = (theRow-1)*myNbColumns + theColumn;
- if(myTable.find(anIndex) != myTable.end()) return myTable[anIndex];
-
- throw DFexception("Invalid cell index");
- return 0;
-}
-
-const std::string& SALOMEDSImpl_AttributeTableOfInteger::ID() const
-{
- return GetID();
-}
-
-void SALOMEDSImpl_AttributeTableOfInteger::Restore(DF_Attribute* with)
-{
- int anIndex;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(with);
- if(!aTable) throw DFexception("Can't Restore from a null attribute");
-
- myTable.clear();
- myCols.clear();
- myRows.clear();
-
- myTable = aTable->myTable;
- myNbRows = aTable->myNbRows;
- myNbColumns = aTable->myNbColumns;
- myTitle = aTable->myTitle;
-
- for(anIndex = 1; anIndex <= aTable->GetNbRows();anIndex++)
- myRows.push_back(aTable->GetRowTitle(anIndex));
-
- for(anIndex = 1; anIndex <= aTable->GetNbColumns(); anIndex++)
- myCols.push_back(aTable->GetColumnTitle(anIndex));
-}
-
-DF_Attribute* SALOMEDSImpl_AttributeTableOfInteger::NewEmpty() const
-{
- return new SALOMEDSImpl_AttributeTableOfInteger();
-}
-
-void SALOMEDSImpl_AttributeTableOfInteger::Paste(DF_Attribute* into)
-{
- int anIndex;
- SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(into);
- if(!aTable) throw DFexception("Can't Paste into a null attribute");
-
- aTable->myTable.clear();
- aTable->myCols.clear();
- aTable->myRows.clear();
-
- aTable->myTable = myTable;
- aTable->myTitle = myTitle;
- aTable->myNbRows = myNbRows;
- aTable->myNbColumns = myNbColumns;
-
- for(anIndex = 1; anIndex <= GetNbRows();anIndex++)
- aTable->myRows.push_back(GetRowTitle(anIndex));
- for(anIndex = 1; anIndex <= GetNbColumns(); anIndex++)
- aTable->myCols.push_back(GetColumnTitle(anIndex));
-}
-
-
-vector<int> SALOMEDSImpl_AttributeTableOfInteger::GetSetRowIndices(const int theRow)
-{
- vector<int> aSeq;
-
- int i, aShift = myNbColumns*(theRow-1);
- for(i = 1; i <= myNbColumns; i++) {
- if(myTable.find(aShift + i) != myTable.end()) aSeq.push_back(i);
- }
-
- return aSeq;
-}
-
-vector<int> SALOMEDSImpl_AttributeTableOfInteger::GetSetColumnIndices(const int theColumn)
-{
- vector<int> aSeq;
-
- int i, anIndex;
- for(i = 1; i <= myNbRows; i++) {
- anIndex = myNbColumns*(i-1)+theColumn;
- if(myTable.find(anIndex) != myTable.end()) aSeq.push_back(i);
- }
-
- return aSeq;
-}
-
-
-string SALOMEDSImpl_AttributeTableOfInteger::Save()
-{
- string aString;
- char* buffer = new char[1024];
- int i, j, l;
-
- //Title
- l = myTitle.size();
- sprintf(buffer, "%d\n", l);
- aString+=buffer;
- for(i=0; i<l; i++) {
- aString += myTitle[i];
- aString +='\n';
- }
-
- //Nb rows
- sprintf(buffer, "%d\n", myNbRows);
- aString+=buffer;
-
- //Row titles
- for(i=0; i<myNbRows; i++) {
- l = myRows[i].size();
- sprintf(buffer, "%d\n", l);
- aString+=buffer;
- for(j=0; j<l; j++) {
- aString += myRows[i][j];
- aString += '\n';
- }
- }
-
- //Nb columns
- sprintf(buffer, "%d\n", myNbColumns);
- aString+=buffer;
-
- //Columns titles
- for(i=0; i<myNbColumns; i++) {
- l = myCols[i].size();
- sprintf(buffer, "%d\n", l);
- aString+=buffer;
- for(j=0; j<l; j++) {
- aString += myCols[i][j];
- aString += '\n';
- }
- }
-
- //Store the table values
- l = myTable.size();
- sprintf(buffer, "%d\n", l);
- aString+=buffer;
- for(MI p = myTable.begin(); p != myTable.end(); p++) {
- sprintf(buffer, "%d\n%d\n", p->first, p->second);
- aString += buffer;
- }
-
- delete []buffer;
- return aString;
-}
-
-
-
-void SALOMEDSImpl_AttributeTableOfInteger::Load(const string& value)
-{
- vector<string> v;
- int i, j, l, pos, aSize = (int)value.size();
- for(i = 0, pos = 0; i<aSize; i++) {
- if(value[i] == '\n') {
- v.push_back(value.substr(pos, i-pos));
- pos = i+1;
- }
- }
-
- Backup();
-
- pos = 0;
- std::string aStr;
-
- //Title
- l = strtol(v[pos++].c_str(), NULL, 10);
-
- myTitle = std::string(l, 0);
- for(i=0; i<l; i++) {
- myTitle[i] = v[pos++][0];
- }
-
- //Nb rows
- myNbRows = strtol(v[pos++].c_str(), NULL, 10);
-
- //Rows titles
- myRows.clear();
- for(i=1; i<=myNbRows; i++) {
- l = strtol(v[pos++].c_str(), NULL, 10);
- aStr = std::string(l,0);
- for(j=0; j<l; j++) {
- aStr[j] = v[pos++][0];
- }
- myRows.push_back(aStr);
- }
-
- //Nb columns
- myNbColumns = strtol(v[pos++].c_str(), NULL, 10);
-
- //Columns titles
- myCols.clear();
- for(i=1; i<=myNbColumns; i++) {
- l = strtol(v[pos++].c_str(), NULL, 10);
- aStr = std::string(l,0);
- for(j=0; j<l; j++) {
- aStr[j] = v[pos++][0];
- }
- myCols.push_back(aStr);
- }
-
- //Restore the table values
- l = strtol(v[pos++].c_str(), NULL, 10);
- myTable.clear();
- for(i=1; i<=l; i++) {
- int aKey = strtol(v[pos++].c_str(), NULL, 10);
- int aValue = strtol(v[pos++].c_str(), NULL, 10);
- myTable[aKey] = aValue;
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDSImpl : data structure of SALOME and sources of Salome data server
-// File : SALOMEDSImpl_AttributeTableOfInteger.hxx
-// Author : Michael Ponikarov
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeTableOfInteger_HeaderFile
-#define _SALOMEDSImpl_AttributeTableOfInteger_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-#include <string>
-#include <vector>
-#include <map>
-
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTableOfInteger :
- public SALOMEDSImpl_GenericAttribute
-{
-
-public:
- virtual std::string Save();
- virtual void Load(const std::string&);
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeTableOfInteger* Set(const DF_Label& label) ;
- SALOMEDSImpl_AttributeTableOfInteger();
- void SetNbColumns(const int theNbColumns);
- void SetTitle(const std::string& theTitle) ;
- std::string GetTitle() const;
- void SetRowData(const int theRow,const std::vector<int>& theData) ;
- std::vector<int> GetRowData(const int theRow) ;
- void SetRowTitle(const int theRow,const std::string& theTitle) ;
- void SetRowUnit(const int theRow,const std::string& theUnit) ;
- std::string GetRowUnit(const int theRow) const;
- void SetRowUnits(const std::vector<std::string>& theUnits) ;
- std::vector<std::string> GetRowUnits();
- void SetRowTitles(const std::vector<std::string>& theTitles) ;
- std::vector<std::string> GetRowTitles();
- std::string GetRowTitle(const int theRow) const;
- void SetColumnData(const int theColumn,const std::vector<int>& theData) ;
- std::vector<int> GetColumnData(const int theColumn) ;
- void SetColumnTitle(const int theColumn,const std::string& theTitle) ;
- std::string GetColumnTitle(const int theColumn) const;
- void SetColumnTitles(const std::vector<std::string>& theTitles);
- std::vector<std::string> GetColumnTitles();
- int GetNbRows() const;
- int GetNbColumns() const;
-
- void PutValue(const int theValue,const int theRow,const int theColumn) ;
- bool HasValue(const int theRow,const int theColumn) ;
- int GetValue(const int theRow,const int theColumn) ;
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
-
- std::vector<int> GetSetRowIndices(const int theRow);
- std::vector<int> GetSetColumnIndices(const int theColumn);
-
- ~SALOMEDSImpl_AttributeTableOfInteger() {}
-
-private:
-
- std::map<int, int> myTable;
- std::string myTitle;
- std::vector<std::string> myRows;
- std::vector<std::string> myCols;
- int myNbRows;
- int myNbColumns;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeTableOfReal.cxx
-// Author : Michael Ponikarov
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeTableOfReal.hxx"
-#include <stdio.h>
-#include <sstream>
-
-using namespace std;
-
-#define SEPARATOR '\1'
-
-typedef map<int, double>::const_iterator MI;
-
-static std::string getUnit(std::string theString)
-{
- std::string aString(theString);
- int aPos = aString.find(SEPARATOR);
- if(aPos <= 0 || aPos == aString.size() ) return std::string();
- return aString.substr(aPos+1, aString.size());
-}
-
-static std::string getTitle(std::string theString)
-{
- std::string aString(theString);
- int aPos = aString.find(SEPARATOR);
- if(aPos < 0) return aString;
- if(aPos == 0) return std::string();
- return aString.substr(0, aPos);
-}
-
-const std::string& SALOMEDSImpl_AttributeTableOfReal::GetID()
-{
- static std::string SALOMEDSImpl_AttributeTableOfRealID ("128371A1-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeTableOfRealID;
-}
-
-SALOMEDSImpl_AttributeTableOfReal* SALOMEDSImpl_AttributeTableOfReal::Set(const DF_Label& label)
-{
- SALOMEDSImpl_AttributeTableOfReal* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeTableOfReal*)label.FindAttribute(SALOMEDSImpl_AttributeTableOfReal::GetID()))) {
- A = new SALOMEDSImpl_AttributeTableOfReal();
- label.AddAttribute(A);
- }
- return A;
-}
-
-SALOMEDSImpl_AttributeTableOfReal::SALOMEDSImpl_AttributeTableOfReal()
-:SALOMEDSImpl_GenericAttribute("AttributeTableOfReal")
-{
- myNbRows = 0;
- myNbColumns = 0;
-}
-
-void SALOMEDSImpl_AttributeTableOfReal::SetNbColumns(const int theNbColumns)
-{
- CheckLocked();
- Backup();
-
- map<int, double> aMap;
- aMap = myTable;
- myTable.clear();
-
- for(MI p = aMap.begin(); p != aMap.end(); p++) {
- int aRow = (int)(p->first/myNbColumns) + 1;
- int aCol = (int)(p->first - myNbColumns*(aRow-1));
- if(aCol == 0) { aCol = myNbColumns; aRow--; }
- if(aCol > theNbColumns) continue;
- int aKey = (aRow-1)*theNbColumns+aCol;
- myTable[aKey] = p->second;
- }
-
- myNbColumns = theNbColumns;
-
- while (myCols.size() < myNbColumns) { // append empty columns titles
- myCols.push_back(string(""));
- }
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeTableOfReal::SetTitle(const std::string& theTitle)
-{
- CheckLocked();
- Backup();
- myTitle = theTitle;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-std::string SALOMEDSImpl_AttributeTableOfReal::GetTitle() const
-{
- return myTitle;
-}
-
-void SALOMEDSImpl_AttributeTableOfReal::SetRowData(const int theRow,
- const vector<double>& theData)
-{
- CheckLocked();
- if(theData.size() > myNbColumns) SetNbColumns(theData.size());
-
- Backup();
-
- while (myRows.size() < theRow) { // append new row titles
- myRows.push_back(std::string(""));
- }
-
- int i, aShift = (theRow-1)*myNbColumns, aLength = theData.size();
- for(i = 1; i <= aLength; i++) {
- myTable[aShift + i] = theData[i-1];
- }
-
- if(theRow > myNbRows) myNbRows = theRow;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-vector<double> SALOMEDSImpl_AttributeTableOfReal::GetRowData(const int theRow)
-{
- vector<double> aSeq;
- int i, aShift = (theRow-1)*myNbColumns;
- for(i = 1; i <= myNbColumns; i++) {
- if(myTable.find(aShift+i) != myTable.end())
- aSeq.push_back(myTable[aShift+i]);
- else
- aSeq.push_back(0.);
- }
-
- return aSeq;
-}
-
-
-void SALOMEDSImpl_AttributeTableOfReal::SetRowTitle(const int theRow,
- const std::string& theTitle)
-{
- CheckLocked();
- Backup();
- std::string aTitle(theTitle), aUnit = GetRowUnit(theRow);
- if(aUnit.size()>0) {
- aTitle += SEPARATOR;
- aTitle += aUnit;
- }
- myRows[theRow-1] = aTitle;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeTableOfReal::SetRowUnit(const int theRow,
- const std::string& theUnit)
-{
- CheckLocked();
- Backup();
- std::string aTitle = GetRowTitle(theRow);
- aTitle += SEPARATOR;
- aTitle += theUnit;
-
- myRows[theRow-1] = aTitle;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeTableOfReal::SetRowUnits(const vector<string>& theUnits)
-{
- if (theUnits.size() != GetNbRows()) throw DFexception("Invalid number of rows");
- int aLength = theUnits.size(), i;
- for(i = 1; i <= aLength; i++) SetRowUnit(i, theUnits[i-1]);
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-vector<string> SALOMEDSImpl_AttributeTableOfReal::GetRowUnits()
-{
- vector<string> aSeq;
- int aLength = myRows.size(), i;
- for(i=0; i<aLength; i++) aSeq.push_back(getUnit(myRows[i]));
- return aSeq;
-}
-
-void SALOMEDSImpl_AttributeTableOfReal::SetRowTitles(const vector<string>& theTitles)
-{
- if (theTitles.size() != GetNbRows()) throw DFexception("Invalid number of rows");
- int aLength = theTitles.size(), i;
- for(i = 1; i <= aLength; i++) SetRowTitle(i, theTitles[i-1]);
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-vector<string> SALOMEDSImpl_AttributeTableOfReal::GetRowTitles()
-{
- vector<string> aSeq;
- int aLength = myRows.size(), i;
- for(i=0; i<aLength; i++) aSeq.push_back(getTitle(myRows[i]));
- return aSeq;
-}
-
-
-std::string SALOMEDSImpl_AttributeTableOfReal::GetRowTitle(const int theRow) const
-{
- return getTitle(myRows[theRow-1]);
-}
-
-
-std::string SALOMEDSImpl_AttributeTableOfReal::GetRowUnit(const int theRow) const
-{
- return getUnit(myRows[theRow-1]);
-}
-
-void SALOMEDSImpl_AttributeTableOfReal::SetColumnData(const int theColumn,
- const vector<double>& theData)
-{
- CheckLocked();
- if(theColumn > myNbColumns) SetNbColumns(theColumn);
-
- Backup();
-
- int i, aLength = theData.size();
- for(i = 1; i <= aLength; i++) {
- myTable[myNbColumns*(i-1)+theColumn] = theData[i-1];
- }
-
- if(aLength > myNbRows) {
- myNbRows = aLength;
- while (myRows.size() < myNbRows) { // append empty row titles
- myRows.push_back(string(""));
- }
- }
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-
-vector<double> SALOMEDSImpl_AttributeTableOfReal::GetColumnData(const int theColumn)
-{
- vector<double> aSeq;
-
- int i, anIndex;
- for(i = 1; i <= myNbRows; i++) {
- anIndex = myNbColumns*(i-1) + theColumn;
- if(myTable.find(anIndex) != myTable.end())
- aSeq.push_back(myTable[anIndex]);
- else
- aSeq.push_back(0.);
- }
-
- return aSeq;
-}
-
-void SALOMEDSImpl_AttributeTableOfReal::SetColumnTitle(const int theColumn,
- const std::string& theTitle)
-{
- CheckLocked();
- Backup();
- while(myCols.size() < theColumn) myCols.push_back(std::string(""));
- myCols[theColumn-1] = theTitle;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-std::string SALOMEDSImpl_AttributeTableOfReal::GetColumnTitle(const int theColumn) const
-{
- if(myCols.empty()) return "";
- if(myCols.size() < theColumn) return "";
- return myCols[theColumn-1];
-}
-
-void SALOMEDSImpl_AttributeTableOfReal::SetColumnTitles(const vector<string>& theTitles)
-{
- if (theTitles.size() != myNbColumns) throw DFexception("Invalid number of columns");
- int aLength = theTitles.size(), i;
- for(i = 0; i < aLength; i++) myCols[i] = theTitles[i];
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-vector<string> SALOMEDSImpl_AttributeTableOfReal::GetColumnTitles()
-{
- vector<string> aSeq;
- int aLength = myCols.size(), i;
- for(i=0; i<aLength; i++) aSeq.push_back(myCols[i]);
- return aSeq;
-}
-
-int SALOMEDSImpl_AttributeTableOfReal::GetNbRows() const
-{
- return myNbRows;
-}
-
-int SALOMEDSImpl_AttributeTableOfReal::GetNbColumns() const
-{
- return myNbColumns;
-}
-
-void SALOMEDSImpl_AttributeTableOfReal::PutValue(const double& theValue,
- const int theRow,
- const int theColumn)
-{
- CheckLocked();
- if(theColumn > myNbColumns) SetNbColumns(theColumn);
-
- int anIndex = (theRow-1)*myNbColumns + theColumn;
- myTable[anIndex] = theValue;
-
- if(theRow > myNbRows) {
- while (myRows.size() < theRow) { // append empty row titles
- myRows.push_back(std::string(""));
- }
- myNbRows = theRow;
- }
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-bool SALOMEDSImpl_AttributeTableOfReal::HasValue(const int theRow,
- const int theColumn)
-{
- if(theRow > myNbRows || theRow < 1) return false;
- if(theColumn > myNbColumns || theColumn < 1) return false;
- int anIndex = (theRow-1)*myNbColumns + theColumn;
- return (myTable.find(anIndex) != myTable.end());
-}
-
-double SALOMEDSImpl_AttributeTableOfReal::GetValue(const int theRow,
- const int theColumn)
-{
- if(theRow > myNbRows || theRow < 1) throw DFexception("Invalid cell index");
- if(theColumn > myNbColumns || theColumn < 1) throw DFexception("Invalid cell index");
-
- int anIndex = (theRow-1)*myNbColumns + theColumn;
- if(myTable.find(anIndex) != myTable.end()) return myTable[anIndex];
-
- throw DFexception("Invalid cell index");
- return 0.;
-}
-
-const std::string& SALOMEDSImpl_AttributeTableOfReal::ID() const
-{
- return GetID();
-}
-
-void SALOMEDSImpl_AttributeTableOfReal::Restore(DF_Attribute* with)
-{
- int anIndex;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(with);
- if(!aTable) throw DFexception("Can't Restore from a null attribute");
-
- myTable.clear();
- myCols.clear();
- myRows.clear();
-
- myTable = aTable->myTable;
- myNbRows = aTable->myNbRows;
- myNbColumns = aTable->myNbColumns;
- myTitle = aTable->myTitle;
-
- for(anIndex = 1; anIndex <= aTable->GetNbRows();anIndex++)
- myRows.push_back(aTable->GetRowTitle(anIndex));
-
- for(anIndex = 1; anIndex <= aTable->GetNbColumns(); anIndex++)
- myCols.push_back(aTable->GetColumnTitle(anIndex));
-}
-
-DF_Attribute* SALOMEDSImpl_AttributeTableOfReal::NewEmpty() const
-{
- return new SALOMEDSImpl_AttributeTableOfReal();
-}
-
-void SALOMEDSImpl_AttributeTableOfReal::Paste(DF_Attribute* into)
-{
- int anIndex;
- SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(into);
- if(!aTable) throw DFexception("Can't Paste into a null attribute");
-
- aTable->myTable.clear();
- aTable->myCols.clear();
- aTable->myRows.clear();
-
- aTable->myTable = myTable;
- aTable->myTitle = myTitle;
- aTable->myNbRows = myNbRows;
- aTable->myNbColumns = myNbColumns;
-
- for(anIndex = 1; anIndex <= GetNbRows();anIndex++)
- aTable->myRows.push_back(GetRowTitle(anIndex));
- for(anIndex = 1; anIndex <= GetNbColumns(); anIndex++)
- aTable->myCols.push_back(GetColumnTitle(anIndex));
-}
-
-
-vector<int> SALOMEDSImpl_AttributeTableOfReal::GetSetRowIndices(const int theRow)
-{
- vector<int> aSeq;
-
- int i, aShift = myNbColumns*(theRow-1);
- for(i = 1; i <= myNbColumns; i++) {
- if(myTable.find(aShift + i) != myTable.end()) aSeq.push_back(i);
- }
-
- return aSeq;
-}
-
-vector<int> SALOMEDSImpl_AttributeTableOfReal::GetSetColumnIndices(const int theColumn)
-{
- vector<int> aSeq;
-
- int i, anIndex;
- for(i = 1; i <= myNbRows; i++) {
- anIndex = myNbColumns*(i-1)+theColumn;
- if(myTable.find(anIndex) != myTable.end()) aSeq.push_back(i);
- }
-
- return aSeq;
-}
-
-string SALOMEDSImpl_AttributeTableOfReal::Save()
-{
- string aString;
- char* buffer = new char[1024];
- int i, j, l;
-
- //Title
- l = myTitle.size();
- sprintf(buffer, "%d\n", l);
- aString+=buffer;
- for(i=0; i<l; i++) {
- aString += myTitle[i];
- aString +='\n';
- }
-
- //Nb rows
- sprintf(buffer, "%d\n", myNbRows);
- aString+=buffer;
-
- //Row titles
- for(i=0; i<myNbRows; i++) {
- l = myRows[i].size();
- sprintf(buffer, "%d\n", l);
- aString+=buffer;
- for(j=0; j<l; j++) {
- aString += myRows[i][j];
- aString += '\n';
- }
- }
-
- //Nb columns
- sprintf(buffer, "%d\n", myNbColumns);
- aString+=buffer;
-
- //Columns titles
- for(i=0; i<myNbColumns; i++) {
- l = myCols[i].size();
- sprintf(buffer, "%d\n", l);
- aString+=buffer;
- for(j=0; j<l; j++) {
- aString += myCols[i][j];
- aString += '\n';
- }
- }
-
- //Store the table values
- l = myTable.size();
- sprintf(buffer, "%d\n", l);
- aString+=buffer;
- for(MI p = myTable.begin(); p != myTable.end(); p++) {
- sprintf(buffer, "%d\n%.64e\n", p->first, p->second);
- aString += buffer;
- }
-
- delete []buffer;
- return aString;
-}
-
-void SALOMEDSImpl_AttributeTableOfReal::Load(const string& value)
-{
- vector<string> v;
- int i, j, l, pos, aSize = (int)value.size();
- for(i = 0, pos = 0; i<aSize; i++) {
- if(value[i] == '\n') {
- v.push_back(value.substr(pos, i-pos));
- pos = i+1;
- }
- }
-
- Backup();
-
- pos = 0;
- std::string aStr;
-
- //Title
- l = strtol(v[pos++].c_str(), NULL, 10);
-
- myTitle = std::string(l, 0);
- for(i=0; i<l; i++) {
- myTitle[i] = v[pos++][0];
- }
-
- //Nb rows
- myNbRows = strtol(v[pos++].c_str(), NULL, 10);
-
- //Rows titles
- myRows.clear();
- for(i=1; i<=myNbRows; i++) {
- l = strtol(v[pos++].c_str(), NULL, 10);
- aStr = std::string(l,0);
- for(j=0; j<l; j++) {
- aStr[j] = v[pos++][0];
- }
- myRows.push_back(aStr);
- }
-
- //Nb columns
- myNbColumns = strtol(v[pos++].c_str(), NULL, 10);
-
- //Columns titles
- myCols.clear();
- for(i=1; i<=myNbColumns; i++) {
- l = strtol(v[pos++].c_str(), NULL, 10);
- aStr = std::string(l,0);
- for(j=0; j<l; j++) {
- aStr[j] = v[pos++][0];
- }
- myCols.push_back(aStr);
- }
-
- //Restore the table values
- l = strtol(v[pos++].c_str(), NULL, 10);
- myTable.clear();
- for(i=1; i<=l; i++) {
- int aKey = strtol(v[pos++].c_str(), NULL, 10);
- double aValue = strtod(v[pos++].c_str(), NULL);
- myTable[aKey] = aValue;
- }
-
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDSImpl : data structure of SALOME and sources of Salome data server
-// File : SALOMEDSImpl_AttributeTableOfReal.hxx
-// Author : Michael Ponikarov
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeTableOfReal_HeaderFile
-#define _SALOMEDSImpl_AttributeTableOfReal_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-#include <string>
-#include <vector>
-#include <map>
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTableOfReal :
- public SALOMEDSImpl_GenericAttribute
-{
-
-public:
- virtual std::string Save();
- virtual void Load(const std::string&);
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeTableOfReal* Set(const DF_Label& label) ;
- SALOMEDSImpl_AttributeTableOfReal();
- void SetNbColumns(const int theNbColumns);
- void SetTitle(const std::string& theTitle) ;
- std::string GetTitle() const;
- void SetRowData(const int theRow,const std::vector<double>& theData) ;
- std::vector<double> GetRowData(const int theRow) ;
- void SetRowTitle(const int theRow,const std::string& theTitle) ;
- void SetRowUnit(const int theRow,const std::string& theUnit) ;
- std::string GetRowUnit(const int theRow) const;
- void SetRowUnits(const std::vector<std::string>& theUnits) ;
- std::vector<std::string> GetRowUnits();
- void SetRowTitles(const std::vector<std::string>& theTitles) ;
- std::vector<std::string> GetRowTitles();
- std::string GetRowTitle(const int theRow) const;
- void SetColumnData(const int theColumn,const std::vector<double>& theData) ;
- std::vector<double> GetColumnData(const int theColumn) ;
- void SetColumnTitle(const int theColumn,const std::string& theTitle) ;
- void SetColumnTitles(const std::vector<std::string>& theTitles);
- std::vector<std::string> GetColumnTitles();
- std::string GetColumnTitle(const int theColumn) const;
- int GetNbRows() const;
- int GetNbColumns() const;
-
- void PutValue(const double& theValue,const int theRow,const int theColumn) ;
- bool HasValue(const int theRow,const int theColumn) ;
- double GetValue(const int theRow,const int theColumn) ;
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
-
- std::vector<int> GetSetRowIndices(const int theRow);
- std::vector<int> GetSetColumnIndices(const int theColumn);
-
- ~SALOMEDSImpl_AttributeTableOfReal() {}
-
-private:
- std::map<int, double> myTable;
- std::string myTitle;
- std::vector<std::string> myRows;
- std::vector<std::string> myCols;
- int myNbRows;
- int myNbColumns;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeTableOfString.cxx
-// Author : Sergey Ruin
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeTableOfString.hxx"
-#include <stdio.h>
-#include <stdlib.h>
-#include <sstream>
-
-using namespace std;
-
-#define SEPARATOR '\1'
-
-typedef map<int, string>::const_iterator MI;
-
-static std::string getUnit(std::string theString)
-{
- std::string aString(theString);
- int aPos = aString.find(SEPARATOR);
- if(aPos <= 0 || aPos == aString.size() ) return std::string();
- return aString.substr(aPos+1, aString.size());
-}
-
-static std::string getTitle(std::string theString)
-{
- std::string aString(theString);
- int aPos = aString.find(SEPARATOR);
- if(aPos < 1) return aString;
- if(aPos == 0) return std::string();
- return aString.substr(0, aPos);
-}
-
-const std::string& SALOMEDSImpl_AttributeTableOfString::GetID()
-{
- static std::string SALOMEDSImpl_AttributeTableOfStringID ("128371A4-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeTableOfStringID;
-}
-
-SALOMEDSImpl_AttributeTableOfString* SALOMEDSImpl_AttributeTableOfString::Set(const DF_Label& label)
-{
- SALOMEDSImpl_AttributeTableOfString* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeTableOfString*)label.FindAttribute(SALOMEDSImpl_AttributeTableOfString::GetID()))) {
- A = new SALOMEDSImpl_AttributeTableOfString();
- label.AddAttribute(A);
- }
- return A;
-}
-
-SALOMEDSImpl_AttributeTableOfString::SALOMEDSImpl_AttributeTableOfString()
-:SALOMEDSImpl_GenericAttribute("AttributeTableOfString")
-{
- myNbRows = 0;
- myNbColumns = 0;
-}
-
-void SALOMEDSImpl_AttributeTableOfString::SetNbColumns(const int theNbColumns)
-{
- CheckLocked();
- Backup();
-
- map<int, string> aMap;
- aMap = myTable;
- myTable.clear();
-
- for(MI p = aMap.begin(); p!=aMap.end(); p++) {
- int aRow = (int)(p->first/myNbColumns) + 1;
- int aCol = (int)(p->first - myNbColumns*(aRow-1));
- if(aCol == 0) { aCol = myNbColumns; aRow--; }
- if(aCol > theNbColumns) continue;
- int aKey = (aRow-1)*theNbColumns+aCol;
- myTable[aKey] = p->second;
- }
-
- myNbColumns = theNbColumns;
-
- while (myCols.size() < myNbColumns) { // append empty columns titles
- myCols.push_back(std::string(""));
- }
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeTableOfString::SetRowTitle(const int theRow,
- const std::string& theTitle)
-{
- CheckLocked();
- Backup();
- std::string aTitle(theTitle), aUnit = GetRowUnit(theRow);
- if(aUnit.size()>0) {
- aTitle += SEPARATOR;
- aTitle += aUnit;
- }
- myRows[theRow-1] = aTitle;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeTableOfString::SetRowUnit(const int theRow,
- const std::string& theUnit)
-{
- CheckLocked();
- Backup();
- std::string aTitle = GetRowTitle(theRow);
- aTitle += SEPARATOR;
- aTitle += theUnit;
-
- myRows[theRow-1] = aTitle;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeTableOfString::SetRowUnits(const vector<string>& theUnits)
-{
- if (theUnits.size() != GetNbRows()) throw DFexception("Invalid number of rows");
- int aLength = theUnits.size(), i;
- for(i = 1; i <= aLength; i++) SetRowUnit(i, theUnits[i-1]);
-}
-
-vector<string> SALOMEDSImpl_AttributeTableOfString::GetRowUnits()
-{
- vector<string> aSeq;
- int aLength = myRows.size(), i;
- for(i=0; i<aLength; i++) aSeq.push_back(getUnit(myRows[i]));
- return aSeq;
-}
-
-void SALOMEDSImpl_AttributeTableOfString::SetRowTitles(const vector<string>& theTitles)
-{
- if (theTitles.size() != GetNbRows()) throw DFexception("Invalid number of rows");
- int aLength = theTitles.size(), i;
- for(i = 1; i <= aLength; i++) SetRowTitle(i, theTitles[i-1]);
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-vector<string> SALOMEDSImpl_AttributeTableOfString::GetRowTitles()
-{
- vector<string> aSeq;
- int aLength = myRows.size(), i;
- for(i=0; i<aLength; i++) aSeq.push_back(getTitle(myRows[i]));
- return aSeq;
-}
-
-
-std::string SALOMEDSImpl_AttributeTableOfString::GetRowTitle(const int theRow) const
-{
- return getTitle(myRows[theRow-1]);
-}
-
-
-std::string SALOMEDSImpl_AttributeTableOfString::GetRowUnit(const int theRow) const
-{
- return getUnit(myRows[theRow-1]);
-}
-
-void SALOMEDSImpl_AttributeTableOfString::SetRowData(const int theRow,
- const vector<string>& theData)
-{
- CheckLocked();
- if(theData.size() > myNbColumns) SetNbColumns(theData.size());
-
- Backup();
-
- while (myRows.size() < theRow) { // append new row titles
- myRows.push_back(std::string(""));
- }
-
- int i, aShift = (theRow-1)*myNbColumns, aLength = theData.size();
- for(i = 1; i <= aLength; i++) {
- myTable[aShift + i] = theData[i-1];
- }
-
- if(theRow > myNbRows) myNbRows = theRow;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-void SALOMEDSImpl_AttributeTableOfString::SetTitle(const std::string& theTitle)
-{
- CheckLocked();
- Backup();
- myTitle = theTitle;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-std::string SALOMEDSImpl_AttributeTableOfString::GetTitle() const
-{
- return myTitle;
-}
-
-vector<string> SALOMEDSImpl_AttributeTableOfString::GetRowData(const int theRow)
-{
- vector<string> aSeq;
- int i, aShift = (theRow-1)*myNbColumns;
- for(i = 1; i <= myNbColumns; i++) {
- if(myTable.find(aShift+i) != myTable.end())
- aSeq.push_back(myTable[aShift+i]);
- else
- aSeq.push_back("");
- }
-
- return aSeq;
-}
-
-void SALOMEDSImpl_AttributeTableOfString::SetColumnData(const int theColumn,
- const vector<string>& theData)
-{
- CheckLocked();
- if(theColumn > myNbColumns) SetNbColumns(theColumn);
-
- Backup();
-
- int i, aLength = theData.size();
- for(i = 1; i <= aLength; i++) {
- myTable[myNbColumns*(i-1)+theColumn] = theData[i-1];
- }
-
- if(aLength > myNbRows) {
- myNbRows = aLength;
- while (myRows.size() < myNbRows) { // append empty row titles
- myRows.push_back(std::string(""));
- }
- }
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-
-vector<string> SALOMEDSImpl_AttributeTableOfString::GetColumnData(const int theColumn)
-{
- vector<string> aSeq;
-
- int i, anIndex;
- for(i = 1; i <= myNbRows; i++) {
- anIndex = myNbColumns*(i-1) + theColumn;
- if(myTable.find(anIndex) != myTable.end())
- aSeq.push_back(myTable[anIndex]);
- else
- aSeq.push_back("");
- }
-
- return aSeq;
-}
-
-void SALOMEDSImpl_AttributeTableOfString::SetColumnTitle(const int theColumn,
- const std::string& theTitle)
-{
- CheckLocked();
- Backup();
- while(myCols.size() < theColumn) myCols.push_back(std::string(""));
- myCols[theColumn-1] = theTitle;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-std::string SALOMEDSImpl_AttributeTableOfString::GetColumnTitle(const int theColumn) const
-{
- if(myCols.empty()) return "";
- if(myCols.size() < theColumn) return "";
- return myCols[theColumn-1];
-}
-
-
-void SALOMEDSImpl_AttributeTableOfString::SetColumnTitles(const vector<string>& theTitles)
-{
- if (theTitles.size() != myNbColumns) throw DFexception("Invalid number of columns");
- int aLength = theTitles.size(), i;
- for(i = 0; i < aLength; i++) myCols[i] = theTitles[i];
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-vector<string> SALOMEDSImpl_AttributeTableOfString::GetColumnTitles()
-{
- vector<string> aSeq;
- int aLength = myCols.size(), i;
- for(i=0; i<aLength; i++) aSeq.push_back(myCols[i]);
- return aSeq;
-}
-
-
-int SALOMEDSImpl_AttributeTableOfString::GetNbRows() const
-{
- return myNbRows;
-}
-
-int SALOMEDSImpl_AttributeTableOfString::GetNbColumns() const
-{
- return myNbColumns;
-}
-
-void SALOMEDSImpl_AttributeTableOfString::PutValue(const std::string& theValue,
- const int theRow,
- const int theColumn)
-{
- CheckLocked();
- if(theColumn > myNbColumns) SetNbColumns(theColumn);
-
- int anIndex = (theRow-1)*myNbColumns + theColumn;
- myTable[anIndex] = theValue;
-
- if(theRow > myNbRows) {
- while (myRows.size() < theRow) { // append empty row titles
- myRows.push_back(std::string(""));
- }
- myNbRows = theRow;
- }
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-bool SALOMEDSImpl_AttributeTableOfString::HasValue(const int theRow,
- const int theColumn)
-{
- if(theRow > myNbRows || theRow < 1) return false;
- if(theColumn > myNbColumns || theColumn < 1) return false;
-
- int anIndex = (theRow-1)*myNbColumns + theColumn;
- return (myTable.find(anIndex) != myTable.end());
-}
-
-std::string SALOMEDSImpl_AttributeTableOfString::GetValue(const int theRow,
- const int theColumn)
-{
- if(theRow > myNbRows || theRow < 1) throw DFexception("Invalid cell index");
- if(theColumn > myNbColumns || theColumn < 1) throw DFexception("Invalid cell index");
-
- int anIndex = (theRow-1)*myNbColumns + theColumn;
- if(myTable.find(anIndex) != myTable.end()) return myTable[anIndex];
-
- throw DFexception("Invalid cell index");
- return "";
-}
-
-const std::string& SALOMEDSImpl_AttributeTableOfString::ID() const
-{
- return GetID();
-}
-
-void SALOMEDSImpl_AttributeTableOfString::Restore(DF_Attribute* with)
-{
- int anIndex;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(with);
-
- myTable.clear();
- myCols.clear();
- myRows.clear();
-
- myTable = aTable->myTable;
- myNbRows = aTable->myNbRows;
- myNbColumns = aTable->myNbColumns;
- myTitle = aTable->myTitle;
-
- for(anIndex = 1; anIndex <= aTable->GetNbRows();anIndex++)
- myRows.push_back(aTable->GetRowTitle(anIndex));
-
- for(anIndex = 1; anIndex <= aTable->GetNbColumns(); anIndex++)
- myCols.push_back(aTable->GetColumnTitle(anIndex));
-}
-
-DF_Attribute* SALOMEDSImpl_AttributeTableOfString::NewEmpty() const
-{
- return new SALOMEDSImpl_AttributeTableOfString();
-}
-
-void SALOMEDSImpl_AttributeTableOfString::Paste(DF_Attribute* into)
-{
- int anIndex;
- SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfString*>(into);
-
- aTable->myTable.clear();
- aTable->myCols.clear();
- aTable->myRows.clear();
-
- aTable->myTable = myTable;
- aTable->myTitle = myTitle;
- aTable->myNbRows = myNbRows;
- aTable->myNbColumns = myNbColumns;
-
- for(anIndex = 1; anIndex <= GetNbRows();anIndex++)
- aTable->myRows.push_back(GetRowTitle(anIndex));
- for(anIndex = 1; anIndex <= GetNbColumns(); anIndex++)
- aTable->myCols.push_back(GetColumnTitle(anIndex));
-}
-
-
-vector<int> SALOMEDSImpl_AttributeTableOfString::GetSetRowIndices(const int theRow)
-{
- vector<int> aSeq;
-
- int i, aShift = myNbColumns*(theRow-1);
- for(i = 1; i <= myNbColumns; i++) {
- if(myTable.find(aShift + i) != myTable.end()) aSeq.push_back(i);
- }
-
- return aSeq;
-}
-
-vector<int> SALOMEDSImpl_AttributeTableOfString::GetSetColumnIndices(const int theColumn)
-{
- vector<int> aSeq;
-
- int i, anIndex;
- for(i = 1; i <= myNbRows; i++) {
- anIndex = myNbColumns*(i-1)+theColumn;
- if(myTable.find(anIndex) != myTable.end()) aSeq.push_back(i);
- }
-
- return aSeq;
-}
-
-
-
-string SALOMEDSImpl_AttributeTableOfString::Save()
-{
- string aString;
- char* buffer = new char[1024];
- int i, j, l;
-
- //Title
- l = myTitle.size();
- sprintf(buffer, "%d\n", l);
- aString+=buffer;
- for(i=0; i<l; i++) {
- aString += myTitle[i];
- aString +='\n';
- }
-
- //Nb rows
- sprintf(buffer, "%d\n", myNbRows);
- aString+=buffer;
-
- //Row titles
- for(i=0; i<myNbRows; i++) {
- l = myRows[i].size();
- sprintf(buffer, "%d\n", l);
- aString+=buffer;
- for(j=0; j<l; j++) {
- aString += myRows[i][j];
- aString += '\n';
- }
- }
-
- //Nb columns
- sprintf(buffer, "%d\n", myNbColumns);
- aString+=buffer;
-
- //Columns titles
- for(i=0; i<myNbColumns; i++) {
- l = myCols[i].size();
- sprintf(buffer, "%d\n", l);
- aString+=buffer;
- for(j=0; j<l; j++) {
- aString += myCols[i][j];
- aString += '\n';
- }
- }
-
- //Store the table values
- l = myTable.size();
- sprintf(buffer, "%d\n", l);
- aString+=buffer;
- for(MI p = myTable.begin(); p!=myTable.end(); p++) {
- if (p->second.size()) { // check empty string in the value table
- sprintf(buffer, "%d\n", p->first);
- aString += buffer;
- unsigned long aValueSize = p->second.size();
- sprintf(buffer, "%ld\n", aValueSize);
- aString +=buffer;
- aString += p->second;
- aString += '\n';
- } else { // write index only of kind: "0key"; "05", for an example
- sprintf(buffer, "0%d\n", p->first);
- aString+=buffer;
- }
- }
-
- delete []buffer;
- return aString;
-}
-
-void SALOMEDSImpl_AttributeTableOfString::Load(const string& value)
-{
- vector<string> v;
- int i, j, l, pos, aSize = (int)value.size();
- for(i = 0, pos = 0; i<aSize; i++) {
- if(value[i] == '\n') {
- v.push_back(value.substr(pos, i-pos));
- pos = i+1;
- }
- }
-
- Backup();
-
- pos = 0;
- std::string aStr;
-
- //Title
- l = strtol(v[pos++].c_str(), NULL, 10);
-
- myTitle = std::string(l, 0);
- for(i=0; i<l; i++) {
- myTitle[i] = v[pos++][0];
- }
-
- //Nb rows
- myNbRows = strtol(v[pos++].c_str(), NULL, 10);
-
- //Rows titles
- myRows.clear();
- for(i=1; i<=myNbRows; i++) {
- l = strtol(v[pos++].c_str(), NULL, 10);
- aStr = std::string(l,0);
- for(j=0; j<l; j++) {
- aStr[j] = v[pos++][0];
- }
- myRows.push_back(aStr);
- }
-
- //Nb columns
- myNbColumns = strtol(v[pos++].c_str(), NULL, 10);
-
- //Columns titles
- myCols.clear();
- for(i=1; i<=myNbColumns; i++) {
- l = strtol(v[pos++].c_str(), NULL, 10);
- aStr = std::string(l,0);
- for(j=0; j<l; j++) {
- aStr[j] = v[pos++][0];
- }
- myCols.push_back(aStr);
- }
-
- //Restore the table values
- l = strtol(v[pos++].c_str(), NULL, 10);
- myTable.clear();
- for(i=1; i<=l; i++) {
- aStr = v[pos++]; //Ket as a string
- int aKey = strtol(aStr.c_str(), NULL, 10);
- string aValue;
- if(aStr[0] == '0') //If the first character of the key is 0, then empty value
- aValue = "";
- else {
- strtol(v[pos++].c_str(), NULL, 10);
- aValue = v[pos++];
- }
- myTable[aKey] = aValue;
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDSImpl : data structure of SALOME and sources of Salome data server
-// File : SALOMEDSImpl_AttributeTableOfString.hxx
-// Author : Sergey Ruin
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeTableOfString_HeaderFile
-#define _SALOMEDSImpl_AttributeTableOfString_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Label.hxx"
-#include "DF_Attribute.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-#include <string>
-#include <vector>
-#include <map>
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTableOfString :
- public SALOMEDSImpl_GenericAttribute
-{
-
-public:
- virtual std::string Save();
- virtual void Load(const std::string&);
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeTableOfString* Set(const DF_Label& label) ;
- SALOMEDSImpl_AttributeTableOfString();
- void SetNbColumns(const int theNbColumns);
- void SetTitle(const std::string& theTitle) ;
- std::string GetTitle() const;
- void SetRowData(const int theRow,const std::vector<std::string>& theData) ;
- std::vector<std::string> GetRowData(const int theRow) ;
- void SetRowTitle(const int theRow,const std::string& theTitle) ;
- void SetRowUnit(const int theRow,const std::string& theUnit) ;
- std::string GetRowUnit(const int theRow) const;
- void SetRowUnits(const std::vector<std::string>& theUnits) ;
- std::vector<std::string> GetRowUnits();
- void SetRowTitles(const std::vector<std::string>& theTitles) ;
- std::vector<std::string> GetRowTitles();
- std::string GetRowTitle(const int theRow) const;
- void SetColumnData(const int theColumn,const std::vector<std::string>& theData) ;
- std::vector<std::string> GetColumnData(const int theColumn) ;
- void SetColumnTitle(const int theColumn,const std::string& theTitle) ;
- std::string GetColumnTitle(const int theColumn) const;
- void SetColumnTitles(const std::vector<std::string>& theTitles);
- std::vector<std::string> GetColumnTitles();
- int GetNbRows() const;
- int GetNbColumns() const;
-
- void PutValue(const std::string& theValue,const int theRow,const int theColumn) ;
- bool HasValue(const int theRow,const int theColumn) ;
- std::string GetValue(const int theRow,const int theColumn) ;
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
-
- std::vector<int> GetSetRowIndices(const int theRow);
- std::vector<int> GetSetColumnIndices(const int theColumn);
-
- ~SALOMEDSImpl_AttributeTableOfString() {}
-
-private:
-
- std::map<int, std::string> myTable;
- std::string myTitle;
- std::vector<std::string> myRows;
- std::vector<std::string> myCols;
- int myNbRows;
- int myNbColumns;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeTarget.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeTarget.hxx"
-#include "SALOMEDSImpl_AttributeReference.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-
-using namespace std;
-
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeTarget::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeTargetID ("12837197-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeTargetID;
-}
-
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-
-SALOMEDSImpl_AttributeTarget* SALOMEDSImpl_AttributeTarget::Set (const DF_Label& L)
-{
- SALOMEDSImpl_AttributeTarget* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeTarget*)L.FindAttribute(SALOMEDSImpl_AttributeTarget::GetID()))) {
- A = new SALOMEDSImpl_AttributeTarget();
- L.AddAttribute(A);
- }
- return A;
-}
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeTarget::SALOMEDSImpl_AttributeTarget()
-:SALOMEDSImpl_GenericAttribute("AttributeTarget")
-{
-}
-
-void SALOMEDSImpl_AttributeTarget::SetRelation(const std::string& theRelation)
-{
- CheckLocked();
- if(myRelation == theRelation) return;
-
- Backup();
- myRelation = theRelation;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : Add
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeTarget::Add(const SALOMEDSImpl_SObject& theSO)
-{
- Backup();
- DF_Label aRefLabel = theSO.GetLabel();
- SALOMEDSImpl_AttributeReference* aReference;
- if ((aReference=(SALOMEDSImpl_AttributeReference*)aRefLabel.FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
- for(int i = 0, len = myVariables.size(); i<len; i++) if(myVariables[i]->Label() == aRefLabel) return; //BugID: PAL6192
- myVariables.push_back(aReference);
- }
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : Get
-//purpose :
-//=======================================================================
-vector<SALOMEDSImpl_SObject> SALOMEDSImpl_AttributeTarget::Get()
-{
- vector<SALOMEDSImpl_SObject> aSeq;
-
- for(int i = 0, len = myVariables.size(); i<len; i++)
- aSeq.push_back( SALOMEDSImpl_Study::SObject(myVariables[i]->Label()));
-
- return aSeq;
-}
-
-//=======================================================================
-//function : Remove
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeTarget::Remove(const SALOMEDSImpl_SObject& theSO)
-{
- Backup();
- DF_Label aRefLabel = theSO.GetLabel();
-
- vector<DF_Attribute*> va;
- for(int i = 0, len = myVariables.size(); i<len; i++) {
- DF_Label L = myVariables[i]->Label();
- if(myVariables[i]->Label() == aRefLabel) continue;
- va.push_back(myVariables[i]);
- }
-
- myVariables.clear();
- myVariables = va;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeTarget::ID () const { return GetID(); }
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeTarget::Restore(DF_Attribute* With)
-{
- SALOMEDSImpl_AttributeTarget* REL = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(With);
- myRelation = REL->GetRelation();
- myVariables.clear();
- for (int i = 0, len = REL->myVariables.size(); i<len; i++) {
- myVariables.push_back(REL->myVariables[i]);
- }
-}
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-DF_Attribute* SALOMEDSImpl_AttributeTarget::NewEmpty() const
-{
- return new SALOMEDSImpl_AttributeTarget();
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeTarget::Paste(DF_Attribute* into)
-{
- SALOMEDSImpl_AttributeTarget* REL = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(into);
- REL->SetRelation(myRelation);
- REL->myVariables.clear();
- for (int i = 0, len = myVariables.size(); i<len; i++) {
- REL->myVariables.push_back(myVariables[i]);
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeTarget.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeTarget_HeaderFile
-#define _SALOMEDSImpl_AttributeTarget_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTarget :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
- std::string myRelation;
- std::vector<DF_Attribute*> myVariables;
-
-public:
- static const std::string& GetID() ;
- static SALOMEDSImpl_AttributeTarget* Set(const DF_Label& label) ;
- SALOMEDSImpl_AttributeTarget();
- void Add(const SALOMEDSImpl_SObject& theSO);
- std::vector<SALOMEDSImpl_SObject> Get();
- void Remove(const SALOMEDSImpl_SObject& theSO);
- std::string GetRelation() { return myRelation; }
- void SetRelation(const std::string& theRelation);
- std::vector<DF_Attribute*>& GetVariables() { return myVariables; }
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeTarget() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeTextColor.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeTextColor.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeTextColor::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeTextColorID ("12837189-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeTextColorID;
-}
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeTextColor::SALOMEDSImpl_AttributeTextColor()
-:SALOMEDSImpl_GenericAttribute("AttributeTextColor")
-{
- myValue.clear();
- myValue.push_back(0.);
- myValue.push_back(0.);
- myValue.push_back(0.);
-}
-
-//=======================================================================
-//function : SetTextColor
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeTextColor::SetTextColor(const double& R, const double& G, const double& B)
-{
- CheckLocked();
-
- Backup();
-
- myValue[0] = R;
- myValue[1] = G;
- myValue[2] = B;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : TextColor
-//purpose :
-//=======================================================================
-vector<double> SALOMEDSImpl_AttributeTextColor::TextColor()
-{
- return myValue;
-}
-
-//=======================================================================
-//function : ChangeArray
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeTextColor::ChangeArray(const vector<double>& newArray)
-{
- Backup();
-
- for(int i = 0; i < 3; i++)
- myValue[i] = newArray[i];
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeTextColor::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributeTextColor::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeTextColor();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeTextColor::Restore(DF_Attribute* with)
-{
- ChangeArray( dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(with)->TextColor ());
- return;
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeTextColor::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(into)->ChangeArray (myValue);
-}
-
-
-
-string SALOMEDSImpl_AttributeTextColor::Save()
-{
- char *Val = new char[75];
- sprintf(Val, "%f %f %f", (float)myValue[0],
- (float)myValue[1],
- (float)myValue[2]);
- string ret(Val);
- delete Val;
- return ret;
-}
-
-void SALOMEDSImpl_AttributeTextColor::Load(const string& value)
-{
- float r, g, b;
- sscanf(value.c_str(), "%f %f %f", &r, &g, &b);
- myValue[0] = r;
- myValue[1] = g;
- myValue[2] = b;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeTextColor.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeTextColor_HeaderFile
-#define _SALOMEDSImpl_AttributeTextColor_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-#include <vector>
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTextColor :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
- std::vector<double> myValue;
-
-public:
- virtual std::string Save();
- virtual void Load(const std::string&);
- static const std::string& GetID() ;
- SALOMEDSImpl_AttributeTextColor();
- const std::string& ID() const;
- void SetTextColor(const double& R, const double& G, const double& B);
- std::vector<double> TextColor();
- void ChangeArray(const std::vector<double>& newArray);
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste( DF_Attribute* into);
- ~SALOMEDSImpl_AttributeTextColor() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeTextHighlightColor.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeTextHighlightColor.hxx"
-
-using namespace std;
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeTextHighlightColor::GetID ()
-{
- static std::string SALOMEDSImpl_AttributeTextHighlightColorID ("12837190-8F52-11d6-A8A3-0001021E8C7F");
- return SALOMEDSImpl_AttributeTextHighlightColorID;
-}
-
-
-
-//=======================================================================
-//function : constructor
-//purpose :
-//=======================================================================
-SALOMEDSImpl_AttributeTextHighlightColor::SALOMEDSImpl_AttributeTextHighlightColor()
-:SALOMEDSImpl_GenericAttribute("AttributeTextHighlightColor")
-{
- myValue.clear();
- myValue.push_back(0.0);
- myValue.push_back(0.0);
- myValue.push_back(0.0);
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-
-const std::string& SALOMEDSImpl_AttributeTextHighlightColor::ID () const { return GetID(); }
-
-
-//=======================================================================
-//function : SetTextHighlightColor
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeTextHighlightColor::SetTextHighlightColor(const double& R,
- const double& G,
- const double& B)
-{
- CheckLocked();
- Backup();
-
- myValue[0] = R;
- myValue[1] = G;
- myValue[2] = B;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : TextHighlightColor
-//purpose :
-//=======================================================================
-vector<double> SALOMEDSImpl_AttributeTextHighlightColor::TextHighlightColor()
-{
- return myValue;
-}
-
-//=======================================================================
-//function : ChangeArray
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeTextHighlightColor::ChangeArray(const vector<double>& newArray)
-{
- Backup();
-
- for(int i = 0; i < 3; i++)
- myValue[i] = newArray[i];
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributeTextHighlightColor::NewEmpty () const
-{
- return new SALOMEDSImpl_AttributeTextHighlightColor();
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeTextHighlightColor::Restore(DF_Attribute* with)
-{
- ChangeArray(dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(with)->TextHighlightColor());;
- return;
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_AttributeTextHighlightColor::Paste (DF_Attribute* into)
-{
- dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(into)->ChangeArray (myValue);
-}
-
-string SALOMEDSImpl_AttributeTextHighlightColor::Save()
-{
- char *Val = new char[75];
- sprintf(Val, "%f %f %f", (float)myValue[0],
- (float)myValue[1],
- (float)myValue[2]);
- string ret(Val);
- delete Val;
- return ret;
-}
-
-void SALOMEDSImpl_AttributeTextHighlightColor::Load(const string& value)
-{
- float r, g, b;
- sscanf(value.c_str(), "%f %f %f", &r, &g, &b);
- myValue[0] = r;
- myValue[1] = g;
- myValue[2] = b;
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeTextHighlightColor.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeTextHighlightColor_HeaderFile
-#define _SALOMEDSImpl_AttributeTextHighlightColor_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-#include <vector>
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTextHighlightColor :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
- std::vector<double> myValue;
-
-public:
- virtual std::string Save();
- virtual void Load(const std::string&);
- static const std::string& GetID() ;
- SALOMEDSImpl_AttributeTextHighlightColor();
- void SetTextHighlightColor(const double& R, const double& G, const double& B);
- std::vector<double> TextHighlightColor();
- void ChangeArray(const std::vector<double>& newArray);
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeTextHighlightColor() {}
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeTreeNode.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeTreeNode.hxx"
-#include <string.h>
-
-using namespace std;
-
-const std::string& SALOMEDSImpl_AttributeTreeNode::GetDefaultTreeID()
-{
- static std::string TreeNodeID ("0E1C36E6-379B-4d90-AC37-17A14310E648");
- return TreeNodeID;
-}
-
-
-SALOMEDSImpl_AttributeTreeNode::SALOMEDSImpl_AttributeTreeNode()
-:SALOMEDSImpl_GenericAttribute("AttributeTreeNode"), myFather(NULL), myPrevious(NULL), myNext(NULL), myFirst(NULL)
-{}
-
-
-SALOMEDSImpl_AttributeTreeNode* SALOMEDSImpl_AttributeTreeNode::Set (const DF_Label& L, const std::string& ID)
-{
- SALOMEDSImpl_AttributeTreeNode* TN = NULL;
-
- if (!(TN=(SALOMEDSImpl_AttributeTreeNode*)L.FindAttribute(ID))) {
- TN = new SALOMEDSImpl_AttributeTreeNode ();
- TN->SetTreeID(ID);
- L.AddAttribute(TN);
- }
-
- return TN;
-}
-
-//=======================================================================
-//TreeNode : ID
-//purpose : Returns GUID of the TreeNode
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeTreeNode::ID() const
-{
- return myTreeID;
-}
-
-//=======================================================================
-//function : Append
-//purpose : Add <TN> as last child of me
-//=======================================================================
-bool SALOMEDSImpl_AttributeTreeNode::Append (SALOMEDSImpl_AttributeTreeNode* TN)
-{
- CheckLocked();
-
- if (!(TN->ID() == myTreeID)) throw DFexception("SALOMEDSImpl_AttributeTreeNode::Append : uncompatible GUID");
-
- if(TN->Label() == Label()) throw DFexception("Attempt of self linking");
-
- TN->SetNext(NULL); // Deconnects from next.
-
- // Find the last
- if (!HasFirst()) {
- SetFirst(TN);
- TN->SetPrevious(NULL); // Deconnects from previous.
- }
- else {
- SALOMEDSImpl_AttributeTreeNode* Last = GetFirst();
- while (Last && Last->HasNext()) {
- Last = Last->GetNext();
- }
- Last->SetNext(TN);
- TN->SetPrevious(Last);
- }
- // Set Father
- TN->SetFather(this);
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-
- return (TN);
-}
-
-//=======================================================================
-//function : Prepend
-//purpose : Add <TN> as first child of me
-//=======================================================================
-bool SALOMEDSImpl_AttributeTreeNode::Prepend (SALOMEDSImpl_AttributeTreeNode* TN)
-{
- CheckLocked();
-
- if (!(TN->ID() == myTreeID) ) throw DFexception("SALOMEDSImpl_AttributeTreeNode::Prepend : uncompatible GUID");
-
- if(TN->Label() == Label()) throw DFexception("Attempt of self linking");
-
- TN->SetPrevious(NULL);
- if (HasFirst()) {
- TN->SetNext(GetFirst());
- GetFirst()->SetPrevious(TN);
- }
- else {
- TN->SetNext(NULL);
- }
- TN->SetFather(this);
- SetFirst(TN);
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-
- return (TN);
-}
-
-
-//=======================================================================
-//function : InsertBefore
-//purpose : Inserts the TreeNode <TN> before me
-//=======================================================================
-bool SALOMEDSImpl_AttributeTreeNode::InsertBefore (SALOMEDSImpl_AttributeTreeNode* TN)
-{
- CheckLocked();
-
- if (!(TN->ID() == myTreeID) ) throw DFexception("SALOMEDSImpl_AttributeTreeNode::InsertBefore : uncompatible GUID");
-
- if(TN->Label() == Label()) throw DFexception("Attempt of self linking");
-
- TN->SetFather(GetFather());
- TN->SetPrevious(GetPrevious());
- TN->SetNext(this);
-
- if (!HasPrevious())
- GetFather()->SetFirst(TN);
- else
- GetPrevious()->SetNext(TN);
-
- SetPrevious(TN);
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-
- return (TN);
-}
-
-//=======================================================================
-//function : InsertAfter
-//purpose : Inserts the TreeNode <TN> after me
-//=======================================================================
-bool SALOMEDSImpl_AttributeTreeNode::InsertAfter (SALOMEDSImpl_AttributeTreeNode* TN)
-{
- CheckLocked();
-
- if(TN->Label() == Label()) throw DFexception("Attempt of self linking");
-
- if (!(TN->ID() == myTreeID) ) throw DFexception("SALOMEDSImpl_AttributeTreeNode::InsertAfter : uncompatible GUID");
-
- TN->SetFather(GetFather());
- TN->SetPrevious(this);
- TN->SetNext(GetNext());
-
- if (HasNext()) GetNext()->SetPrevious(TN);
-
- SetNext(TN);
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-
- return (TN);
-}
-
-//=======================================================================
-//function : Remove
-//purpose : Removees the function from the function tree
-//=======================================================================
-bool SALOMEDSImpl_AttributeTreeNode::Remove ()
-{
- CheckLocked();
-
- if (IsRoot()) return true;
-
- if (!HasPrevious())
- GetFather()->SetFirst(GetNext());
- else
- GetPrevious()->SetNext(GetNext());
-
- if (HasNext()) {
- if (HasPrevious()) GetNext()->SetPrevious(GetPrevious());
- else GetNext()->SetPrevious(NULL);
- }
- else {
- if (HasPrevious()) GetPrevious()->SetNext(NULL);
- }
-
- if (GetFather()->HasFirst()) {
- if (this == GetFather()->GetFirst()) {
- if (HasNext()) {
- GetFather()->SetFirst(GetNext());
- }
- else GetFather()->SetFirst(NULL);
- }
- }
-
- SetFather(NULL);
- SetNext(NULL);
- SetPrevious(NULL);
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-
- return true;
-}
-
-//=======================================================================
-//function : Depth
-//purpose :
-//=======================================================================
-int SALOMEDSImpl_AttributeTreeNode::Depth () const
-{
- int depth = 0;
- SALOMEDSImpl_AttributeTreeNode* current = (SALOMEDSImpl_AttributeTreeNode*)this;
- while (current) {
- depth++;
- current = current->GetFather();
- }
- return depth;
-}
-
-//=======================================================================
-//function : SetTreeID
-//purpose : Finds or creates a TreeNode attribute with explicit ID
-// : a driver for it
-//=======================================================================
-void SALOMEDSImpl_AttributeTreeNode::SetTreeID (const std::string& explicitID)
-{
- myTreeID = explicitID;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-
-//=======================================================================
-//function : IsAscendant
-//purpose :
-//=======================================================================
-bool SALOMEDSImpl_AttributeTreeNode::IsAscendant (const SALOMEDSImpl_AttributeTreeNode* ofTN) const
-{
- return ofTN->IsDescendant(this);
-}
-
-//=======================================================================
-//function : IsDescendant
-//purpose :
-//=======================================================================
-
-bool SALOMEDSImpl_AttributeTreeNode::IsDescendant (const SALOMEDSImpl_AttributeTreeNode* ofTN) const
-{
- SALOMEDSImpl_AttributeTreeNode* current = (SALOMEDSImpl_AttributeTreeNode*)this;
- while (current) {
- if (current->GetFather() == ofTN) return true;
- current = current->GetFather();
- }
- return false;
-}
-
-//=======================================================================
-//function : IsFather
-//purpose :
-//=======================================================================
-
-bool SALOMEDSImpl_AttributeTreeNode::IsFather (const SALOMEDSImpl_AttributeTreeNode* ofTN) const
-{
- return (ofTN->GetFather() == this);
-}
-
-
-//=======================================================================
-//function : IsChild
-//purpose :
-//=======================================================================
-
-bool SALOMEDSImpl_AttributeTreeNode::IsChild (const SALOMEDSImpl_AttributeTreeNode* ofTN) const
-{
- return (myFather == ofTN);
-}
-
-//=======================================================================
-//TreeNode : IsRoot
-//purpose : Returns Standard_True if the TreeNode is not attached to a
-// TreeNode tree or hasn't an Father.
-//=======================================================================
-bool SALOMEDSImpl_AttributeTreeNode::IsRoot() const
-{
- if (!myFather && !myPrevious && !myNext)
- return true;
- return false;
-}
-
-//=======================================================================
-//TreeNode : Root
-//purpose : Returns the TreeNode which has no Father
-//=======================================================================
-SALOMEDSImpl_AttributeTreeNode* SALOMEDSImpl_AttributeTreeNode::Root() const
-{
- SALOMEDSImpl_AttributeTreeNode* O = (SALOMEDSImpl_AttributeTreeNode*)this;
- while (O && O->HasFather())
- O = O->GetFather();
- return O;
-}
-
-//=======================================================================
-//TreeNode : SetFather
-//purpose : Sets the TreeNode F as Father of me
-//=======================================================================
-void SALOMEDSImpl_AttributeTreeNode::SetFather(const SALOMEDSImpl_AttributeTreeNode* F)
-{
- CheckLocked();
- Backup();
- myFather = (SALOMEDSImpl_AttributeTreeNode*)F;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//TreeNode : SetNext
-//purpose : Sets the TreeNode F next to me
-//=======================================================================
-void SALOMEDSImpl_AttributeTreeNode::SetNext(const SALOMEDSImpl_AttributeTreeNode* F)
-{
- CheckLocked();
- Backup();
- myNext = (SALOMEDSImpl_AttributeTreeNode*)F;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-
-//=======================================================================
-//TreeNode : SetPrevious
-//purpose : Sets the TreeNode F previous to me
-//=======================================================================
-void SALOMEDSImpl_AttributeTreeNode::SetPrevious(const SALOMEDSImpl_AttributeTreeNode* F)
-{
- CheckLocked();
- Backup();
- myPrevious = (SALOMEDSImpl_AttributeTreeNode*)F;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//TreeNode : SetFirst
-//purpose : Sets the TreeNode F as first in the TreeNode tree
-//=======================================================================
-void SALOMEDSImpl_AttributeTreeNode::SetFirst(const SALOMEDSImpl_AttributeTreeNode* F)
-{
- CheckLocked();
- Backup();
- myFirst = (SALOMEDSImpl_AttributeTreeNode*)F;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//TreeNode : AfterAddition
-//purpose : Connects the TreeNode to the tree.
-//=======================================================================
-void SALOMEDSImpl_AttributeTreeNode::AfterAddition()
-{
- if (myPrevious) {
- myPrevious->SetNext(this);
- }
- else if (myFather) {
- myFather->SetFirst(this);
- }
- if (myNext) {
- myNext->SetPrevious(this);
- }
-}
-
-//=======================================================================
-//TreeNode : BeforeForget
-//purpose : Disconnect the TreeNode from the tree.
-//=======================================================================
-void SALOMEDSImpl_AttributeTreeNode::BeforeForget()
-{
- Remove();
- while (HasFirst()) GetFirst()->Remove();
-}
-
-//=======================================================================
-//TreeNode : Restore
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeTreeNode::Restore(DF_Attribute* other)
-{
- SALOMEDSImpl_AttributeTreeNode* F = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(other);
- myFather = F->myFather;
- myPrevious = F->myPrevious;
- myNext = F->myNext;
- myFirst = F->myFirst;
- myTreeID = F->myTreeID;
-}
-
-//=======================================================================
-//TreeNode : Paste
-//purpose : Method for Copy mechanism
-//=======================================================================
-
-void SALOMEDSImpl_AttributeTreeNode::Paste(DF_Attribute* into)
-{
- SALOMEDSImpl_AttributeTreeNode* intof = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(into);
- intof->SetFather(myFather);
- intof->SetNext(myNext);
- intof->SetPrevious(myPrevious);
- intof->SetFirst(myFirst);
- intof->SetTreeID(myTreeID);
-}
-
-//=======================================================================
-//TreeNode : NewEmpty
-//purpose : Returns new empty TreeNode attribute
-//=======================================================================
-
-DF_Attribute* SALOMEDSImpl_AttributeTreeNode::NewEmpty() const
-{
- SALOMEDSImpl_AttributeTreeNode* T = new SALOMEDSImpl_AttributeTreeNode();
- T->SetTreeID(myTreeID);
- return T;
-}
-
-string SALOMEDSImpl_AttributeTreeNode::Type()
-{
- char* aNodeName = new char[127];
- sprintf(aNodeName, "AttributeTreeNodeGUID%s", ID().c_str());
- string ret(aNodeName);
- delete [] aNodeName;
-
- return ret;
-}
-
-string SALOMEDSImpl_AttributeTreeNode::Save()
-{
- string aFather, aPrevious, aNext, aFirst;
-
- if (HasFather()) aFather = GetFather()->Label().Entry(); else aFather = "!";
- if (HasPrevious()) aPrevious = GetPrevious()->Label().Entry(); else aPrevious = "!";
- if (HasNext()) aNext = GetNext()->Label().Entry(); else aNext = "!";
- if (HasFirst()) aFirst = GetFirst()->Label().Entry(); else aFirst = "!";
-
- int aLength = 4;
- aLength += aFather.size() + aPrevious.size() + aNext.size() + aFirst.size();
- char* aResult = new char[aLength];
- sprintf(aResult, "%s %s %s %s", aFather.c_str(), aPrevious.c_str(), aNext.c_str(), aFirst.c_str());
- string ret(aResult);
- delete [] aResult;
- return ret;
-}
-
-void SALOMEDSImpl_AttributeTreeNode::Load(const string& value)
-{
- char* aCopy = (char*)value.c_str();
- char* adr = strtok(aCopy, " ");
-
- DF_Label aLabel;
- SALOMEDSImpl_AttributeTreeNode* aDepNode = NULL;
-
- if (adr && adr[0] != '!') {
- aLabel = DF_Label::Label(Label(), adr, true);
- if (!(aDepNode=(SALOMEDSImpl_AttributeTreeNode*)aLabel.FindAttribute(ID())))
- aDepNode = SALOMEDSImpl_AttributeTreeNode::Set(aLabel, ID());
-
- SetFather(aDepNode);
- }
-
- adr = strtok(NULL, " ");
- if (adr && adr[0] != '!') {
- aLabel = DF_Label::Label(Label(), adr, true);
- if (!(aDepNode=(SALOMEDSImpl_AttributeTreeNode*)aLabel.FindAttribute(ID())))
- aDepNode = SALOMEDSImpl_AttributeTreeNode::Set(aLabel, ID());
- SetPrevious(aDepNode);
- }
-
- adr = strtok(NULL, " ");
- if (adr && adr[0] != '!') {
- aLabel = DF_Label::Label(Label(), adr, true);
- if (!(aDepNode=(SALOMEDSImpl_AttributeTreeNode*)aLabel.FindAttribute(ID())))
- aDepNode = SALOMEDSImpl_AttributeTreeNode::Set(aLabel, ID());
- SetNext(aDepNode);
- }
-
- adr = strtok(NULL, " ");
- if (adr && adr[0] != '!') {
- aLabel = DF_Label::Label(Label(), adr, true);
- if (!(aDepNode=(SALOMEDSImpl_AttributeTreeNode*)aLabel.FindAttribute(ID())))
- aDepNode = SALOMEDSImpl_AttributeTreeNode::Set(aLabel, ID());
- SetFirst(aDepNode);
- }
-}
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeTreeNode.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeTreeNode_HeaderFile
-#define _SALOMEDSImpl_AttributeTreeNode_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTreeNode :
- public SALOMEDSImpl_GenericAttribute
-{
-public:
-
- const static std::string& GetDefaultTreeID();
- static SALOMEDSImpl_AttributeTreeNode* Set(const DF_Label& L, const std::string& ID);
-
- SALOMEDSImpl_AttributeTreeNode();
- void SetFather(const SALOMEDSImpl_AttributeTreeNode* value);
- void SetPrevious(const SALOMEDSImpl_AttributeTreeNode* value);
- void SetNext(const SALOMEDSImpl_AttributeTreeNode* value);
- void SetFirst(const SALOMEDSImpl_AttributeTreeNode* value);
- void SetTreeID(const std::string& value);
-
- bool Append(SALOMEDSImpl_AttributeTreeNode* value);
- bool Prepend(SALOMEDSImpl_AttributeTreeNode* value);
- bool Remove();
- bool InsertBefore(SALOMEDSImpl_AttributeTreeNode* value);
- bool InsertAfter(SALOMEDSImpl_AttributeTreeNode* value);
-
- SALOMEDSImpl_AttributeTreeNode* GetFather() const { return myFather; }
- SALOMEDSImpl_AttributeTreeNode* GetPrevious() const { return myPrevious; }
- SALOMEDSImpl_AttributeTreeNode* GetNext() const { return myNext; }
- SALOMEDSImpl_AttributeTreeNode* GetFirst() const { return myFirst; }
-
- bool HasFather() { return (myFather); }
- bool HasPrevious() { return (myPrevious); }
- bool HasNext() {return (myNext); }
- bool HasFirst() { return (myFirst); }
- const std::string& GetTreeID() { return ID(); }
- int Depth() const;
- bool IsRoot() const ;
- SALOMEDSImpl_AttributeTreeNode* Root() const;
- bool IsAscendant (const SALOMEDSImpl_AttributeTreeNode* ofTN) const;
- bool IsDescendant(const SALOMEDSImpl_AttributeTreeNode* value) const;
- bool IsFather(const SALOMEDSImpl_AttributeTreeNode* value) const;
- bool IsChild(const SALOMEDSImpl_AttributeTreeNode* value) const;
-
- virtual std::string Save();
- virtual void Load(const std::string&);
- virtual std::string Type();
-
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- void Paste(DF_Attribute* into);
- DF_Attribute* NewEmpty() const;
- ~SALOMEDSImpl_AttributeTreeNode() {;}
-
- virtual void AfterAddition();
- virtual void BeforeForget();
-
-private:
-
- std::string myTreeID;
- SALOMEDSImpl_AttributeTreeNode* myFather;
- SALOMEDSImpl_AttributeTreeNode* myPrevious;
- SALOMEDSImpl_AttributeTreeNode* myNext;
- SALOMEDSImpl_AttributeTreeNode* myFirst;
-
- friend class SALOMEDSImpl_ChildNodeIterator;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeUAttribute.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_AttributeUserID.hxx"
-
-using namespace std;
-
-SALOMEDSImpl_AttributeUserID* SALOMEDSImpl_AttributeUserID::Set (const DF_Label& L, const std::string& ID)
-{
- SALOMEDSImpl_AttributeUserID* A = NULL;
- if (!(A=(SALOMEDSImpl_AttributeUserID*)L.FindAttribute(ID))) {
- A = new SALOMEDSImpl_AttributeUserID();
- A->SetValue(ID);
- L.AddAttribute(A);
- }
- return A;
-}
-
-//=======================================================================
-//function : ID
-//purpose :
-//=======================================================================
-const std::string& SALOMEDSImpl_AttributeUserID::ID() const
-{ return myID; }
-
-
-//=======================================================================
-//function : SetValue
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeUserID::SetValue( const std::string& guid)
-{
- CheckLocked();
- if(myID == guid) return;
-
- Backup();
- myID = guid;
-
- SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
-}
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-DF_Attribute* SALOMEDSImpl_AttributeUserID::NewEmpty () const
-{
- SALOMEDSImpl_AttributeUserID* A = new SALOMEDSImpl_AttributeUserID();
- A->SetValue(myID);
- return A;
-}
-
-//=======================================================================
-//function : Restore
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeUserID::Restore(DF_Attribute* with)
-{
- SALOMEDSImpl_AttributeUserID* A = dynamic_cast<SALOMEDSImpl_AttributeUserID*>(with);
- SetValue( A->ID() );
-}
-
-//=======================================================================
-//function : Paste
-//purpose :
-//=======================================================================
-void SALOMEDSImpl_AttributeUserID::Paste (DF_Attribute* into)
-{
- SALOMEDSImpl_AttributeUserID* A = dynamic_cast<SALOMEDSImpl_AttributeUserID*>(into);
- A->SetValue( myID );
-}
-
-string SALOMEDSImpl_AttributeUserID::Type()
-{
-
- char* aUAttrName = new char[127];
- sprintf(aUAttrName, "AttributeUserID_%s",ID().c_str());
-
- string ret(aUAttrName);
- delete aUAttrName;
-
- return ret;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_AttributeUAttribute.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef _SALOMEDSImpl_AttributeUserID_HeaderFile
-#define _SALOMEDSImpl_AttributeUserID_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include <string>
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeUserID :
- public SALOMEDSImpl_GenericAttribute
-{
-private:
- std::string myID;
-
-public:
- SALOMEDSImpl_AttributeUserID():SALOMEDSImpl_GenericAttribute("AttributeUserID") {}
- static SALOMEDSImpl_AttributeUserID* Set (const DF_Label& L, const std::string& ID);
- static const std::string& DefaultID()
- {
- static std::string SALOMEDSImpl_DefaultUserAttributeID ("FFFFFFFF-D9CD-11d6-945D-1050DA506788");
- return SALOMEDSImpl_DefaultUserAttributeID;
- }
-
- const std::string& Value() const { return ID(); }
- void SetValue(const std::string& value);
-
- virtual std::string Type();
-
- const std::string& ID() const;
- void Restore(DF_Attribute* with) ;
- DF_Attribute* NewEmpty() const;
- void Paste(DF_Attribute* into);
- ~SALOMEDSImpl_AttributeUserID() {}
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_Attributes.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSIMPL_ATTRIBUTES__H__
-#define __SALOMEDSIMPL_ATTRIBUTES__H__
-
-#include "SALOMEDSImpl_Defines.hxx"
-
-#include <iostream>
-class SALOMEDSIMPL_EXPORT LockProtection
-{
-public :
- LockProtection(const char *message) {
- std::cerr << message << std::endl;
- }
-};
-
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "SALOMEDSImpl_AttributeName.hxx"
-#include "SALOMEDSImpl_AttributeComment.hxx"
-#include "SALOMEDSImpl_AttributeInteger.hxx"
-#include "SALOMEDSImpl_AttributeReal.hxx"
-#include "SALOMEDSImpl_AttributeTreeNode.hxx"
-#include "SALOMEDSImpl_AttributeUserID.hxx"
-#include "SALOMEDSImpl_AttributeReference.hxx"
-#include "SALOMEDSImpl_AttributeSequenceOfReal.hxx"
-#include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx"
-#include "SALOMEDSImpl_AttributeIOR.hxx"
-#include "SALOMEDSImpl_AttributePersistentRef.hxx"
-#include "SALOMEDSImpl_AttributeDrawable.hxx"
-#include "SALOMEDSImpl_AttributeSelectable.hxx"
-#include "SALOMEDSImpl_AttributeExpandable.hxx"
-#include "SALOMEDSImpl_AttributeOpened.hxx"
-#include "SALOMEDSImpl_AttributeTextColor.hxx"
-#include "SALOMEDSImpl_AttributeTextHighlightColor.hxx"
-#include "SALOMEDSImpl_AttributePixMap.hxx"
-#include "SALOMEDSImpl_AttributeLocalID.hxx"
-#include "SALOMEDSImpl_AttributeTarget.hxx"
-#include "SALOMEDSImpl_AttributeTableOfInteger.hxx"
-#include "SALOMEDSImpl_AttributeTableOfReal.hxx"
-#include "SALOMEDSImpl_AttributeTableOfString.hxx"
-#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
-#include "SALOMEDSImpl_AttributePythonObject.hxx"
-#include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
-#include "SALOMEDSImpl_AttributeFileType.hxx"
-#include "SALOMEDSImpl_AttributeFlags.hxx"
-#include "SALOMEDSImpl_AttributeGraphic.hxx"
-#include "SALOMEDSImpl_AttributeParameter.hxx"
-#include "SALOMEDSImpl_AttributeString.hxx"
-
-
-#define __AttributeTypeToGUIDForSObject \
- if(theType == "AttributeReal") return SALOMEDSImpl_AttributeReal::GetID(); \
- if(theType == "AttributeInteger") return SALOMEDSImpl_AttributeInteger::GetID(); \
- if(theType == "AttributeSequenceOfReal") return SALOMEDSImpl_AttributeSequenceOfReal::GetID(); \
- if(theType == "AttributeSequenceOfInteger") return SALOMEDSImpl_AttributeSequenceOfInteger::GetID(); \
- if(theType == "AttributeName") return SALOMEDSImpl_AttributeName::GetID(); \
- if(theType == "AttributeComment") return SALOMEDSImpl_AttributeComment::GetID(); \
- if(theType == "AttributeIOR") return SALOMEDSImpl_AttributeIOR::GetID(); \
- if(theType == "AttributePersistentRef") return SALOMEDSImpl_AttributePersistentRef::GetID(); \
- if(theType == "AttributeDrawable") return SALOMEDSImpl_AttributeDrawable::GetID(); \
- if(theType == "AttributeSelectable") return SALOMEDSImpl_AttributeSelectable::GetID(); \
- if(theType == "AttributeExpandable") return SALOMEDSImpl_AttributeExpandable::GetID(); \
- if(theType == "AttributeOpened") return SALOMEDSImpl_AttributeOpened::GetID(); \
- if(theType == "AttributeTextColor") return SALOMEDSImpl_AttributeTextColor::GetID(); \
- if(theType == "AttributeTextHighlightColor") return SALOMEDSImpl_AttributeTextHighlightColor::GetID(); \
- if(theType == "AttributePixMap") return SALOMEDSImpl_AttributePixMap::GetID(); \
- if(theType == "AttributeLocalID") return SALOMEDSImpl_AttributeLocalID::GetID(); \
- if(theType == "AttributeTarget") return SALOMEDSImpl_AttributeTarget::GetID(); \
- if(theType == "AttributeTableOfInteger") return SALOMEDSImpl_AttributeTableOfInteger::GetID(); \
- if(theType == "AttributeTableOfReal") return SALOMEDSImpl_AttributeTableOfReal::GetID(); \
- if(theType == "AttributeTableOfString") return SALOMEDSImpl_AttributeTableOfString::GetID(); \
- if(theType == "AttributeStudyProperties") return SALOMEDSImpl_AttributeStudyProperties::GetID(); \
- if(theType == "AttributePythonObject") return SALOMEDSImpl_AttributePythonObject::GetID(); \
- if(theType == "AttributeUserID") return std::string("FFFFFFFF-D9CD-11d6-945D-1050DA506788"); \
- if(theType == "AttributeExternalFileDef") return SALOMEDSImpl_AttributeExternalFileDef::GetID(); \
- if(theType == "AttributeFileType") return SALOMEDSImpl_AttributeFileType::GetID(); \
- if(theType == "AttributeFlags") return SALOMEDSImpl_AttributeFlags::GetID(); \
- if(theType == "AttributeGraphic") return SALOMEDSImpl_AttributeGraphic::GetID(); \
- if(theType == "AttributeReference") return SALOMEDSImpl_AttributeReference::GetID(); \
- if(theType == "AttributeParameter") return SALOMEDSImpl_AttributeParameter::GetID(); \
- if(theType == "AttributeString") return SALOMEDSImpl_AttributeString::GetID();
-
-
-#define __FindOrCreateAttributeLocked(ClassName) if (strcmp(aTypeOfAttribute.c_str(), #ClassName) == 0) { \
- SALOMEDSImpl_##ClassName* anAttr; \
- if (!(anAttr=(SALOMEDSImpl_##ClassName*)Lab.FindAttribute(SALOMEDSImpl_##ClassName::GetID()))) { \
- CheckLocked(); \
- anAttr = new SALOMEDSImpl_##ClassName; \
- Lab.AddAttribute(anAttr); \
- } \
- return anAttr; \
- }
-
-#define __FindOrCreateAttribute(ClassName) if (strcmp(aTypeOfAttribute.c_str(), #ClassName) == 0) { \
- SALOMEDSImpl_##ClassName* anAttr; \
- if (!(anAttr=(SALOMEDSImpl_##ClassName*)Lab.FindAttribute(SALOMEDSImpl_##ClassName::GetID()))) { \
- anAttr = new SALOMEDSImpl_##ClassName; \
- Lab.AddAttribute(anAttr); \
- } \
- return anAttr; \
- }
-
-#define __FindOrCreateAttributeForBuilder \
-__FindOrCreateAttributeLocked(AttributeReal) \
-__FindOrCreateAttributeLocked(AttributeInteger) \
-__FindOrCreateAttributeLocked(AttributeSequenceOfReal) \
-__FindOrCreateAttributeLocked(AttributeSequenceOfInteger) \
-__FindOrCreateAttributeLocked(AttributeName) \
-__FindOrCreateAttributeLocked(AttributeComment) \
-__FindOrCreateAttributeLocked(AttributeIOR) \
-__FindOrCreateAttributeLocked(AttributePixMap) \
-__FindOrCreateAttributeLocked(AttributeLocalID) \
-__FindOrCreateAttributeLocked(AttributeTableOfInteger) \
-__FindOrCreateAttributeLocked(AttributeTableOfReal) \
-__FindOrCreateAttributeLocked(AttributeTableOfString) \
-__FindOrCreateAttributeLocked(AttributePythonObject) \
-__FindOrCreateAttributeLocked(AttributeParameter) \
-__FindOrCreateAttributeLocked(AttributeString) \
-__FindOrCreateAttribute(AttributePersistentRef) \
-__FindOrCreateAttribute(AttributeDrawable) \
-__FindOrCreateAttribute(AttributeSelectable) \
-__FindOrCreateAttribute(AttributeExpandable) \
-__FindOrCreateAttribute(AttributeOpened) \
-__FindOrCreateAttribute(AttributeTextColor) \
-__FindOrCreateAttribute(AttributeTextHighlightColor) \
-__FindOrCreateAttribute(AttributeTarget) \
-__FindOrCreateAttribute(AttributeStudyProperties) \
-__FindOrCreateAttribute(AttributeExternalFileDef) \
-__FindOrCreateAttribute(AttributeFileType) \
-__FindOrCreateAttribute(AttributeFlags) \
-__FindOrCreateAttribute(AttributeGraphic)
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_Callback.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_Callback.hxx"
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_Callback.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSIMPL_CALLBACK_H__
-#define __SALOMEDSIMPL_CALLBACK_H__
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "SALOMEDSImpl_UseCaseBuilder.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Callback
-{
-private:
- SALOMEDSImpl_UseCaseBuilder* _builder;
-
-public:
-
- SALOMEDSImpl_Callback(SALOMEDSImpl_UseCaseBuilder* builder)
- {
- _builder = builder;
- }
-
- virtual void OnAddSObject(const SALOMEDSImpl_SObject& theObject)
- {
- if(_builder != NULL && theObject) _builder->Append(theObject);
- }
-
- virtual void OnRemoveSObject(const SALOMEDSImpl_SObject& theObject)
- {
- if(_builder != NULL && theObject) _builder->Remove(theObject);
- }
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_ChildIterator.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_ChildIterator.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-
-SALOMEDSImpl_ChildIterator::SALOMEDSImpl_ChildIterator(const SALOMEDSImpl_SObject& theSO)
-{
- _so = theSO;
- _it = DF_ChildIterator(_so.GetLabel());
-}
-
-SALOMEDSImpl_ChildIterator::SALOMEDSImpl_ChildIterator(const DF_Label& theLabel)
-{
- _so = SALOMEDSImpl_Study::SObject(theLabel);
- _it = DF_ChildIterator(theLabel);
-}
-
-void SALOMEDSImpl_ChildIterator::Init()
-{
- if(_so) _it.Init(_so.GetLabel(), false);
-}
-
-void SALOMEDSImpl_ChildIterator::Init(const DF_Label& theLabel)
-{
- _it.Init(theLabel, false);
-}
-
-void SALOMEDSImpl_ChildIterator::InitEx(bool theAllLevels)
-{
- if(_so) _it.Init(_so.GetLabel(), theAllLevels);
-}
-
-void SALOMEDSImpl_ChildIterator::InitEx(const DF_Label& theLabel, bool theAllLevels)
-{
- _it.Init(theLabel, theAllLevels);
-}
-
-bool SALOMEDSImpl_ChildIterator::More()
-{
- return _it.More();
-}
-
-void SALOMEDSImpl_ChildIterator::Next()
-{
- _it.Next();
-}
-
-SALOMEDSImpl_SObject SALOMEDSImpl_ChildIterator::Value()
-{
- if(!_so) return SALOMEDSImpl_SObject();
- return SALOMEDSImpl_Study::SObject(_it.Value());
-}
-
-DF_Label SALOMEDSImpl_ChildIterator::Label()
-{
- return _it.Value();
-}
-
-SALOMEDSImpl_ChildIterator* SALOMEDSImpl_ChildIterator::GetPersistentCopy() const
-{
- SALOMEDSImpl_ChildIterator* itr = new SALOMEDSImpl_ChildIterator();
- itr->_it = _it;
- itr->_so = _so;
- return itr;
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_ChildIterator.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSImpl_CHILDITERATOR_H__
-#define __SALOMEDSImpl_CHILDITERATOR_H__
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "DF_ChildIterator.hxx"
-#include "DF_Label.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_ChildIterator
-{
-private:
- DF_ChildIterator _it;
- SALOMEDSImpl_SObject _so;
-
-public:
-
- SALOMEDSImpl_ChildIterator() {}
- SALOMEDSImpl_ChildIterator(const SALOMEDSImpl_SObject& theSO);
- SALOMEDSImpl_ChildIterator(const DF_Label& theLabel);
- ~SALOMEDSImpl_ChildIterator() {};
-
- virtual void Init();
- virtual void Init(const DF_Label& theLabel);
- virtual void InitEx(bool theAllLevels);
- virtual void InitEx(const DF_Label& theLabel, bool theAllLevels);
- virtual bool More();
- virtual void Next();
- virtual SALOMEDSImpl_SObject Value();
- virtual DF_Label Label();
-
- SALOMEDSImpl_ChildIterator* GetPersistentCopy() const;
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File: SALOMEDSImpl_ChildNodeIterator.cxx
-// Created: Wed Jan 26 16:43:08 2000
-// Author: Denis PASCAL
-// <dp@dingox.paris1.matra-dtv.fr>
-//
-#include "SALOMEDSImpl_ChildNodeIterator.hxx"
-
-#define ChildNodeIterator_UpToBrother \
-{ \
- while (myNode && (myNode->Depth() > myFirstLevel) && myNode->myNext == NULL) \
- myNode = myNode->myFather; \
- if (myNode && (myNode->Depth() > myFirstLevel) && myNode->myFather != NULL) \
- myNode = myNode->myNext; \
- else \
- myNode = NULL; \
-}
-
-//=======================================================================
-//function : SALOMEDSImpl_ChildNodeIterator
-//purpose :
-//=======================================================================
-SALOMEDSImpl_ChildNodeIterator::SALOMEDSImpl_ChildNodeIterator()
- : myFirstLevel(0)
-{}
-
-//=======================================================================
-//function : SALOMEDSImpl_ChildNodeIterator
-//purpose :
-//=======================================================================
-
-SALOMEDSImpl_ChildNodeIterator::SALOMEDSImpl_ChildNodeIterator (const SALOMEDSImpl_AttributeTreeNode* aNode,
- const bool allLevels)
-: myNode(aNode->myFirst),
- myFirstLevel(allLevels ? aNode->Depth() : -1)
-{}
-
-//=======================================================================
-//function : Initialize
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_ChildNodeIterator::Initialize(const SALOMEDSImpl_AttributeTreeNode* aNode,
- const bool allLevels)
-{
- myNode = aNode->myFirst;
- myFirstLevel = allLevels ? aNode->Depth() : -1;
-}
-
-//=======================================================================
-//function : Next
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_ChildNodeIterator::Next()
-{
- if (myFirstLevel == -1) {
- myNode = myNode->myNext;
- }
- else {
- if (myNode->myFirst != NULL) myNode = myNode->myFirst;
- else ChildNodeIterator_UpToBrother;
- }
-}
-
-//=======================================================================
-//function : NextBrother
-//purpose :
-//=======================================================================
-
-void SALOMEDSImpl_ChildNodeIterator::NextBrother()
-{
- if (myNode->myNext != NULL) myNode = myNode->myNext;
- else ChildNodeIterator_UpToBrother;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef _SALOMEDSImpl_ChildNodeIterator_HeaderFile
-#define _SALOMEDSImpl_ChildNodeIterator_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "SALOMEDSImpl_AttributeTreeNode.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_ChildNodeIterator
-{
-
-public:
-
- SALOMEDSImpl_ChildNodeIterator();
- SALOMEDSImpl_ChildNodeIterator(const SALOMEDSImpl_AttributeTreeNode* aTreeNode,
- const bool allLevels = false);
- void Initialize(const SALOMEDSImpl_AttributeTreeNode* aTreeNode,
- const bool allLevels = false) ;
- bool More() const { return (myNode); }
- void Next() ;
- void NextBrother() ;
- SALOMEDSImpl_AttributeTreeNode* Value() const { return myNode; }
-
-private:
-
- SALOMEDSImpl_AttributeTreeNode* myNode;
- int myFirstLevel;
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_Defines.hxx
-// Author : Alexander A. BORODIN
-// Module : KERNEL
-//
-#ifndef _SALOMEDSImpl_Defines_HXX_
-#define _SALOMEDSImpl_Defines_HXX_
-
-#ifdef WIN32
-# if defined SALOMEDSIMPL_EXPORTS || defined SalomeDSImpl_EXPORTS
-# define SALOMEDSIMPL_EXPORT __declspec( dllexport )
-# else
-# define SALOMEDSIMPL_EXPORT __declspec( dllimport )
-# endif
-#else
-# define SALOMEDSIMPL_EXPORT
-#endif
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef __SALOMEDSIMPL_DRIVER_H__
-#define __SALOMEDSIMPL_DRIVER_H__
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include <string>
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_TMPFile.hxx"
-
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Driver
-{
-public:
-
- virtual std::string GetIOR() = 0;
-
- virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent,
- const std::string& theURL,
- long& theStreamLength,
- bool isMultiFile) = 0;
-
- virtual SALOMEDSImpl_TMPFile* SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
- const std::string& theURL,
- long& theStreamLength,
- bool isMultiFile) = 0;
-
- virtual bool Load(const SALOMEDSImpl_SComponent& theComponent,
- const unsigned char* theStream,
- const long theStreamLength,
- const std::string& theURL,
- bool isMultiFile) = 0;
-
- virtual bool LoadASCII(const SALOMEDSImpl_SComponent& theComponent,
- const unsigned char* theStream,
- const long theStreamLength,
- const std::string& theURL,
- bool isMultiFile) = 0;
-
- virtual void Close(const SALOMEDSImpl_SComponent& theComponent) = 0;
-
- virtual std::string ComponentDataType() = 0;
-
-
- virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
- const std::string& IORString,
- bool isMultiFile,
- bool isASCII) = 0;
-
- virtual std::string LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theSObject,
- const std::string& aLocalPersistentID,
- bool isMultiFile,
- bool isASCII) = 0;
-
- virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject) = 0;
-
- virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& theObject,
- int& theObjectID,
- long& theStreamLength) = 0;
-
- virtual bool CanPaste(const std::string& theComponentName, int theObjectID) = 0;
-
- virtual std::string PasteInto(const unsigned char* theStream,
- const long theStreamLength,
- int theObjectID,
- const SALOMEDSImpl_SObject& theObject) = 0;
-
- virtual SALOMEDSImpl_TMPFile* DumpPython(SALOMEDSImpl_Study* theStudy,
- bool isPublished,
- bool& isValidScript,
- long& theStreamLength) = 0;
-};
-
-class SALOMEDSImpl_DriverFactory
-{
-public:
-
- virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType) = 0;
-
- virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR) = 0;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_GenericAttribute.hxx
-// Author : SERGEY_RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_Attributes.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-#include "SALOMEDSImpl_StudyBuilder.hxx"
-
-using namespace std;
-
-string SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr)
-{
- SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);
- if (ga)
- return ga->Type();
-
- return "";
-}
-
-string SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr)
-{
- SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);
- if (ga)
- return ga->GetClassType();
-
- return "";
-}
-
-void SALOMEDSImpl_GenericAttribute::Impl_CheckLocked(DF_Attribute* theAttr)
-{
- SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);
- ga->CheckLocked();
-}
-
-string SALOMEDSImpl_GenericAttribute::Type()
-{
- return _type;
-}
-
-
-void SALOMEDSImpl_GenericAttribute::CheckLocked()
-{
- DF_Label aLabel = Label();
- if(aLabel.IsNull()) return;
-
- SALOMEDSImpl_Study* aStudy = SALOMEDSImpl_Study::GetStudy(aLabel);
- if(!aStudy) return;
- if(aStudy->IsLocked()) {
- aStudy->_errorCode = "LockProtection";
- throw LockProtection("LockProtection");
- }
-}
-
-SALOMEDSImpl_SObject SALOMEDSImpl_GenericAttribute::GetSObject()
-{
- SALOMEDSImpl_SObject so;
- DF_Label aLabel = Label();
- if(aLabel.IsNull()) return so;
- return SALOMEDSImpl_Study::SObject(aLabel);
-}
-
-void SALOMEDSImpl_GenericAttribute::SetModifyFlag()
-{
- DF_Label aLabel = Label();
- if(aLabel.IsNull()) return;
-
- SALOMEDSImpl_Study* aStudy = SALOMEDSImpl_Study::GetStudy(aLabel);
- if(aStudy) aStudy->Modify();
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_GenericAttribute.hxx
-// Author : SERGEY_RUIN
-// Module : SALOME
-//
-#ifndef _GENERICIMPL_ATTRIBUTE_HXX_
-#define _GENERICIMPL_ATTRIBUTE_HXX_
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Label.hxx"
-#include "DF_Attribute.hxx"
-#include <string>
-
-#include "SALOMEDSImpl_SObject.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_GenericAttribute:
- public DF_Attribute
-{
-protected:
-
- std::string _type; //This field must be filled in each attribute that inherits from this class.
-
-public:
-
- SALOMEDSImpl_GenericAttribute(const std::string& theType)
- :_type(theType)
- {}
-
- virtual std::string Type();
- virtual void CheckLocked();
- std::string GetClassType() { return _type; }
- SALOMEDSImpl_SObject GetSObject();
- void SetModifyFlag();
-
- static std::string Impl_GetType(DF_Attribute* theAttr);
- static std::string Impl_GetClassType(DF_Attribute* theAttr);
- static void Impl_CheckLocked(DF_Attribute* theAttr);
-
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_GenericVariable.cxx
-// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
-// Module : SALOME
-
-#include "SALOMEDSImpl_GenericVariable.hxx"
-#include "SALOMEDSImpl_Attributes.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-
-#include <string>
-
-
-using namespace std;
-
-//============================================================================
-/*! Function : SALOMEDSImpl_GenericVariable
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_GenericVariable::
-SALOMEDSImpl_GenericVariable(SALOMEDSImpl_GenericVariable::VariableTypes theType,
- const string& theName):
- _type(theType),
- _name(theName)
-{}
-
-//============================================================================
-/*! Function : ~SALOMEDSImpl_GenericVariable
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_GenericVariable::~SALOMEDSImpl_GenericVariable()
-{}
-
-//============================================================================
-/*! Function : Type
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_GenericVariable::VariableTypes SALOMEDSImpl_GenericVariable::Type() const
-{
- return _type;
-}
-
-//============================================================================
-/*! Function : Name
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_GenericVariable::Name() const
-{
- return _name;
-}
-
-//============================================================================
-/*! Function : setType
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_GenericVariable::setType(const SALOMEDSImpl_GenericVariable::VariableTypes theType)
-{
- if(_type == theType)
- return false;
-
- _type = theType;
- return true;
-}
-
-//============================================================================
-/*! Function : setName
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_GenericVariable::setName(const std::string& theName)
-{
- if(_name.compare(theName) == 0)
- return false;
-
- _name = theName;
- return true;
-}
-
-//============================================================================
-/*! Function : String2VariableType
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_GenericVariable::VariableTypes SALOMEDSImpl_GenericVariable::String2VariableType(const string& theStrType)
-{
- return(SALOMEDSImpl_GenericVariable::VariableTypes)atoi((char*)theStrType.c_str());
-}
-
-//============================================================================
-/*! Function : Save
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_GenericVariable::Save() const
-{
- return string();
-}
-
-
-//============================================================================
-/*! Function : SaveToScript
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_GenericVariable::SaveToScript() const
-{
- return string();
-}
-//============================================================================
-/*! Function : SaveType
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_GenericVariable::SaveType() const
-{
- return string();
-}
-
-//============================================================================
-/*! Function : Load
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_GenericVariable::Load(const string& theStrValue)
-{
-}
+++ /dev/null
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_GenericVariable.hxx
-// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
-// Module : SALOME
-
-#ifndef _GENERICIMPL_VARIABLE_HXX_
-#define _GENERICIMPL_VARIABLE_HXX_
-
-#include "SALOMEDSImpl_Defines.hxx"
-
-#include <string>
-
-//This is base class for all variable of the Salome notebook
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_GenericVariable
-{
- public:
-
- //Supported types of the nootebook variables
- enum VariableTypes{REAL_VAR, INTEGER_VAR, BOOLEAN_VAR};
-
- SALOMEDSImpl_GenericVariable(VariableTypes theType, const std::string& theName);
- ~SALOMEDSImpl_GenericVariable();
-
- VariableTypes Type() const;
-
- std::string Name() const;
-
- static VariableTypes String2VariableType(const std::string& theStrType);
-
- bool setType(const VariableTypes theType);
-
- bool setName(const std::string& theName);
-
- virtual std::string Save() const;
- virtual std::string SaveToScript() const;
- virtual std::string SaveType() const;
-
- virtual void Load(const std::string& theStrValue);
-
- private:
- VariableTypes _type;
- std::string _name;
-};
-
-#endif //_GENERICIMPL_VARIABLE_HXX_
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "SALOMEDSImpl_IParameters.hxx"
-#include <utilities.h>
-
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_ChildIterator.hxx"
-
-using namespace std;
-
-#define _AP_LISTS_LIST_ "AP_LISTS_LIST"
-#define _AP_ENTRIES_LIST_ "AP_ENTRIES_LIST"
-#define _AP_PROPERTIES_LIST_ "AP_PROPERTIES_LIST"
-#define _AP_DUMP_PYTHON_ "AP_DUMP_PYTHON"
-
-/*!
- Constructor
-*/
-SALOMEDSImpl_IParameters::SALOMEDSImpl_IParameters(SALOMEDSImpl_AttributeParameter* ap)
-{
- if(!ap) return;
- _ap = ap;
- SALOMEDSImpl_SObject so = _ap->GetSObject();
- _study = so.GetStudy();
-}
-
-SALOMEDSImpl_IParameters::~SALOMEDSImpl_IParameters()
-{
- _compNames.clear();
-}
-
-int SALOMEDSImpl_IParameters::append(const string& listName, const string& value)
-{
- if(!_ap) return -1;
- vector<string> v;
- if(!_ap->IsSet(listName, PT_STRARRAY)) {
- if(!_ap->IsSet(_AP_LISTS_LIST_, PT_STRARRAY)) _ap->SetStrArray(_AP_LISTS_LIST_, v);
- if(listName != _AP_ENTRIES_LIST_ &&
- listName != _AP_PROPERTIES_LIST_) {
- append(_AP_LISTS_LIST_, listName);
- }
- _ap->SetStrArray(listName, v);
- }
- v = _ap->GetStrArray(listName);
- v.push_back(value);
- _ap->SetStrArray(listName, v);
- return (v.size()-1);
-}
-
-int SALOMEDSImpl_IParameters::nbValues(const string& listName)
-{
- if(!_ap) return -1;
- if(!_ap->IsSet(listName, PT_STRARRAY)) return 0;
- vector<string> v = _ap->GetStrArray(listName);
- return v.size();
-}
-
-vector<string> SALOMEDSImpl_IParameters::getValues(const string& listName)
-{
- vector<string> v;
- if(!_ap) return v;
- if(!_ap->IsSet(listName, PT_STRARRAY)) return v;
- return _ap->GetStrArray(listName);
-}
-
-
-string SALOMEDSImpl_IParameters::getValue(const string& listName, int index)
-{
- if(!_ap) return "";
- if(!_ap->IsSet(listName, PT_STRARRAY)) return "";
- vector<string> v = _ap->GetStrArray(listName);
- if(index >= v.size()) return "";
- return v[index];
-}
-
-vector<string> SALOMEDSImpl_IParameters::getLists()
-{
- vector<string> v;
- if(!_ap->IsSet(_AP_LISTS_LIST_, PT_STRARRAY)) return v;
- return _ap->GetStrArray(_AP_LISTS_LIST_);
-}
-
-void SALOMEDSImpl_IParameters::setParameter(const string& entry, const string& parameterName, const string& value)
-{
- if(!_ap) return;
- vector<string> v;
- if(!_ap->IsSet(entry, PT_STRARRAY)) {
- append(_AP_ENTRIES_LIST_, entry); //Add the entry to the internal list of entries
- _ap->SetStrArray(entry, v);
- }
- v = _ap->GetStrArray(entry);
- v.push_back(parameterName);
- v.push_back(value);
- _ap->SetStrArray(entry, v);
-}
-
-
-string SALOMEDSImpl_IParameters::getParameter(const string& entry, const string& parameterName)
-{
- if(!_ap) return "";
- if(!_ap->IsSet(entry, PT_STRARRAY)) return "";
- vector<string> v = _ap->GetStrArray(entry);
- int length = v.size();
- for(int i = 0; i<length; i+=1) {
- if(v[i] == parameterName) return v[i+1];
- }
- return "";
-}
-
-
-vector<string> SALOMEDSImpl_IParameters::getAllParameterNames(const string& entry)
-{
- vector<string> v, names;
- if(!_ap) return v;
- if(!_ap->IsSet(entry, PT_STRARRAY)) return v;
- v = _ap->GetStrArray(entry);
- int length = v.size();
- for(int i = 0; i<length; i+=2) {
- names.push_back(v[i]);
- }
- return names;
-}
-
-vector<string> SALOMEDSImpl_IParameters::getAllParameterValues(const string& entry)
-{
- vector<string> v, values;
- if(!_ap) return v;
- if(!_ap->IsSet(entry, PT_STRARRAY)) return v;
- v = _ap->GetStrArray(entry);
- int length = v.size();
- for(int i = 1; i<length; i+=2) {
- values.push_back(v[i]);
- }
- return values;
-}
-
-int SALOMEDSImpl_IParameters::getNbParameters(const string& entry)
-{
- if(!_ap) return -1;
- if(!_ap->IsSet(entry, PT_STRARRAY)) return -1;
- return _ap->GetStrArray(entry).size()/2;
-}
-
-vector<string> SALOMEDSImpl_IParameters::getEntries()
-{
- vector<string> v;
- if(!_ap) return v;
- if(!_ap->IsSet(_AP_ENTRIES_LIST_, PT_STRARRAY)) return v;
- return _ap->GetStrArray(_AP_ENTRIES_LIST_);
-}
-
-void SALOMEDSImpl_IParameters::setProperty(const string& name, const std::string& value)
-{
- if(!_ap) return;
- if(!_ap->IsSet(name, PT_STRING)) {
- append(_AP_PROPERTIES_LIST_, name); //Add the property to the internal list of properties
- }
- _ap->SetString(name, value);
-}
-
-string SALOMEDSImpl_IParameters::getProperty(const string& name)
-{
- if(!_ap) return "";
- if(!_ap->IsSet(name, PT_STRING)) return "";
- return _ap->GetString(name);
-}
-
-vector<string> SALOMEDSImpl_IParameters::getProperties()
-{
- vector<string> v;
- if(!_ap) return v;
- if(!_ap->IsSet(_AP_PROPERTIES_LIST_, PT_STRARRAY)) return v;
- return _ap->GetStrArray(_AP_PROPERTIES_LIST_);
-}
-
-string SALOMEDSImpl_IParameters::decodeEntry(const string& entry)
-{
- if(!_study) return entry;
- int pos = entry.rfind("_");
- if(pos < 0 || pos >= entry.size()) return entry;
-
- string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1);
-
- if(_compNames.find(compName) == _compNames.end()) {
- SALOMEDSImpl_SObject so = _study->FindComponent(compName);
- if(!so) return entry;
- compID = so.GetID();
- _compNames[compName] = compID;
- }
- else compID = _compNames[compName];
-
- string newEntry(compID);
- newEntry += (":"+tail);
-
- return newEntry;
-}
-
-
-bool SALOMEDSImpl_IParameters::isDumpPython(SALOMEDSImpl_Study* study, const string& theID)
-{
- string anID;
- if(theID == "") anID = getDefaultVisualComponent();
- else anID = theID;
-
- SALOMEDSImpl_AttributeParameter* ap = study->GetCommonParameters((char*)anID.c_str(), 0);
- if(!ap) return false;
- if(!ap->IsSet(_AP_DUMP_PYTHON_, PT_BOOLEAN)) return false;
- return (bool)ap->GetBool(_AP_DUMP_PYTHON_);
-}
-
-
-int SALOMEDSImpl_IParameters::getLastSavePoint(SALOMEDSImpl_Study* study, const string& theID)
-{
- string anID;
- if(theID == "") anID = getDefaultVisualComponent();
- else anID = theID;
-
-
- SALOMEDSImpl_SObject so = study->FindComponent(anID);
- if(!so) return -1;
-
- SALOMEDSImpl_StudyBuilder* builder = study->NewBuilder();
- SALOMEDSImpl_ChildIterator anIter = study->NewChildIterator( so );
- int tag = -1;
- for(; anIter.More(); anIter.Next())
- {
- SALOMEDSImpl_SObject val( anIter.Value() );
- DF_Attribute* genAttr;
- if(builder->FindAttribute(val, genAttr, "AttributeParameter")) tag = val.Tag();
- }
-
- return tag;
-}
-
-
-
-string SALOMEDSImpl_IParameters::getStudyScript(SALOMEDSImpl_Study* study, int savePoint, const std::string& theID)
-{
- string anID;
- if(theID == "") anID = getDefaultVisualComponent();
- else anID = theID;
-
- SALOMEDSImpl_AttributeParameter* ap = study->GetCommonParameters((char*)anID.c_str(), savePoint);
- SALOMEDSImpl_IParameters ip(ap);
-
- string dump("");
-
- dump += "import iparameters\n";
- dump += "ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters(\""+anID+"\", 1))\n\n";
-
-
- vector<string> v = ip.getProperties();
- if(v.size() > 0) {
- dump += "#Set up visual properties:\n";
- for(int i = 0; i<v.size(); i++) {
- string prp = ip.getProperty(v[i]);
- dump += "ipar.setProperty(\""+v[i]+"\", \""+prp+"\")\n";
- }
- }
-
- v = ip.getLists();
- if(v.size() > 0) {
- dump += "#Set up lists:\n";
- for(int i = 0; i<v.size(); i++) {
- vector<string> lst = ip.getValues(v[i]);
- dump += "# fill list "+v[i]+"\n";
- for(int j = 0; j < lst.size(); j++) {
- printf("### %s \nFind : %i\n",lst[j].c_str(), lst[j].find('\"'));
- if (lst[j].find('\"') == -1)
- dump += "ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n";
- else
- dump += "ipar.append(\""+v[i]+"\", \"\"\""+lst[j]+"\"\"\")\n";
- }
- }
- }
-
- return dump;
-}
-
-string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study,
- const string& moduleName,
- const string& shift,
- const string& theID)
-{
- string anID;
- if(theID == "") anID = getDefaultVisualComponent();
- else anID = theID;
-
- string dump("");
-
- int savePoint = SALOMEDSImpl_IParameters::getLastSavePoint(study, anID);
- if(savePoint < 0) return dump;
- SALOMEDSImpl_IParameters ip = SALOMEDSImpl_IParameters(study->GetCommonParameters(anID.c_str(), savePoint));
- if(!isDumpPython(study)) return dump;
-
- SALOMEDSImpl_AttributeParameter* ap = study->GetModuleParameters(anID.c_str(), moduleName.c_str(), savePoint);
- ip = SALOMEDSImpl_IParameters(ap);
-
-
- dump += shift +"import iparameters\n";
- dump += shift + "ipar = iparameters.IParameters(theStudy.GetModuleParameters(\""+anID+"\", \""+moduleName+"\", 1))\n\n";
-
- vector<string> v = ip.getProperties();
- if(v.size() > 0) {
- dump += shift +"#Set up visual properties:\n";
- for(int i = 0; i<v.size(); i++) {
- string prp = ip.getProperty(v[i]);
- dump += shift +"ipar.setProperty(\""+v[i]+"\", \""+prp+"\")\n";
- }
- }
-
- v = ip.getLists();
- if(v.size() > 0) {
- dump += shift +"#Set up lists:\n";
- for(int i = 0; i<v.size(); i++) {
- vector<string> lst = ip.getValues(v[i]);
- dump += shift +"# fill list "+v[i]+"\n";
- for(int j = 0; j < lst.size(); j++)
- dump += shift +"ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n";
- }
- }
-
- v = ip.getEntries();
- if(v.size() > 0) {
- dump += shift + "#Set up entries:\n";
- for(int i = 0; i<v.size(); i++) {
- vector<string> names = ip.getAllParameterNames(v[i]);
- vector<string> values = ip.getAllParameterValues(v[i]);
- string decodedEntry = ip.decodeEntry(v[i]);
- SALOMEDSImpl_SObject so = study->FindObjectID(decodedEntry);
- string so_name("");
- if(so) so_name = so.GetName();
- dump += shift + "# set up entry " + v[i] +" ("+so_name+")" + " parameters" + "\n";
- for(int j = 0; j < names.size() && j < values.size(); j++)
- dump += shift + "ipar.setParameter(\"" + v[i] + "\", \"" + names[j] + "\", \"" + values[j] + "\")\n";
- }
- }
-
- return dump;
-}
-
-
-string SALOMEDSImpl_IParameters::getDefaultVisualComponent()
-{
- return "Interface Applicative";
-}
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef SALOMEDSImpl_IParameters_H
-#define SALOMEDSImpl_IParameters_H
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include <string>
-#include <vector>
-#include <map>
-
-#include "SALOMEDSImpl_AttributeParameter.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-
-/*!
-Class which an interface to store the parameters of the objects
-*/
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_IParameters
-{
-public:
- SALOMEDSImpl_IParameters(SALOMEDSImpl_AttributeParameter* ap);
-
- virtual ~SALOMEDSImpl_IParameters();
-
- /*!
- Appends a string value to a named list.
- Returns a number of the added value.
- Note: the name of the list MUST be unique
- */
- virtual int append(const std::string& listName, const std::string& value);
-
- /*!
- Returns a number elements in the list
- */
- virtual int nbValues(const std::string& listName);
-
- /*!
- Returns a list of values in the list
- */
- virtual std::vector<std::string> getValues(const std::string& listName);
-
- /*!
- Returns a value with given %index, where %index is in range [0:nbValues-1]
- */
- virtual std::string getValue(const std::string& listName, int index);
-
- /*!
- Returns a list all entries lists
- */
- virtual std::vector<std::string> getLists();
-
- /*!
- Sets a new named parameter value for the given entry
- */
- virtual void setParameter(const std::string& entry, const std::string& parameterName, const std::string& value);
-
- /*!
- Gets a named parameter value for the given entry
- */
- virtual std::string getParameter(const std::string& entry, const std::string& parameterName);
-
- /*!
- Returns all parameter names of the given entry
- */
- virtual std::vector<std::string> getAllParameterNames(const std::string& entry);
-
- /*!
- Returns all parameter values of the given entry
- */
- virtual std::vector<std::string> getAllParameterValues(const std::string& entry);
-
- /*!
- Returns a number of parameters of the given entry
- */
- virtual int getNbParameters(const std::string& entry);
-
- /*!
- Returns a list all entries
- */
- virtual std::vector<std::string> getEntries();
-
- /*!
- Sets a global named property value
- */
- virtual void setProperty(const std::string& name, const std::string& value);
-
- /*!
- Gets a value of global named property
- */
- virtual std::string getProperty(const std::string& name);
-
- /*!
- Returns a list all properties
- */
- virtual std::vector<std::string> getProperties();
-
- /*!
- Returns decoded entry that is an absolute entry
- */
- virtual std::string decodeEntry(const std::string& entry);
-
-
- /*!
- Returns whether there is the dumping visual parameters
- */
- static bool isDumpPython(SALOMEDSImpl_Study* study, const std::string& theID = "");
-
- /*!
- Returns an ID of the last save point
- */
- static int getLastSavePoint(SALOMEDSImpl_Study* study, const std::string& theID = "");
-
- /*!
- Returns a Python script for the study, which sets up visual parameters
- */
- static std::string getStudyScript(SALOMEDSImpl_Study* study, int savePoint, const std::string& theID = "");
-
- /*!
- Returns a default Python script that set ups visual parameters for the given module
- shift is a string that contain spaces to make valid Python script indentaion
- */
- static std::string getDefaultScript(SALOMEDSImpl_Study* study,
- const std::string& moduleName,
- const std::string& shift,
- const std::string& theID = "");
-
- /*!
- Returns a default name of the component where the visula parameters are stored.
- */
- static std::string getDefaultVisualComponent();
-
-private:
- SALOMEDSImpl_AttributeParameter* _ap;
- SALOMEDSImpl_Study* _study;
- std::map<std::string, std::string> _compNames;
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_SComponent.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_AttributeComment.hxx"
-#include "SALOMEDSImpl_AttributeIOR.hxx"
-
-using namespace std;
-
-//============================================================================
-/*! Function : Empty constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SComponent::SALOMEDSImpl_SComponent()
-{
-}
-
-//============================================================================
-/*! Function : Copy constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SComponent::SALOMEDSImpl_SComponent(const SALOMEDSImpl_SComponent& theSCO)
-{
- _lab = theSCO._lab;
- _value = theSCO._value;
- _type = theSCO._type;
- _name = theSCO._name;
-}
-
-//============================================================================
-/*! Function : constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SComponent::SALOMEDSImpl_SComponent(const DF_Label& theLabel)
- :SALOMEDSImpl_SObject(theLabel)
-{
-}
-
-//============================================================================
-/*! Function : destructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SComponent::~SALOMEDSImpl_SComponent()
-{
-}
-
-
-//============================================================================
-/*! Function : ComponentDataType
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_SComponent::ComponentDataType()
-{
- string res = "";
- SALOMEDSImpl_AttributeComment* type;
- if ( (type = (SALOMEDSImpl_AttributeComment*)_lab.FindAttribute(SALOMEDSImpl_AttributeComment::GetID())) ) {
- res = type->Value();
- }
-
- return res;
-}
-
-
-//============================================================================
-/*! Function : ComponentIOR
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_SComponent::ComponentIOR(string& IOR)
-{
- SALOMEDSImpl_AttributeIOR* ior;
- if (!(ior = (SALOMEDSImpl_AttributeIOR*)_lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID())) )
- return false;
- IOR = ior->Value();
- return true;
-}
-
-
-//============================================================================
-/*! Function : IsA
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_SComponent::IsA(const DF_Label& theLabel)
-{
- // scomponent must contain comment and belong to the 2th depth label
- if ( theLabel.IsAttribute(SALOMEDSImpl_AttributeComment::GetID()) && theLabel.Depth() == 2) {
- return true;
- }
- return false;
-}
-
-//============================================================================
-/*! Function : GetPersistentCopy
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SComponent* SALOMEDSImpl_SComponent::GetPersistentCopy() const
-{
- SALOMEDSImpl_SComponent* sco = new SALOMEDSImpl_SComponent;
- sco->_lab = _lab;
- sco->_name = _name;
- sco->_type = _type;
- sco->_value = _value;
- return sco;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_SComponent.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSIMPL_SCOMPONENT_H__
-#define __SALOMEDSIMPL_SCOMPONENT_H__
-
-//SALOMEDSImpl headers
-#include "SALOMEDSImpl_Defines.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-
-// std C++ headers
-#include <iostream>
-#include <string>
-
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include <stdio.h>
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_SComponent :
- public virtual SALOMEDSImpl_SObject
-{
-public:
-
- SALOMEDSImpl_SComponent();
- SALOMEDSImpl_SComponent(const SALOMEDSImpl_SComponent& theSCO);
- SALOMEDSImpl_SComponent(const DF_Label& lab);
-
- ~SALOMEDSImpl_SComponent();
-
- virtual std::string ComponentDataType();
- virtual bool ComponentIOR(std::string& theID);
-
- static bool IsA(const DF_Label& theLabel);
-
- SALOMEDSImpl_SComponent* GetPersistentCopy() const;
-
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_SComponentIterator.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_SComponentIterator.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-
-using namespace std;
-
-//============================================================================
-/*! Function : constructor
- *
- */
-//============================================================================
-
-SALOMEDSImpl_SComponentIterator::SALOMEDSImpl_SComponentIterator(DF_Document* theDocument)
-{
- _lab = theDocument->Main();
- _it.Init (_lab);
-}
-
-//============================================================================
-/*! Function : Init
- *
- */
-//============================================================================
-void SALOMEDSImpl_SComponentIterator::Init()
-{
- _it.Init (_lab);
-}
-
-//============================================================================
-/*! Function : More
- *
- */
-//============================================================================
-bool SALOMEDSImpl_SComponentIterator::More()
-{
- if (!_it.More())
- return false;
- DF_Label L = _it.Value();
- return SALOMEDSImpl_SComponent::IsA(L);
-}
-
-//============================================================================
-/*! Function : Next
- */
-//============================================================================
-void SALOMEDSImpl_SComponentIterator::Next()
-{
- _it.Next();
-}
-
-
-//============================================================================
-/*! Function : Value
- *
- */
-//============================================================================
-SALOMEDSImpl_SComponent SALOMEDSImpl_SComponentIterator::Value()
-{
- return SALOMEDSImpl_Study::SComponent(_it.Value());
-}
-
-//============================================================================
-/*! Function : GetPersistentCopy
- */
-//============================================================================
-SALOMEDSImpl_SComponentIterator* SALOMEDSImpl_SComponentIterator::GetPersistentCopy() const
-{
- SALOMEDSImpl_SComponentIterator* itr = new SALOMEDSImpl_SComponentIterator();
- itr->_lab = _lab;
- itr->_it = _it;
-
- return itr;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_SComponentIterator_i.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSIMPL_SCOMPONENTITERATOR_H__
-#define __SALOMEDSIMPL_SCOMPONENTITERATOR_H__
-
-
-//SALOMEDSImpl headers
-#include "SALOMEDSImpl_Defines.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-
-#include "DF_ChildIterator.hxx"
-#include "DF_Label.hxx"
-#include "DF_Document.hxx"
-#include <stdio.h>
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_SComponentIterator
-{
-private:
-
- DF_ChildIterator _it;
- DF_Label _lab;
-
-public:
-
- SALOMEDSImpl_SComponentIterator(const SALOMEDSImpl_SComponentIterator& theIterator)
- {
- _it = theIterator._it;
- _lab = theIterator._lab;
- }
-
- SALOMEDSImpl_SComponentIterator() {};
-
- SALOMEDSImpl_SComponentIterator(DF_Document* theDocument);
-
- ~SALOMEDSImpl_SComponentIterator() {};
-
- virtual void Init();
- virtual bool More();
- virtual void Next();
- virtual SALOMEDSImpl_SComponent Value();
-
- SALOMEDSImpl_SComponentIterator* GetPersistentCopy() const;
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDSImpl_SObject.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_Attributes.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-
-using namespace std;
-
-#include <map>
-#include <string.h>
-
-//============================================================================
-/*! Function : empty constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SObject::SALOMEDSImpl_SObject()
-{
-}
-
-//============================================================================
-/*! Function : copy constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SObject::SALOMEDSImpl_SObject(const SALOMEDSImpl_SObject& theSObject)
-{
- _lab = theSObject._lab;
- _value = theSObject._value;
- _type = theSObject._type;
- _name = theSObject._name;
-
-}
-
-
-//============================================================================
-/*! Function : constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SObject::SALOMEDSImpl_SObject(const DF_Label& theLabel)
- :_lab(theLabel)
-{
- _value = "";
- _type = "";
- _name = "";
-}
-
-//============================================================================
-/*! Function : Desctructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SObject::~SALOMEDSImpl_SObject()
-{
-}
-
-//============================================================================
-/*! Function : GetID
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_SObject::GetID() const
-{
- return _lab.Entry();
-}
-
-//============================================================================
-/*! Function : GetFatherComponent
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SComponent SALOMEDSImpl_SObject::GetFatherComponent() const
-{
- SALOMEDSImpl_SComponent sco;
- DF_Label LF = _lab;
- while (!SALOMEDSImpl_SComponent::IsA(LF) && !LF.IsRoot()) {
- LF = LF.Father();
- }
-
- if(LF.IsRoot()) return sco;
-
- return GetStudy()->GetSComponent(LF);
-}
-
-//============================================================================
-/*! Function : GetFather
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_SObject::GetFather() const
-{
- return GetStudy()->GetSObject(_lab.Father());
-}
-
-
-//============================================================================
-/*! Function : GetStudy
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_Study* SALOMEDSImpl_SObject::GetStudy() const
-{
- return SALOMEDSImpl_Study::GetStudy(_lab);
-}
-
-//============================================================================
-/*! Function : FindAttribute
- * Purpose : Find attribute of given type on this SObject
- */
-//============================================================================
-bool SALOMEDSImpl_SObject::FindAttribute(DF_Attribute*& theAttribute,
- const string& theTypeOfAttribute) const
-{
- if(_lab.IsNull()) return false;
- std::string aGUID = GetGUID(theTypeOfAttribute);
- if ((theAttribute = _lab.FindAttribute(aGUID))) return true;
- return false;
-}
-
-
-
-//============================================================================
-/*! Function : GetAllAttributes
- * Purpose : Returns list of all attributes for this sobject
- */
-//============================================================================
-vector<DF_Attribute*> SALOMEDSImpl_SObject::GetAllAttributes() const
-{
- vector<DF_Attribute*> va1, va = _lab.GetAttributes();
- for(int i = 0, len = va.size(); i<len; i++) {
- SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(va[i]);
- if(ga && ga->Type() != string("AttributeReference"))
- va1.push_back(va[i]);
- }
-
- return va1;
-}
-
-
-//============================================================================
-/*! Function : ReferencedObject
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_SObject::ReferencedObject(SALOMEDSImpl_SObject& theObject) const
-{
- SALOMEDSImpl_AttributeReference* Ref;
- if (!(Ref=(SALOMEDSImpl_AttributeReference*)_lab.FindAttribute(SALOMEDSImpl_AttributeReference::GetID())))
- return false;
-
- theObject = GetStudy()->GetSObject(Ref->Get());
- return true;
-}
-
-//============================================================================
-/*! Function : FindSubObject
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_SObject::FindSubObject(int theTag, SALOMEDSImpl_SObject& theObject)
-{
- DF_Label L = _lab.FindChild(theTag, false);
- if (L.IsNull()) return false;
-
- theObject = GetStudy()->GetSObject(L);
- return true;
-
-}
-
-
-//============================================================================
-/*! Function : GetName
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_SObject::GetName() const
-{
- string aStr = "";
- SALOMEDSImpl_AttributeName* aName;
- if ((aName=(SALOMEDSImpl_AttributeName*)_lab.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) {
- aStr =aName->Value();
- }
- return aStr;
-}
-
-//============================================================================
-/*! Function : GetComment
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_SObject::GetComment() const
-{
- string aStr = "";
- SALOMEDSImpl_AttributeComment* aComment;
- if ((aComment=(SALOMEDSImpl_AttributeComment*)_lab.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) {
- aStr = aComment->Value();
- }
- return aStr;
-}
-
-//============================================================================
-/*! Function : GetIOR
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_SObject::GetIOR() const
-{
- string aStr = "";
- SALOMEDSImpl_AttributeIOR* anIOR;
- if ((anIOR=(SALOMEDSImpl_AttributeIOR*)_lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) {
- aStr = dynamic_cast<SALOMEDSImpl_AttributeIOR*>(anIOR)->Value();
- }
- return aStr;
-}
-
-
-std::string SALOMEDSImpl_SObject::GetGUID(const string& theType)
-{
- __AttributeTypeToGUIDForSObject
-
- if (strncmp(theType.c_str(), "AttributeTreeNodeGUID",21) == 0) {
- return theType.substr(21, theType.size());
- }
- return "";
-}
-
-//============================================================================
-/*! Function : SALOMEDSImpl_SComponent
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SObject::operator SALOMEDSImpl_SComponent() const
-{
- SALOMEDSImpl_SComponent sco;
- sco._lab = _lab;
- sco._name = _name;
- sco._type = _type;
- sco._value = _value;
- return sco;
-}
-
-//============================================================================
-/*! Function : GetPersistentCopy
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SObject* SALOMEDSImpl_SObject::GetPersistentCopy() const
-{
- SALOMEDSImpl_SObject* so = new SALOMEDSImpl_SObject;
- so->_lab = _lab;
- so->_name = _name;
- so->_type = _type;
- so->_value = _value;
- return so;
-}
-
-//============================================================================
-/*! Function : IsComponent
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_SObject::IsComponent() const
-{
- return SALOMEDSImpl_SComponent::IsA(_lab);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_SObject.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSIMPL_SOBJECT_H__
-#define __SALOMEDSIMPL_SOBJECT_H__
-
-#include "SALOMEDSImpl_Defines.hxx"
-
-#include "DF_Label.hxx"
-#include "DF_Attribute.hxx"
-#include <string>
-#include <vector>
-
-class SALOMEDSImpl_SComponent;
-class SALOMEDSImpl_Study;
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_SObject
-{
-protected:
- DF_Label _lab;
- std::string _name;
- std::string _value;
- std::string _type;
-
-public:
-
- SALOMEDSImpl_SObject();
- SALOMEDSImpl_SObject(const DF_Label& theLabel);
- SALOMEDSImpl_SObject(const SALOMEDSImpl_SObject& theSObject);
- virtual ~SALOMEDSImpl_SObject();
-
- virtual std::string GetID() const;
- virtual SALOMEDSImpl_SComponent GetFatherComponent() const;
- virtual SALOMEDSImpl_SObject GetFather() const ;
- virtual bool FindAttribute(DF_Attribute*& theAttribute, const std::string& theTypeOfAttribute) const;
- virtual bool ReferencedObject(SALOMEDSImpl_SObject& theObject) const ;
- virtual bool FindSubObject(int theTag, SALOMEDSImpl_SObject& theObject);
-
- virtual SALOMEDSImpl_Study* GetStudy() const;
- virtual std::string Name() const { return _name; }
- virtual void Name(const std::string& theName) { _name = theName; }
- virtual std::vector<DF_Attribute*> GetAllAttributes() const;
-
- virtual std::string GetName() const ;
- virtual std::string GetComment() const;
- virtual std::string GetIOR() const;
-
- virtual int Tag() const { return _lab.Tag(); }
- virtual int Depth() const { return _lab.Depth(); }
-
- virtual DF_Label GetLabel() const { return _lab; }
-
- bool IsNull() const { return _lab.IsNull(); }
-
- bool IsComponent() const;
-
- operator SALOMEDSImpl_SComponent() const;
-
- operator bool () const { return !IsNull(); }
-
- SALOMEDSImpl_SObject* GetPersistentCopy() const;
-
- static std::string GetGUID(const std::string& theTypeOfAttribute);
-
-
-};
-#endif
+++ /dev/null
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_ScalarVariable.cxx
-// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
-// Module : SALOME
-
-#include "SALOMEDSImpl_ScalarVariable.hxx"
-#include "SALOMEDSImpl_GenericVariable.hxx"
-#include <iostream>
-#include <cstdlib>
-
-using namespace std;
-
-//============================================================================
-/*! Function : SALOMEDSImpl_ScalarVariable
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_ScalarVariable::
-SALOMEDSImpl_ScalarVariable(SALOMEDSImpl_GenericVariable::VariableTypes type,
- const string& theName):
- SALOMEDSImpl_GenericVariable(type,theName)
-{}
-
-//============================================================================
-/*! Function : ~SALOMEDSImpl_ScalarVariable()
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_ScalarVariable::~SALOMEDSImpl_ScalarVariable(){}
-
-//============================================================================
-/*! Function :
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_ScalarVariable::setValue(const double theValue)
-{
-
- if(myValue == theValue)
- return false;
-
- myValue = theValue;
- return true;
-}
-
-//============================================================================
-/*! Function : getValue()
- * Purpose :
- */
-//============================================================================
-double SALOMEDSImpl_ScalarVariable::getValue() const
-{
- return myValue;
-}
-
-//============================================================================
-/*! Function : Save()
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_ScalarVariable::Save() const{
- char buffer[255];
- switch(Type())
- {
- case SALOMEDSImpl_GenericVariable::REAL_VAR:
- {
- sprintf(buffer, "%.64e", myValue);
- break;
- }
- case SALOMEDSImpl_GenericVariable::BOOLEAN_VAR:
- case SALOMEDSImpl_GenericVariable::INTEGER_VAR:
- {
- sprintf(buffer, "%d", (int)myValue);
- break;
- }
- default:break;
- }
- return string(buffer);
-}
-
-//============================================================================
-/*! Function : SaveToScript()
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_ScalarVariable::SaveToScript() const
-{
- char buffer[255];
- switch(Type())
- {
- case SALOMEDSImpl_GenericVariable::REAL_VAR:
- {
- sprintf(buffer, "%g", myValue);
- break;
- }
- case SALOMEDSImpl_GenericVariable::INTEGER_VAR:
- {
- sprintf(buffer, "%d", (int)myValue);
- break;
- }
- case SALOMEDSImpl_GenericVariable::BOOLEAN_VAR:
- {
- if((bool)myValue)
- sprintf(buffer, "%s", "True");
- else
- sprintf(buffer, "%s", "False");
- break;
- }
- default:break;
- }
- return string(buffer);
-}
-
-//============================================================================
-/*! Function : SaveType()
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_ScalarVariable::SaveType() const{
- char buffer[255];
- sprintf(buffer, "%d", (int)Type());
- return string(buffer);
-}
-
-//============================================================================
-/*! Function : Load()
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_ScalarVariable::Load(const string& theStrValue)
-{
- double aValue = atof(theStrValue.c_str());
- setValue(aValue);
-}
+++ /dev/null
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_ScalarVariable.hxx
-// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
-// Module : SALOME
-
-#ifndef _SALOMEDSImpl_ScalarVariable_HeaderFile
-#define _SALOMEDSImpl_ScalarVariable_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "SALOMEDSImpl_GenericVariable.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_ScalarVariable :
- public SALOMEDSImpl_GenericVariable
-{
-public:
- SALOMEDSImpl_ScalarVariable(SALOMEDSImpl_GenericVariable::VariableTypes theType,
- const std::string& theName);
- ~SALOMEDSImpl_ScalarVariable();
-
- bool setValue(const double theValue);
- double getValue() const;
-
- virtual std::string Save() const;
- virtual std::string SaveToScript() const;
- virtual std::string SaveType() const;
-
- virtual void Load(const std::string& theStrValue);
-
-private:
- double myValue;
-};
-
-
-#endif //_SALOMEDSImpl_ScalarVariable_HeaderFile
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_Study.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_Study.hxx"
-#include <string.h>
-
-using namespace std;
-
-#include "DF_Application.hxx"
-#include "DF_ChildIterator.hxx"
-
-#include "SALOMEDSImpl_ChildNodeIterator.hxx"
-#include "SALOMEDSImpl_Attributes.hxx"
-#include "SALOMEDSImpl_UseCaseIterator.hxx"
-#include "SALOMEDSImpl_AttributeReference.hxx"
-#include "SALOMEDSImpl_StudyHandle.hxx"
-#include "SALOMEDSImpl_Tool.hxx"
-#include "SALOMEDSImpl_IParameters.hxx"
-#include "SALOMEDSImpl_ScalarVariable.hxx"
-
-#include <fstream>
-
-#define DIRECTORYID 16661
-#define FILELOCALID 26662
-#define FILEID "FILE: "
-#define VARIABLE_SEPARATOR ':'
-#define OPERATION_SEPARATOR '|'
-
-
-//============================================================================
-/*! Function : SALOMEDSImpl_Study
- * Purpose : SALOMEDSImpl_Study constructor
- */
-//============================================================================
-SALOMEDSImpl_Study::SALOMEDSImpl_Study(const DF_Document* doc,
- const string& study_name)
-{
- _name = study_name;
- _doc = (DF_Document*)doc;
- _Saved = false ;
- _URL = "";
- _StudyId = -1;
- _autoFill = false;
- _errorCode = "";
- _useCaseBuilder = new SALOMEDSImpl_UseCaseBuilder(_doc);
- _builder = new SALOMEDSImpl_StudyBuilder(this);
- _cb = new SALOMEDSImpl_Callback(_useCaseBuilder);
- //Put on the root label a StudyHandle attribute to store the address of this object
- //It will be used to retrieve the study object by DF_Label that belongs to the study
- SALOMEDSImpl_StudyHandle::Set(_doc->Main().Root(), this);
-}
-
-
-//============================================================================
-/*! Function : ~SALOMEDSImpl_Study
- * Purpose : SALOMEDSImpl_Study destructor
- */
-//============================================================================
-SALOMEDSImpl_Study::~SALOMEDSImpl_Study()
-{}
-
-//============================================================================
-/*! Function : GetPersistentReference
- * Purpose : Get persistent reference of study (idem URL())
- */
-//============================================================================
-string SALOMEDSImpl_Study::GetPersistentReference()
-{
- _errorCode = "";
- return URL();
-}
-//============================================================================
-/*! Function : GetTransientReference
- * Purpose : Get IOR of the Study (registred in Document in doc->Root)
- */
-//============================================================================
-string SALOMEDSImpl_Study::GetTransientReference()
-{
- _errorCode = "";
- string IOR = "";
-
- SALOMEDSImpl_AttributeIOR* Att;
- DF_Label _lab = _doc->Root();
- if ((Att=(SALOMEDSImpl_AttributeIOR*)_lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) {
- IOR = Att->Value();
- }
- else {
- _errorCode = "IOR is empty";
- }
-
- return IOR;
-}
-
-void SALOMEDSImpl_Study::SetTransientReference(const string& theIOR)
-{
- _errorCode = "";
-
- SALOMEDSImpl_AttributeStudyProperties* aProp = GetProperties();
- int aLocked = aProp->IsLocked();
- if (aLocked) aProp->SetLocked(false);
-
- // Assign the value of the IOR in the study->root
- SALOMEDSImpl_AttributeIOR::Set(_doc->Main().Root(), theIOR);
-
- if (aLocked) aProp->SetLocked(true);
-}
-
-//============================================================================
-/*! Function : IsEmpty
- * Purpose : Detect if study is empty
- */
-//============================================================================
-bool SALOMEDSImpl_Study::IsEmpty()
-{
- _errorCode = "";
- if (!_doc) return true;
- return _doc->IsEmpty();
-}
-
-//============================================================================
-/*! Function : FindComponent
- * Purpose : Find a Component with ComponentDataType = aComponentName
- */
-//============================================================================
-SALOMEDSImpl_SComponent SALOMEDSImpl_Study::FindComponent (const string& aComponentName)
-{
- _errorCode = "";
- bool _find = false;
- string name;
- SALOMEDSImpl_SComponentIterator itcomp = NewComponentIterator();
- SALOMEDSImpl_SComponent compo;
-
- for (; itcomp.More(); itcomp.Next()) {
- SALOMEDSImpl_SComponent SC = itcomp.Value();
- name = SC.ComponentDataType();
- if(aComponentName == name) {
- _find = true;
- return SC;
- }
- }
-
- if(!_find)
- {
- _errorCode = "No component was found";
- return compo;
- }
- return compo;
-}
-
-//============================================================================
-/*! Function : FindComponentID
- * Purpose : Find a Component from it's ID
- */
-//============================================================================
-SALOMEDSImpl_SComponent SALOMEDSImpl_Study::FindComponentID(const string& aComponentID)
-{
- _errorCode = "";
-
- // Iterate on each components defined in the study
- // Get the component ID and compare with aComponentID
- bool _find = false;
- string ID;
- SALOMEDSImpl_SComponent compo;
-
- SALOMEDSImpl_SComponentIterator itcomp = NewComponentIterator();
- for (; itcomp.More(); itcomp.Next()) {
- SALOMEDSImpl_SComponent SC = itcomp.Value();
- ID = SC.GetID();
- if(aComponentID == ID)
- {
- // ComponentID found
- _find = true;
- compo = SC;
- }
- }
- if(!_find)
- {
- _errorCode = "No component was found";
- compo = compo;
- }
-
- return compo;
-}
-
-//============================================================================
-/*! Function : FindObject
- * Purpose : Find an Object with SALOMEDSImpl_Name = anObjectName
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_Study::FindObject(const string& anObjectName)
-{
- _errorCode = "";
-
- // Iterate to all components defined in the study
- // After testing the component name, iterate in all objects defined under
- // components (function _FindObject)
- bool _find = false;
- SALOMEDSImpl_SObject RefSO;
-
- SALOMEDSImpl_SComponentIterator it = NewComponentIterator();
- for (; it.More();it.Next()){
- if(!_find)
- {
- SALOMEDSImpl_SComponent SC = it.Value();
- if (SC.GetName() == anObjectName)
- {
- _find = true;
- RefSO = SC;
-
- }
- if (!_find) RefSO = _FindObject(SC, anObjectName, _find);
- }
- }
- if(!RefSO) _errorCode = "No object was found";
- return RefSO;
-}
-
-//============================================================================
-/*! Function : FindObjectID
- * Purpose : Find an Object with ID = anObjectID
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_Study::FindObjectID(const string& anObjectID)
-{
- _errorCode = "";
- SALOMEDSImpl_SObject so;
-
- // Convert aSO->GetID in DF_Label.
- DF_Label Lab = DF_Label::Label(_doc->Main(), anObjectID, false);
-
- if (Lab.IsNull()) {
- _errorCode = "No label was found by ID";
- return so;
- }
- return GetSObject(Lab);
-
-}
-
-//============================================================================
-/*! Function : CreateObjectID
- * Purpose : Creates an Object with ID = anObjectID
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_Study::CreateObjectID(const string& anObjectID)
-{
- _errorCode = "";
- SALOMEDSImpl_SObject so;
-
- // Convert aSO->GetID in DF_Label.
- DF_Label Lab = DF_Label::Label(_doc->Main(), anObjectID, true);
-
- if (Lab.IsNull()) {
- _errorCode = "Can not create a label";
- return so;
- }
- return GetSObject(Lab);
-
-}
-
-//============================================================================
-/*! Function : FindObjectByName
- * Purpose : Find Objects with SALOMEDSImpl_Name = anObjectName in a Component
- * : with ComponentDataType = aComponentName
- */
-//============================================================================
-vector<SALOMEDSImpl_SObject> SALOMEDSImpl_Study::FindObjectByName(const string& anObjectName,
- const string& aComponentName)
-{
- _errorCode = "";
-
- vector<SALOMEDSImpl_SObject> listSO;
-
- SALOMEDSImpl_SComponent compo = FindComponent(aComponentName) ;
- if ( !compo ) {
- _errorCode = "Can not find the component";
- return listSO;
- }
-
- // Iterate on each object and subobject of the component
- // If objectName is found add it to the list of SObjects
- string childName ;
-
- string compoId = compo.GetID();
- SALOMEDSImpl_ChildIterator it = NewChildIterator(compo);
- for ( ; it.More(); it.Next() ) {
-
- SALOMEDSImpl_SObject CSO = it.Value();
- if ( CSO.GetName() == anObjectName ) {
- /* add to list */
- listSO.push_back(CSO) ;
- }
-
- /* looks also for eventual children */
- bool found = false ;
- CSO = _FindObject( CSO, anObjectName, found ) ;
- if( found) {
- listSO.push_back(CSO) ;
- }
- }
-
- return listSO;
-}
-
-
-
-//============================================================================
-/*! Function : FindObjectIOR
- * Purpose : Find an Object with IOR = anObjectIOR
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_Study::FindObjectIOR(const string& anObjectIOR)
-{
- _errorCode = "";
-
- SALOMEDSImpl_SObject aResult ;
-
- // searching in the datamap for optimization
- if (myIORLabels.find(anObjectIOR) != myIORLabels.end()) {
- aResult = GetSObject(myIORLabels[anObjectIOR]);
- // 11 oct 2002: forbidden attributes must be checked here
- if (!aResult.GetLabel().IsAttribute(SALOMEDSImpl_AttributeIOR::GetID())) {
- myIORLabels.erase(anObjectIOR);
- aResult = SALOMEDSImpl_SObject();
- }
- }
-
- if(!aResult) _errorCode = "No object was found";
- return aResult;
-}
-
-//============================================================================
-/*! Function : FindObjectByPath
- * Purpose : Find an Object by its path = thePath
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_Study::FindObjectByPath(const string& thePath)
-{
- _errorCode = "";
-
- string aPath(thePath), aToken;
- SALOMEDSImpl_SObject aSO;
- int aLength = aPath.size();
- bool isRelative = false;
-
- if(aLength == 0) { //Empty path - return the current context
- return GetSObject(_current);
- }
-
- if(aPath[0] != '/') //Relative path
- isRelative = true;
-
- DF_ChildIterator anIterator;
- DF_Label aLabel;
- SALOMEDSImpl_AttributeName* anAttr;
-
- if(isRelative) {
- if(_current.IsNull()) return aSO;
- anIterator.Init(_current, false);
- }
- else {
- if(aPath.size() == 1 && aPath[0] == '/') { //Root
- return GetSObject(_doc->Main());
- }
- anIterator.Init(_doc->Main(), false);
- }
-
- vector<string> vs = SALOMEDSImpl_Tool::splitString(aPath, '/');
- for(int i = 0, len = vs.size(); i<len; i++) {
-
- aToken = vs[i];
- if(aToken.size() == 0) break;
-
- for ( ; anIterator.More(); anIterator.Next() ) {
- aLabel = anIterator.Value();
- if((anAttr=(SALOMEDSImpl_AttributeName*)aLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) {
- if(anAttr->Value() == aToken) {
- if(i == (len-1)) { //The searched label is found (no part of the path is left)
- return GetSObject(aLabel);
- }
-
- anIterator.Init(aLabel, false);
- break;
- }
- }
- }
-
- }
-
- if(!aSO) _errorCode = "No object was found";
- return aSO;
-}
-
-//============================================================================
-/*! Function : GetObjectPath
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_Study::GetObjectPath(const SALOMEDSImpl_SObject& theObject)
-{
- _errorCode = "";
-
- string aPath("");
- if(!theObject) {
- _errorCode = "Null object";
- return aPath;
- }
-
- string aName = theObject.GetName();
- if(!aName.empty() && aName != "" ) {
- string aValue("/");
- aValue+=aName;
- aValue += aPath;
- aPath = aValue;
- SALOMEDSImpl_SObject aFather = theObject.GetFather();
- if(aFather) {
- aName = aFather.GetName();
- if(!aName.empty() && aName != "") {
- aValue = GetObjectPath(aFather);
- aPath = aValue + aPath;
- }
- }
- }
-
- return aPath;
-}
-
-
-//============================================================================
-/*! Function : GetObjectPathByIOR
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_Study::GetObjectPathByIOR(const string& theIOR)
-{
- _errorCode = "";
-
- string aPath;
- SALOMEDSImpl_SObject so = FindObjectIOR(theIOR);
- if(!so) {
- _errorCode = "No SObject was found by IOR";
- return aPath;
- }
-
- return GetObjectPath(so);
-}
-
-
-//============================================================================
-/*! Function : SetContext
- * Purpose : Sets the current context
- */
-//============================================================================
-bool SALOMEDSImpl_Study::SetContext(const string& thePath)
-{
- _errorCode = "";
- if(thePath.empty()) {
- _errorCode = "InvalidPath";
- return false;
- }
-
- string aPath(thePath), aContext("");
- bool isInvalid = false;
- SALOMEDSImpl_SObject aSO;
-
- if(aPath[0] != '/') { //Relative path
- aContext = GetContext();
- aContext += '/';
- aContext += aPath;
- }
- else
- aContext = aPath;
-
- try {
- aSO = FindObjectByPath(aContext);
- }
- catch( ... ) {
- isInvalid = true;
- }
-
- if(isInvalid || !aSO) {
- _errorCode = "InvalidContext";
- return false;
- }
-
- DF_Label aLabel = aSO.GetLabel();
- if(aLabel.IsNull()) {
- _errorCode = "InvalidContext";
- return false;
- }
- else
- _current = aLabel; //Set the current context
-
- return true;
-}
-
-//============================================================================
-/*! Function : GetContext
- * Purpose : Gets the current context
- */
-//============================================================================
-string SALOMEDSImpl_Study::GetContext()
-{
- _errorCode = "";
-
- if(_current.IsNull()) {
- _errorCode = "InvaidContext";
- return "";
- }
- SALOMEDSImpl_SObject so = GetSObject(_current);
- return GetObjectPath(so);
-}
-
-//============================================================================
-/*! Function : GetObjectNames
- * Purpose : method to get all object names in the given context (or in the current context, if 'theContext' is empty)
- */
-//============================================================================
-vector<string> SALOMEDSImpl_Study::GetObjectNames(const string& theContext)
-{
- _errorCode = "";
-
- vector<string> aResultSeq;
- DF_Label aLabel;
- if (theContext.empty()) {
- aLabel = _current;
- } else {
- DF_Label aTmp = _current;
- SetContext(theContext);
- aLabel = _current;
- _current = aTmp;
- }
- if (aLabel.IsNull()) {
- _errorCode = "InvalidContext";
- return aResultSeq;
- }
-
- DF_ChildIterator anIter (aLabel, true); // iterate all subchildren at all sublevels
- for (; anIter.More(); anIter.Next()) {
- DF_Label aLabel = anIter.Value();
- SALOMEDSImpl_AttributeName* aName;
- if ((aName=(SALOMEDSImpl_AttributeName*)aLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID())))
- aResultSeq.push_back(aName->Value());
- }
-
- return aResultSeq;
-}
-
-//============================================================================
-/*! Function : GetDirectoryNames
- * Purpose : method to get all directory names in the given context (or in the current context, if 'theContext' is empty)
- */
-//============================================================================
-vector<string> SALOMEDSImpl_Study::GetDirectoryNames(const string& theContext)
-{
- _errorCode = "";
-
- vector<string> aResultSeq;
- DF_Label aLabel;
- if (theContext.empty()) {
- aLabel = _current;
- } else {
- DF_Label aTmp = _current;
- SetContext(theContext);
- aLabel = _current;
- _current = aTmp;
- }
- if (aLabel.IsNull()) {
- _errorCode = "InvalidContext";
- return aResultSeq;
- }
-
- DF_ChildIterator anIter (aLabel, true); // iterate first-level children at all sublevels
- for (; anIter.More(); anIter.Next()) {
- DF_Label aLabel = anIter.Value();
- SALOMEDSImpl_AttributeLocalID* anID;
- if ((anID=(SALOMEDSImpl_AttributeLocalID*)aLabel.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID()))) {
- if (anID->Value() == DIRECTORYID) {
- SALOMEDSImpl_AttributeName* aName;
- if ((aName=(SALOMEDSImpl_AttributeName*)aLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) {
- aResultSeq.push_back(aName->Value());
- }
- }
- }
- }
-
- return aResultSeq;
-}
-
-//============================================================================
-/*! Function : GetFileNames
- * Purpose : method to get all file names in the given context (or in the current context, if 'theContext' is empty)
- */
-//============================================================================
-vector<string> SALOMEDSImpl_Study::GetFileNames(const string& theContext)
-{
- _errorCode = "";
-
- vector<string> aResultSeq;
- DF_Label aLabel;
- if (theContext.empty()) {
- aLabel = _current;
- } else {
- DF_Label aTmp = _current;
- SetContext(theContext);
- aLabel = _current;
- _current = aTmp;
- }
- if (aLabel.IsNull()) {
- _errorCode = "InvalidContext";
- return aResultSeq;
- }
-
- DF_ChildIterator anIter (aLabel, true); // iterate all subchildren at all sublevels
- for (; anIter.More(); anIter.Next()) {
- DF_Label aLabel = anIter.Value();
- SALOMEDSImpl_AttributeLocalID* anID;
- if ((anID=(SALOMEDSImpl_AttributeLocalID*)aLabel.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID()))) {
- if (anID->Value() == FILELOCALID) {
- SALOMEDSImpl_AttributePersistentRef* aName;
- if ((aName=(SALOMEDSImpl_AttributePersistentRef*)aLabel.FindAttribute(SALOMEDSImpl_AttributePersistentRef::GetID()))) {
- std::string aFileName = aName->Value();
- if (aFileName.size() > 0)
- aResultSeq.push_back(aFileName.substr(strlen(FILEID), aFileName.size()));
- }
- }
- }
- }
-
- return aResultSeq;
-}
-
-//============================================================================
-/*! Function : GetComponentNames
- * Purpose : method to get all components names
- */
-//============================================================================
-vector<string> SALOMEDSImpl_Study::GetComponentNames(const string& theContext)
-{
- _errorCode = "";
-
- vector<string> aResultSeq;
- DF_ChildIterator anIter(_doc->Main(), false); // iterate all subchildren at first level
- for(; anIter.More(); anIter.Next()) {
- DF_Label aLabel = anIter.Value();
- SALOMEDSImpl_AttributeName* aName;
- if ((aName=(SALOMEDSImpl_AttributeName*)aLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID())))
- aResultSeq.push_back(aName->Value());
- }
-
- return aResultSeq;
-}
-
-//============================================================================
-/*! Function : NewChildIterator
- * Purpose : Create a ChildIterator from an SObject
- */
-//============================================================================
-SALOMEDSImpl_ChildIterator SALOMEDSImpl_Study::NewChildIterator(const SALOMEDSImpl_SObject& aSO)
-{
- _errorCode = "";
- return SALOMEDSImpl_ChildIterator(aSO);
-}
-
-
-//============================================================================
-/*! Function : NewComponentIterator
- * Purpose : Create a SComponentIterator
- */
-//============================================================================
-SALOMEDSImpl_SComponentIterator SALOMEDSImpl_Study::NewComponentIterator()
-{
- _errorCode = "";
- return SALOMEDSImpl_SComponentIterator(_doc);
-}
-
-
-//============================================================================
-/*! Function : NewBuilder
- * Purpose : Create a StudyBuilder
- */
-//============================================================================
-SALOMEDSImpl_StudyBuilder* SALOMEDSImpl_Study::NewBuilder()
-{
- _errorCode = "";
- if(_autoFill) {
- _builder->SetOnAddSObject(_cb);
- _builder->SetOnRemoveSObject(_cb);
- }
- return _builder;
-
-}
-
-//============================================================================
-/*! Function : Name
- * Purpose : get study name
- */
-//============================================================================
-string SALOMEDSImpl_Study::Name()
-{
- _errorCode = "";
- return _name;
-}
-
-//============================================================================
-/*! Function : Name
- * Purpose : set study name
- */
-//============================================================================
-void SALOMEDSImpl_Study::Name(const string& name)
-{
- _errorCode = "";
- _name = name;
-}
-
-//============================================================================
-/*! Function : IsSaved
- * Purpose : get if study has been saved
- */
-//============================================================================
-bool SALOMEDSImpl_Study::IsSaved()
-{
- _errorCode = "";
- return _Saved;
-}
-
-//============================================================================
-/*! Function : IsSaved
- * Purpose : set if study has been saved
- */
-//============================================================================
-void SALOMEDSImpl_Study::IsSaved(bool save)
-{
- _errorCode = "";
- _Saved = save;
- if(save) _doc->SetModified(false);
-}
-
-//============================================================================
-/*! Function : IsModified
- * Purpose : Detect if a Study has been modified since it has been saved
- */
-//============================================================================
-bool SALOMEDSImpl_Study::IsModified()
-{
- _errorCode = "";
-
- // True if is modified
- if (_doc && _doc->IsModified()) return true;
-
- return false;
-}
-
-//============================================================================
-/*! Function : URL
- * Purpose : get URL of the study (persistent reference of the study)
- */
-//============================================================================
-string SALOMEDSImpl_Study::URL()
-{
- _errorCode = "";
- return _URL;
-}
-
-//============================================================================
-/*! Function : URL
- * Purpose : set URL of the study (persistent reference of the study)
- */
-//============================================================================
-void SALOMEDSImpl_Study::URL(const string& url)
-{
- _errorCode = "";
- _URL = url;
-
- /*jfa: Now name of SALOMEDS study will correspond to name of SalomeApp study
- string tmp(_URL);
-
- char *aName = (char*)tmp.ToCString();
- char *adr = strtok(aName, "/");
- while (adr)
- {
- aName = adr;
- adr = strtok(NULL, "/");
- }
- Name(aName);*/
- Name(url);
-}
-
-
-//============================================================================
-/*! Function : _FindObject
- * Purpose : Find an Object with SALOMEDSImpl_Name = anObjectName
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_Study::_FindObject(const SALOMEDSImpl_SObject& SO,
- const string& theObjectName,
- bool& _find)
-{
- SALOMEDSImpl_SObject RefSO;
- if(!SO) return RefSO;
-
- // Iterate on each objects and subobjects of the component
- // If objectName find, stop the loop and get the object reference
- SALOMEDSImpl_AttributeName* anAttr;
-
- string soid = SO.GetID();
- DF_ChildIterator it(SO.GetLabel());
- for (; it.More(); it.Next()){
- if(!_find)
- {
- if ((anAttr=(SALOMEDSImpl_AttributeName*)it.Value().FindAttribute(SALOMEDSImpl_AttributeName::GetID())))
- {
- string Val(anAttr->Value());
- if (Val == theObjectName)
- {
- RefSO = GetSObject(it.Value());
- _find = true;
- }
- }
- if (!_find) RefSO = _FindObject(GetSObject(it.Value()), theObjectName, _find);
- }
- }
- return RefSO;
-}
-
-//============================================================================
-/*! Function : _FindObjectIOR
- * Purpose : Find an Object with SALOMEDSImpl_IOR = anObjectIOR
- */
-//============================================================================
-SALOMEDSImpl_SObject
-SALOMEDSImpl_Study::_FindObjectIOR(const SALOMEDSImpl_SObject& SO,
- const string& theObjectIOR,
- bool& _find)
-{
- SALOMEDSImpl_SObject RefSO, aSO;
- if(!SO) return RefSO;
-
- // Iterate on each objects and subobjects of the component
- // If objectName find, stop the loop and get the object reference
- SALOMEDSImpl_AttributeIOR* anAttr;
-
- DF_ChildIterator it(SO.GetLabel());
- for (; it.More();it.Next()){
- if(!_find)
- {
- if ((anAttr=(SALOMEDSImpl_AttributeIOR*)it.Value().FindAttribute(SALOMEDSImpl_AttributeIOR::GetID())))
- {
- string Val(anAttr->Value());
- if (Val == theObjectIOR)
- {
- RefSO = GetSObject(it.Value());
- _find = true;
- }
- }
- aSO = GetSObject(it.Value());
- if (!_find) RefSO = _FindObjectIOR(aSO, theObjectIOR, _find);
- }
- }
- return RefSO;
-}
-
-//============================================================================
-/*! Function : _GetNoteBookAccessor
- * Purpose : Find an Object with SALOMEDSImpl_IOR = anObjectIOR
- */
-//============================================================================
-string SALOMEDSImpl_Study::_GetNoteBookAccessor(){
- return string("notebook");
-}
-
-//============================================================================
-/*! Function : _GetStudyVariablesScript
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_Study::_GetStudyVariablesScript()
-{
- string dump("");
-
- if(myNoteBookVars.empty())
- return dump;
-
- dump += "####################################################\n";
- dump += "## Begin of NoteBook variables section ##\n";
- dump += "####################################################\n";
-
- string set_method = _GetNoteBookAccessor()+".set(";
- string varName;
- string varValue;
- for(int i = 0 ; i < myNoteBookVars.size();i++ ) {
- varName = myNoteBookVars[i]->Name();
- varValue = myNoteBookVars[i]->SaveToScript();
- dump+=set_method+"\""+varName+"\", "+varValue+")\n";
- }
-
- dump += "####################################################\n";
- dump += "## End of NoteBook variables section ##\n";
- dump += "####################################################\n";
-
- return dump;
-}
-
-//============================================================================
-/*! Function : _GetNoteBookAccess
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_Study::_GetNoteBookAccess()
-{
- string accessor = _GetNoteBookAccessor();
- string notebook = "import salome_notebook\n";
- notebook += accessor+" = salome_notebook."+accessor + "\n";
- return notebook;
-}
-
-bool SALOMEDSImpl_Study::IsLocked()
-{
- _errorCode = "";
- return GetProperties()->IsLocked();
-}
-
-int SALOMEDSImpl_Study::StudyId()
-{
- _errorCode = "";
- return _StudyId;
-}
-
-void SALOMEDSImpl_Study::StudyId(int id)
-{
- _errorCode = "";
- _StudyId = id;
-}
-
-void SALOMEDSImpl_Study::UpdateIORLabelMap(const string& anIOR,const string& anEntry)
-{
- _errorCode = "";
- DF_Label aLabel = DF_Label::Label(_doc->Main(), anEntry, true);
- if (myIORLabels.find(anIOR) != myIORLabels.end()) myIORLabels.erase(anIOR);
- myIORLabels[anIOR] = aLabel;
-}
-
-SALOMEDSImpl_Study* SALOMEDSImpl_Study::GetStudy(const DF_Label& theLabel)
-{
- SALOMEDSImpl_StudyHandle* Att;
- if ((Att=(SALOMEDSImpl_StudyHandle*)theLabel.Root().FindAttribute(SALOMEDSImpl_StudyHandle::GetID()))) {
- return Att->Get();
- }
- return NULL;
-}
-
-SALOMEDSImpl_SObject SALOMEDSImpl_Study::SObject(const DF_Label& theLabel)
-{
- return GetStudy(theLabel)->GetSObject(theLabel);
-}
-
-SALOMEDSImpl_SComponent SALOMEDSImpl_Study::SComponent(const DF_Label& theLabel)
-{
- return GetStudy(theLabel)->GetSComponent(theLabel);
-}
-
-
-void SALOMEDSImpl_Study::IORUpdated(const SALOMEDSImpl_AttributeIOR* theAttribute)
-{
- string aString = theAttribute->Label().Entry();
- GetStudy(theAttribute->Label())->UpdateIORLabelMap(theAttribute->Value(), aString);
-}
-
-vector<SALOMEDSImpl_SObject> SALOMEDSImpl_Study::FindDependances(const SALOMEDSImpl_SObject& anObject)
-{
- _errorCode = "";
- vector<SALOMEDSImpl_SObject> aSeq;
-
- SALOMEDSImpl_AttributeTarget* aTarget;
- if ((aTarget=(SALOMEDSImpl_AttributeTarget*)anObject.GetLabel().FindAttribute(SALOMEDSImpl_AttributeTarget::GetID()))) {
- return aTarget->Get();
- }
-
- return aSeq;
-}
-
-
-SALOMEDSImpl_AttributeStudyProperties* SALOMEDSImpl_Study::GetProperties()
-{
- _errorCode = "";
- return SALOMEDSImpl_AttributeStudyProperties::Set(_doc->Main());
-}
-
-string SALOMEDSImpl_Study::GetLastModificationDate()
-{
- _errorCode = "";
- SALOMEDSImpl_AttributeStudyProperties* aProp = GetProperties();
-
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
- aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
-
- int aLastIndex = aNames.size()-1;
- char aResult[20];
- sprintf(aResult, "%2.2d/%2.2d/%4.4d %2.2d:%2.2d",
- (int)(aDays[aLastIndex]),(int)(aMonths[aLastIndex]), (int)(aYears[aLastIndex]),
- (int)(aHours[aLastIndex]), (int)(aMinutes[aLastIndex]));
- string aResStr (aResult);
- return aResStr;
-}
-
-vector<string> SALOMEDSImpl_Study::GetModificationsDate()
-{
- _errorCode = "";
- SALOMEDSImpl_AttributeStudyProperties* aProp = GetProperties();
-
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
- aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
-
- int anIndex, aLength = aNames.size();
- vector<string> aDates;
-
- for (anIndex = 1; anIndex < aLength; anIndex++) {
- char aDate[20];
- sprintf(aDate, "%2.2d/%2.2d/%4.4d %2.2d:%2.2d",
- (int)(aDays[anIndex]), (int)(aMonths[anIndex]), (int)(aYears[anIndex]),
- (int)(aHours[anIndex]), (int)(aMinutes[anIndex]));
- aDates.push_back(aDate);
- }
- return aDates;
-}
-
-
-
-//============================================================================
-/*! Function : GetUseCaseBuilder
- * Purpose : Returns a UseCase builder
- */
-//============================================================================
-SALOMEDSImpl_UseCaseBuilder* SALOMEDSImpl_Study::GetUseCaseBuilder()
-{
- _errorCode = "";
- return _useCaseBuilder;
-}
-
-
-//============================================================================
-/*! Function : Close
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_Study::Close()
-{
- _errorCode = "";
- _doc->GetApplication()->Close(_doc);
- _doc = NULL;
- _mapOfSO.clear();
- _mapOfSCO.clear();
-}
-
-
-//============================================================================
-/*! Function : GetSComponent
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SComponent SALOMEDSImpl_Study::GetSComponent(const string& theEntry)
-{
- SALOMEDSImpl_SComponent aSCO;
- if(_mapOfSCO.find(theEntry) != _mapOfSCO.end())
- aSCO = _mapOfSCO[theEntry];
- else {
- DF_Label aLabel = DF_Label::Label(_doc->Main(), theEntry);
- aSCO = SALOMEDSImpl_SComponent(aLabel);
- _mapOfSCO[theEntry] = aSCO;
- }
-
- return aSCO;
-}
-
-//============================================================================
-/*! Function : GetSComponent
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SComponent SALOMEDSImpl_Study::GetSComponent(const DF_Label& theLabel)
-{
- return SALOMEDSImpl_SComponent(theLabel);
-}
-
-//============================================================================
-/*! Function : GetSObject
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_Study::GetSObject(const string& theEntry)
-{
- SALOMEDSImpl_SObject aSO;
- if(_mapOfSO.find(theEntry) != _mapOfSO.end())
- aSO = _mapOfSO[theEntry];
- else {
- DF_Label aLabel = DF_Label::Label(_doc->Main(), theEntry);
- aSO = SALOMEDSImpl_SObject(aLabel);
- _mapOfSO[theEntry] = aSO;
- }
-
- return aSO;
-}
-
-//============================================================================
-/*! Function : GetSObject
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_Study::GetSObject(const DF_Label& theLabel)
-{
- return SALOMEDSImpl_SObject(theLabel);
-}
-
-//============================================================================
-/*! Function : GetAttribute
- * Purpose :
- */
-//============================================================================
-DF_Attribute* SALOMEDSImpl_Study::GetAttribute(const string& theEntry,
- const string& theType)
-{
- SALOMEDSImpl_SObject aSO = GetSObject(theEntry);
- DF_Attribute* anAttr;
- aSO.FindAttribute(anAttr, theType);
- return anAttr;
-}
-
-//============================================================================
-/*! Function : DumpStudy
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_Study::DumpStudy(const string& thePath,
- const string& theBaseName,
- bool isPublished,
- SALOMEDSImpl_DriverFactory* theFactory)
-{
- _errorCode = "";
-
- if(theFactory == NULL) {
- _errorCode = "Null factory for creation of Engines";
- return false;
- }
-
- vector<string> aSeq;
- string aCompType, aFactoryType;
-
- //Build a list of all components in the Study
- SALOMEDSImpl_SComponentIterator itcomponent = NewComponentIterator();
-
- for (; itcomponent.More(); itcomponent.Next()) {
- SALOMEDSImpl_SComponent sco = itcomponent.Value();
- aCompType = sco.ComponentDataType();
- //GEOM and MED are independent components
- if (aCompType == "GEOM" || aCompType == "MED")
- aSeq.insert(aSeq.begin(), aCompType);
- else
- aSeq.push_back(aCompType);
- }
-
-#ifdef WIN32
- string aFileName =
- thePath + string("\\") + theBaseName + string(".py");
-#else
- string aFileName =
- thePath + string("/") + theBaseName + string(".py");
-#endif
-
- //Create a file that will contain a main Study script
- fstream fp;
- fp.open(aFileName.c_str(), ios::out);
-
-#ifdef WIN32
- bool isOpened = fp.is_open();
-#else
- bool isOpened = fp.rdbuf()->is_open();
-#endif
-
- if(!isOpened) {
- _errorCode = string("Can't create a file ")+aFileName;
- return false;
- }
-
- string aBatchModeScript = "salome";
-
- //Output to the main Study script required Python modules import,
- //set sys.path and add a creation of the study.
- fp << GetDumpStudyComment() << endl << endl;
- fp << "import sys" << endl;
- fp << "import " << aBatchModeScript << endl << endl;
-
- fp << aBatchModeScript << ".salome_init()" << endl << endl;
-
- fp << _GetNoteBookAccess();
-
- fp << "sys.path.insert( 0, \'" << thePath << "\')" << endl << endl;
-
- //Dump NoteBook Variables
- fp << _GetStudyVariablesScript();
-
- //Check if it's necessary to dump visual parameters
- bool isDumpVisuals = SALOMEDSImpl_IParameters::isDumpPython(this);
- int lastSavePoint = -1;
- if(isDumpVisuals) {
- lastSavePoint = SALOMEDSImpl_IParameters::getLastSavePoint(this);
- if(lastSavePoint > 0) {
- fp << SALOMEDSImpl_IParameters::getStudyScript(this, lastSavePoint) << endl << endl;
- }
- }
-
-
- vector<string> aSeqOfFileNames;
-
- //Iterate all components and create the componponents specific scripts.
- bool isOk = true;
- int aLength = aSeq.size();
- for(int i = 1; i <= aLength; i++) {
-
- aCompType = aSeq[i-1];
- SALOMEDSImpl_SComponent sco = FindComponent(aCompType);
- SALOMEDSImpl_Driver* aDriver = NULL;
- // if there is an associated Engine call its method for saving
- string IOREngine;
- try {
- if (!sco.ComponentIOR(IOREngine)) {
- if (!aCompType.empty()) {
-
- aDriver = theFactory->GetDriverByType(aCompType);
-
- if (aDriver != NULL) {
- SALOMEDSImpl_StudyBuilder* SB = NewBuilder();
- if(!SB->LoadWith(sco, aDriver)) {
- _errorCode = SB->GetErrorCode();
- return false;
- }
- }
- else continue;
- }
- }
- else {
- aDriver = theFactory->GetDriverByIOR(IOREngine);
- }
- } catch(...) {
- _errorCode = "Can not restore information to dump it";
- return false;
- }
-
- if(aDriver == NULL) continue;
-
- bool isValidScript;
- long aStreamLength = 0;
- SALOMEDSImpl_TMPFile* aStream = aDriver->DumpPython(this, isPublished, isValidScript, aStreamLength);
- if ( !isValidScript )
- isOk = false;
-
- //Create a file that will contain the component specific script
- fstream fp2;
-#ifdef WIN32
- aFileName=thePath+string("\\");
-#else
- aFileName=thePath+string("/");
-#endif
- string aScriptName;
- aScriptName += theBaseName;
- aScriptName += "_";
- aScriptName += aCompType;
-
- aFileName += aScriptName+ string(".py");
- aSeqOfFileNames.push_back(aFileName);
-
- fp2.open(aFileName.c_str(), ios::out);
-
-#ifdef WIN32
- isOpened = fp2.is_open();
-#else
- isOpened = fp2.rdbuf()->is_open();
-#endif
-
- if(!isOpened) {
- _errorCode = string("Can't create a file ")+aFileName;
- SALOMEDSImpl_Tool::RemoveTemporaryFiles(thePath, aSeqOfFileNames, false);
- return false;
- }
-
- //Output the Python script generated by the component in the newly created file.
- fp2 << aStream->Data();
- fp2.close();
-
- if(aStream) delete aStream;
-
- //Add to the main script a call to RebuildData of the generated by the component the Python script
- fp << "import " << aScriptName << endl;
- fp << aScriptName << ".RebuildData(" << aBatchModeScript << ".myStudy)" << endl;
- }
-
- fp << endl;
- fp << "if salome.sg.hasDesktop():" << endl;
- fp << "\tsalome.sg.updateObjBrowser(1)" << endl;
-
- if(isDumpVisuals) { //Output the call to Session's method restoreVisualState
- fp << "\tiparameters.getSession().restoreVisualState(1)" << endl;
- }
-
-
- fp.close();
- return isOk;
-}
-
-//=======================================================================
-//function : GetDumpStudyComment
-//purpose : return a header comment for a DumpStudy script
-//=======================================================================
-
-string SALOMEDSImpl_Study::GetDumpStudyComment(const char* theComponentName)
-{
- string txt
- ("### This file is generated by SALOME automatically by dump python functionality");
- if ( theComponentName )
- txt += string(" of ") + (char*) theComponentName + " component";
- return txt;
-}
-
-void dumpSO(const SALOMEDSImpl_SObject& theSO,
- fstream& fp,
- const string& Tab,
- SALOMEDSImpl_Study* theStudy);
-
-//============================================================================
-/*! Function : dump
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_Study::dump(const string& theFileName)
-{
- //Create a file that will contain a main Study script
- fstream fp;
- fp.open(theFileName.c_str(), ios::out);
-
-#ifdef WIN32
- bool isOpened = fp.is_open();
-#else
- bool isOpened = fp.rdbuf()->is_open();
-#endif
-
- if(!isOpened) {
- _errorCode = string("Can't create a file ")+theFileName;
- cout << "### SALOMEDSImpl_Study::dump Error: " << _errorCode << endl;
- return;
- }
-
- SALOMEDSImpl_SObject aSO = FindObjectID("0:1");
- fp << "0:1" << endl;
- SALOMEDSImpl_ChildIterator Itr = NewChildIterator(aSO);
- string aTab(" ");
- for(; Itr.More(); Itr.Next()) {
- dumpSO(Itr.Value(), fp, aTab, this);
- }
-
- fp.close();
-}
-
-
-void dumpSO(const SALOMEDSImpl_SObject& theSO,
- fstream& fp,
- const string& Tab,
- SALOMEDSImpl_Study* theStudy)
-{
- string aTab(Tab), anID(theSO.GetID());
- fp << aTab << anID << endl;
- vector<DF_Attribute*> attribs = theSO.GetLabel().GetAttributes();
- for(int i = 0; i<attribs.size(); i++) {
- SALOMEDSImpl_GenericAttribute* anAttr = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(attribs[i]);
-
- if(!anAttr) {
- continue;
- }
-
- string aType = anAttr->GetClassType();
- fp << Tab << " -- " << aType;
-
- if(aType == string("AttributeReal")) {
- fp << " : " << dynamic_cast<SALOMEDSImpl_AttributeReal*>(anAttr)->Value();
- }
- else if(aType == string("AttributeInteger")) {
- fp << " : " << dynamic_cast<SALOMEDSImpl_AttributeInteger*>(anAttr)->Value();
- }
- else if(aType == string("AttributeName")) {
- fp << " : " << dynamic_cast<SALOMEDSImpl_AttributeName*>(anAttr)->Value();
- }
- else if(aType == string("AttributeComment")) {
- fp << " : " << dynamic_cast<SALOMEDSImpl_AttributeComment*>(anAttr)->Value();
- }
- else if(aType == string("AttributeReference")) {
- fp << " : " << dynamic_cast<SALOMEDSImpl_AttributeReference*>(anAttr)->Save();
- }
- fp << endl;
- }
-
- SALOMEDSImpl_ChildIterator Itr = theStudy->NewChildIterator(theSO);
- string aNewTab(" ");
- aNewTab+=aTab;
- for(; Itr.More(); Itr.Next()) {
- dumpSO(Itr.Value(), fp, aNewTab, theStudy);
- }
-
- return;
-}
-
-void SALOMEDSImpl_Study::Modify()
-{
- _errorCode = "";
- _doc->SetModified(true);
-}
-
-//============================================================================
-/*! Function :
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_AttributeParameter* SALOMEDSImpl_Study::GetCommonParameters(const char* theID, int theSavePoint)
-{
- if (theSavePoint < 0) return NULL;
- SALOMEDSImpl_StudyBuilder* builder = NewBuilder();
- SALOMEDSImpl_SObject so = FindComponent((char*)theID);
- if (!so) so = builder->NewComponent((char*)theID);
- SALOMEDSImpl_AttributeParameter* attParam = NULL;
-
- if (theSavePoint > 0) { // Try to find SObject that contains attribute parameter ...
- DF_Label savePointLabel = so.GetLabel().FindChild( theSavePoint, /*create=*/0 );
- if ( !savePointLabel.IsNull() )
- so = GetSObject( savePointLabel );
- else // ... if it does not exist - create a new one
- so = builder->NewObjectToTag( so, theSavePoint );
- }
-
- DF_Attribute* A;
- if (so) {
- builder->FindAttribute(so, A, "AttributeParameter");
- if ( !A ) { // first call of GetCommonParameters on "Interface Applicative" component
- A = builder->FindOrCreateAttribute(so, "AttributeParameter");
- }
- attParam = dynamic_cast<SALOMEDSImpl_AttributeParameter*>( A );
- }
- return attParam;
-}
-
-//============================================================================
-/*! Function :
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_AttributeParameter* SALOMEDSImpl_Study::GetModuleParameters(const char* theID,
- const char* theModuleName,
- int theSavePoint)
-{
- if(theSavePoint <= 0) return NULL;
- SALOMEDSImpl_AttributeParameter* main_ap = GetCommonParameters(theID, theSavePoint);
- SALOMEDSImpl_SObject main_so = main_ap->GetSObject();
- SALOMEDSImpl_AttributeParameter* par = NULL;
-
- SALOMEDSImpl_ChildIterator it = NewChildIterator(main_so);
- string moduleName(theModuleName);
- for(; it.More(); it.Next()) {
- SALOMEDSImpl_SObject so(it.Value());
- if((par=(SALOMEDSImpl_AttributeParameter*)so.GetLabel().FindAttribute(SALOMEDSImpl_AttributeParameter::GetID()))) {
- if(!par->IsSet("AP_MODULE_NAME", (Parameter_Types)3)) continue; //3 -> PT_STRING
- if(par->GetString("AP_MODULE_NAME") == moduleName) return par;
- }
- }
-
- SALOMEDSImpl_StudyBuilder* builder = NewBuilder();
- SALOMEDSImpl_SObject so = builder->NewObject(main_so);
- par = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(builder->FindOrCreateAttribute(so, "AttributeParameter"));
- par->SetString("AP_MODULE_NAME", moduleName);
- return par;
-}
-
-//============================================================================
-/*! Function : SetStudyLock
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_Study::SetStudyLock(const char* theLockerID)
-{
- _lockers.push_back(theLockerID);
-}
-
-//============================================================================
-/*! Function : IsStudyLocked
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_Study::IsStudyLocked()
-{
- return (_lockers.size() > 0);
-}
-
-//============================================================================
-/*! Function : UnLockStudy
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_Study::UnLockStudy(const char* theLockerID)
-{
- vector<string>::iterator vsI = _lockers.begin();
- int length = _lockers.size();
- bool isFound = false;
- string id(theLockerID);
- for(int i = 0; i<length; i++, vsI++) {
- if(id == _lockers[i]) {
- isFound = true;;
- break;
- }
- }
- if(isFound) _lockers.erase(vsI);
-}
-
-//============================================================================
-/*! Function : GetLockerID
- * Purpose :
- */
-//============================================================================
-vector<string> SALOMEDSImpl_Study::GetLockerID()
-{
- return _lockers;
-}
-
-//============================================================================
-/*! Function : SetVariable
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_Study::SetVariable(const string& theVarName,
- const double theValue,
- const SALOMEDSImpl_GenericVariable::VariableTypes theType)
-{
- bool modified = false;
- SALOMEDSImpl_GenericVariable* aGVar = GetVariable(theVarName);
-
- if( aGVar == NULL ) {
-
- SALOMEDSImpl_ScalarVariable* aSVar = new SALOMEDSImpl_ScalarVariable(theType, theVarName);
-
- aSVar->setValue(theValue);
- myNoteBookVars.push_back(aSVar);
- modified = true;
- }
- else {
- if(SALOMEDSImpl_ScalarVariable* aSVar = dynamic_cast<SALOMEDSImpl_ScalarVariable*>(aGVar)) {
- modified = aSVar->setValue(theValue) || modified;
- modified = aSVar->setType(theType) || modified;
- }
- }
- if(modified)
- Modify();
-}
-
-//============================================================================
-/*! Function : GetReal
- * Purpose :
- */
-//============================================================================
-double SALOMEDSImpl_Study::GetVariableValue(const string& theVarName)
-{
- SALOMEDSImpl_GenericVariable* aGVar = GetVariable(theVarName);
-
- if(aGVar != NULL )
- if(SALOMEDSImpl_ScalarVariable* aSVar = dynamic_cast<SALOMEDSImpl_ScalarVariable*>(aGVar))
- return aSVar->getValue();
-
- return 0;
-}
-
-//============================================================================
-/*! Function : IsTypeOf
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_Study::IsTypeOf(const string& theVarName,
- SALOMEDSImpl_GenericVariable::
- VariableTypes theType) const
-{
- SALOMEDSImpl_GenericVariable* aGVar = GetVariable(theVarName);
-
- if(aGVar != NULL )
- return aGVar->Type() == theType;
-
- return false;
-}
-
-//============================================================================
-/*! Function : IsVariable
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_Study::IsVariable(const string& theVarName) const
-{
- SALOMEDSImpl_GenericVariable* aGVar = GetVariable(theVarName);
- return (aGVar != NULL);
-}
-
-//============================================================================
-/*! Function : GetVariableNames
- * Purpose :
- */
-//============================================================================
-vector<string> SALOMEDSImpl_Study::GetVariableNames() const
-{
- vector<string> aResult;
-
- for(int i = 0; i < myNoteBookVars.size(); i++)
- aResult.push_back(myNoteBookVars[i]->Name());
-
- return aResult;
-}
-
-//============================================================================
-/*! Function : AddVariable
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_Study::AddVariable(SALOMEDSImpl_GenericVariable* theVariable)
-{
- myNoteBookVars.push_back(theVariable);
-}
-
-//============================================================================
-/*! Function : AddVariable
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_GenericVariable* SALOMEDSImpl_Study::GetVariable(const std::string& theName) const
-{
- SALOMEDSImpl_GenericVariable* aResult = NULL;
- for(int i = 0; i < myNoteBookVars.size();i++) {
- if(theName.compare(myNoteBookVars[i]->Name()) == 0) {
- aResult = myNoteBookVars[i];
- break;
- }
- }
- return aResult;
-}
-
-//============================================================================
-/*! Function : RemoveVariable
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_Study::RemoveVariable(const string& theVarName)
-{
- SALOMEDSImpl_GenericVariable* aVariable = GetVariable( theVarName );
- if( !aVariable )
- return false;
-
- string aValue = aVariable->SaveToScript();
- ReplaceVariableAttribute( theVarName, aValue );
-
- std::vector<SALOMEDSImpl_GenericVariable*>::iterator it = myNoteBookVars.begin(), itEnd = myNoteBookVars.end();
- for( ; it != itEnd; it++ )
- {
- SALOMEDSImpl_GenericVariable* aVariableRef = *it;
- if( aVariableRef && theVarName.compare( aVariableRef->Name() ) == 0 )
- {
- myNoteBookVars.erase( it );
- Modify();
- break;
- }
- }
-
- return true;
-}
-
-//============================================================================
-/*! Function : RenameVariable
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_Study::RenameVariable(const string& theVarName, const string& theNewVarName)
-{
- SALOMEDSImpl_GenericVariable* aVariable = GetVariable( theVarName );
- if( !aVariable )
- return false;
-
- ReplaceVariableAttribute( theVarName, theNewVarName );
-
- std::vector<SALOMEDSImpl_GenericVariable*>::iterator it = myNoteBookVars.begin(), itEnd = myNoteBookVars.end();
- for( ; it != itEnd; it++ )
- {
- SALOMEDSImpl_GenericVariable* aVariableRef = *it;
- if( aVariableRef && theVarName.compare( aVariableRef->Name() ) == 0 )
- {
- aVariableRef->setName( theNewVarName );
- Modify();
- break;
- }
- }
-
- return true;
-}
-
-//============================================================================
-/*! Function : IsVariableUsed
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_Study::IsVariableUsed(const string& theVarName)
-{
- return FindVariableAttribute( theVarName );
-}
-
-//============================================================================
-/*! Function : FindVariableAttribute
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_Study::FindVariableAttribute(SALOMEDSImpl_StudyBuilder* theStudyBuilder,
- SALOMEDSImpl_SObject theSObject,
- const std::string& theName)
-{
- SALOMEDSImpl_ChildIterator anIter = NewChildIterator( theSObject );
- for( ; anIter.More(); anIter.Next() )
- if( FindVariableAttribute( theStudyBuilder, anIter.Value(), theName ) )
- return true;
-
- DF_Attribute* anAttr;
- if( theStudyBuilder->FindAttribute( theSObject, anAttr, "AttributeString" ) )
- {
- if( SALOMEDSImpl_AttributeString* aStringAttr = ( SALOMEDSImpl_AttributeString* )anAttr )
- {
- string aString = aStringAttr->Value();
-
- vector< vector<string> > aSections = ParseVariables( aString );
- for( int i = 0, n = aSections.size(); i < n; i++ )
- {
- vector<string> aVector = aSections[i];
- for( int j = 0, m = aVector.size(); j < m; j++ )
- {
- string aStr = aVector[j];
- if( aStr.compare( theName ) == 0 )
- return true;
- }
- }
- }
- }
- return false;
-}
-
-//============================================================================
-/*! Function : FindVariableAttribute
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_Study::FindVariableAttribute(const std::string& theName)
-{
- SALOMEDSImpl_StudyBuilder* aStudyBuilder = NewBuilder();
- SALOMEDSImpl_SComponentIterator aCompIter = NewComponentIterator();
- for( ; aCompIter.More(); aCompIter.Next() )
- {
- SALOMEDSImpl_SObject aComp = aCompIter.Value();
- if( FindVariableAttribute( aStudyBuilder, aComp, theName ) )
- return true;
- }
- return false;
-}
-
-//============================================================================
-/*! Function : ReplaceVariableAttribute
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_Study::ReplaceVariableAttribute(SALOMEDSImpl_StudyBuilder* theStudyBuilder,
- SALOMEDSImpl_SObject theSObject,
- const std::string& theSource,
- const std::string& theDest)
-{
- SALOMEDSImpl_ChildIterator anIter = NewChildIterator( theSObject );
- for( ; anIter.More(); anIter.Next() )
- ReplaceVariableAttribute( theStudyBuilder, anIter.Value(), theSource, theDest );
-
- DF_Attribute* anAttr;
- if( theStudyBuilder->FindAttribute( theSObject, anAttr, "AttributeString" ) )
- {
- if( SALOMEDSImpl_AttributeString* aStringAttr = ( SALOMEDSImpl_AttributeString* )anAttr )
- {
- bool isChanged = false;
- string aNewString, aCurrentString = aStringAttr->Value();
-
- vector< vector<string> > aSections = ParseVariables( aCurrentString );
- for( int i = 0, n = aSections.size(); i < n; i++ )
- {
- vector<string> aVector = aSections[i];
- for( int j = 0, m = aVector.size(); j < m; j++ )
- {
- string aStr = aVector[j];
- if( aStr.compare( theSource ) == 0 )
- {
- isChanged = true;
- aStr = theDest;
- }
-
- aNewString.append( aStr );
- if( j != m - 1 )
- aNewString.append( ":" );
- }
- if( i != n - 1 )
- aNewString.append( "|" );
- }
-
- if( isChanged )
- aStringAttr->SetValue( aNewString );
- }
- }
-}
-
-//============================================================================
-/*! Function : ReplaceVariableAttribute
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_Study::ReplaceVariableAttribute(const std::string& theSource, const std::string& theDest)
-{
- SALOMEDSImpl_StudyBuilder* aStudyBuilder = NewBuilder();
- SALOMEDSImpl_SComponentIterator aCompIter = NewComponentIterator();
- for( ; aCompIter.More(); aCompIter.Next() )
- {
- SALOMEDSImpl_SObject aComp = aCompIter.Value();
- ReplaceVariableAttribute( aStudyBuilder, aComp, theSource, theDest );
- }
-}
-
-//============================================================================
-/*! Function : ParseVariables
- * Purpose :
- */
-//============================================================================
-vector< vector< string > > SALOMEDSImpl_Study::ParseVariables(const string& theVariables) const
-{
- return SALOMEDSImpl_Tool::splitStringWithEmpty( theVariables, OPERATION_SEPARATOR, VARIABLE_SEPARATOR );
-}
-
-//============================================================================
-/*! Function : EnableUseCaseAutoFilling
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_Study::EnableUseCaseAutoFilling(bool isEnabled)
-{
- _errorCode = ""; _autoFill = isEnabled;
- if(isEnabled) {
- _builder->SetOnAddSObject(_cb);
- _builder->SetOnRemoveSObject(_cb);
- }
- else {
- _builder->SetOnAddSObject(NULL);
- _builder->SetOnRemoveSObject(NULL);
- }
-}
-
-//============================================================================
-/*! Function : GetIORs
- * Purpose :
- */
-//============================================================================
-vector<string> SALOMEDSImpl_Study::GetIORs()
-{
- vector<string> anIORs;
- map<string, DF_Label>::const_iterator MI;
- for(MI = myIORLabels.begin(); MI!=myIORLabels.end(); MI++)
- anIORs.push_back(MI->first);
-
- return anIORs;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_Study.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSIMPL_STUDY_I_H__
-#define __SALOMEDSIMPL_STUDY_I_H__
-
-// std C++ headers
-#include <iostream>
-#include <string>
-#include <vector>
-#include <map>
-
-#include "DF_Document.hxx"
-#include "DF_Label.hxx"
-#include <stdio.h>
-
-//SALOMEDSImpl headers
-#include "SALOMEDSImpl_Defines.hxx"
-#include "SALOMEDSImpl_SComponentIterator.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_StudyBuilder.hxx"
-#include "SALOMEDSImpl_UseCaseBuilder.hxx"
-#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
-#include "SALOMEDSImpl_AttributeIOR.hxx"
-#include "SALOMEDSImpl_AttributeParameter.hxx"
-#include "SALOMEDSImpl_Callback.hxx"
-#include "SALOMEDSImpl_Driver.hxx"
-#include "SALOMEDSImpl_ChildIterator.hxx"
-#include "SALOMEDSImpl_GenericVariable.hxx"
-
-class SALOMEDSImpl_StudyManager;
-class SALOMEDSImpl_GenericAttribute;
-
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Study
-{
-private:
- std::string _name;
- DF_Document* _doc; // Document
- bool _Saved; // True if the Study is saved
- std::string _URL; //URL of the persistent reference of the study
- int _StudyId;
- DF_Label _current;
- bool _autoFill;
- std::string _errorCode;
- std::vector<std::string> _lockers;
- SALOMEDSImpl_Callback* _cb;
- SALOMEDSImpl_StudyBuilder* _builder;
- SALOMEDSImpl_UseCaseBuilder* _useCaseBuilder;
-
- std::map<std::string, SALOMEDSImpl_SObject> _mapOfSO;
- std::map<std::string, SALOMEDSImpl_SComponent> _mapOfSCO;
- std::map<std::string, DF_Label> myIORLabels;
- std::vector<SALOMEDSImpl_GenericVariable*> myNoteBookVars;
-
- SALOMEDSImpl_SObject _FindObject(const SALOMEDSImpl_SObject& SO,
- const std::string& anObjectName,
- bool& _find);
-
- SALOMEDSImpl_SObject _FindObjectIOR(const SALOMEDSImpl_SObject& SO,
- const std::string& anObjectIOR,
- bool& _find);
-
- std::string _GetStudyVariablesScript();
- std::string _GetNoteBookAccessor();
- std::string _GetNoteBookAccess();
-
-public:
-
- static SALOMEDSImpl_Study* GetStudy(const DF_Label& theLabel);
- static SALOMEDSImpl_SObject SObject(const DF_Label& theLabel);
- static SALOMEDSImpl_SComponent SComponent(const DF_Label& theLabel);
- static void IORUpdated(const SALOMEDSImpl_AttributeIOR* theAttribute);
-
- //! standard constructor
- SALOMEDSImpl_Study(const DF_Document*, const std::string& study_name);
-
- //! standard destructor
- virtual ~SALOMEDSImpl_Study();
-
- //! method to Get persistent reference of study (idem URL())
- virtual std::string GetPersistentReference();
-
- //! method to Get transient reference of study
- virtual std::string GetTransientReference();
-
- virtual void SetTransientReference(const std::string& theIOR);
-
- //! method to detect if a study is empty
- virtual bool IsEmpty();
-
- //! method to Find a Component with ComponentDataType = aComponentName
- virtual SALOMEDSImpl_SComponent FindComponent (const std::string& aComponentName);
-
- //! method to Find a Component Find a Component from it's ID
- virtual SALOMEDSImpl_SComponent FindComponentID(const std::string& aComponentID);
-
- //! method to Find an Object with SALOMEDSImpl::Name = anObjectName
- virtual SALOMEDSImpl_SObject FindObject(const std::string& anObjectName);
-
-
- //! method to Find Object(s) with SALOMEDSImpl::Name=anObjectName in a component with ComponentDataType = aComponentName
- virtual std::vector<SALOMEDSImpl_SObject> FindObjectByName( const std::string& anObjectName,
- const std::string& aComponentName ) ;
-
- //! method to Find an Object with ID = anObjectID
- virtual SALOMEDSImpl_SObject FindObjectID(const std::string& anObjectID);
-
- //! method to Create an Object with ID = anObjectID
- virtual SALOMEDSImpl_SObject CreateObjectID(const std::string& anObjectID);
-
- //! method to Find an Object with ID = anObjectIOR
- virtual SALOMEDSImpl_SObject FindObjectIOR(const std::string& anObjectIOR);
-
- //! method to Find an Object by its path
- virtual SALOMEDSImpl_SObject FindObjectByPath(const std::string& thePath);
-
- //! method to get a path of SObject
- virtual std::string GetObjectPath(const SALOMEDSImpl_SObject& theObject);
-
- std::string GetObjectPathByIOR(const std::string& theIOR);
-
- //! method to set a context: root ('/') is UserData component
- virtual bool SetContext(const std::string& thePath);
-
- //! method to get a context
- virtual std::string GetContext();
-
- //! method to get all object names in the given context (or in the current context, if 'theContext' is empty)
- virtual std::vector<std::string> GetObjectNames(const std::string& theContext);
-
- //! method to get all directory names in the given context (or in the current context, if 'theContext' is empty)
- virtual std::vector<std::string> GetDirectoryNames(const std::string& theContext);
-
- //! method to get all file names in the given context (or in the current context, if 'theContext' is empty)
- virtual std::vector<std::string> GetFileNames(const std::string& theContext);
-
- //! method to get all components names
- virtual std::vector<std::string> GetComponentNames(const std::string& theContext);
-
- //! method to Create a ChildIterator from an SObject
- virtual SALOMEDSImpl_ChildIterator NewChildIterator(const SALOMEDSImpl_SObject& aSO);
-
- //! method to Create a SComponentIterator
- virtual SALOMEDSImpl_SComponentIterator NewComponentIterator();
-
- //! method to Create a StudyBuilder
- virtual SALOMEDSImpl_StudyBuilder* NewBuilder();
-
- //! method to get study name
- virtual std::string Name();
-
- //! method to set study name
- virtual void Name(const std::string& name);
-
- //! method to get if study has been saved
- virtual bool IsSaved();
-
- //! method to set if study has been saved
- virtual void IsSaved(bool save);
-
- //! method to Detect if a Study has been modified since it has been saved
- virtual bool IsModified();
-
- //! method to get URL of the study (idem GetPersistentReference)
- virtual std::string URL();
-
- //! method to set URL of the study
- virtual void URL(const std::string& url);
-
- virtual bool IsLocked();
-
- virtual int StudyId();
-
- virtual void StudyId(int id);
-
- virtual void UpdateIORLabelMap(const std::string& anIOR, const std::string& aLabel);
-
- virtual std::vector<SALOMEDSImpl_SObject> FindDependances(const SALOMEDSImpl_SObject& anObject);
-
- virtual SALOMEDSImpl_AttributeStudyProperties* GetProperties();
-
- virtual std::string GetLastModificationDate();
-
- virtual std::vector<std::string> GetModificationsDate();
-
- virtual SALOMEDSImpl_UseCaseBuilder* GetUseCaseBuilder();
-
- virtual void Close();
-
- void EnableUseCaseAutoFilling(bool isEnabled);
-
- virtual std::string GetErrorCode() { return _errorCode; }
- virtual bool IsError() { return _errorCode != ""; }
-
- virtual SALOMEDSImpl_SComponent GetSComponent(const std::string& theEntry);
- virtual SALOMEDSImpl_SComponent GetSComponent(const DF_Label& theLabel);
- virtual SALOMEDSImpl_SObject GetSObject(const std::string& theEntry);
- virtual SALOMEDSImpl_SObject GetSObject(const DF_Label& theEntryLabel);
- virtual DF_Attribute* GetAttribute(const std::string& theEntry,
- const std::string& theType);
-
- virtual bool HasCurrentContext() { return !_current.IsNull(); }
-
- virtual bool DumpStudy(const std::string& thePath,
- const std::string& theBaseName,
- bool isPublished,
- SALOMEDSImpl_DriverFactory* theFactory);
-
- static std::string GetDumpStudyComment(const char* theComponentName = 0);
-
- virtual DF_Document* GetDocument() { return _doc; }
-
- //The method dump creates a txt file that contain a dump of the study, for debug use
- void dump(const std::string& theFileName);
-
- //This method marks the study as being modified
- void Modify();
-
- SALOMEDSImpl_AttributeParameter* GetCommonParameters(const char* theID, int theSavePoint);
-
- SALOMEDSImpl_AttributeParameter* GetModuleParameters(const char* theID,
- const char* theModuleName,
- int theSavePoint);
-
- //Locks the study, theLockerID is identificator of the of the one who locked the study for ex. IOR
- void SetStudyLock(const char* theLockerID);
-
- //Returns True if the study is locked
- bool IsStudyLocked();
-
- //Unlocks the study
- void UnLockStudy(const char* theLockerID);
-
- //Returns an ID of the study locker
- std::vector<std::string> GetLockerID();
-
- //Managing of variables
- void SetVariable(const std::string& theVarName,
- const double theValue,
- const SALOMEDSImpl_GenericVariable::VariableTypes);
-
- double GetVariableValue(const std::string& theVarName);
-
- bool IsTypeOf(const std::string& theVarName,
- SALOMEDSImpl_GenericVariable::VariableTypes theType) const;
-
- bool IsVariable(const std::string& theVarName) const;
-
-
- std::vector<std::string> GetVariableNames() const;
-
- void AddVariable(SALOMEDSImpl_GenericVariable* theVariable);
-
- SALOMEDSImpl_GenericVariable* GetVariable(const std::string& theName) const;
-
- bool RemoveVariable(const std::string& theVarName);
-
- bool RenameVariable(const std::string& theVarName, const std::string& theNewVarName);
-
- bool IsVariableUsed(const std::string& theVarName);
-
- bool FindVariableAttribute(SALOMEDSImpl_StudyBuilder* theStudyBuilder,
- SALOMEDSImpl_SObject theSObject,
- const std::string& theName);
- bool FindVariableAttribute(const std::string& theName);
-
- void ReplaceVariableAttribute(SALOMEDSImpl_StudyBuilder* theStudyBuilder,
- SALOMEDSImpl_SObject theSObject,
- const std::string& theSource,
- const std::string& theDest);
- void ReplaceVariableAttribute(const std::string& theSource, const std::string& theDest);
-
- std::vector< std::vector<std::string> > ParseVariables(const std::string& theVariables) const;
-
- //Returns a callback
- SALOMEDSImpl_Callback* GetCallback() { return _cb; }
-
- //Returns a list of IOR's stored in the study
- std::vector<std::string> GetIORs();
-
- friend class SALOMEDSImpl_StudyManager;
- friend class SALOMEDSImpl_GenericAttribute;
- friend class SALOMEDSImpl_GenericVariable;
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_StudyBuilder.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_Attributes.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-#include "SALOMEDSImpl_StudyBuilder.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_Tool.hxx"
-#include "SALOMEDSImpl_ChildNodeIterator.hxx"
-
-#include "DF_ChildIterator.hxx"
-#include "DF_Label.hxx"
-
-#include <HDFOI.hxx>
-#include <stdlib.h>
-#include <string.h>
-
-using namespace std;
-
-#define USE_CASE_LABEL_TAG 2
-#define DIRECTORYID 16661
-#define FILELOCALID 26662
-
-static void Translate_persistentID_to_IOR(DF_Label& Lab, SALOMEDSImpl_Driver* driver, bool isMultiFile, bool isASCII);
-
-//============================================================================
-/*! Function : constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_StudyBuilder::SALOMEDSImpl_StudyBuilder(const SALOMEDSImpl_Study* theOwner)
-{
- _errorCode = "";
- _callbackOnAdd=NULL;
- _callbackOnRemove = NULL;
- _study = (SALOMEDSImpl_Study*)theOwner;
- _doc = _study->GetDocument();
-}
-
-//============================================================================
-/*! Function : destructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_StudyBuilder::~SALOMEDSImpl_StudyBuilder()
-{}
-
-//============================================================================
-/*! Function : NewComponent
- * Purpose : Create a new component (Scomponent)
- */
-//============================================================================
-SALOMEDSImpl_SComponent SALOMEDSImpl_StudyBuilder::NewComponent(const string& DataType)
-{
- _errorCode = "";
- CheckLocked();
-
- SALOMEDSImpl_SComponent sco;
-
- if(DataType.size() == 0) return sco;
-
- //Always create component under main label.
- DF_Label L = _doc->Main();
-
- DF_Label NL = L.NewChild();
-
- SALOMEDSImpl_AttributeComment::Set(NL, DataType);
-
- SALOMEDSImpl_SComponent so = _study->GetSComponent (NL);
-
- if(_callbackOnAdd) _callbackOnAdd->OnAddSObject(so);
-
- _doc->SetModified(true);
-
- return so;
-}
-
-//============================================================================
-/*! Function : DefineComponentInstance
- * Purpose : Add IOR attribute of a Scomponent
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::DefineComponentInstance(const SALOMEDSImpl_SComponent& aComponent,
- const string& IOR)
-{
- _errorCode = "";
-
- CheckLocked();
- if(!aComponent || IOR.empty()) {
- _errorCode = "Invalid arguments";
- return false;
- }
- //add IOR definition
- SALOMEDSImpl_AttributeIOR::Set(aComponent.GetLabel(), IOR);
-
- return true;
-}
-
-//============================================================================
-/*! Function : RemoveComponent
- * Purpose : Delete a Scomponent
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::RemoveComponent(const SALOMEDSImpl_SComponent& aComponent)
-{
- _errorCode = "";
- CheckLocked();
- return RemoveObject(aComponent);
-}
-
-//============================================================================
-/*! Function : NewObject
- * Purpose : Create a new SObject
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_StudyBuilder::NewObject(const SALOMEDSImpl_SObject& theFatherObject)
-{
- _errorCode = "";
- CheckLocked();
-
- //Find label of father
- DF_Label Lab = theFatherObject.GetLabel();
-
- //Create a new label
- DF_Label NewLab = Lab.NewChild();
-
- SALOMEDSImpl_SObject so = _study->GetSObject(NewLab);
- if(_callbackOnAdd) _callbackOnAdd->OnAddSObject(so);
-
- _doc->SetModified(true);
- return so;
-}
-
-//============================================================================
-/*! Function : NewObjectToTag
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_StudyBuilder::NewObjectToTag(const SALOMEDSImpl_SObject& theFatherObject,
- const int theTag)
-{
- _errorCode = "";
- CheckLocked();
- //Find label of father
- DF_Label Lab = theFatherObject.GetLabel();
-
- //Create or find label
- DF_Label NewLab = Lab.FindChild(theTag, 1);
-
- SALOMEDSImpl_SObject so = _study->GetSObject(NewLab);
-
- if(_callbackOnAdd) _callbackOnAdd->OnAddSObject(so);
-
- _doc->SetModified(true);
- return so;
-}
-
-//============================================================================
-/*! Function : RemoveObject
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::RemoveObject(const SALOMEDSImpl_SObject& anObject)
-{
- _errorCode = "";
- CheckLocked();
- if(!anObject) {
- _errorCode = "Null object";
- return false;
- }
-
- if(_callbackOnRemove) _callbackOnRemove->OnRemoveSObject(anObject);
-
- DF_Label Lab = anObject.GetLabel();
-
- SALOMEDSImpl_AttributeReference* aReference = NULL;
- if ((aReference=(SALOMEDSImpl_AttributeReference*)Lab.FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
- SALOMEDSImpl_AttributeTarget* aTarget = NULL;
- if ((aTarget=(SALOMEDSImpl_AttributeTarget*)aReference->Get().FindAttribute(SALOMEDSImpl_AttributeTarget::GetID())))
- aTarget->Remove(SALOMEDSImpl_Study::SObject(Lab));
- }
-
- SALOMEDSImpl_AttributeIOR* anAttr = NULL; //Remove from IORLabel map
- if ((anAttr=(SALOMEDSImpl_AttributeIOR*)Lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) {
- }
-
- Lab.ForgetAllAttributes();
-
- _doc->SetModified(true);
-
- return true;
-}
-
-//============================================================================
-/*! Function : RemoveObjectWithChildren
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::RemoveObjectWithChildren(const SALOMEDSImpl_SObject& anObject)
-{
- _errorCode = "";
- CheckLocked();
- if(!anObject) {
- _errorCode = "Null object";
- return false;
- }
-
- if(_callbackOnRemove) _callbackOnRemove->OnRemoveSObject(anObject);
-
- DF_Label Lab = anObject.GetLabel();
-
- SALOMEDSImpl_AttributeReference* aReference = NULL;
- if ((aReference=(SALOMEDSImpl_AttributeReference*)Lab.FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
- SALOMEDSImpl_AttributeTarget* aTarget = NULL;
- if ((aTarget=(SALOMEDSImpl_AttributeTarget*)aReference->Get().FindAttribute(SALOMEDSImpl_AttributeTarget::GetID())))
- aTarget->Remove(SALOMEDSImpl_Study::SObject(Lab));
- }
- SALOMEDSImpl_AttributeIOR* anAttr = NULL; //Remove from IORLabel map
- if ((anAttr=(SALOMEDSImpl_AttributeIOR*)Lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) {
- }
-
- DF_ChildIterator it(Lab, true);
- for(;it.More();it.Next()) {
- DF_Label aLabel = it.Value();
- if ((aReference=(SALOMEDSImpl_AttributeReference*)aLabel.FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
- SALOMEDSImpl_AttributeTarget* aTarget = NULL;
- if ((aTarget=(SALOMEDSImpl_AttributeTarget*)aReference->Get().FindAttribute(SALOMEDSImpl_AttributeTarget::GetID())))
- aTarget->Remove(SALOMEDSImpl_Study::SObject(aLabel));
- }
- SALOMEDSImpl_AttributeIOR* anAttr = NULL; //Remove from IORLabel map
- if ((anAttr=(SALOMEDSImpl_AttributeIOR*)aLabel.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) {
- }
- }
-
- Lab.ForgetAllAttributes(true);
-
- _doc->SetModified(true);
-
- return true;
-}
-
-//============================================================================
-/*! Function : LoadWith
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO,
- SALOMEDSImpl_Driver* aDriver)
-{
- _errorCode = "";
-
- DF_Label Lab = anSCO.GetLabel();
- SALOMEDSImpl_AttributePersistentRef* Att = NULL;
-
- //Find the current Url of the study
- if ((Att=(SALOMEDSImpl_AttributePersistentRef*)_doc->Main().FindAttribute(SALOMEDSImpl_AttributePersistentRef::GetID()))) {
- int aLocked = _study->GetProperties()->IsLocked();
- if (aLocked) _study->GetProperties()->SetLocked(false);
-
- std::string Res(Att->Value());
- string aHDFPath(Res);
-
- SALOMEDSImpl_AttributeComment* type = NULL;
- std::string DataType;
- if ((type=(SALOMEDSImpl_AttributeComment*)Lab.FindAttribute(SALOMEDSImpl_AttributeComment::GetID())))
- DataType = type->Value();
-
- // associate the driver to the SComponent
- if(aDriver == NULL) {
- _errorCode = "Driver is null";
- return false;
- }
-
- // mpv 06.03.2003: SAL1927 - if component data if already loaded, it is not necessary to do it again
- SALOMEDSImpl_AttributeIOR* attrIOR = NULL;
- if ((attrIOR=(SALOMEDSImpl_AttributeIOR*)Lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) {
- if (aLocked) _study->GetProperties()->SetLocked(true);
- return true;
- }
-
- DefineComponentInstance (anSCO, aDriver->GetIOR());
-
- string aHDFUrl;
- bool isASCII = false;
- if (HDFascii::isASCII(aHDFPath.c_str())) {
- isASCII = true;
- aHDFUrl = HDFascii::ConvertFromASCIIToHDF(aHDFPath.c_str());
- aHDFUrl += "hdf_from_ascii.hdf";
- } else {
- aHDFUrl = aHDFPath;
- }
-
- //Open the Study HDF file
- HDFfile *hdf_file = new HDFfile((char*)aHDFUrl.c_str());
-
- char aMultifileState[2];
- char ASCIIfileState[2];
- try {
- string scoid = anSCO.GetID();
- hdf_file->OpenOnDisk(HDF_RDONLY);
- HDFgroup *hdf_group = new HDFgroup("DATACOMPONENT",hdf_file);
- hdf_group->OpenOnDisk();
- HDFgroup *hdf_sco_group = new HDFgroup((char*)scoid.c_str(), hdf_group);
- hdf_sco_group->OpenOnDisk();
-
- unsigned char* aStreamFile = NULL;
- int aStreamSize = 0;
-
- if (hdf_sco_group->ExistInternalObject("FILE_STREAM")) {
- HDFdataset *hdf_dataset = new HDFdataset("FILE_STREAM", hdf_sco_group);
- hdf_dataset->OpenOnDisk();
- aStreamSize = hdf_dataset->GetSize();
- aStreamFile = new unsigned char[aStreamSize];
- if(aStreamFile == NULL) throw HDFexception("Unable to open dataset FILE_STREAM");
- hdf_dataset->ReadFromDisk(aStreamFile);
- hdf_dataset->CloseOnDisk();
- hdf_dataset = 0;
- } else
- aStreamFile = NULL;
-
- HDFdataset *multifile_hdf_dataset = new HDFdataset("MULTIFILE_STATE", hdf_sco_group);
- multifile_hdf_dataset->OpenOnDisk();
- multifile_hdf_dataset->ReadFromDisk(aMultifileState);
-
- HDFdataset *ascii_hdf_dataset = new HDFdataset("ASCII_STATE", hdf_sco_group);
- ascii_hdf_dataset->OpenOnDisk();
- ascii_hdf_dataset->ReadFromDisk(ASCIIfileState);
-
- string aDir = SALOMEDSImpl_Tool::GetDirFromPath(Res);
-
- bool aResult = (ASCIIfileState[0]=='A')?
- aDriver->LoadASCII(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'):
- aDriver->Load(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M');
-
- if(aStreamFile != NULL) delete []aStreamFile;
-
- if(!aResult) {
- RemoveAttribute( anSCO, "AttributeIOR" );
-
- _errorCode = "Can't load component";
- throw HDFexception("Unable to load component");
- }
-
- //if(aDir != NULL) delete []aDir;
-
- multifile_hdf_dataset->CloseOnDisk();
- multifile_hdf_dataset = 0;
- ascii_hdf_dataset->CloseOnDisk();
- ascii_hdf_dataset = 0;
-
- hdf_sco_group->CloseOnDisk();
- hdf_sco_group = 0;
- hdf_group->CloseOnDisk();
- hdf_group = 0;
- hdf_file->CloseOnDisk();
- delete hdf_file;
-
- if (isASCII) {
- vector<string> aFilesToRemove;
- aFilesToRemove.push_back("hdf_from_ascii.hdf");
- SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl),
- aFilesToRemove, true);
- }
- }
- catch (HDFexception) {
- delete hdf_file;
-
- if (isASCII) {
- vector<string> aFilesToRemove;
- aFilesToRemove.push_back(aHDFUrl);
- SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true);
- }
-
- if (aLocked) _study->GetProperties()->SetLocked(true);
- _errorCode = "No persistent file";
- return false;
- }
-
- try {
- Translate_persistentID_to_IOR (Lab, aDriver, aMultifileState[0]=='M', ASCIIfileState[0] == 'A');
- } catch(...) {
- _errorCode = "Can not convert persistent IDs to IORs";
- return false;
- }
-
- if (aLocked) _study->GetProperties()->SetLocked(true);
- } else {
- _errorCode = "No persistent file";
- }
-
- return true;
-}
-
-
-//============================================================================
-/*! Function : Load
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::Load(const SALOMEDSImpl_SObject& sco)
-{
- _errorCode = "Not implemented";
- return false;
-}
-
-//============================================================================
-/*! Function : FindOrCreateAttribute
- * Purpose : Add attribute of given type to SObject, if there is attribute of such type, returns
- * existing one
- */
-//============================================================================
-DF_Attribute* SALOMEDSImpl_StudyBuilder::FindOrCreateAttribute(const SALOMEDSImpl_SObject& anObject,
- const string& aTypeOfAttribute)
-{
- _errorCode = "";
- if(!anObject) {
- _errorCode = "Invalid arguments";
- return NULL;
- }
-
- DF_Label Lab = anObject.GetLabel();
- if(Lab.IsNull()) {
- _errorCode = "Null label";
- return NULL;
- }
-
- _doc->SetModified(true);
-
- //The macro adds all necessary checks for standardly behaiving attributes
- __FindOrCreateAttributeForBuilder
-
-
- //Add checks for TreeNode and UserID attributes
- if (strncmp(aTypeOfAttribute.c_str(), "AttributeTreeNode",17) == 0 ) {
-
- string aTreeNodeGUID;
- if (strcmp(aTypeOfAttribute.c_str(), "AttributeTreeNode") == 0) {
- aTreeNodeGUID = SALOMEDSImpl_AttributeTreeNode::GetDefaultTreeID();
- } else {
- aTreeNodeGUID = aTypeOfAttribute.substr(21, aTypeOfAttribute.size()); // create tree node GUID by name
- }
- SALOMEDSImpl_AttributeTreeNode* anAttr = NULL;
- if (!(anAttr=(SALOMEDSImpl_AttributeTreeNode*)Lab.FindAttribute(aTreeNodeGUID))) {
- CheckLocked();
- anAttr = SALOMEDSImpl_AttributeTreeNode::Set(Lab, aTreeNodeGUID);
- }
- return anAttr;
- }
-
- if (strncmp(aTypeOfAttribute.c_str(), "AttributeUserID",15) == 0 ) {
- std::string aUserGUID;
- if (strcmp(aTypeOfAttribute.c_str(), "AttributeUserID") == 0) {
- aUserGUID = SALOMEDSImpl_AttributeUserID::DefaultID();
- } else {
- aUserGUID = aTypeOfAttribute.substr(15, aTypeOfAttribute.size()); // create tree node GUID by name
- }
- SALOMEDSImpl_AttributeUserID* anAttr = NULL;
- if (!(anAttr=(SALOMEDSImpl_AttributeUserID*)Lab.FindAttribute(aUserGUID))) {
- CheckLocked();
- anAttr = SALOMEDSImpl_AttributeUserID::Set(Lab, aUserGUID);
- }
- return anAttr;
- }
- _errorCode = "Can not create an attribute";
-
- return NULL;
-}
-
-//============================================================================
-/*! Function : FindAttribute
- * Purpose : Find attribute of given type assigned SObject, returns Standard_True if it is found
- */
-//============================================================================
-
-bool SALOMEDSImpl_StudyBuilder::FindAttribute(const SALOMEDSImpl_SObject& anObject,
- DF_Attribute*& anAttribute,
- const string& aTypeOfAttribute)
-{
- _errorCode = "";
- if(!anObject) {
- _errorCode = "Invalid arguments";
- return false;
- }
- DF_Label Lab = anObject.GetLabel();
- if ((anAttribute=Lab.FindAttribute(SALOMEDSImpl_SObject::GetGUID(aTypeOfAttribute)))) {
- // commented out because NO MODIFICATION is done to attributes when calling FindAttribute()
- // _doc->Modify();
- return true;
- }
- return false;
-}
-
-//============================================================================
-/*! Function : RemoveAttribute
- * Purpose : Remove attribute of given type assigned SObject
- */
-//============================================================================
-
-bool SALOMEDSImpl_StudyBuilder::RemoveAttribute(const SALOMEDSImpl_SObject& anObject,
- const string& aTypeOfAttribute)
-{
- _errorCode = "";
- CheckLocked();
- if(!anObject) {
- _errorCode = "Invalid arguments";
- return false;
- }
- DF_Label Lab = anObject.GetLabel();
-
- if (aTypeOfAttribute == string("AttributeIOR")) { // Remove from IORLabel map
- SALOMEDSImpl_AttributeIOR* anAttr = NULL;
- if ((anAttr=(SALOMEDSImpl_AttributeIOR*)Lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) {
- }
- }
-
- Lab.ForgetAttribute (SALOMEDSImpl_SObject::GetGUID(aTypeOfAttribute));
-
- _doc->SetModified(true);
-
- return true;
-}
-
-//============================================================================
-/*! Function : Addreference
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::Addreference(const SALOMEDSImpl_SObject& me,
- const SALOMEDSImpl_SObject& theReferencedObject)
-{
- _errorCode = "";
- if(!me || !theReferencedObject) {
- _errorCode = "Invalid arguments";
- return false;
- }
- CheckLocked();
- DF_Label Lab = me.GetLabel();
- DF_Label RefLab = theReferencedObject.GetLabel();
- SALOMEDSImpl_AttributeReference::Set(Lab,RefLab);
-
- SALOMEDSImpl_AttributeTarget::Set(RefLab)->Add(SALOMEDSImpl_Study::SObject(Lab));
-
- if(_callbackOnRemove && Lab.IsDescendant(_doc->Main())) _callbackOnRemove->OnRemoveSObject(me);
-
- return true;
-}
-
-//============================================================================
-/*! Function : RemoveReference
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::RemoveReference(const SALOMEDSImpl_SObject& me)
-{
- _errorCode = "";
- SALOMEDSImpl_SObject theReferencedObject;
-
- if(!me.ReferencedObject(theReferencedObject)) return false; //No reference is found
-
- CheckLocked();
- DF_Label Lab = me.GetLabel();
-
- //SRN: 30 Aug, 2004 : fix from Ecole l'ete version
-
- DF_Label RefLab = theReferencedObject.GetLabel();
-
- SALOMEDSImpl_AttributeTarget* aTarget = NULL;
- if((aTarget=(SALOMEDSImpl_AttributeTarget*)RefLab.FindAttribute(SALOMEDSImpl_AttributeTarget::GetID()))) {
- aTarget->Remove(SALOMEDSImpl_Study::SObject(Lab));
- }
-
- Lab.ForgetAttribute(SALOMEDSImpl_AttributeReference::GetID());
-
- _doc->SetModified(true);
-
- return true;
-}
-
-
-
-//============================================================================
-/*! Function : AddDirectory
- * Purpose : adds a new directory with a path = thePath
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::AddDirectory(const string& thePath)
-{
- _errorCode = "";
- CheckLocked();
- if(thePath.empty()) {
- _errorCode = "Invalid path";
- return false;
- }
-
- string aPath(thePath), aContext(""), aFatherPath;
- DF_Label aLabel;
- SALOMEDSImpl_SObject anObject;
-
- try {
- anObject = _study->FindObjectByPath(thePath); //Check if the directory already exists
- }
- catch(...) { }
-
- if(anObject) {
- _errorCode = "StudyNameAlreadyUsed";
- return false;
- }
-
- if(aPath[0] != '/') { //Relative path
- aPath.insert(aPath.begin(), '/');
- aPath = _study->GetContext() + aPath;
- }
-
- vector<string> vs = SALOMEDSImpl_Tool::splitString(aPath, '/');
- if(vs.size() == 1)
- aFatherPath = "/";
- else {
- for(int i = 0, len = vs.size()-1; i<len; i++) {
- aFatherPath += "/";
- aFatherPath += vs[i];
- }
- }
-
- try {
- anObject = _study->FindObjectByPath(aFatherPath); //Check if the father directory exists
- }
- catch(...) { ; }
- if(!anObject) {
- _errorCode = "StudyInvalidDirectory";
- return false;
- }
-
- SALOMEDSImpl_SObject aNewObject = NewObject(anObject);
- aLabel = aNewObject.GetLabel();
- if(aLabel.IsNull()) {
- _errorCode = "StudyInvalidComponent";
- return false;
- }
-
- SALOMEDSImpl_AttributeName::Set(aLabel, vs.back());
-
- //Set LocalID attribute to identify the directory object
- SALOMEDSImpl_AttributeLocalID::Set(aLabel, DIRECTORYID);
-
- _doc->SetModified(true);
-
- return true;
-}
-
-
-//============================================================================
-/*! Function : SetGUID
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::SetGUID(const SALOMEDSImpl_SObject& anObject,
- const string& theGUID)
-{
- _errorCode = "";
- CheckLocked();
- if(!anObject) {
- _errorCode = "Invalid arguments";
- return false;
- }
-
- DF_Label aLabel = anObject.GetLabel();
- SALOMEDSImpl_AttributeUserID::Set(aLabel, theGUID);
-
- _doc->SetModified(true);
-
- return true;
-}
-
-//============================================================================
-/*! Function : IsGUID
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::IsGUID(const SALOMEDSImpl_SObject& anObject,
- const string& theGUID)
-{
- _errorCode = "";
- if(!anObject) {
- _errorCode = "Invalid arguments";
- return false;
- }
- DF_Label aLabel = anObject.GetLabel();
- return aLabel.IsAttribute(theGUID);
-}
-
-
-//============================================================================
-/*! Function : NewCommand
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_StudyBuilder::NewCommand()
-{
- _errorCode = "";
-
- // mpv: for SAL2114 - unset "lock changed" flag at the operation start
- _study->GetProperties()->IsLockChanged(true);
-
- //Not implemented
-}
-
-//============================================================================
-/*! Function : CommitCommand
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_StudyBuilder::CommitCommand()
-{
- _errorCode = "";
- SALOMEDSImpl_AttributeStudyProperties* anAttr = _study->GetProperties();
- if (anAttr->IsLocked() && !anAttr->IsLockChanged(true)) {
- _errorCode = "LockProtection";
- throw LockProtection("LockProtection");
- } else {
- int aModif = anAttr->GetModified();
- if (aModif < 0) aModif = 1000; // if user make undo and then - new transaction "modify" will never be zero
- anAttr->SetModified(aModif+1);
- }
-
-
- //Not implemented
- _doc->SetModified(true);
-}
-
-//============================================================================
-/*! Function : HasOpenCommand
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::HasOpenCommand()
-{
- _errorCode = "";
-
- //Not implememnted
- return false;
-}
-
-//============================================================================
-/*! Function : AbortCommand
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_StudyBuilder::AbortCommand()
-{
- _errorCode = "";
- //Not implemented
-}
-
-//============================================================================
-/*! Function : Undo
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_StudyBuilder::Undo()
-{
- //Not implemented
- _errorCode = "";
- SALOMEDSImpl_AttributeStudyProperties* anAttr = _study->GetProperties();
- if (anAttr->IsLocked()) {
- _errorCode = "LockProtection";
- throw LockProtection("LockProtection");
- } else {
- anAttr->SetModified(anAttr->GetModified()-1);
- }
-
- _doc->SetModified(true);
-}
-
-//============================================================================
-/*! Function : Redo
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_StudyBuilder::Redo()
-{
- _errorCode = "";
- SALOMEDSImpl_AttributeStudyProperties* anAttr = _study->GetProperties();
- if (anAttr->IsLocked()) {
- _errorCode = "LockProtection";
- throw LockProtection("LockProtection");
- } else {
- anAttr->SetModified(anAttr->GetModified()+1);
- }
-
- //Not implemented
-
- _doc->SetModified(true);
-}
-
-//============================================================================
-/*! Function : GetAvailableUndos
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::GetAvailableUndos()
-{
- _errorCode = "";
- return false;
-}
-
-//============================================================================
-/*! Function : GetAvailableRedos
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::GetAvailableRedos()
-{
- _errorCode = "";
- return false;
-}
-
-//============================================================================
-/*! Function : UndoLimit
- * Purpose :
- */
-//============================================================================
-int SALOMEDSImpl_StudyBuilder::UndoLimit()
-{
- _errorCode = "";
- return 1;
-}
-
-//============================================================================
-/*! Function : UndoLimit
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_StudyBuilder::UndoLimit(int n)
-{
- _errorCode = "";
- CheckLocked();
- //Not implemented
-}
-
-//============================================================================
-/*! Function : SetOnAddSObject
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_Callback*
-SALOMEDSImpl_StudyBuilder::SetOnAddSObject(const SALOMEDSImpl_Callback* theCallback)
-{
- _errorCode = "";
- SALOMEDSImpl_Callback* aRet = _callbackOnAdd;
- _callbackOnAdd = (SALOMEDSImpl_Callback*)theCallback;
- return aRet;
-}
-
-//============================================================================
-/*! Function : SetOnNewSObject
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_Callback*
-SALOMEDSImpl_StudyBuilder::SetOnRemoveSObject(const SALOMEDSImpl_Callback* theCallback)
-{
- _errorCode = "";
- SALOMEDSImpl_Callback* aRet = _callbackOnRemove;
- _callbackOnRemove = (SALOMEDSImpl_Callback*)theCallback;
- return aRet;
-}
-
-//============================================================================
-/*! Function : CheckLocked
- * Purpose :
- */
-//============================================================================
-void SALOMEDSImpl_StudyBuilder::CheckLocked()
-{
- _errorCode = "";
- if (HasOpenCommand()) return;
- SALOMEDSImpl_AttributeStudyProperties* anAttr = _study->GetProperties();
- if (anAttr->IsLocked()) {
- _errorCode = "LockProtection";
- throw LockProtection("LockProtection");
- }
-}
-
-//============================================================================
-/*! Function : SetName
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::SetName(const SALOMEDSImpl_SObject& theSO,
- const string& theValue)
-{
- _errorCode = "";
- CheckLocked();
- if(!theSO) {
- _errorCode = "Invalid arguments";
- return false;
- }
- SALOMEDSImpl_AttributeName::Set(theSO.GetLabel(), theValue);
-
- _doc->SetModified(true);
-
- return true;
-}
-
-//============================================================================
-/*! Function : SetComment
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::SetComment(const SALOMEDSImpl_SObject& theSO,
- const string& theValue)
-{
- _errorCode = "";
- CheckLocked();
- if(!theSO) {
- _errorCode = "Invalid arguments";
- return false;
- }
- SALOMEDSImpl_AttributeComment::Set(theSO.GetLabel(), theValue);
-
- _doc->SetModified(true);
-
- return true;
-}
-
-//============================================================================
-/*! Function : SetIOR
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyBuilder::SetIOR(const SALOMEDSImpl_SObject& theSO,
- const string& theValue)
-{
- _errorCode = "";
- CheckLocked();
- if(!theSO) {
- _errorCode = "Invalid arguments";
- return false;
- }
- SALOMEDSImpl_AttributeIOR::Set(theSO.GetLabel(), theValue);
-
- _doc->SetModified(true);
-
- return true;
-}
-
-
-//============================================================================
-/*! Function : Translate_persistentID_to_IOR
- * Purpose :
- */
-//============================================================================
-static void Translate_persistentID_to_IOR(DF_Label& Lab, SALOMEDSImpl_Driver* driver, bool isMultiFile, bool isASCII)
-{
- if(driver == NULL) return;
- DF_ChildIterator itchild (Lab);
-
- for (; itchild.More(); itchild.Next()) {
- DF_Label current = itchild.Value();
- SALOMEDSImpl_AttributePersistentRef* Att = NULL;
- if ((Att=(SALOMEDSImpl_AttributePersistentRef*)current.FindAttribute(SALOMEDSImpl_AttributePersistentRef::GetID()))) {
-
- SALOMEDSImpl_AttributeLocalID* anID = NULL;
- if ((anID=(SALOMEDSImpl_AttributeLocalID*)current.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID())))
- if (anID->Value() == FILELOCALID) continue; //SRN: This attribute store a file name, skip it
-
- string persist_ref = Att->Value();
- SALOMEDSImpl_SObject so = SALOMEDSImpl_Study::SObject(current);
- string ior_string = driver->LocalPersistentIDToIOR(so,
- persist_ref,
- isMultiFile,
- isASCII);
- SALOMEDSImpl_AttributeIOR::Set (current, ior_string);
-
- }
- Translate_persistentID_to_IOR (current, driver, isMultiFile, isASCII);
- }
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_StudyBuilder.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSImpl_STUDYBUILDER_H__
-#define __SALOMEDSImpl_STUDYBUILDER_H__
-
-#include "SALOMEDSImpl_Defines.hxx"
-// std C++ headers
-#include <iostream>
-#include <string>
-#include <vector>
-
-#include "SALOMEDSImpl_Callback.hxx"
-#include "SALOMEDSImpl_Driver.hxx"
-
-class SALOMEDSImpl_Study;
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_StudyBuilder
-{
-private:
- DF_Document* _doc;
- SALOMEDSImpl_Study* _study;
- SALOMEDSImpl_Callback* _callbackOnAdd;
- SALOMEDSImpl_Callback* _callbackOnRemove;
- std::string _errorCode;
-
-public:
-
- SALOMEDSImpl_StudyBuilder(const SALOMEDSImpl_Study* theOwner);
-
- ~SALOMEDSImpl_StudyBuilder();
-
- virtual SALOMEDSImpl_SComponent NewComponent(const std::string& ComponentDataType);
-
- virtual bool DefineComponentInstance (const SALOMEDSImpl_SComponent&, const std::string& ComponentIOR);
-
- virtual bool RemoveComponent(const SALOMEDSImpl_SComponent& aComponent);
-
- virtual SALOMEDSImpl_SObject NewObject(const SALOMEDSImpl_SObject& theFatherObject);
-
- virtual SALOMEDSImpl_SObject NewObjectToTag(const SALOMEDSImpl_SObject& theFatherObject,
- const int theTag);
-
- //! The methods adds a new subdirectory, the path can be absolute or relative (then the current context is used)
- virtual bool AddDirectory(const std::string& thePath);
-
- virtual bool LoadWith(const SALOMEDSImpl_SComponent& sco, SALOMEDSImpl_Driver* Engine);
- virtual bool Load(const SALOMEDSImpl_SObject& sco);
-
- virtual bool RemoveObject(const SALOMEDSImpl_SObject& anObject);
- virtual bool RemoveObjectWithChildren(const SALOMEDSImpl_SObject& anObject);
-
- virtual DF_Attribute* FindOrCreateAttribute(const SALOMEDSImpl_SObject& anObject,
- const std::string& aTypeOfAttribute);
- virtual bool FindAttribute(const SALOMEDSImpl_SObject& anObject,
- DF_Attribute*& anAttribute,
- const std::string& aTypeOfAttribute);
-
- virtual bool RemoveAttribute(const SALOMEDSImpl_SObject& anObject, const std::string& aTypeOfAttribute);
-
- virtual bool Addreference(const SALOMEDSImpl_SObject& me,
- const SALOMEDSImpl_SObject& thereferencedObject);
-
- virtual bool RemoveReference(const SALOMEDSImpl_SObject& me);
-
- virtual bool SetGUID(const SALOMEDSImpl_SObject& anObject, const std::string& theGUID);
- virtual bool IsGUID(const SALOMEDSImpl_SObject& anObject, const std::string& theGUID);
-
- virtual void NewCommand();
- virtual void CommitCommand();
- virtual bool HasOpenCommand();
- virtual void AbortCommand();
- virtual void Undo();
- virtual void Redo();
- bool GetAvailableUndos();
- bool GetAvailableRedos();
- bool IsSaved();
- bool IsModified();
- virtual int UndoLimit();
- virtual void UndoLimit(const int);
-
- void CheckLocked();
-
- virtual SALOMEDSImpl_Callback* SetOnAddSObject(const SALOMEDSImpl_Callback* theCallback);
- virtual SALOMEDSImpl_Callback* SetOnRemoveSObject(const SALOMEDSImpl_Callback* theCallback);
-
- virtual bool SetName(const SALOMEDSImpl_SObject& theSO, const std::string& theValue);
-
- virtual bool SetComment(const SALOMEDSImpl_SObject& theSO, const std::string& theValue);
-
- virtual bool SetIOR(const SALOMEDSImpl_SObject& theSO, const std::string& theValue);
-
- virtual std::string GetErrorCode() { return _errorCode; }
- virtual bool IsError() { return _errorCode != ""; }
-
- virtual SALOMEDSImpl_Study* GetOwner() { return _study; }
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_StudyHandle.cxx
-// Author : Sergey LITONIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_StudyHandle.hxx"
-
-/*
- Class : SALOMEDSImpl_StudyHandle
- Description : This class is intended for storing information about
- graphic representation of objects in dirrent views
-*/
-
-
-//=======================================================================
-//function : GetID
-//purpose : Get GUID of this attribute
-//=======================================================================
-const std::string& SALOMEDSImpl_StudyHandle::GetID()
-{
- static std::string SALOMEDSImpl_StudyHandleID( "050C9555-4BA8-49bf-8F1C-086F0469A40B" );
- return SALOMEDSImpl_StudyHandleID;
-}
-
-//=======================================================================
-//function : SALOMEDSImpl_StudyHandle
-//purpose : Empty Constructor
-//=======================================================================
-SALOMEDSImpl_StudyHandle::SALOMEDSImpl_StudyHandle()
-{
- myHandle = NULL;
-}
-
-//=======================================================================
-//function : Set
-//purpose :
-//=======================================================================
-SALOMEDSImpl_StudyHandle* SALOMEDSImpl_StudyHandle::Set(const DF_Label& theLabel,
- SALOMEDSImpl_Study* theStudy)
-{
- SALOMEDSImpl_StudyHandle* A = NULL;
- if (!(A=(SALOMEDSImpl_StudyHandle*)theLabel.FindAttribute(GetID()))) {
- A = new SALOMEDSImpl_StudyHandle;
- theLabel.AddAttribute(A);
- }
-
- A->Set(theStudy);
- return A;
-}
-
-
-//=======================================================================
-//function : ID
-//purpose : Get GUID of this attribute
-//=======================================================================
-const std::string& SALOMEDSImpl_StudyHandle::ID () const
-{
- return GetID();
-}
-
-
-//=======================================================================
-//function : NewEmpty
-//purpose : Create new empty attribute
-//=======================================================================
-DF_Attribute* SALOMEDSImpl_StudyHandle::NewEmpty () const
-{
- return new SALOMEDSImpl_StudyHandle ();
-}
-
-
-//=======================================================================
-//function : Restore
-//purpose : Restore value of attribute with value of theWith one
-//=======================================================================
-void SALOMEDSImpl_StudyHandle::Restore( DF_Attribute* theWith )
-{
- SALOMEDSImpl_StudyHandle* anAttr = dynamic_cast<SALOMEDSImpl_StudyHandle*>( theWith );
- if ( anAttr ) Set ( anAttr->Get() );
-}
-
-//=======================================================================
-//function : Paste
-//purpose : Paste value of current attribute to the value of entry one
-//=======================================================================
-void SALOMEDSImpl_StudyHandle::Paste( DF_Attribute* theInto)
-{
- SALOMEDSImpl_StudyHandle* anAttr = dynamic_cast<SALOMEDSImpl_StudyHandle*>( theInto );
- if ( anAttr ) anAttr->Set ( myHandle );
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_StudyHandle.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef SALOMEDSImpl_StudyHandle_HeaderFile
-#define SALOMEDSImpl_StudyHandle_HeaderFile
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-
-/*
-Class : SALOMEDSImpl_StudyHandle
-Description : PRIVATE: This class is intended for storing of the study handle
-*/
-
-#include "SALOMEDSImpl_Study.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_StudyHandle :
- public DF_Attribute
-{
-
-public:
- SALOMEDSImpl_StudyHandle();
- ~SALOMEDSImpl_StudyHandle() {; }
-
- static SALOMEDSImpl_StudyHandle* Set(const DF_Label& theLabel, SALOMEDSImpl_Study* theStudy);
- static const std::string& GetID() ;
-
- void Set(SALOMEDSImpl_Study* theStudy) { myHandle = theStudy; }
- SALOMEDSImpl_Study* Get() { return myHandle; }
- const std::string& ID() const;
- void Restore( DF_Attribute* theWith );
- DF_Attribute* NewEmpty() const;
- void Paste( DF_Attribute* theInto);
-
-private:
- SALOMEDSImpl_Study* myHandle;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_StudyManager.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_StudyManager.hxx"
-
-#include "DF_ChildIterator.hxx"
-#include "HDFexplorer.hxx"
-
-#include "SALOMEDSImpl_Attributes.hxx"
-#include "SALOMEDSImpl_Tool.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-#include "SALOMEDSImpl_ScalarVariable.hxx"
-#include <map>
-
-#include "HDFOI.hxx"
-#include <iostream>
-#include <stdlib.h>
-#include <string.h>
-
-using namespace std;
-
-#define USE_CASE_LABEL_ID "0:2"
-
-static void SaveAttributes(const SALOMEDSImpl_SObject& SO, HDFgroup *hdf_group_sobject);
-static void ReadAttributes(SALOMEDSImpl_Study*, const SALOMEDSImpl_SObject&, HDFdataset* );
-static void BuildTree (SALOMEDSImpl_Study*, HDFgroup*);
-static void Translate_IOR_to_persistentID (const SALOMEDSImpl_SObject&,
- SALOMEDSImpl_Driver*, bool isMultiFile, bool isASCII);
-static void ReadNoteBookVariables(SALOMEDSImpl_Study* theStudy, HDFgroup* theGroup);
-
-//============================================================================
-/*! Function : SALOMEDSImpl_StudyManager
- * Purpose : SALOMEDSImpl_StudyManager constructor
- */
-//============================================================================
-SALOMEDSImpl_StudyManager::SALOMEDSImpl_StudyManager()
-{
- _errorCode = "";
- _appli = new DF_Application();
- _IDcounter = 0;
- _clipboard = _appli->NewDocument("SALOME_STUDY");
-}
-
-//============================================================================
-/*! Function : ~SALOMEDSImpl_StudyManager
- * Purpose : SALOMEDSImpl_StudyManager destructor
- */
-//============================================================================
-SALOMEDSImpl_StudyManager::~SALOMEDSImpl_StudyManager()
-{
- // Destroy application
- delete _appli;
-}
-
-
-//============================================================================
-/*! Function : NewStudy
- * Purpose : Create a New Study of name study_name
- */
-//==================================================T==========================
-SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::NewStudy(const string& study_name)
-{
- _errorCode = "";
-
- DF_Document* Doc = _appli->NewDocument("SALOME_STUDY");
-
- SALOMEDSImpl_Study* Study = new SALOMEDSImpl_Study(Doc, study_name);
-
- _IDcounter++;
- Study->StudyId( _IDcounter );
-
- // set Study properties
- SALOMEDSImpl_AttributeStudyProperties* aProp = Study->GetProperties();
-
- int month=0,day=0,year=0,hh=0,mn=0,ss=0;
- SALOMEDSImpl_Tool::GetSystemDate(year, month, day, hh, mn, ss);
- aProp->SetModification(SALOMEDSImpl_Tool::GetUserName(),
- mn, hh, day, month, year);
- aProp->SetCreationMode(1); //"from scratch"
-
- return Study;
-}
-
-//============================================================================
-/*! Function : Open
- * Purpose : Open a Study from it's persistent reference
- */
-//============================================================================
-SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const string& aUrl)
-{
- _errorCode = "";
-
- // open the HDFFile
- HDFfile *hdf_file =0;
- HDFgroup *hdf_group_study_structure =0;
- HDFgroup *hdf_notebook_vars = 0;
-
- char* aC_HDFUrl;
- string aHDFUrl;
- bool isASCII = false;
- if (HDFascii::isASCII(aUrl.c_str())) {
- isASCII = true;
- char* aResultPath = HDFascii::ConvertFromASCIIToHDF(aUrl.c_str());
- aC_HDFUrl = new char[strlen(aResultPath) + 19];
- sprintf(aC_HDFUrl, "%shdf_from_ascii.hdf", aResultPath);
- delete [] (aResultPath);
- aHDFUrl = aC_HDFUrl;
- delete [] aC_HDFUrl;
- } else {
- aHDFUrl = aUrl;
- }
-
-
- hdf_file = new HDFfile((char*)aHDFUrl.c_str());
- try {
- hdf_file->OpenOnDisk(HDF_RDONLY);// mpv: was RDWR, but opened file can be write-protected too
- }
- catch (HDFexception)
- {
- char *eStr;
- eStr = new char[strlen(aUrl.c_str())+17];
- sprintf(eStr,"Can't open file %s",aUrl.c_str());
- delete [] eStr;
- _errorCode = string(eStr);
- return NULL;
- }
-
- // Temporary aStudyUrl in place of study name
- DF_Document* Doc = _appli->NewDocument("SALOME_STUDY");
-
- SALOMEDSImpl_Study* Study = new SALOMEDSImpl_Study(Doc, aUrl);
-
- _IDcounter++;
- Study->StudyId( _IDcounter );
-
- // Assign the value of the URL in the study object
- Study->URL (aUrl);
-
- SALOMEDSImpl_AttributePersistentRef::Set(Doc->Main(), aUrl);
-
- if (!hdf_file->ExistInternalObject("STUDY_STRUCTURE")) {
- _errorCode = "Study is empty";
- return Study;
- }
-
- //Create the Structure of the Document
- hdf_group_study_structure = new HDFgroup("STUDY_STRUCTURE",hdf_file);
-
- try {
- BuildTree (Study, hdf_group_study_structure);
- }
- catch (HDFexception)
- {
- char *eStr = new char [strlen(aUrl.c_str())+17];
- sprintf(eStr,"Can't open file %s", aUrl.c_str());
- _errorCode = string(eStr);
- return NULL;
- }
-
- //Read and create notebook variables
- if(hdf_file->ExistInternalObject("NOTEBOOK_VARIABLES")) {
- hdf_notebook_vars = new HDFgroup("NOTEBOOK_VARIABLES",hdf_file);
- ReadNoteBookVariables(Study,hdf_notebook_vars);
- hdf_notebook_vars =0; //will be deleted by hdf_sco_group destructor
- }
-
- hdf_file->CloseOnDisk();
- hdf_group_study_structure = new HDFgroup("STUDY_STRUCTURE",hdf_file);
-
- if (isASCII) {
- vector<string> aFilesToRemove;
- aFilesToRemove.push_back("hdf_from_ascii.hdf");
- SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true);
- }
-
- delete hdf_file; // all related hdf objects will be deleted
-
- return Study;
-}
-
-
-
-//============================================================================
-/*! Function : Close
- * Purpose : Close a study.
- * If the study hasn't been saved, ask the user to confirm the
- * close action without saving
- */
-
-//============================================================================
-void SALOMEDSImpl_StudyManager::Close(SALOMEDSImpl_Study* aStudy)
-{
- _errorCode = "";
-
- if(!aStudy) {
- _errorCode = "Study is null";
- return;
- }
-
- aStudy->Close();
-}
-
-//============================================================================
-/*! Function : Save
- * Purpose : Save a Study to it's persistent reference
- */
-//============================================================================
-bool SALOMEDSImpl_StudyManager::Save(SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile)
-{
- _errorCode = "";
-
- string url = aStudy->URL();
- if (url.empty()) {
- _errorCode = "No path specified to save the study. Nothing done";
- return false;
- }
- else {
- return Impl_SaveAs(url,aStudy, aFactory, theMultiFile, false);
- }
-
- return false;
-}
-
-bool SALOMEDSImpl_StudyManager::SaveASCII(SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile)
-{
- _errorCode = "";
-
- string url = aStudy->URL();
- if (url.empty()) {
- _errorCode = "No path specified to save the study. Nothing done";
- return false;
- }
- else {
- return Impl_SaveAs(url,aStudy, aFactory, theMultiFile, true);
- }
-
- return false;
-}
-
-//=============================================================================
-/*! Function : SaveAs
- * Purpose : Save a study to the persistent reference aUrl
- */
-//============================================================================
-bool SALOMEDSImpl_StudyManager::SaveAs(const string& aUrl,
- SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile)
-{
- _errorCode = "";
- return Impl_SaveAs(aUrl,aStudy, aFactory, theMultiFile, false);
-}
-
-bool SALOMEDSImpl_StudyManager::SaveAsASCII(const string& aUrl,
- SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile)
-{
- _errorCode = "";
- return Impl_SaveAs(aUrl,aStudy, aFactory, theMultiFile, true);
-}
-
-//============================================================================
-/*! Function : GetOpenStudies
- * Purpose : Get name list of open studies in the session
- */
-//============================================================================
-vector<SALOMEDSImpl_Study*> SALOMEDSImpl_StudyManager::GetOpenStudies()
-{
- _errorCode = "";
- vector<SALOMEDSImpl_Study*> aList;
-
- int nbDocs = _appli->NbDocuments();
-
- if(nbDocs == 0) {
- _errorCode = "No active study in this session";
- return aList;
- }
- else {
- SALOMEDSImpl_Study* aStudy;
- vector<int> ids = _appli->GetDocumentIDs();
- for (int i = 0, len = ids.size(); i<len; i++) {
- DF_Document* D = _appli->GetDocument(ids[i]);
- if(D == _clipboard) continue;
- aStudy = SALOMEDSImpl_Study::GetStudy(D->Main());
- if(!aStudy) continue;
- aList.push_back(aStudy);
- }
- }
-
- return aList;
-}
-
-//============================================================================
-/*! Function : GetStudyByName
- * Purpose : Get a study from its name
- */
-//============================================================================
-SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::GetStudyByName
- (const string& aStudyName)
-{
- _errorCode = "";
- int nbDocs = _appli->NbDocuments();
-
- if (nbDocs == 0) {
- _errorCode = "No active study in this session";
- return NULL;
- }
- else {
- vector<SALOMEDSImpl_Study*> studies = GetOpenStudies();
- for (int i = 0, len = studies.size(); i<len; i++) {
- if (studies[i]->Name() == aStudyName) return studies[i];
- }
- }
-
- _errorCode = string("Found no study with the name ") + aStudyName;
- return NULL;
-}
-
-//============================================================================
-/*! Function : GetStudyByID
- * Purpose : Get a study from its ID
- */
-//============================================================================
-SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::GetStudyByID(int aStudyID)
-{
- _errorCode = "";
- int nbDocs = _appli->NbDocuments();
-
- if (nbDocs == 0) {
- _errorCode = "No active study in this session";
- return NULL;
- }
- else {
- vector<SALOMEDSImpl_Study*> studies = GetOpenStudies();
- for (int i = 0, len = studies.size(); i<len; i++) {
- if (studies[i]->StudyId() == aStudyID) return studies[i];
- }
- }
-
- _errorCode = "Found no study with the given ID";
- return NULL;
-}
-
-//=============================================================================
-/*! Function : _SaveProperties
- * Purpose : save the study properties in HDF file
- */
-//============================================================================
-bool SALOMEDSImpl_StudyManager::Impl_SaveProperties(SALOMEDSImpl_Study* aStudy,
- HDFgroup *hdf_group)
-{
- _errorCode = "";
-
- HDFdataset *hdf_dataset = 0;
- hdf_size size[1];
- hdf_int32 name_len;
-
- // add modifications list (user and date of save)
- SALOMEDSImpl_AttributeStudyProperties* aProp = aStudy->GetProperties();
- int aLocked = aProp->IsLocked();
- if (aLocked) aProp->SetLocked(false);
-
- int month=0,day=0,year=0,hh=0,mn=0,ss=0;
- SALOMEDSImpl_Tool::GetSystemDate(year, month, day, hh, mn, ss);
- aProp->SetModification(SALOMEDSImpl_Tool::GetUserName(),
- mn, hh, day, month, year);
-
- if (aLocked) aProp->SetLocked(true);
-
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
-
- aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
-
- int aLength = 0, anIndex, i;
- for(i=1; i<=aNames.size(); i++)
- aLength += aNames[i-1].size() + 1;
-
- //string length: 1 byte = locked flag, 1 byte = modified flag, (12 + name length + 1) for each name and date, "zero" byte
- char* aProperty = new char[3 + aLength + 12 * aNames.size()];
-
-
- sprintf(aProperty,"%c%c", (char)aProp->GetCreationMode(), (aProp->IsLocked())?'l':'u');
-
- aLength = aNames.size();
- int a = 2;
- for(anIndex = 0; anIndex<aLength; anIndex++) {
- sprintf(&(aProperty[a]),"%2d%2d%2d%2d%4d%s",
- (int)(aMinutes[anIndex]),
- (int)(aHours[anIndex]),
- (int)(aDays[anIndex]),
- (int)(aMonths[anIndex]),
- (int)(aYears[anIndex]),
- aNames[anIndex].c_str());
- a = strlen(aProperty);
- aProperty[a++] = 1;
- }
- aProperty[a] = 0;
-
- name_len = (hdf_int32) a;
- size[0] = name_len + 1 ;
- hdf_dataset = new HDFdataset("AttributeStudyProperties",hdf_group,HDF_STRING,size,1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk(aProperty);
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_group destructor
- delete [] aProperty;
-
- aProp->SetModified(0);
- return true;
-}
-
-//=============================================================================
-/*! Function : _SaveAs
- * Purpose : save the study in HDF file
- */
-//============================================================================
-bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aUrl,
- SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile,
- bool theASCII)
-{
- // HDF File will be composed of differents part :
- // * For each ComponentDataType, all data created by the component
- // Informations in data group hdf_group_datacomponent
- // * Study Structure -> Exactly what is contained in Document
- // Informations in data group hdf_group_study_structure
-
- _errorCode = "";
-
- HDFfile *hdf_file=0;
- HDFgroup *hdf_group_study_structure =0;
- HDFgroup *hdf_sco_group =0;
- HDFgroup *hdf_sco_group2 =0;
- HDFgroup *hdf_notebook_vars =0;
- HDFgroup *hdf_notebook_var = 0;
-
- HDFgroup *hdf_group_datacomponent =0;
- HDFdataset *hdf_dataset =0;
- hdf_size size[1];
- hdf_int32 name_len = 0;
- string component_name;
-
- if(!aStudy) {
- _errorCode = "Study is null";
- return false;
- }
-
- int aLocked = aStudy->GetProperties()->IsLocked();
- if (aLocked) aStudy->GetProperties()->SetLocked(false);
-
- SALOMEDSImpl_StudyBuilder* SB= aStudy->NewBuilder();
- map<string, SALOMEDSImpl_Driver*> aMapTypeDriver;
-
- try
- {
- // mpv 15.12.2003: for saving components we have to load all data from all modules
- SALOMEDSImpl_SComponentIterator itcomponent1 = aStudy->NewComponentIterator();
- for (; itcomponent1.More(); itcomponent1.Next())
- {
- SALOMEDSImpl_SComponent sco = itcomponent1.Value();
- // if there is an associated Engine call its method for saving
- string IOREngine;
- try {
- if (!sco.ComponentIOR(IOREngine)) {
- string aCompType = sco.GetComment();
- if (!aCompType.empty()) {
-
- SALOMEDSImpl_Driver* aDriver = aFactory->GetDriverByType(aCompType);
- aMapTypeDriver[aCompType] = aDriver;
-
- if (aDriver != NULL) {
- if(!SB->LoadWith(sco, aDriver)) {
- _errorCode = SB->GetErrorCode();
- return false;
- }
- }
- }
- }
- } catch(...) {
- _errorCode = "Can not restore information to resave it";
- return false;
- }
- }
-
- string anOldName = aStudy->Name();
- aStudy->URL(aUrl);
-
- // To change for Save
- // Do not have to do a new file but just a Open??? Rewrite all informations after erasing evrything??
- hdf_file = new HDFfile((char*)aUrl.c_str());
- hdf_file->CreateOnDisk();
-
- //-----------------------------------------------------------------------
- // 1 - Create a groupe for each SComponent and Update the PersistanceRef
- //-----------------------------------------------------------------------
- hdf_group_datacomponent = new HDFgroup("DATACOMPONENT",hdf_file);
- hdf_group_datacomponent->CreateOnDisk();
-
- SALOMEDSImpl_SComponentIterator itcomponent = aStudy->NewComponentIterator();
-
- for (; itcomponent.More(); itcomponent.Next())
- {
- SALOMEDSImpl_SComponent sco = itcomponent.Value();
-
- string scoid = sco.GetID();
- hdf_sco_group = new HDFgroup((char*)scoid.c_str(), hdf_group_datacomponent);
- hdf_sco_group->CreateOnDisk();
-
- string componentDataType = sco.ComponentDataType();
- string IOREngine;
- if (sco.ComponentIOR(IOREngine))
- {
- SALOMEDSImpl_Driver* Engine = NULL;
- if(aMapTypeDriver.find(componentDataType) != aMapTypeDriver.end()) {
- // we have found the associated engine to write the data
- Engine = aMapTypeDriver[componentDataType];
- }
- else {
- Engine = aFactory->GetDriverByIOR(IOREngine);
- }
-
- if (Engine != NULL)
- {
- SALOMEDSImpl_TMPFile* aStream = NULL;
- long length = 0;
-
- if (theASCII) aStream = Engine->SaveASCII(sco,
- SALOMEDSImpl_Tool::GetDirFromPath(aUrl),
- length,
- theMultiFile);
- else aStream = Engine->Save(sco,
- SALOMEDSImpl_Tool::GetDirFromPath(aUrl),
- length,
- theMultiFile);
- HDFdataset *hdf_dataset;
- hdf_size aHDFSize[1];
- if(length > 0) { //The component saved some auxiliary files, then put them into HDF file
-
- aHDFSize[0] = length;
-
- HDFdataset *hdf_dataset = new HDFdataset("FILE_STREAM", hdf_sco_group, HDF_STRING, aHDFSize, 1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk(aStream->Data()); //Save the stream in the HDF file
- hdf_dataset->CloseOnDisk();
- }
-
- if(aStream) delete aStream;
-
- // store multifile state
- aHDFSize[0] = 2;
- hdf_dataset = new HDFdataset("MULTIFILE_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((void*)(theMultiFile?"M":"S")); // save: multi or single
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor
- // store ASCII state
- aHDFSize[0] = 2;
- hdf_dataset = new HDFdataset("ASCII_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((void*)(theASCII?"A":"B")); // save: ASCII or BINARY
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor
- // Creation of the persistance reference attribute
- Translate_IOR_to_persistentID (sco, Engine, theMultiFile, theASCII);
- }
- }
- hdf_sco_group->CloseOnDisk();
- hdf_sco_group=0; // will be deleted by hdf_group_datacomponent destructor
- }
- hdf_group_datacomponent->CloseOnDisk();
- hdf_group_datacomponent =0; // will be deleted by hdf_file destructor
-
- //-----------------------------------------------------------------------
- //3 - Write the Study Structure
- //-----------------------------------------------------------------------
- hdf_group_study_structure = new HDFgroup("STUDY_STRUCTURE",hdf_file);
- hdf_group_study_structure->CreateOnDisk();
- // save component attributes
- SALOMEDSImpl_SComponentIterator itcomp = aStudy->NewComponentIterator();
- for (; itcomp.More(); itcomp.Next())
- {
- SALOMEDSImpl_SComponent SC = itcomp.Value();
- string scid = SC.GetID();
- hdf_sco_group2 = new HDFgroup((char*)scid.c_str(), hdf_group_study_structure);
- hdf_sco_group2->CreateOnDisk();
- SaveAttributes(SC, hdf_sco_group2);
- // ComponentDataType treatment
- component_name = SC.ComponentDataType();
- name_len = (hdf_int32)component_name.length();
- size[0] = name_len +1 ;
- hdf_dataset = new HDFdataset("COMPONENTDATATYPE",hdf_sco_group2,HDF_STRING,size,1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((char*)component_name.c_str());
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_group destructor
- Impl_SaveObject(SC, hdf_sco_group2);
- hdf_sco_group2->CloseOnDisk();
- hdf_sco_group2=0; // will be deleted by hdf_group_study_structure destructor
- }
- //-----------------------------------------------------------------------
- //4 - Write the Study UseCases Structure
- //-----------------------------------------------------------------------
- SALOMEDSImpl_SObject aSO = aStudy->FindObjectID(USE_CASE_LABEL_ID);
- if (aSO) {
- HDFgroup *hdf_soo_group = new HDFgroup(USE_CASE_LABEL_ID,hdf_group_study_structure);
- hdf_soo_group->CreateOnDisk();
- SaveAttributes(aSO, hdf_soo_group);
- Impl_SaveObject(aSO, hdf_soo_group);
- hdf_soo_group->CloseOnDisk();
- hdf_soo_group=0; // will be deleted by hdf_group_study_structure destructor
- }
- //-----------------------------------------------------------------------
- //5 - Write the NoteBook Variables
- //-----------------------------------------------------------------------
-
- //5.1 Create group to store all note book variables
- hdf_notebook_vars = new HDFgroup("NOTEBOOK_VARIABLES",hdf_file);
- hdf_notebook_vars->CreateOnDisk();
-
- string varValue;
- string varType;
- string varIndex;
-
- for(int i=0 ;i < aStudy->myNoteBookVars.size(); i++ ){
- // For each variable create HDF group
- hdf_notebook_var = new HDFgroup((char*)aStudy->myNoteBookVars[i]->Name().c_str(),hdf_notebook_vars);
- hdf_notebook_var->CreateOnDisk();
-
- // Save Variable type
- varType = aStudy->myNoteBookVars[i]->SaveType();
- name_len = (hdf_int32) varType.length();
- size[0] = name_len +1 ;
- hdf_dataset = new HDFdataset("VARIABLE_TYPE",hdf_notebook_var,HDF_STRING,size,1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((char*)varType.c_str());
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_group destructor
-
- char buffer[256];
- sprintf(buffer,"%d",i);
- varIndex= string(buffer);
- name_len = (hdf_int32) varIndex.length();
- size[0] = name_len +1 ;
- hdf_dataset = new HDFdataset("VARIABLE_INDEX",hdf_notebook_var,HDF_STRING,size,1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((char*)varIndex.c_str());
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_group destructor
-
-
- // Save Variable value
- varValue = aStudy->myNoteBookVars[i]->Save();
- name_len = (hdf_int32) varValue.length();
- size[0] = name_len +1 ;
- hdf_dataset = new HDFdataset("VARIABLE_VALUE",hdf_notebook_var,HDF_STRING,size,1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((char*)varValue.c_str());
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_group destructor
- hdf_notebook_var->CloseOnDisk();
- hdf_notebook_var = 0; //will be deleted by hdf_sco_group destructor
- }
- hdf_notebook_vars->CloseOnDisk();
- hdf_notebook_vars = 0; //will be deleted by hdf_sco_group destructor
-
- if (aLocked) aStudy->GetProperties()->SetLocked(true);
- //-----------------------------------------------------------------------
- //6 - Write the Study Properties
- //-----------------------------------------------------------------------
- string study_name = aStudy->Name();
- name_len = (hdf_int32) study_name.size();
- size[0] = name_len +1 ;
- hdf_dataset = new HDFdataset("STUDY_NAME",hdf_group_study_structure,HDF_STRING,size,1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((char*)study_name.c_str());
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; // will be deleted by hdf_group_study_structure destructor
-
- Impl_SaveProperties(aStudy, hdf_group_study_structure);
- hdf_group_study_structure->CloseOnDisk();
- hdf_file->CloseOnDisk();
-
- aStudy->IsSaved(true);
- hdf_group_study_structure =0; // will be deleted by hdf_file destructor
- delete hdf_file; // recursively deletes all hdf objects...
- }
- catch (HDFexception)
- {
- _errorCode = "HDFexception ! ";
- return false;
- }
- catch(std::exception& exc)
- {
- _errorCode = const_cast<char*>(exc.what());
- return false;
- }
- catch(...)
- {
- _errorCode = "Unknown exception ! ";
- return false;
- }
- if (theASCII) { // save file in ASCII format
- HDFascii::ConvertFromHDFToASCII(aUrl.c_str(), true);
- }
-
- return true;
-}
-
-//============================================================================
-/*! Function : Impl_SaveObject
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyManager::Impl_SaveObject(const SALOMEDSImpl_SObject& SC,
- HDFgroup *hdf_group_datatype)
-{
- _errorCode = "";
-
- // Write in group hdf_group_datatype all informations of SObject SC
- // Iterative function to parse all SObjects under a SComponent
-
- HDFgroup *hdf_group_sobject = 0;
-
- DF_ChildIterator itchild(SC.GetLabel());
- for (; itchild.More(); itchild.Next())
- {
-
- // mpv: don't save empty labels
- vector<DF_Attribute*> attr = itchild.Value().GetAttributes();
- if (attr.size() == 0) { //No attributes on the label
- DF_ChildIterator subchild(itchild.Value());
- if (!subchild.More()) {
- continue;
- }
- subchild.Init(itchild.Value(), true);
- bool anEmpty = true;
- for (; subchild.More() && anEmpty; subchild.Next()) {
- vector<DF_Attribute*> attr2 = subchild.Value().GetAttributes();
- if (attr2.size()) {
- anEmpty = false; //There are attributes on the child label
- break;
- }
- }
- if (anEmpty) continue;
- }
-
- SALOMEDSImpl_SObject SO = SALOMEDSImpl_Study::SObject(itchild.Value());
-
- string scoid = SO.GetID();
- hdf_group_sobject = new HDFgroup(scoid.c_str(), hdf_group_datatype);
- hdf_group_sobject->CreateOnDisk();
- SaveAttributes(SO, hdf_group_sobject);
- Impl_SaveObject(SO, hdf_group_sobject);
- hdf_group_sobject->CloseOnDisk();
- hdf_group_sobject =0; // will be deleted by father hdf object destructor
- }
-
- return true;
-}
-
-//============================================================================
-/*! Function : Impl_SubstituteSlash
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_StudyManager::Impl_SubstituteSlash(const string& aUrl)
-{
- _errorCode = "";
-
- std::string theUrl(aUrl);
- for(int i = 0; i<theUrl.size(); i++)
- if(theUrl[i] == '/') theUrl[i] = ':';
- return theUrl;
-}
-
-//============================================================================
-/*! Function : GetDocumentOfStudy
- * Purpose :
- */
-//============================================================================
-DF_Document* SALOMEDSImpl_StudyManager::GetDocumentOfStudy(SALOMEDSImpl_Study* theStudy)
-{
- _errorCode = "";
- return theStudy->_doc;
-}
-
-//============================================================================
-/*! Function : CanCopy
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyManager::CanCopy(const SALOMEDSImpl_SObject& theObject,
- SALOMEDSImpl_Driver* theEngine)
-{
- _errorCode = "";
- SALOMEDSImpl_SComponent aComponent = theObject.GetFatherComponent();
- if (!aComponent) return false;
- if (aComponent.GetLabel() == theObject.GetLabel()) return false;
- string IOREngine;
- if (!aComponent.ComponentIOR(IOREngine)) return false;
- if (theEngine == NULL) return false;
- return theEngine->CanCopy(theObject);
-}
-
-//============================================================================
-/*! Function : CopyLabel
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyManager::CopyLabel(SALOMEDSImpl_Study* theSourceStudy,
- SALOMEDSImpl_Driver* theEngine,
- const int theSourceStartDepth,
- const DF_Label& theSource,
- const DF_Label& theDestinationMain)
-{
- _errorCode = "";
-
- int a;
- DF_Label aTargetLabel = theDestinationMain;
- DF_Label aAuxTargetLabel = theDestinationMain.Father().FindChild(2);
- for(a = theSource.Depth() - theSourceStartDepth; a > 0 ; a--) {
- DF_Label aSourceLabel = theSource;
- for(int aNbFather = 1; aNbFather < a; aNbFather++) aSourceLabel = aSourceLabel.Father();
- aTargetLabel = aTargetLabel.FindChild(aSourceLabel.Tag());
- aAuxTargetLabel = aAuxTargetLabel.FindChild(aSourceLabel.Tag());
- }
- // iterate attributes
- vector<DF_Attribute*> attrList = theSource.GetAttributes();
- for(int i = 0, len = attrList.size(); i<len; i++) {
- DF_Attribute* anAttr = attrList[i];
- string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(anAttr);
- if (type.substr(0, 17) == string("AttributeTreeNode")) continue; // never copy tree node attribute
- if (type == string("AttributeTarget")) continue; // and target attribute
-
- if (type == string("AttributeReference")) { // reference copied as Comment in aux tree
- DF_Label aReferenced = dynamic_cast<SALOMEDSImpl_AttributeReference*>(anAttr)->Get();
- string anEntry = aReferenced.Entry();
- // store the value of name attribute of referenced label
- SALOMEDSImpl_AttributeName* aNameAttribute;
- if ((aNameAttribute=(SALOMEDSImpl_AttributeName*)aReferenced.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) {
- anEntry += " ";
- anEntry += aNameAttribute->Value();
- }
- SALOMEDSImpl_AttributeComment::Set(aAuxTargetLabel, anEntry);
- continue;
- }
-
- if (type == string("AttributeIOR")) { // IOR => ID and TMPFile of Engine
- string anEntry = theSource.Entry();
- SALOMEDSImpl_SObject aSO = theSourceStudy->FindObjectID(anEntry);
- int anObjID;
- long aLen;
- SALOMEDSImpl_TMPFile* aStream = theEngine->CopyFrom(aSO, anObjID, aLen);
- string aResStr("");
- for(a = 0; a < aLen; a++) {
- aResStr += (char)(aStream->Get(a));
- }
-
- if(aStream) delete aStream;
-
- SALOMEDSImpl_AttributeInteger::Set(aAuxTargetLabel, anObjID);
- SALOMEDSImpl_AttributeName::Set(aAuxTargetLabel, aResStr);
- continue;
- }
- DF_Attribute* aNewAttribute = anAttr->NewEmpty();
- aTargetLabel.AddAttribute(aNewAttribute);
- anAttr->Paste(aNewAttribute);
- }
-
- return true;
-}
-
-//============================================================================
-/*! Function : Copy
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyManager::Copy(const SALOMEDSImpl_SObject& theObject,
- SALOMEDSImpl_Driver* theEngine)
-{
- _errorCode = "";
-
- // adoptation for alliances datamodel copy: without IOR attributes !!!
- bool aStructureOnly; // copy only SObjects and attributes without component help
- aStructureOnly = !theObject.GetLabel().IsAttribute(SALOMEDSImpl_AttributeIOR::GetID());
-
- // get component-engine
- SALOMEDSImpl_Study* aStudy = theObject.GetStudy();
-
- // CAF document of current study usage
- DF_Document* aDocument = GetDocumentOfStudy(aStudy);
- if (!aDocument) {
- _errorCode = "Document is null";
- return false;
- }
-
- //Clear the clipboard
- _clipboard->Main().Root().ForgetAllAttributes(true);
- _appli->Close(_clipboard);
- _clipboard = _appli->NewDocument("SALOME_STUDY");
-
- // set component data type to the name attribute of root label
- if (!aStructureOnly) {
- SALOMEDSImpl_AttributeComment::Set(_clipboard->Main().Root(),
- theEngine->ComponentDataType());
- }
- // set to the Root label integer attribute: study id
- SALOMEDSImpl_AttributeInteger::Set(_clipboard->Main().Root(), aStudy->StudyId());
- // iterate all theObject's label children
- DF_Label aStartLabel = theObject.GetLabel();
- int aSourceStartDepth = aStartLabel.Depth();
-
- // copy main source label
- CopyLabel(aStudy, theEngine, aSourceStartDepth, aStartLabel, _clipboard->Main());
-
- // copy all subchildren of the main source label (all levels)
- DF_ChildIterator anIterator(aStartLabel, true);
- for(; anIterator.More(); anIterator.Next()) {
- CopyLabel(aStudy, theEngine, aSourceStartDepth, anIterator.Value(), _clipboard->Main());
- }
-
- return true;
-}
-//============================================================================
-/*! Function : CanPaste
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_StudyManager::CanPaste(const SALOMEDSImpl_SObject& theObject,
- SALOMEDSImpl_Driver* theEngine)
-{
- _errorCode = "";
-
- if (!_clipboard) {
- _errorCode = "Clipboard is null";
- return false;
- }
-
- SALOMEDSImpl_AttributeComment* aCompName = NULL;
- if (!(aCompName=(SALOMEDSImpl_AttributeComment*)_clipboard->Main().Root().FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) {
- _errorCode = "Clipboard has no component type";
- return false;
- }
- SALOMEDSImpl_AttributeInteger* anObjID;
- if (!(anObjID=(SALOMEDSImpl_AttributeInteger*)_clipboard->Main().Father().FindChild(2).FindAttribute(SALOMEDSImpl_AttributeInteger::GetID()))) {
- _errorCode = "Clipboard has no object id";
- return false;
- }
- SALOMEDSImpl_SComponent aComponent = theObject.GetFatherComponent();
- if (!aComponent) {
- _errorCode = "Object doesn't belong to component";
- return false;
- }
-
- string IOREngine;
- if (!aComponent.ComponentIOR(IOREngine)) {
- _errorCode = "component has no IOR";
- return false;
- }
- return theEngine->CanPaste(aCompName->Value(), anObjID->Value());
-}
-
-//============================================================================
-/*! Function : PasteLabel
- * Purpose :
- */
-//============================================================================
-DF_Label SALOMEDSImpl_StudyManager::PasteLabel(SALOMEDSImpl_Study* theDestinationStudy,
- SALOMEDSImpl_Driver* theEngine,
- const DF_Label& theSource,
- const DF_Label& theDestinationStart,
- const int theCopiedStudyID,
- const bool isFirstElement)
-{
- _errorCode = "";
-
- // get corresponding source, target and auxiliary labels
- DF_Label aTargetLabel = theDestinationStart;
-
- DF_Label aAuxSourceLabel = theSource.Root().FindChild(2);
- int a;
- if (!isFirstElement) {
- for(a = theSource.Depth() - 1; a > 0 ; a--) {
- DF_Label aSourceLabel = theSource;
- for(int aNbFather = 1; aNbFather < a; aNbFather++) aSourceLabel = aSourceLabel.Father();
- aTargetLabel = aTargetLabel.FindChild(aSourceLabel.Tag());
- aAuxSourceLabel = aAuxSourceLabel.FindChild(aSourceLabel.Tag());
- }
- }
-
- // check auxiliary label for TMPFile => IOR
- SALOMEDSImpl_AttributeName* aNameAttribute = NULL;
- if ((aNameAttribute=(SALOMEDSImpl_AttributeName*)aAuxSourceLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) {
- SALOMEDSImpl_AttributeInteger* anObjID = (SALOMEDSImpl_AttributeInteger*)aAuxSourceLabel.FindAttribute(SALOMEDSImpl_AttributeInteger::GetID());
- SALOMEDSImpl_AttributeComment* aComponentName = (SALOMEDSImpl_AttributeComment*)theSource.Root().FindAttribute(SALOMEDSImpl_AttributeComment::GetID());
- string aCompName = aComponentName->Value();
-
- if (theEngine->CanPaste(aCompName, anObjID->Value())) {
- std::string aTMPStr = aNameAttribute->Value();
- int aLen = aTMPStr.size();
- unsigned char* aStream = NULL;
- if(aLen > 0) {
- aStream = new unsigned char[aLen+10];
- for(a = 0; a < aLen; a++) {
- aStream[a] = aTMPStr[a];
- }
- }
-
- string anEntry = aTargetLabel.Entry();
- SALOMEDSImpl_SObject aPastedSO = theDestinationStudy->FindObjectID(anEntry);
-
- if (isFirstElement) {
- string aDestEntry = theEngine->PasteInto(aStream,
- aLen,
- anObjID->Value(),
- aPastedSO.GetFatherComponent());
- aTargetLabel = DF_Label::Label(theDestinationStart, aDestEntry);
- } else
- theEngine->PasteInto(aStream, aLen, anObjID->Value(), aPastedSO);
-
- if(aStream != NULL) delete []aStream;
- }
- }
-
- // iterate attributes
- vector<DF_Attribute*> attrList = theSource.GetAttributes();
- for(int i = 0, len = attrList.size(); i<len; i++) {
- DF_Attribute* anAttr = attrList[i];
- if (aTargetLabel.FindAttribute(anAttr->ID())) {
- aTargetLabel.ForgetAttribute(anAttr->ID());
- }
- DF_Attribute* aNewAttribute = anAttr->NewEmpty();
- aTargetLabel.AddAttribute(aNewAttribute);
- anAttr->Paste(aNewAttribute);
- }
-
- // check auxiliary label for Comment => reference or name attribute of the referenced object
- SALOMEDSImpl_AttributeComment* aCommentAttribute = NULL;
- if ((aCommentAttribute=(SALOMEDSImpl_AttributeComment*)aAuxSourceLabel.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) {
- char * anEntry = new char[aCommentAttribute->Value().size() + 1];
- strcpy(anEntry, string(aCommentAttribute->Value()).c_str());
- char* aNameStart = strchr(anEntry, ' ');
- if (aNameStart) {
- *aNameStart = '\0';
- aNameStart++;
- }
- if (theCopiedStudyID == theDestinationStudy->StudyId()) { // if copy to the same study, reanimate reference
- DF_Label aRefLabel = DF_Label::Label(aTargetLabel, anEntry);
- SALOMEDSImpl_AttributeReference::Set(aTargetLabel, aRefLabel);
- // target attributes structure support
- SALOMEDSImpl_AttributeTarget::Set(aRefLabel)->Add(SALOMEDSImpl_Study::SObject(aTargetLabel));
- } else {
- if (aNameStart) SALOMEDSImpl_AttributeName::Set(aTargetLabel, aNameStart);
- else SALOMEDSImpl_AttributeName::Set(aTargetLabel, std::string("Reference to:")+anEntry);
- }
- delete [] anEntry;
- }
-
- return aTargetLabel;
-}
-
-//============================================================================
-/*! Function : Paste
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_StudyManager::Paste(const SALOMEDSImpl_SObject& theObject,
- SALOMEDSImpl_Driver* theEngine)
-{
- _errorCode = "";
-
- SALOMEDSImpl_SObject so;
- SALOMEDSImpl_Study* aStudy = theObject.GetStudy();
-
- // if study is locked, then paste can't be done
- if (aStudy->GetProperties()->IsLocked()) {
- _errorCode = "LockProtection";
- throw LockProtection("LockProtection");
- }
-
- // if there is no component name, then paste only SObjects and attributes: without component help
- SALOMEDSImpl_AttributeComment* aComponentName = NULL;
- bool aStructureOnly = !(aComponentName=(SALOMEDSImpl_AttributeComment*)_clipboard->Main().Root().FindAttribute(SALOMEDSImpl_AttributeComment::GetID()));
-
- // get copied study ID
- SALOMEDSImpl_AttributeInteger* aStudyIDAttribute = NULL;
- if (!(aStudyIDAttribute=(SALOMEDSImpl_AttributeInteger*)_clipboard->Main().Root().FindAttribute(SALOMEDSImpl_AttributeInteger::GetID()))) {
- _errorCode = "No study ID was found";
- return so;
- }
- int aCStudyID = aStudyIDAttribute->Value();
-
- // CAF document of current study usage
- DF_Document* aDocument = GetDocumentOfStudy(aStudy);
- if (!aDocument) {
- _errorCode = "Document is null";
- return so;
- }
-
- SALOMEDSImpl_SComponent aComponent = theObject.GetFatherComponent();
-
- // fill root inserted SObject
- DF_Label aStartLabel;
- if (aStructureOnly) {
- DF_Label anObjectLabel = DF_Label::Label(aDocument->Main(), theObject.GetID());
- aStartLabel = PasteLabel(aStudy, theEngine, _clipboard->Main(), anObjectLabel, aCStudyID, false);
- } else {
- DF_Label aComponentLabel = DF_Label::Label(aDocument->Main(), aComponent.GetID());
- aStartLabel = PasteLabel(aStudy, theEngine, _clipboard->Main(), aComponentLabel, aCStudyID, true);
- }
-
- // paste all sublebels
- DF_ChildIterator anIterator(_clipboard->Main(), true);
- for(; anIterator.More(); anIterator.Next()) {
- PasteLabel(aStudy, theEngine, anIterator.Value(), aStartLabel, aCStudyID, false);
- }
-
- return SALOMEDSImpl_Study::SObject(aStartLabel);
-}
-
-//#######################################################################################################
-//# STATIC PRIVATE FUNCTIONS
-//#######################################################################################################
-
-//============================================================================
-/*! Function : SaveAttributes
- * Purpose : Save attributes for object
- */
-//============================================================================
-static void SaveAttributes(const SALOMEDSImpl_SObject& aSO, HDFgroup *hdf_group_sobject)
-{
- hdf_size size[1];
- vector<DF_Attribute*> attrList = aSO.GetLabel().GetAttributes();
- DF_Attribute* anAttr = NULL;
- for(int i = 0, len = attrList.size(); i<len; i++) {
- anAttr = attrList[i];
- //The following attributes are not supposed to be written to the file
- string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(anAttr);
- if(type == string("AttributeIOR")) continue; //IOR attribute is not saved
- string aSaveStr =anAttr->Save();
- //cout << "Saving: " << aSO.GetID() << " type: "<< type<<"|" << endl;
- size[0] = (hdf_int32) strlen(aSaveStr.c_str()) + 1;
- HDFdataset *hdf_dataset = new HDFdataset((char*)type.c_str(), hdf_group_sobject, HDF_STRING,size, 1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((char*)aSaveStr.c_str());
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_group destructor
- }
-}
-
-//===========================================================================
-//Function : ReadAttributes
-//===========================================================================
-static void ReadAttributes(SALOMEDSImpl_Study* theStudy,
- const SALOMEDSImpl_SObject& aSO,
- HDFdataset* hdf_dataset)
-{
- hdf_dataset->OpenOnDisk();
-
- DF_Attribute* anAttr = NULL;
- char* current_string = new char[hdf_dataset->GetSize()+1];
- hdf_dataset->ReadFromDisk(current_string);
- //cout << "Reading attr type = " << hdf_dataset->GetName() << " SO = " << aSO.GetID() << endl;
- if (!strcmp(hdf_dataset->GetName(),"COMPONENTDATATYPE")) {
- anAttr = theStudy->NewBuilder()->FindOrCreateAttribute(aSO, "AttributeComment");
- } else if (!strcmp(hdf_dataset->GetName(),"AttributeReference") ||
- !strcmp(hdf_dataset->GetName(),"Reference")) { // Old format maintainance
- theStudy->NewBuilder()->Addreference(aSO, theStudy->CreateObjectID(current_string));
- delete [] (current_string);
- hdf_dataset->CloseOnDisk();
- return;
- } else {
- anAttr = theStudy->NewBuilder()->FindOrCreateAttribute(aSO, hdf_dataset->GetName());
- }
-
- if (anAttr) {
- anAttr->Load(current_string);
- }
-
- delete [] (current_string);
- hdf_dataset->CloseOnDisk();
-}
-
-//============================================================================
-//Function : BuildlTree
-//============================================================================
-static void BuildTree (SALOMEDSImpl_Study* theStudy, HDFgroup* hdf_current_group)
-{
- hdf_current_group->OpenOnDisk();
- SALOMEDSImpl_SObject aSO;
- char* Entry = hdf_current_group->GetName();
- if (strcmp(Entry,"STUDY_STRUCTURE") == 0) {
- aSO = theStudy->CreateObjectID("0:1");
- }
- else {
- aSO = theStudy->CreateObjectID(Entry);
- }
-
- char name[HDF_NAME_MAX_LEN+1];
- int nbsons = hdf_current_group->nInternalObjects();
- for (int i=0; i<nbsons; i++) {
- hdf_current_group->InternalObjectIndentify(i,name);
- if (strncmp(name, "INTERNAL_COMPLEX",16) == 0) continue;
- hdf_object_type type = hdf_current_group->InternalObjectType(name);
-
- if (type == HDF_DATASET) {
- HDFdataset* new_dataset = new HDFdataset(name,hdf_current_group);
- ReadAttributes(theStudy,aSO,new_dataset);
- new_dataset = 0; // will be deleted by father destructor
-
- }
- else if (type == HDF_GROUP) {
- HDFgroup* new_group = new HDFgroup(name,hdf_current_group);
- BuildTree (theStudy, new_group);
- new_group = 0; // will be deleted by father destructor
- }
- }
- hdf_current_group->CloseOnDisk();
-}
-
-
-//============================================================================
-//Function : Translate_IOR_to_persistentID
-//============================================================================
-static void Translate_IOR_to_persistentID (const SALOMEDSImpl_SObject& so,
- SALOMEDSImpl_Driver* engine,
- bool isMultiFile,
- bool isASCII)
-{
- DF_ChildIterator itchild(so.GetLabel());
- string ior_string, persistent_string, curid;
-
- for (; itchild.More(); itchild.Next()) {
- SALOMEDSImpl_SObject current = SALOMEDSImpl_Study::SObject(itchild.Value());
- SALOMEDSImpl_AttributeIOR* IOR = NULL;
- if ((IOR=(SALOMEDSImpl_AttributeIOR*)current.GetLabel().FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) {
- ior_string = IOR->Value();
-
- persistent_string = engine->IORToLocalPersistentID (current, ior_string, isMultiFile, isASCII);
- SALOMEDSImpl_AttributePersistentRef::Set(current.GetLabel(), persistent_string);
- }
- Translate_IOR_to_persistentID (current, engine, isMultiFile, isASCII);
- }
-}
-
-void ReadNoteBookVariables(SALOMEDSImpl_Study* theStudy, HDFgroup* theGroup)
-{
- if(!theGroup)
- return;
-
- HDFgroup* new_group =0;
- HDFdataset* new_dataset =0;
-
- char aVarName[HDF_NAME_MAX_LEN+1];
- char *currentVarType = 0;
- char *currentVarValue = 0;
- char *currentVarIndex = 0;
- int order = 0;
- //Open HDF group with notebook variables
- theGroup->OpenOnDisk();
-
- //Get Nb of variables
- int aNbVars = theGroup->nInternalObjects();
-
- map<int,SALOMEDSImpl_GenericVariable*> aVarsMap;
-
- for( int iVar=0;iVar < aNbVars;iVar++ ) {
- theGroup->InternalObjectIndentify(iVar,aVarName);
- hdf_object_type type = theGroup->InternalObjectType(aVarName);
- if(type == HDF_GROUP) {
-
- //Read Variable
- new_group = new HDFgroup(aVarName,theGroup);
- new_group->OpenOnDisk();
-
- //Read Type
- new_dataset = new HDFdataset("VARIABLE_TYPE",new_group);
- new_dataset->OpenOnDisk();
- currentVarType = new char[new_dataset->GetSize()+1];
- new_dataset->ReadFromDisk(currentVarType);
- new_dataset->CloseOnDisk();
- new_dataset = 0; //will be deleted by hdf_sco_group destructor
-
- //Read Order
- if(new_group->ExistInternalObject("VARIABLE_INDEX")) {
- new_dataset = new HDFdataset("VARIABLE_INDEX",new_group);
- new_dataset->OpenOnDisk();
- currentVarIndex = new char[new_dataset->GetSize()+1];
- new_dataset->ReadFromDisk(currentVarIndex);
- new_dataset->CloseOnDisk();
- new_dataset = 0; //will be deleted by hdf_sco_group destructor
- order = atoi(currentVarIndex);
- delete [] currentVarIndex;
- }
- else
- order = iVar;
-
- //Read Value
- new_dataset = new HDFdataset("VARIABLE_VALUE",new_group);
- new_dataset->OpenOnDisk();
- currentVarValue = new char[new_dataset->GetSize()+1];
- new_dataset->ReadFromDisk(currentVarValue);
- new_dataset->CloseOnDisk();
- new_dataset = 0; //will be deleted by hdf_sco_group destructor
-
- new_group->CloseOnDisk();
- new_group = 0; //will be deleted by hdf_sco_group destructor
-
- SALOMEDSImpl_GenericVariable::VariableTypes aVarType =
- SALOMEDSImpl_GenericVariable::String2VariableType(string(currentVarType));
- delete [] currentVarType;
-
- //Create variable and add it in the study
- SALOMEDSImpl_GenericVariable* aVariable =
- new SALOMEDSImpl_ScalarVariable(aVarType,string(aVarName));
- aVariable->Load(string(currentVarValue));
- aVarsMap.insert(make_pair<int,SALOMEDSImpl_GenericVariable*>(order,aVariable));
- delete [] currentVarValue;
- }
- }
-
- map<int,SALOMEDSImpl_GenericVariable*>::const_iterator it= aVarsMap.begin();
- for(;it!=aVarsMap.end();it++)
- theStudy->AddVariable((*it).second);
-
- theGroup->CloseOnDisk();
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_StudyManager.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSImpl_STUDYMANAGER_I_H__
-#define __SALOMEDSImpl_STUDYMANAGER_I_H__
-
-#include "SALOMEDSImpl_Defines.hxx"
-
-// std C++ headers
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "DF_Application.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_Driver.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include "DF_Document.hxx"
-
-class HDFgroup;
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_StudyManager
-{
-
-private:
-
- DF_Application* _appli;
- int _IDcounter;
- DF_Document* _clipboard;
- std::string _errorCode;
-
-public:
-
- //! standard constructor
- SALOMEDSImpl_StudyManager();
-
- //! standard destructor
- virtual ~SALOMEDSImpl_StudyManager();
-
- //! method to Create a New Study of name study_name
- virtual SALOMEDSImpl_Study* NewStudy(const std::string& study_name);
-
- //! method to Open a Study from it's persistent reference
- virtual SALOMEDSImpl_Study* Open(const std::string& aStudyUrl);
-
- //! method to close a Study
- virtual void Close(SALOMEDSImpl_Study* aStudy);
-
- //! method to save a Study
- virtual bool Save(SALOMEDSImpl_Study* aStudy, SALOMEDSImpl_DriverFactory* aFactory, bool theMultiFile);
-
- virtual bool SaveASCII(SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile);
-
- //! method to save a Study to the persistent reference aUrl
- virtual bool SaveAs(const std::string& aUrl,
- SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile);
-
- virtual bool SaveAsASCII(const std::string& aUrl,
- SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile);
-
- //! method to Get name list of open studies in the session
- virtual std::vector<SALOMEDSImpl_Study*> GetOpenStudies();
-
- //! method to get a Study from it's name
- virtual SALOMEDSImpl_Study* GetStudyByName(const std::string& aStudyName) ;
-
- //! method to get a Study from it's ID
- virtual SALOMEDSImpl_Study* GetStudyByID(int aStudyID) ;
-
-
- DF_Document* GetDocumentOfStudy(SALOMEDSImpl_Study* theStudy);
-
- DF_Document* GetClipboard() { return _clipboard; }
-
- bool CopyLabel(SALOMEDSImpl_Study* theSourceStudy,
- SALOMEDSImpl_Driver* theEngine,
- const int theSourceStartDepth,
- const DF_Label& theSource,
- const DF_Label& theDestinationMain);
-
- DF_Label PasteLabel(SALOMEDSImpl_Study* theDestinationStudy,
- SALOMEDSImpl_Driver* theEngine,
- const DF_Label& theSource,
- const DF_Label& theDestinationStart,
- const int theCopiedStudyID,
- const bool isFirstElement);
-
- virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine);
- virtual bool Copy(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine);
- virtual bool CanPaste(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine);
- virtual SALOMEDSImpl_SObject Paste(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine);
-
- // _SaveAs private function called by Save and SaveAs
- virtual bool Impl_SaveAs(const std::string& aUrl,
- SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile,
- bool theASCII);
-
- // _SaveObject private function called by _SaveAs
- virtual bool Impl_SaveObject(const SALOMEDSImpl_SObject& SC, HDFgroup *hdf_group_datatype);
-
- // _SubstituteSlash function called by Open and GetStudyByName
- virtual std::string Impl_SubstituteSlash(const std::string& aUrl);
-
- virtual bool Impl_SaveProperties(SALOMEDSImpl_Study* aStudy, HDFgroup *hdf_group);
-
- std::string GetErrorCode() { return _errorCode; }
- virtual bool IsError() { return _errorCode != ""; }
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
-// File : SALOMEDSImpl_SObject.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_TMPFile.hxx"
-
-SALOMEDSImpl_TMPFile::TOctet*
-SALOMEDSImpl_TMPFile
-::Data()
-{
- return &Get(0);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef __SALOMEDSIMPL_TMPFILE_H__
-#define __SALOMEDSIMPL_TMPFILE_H__
-
-#include "SALOMEDSImpl_Defines.hxx"
-#include "DF_definitions.hxx"
-
-
-struct SALOMEDSIMPL_EXPORT SALOMEDSImpl_TMPFile
-{
- typedef unsigned char TOctet;
- //typedef unsigned int size_t;
-
- virtual size_t Size() = 0;
-
- virtual TOctet* Data();
-
- virtual TOctet& Get(size_t) = 0;
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_Tool.cxx
-// Created : Mon Oct 21 16:24:34 2002
-// Author : Sergey RUIN
-// Project : SALOME
-// Module : SALOMEDSImpl
-//
-#include <stdio.h>
-#include <iostream>
-#include <fstream>
-#include <stdlib.h>
-#include <string.h>
-
-#include "SALOMEDSImpl_Tool.hxx"
-
-#ifndef WIN32
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <pwd.h>
-#include <unistd.h>
-#else
-#include <time.h>
-#include <lmcons.h>
-//#include <winbase.h>
-#include <windows.h>
-#endif
-
-using namespace std;
-
-
-
-bool Exists(const string thePath)
-{
-#ifdef WIN32
- if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) {
- if ( GetLastError () != ERROR_FILE_NOT_FOUND ) {
- return false;
- }
- }
-#else
- int status = access ( thePath.c_str() , F_OK );
- if (status != 0) return false;
-#endif
- return true;
-}
-
-
-
-
-//============================================================================
-// function : GetTempDir
-// purpose : Return a temp directory to store created files like "/tmp/sub_dir/"
-//============================================================================
-string SALOMEDSImpl_Tool::GetTmpDir()
-{
- //Find a temporary directory to store a file
-
- string aTmpDir;
-
- char *Tmp_dir = getenv("SALOME_TMP_DIR");
- if(Tmp_dir != NULL) {
- aTmpDir = string(Tmp_dir);
-#ifdef WIN32
- if(aTmpDir[aTmpDir.size()-1] != '\\') aTmpDir+='\\';
-#else
- if(aTmpDir[aTmpDir.size()-1] != '/') aTmpDir+='/';
-#endif
- }
- else {
-#ifdef WIN32
- aTmpDir = string("C:\\");
-#else
- aTmpDir = string("/tmp/");
-#endif
- }
-
- srand((unsigned int)time(NULL));
- int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory
- char buffer[127];
- sprintf(buffer, "%d", aRND);
- string aSubDir(buffer);
- if(aSubDir.size() <= 1) aSubDir = string("123409876");
-
- aTmpDir += aSubDir; //Get RND sub directory
-
- string aDir = aTmpDir;
-
- if(Exists(aDir)) {
- for(aRND = 0; Exists(aDir); aRND++) {
- sprintf(buffer, "%d", aRND);
- aDir = aTmpDir+buffer; //Build a unique directory name
- }
- }
-
-#ifdef WIN32
- if(aDir[aTmpDir.size()-1] != '\\') aDir+='\\';
-#else
- if(aDir[aTmpDir.size()-1] != '/') aDir+='/';
-#endif
-
-
-#ifdef WIN32
- CreateDirectory(aDir.c_str(), NULL);
-#else
- mkdir(aDir.c_str(), 0x1ff);
-#endif
-
- return aDir;
-}
-
-//============================================================================
-// function : RemoveTemporaryFiles
-// purpose : Removes files listed in theFileList
-//============================================================================
-void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const string& theDirectory,
- const vector<string>& theFiles,
- const bool IsDirDeleted)
-{
- string aDirName = theDirectory;
-
- int i, aLength = theFiles.size();
- for(i=1; i<=aLength; i++) {
- string aFile(aDirName);
- aFile += theFiles[i-1];
- if(!Exists(aFile)) continue;
-
-#ifdef WIN32
- DeleteFile(aFile.c_str());
-#else
- unlink(aFile.c_str());
-#endif
- }
-
- if(IsDirDeleted) {
- if(Exists(aDirName)) {
-#ifdef WIN32
- RemoveDirectory(aDirName.c_str());
-#else
- rmdir(aDirName.c_str());
-#endif
- }
- }
-
-}
-
-//============================================================================
-// function : GetNameFromPath
-// purpose : Returns the name by the path
-//============================================================================
-string SALOMEDSImpl_Tool::GetNameFromPath(const string& thePath) {
- if (thePath.empty()) return "";
- int pos = thePath.rfind('/');
- if(pos > 0) return thePath.substr(pos+1, thePath.size());
- pos = thePath.rfind('\\');
- if(pos > 0) return thePath.substr(pos+1, thePath.size());
- pos = thePath.rfind('|');
- if(pos > 0) return thePath.substr(pos+1, thePath.size());
- return thePath;
-}
-
-//============================================================================
-// function : GetDirFromPath
-// purpose : Returns the dir by the path
-//============================================================================
-string SALOMEDSImpl_Tool::GetDirFromPath(const string& thePath) {
- if (thePath.empty()) return "";
-
- int pos = thePath.rfind('/');
- string path;
- if(pos > 0) {
- path = thePath.substr(0, pos+1);
- }
- if(path.empty()) {
- pos = thePath.rfind('\\');
- if(pos > 0) path = thePath.substr(0, pos+1);
- }
- if(path.empty()) {
- pos = thePath.rfind('|');
- if(pos > 0) path = thePath.substr(0, pos+1);
- }
- if(path.empty()) {
- path = thePath+"/";
- }
-
-#ifdef WIN32 //Check if the only disk letter is given as path
- if(path.size() == 2 && path[1] == ':') path +='\\';
-#endif
-
- for(int i = 0, len = path.size(); i<len; i++)
- if(path[i] == '|') path[i] = '/';
- return path;
-}
-
-//============================================================================
-// function :
-// purpose : The functions returns a list of substring of initial string
-// divided by given separator
-//============================================================================
-vector<string> SALOMEDSImpl_Tool::splitString(const string& theValue, char separator)
-{
- vector<string> vs;
- if(theValue[0] == separator && theValue.size() == 1) return vs;
- int pos = theValue.find(separator);
- if(pos < 0) {
- vs.push_back(theValue);
- return vs;
- }
-
- string s = theValue;
- if(s[0] == separator) s = s.substr(1, s.size());
- while((pos = s.find(separator)) >= 0) {
- vs.push_back(s.substr(0, pos));
- s = s.substr(pos+1, s.size());
- }
-
- if(!s.empty() && s[0] != separator) vs.push_back(s);
- return vs;
-}
-
-//============================================================================
-// function :
-// purpose : The functions returns a list of substring of initial string
-// divided by given separator include empty strings
-//============================================================================
-vector<string> SALOMEDSImpl_Tool::splitStringWithEmpty(const string& theValue, char sep)
-{
- vector<string> aResult;
- if(theValue[0] == sep ) aResult.push_back(string());
- int pos = theValue.find(sep);
- if(pos < 0 ) {
- aResult.push_back(theValue);
- return aResult;
- }
-
- string s = theValue;
- if(s[0] == sep) s = s.substr(1, s.size());
- while((pos = s.find(sep)) >= 0) {
- aResult.push_back(s.substr(0, pos));
- s = s.substr(pos+1, s.size());
- }
-
- if(!s.empty() && s[0] != sep) aResult.push_back(s);
- if(theValue[theValue.size()-1] == sep) aResult.push_back(string());
-
- return aResult;
-}
-
-//============================================================================
-// function :
-// purpose : The functions returns a list of lists of substrings of initial string
-// divided by two given separators include empty strings
-//============================================================================
-vector< vector<string> > SALOMEDSImpl_Tool::splitStringWithEmpty(const string& theValue, char sep1, char sep2)
-{
- vector< vector<string> > aResult;
- if(theValue.size() > 0) {
- vector<string> aSections = splitStringWithEmpty( theValue, sep1 );
- for( int i = 0, n = aSections.size(); i < n; i++ )
- aResult.push_back( splitStringWithEmpty( aSections[i], sep2 ) );
- }
- return aResult;
-}
-
-
-void SALOMEDSImpl_Tool::GetSystemDate(int& year, int& month, int& day, int& hours, int& minutes, int& seconds)
-{
-#ifdef WIN32
- SYSTEMTIME st;
-
- GetLocalTime ( &st );
-
- month = st.wMonth;
- day = st.wDay;
- year = st.wYear;
- hours = st.wHour;
- minutes = st.wMinute;
- seconds = st.wSecond;
-#else
- struct tm transfert;
- struct timeval tval;
- struct timezone tzone;
- int status;
-
- status = gettimeofday( &tval, &tzone );
- memcpy(&transfert, localtime((time_t *)&tval.tv_sec), sizeof(tm));
-
- month = transfert.tm_mon + 1;
- day = transfert.tm_mday;
- year = transfert.tm_year + 1900;
- hours = transfert.tm_hour;
- minutes = transfert.tm_min ;
- seconds = transfert.tm_sec ;
-#endif
-}
-
-//Warning undef of Ascii Winwows define
-#ifdef WIN32
-# undef GetUserName
-#endif
-string SALOMEDSImpl_Tool::GetUserName()
-{
-#ifdef WIN32
- char* pBuff = new char[UNLEN + 1];
- DWORD dwSize = UNLEN + 1;
- string retVal;
- ::GetUserNameA( pBuff, &dwSize );
- string theTmpUserName(pBuff,(int)dwSize -1 );
- retVal = theTmpUserName;
- delete [] pBuff;
- return retVal;
-#else
- struct passwd *infos;
- infos = getpwuid(getuid());
- return string(infos->pw_name);
-#endif
-}
-
-
-
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_Tool.hxx
-// Created : Mon Oct 21 16:24:50 2002
-// Author : Sergey RUIN
-// Project : SALOME
-// Module : SALOMEDSImpl
-//
-#ifndef __SALOMEDSIMPL_TOOL_H__
-#define __SALOMEDSIMPL_TOOL_H__
-
-#include "SALOMEDSImpl_Defines.hxx"
-
-#include <string>
-#include <vector>
-#include "DF_Label.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Tool
-{
-
-public:
-
- // Returns the unique temporary directory, that is defined in SALOME_TMP_DIR if this variable is set
- // otherwise return /tmp/something/ for Unix or c:\something\ for WIN32
- static std::string GetTmpDir();
-
-
- // Removes files which are in <theDirectory>, the files for deletion are listed in <theFiles>
- // if <IsDirDeleted> is true <theDirectory> is also deleted if it is empty
- static void RemoveTemporaryFiles(const std::string& theDirectory,
- const std::vector<std::string>& theFiles,
- const bool IsDirDeleted);
-
- // Returns the name by the path
- // for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "doc1"
- static std::string GetNameFromPath(const std::string& thePath);
-
- // Returns the directory by the path
- // for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "/tmp/aaa"
- static std::string GetDirFromPath(const std::string& thePath);
-
- //The functions returns a list of substring of initial string divided by given separator
- static std::vector<std::string> splitString(const std::string& theValue, char separator);
-
- //The functions returns a list of substring of initial string divided by given separator,
- //include empty strings
- static std::vector<std::string> splitStringWithEmpty(const std::string& theValue, char separator);
-
- //The functions returns a list of substring of initial string divided by given separator,
- //include empty strings
- static std::vector< std::vector<std::string> > splitStringWithEmpty(const std::string& theValue,
- char separator1,
- char separator2);
-
-
- //Returns a system date
- static void GetSystemDate(int& year, int& month, int& day, int& hours, int& minutes, int& seconds);
-
- //Returns a name of the user
- static std::string GetUserName();
-
-};
-#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_UseCaseBuilder.cxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_UseCaseBuilder.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-#include "SALOMEDSImpl_Attributes.hxx"
-
-#include "DF_ChildIterator.hxx"
-
-using namespace std;
-
-#define USE_CASE_LABEL_TAG 2
-#define USE_CASE_GUID "AA43BB12-D9CD-11d6-945D-0050DA506788"
-
-
-//============================================================================
-/*! Function : constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_UseCaseBuilder::SALOMEDSImpl_UseCaseBuilder(DF_Document* theDocument)
-:_doc(theDocument)
-{
- if(!_doc) return;
-
- DF_Label aLabel = _doc->Main().Root().FindChild(USE_CASE_LABEL_TAG); //Iterate all use cases
- if(!(_root = (SALOMEDSImpl_AttributeTreeNode*)aLabel.FindAttribute(std::string(USE_CASE_GUID)))) {
- _root = SALOMEDSImpl_AttributeTreeNode::Set(aLabel, std::string(USE_CASE_GUID));
- }
-
- SALOMEDSImpl_AttributeReference* aRef = NULL;
- if(!(aRef=(SALOMEDSImpl_AttributeReference*)_root->FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
- aRef = SALOMEDSImpl_AttributeReference::Set(_root->Label(), _root->Label());
- }
-
- if(!aLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID())) {
- SALOMEDSImpl_AttributeName::Set(aLabel, "Use cases");
- }
-}
-
-//============================================================================
-/*! Function : destructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_UseCaseBuilder::~SALOMEDSImpl_UseCaseBuilder()
-{
-}
-
-
-//============================================================================
-/*! Function : Append
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_UseCaseBuilder::Append(const SALOMEDSImpl_SObject& theObject)
-{
- if(!_root || !theObject) return false;
-
- DF_Label aLabel = theObject.GetLabel();
- if(aLabel.IsNull()) return false;
-
- SALOMEDSImpl_AttributeTreeNode* aNode = NULL;
- SALOMEDSImpl_AttributeTreeNode* aCurrentNode = NULL;
- aNode = SALOMEDSImpl_AttributeTreeNode::Set(aLabel, _root->ID());
- aNode->Remove();
-
- SALOMEDSImpl_AttributeReference* aRef;
- if(!(aRef=(SALOMEDSImpl_AttributeReference*)_root->FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
- aRef = SALOMEDSImpl_AttributeReference::Set(_root->Label(), _root->Label());
- }
-
- DF_Label aCurrent = aRef->Get();
- if(aCurrent.IsNull() || !(aCurrentNode=(SALOMEDSImpl_AttributeTreeNode*)aCurrent.FindAttribute(_root->ID())))
- aCurrentNode = _root;
-
- aCurrentNode->Append(aNode);
-
- return true;
-}
-
- //============================================================================
-/*! Function : Remove
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_UseCaseBuilder::Remove(const SALOMEDSImpl_SObject& theObject)
-{
- if(!_root || !theObject) return false;
-
- DF_Label aLabel = theObject.GetLabel();
- if(aLabel.IsNull()) return false;
-
- SALOMEDSImpl_AttributeTreeNode* aNode = NULL;
- if(!(aNode=(SALOMEDSImpl_AttributeTreeNode*)aLabel.FindAttribute(_root->ID()))) return false;
-
- aNode->Remove();
-
- vector<DF_Attribute*> aList;
- aList.push_back(aNode);
-
- SALOMEDSImpl_AttributeReference* aRef = NULL;
- if(!(aRef=(SALOMEDSImpl_AttributeReference*)_root->FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
- aRef = SALOMEDSImpl_AttributeReference::Set(_root->Label(), _root->Label());
- }
-
- DF_Label aCurrent = aRef->Get();
-
- SALOMEDSImpl_ChildNodeIterator aChildItr(aNode, true);
- for(; aChildItr.More(); aChildItr.Next())
- aList.push_back(aChildItr.Value());
-
- for(int i = 0, len = aList.size(); i<len; i++) {
- if(aList[i]->Label() == aCurrent) { //The current node is removed
- aRef->Set(_root->Label()); //Reset the current node to the root
- }
- aList[i]->Label().ForgetAttribute(_root->ID());
- }
-
- return true;
-}
-
-
-//============================================================================
-/*! Function : AppendTo
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_UseCaseBuilder::AppendTo(const SALOMEDSImpl_SObject& theFather,
- const SALOMEDSImpl_SObject& theObject)
-{
- if(!_root || !theFather || !theObject) return false;
-
- DF_Label aFatherLabel = theFather.GetLabel(), aLabel = theObject.GetLabel();
- if(aFatherLabel == aLabel) return false;
-
- SALOMEDSImpl_AttributeTreeNode *aFather = false, *aNode = false;
-
- if(aFatherLabel.IsNull()) return false;
- if(!(aFather=(SALOMEDSImpl_AttributeTreeNode*)aFatherLabel.FindAttribute(_root->ID()))) return false;
-
- if(aLabel.IsNull()) return false;
- if(!(aNode=(SALOMEDSImpl_AttributeTreeNode*)aLabel.FindAttribute(_root->ID()))) {
- aNode = SALOMEDSImpl_AttributeTreeNode::Set(aLabel, _root->ID());
- }
-
- aNode->Remove();
-
- return aFather->Append(aNode);
-}
-
-//============================================================================
-/*! Function : InsertBefore
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_UseCaseBuilder::InsertBefore(const SALOMEDSImpl_SObject& theFirst,
- const SALOMEDSImpl_SObject& theNext)
-{
- if(!_root || !theFirst || !theNext) return false;
-
- DF_Label aFirstLabel = theFirst.GetLabel(), aLabel= theNext.GetLabel();
- if(aFirstLabel == aLabel) return false;
-
- SALOMEDSImpl_AttributeTreeNode *aFirstNode = NULL, *aNode = NULL;
-
- if(aFirstLabel.IsNull()) return false;
- if((aFirstNode=(SALOMEDSImpl_AttributeTreeNode*)aFirstLabel.FindAttribute(_root->ID()))) {
- aFirstNode->Remove();
- aFirstLabel.ForgetAttribute(aFirstNode->ID());
- }
-
- aFirstNode = SALOMEDSImpl_AttributeTreeNode::Set(aFirstLabel, _root->ID());
-
- if(aLabel.IsNull()) return false;
- if(!(aNode=(SALOMEDSImpl_AttributeTreeNode*)aLabel.FindAttribute(_root->ID()))) return false;
-
- aFirstNode->Remove();
-
- return aNode->InsertBefore(aFirstNode);
-}
-
-
-//============================================================================
-/*! Function : SetCurrentObject
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_UseCaseBuilder::SetCurrentObject(const SALOMEDSImpl_SObject& theObject)
-{
- if(!_root || !theObject) return false;
-
- DF_Label aLabel = theObject.GetLabel();
- SALOMEDSImpl_AttributeTreeNode* aNode = NULL;
- if(aLabel.IsNull()) return false;
- if(!(aNode=(SALOMEDSImpl_AttributeTreeNode*)aLabel.FindAttribute(_root->ID()))) return false;
-
- SALOMEDSImpl_AttributeReference* aRef = NULL;
- if(!(aRef=(SALOMEDSImpl_AttributeReference*)_root->FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
- aRef = SALOMEDSImpl_AttributeReference::Set(_root->Label(), aNode->Label());
- }
-
- aRef->Set(aNode->Label());
-
- return true;
-}
-
-//============================================================================
-/*! Function : SetRootCurrent
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_UseCaseBuilder::SetRootCurrent()
-{
- if(!_root) return false;
-
- SALOMEDSImpl_AttributeReference* aRef = NULL;
- if(!(aRef=(SALOMEDSImpl_AttributeReference*)_root->FindAttribute(SALOMEDSImpl_AttributeReference::GetID())))
- aRef = SALOMEDSImpl_AttributeReference::Set(_root->Label(), _root->Label());
-
- aRef->Set(_root->Label());
- return true;
-}
-
-//============================================================================
-/*! Function : HasChildren
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_UseCaseBuilder::HasChildren(const SALOMEDSImpl_SObject& theObject)
-{
- if(!_root) return false;
-
- DF_Label aLabel;
- if (!theObject) aLabel = _root->Label();
- else
- aLabel = theObject.GetLabel();
- if(aLabel.IsNull()) return false;
-
- SALOMEDSImpl_AttributeTreeNode* aNode = NULL;
- if(!(aNode=(SALOMEDSImpl_AttributeTreeNode*)aLabel.FindAttribute(_root->ID()))) return false;
-
- return (aNode->GetFirst());
-}
-
-//============================================================================
-/*! Function : SetName
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_UseCaseBuilder::SetName(const string& theName) {
- if(!_root) return false;
-
- SALOMEDSImpl_AttributeName* aNameAttrib = NULL;
-
- if (!(aNameAttrib=(SALOMEDSImpl_AttributeName*)_root->FindAttribute(SALOMEDSImpl_AttributeName::GetID())))
- aNameAttrib = SALOMEDSImpl_AttributeName::Set(_root->Label(), theName);
-
- aNameAttrib->SetValue(theName);
-
- return true;
-}
-
-
-//============================================================================
-/*! Function : GetCurrentObject
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_UseCaseBuilder::GetCurrentObject()
-{
- SALOMEDSImpl_SObject so;
- if(!_root) return so;
-
- SALOMEDSImpl_AttributeReference* aRef = NULL;
- if(!(aRef=(SALOMEDSImpl_AttributeReference*)_root->FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
- aRef = SALOMEDSImpl_AttributeReference::Set(_root->Label(), _root->Label());
- }
-
- DF_Label aCurrent = aRef->Get();
- if(aCurrent.IsNull()) return so;
-
- return SALOMEDSImpl_Study::SObject(aCurrent);
-}
-
-//============================================================================
-/*! Function : GetName
- * Purpose :
- */
-//============================================================================
-string SALOMEDSImpl_UseCaseBuilder::GetName()
-{
- string aString;
- if(!_root) return aString;
-
- SALOMEDSImpl_AttributeName* aName = NULL;
- if (!(aName=(SALOMEDSImpl_AttributeName*)_root->FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) return aString;
- return aName->Value();
-}
-
-//============================================================================
-/*! Function : IsUseCase
- * Purpose :
- */
-//============================================================================
-bool SALOMEDSImpl_UseCaseBuilder::IsUseCase(const SALOMEDSImpl_SObject& theObject)
-{
- if(!theObject) return false;
- DF_Label aFather, aLabel = theObject.GetLabel();
- aFather = _doc->Main().Root().FindChild(USE_CASE_LABEL_TAG);
- if(aLabel.Father() == aFather) return true;
- return false;
-}
-
-//============================================================================
-/*! Function : NewUseCase
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_SObject SALOMEDSImpl_UseCaseBuilder::AddUseCase(const string& theName)
-{
- string aBasicGUID(USE_CASE_GUID);
-
- //Create a use cases structure if it not exists
-
- SALOMEDSImpl_AttributeTreeNode *aFatherNode = NULL, *aNode = NULL;
- SALOMEDSImpl_AttributeInteger* anInteger = NULL;
- SALOMEDSImpl_AttributeReference* aRef = NULL;
-
- DF_Label aLabel = _doc->Main().Root().FindChild(USE_CASE_LABEL_TAG);
-
- if(!(aRef=(SALOMEDSImpl_AttributeReference*)_root->FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
- aRef = SALOMEDSImpl_AttributeReference::Set(aLabel, aLabel);
- }
-
- if(!(aFatherNode=(SALOMEDSImpl_AttributeTreeNode*)aRef->Get().FindAttribute(aBasicGUID))) {
- aFatherNode = SALOMEDSImpl_AttributeTreeNode::Set(aRef->Get(), aBasicGUID);
- }
-
- if(!(anInteger=(SALOMEDSImpl_AttributeInteger*)_root->FindAttribute(SALOMEDSImpl_AttributeInteger::GetID()))) {
- anInteger = SALOMEDSImpl_AttributeInteger::Set(aLabel, 0);
- }
-
- //Create a new use case
- anInteger->SetValue(anInteger->Value()+1);
- DF_Label aChild = aLabel.FindChild(anInteger->Value());
- aNode = SALOMEDSImpl_AttributeTreeNode::Set(aChild, aBasicGUID);
- aNode->Remove();
- aFatherNode->Append(aNode);
- SALOMEDSImpl_AttributeName::Set(aChild, theName);
-
- return SALOMEDSImpl_Study::SObject(aChild);
-}
-
-//============================================================================
-/*! Function : GetUseCaseIterator
- * Purpose : Creates a new UseCase iterator, if anObject is null all use cases are iterated
- */
-//============================================================================
-SALOMEDSImpl_UseCaseIterator
-SALOMEDSImpl_UseCaseBuilder::GetUseCaseIterator(const SALOMEDSImpl_SObject& theObject)
-{
- DF_Label aLabel;
-
- if(theObject) {
- aLabel = theObject.GetLabel(); //Iterate only sub tree in the use case
- }
- else {
- aLabel = _doc->Main().Root().FindChild(USE_CASE_LABEL_TAG); //Iterate all use cases
- }
-
- return SALOMEDSImpl_UseCaseIterator(aLabel, USE_CASE_GUID, false);
-}
-
-
-SALOMEDSImpl_SObject SALOMEDSImpl_UseCaseBuilder::GetSObject(const string& theEntry)
-{
- DF_Label L = DF_Label::Label(_root->Label(), theEntry);
- return SALOMEDSImpl_Study::SObject(L);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_UseCaseBuilder.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSIMPL_USECaseBuilder_H__
-#define __SALOMEDSIMPL_USECaseBuilder_H__
-
-#include "SALOMEDSImpl_Defines.hxx"
-
-#include <string>
-
-#include "DF_Document.hxx"
-#include "DF_Label.hxx"
-#include "SALOMEDSImpl_AttributeTreeNode.hxx"
-#include "SALOMEDSImpl_UseCaseIterator.hxx"
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_UseCaseBuilder
-{
-private:
-
- SALOMEDSImpl_AttributeTreeNode* _root;
- DF_Document* _doc;
-
-public:
-
- //! standard constructor
- SALOMEDSImpl_UseCaseBuilder(DF_Document* theDocument);
-
- //! standard destructor
- ~SALOMEDSImpl_UseCaseBuilder();
-
- virtual bool Append(const SALOMEDSImpl_SObject& theObject);
-
- virtual bool Remove(const SALOMEDSImpl_SObject& theObject);
-
- virtual bool AppendTo(const SALOMEDSImpl_SObject& theFather, const SALOMEDSImpl_SObject& theObject);
-
- virtual bool InsertBefore(const SALOMEDSImpl_SObject& theFirst, const SALOMEDSImpl_SObject& theNext);
-
- virtual bool SetCurrentObject(const SALOMEDSImpl_SObject& theObject);
-
- virtual bool SetRootCurrent();
-
- virtual bool HasChildren(const SALOMEDSImpl_SObject& theObject);
-
- virtual bool IsUseCase(const SALOMEDSImpl_SObject& theObject);
-
- virtual bool SetName(const std::string& theName);
-
- virtual SALOMEDSImpl_SObject GetCurrentObject();
-
- virtual std::string GetName();
-
- virtual SALOMEDSImpl_SObject AddUseCase(const std::string& theName);
-
- virtual SALOMEDSImpl_UseCaseIterator GetUseCaseIterator(const SALOMEDSImpl_SObject& anObject);
-
- SALOMEDSImpl_SObject GetSObject(const std::string& theEntry);
-
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_UseCaseIterator.cxx
-// Author : Serge RUIN
-// Module : SALOME
-//
-#include "SALOMEDSImpl_UseCaseIterator.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-
-using namespace std;
-
-//============================================================================
-/*! Function : empty constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_UseCaseIterator::SALOMEDSImpl_UseCaseIterator()
-{
- _node = NULL;
-}
-
-
-//============================================================================
-/*! Function : constructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_UseCaseIterator::SALOMEDSImpl_UseCaseIterator(const DF_Label& theLabel,
- const string& theGUID,
- const bool allLevels)
-:_guid(theGUID), _levels(allLevels)
-{
- if((_node = (SALOMEDSImpl_AttributeTreeNode*)theLabel.FindAttribute(_guid))) {
- _it.Initialize (_node, _levels);
- }
-}
-
-//============================================================================
-/*! Function : destructor
- * Purpose :
- */
-//============================================================================
-SALOMEDSImpl_UseCaseIterator::~SALOMEDSImpl_UseCaseIterator()
-{
-}
-
-//============================================================================
-/*! Function :Init
- *
- */
-//============================================================================
-void SALOMEDSImpl_UseCaseIterator::Init(bool allLevels)
-{
- _it.Initialize (_node, allLevels);
-}
-
-//============================================================================
-/*! Function : More
- *
- */
-//============================================================================
-bool SALOMEDSImpl_UseCaseIterator::More()
-{
- return _it.More();
-}
-
-//============================================================================
-/*! Function : Next
- *
- */
-//============================================================================
-void SALOMEDSImpl_UseCaseIterator::Next()
-{
- _it.Next();
-}
-
-
-//============================================================================
-/*! Function :
- * Purpose :
- */
-//============================================================================
-
-SALOMEDSImpl_SObject SALOMEDSImpl_UseCaseIterator::Value()
-{
- DF_Label L = _it.Value()->Label();
- return SALOMEDSImpl_Study::SObject(L);
-}
-
-//============================================================================
-/*! Function : GetPersistentCopy
- *
- */
-//============================================================================
-SALOMEDSImpl_UseCaseIterator* SALOMEDSImpl_UseCaseIterator::GetPersistentCopy() const
-{
- SALOMEDSImpl_UseCaseIterator* itr = new SALOMEDSImpl_UseCaseIterator();
- itr->_it = _it;
- itr->_node = _node;
- itr->_guid = _guid;
- itr->_levels = _levels;
-
- return itr;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDSImpl_UseCaseIterator.hxx
-// Author : Sergey RUIN
-// Module : SALOME
-//
-#ifndef __SALOMEDSIMPL_USECASEITERATOR_H__
-#define __SALOMEDSIMPL_USECASEITERATOR_H__
-
-#include "SALOMEDSImpl_Defines.hxx"
-
-#include "SALOMEDSImpl_SObject.hxx"
-#include "DF_ChildIterator.hxx"
-#include "SALOMEDSImpl_ChildNodeIterator.hxx"
-
-#include <string>
-
-class SALOMEDSIMPL_EXPORT SALOMEDSImpl_UseCaseIterator
-{
-
-private:
- std::string _guid;
- bool _levels;
- SALOMEDSImpl_AttributeTreeNode* _node;
- SALOMEDSImpl_ChildNodeIterator _it;
-
-public:
-
- SALOMEDSImpl_UseCaseIterator();
-
- //! standard constructor
- SALOMEDSImpl_UseCaseIterator(const DF_Label& theLabel,
- const std::string& theGUID,
- const bool allLevels);
-
- //! standard destructor
- ~SALOMEDSImpl_UseCaseIterator();
-
- virtual void Init(bool);
- virtual bool More();
- virtual void Next();
- virtual SALOMEDSImpl_SObject Value();
-
- SALOMEDSImpl_UseCaseIterator* GetPersistentCopy() const;
-};
-#endif
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# File : Makefile.am
-# Author : Paul RASCLE
-# Module : KERNEL
-# $Header$
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-#
-# ===============================================================
-# Files to be installed
-# ===============================================================
-#
-# header files
-salomeinclude_HEADERS= SALOMEDSImplTest.hxx
-
-# Scripts to be installed
-dist_salomescript_PYTHON = TestSALOMEDSImpl.py
-
-#
-# ===============================================================
-# Local definitions
-# ===============================================================
-#
-
-# This directory defines the subdirectory src in the top source directory.
-RPATH=../..
-
-# This local variable defines the list of CPPFLAGS common to all target in this package.
-COMMON_CPPFLAGS=\
- @CPPUNIT_INCLUDES@ \
- -I$(srcdir)/$(RPATH)/Basics -I$(srcdir)/$(RPATH)/Basics/Test \
- -I$(srcdir)/$(RPATH)/SALOMELocalTrace -I$(srcdir)/$(RPATH)/SALOMELocalTrace/Test \
- -I$(srcdir)/$(RPATH)/SALOMETraceCollector -I$(srcdir)/$(RPATH)/SALOMETraceCollector/Test \
- -I$(srcdir)/$(RPATH)/NamingService -I$(srcdir)/$(RPATH)/NamingService/Test \
- -I$(srcdir)/$(RPATH)/Utils -I$(srcdir)/$(RPATH)/Utils/Test \
- -I$(srcdir)/$(RPATH)/ResourcesManager \
- -I$(srcdir)/$(RPATH)/LifeCycleCORBA \
- -I$(srcdir)/$(RPATH)/DF \
- -I$(srcdir)/$(RPATH)/SALOMEDSImpl \
- -I$(top_builddir)/salome_adm/unix \
- -I$(top_builddir)/idl \
- @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @BOOST_CPPFLAGS@
-
-# This local variable defines the list of dependant libraries common to all target in this package.
-COMMON_LIBS =\
- @CPPUNIT_LIBS@ \
- $(RPATH)/Basics/libSALOMEBasics.la \
- $(RPATH)/ResourcesManager/libSalomeResourcesManager.la \
- $(RPATH)/Container/libSalomeContainer.la \
- $(RPATH)/NamingService/libSalomeNS.la \
- $(RPATH)/Registry/libRegistry.la \
- $(RPATH)/Notification/libSalomeNotification.la \
- $(RPATH)/Utils/Test/libUtilsTest.la \
- $(RPATH)/Utils/libOpUtil.la \
- $(RPATH)/SALOMELocalTrace/Test/libSALOMELocalTraceTest.la \
- $(RPATH)/SALOMELocalTrace/libSALOMELocalTrace.la \
- $(RPATH)/SALOMETraceCollector/Test/libSALOMETraceCollectorTest.la \
- $(RPATH)/DF/libDF.la \
- $(RPATH)/SALOMEDSImpl/libSalomeDSImpl.la \
- $(RPATH)/HDFPersist/libSalomeHDFPersist.la \
- $(top_builddir)/idl/libSalomeIDLKernel.la
-
-#
-# ===============================================================
-# Libraries targets
-# ===============================================================
-#
-lib_LTLIBRARIES = libSALOMEDSImplTest.la
-libSALOMEDSImplTest_la_SOURCES = SALOMEDSImplTest.cxx
-libSALOMEDSImplTest_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSALOMEDSImplTest_la_LDFLAGS = -no-undefined -version-info=0:0:0
-libSALOMEDSImplTest_la_LIBADD = $(COMMON_LIBS)
-
-#
-# ===============================================================
-# Executables targets
-# ===============================================================
-#
-bin_PROGRAMS = TestSALOMEDSImpl
-TestSALOMEDSImpl_SOURCES = TestSALOMEDSImpl.cxx
-TestSALOMEDSImpl_CPPFLAGS = $(COMMON_CPPFLAGS)
-TestSALOMEDSImpl_LDADD = \
- libSALOMEDSImplTest.la ../libSalomeDSImpl.la \
- $(RPATH)/NamingService/Test/libNamingServiceTest.la \
- $(COMMON_LIBS)
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "SALOMEDSImplTest.hxx"
-
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <vector>
-#include <cstdlib>
-#include "utilities.h"
-
-#include "SALOMEDSImpl_AttributeParameter.hxx"
-#include "SALOMEDSImpl_StudyManager.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-#include "SALOMEDSImpl_StudyBuilder.hxx"
-#include "SALOMEDSImpl_GenericAttribute.hxx"
-
-using namespace std;
-
-// ============================================================================
-/*!
- * Set up the environment
- */
-// ============================================================================
-
-void SALOMEDSImplTest::setUp()
-{
-}
-
-// ============================================================================
-/*!
- * - delete trace classes
- */
-// ============================================================================
-
-void
-SALOMEDSImplTest::tearDown()
-{
-}
-
-// ============================================================================
-/*!
- * Check setting int value
- */
-// ============================================================================
-void SALOMEDSImplTest::testAttributeParameter()
-{
- SALOMEDSImpl_StudyManager* sm = new SALOMEDSImpl_StudyManager();
- SALOMEDSImpl_Study* study = sm->NewStudy("Test");
- SALOMEDSImpl_AttributeParameter* _ap = study->GetCommonParameters("TestComp", 0);
-
- CPPUNIT_ASSERT(_ap);
-
- _ap->SetInt("IntValue", 1);
- CPPUNIT_ASSERT(_ap->IsSet("IntValue", PT_INTEGER));
- CPPUNIT_ASSERT(_ap->GetInt("IntValue") == 1);
-
- _ap->SetReal("RealValue", 1.2);
- CPPUNIT_ASSERT(_ap->IsSet("RealValue", PT_REAL));
- CPPUNIT_ASSERT(_ap->GetReal("RealValue") == 1.2);
-
- _ap->SetString("StringValue", "hello");
- CPPUNIT_ASSERT(_ap->IsSet("StringValue", PT_STRING));
- CPPUNIT_ASSERT(_ap->GetString("StringValue") == "hello");
-
- _ap->SetBool("BoolValue", 0);
- CPPUNIT_ASSERT(_ap->IsSet("BoolValue", PT_BOOLEAN));
- CPPUNIT_ASSERT(!_ap->GetBool("BoolValue"));
-
- _ap->SetBool("BoolValue", 0);
- CPPUNIT_ASSERT(_ap->IsSet("BoolValue", PT_BOOLEAN));
- CPPUNIT_ASSERT(!_ap->GetBool("BoolValue"));
-
- vector<int> intArray;
- intArray.push_back(0);
- intArray.push_back(1);
-
- _ap->SetIntArray("IntArray", intArray);
- CPPUNIT_ASSERT(_ap->IsSet("IntArray", PT_INTARRAY));
- CPPUNIT_ASSERT(_ap->GetIntArray("IntArray")[0] == 0);
- CPPUNIT_ASSERT(_ap->GetIntArray("IntArray")[1] == 1);
-
- vector<double> realArray;
- realArray.push_back(0.0);
- realArray.push_back(1.1);
-
- _ap->SetRealArray("RealArray", realArray);
- CPPUNIT_ASSERT(_ap->IsSet("RealArray", PT_REALARRAY));
- CPPUNIT_ASSERT(_ap->GetRealArray("RealArray")[0] == 0.0);
- CPPUNIT_ASSERT(_ap->GetRealArray("RealArray")[1] == 1.1);
-
- vector<string> strArray;
- strArray.push_back("hello");
- strArray.push_back("world");
-
- _ap->SetStrArray("StrArray", strArray);
- CPPUNIT_ASSERT(_ap->IsSet("StrArray", PT_STRARRAY));
- CPPUNIT_ASSERT(_ap->GetStrArray("StrArray")[0] == "hello");
- CPPUNIT_ASSERT(_ap->GetStrArray("StrArray")[1] == "world");
-
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef _SALOMEDSImplTEST_HXX_
-#define _SALOMEDSImplTEST_HXX_
-
-#include <cppunit/extensions/HelperMacros.h>
-
-class SALOMEDSImplTest : public CppUnit::TestFixture
-{
- CPPUNIT_TEST_SUITE( SALOMEDSImplTest );
- CPPUNIT_TEST( testAttributeParameter );
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
- void setUp();
- void tearDown();
- void testAttributeParameter();
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// --- include all SALOMEDSImpl Test from basics until the present directory
-//
-#include "SALOMEDSImplTest.hxx"
-
-// --- Registers the fixture into the 'registry'
-
-CPPUNIT_TEST_SUITE_REGISTRATION( SALOMEDSImplTest );
-
-// --- generic Main program from Basic/Test
-
-#include "BasicMainTest.hxx"
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-import sys, os,signal,string,commands
-import runSalome
-import orbmodule
-import TestKiller
-
-# get SALOME environment :
-
-args, modules_list, modules_root_dir = runSalome.get_config()
-runSalome.set_env(args, modules_list, modules_root_dir)
-
-# launch CORBA naming server
-
-clt=orbmodule.client()
-
-# launch CORBA logger server
-
-myServer=runSalome.LoggerServer(args)
-myServer.run()
-clt.waitLogger("Logger")
-
-# execute Unit Test
-
-command = ['TestSALOMEDSImpl']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
-
-# kill Test process
-
-TestKiller.killProcess(runSalome.process_id)
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//File: testDS.cxx
-//Author: Sergey RUIN
-//
-#include <stdio.h>
-#include <iostream>
-#include <vector>
-#include <string>
-
-#include "DF_Document.hxx"
-#include "DF_Attribute.hxx"
-#include "DF_Label.hxx"
-#include "DF_ChildIterator.hxx"
-
-#include "SALOMEDSImpl_Attributes.hxx"
-#include "SALOMEDSImpl_StudyManager.hxx"
-#include "SALOMEDSImpl_Study.hxx"
-#include "SALOMEDSImpl_StudyBuilder.hxx"
-#include "SALOMEDSImpl_SObject.hxx"
-#include "SALOMEDSImpl_SComponent.hxx"
-#include "SALOMEDSImpl_AttributeParameter.hxx"
-#include "SALOMEDSImpl_UseCaseBuilder.hxx"
-#include "SALOMEDSImpl_UseCaseIterator.hxx"
-
-//#include "SALOMEDSImpl_.hxx"
-
-using namespace std;
-
-int main (int argc, char * argv[])
-{
- cout << "Test started " << endl;
-
- SALOMEDSImpl_StudyManager* aSM = new SALOMEDSImpl_StudyManager();
- cout << "Manager is created " << endl;
- SALOMEDSImpl_Study* aStudy = aSM->NewStudy("SRN");
- cout << "Study with id = " << aStudy->StudyId() << " is created " << endl;
-
- cout << "Check the study lock, locking" << endl;
- aStudy->SetStudyLock("SRN");
- cout << "Is study locked = " << aStudy->IsStudyLocked() << endl;
- vector<string> ids = aStudy->GetLockerID();
- for(int i = 0; i<ids.size(); i++)
- cout << "Get study locker : " << ids[i] << endl;
- aStudy->UnLockStudy("SRN");
- cout << "Is study locked = " << aStudy->IsStudyLocked() << endl;
-
- SALOMEDSImpl_StudyBuilder* aBuilder = aStudy->NewBuilder();
- cout << "StudyBuilder is created " << endl;
- SALOMEDSImpl_SComponent aSC = aBuilder->NewComponent("TEST");
- cout << "New component with type " << aSC.ComponentDataType() << " is created " << endl;
- SALOMEDSImpl_SObject aSO = aBuilder->NewObject(aSC);
- cout << "New SObject with ID = " << aSO.GetID() << " is created" << endl;
- cout << "An entry of newly created SO is " << aSO.GetLabel().Entry() << endl;
- SALOMEDSImpl_AttributeIOR* aIORA = SALOMEDSImpl_AttributeIOR::Set(aSO.GetLabel(), "ior1234");
- cout << "New AttributeIOR is created, it contains " << dynamic_cast<SALOMEDSImpl_AttributeIOR*>(aIORA)->Value() << endl;
- cout << "Attribute has type: " << aIORA->Type() << " and value: " << aIORA->Save() << endl;
- cout << "Just another way to create an attribute: official one :) " << endl;
- cout << "Is SO null : " << aSO.IsNull()<< endl;
- DF_Attribute* aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeName");
- SALOMEDSImpl_AttributeName* aRN = dynamic_cast<SALOMEDSImpl_AttributeName*>(aTDFAttr);
- aRN->SetValue("name_attribute");
- cout << " The type = " << aRN->Type() << endl;
- cout << "Attribute has type: " << aRN->Type() << " and value: " << aRN->Save() << endl;
- cout << "Check GetObjectPath: " << aStudy->GetObjectPath(aSO) << endl;
-
- SALOMEDSImpl_SObject aSubSO = aBuilder->NewObject(aSO);
- aTDFAttr = aBuilder->FindOrCreateAttribute(aSubSO, "AttributeIOR");
- SALOMEDSImpl_AttributeIOR* aIOR2 = dynamic_cast<SALOMEDSImpl_AttributeIOR*>(aTDFAttr);
- aIOR2->SetValue("some ior");
- aBuilder->Addreference(aSubSO, aSO);
- SALOMEDSImpl_SObject aRefObject;
- aSubSO.ReferencedObject(aRefObject);
- cout << "Check reference : ReferencedObject is " << aRefObject.GetID() << endl;
- cout << "Check : Remove object: " << endl;
- aBuilder->RemoveObject(aSubSO);
- cout << "Remove: done" << endl;
-
- cout << "Try invalid attribute creation" << endl;
- aTDFAttr = aBuilder->FindOrCreateAttribute(aSubSO, "invalid type");
- cout << "Address of created attribute : " << aTDFAttr << endl;
-
- cout << "Check AttributeUserID" << endl;
-
- aTDFAttr = aBuilder->FindOrCreateAttribute(aSubSO, "AttributeUserID");
- if(aTDFAttr) {
- cout << "Attribute UserID was created succesfully : id = " << dynamic_cast<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->Value() << endl;
- }
- else cout << "Can't create AttributeUserID" << endl;
-
- string id = "0e1c36e6-379b-4d90-ab3b-17a14310e648";
- dynamic_cast<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->SetValue(id);
- cout << "SetValue id = " << dynamic_cast<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->Value() << endl;
-
- string id2 = "0e1c36e6-379b-4d90-ab3b-18a14310e648";
- aTDFAttr = aBuilder->FindOrCreateAttribute(aSubSO, "AttributeUserID"+id2);
- if(aTDFAttr) {
- cout << "Attribute UserID was created succesfully : id = " << dynamic_cast<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->Value() << endl;
- }
- else cout << "Can't create AttributeUserID" << endl;
-
- cout << "Check AttributeTreeNode " << endl;
- aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeTreeNode");
- cout << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aTDFAttr)->Type() << endl;
- cout << "Check AttributeTreeNode : done " << endl;
-
- aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeParameter");
- cout << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aTDFAttr)->Type() << endl;
-
- cout << "Check the attributes on SObject" << endl;
- vector<DF_Attribute*> aSeq = aSO.GetAllAttributes();
- for(int i = 0; i < aSeq.size(); i++)
- cout << "Found: " << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aSeq[i])->Type() << endl;
-
-
- cout << "Check UseCase" << endl;
- SALOMEDSImpl_UseCaseBuilder* ucb = aStudy->GetUseCaseBuilder();
- ucb->AddUseCase("use_case1");
- ucb->AddUseCase("use_case2");
- SALOMEDSImpl_UseCaseIterator ucitr = ucb->GetUseCaseIterator(SALOMEDSImpl_SObject());
- ucitr.Init(false);
- cout << "More? : " << ucitr.More() << endl;
-
- cout << "Check AttributeParameter " << endl;
-
- SALOMEDSImpl_AttributeParameter* AP = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(aTDFAttr);
-
- cout << "AttributeParameter with type : " << AP->Type() << endl;
-
- AP->SetInt("1", 123);
- cout << "IsSet for int: " << AP->IsSet("1", PT_INTEGER) << " value : " << AP->GetInt("1") << endl;
- //for(int i = 2; i < 5; i++) AP->SetInt(i, i*i);
-
- AP->SetReal("1", 123.123);
- cout << "IsSet for real: " << AP->IsSet("1", PT_REAL) << " value : " << AP->GetReal("1") << endl;
- //for(int i = 2; i < 5; i++) AP->SetReal(i, 0.1);
-
- AP->SetString("1", "value is 123.123!");
- cout << "IsSet for string: " << AP->IsSet("1", PT_STRING) << " value : " << AP->GetString("1") << endl;
- /*
- for(int i = 2; i < 5; i++) {
- string s((double)(1.0/i));
- cout << "Setting for " << i << " value : " << s << endl;
- AP->SetString(i, s);
- }
- */
-
- AP->SetBool("1", true);
- cout << "IsSet for bool: " << AP->IsSet("1", PT_BOOLEAN) << " value : " << AP->GetBool("1") << endl;
- //for(int i = 2; i < 5; i++) AP->SetBool(i, 0);
-
- vector<double> v;
- v.push_back(111.111);
- v.push_back(222.22222);
- v.push_back(333.3333333);
- AP->SetRealArray("1", v);
- cout << "IsSet for array: " << AP->IsSet("1", PT_REALARRAY);
- vector<double> v2 = AP->GetRealArray("1");
- cout.precision(10);
- cout << " values : ";
- for(int i = 0; i<v2.size(); i++) cout << v2[i] << " ";
- cout << endl;
-
- v[0] = 211.111;
- v[1] = 422.22222;
- v[2] = 633.3333333;
- AP->SetRealArray("2", v);
-
- vector<int> vi;
- vi.push_back(1);
- vi.push_back(2);
- AP->SetIntArray("2", vi);
-
- vector<string> vs;
- vs.push_back("hello, ");
- vs.push_back("world!");
- AP->SetStrArray("3", vs);
-
- string as = AP->Save();
- cout << "AS = " << as << endl;
- AP->Load(as);
-
- cout << "Restored string with id = 1 is: " << AP->GetString("1") << endl;
- cout << "Restored int with id = 2 is: " << AP->GetInt("1") << endl;
- cout << "Restored real with id = 3 is: " << AP->GetReal("1") << endl;
- cout << "Restored bool with id = 1 is: " << AP->GetBool("1") << endl;
-
- v2 = AP->GetRealArray("2");
- cout << "Restored real array with id = 2 is: ";
- for(int i = 0; i<v2.size(); i++) cout << v2[i] << " ";
- cout << endl;
-
- vi = AP->GetIntArray("2");
- cout << "Restored int array with id = 2 is: ";
- for(int i = 0; i<vi.size(); i++) cout << vi[i] << " ";
- cout << endl;
-
- vs = AP->GetStrArray("3");
- cout << "Restored string array with id = 2 is: ";
- for(int i = 0; i<vs.size(); i++) cout << vs[i] << " ";
- cout << endl;
-
- cout << "Check RemoveID 1 with type PT_INTEGER" << endl;
- AP->RemoveID("1", PT_INTEGER);
- cout << "IsSet with id = 1, type = PT_INTEGER : " << AP->IsSet("1", PT_INTEGER) << endl;
- cout << "Check RemoveID is done" << endl;
-
- cout << "Check AttributeParameter : done" << endl;
-
-
- SALOMEDSImpl_SComponent tst = aBuilder->NewComponent("TEST2");
- aSO = aBuilder->NewObject(tst);
- SALOMEDSImpl_SObject ss = aBuilder->NewObjectToTag(aSO, 3);
- aBuilder->NewObjectToTag(ss, 1);
- aBuilder->NewObjectToTag(ss, 3);
- SALOMEDSImpl_SObject ss2 = aBuilder->NewObjectToTag(aSO, 2);
- aBuilder->NewObjectToTag(ss, 2);
-
- SALOMEDSImpl_ChildIterator ci=aStudy->NewChildIterator(tst);
- for(ci.InitEx(true); ci.More(); ci.Next())
- cout << "######## " << ci.Value().GetID() << endl;
-
- DF_ChildIterator dci(tst.GetLabel(), true);
- for(; dci.More(); dci.Next())
- cout << "###### DF: " << dci.Value().Entry() << endl;
-
- cout << "Test finished " << endl;
- return 0;
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : BaseTraceCollector.cxx
-// Author : Paul RASCLE (EDF)
-// Module : KERNEL
-// $Header$
-//
-#include <iostream>
-#include <sstream>
-#include <fstream>
-#include <cstdlib>
-
-#include "BaseTraceCollector.hxx"
-#include "LocalTraceBufferPool.hxx"
-
-using namespace std;
-
-// Class attributes initialisation, for class method BaseTraceCollector::run
-
-BaseTraceCollector* BaseTraceCollector::_singleton = 0;
-#ifndef WIN32
-pthread_mutex_t BaseTraceCollector::_singletonMutex;
-#else
-pthread_mutex_t BaseTraceCollector::_singletonMutex =
- PTHREAD_MUTEX_INITIALIZER;
-#endif
-sem_t BaseTraceCollector::_sem;
-int BaseTraceCollector::_threadToClose = 0;
-pthread_t* BaseTraceCollector::_threadId = 0; // used to control single run
-
-// ============================================================================
-/*!
- * Destructor: virtual, implemented in derived classes.
- * Wait until printing thread ends (BaseTraceCollector::run)
- */
-// ============================================================================
-
-BaseTraceCollector:: ~BaseTraceCollector()
-{
-}
-
-// ============================================================================
-/*!
- * Constructor: no need of LocalTraceBufferPool object initialization here,
- * thread safe singleton used in LocalTraceBufferPool::instance()
- * See derived classes.
- */
-// ============================================================================
-
-BaseTraceCollector::BaseTraceCollector()
-{
-}
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : BaseTraceCollector.hxx
-// Author : Paul RASCLE (EDF)
-// Module : KERNEL
-// $Header$
-//
-#ifndef _BASETRACECOLLECTOR_HXX_
-#define _BASETRACECOLLECTOR_HXX_
-
-#include "SALOME_LocalTrace.hxx"
-
-#include <pthread.h>
-#include <semaphore.h>
-
-//! See derived Classes in SALOMELocalTrace for usage without CORBA,
-//! see derived Classes in SALOMETraceCollector for usage with CORBA.
-
-class SALOMELOCALTRACE_EXPORT BaseTraceCollector
-{
- public:
- virtual ~BaseTraceCollector();
-
- protected:
- BaseTraceCollector();
-
- static int _threadToClose;
- static BaseTraceCollector* _singleton;
- static pthread_mutex_t _singletonMutex;
- static pthread_t* _threadId;
- static sem_t _sem;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : FileTraceCollector.cxx
-// Author : Paul RASCLE (EDF)
-// Module : KERNEL
-// $Header$
-//
-#include <iostream>
-#include <sstream>
-#include <fstream>
-#include <cstdlib>
-
-using namespace std;
-
-//#define _DEVDEBUG_
-#include "FileTraceCollector.hxx"
-
-// Class attributes initialisation, for class method FileTraceCollector::run
-
-std::string FileTraceCollector::_fileName = "";
-
-// ============================================================================
-/*!
- * This class is for use without CORBA, inside or outside SALOME.
- * SALOME uses SALOMETraceCollector, to allow trace collection via CORBA.
- * Type of trace (and corresponding class) is choosen in LocalTraceBufferPool.
- *
- * Guarantees a unique object instance of the class (singleton thread safe)
- * a separate thread for loop to print traces is launched.
- */
-// ============================================================================
-
-BaseTraceCollector* FileTraceCollector::instance(const char *fileName)
-{
- if (_singleton == 0) // no need of lock when singleton already exists
- {
- int ret;
- ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
- if (_singleton == 0) // another thread may have got
- { // the lock after the first test
- DEVTRACE("FileTraceCollector:: instance()");
- BaseTraceCollector* myInstance = new FileTraceCollector();
- _fileName = fileName;
- DEVTRACE(" _fileName: " << _fileName);
-
- sem_init(&_sem,0,0); // to wait until run thread is initialized
- pthread_t traceThread;
- int bid = 0;
- pthread_create(&traceThread, NULL,
- FileTraceCollector::run, (void *)bid);
- sem_wait(&_sem);
- _singleton = myInstance; // _singleton known only when init done
- DEVTRACE("FileTraceCollector:: instance()-end");
- }
- ret = pthread_mutex_unlock(&_singletonMutex); // release lock
- }
- return _singleton;
-}
-
-// ============================================================================
-/*!
- * In a separate thread, loop to print traces.
- * Mutex garantees intialisation on instance method is done and only one run
- * allowed (double check ...)
- * Loop until there is no more buffer to print,
- * and no ask for end from destructor.
- * Get a buffer. If type = ABORT then exit application with message.
- */
-// ============================================================================
-
-void* FileTraceCollector::run(void *bid)
-{
- //DEVTRACE("init run");
- _threadId = new pthread_t;
- *_threadId = pthread_self();
- sem_post(&_sem); // unlock instance
-
- LocalTraceBufferPool* myTraceBuffer = LocalTraceBufferPool::instance();
- LocalTrace_TraceInfo myTrace;
-
- // --- opens a file with append mode
- // so, several processes can share the same file
-
- ofstream traceFile;
- const char *theFileName = _fileName.c_str();
- DEVTRACE("try to open trace file "<< theFileName);
- traceFile.open(theFileName, ios::out | ios::app);
- if (!traceFile)
- {
- cerr << "impossible to open trace file "<< theFileName << endl;
- exit (1);
- }
-
- // --- Loop until there is no more buffer to print,
- // and no ask for end from destructor.
- DEVTRACE("Begin loop");
- while ((!_threadToClose) || myTraceBuffer->toCollect() )
- {
- if (_threadToClose)
- {
- DEVTRACE("FileTraceCollector _threadToClose");
- //break;
- }
-
- myTraceBuffer->retrieve(myTrace);
- if (myTrace.traceType == ABORT_MESS)
- {
-#ifndef WIN32
- traceFile << "INTERRUPTION from thread " << myTrace.threadId
- << " : " << myTrace.trace;
-#else
- traceFile << "INTERRUPTION from thread "
- << (void*)(&myTrace.threadId)
- << " : " << myTrace.trace;
-#endif
- traceFile.close();
- cout << flush ;
-#ifndef WIN32
- cerr << "INTERRUPTION from thread " << myTrace.threadId
- << " : " << myTrace.trace;
-#else
- cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
- << " : " << myTrace.trace;
-#endif
- cerr << flush ;
- exit(1);
- }
- else
- {
-#ifndef WIN32
- traceFile << "th. " << myTrace.threadId
- << " " << myTrace.trace;
-#else
- traceFile << "th. " << (void*)(&myTrace.threadId)
- << " " << myTrace.trace;
-#endif
- }
- }
- DEVTRACE("traceFile.close()");
- traceFile.close();
- DEVTRACE("traceFile.close()_end");
- pthread_exit(NULL);
-}
-
-// ============================================================================
-/*!
- * Destructor: wait until printing thread ends (FileTraceCollector::run)
- */
-// ============================================================================
-
-FileTraceCollector:: ~FileTraceCollector()
-{
- int ret;
- ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
- if (_singleton)
- {
- DEVTRACE("FileTraceCollector:: ~FileTraceCollector()");
- LocalTraceBufferPool* myTraceBuffer = LocalTraceBufferPool::instance();
- _threadToClose = 1;
- myTraceBuffer->insert(NORMAL_MESS,"end of trace\n"); // to wake up thread
- if (_threadId)
- {
- int ret = pthread_join(*_threadId, NULL);
- if (ret) cerr << "error close FileTraceCollector : "<< ret << endl;
- else DEVTRACE("FileTraceCollector destruction OK");
- delete _threadId;
- _threadId = 0;
- _threadToClose = 0;
- }
- _singleton = 0;
- }
- ret = pthread_mutex_unlock(&_singletonMutex); // release lock
-}
-
-// ============================================================================
-/*!
- * Constructor: no need of LocalTraceBufferPool object initialization here,
- * thread safe singleton used in LocalTraceBufferPool::instance()
- */
-// ============================================================================
-
-FileTraceCollector::FileTraceCollector()
-{
- _threadId=0;
- _threadToClose = 0;
-}
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : FileTraceCollector.hxx
-// Author : Paul RASCLE (EDF)
-// Module : KERNEL
-// $Header$
-//
-#ifndef _FILETRACECOLLECTOR_HXX_
-#define _FILETRACECOLLECTOR_HXX_
-
-#include "SALOME_LocalTrace.hxx"
-
-#include <string>
-#include "LocalTraceBufferPool.hxx"
-#include "BaseTraceCollector.hxx"
-
-//! See also other derived Classes in SALOMELocalTrace for usage without CORBA,
-//! see also derived Classes in SALOMETraceCollector for usage with CORBA.
-
-class SALOMELOCALTRACE_EXPORT FileTraceCollector : public BaseTraceCollector
-{
- public:
- static BaseTraceCollector* instance(const char *fileName);
- static void *run(void *bid);
- ~FileTraceCollector();
-
- protected:
- FileTraceCollector();
-
- static std::string _fileName;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// Author : Paul RASCLE (EDF)
-// Module : KERNEL
-// $Header$
-// Cf. C++ Users Journal, June 2004, Tracing Application Execution, Tomer Abramson
-//
-#include <iostream>
-#include <limits.h>
-#include <cassert>
-#include <string.h>
-
-#ifndef WIN32
-#include <dlfcn.h>
-#else
-#include <windows.h>
-#endif
-
-//#define _DEVDEBUG_
-#include "LocalTraceBufferPool.hxx"
-#include "BaseTraceCollector.hxx"
-#include "LocalTraceCollector.hxx"
-#include "FileTraceCollector.hxx"
-#include "utilities.h"
-
-using namespace std;
-
-// In case of truncated message, end of trace contains "...\n\0"
-
-#define TRUNCATED_MESSAGE "...\n"
-#define MAXMESS_LENGTH MAX_TRACE_LENGTH-5
-
-// Class static attributes initialisation
-
-LocalTraceBufferPool* LocalTraceBufferPool::_singleton = 0;
-//#ifndef WIN32
-//pthread_mutex_t LocalTraceBufferPool::_singletonMutex;
-//#else
-pthread_mutex_t LocalTraceBufferPool::_singletonMutex =
- PTHREAD_MUTEX_INITIALIZER;
-//#endif
-BaseTraceCollector *LocalTraceBufferPool::_myThreadTrace = 0;
-
-// ============================================================================
-/*!
- * Guarantees a unique object instance of the class (singleton thread safe).
- * When the LocalTraceBufferPool instance is created, the trace collector is
- * also created (singleton). Type of trace collector to create depends on
- * environment variable "SALOME_trace":
- * - "local" implies standard err trace, LocalTraceCollector is launched.
- * - "file" implies trace in /tmp/tracetest.log
- * - "file:pathname" implies trace in file pathname
- * - anything else like "other" : try to load dynamically a library named
- * otherTraceCollector, and invoque C method instance() to start a singleton
- * instance of the trace collector. Example: with_loggerTraceCollector, for
- * CORBA Log.
- */
-// ============================================================================
-
-LocalTraceBufferPool* LocalTraceBufferPool::instance()
-{
- if (_singleton == 0) // no need of lock when singleton already exists
- {
- int ret;
- ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
- if (_singleton == 0) // another thread may have got
- { // the lock after the first test
- DEVTRACE("New buffer pool");
- LocalTraceBufferPool* myInstance = new LocalTraceBufferPool();
-
- new DESTRUCTOR_OF<LocalTraceBufferPool> (*myInstance);
- _singleton = myInstance;
-
- // --- start a trace Collector
-
- char* traceKind = getenv("SALOME_trace");
-
- if ( !traceKind || strcmp(traceKind,"local")==0 ) // mkr : 27.11.2006 : PAL13967 - Distributed supervision graphs - Problem with "SALOME_trace"
- {
- _myThreadTrace = LocalTraceCollector::instance();
- }
- else if (strncmp(traceKind,"file",strlen("file"))==0)
- {
- const char *fileName;
- if (strlen(traceKind) > strlen("file"))
- fileName = &traceKind[strlen("file")+1];
- else
- fileName = "/tmp/tracetest.log";
-
- _myThreadTrace = FileTraceCollector::instance(fileName);
- }
- else // --- try a dynamic library
- {
-#ifndef WIN32
- void* handle;
- string impl_name = string ("lib") + traceKind
- + string("TraceCollector.so");
- handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ;
-#else
- HINSTANCE handle;
- string impl_name = string ("lib") + traceKind + string(".dll");
- handle = LoadLibrary( impl_name.c_str() );
-#endif
- if ( handle )
- {
- typedef BaseTraceCollector * (*FACTORY_FUNCTION) (void);
-#ifndef WIN32
- FACTORY_FUNCTION TraceCollectorFactory =
- (FACTORY_FUNCTION) dlsym(handle, "SingletonInstance");
-#else
- FACTORY_FUNCTION TraceCollectorFactory =
- (FACTORY_FUNCTION)GetProcAddress(handle, "SingletonInstance");
-#endif
- if ( !TraceCollectorFactory )
- {
- cerr << "Can't resolve symbol: SingletonInstance" <<endl;
-#ifndef WIN32
- cerr << "dlerror: " << dlerror() << endl;
-#endif
- exit( 1 );
- }
- _myThreadTrace = (TraceCollectorFactory) ();
- }
- else
- {
- cerr << "library: " << impl_name << " not found !" << endl;
- assert(handle); // to give file and line
- exit(1); // in case assert is deactivated
- }
- }
- DEVTRACE("New buffer pool: end");
- }
- ret = pthread_mutex_unlock(&_singletonMutex); // release lock
- }
- return _singleton;
-}
-
-// ============================================================================
-/*!
- * Called by trace producers within their threads. The trace message is copied
- * in specific buffer from a circular pool of buffers.
- * Waits until there is a free buffer in the pool, gets the first available
- * buffer, fills it with the message.
- * Messages are printed in a separate thread (see retrieve method)
- */
-// ============================================================================
-
-int LocalTraceBufferPool::insert(int traceType, const char* msg)
-{
-
- // get immediately a message number to control sequence (mutex protected)
-
- unsigned long myMessageNumber = lockedIncrement(_position);
-
- // wait until there is a free buffer in the pool
-
- int ret = -1;
- while (ret)
- {
- ret = sem_wait(&_freeBufferSemaphore);
- if (ret) perror(" LocalTraceBufferPool::insert, sem_wait");
- }
-
- // get the next free buffer available (mutex protected)
-
- unsigned long myInsertPos = lockedIncrement(_insertPos);
-
- // fill the buffer with message, thread id and type (normal or abort)
-
- strncpy(_myBuffer[myInsertPos%TRACE_BUFFER_SIZE].trace,
- msg,
- MAXMESS_LENGTH); // last chars always "...\n\0" if msg too long
- _myBuffer[myInsertPos%TRACE_BUFFER_SIZE].threadId =pthread_self();//thread id
- _myBuffer[myInsertPos%TRACE_BUFFER_SIZE].traceType = traceType;
- _myBuffer[myInsertPos%TRACE_BUFFER_SIZE].position = myMessageNumber;
-
-
- // increment the full buffer semaphore
- // (if previously 0, awake thread in charge of trace)
-
- ret = sem_post(&_fullBufferSemaphore);
-
- // returns the number of free buffers
-
- sem_getvalue(&_freeBufferSemaphore, &ret);
- return ret;
-}
-
-// ============================================================================
-/*!
- * Called by the thread in charge of printing trace messages.
- * Waits until there is a buffer with a message to print.
- * Gets the first buffer to print, copies it int the provided buffer
- */
-// ============================================================================
-
-int LocalTraceBufferPool::retrieve(LocalTrace_TraceInfo& aTrace)
-{
-
- // wait until there is a buffer in the pool, with a message to print
-
- int ret = -1;
- while (ret)
- {
- ret = sem_wait(&_fullBufferSemaphore);
- if (ret) MESSAGE (" LocalTraceBufferPool::retrieve, sem_wait");
- }
-
- // get the next buffer to print
-
- unsigned long myRetrievePos = lockedIncrement(_retrievePos);
-
- // copy the buffer from the pool to the provided buffer
-
- memcpy((void*)&aTrace,
- (void*)&_myBuffer[myRetrievePos%TRACE_BUFFER_SIZE],
- sizeof(aTrace));
-
- // increment the free buffer semaphore
- // (if previously 0, awake one of the threads waiting to put a trace, if any)
- // there is no way to preserve the order of waiting threads if several
- // threads are waiting to put a trace: the waken up thread is not
- // necessarily the first thread to wait.
-
- ret = sem_post(&_freeBufferSemaphore);
-
- // returns the number of full buffers
-
- sem_getvalue(&_fullBufferSemaphore, &ret);
- return ret;
-}
-
-// ============================================================================
-/*!
- * Gives the number of buffers to print.
- * Usage : when the thread in charge of messages print id to be stopped,
- * check if there is still something to print, before stop.
- * There is no need of mutex here, provided there is only one thread to
- * retrieve and print the buffers.
- */
-// ============================================================================
-
-unsigned long LocalTraceBufferPool::toCollect()
-{
- return _insertPos - _retrievePos;
-}
-
-// ============================================================================
-/*!
- * Constructor : initialize pool of buffers, semaphores and mutex.
- */
-// ============================================================================
-
-LocalTraceBufferPool::LocalTraceBufferPool()
-{
- //cerr << "LocalTraceBufferPool::LocalTraceBufferPool()" << endl;
-
- _insertPos = ULONG_MAX; // first increment will give 0
- _retrievePos = ULONG_MAX;
- _position=0; // first message will have number = 1
-
- memset(_myBuffer, 0, sizeof(_myBuffer)); // to guarantee end of strings = 0
- for (int i=0; i<TRACE_BUFFER_SIZE; i++)
- strcpy(&(_myBuffer[i].trace[MAXMESS_LENGTH]),TRUNCATED_MESSAGE);
- int ret;
- ret=sem_init(&_freeBufferSemaphore, 0, TRACE_BUFFER_SIZE); // all buffer free
- if (ret!=0) IMMEDIATE_ABORT(ret);
- ret=sem_init(&_fullBufferSemaphore, 0, 0); // 0 buffer full
- if (ret!=0) IMMEDIATE_ABORT(ret);
- ret=pthread_mutex_init(&_incrementMutex,NULL); // default = fast mutex
- if (ret!=0) IMMEDIATE_ABORT(ret);
-
- //cerr << "LocalTraceBufferPool::LocalTraceBufferPool()-end" << endl;
-}
-
-// ============================================================================
-/*!
- * Destructor : release memory associated with semaphores and mutex
- */
-// ============================================================================
-
-LocalTraceBufferPool::~LocalTraceBufferPool()
-{
- int ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
- if (_singleton)
- {
- DEVTRACE("LocalTraceBufferPool::~LocalTraceBufferPool()");
- delete (_myThreadTrace);
- _myThreadTrace = 0;
- int ret;
- ret=sem_destroy(&_freeBufferSemaphore);
- ret=sem_destroy(&_fullBufferSemaphore);
- ret=pthread_mutex_destroy(&_incrementMutex);
- DEVTRACE("LocalTraceBufferPool::~LocalTraceBufferPool()-end");
- _singleton = 0;
- }
- ret = pthread_mutex_unlock(&_singletonMutex); // release lock
-}
-
-// ============================================================================
-/*!
- * pool counters are incremented under a mutex protection
- */
-// ============================================================================
-
-unsigned long LocalTraceBufferPool::lockedIncrement(unsigned long& pos)
-{
- int ret;
- ret = pthread_mutex_lock(&_incrementMutex); // lock access to counters
- unsigned long mypos = ++pos;
- ret = pthread_mutex_unlock(&_incrementMutex); // release lock
- return mypos;
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// Author : Paul RASCLE (EDF)
-// Module : KERNEL
-// $Header$
-//
-#ifndef _LOCALTRACEBUFFERPOOL_HXX_
-#define _LOCALTRACEBUFFERPOOL_HXX_
-
-#include "SALOME_LocalTrace.hxx"
-
-#define TRACE_BUFFER_SIZE 512 // number of entries in circular buffer
- // must be power of 2
-#define MAX_TRACE_LENGTH 1024 // messages are truncated at this size
-
-#include <pthread.h>
-#include <semaphore.h>
-#include "BaseTraceCollector.hxx"
-#include "BasicsGenericDestructor.hxx"
-
-#define ABORT_MESS 1 // for traceType field in struct LocalTrace_TraceInfo
-#define NORMAL_MESS 0
-
-struct SALOMELOCALTRACE_EXPORT LocalTrace_TraceInfo
-{
- char trace[MAX_TRACE_LENGTH];
- pthread_t threadId;
- int traceType; // normal or abort
- int position; // to check sequence
-};
-
-class SALOMELOCALTRACE_EXPORT LocalTraceBufferPool : public PROTECTED_DELETE
-{
- public:
- static LocalTraceBufferPool* instance();
- int insert(int traceType, const char* msg);
- int retrieve(LocalTrace_TraceInfo& aTrace);
- unsigned long toCollect();
-
- protected:
- LocalTraceBufferPool();
- virtual ~LocalTraceBufferPool();
- unsigned long lockedIncrement(unsigned long& pos);
-
- private:
- static LocalTraceBufferPool* _singleton;
- static pthread_mutex_t _singletonMutex;
- static BaseTraceCollector *_myThreadTrace;
-
- LocalTrace_TraceInfo _myBuffer[TRACE_BUFFER_SIZE];
- sem_t _freeBufferSemaphore; // to wait until there is a free buffer
- sem_t _fullBufferSemaphore; // to wait until there is a buffer to print
- pthread_mutex_t _incrementMutex; // to lock position variables for increment
- unsigned long _position;
- unsigned long _insertPos;
- unsigned long _retrievePos;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : LocalTraceCollector.cxx
-// Author : Paul RASCLE (EDF)
-// Module : KERNEL
-// $Header$
-//
-#include <iostream>
-#include <sstream>
-#include <fstream>
-#include <cstdlib>
-
-using namespace std;
-
-#include "LocalTraceCollector.hxx"
-
-// ============================================================================
-/*!
- * This class is for use without CORBA, inside or outside SALOME.
- * SALOME uses SALOMETraceCollector, to allow trace collection via CORBA.
- * Type of trace (and corresponding class) is choosen in LocalTraceBufferPool.
- *
- * Guarantees a unique object instance of the class (singleton thread safe)
- * a separate thread for loop to print traces is launched.
- */
-// ============================================================================
-
-BaseTraceCollector* LocalTraceCollector::instance()
-{
- if (_singleton == 0) // no need of lock when singleton already exists
- {
- int ret;
- ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
- if (_singleton == 0) // another thread may have got
- { // the lock after the first test
- BaseTraceCollector* myInstance = new LocalTraceCollector();
-
- sem_init(&_sem,0,0); // to wait until run thread is initialized
- pthread_t traceThread;
- pthread_create(&traceThread, NULL,
- LocalTraceCollector::run, NULL);
- sem_wait(&_sem);
- _singleton = myInstance; // _singleton known only when init done
- }
- ret = pthread_mutex_unlock(&_singletonMutex); // release lock
- }
- return _singleton;
-}
-
-// ============================================================================
-/*!
- * In a separate thread, loop to print traces.
- * Mutex garantees intialisation on instance method is done and only one run
- * allowed (double check ...)
- * Loop until there is no more buffer to print,
- * and no ask for end from destructor.
- * Get a buffer. If type = ABORT then exit application with message.
- */
-// ============================================================================
-
-void* LocalTraceCollector::run(void *bid)
-{
- _threadId = new pthread_t;
- *_threadId = pthread_self();
- sem_post(&_sem); // unlock instance
-
- LocalTraceBufferPool* myTraceBuffer = LocalTraceBufferPool::instance();
- LocalTrace_TraceInfo myTrace;
-
- // --- Loop until there is no more buffer to print,
- // and no ask for end from destructor.
-
- while ((!_threadToClose) || myTraceBuffer->toCollect() )
- {
- if (_threadToClose)
- {
- DEVTRACE("FileTraceCollector _threadToClose");
- //break;
- }
-
- myTraceBuffer->retrieve(myTrace);
- if (myTrace.traceType == ABORT_MESS)
- {
- cout << flush ;
-#ifndef WIN32
- cerr << "INTERRUPTION from thread " << myTrace.threadId
- << " : " << myTrace.trace;
-#else
- cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
- << " : " << myTrace.trace;
-#endif
- cerr << flush ;
- exit(1);
- }
- else
- {
- cout << flush ;
-#ifndef WIN32
- cerr << "th. " << myTrace.threadId << " " << myTrace.trace;
-#else
- cerr << "th. " << (void*)(&myTrace.threadId)
- << " " << myTrace.trace;
-#endif
- cerr << flush ;
- }
- }
- pthread_exit(NULL);
- return NULL;
-}
-
-// ============================================================================
-/*!
- * Destructor: wait until printing thread ends (LocalTraceCollector::run)
- */
-// ============================================================================
-
-LocalTraceCollector:: ~LocalTraceCollector()
-{
- int ret;
- ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
- if (_singleton)
- {
- DEVTRACE("LocalTraceCollector:: ~LocalTraceCollector()");
- LocalTraceBufferPool* myTraceBuffer = LocalTraceBufferPool::instance();
- _threadToClose = 1;
- myTraceBuffer->insert(NORMAL_MESS,"end of trace\n"); // to wake up thread
- if (_threadId)
- {
- int ret = pthread_join(*_threadId, NULL);
- if (ret) cerr << "error close LocalTraceCollector : "<< ret << endl;
- else DEVTRACE("LocalTraceCollector destruction OK");
- delete _threadId;
- _threadId = 0;
- _threadToClose = 0;
- }
- _singleton = 0;
- }
- ret = pthread_mutex_unlock(&_singletonMutex); // release lock
-}
-
-// ============================================================================
-/*!
- * Constructor: no need of LocalTraceBufferPool object initialization here,
- * thread safe singleton used in LocalTraceBufferPool::instance()
- */
-// ============================================================================
-
-LocalTraceCollector::LocalTraceCollector()
-{
- _threadId=0;
- _threadToClose = 0;
-}
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : LocalTraceCollector.hxx
-// Author : Paul RASCLE (EDF)
-// Module : KERNEL
-// $Header$
-//
-#ifndef _LOCALTRACECOLLECTOR_HXX_
-#define _LOCALTRACECOLLECTOR_HXX_
-
-#include "SALOME_LocalTrace.hxx"
-
-#include "LocalTraceBufferPool.hxx"
-#include "BaseTraceCollector.hxx"
-
-//! See also other derived Classes in SALOMELocalTrace for usage without CORBA,
-//! see also derived Classes in SALOMETraceCollector for usage with CORBA.
-
-class SALOMELOCALTRACE_EXPORT LocalTraceCollector : public BaseTraceCollector
-{
- public:
- static BaseTraceCollector* instance();
- static void *run(void *bid);
- ~LocalTraceCollector();
-
- protected:
- LocalTraceCollector();
-};
-
-#endif
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# SALOMELocalTrace : log on local machine
-# File : Makefile.am
-# Author : Guillaume BOULANT (CSSI)
-# Module : SALOME
-# $Header$
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-salomeinclude_HEADERS = \
- utilities.h \
- LocalTraceBufferPool.hxx \
- BaseTraceCollector.hxx \
- SALOME_LocalTrace.hxx
-
-lib_LTLIBRARIES = libSALOMELocalTrace.la
-
-libSALOMELocalTrace_la_SOURCES = \
- BaseTraceCollector.cxx \
- BaseTraceCollector.hxx \
- LocalTraceCollector.cxx \
- LocalTraceCollector.hxx \
- FileTraceCollector.cxx \
- FileTraceCollector.hxx \
- LocalTraceBufferPool.cxx \
- LocalTraceBufferPool.hxx \
- SALOME_LocalTrace.hxx
-
-libSALOMELocalTrace_la_LDFLAGS = -no-undefined -version-info=0:0:0
-libSALOMELocalTrace_la_CPPFLAGS = -I$(srcdir)/../Basics
-libSALOMELocalTrace_la_LIBADD = ../Basics/libSALOMEBasics.la
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOME_LocalTrace.hxx
-// Author : Alexander A. BORODIN
-// Module : SALOME
-//
-#ifndef _SALOME_LOCALTRACE_HXX_
-#define _SALOME_LOCALTRACE_HXX_
-
-#ifdef WIN32
-# if defined SALOMELOCALTRACE_EXPORTS || defined SALOMELocalTrace_EXPORTS
-# define SALOMELOCALTRACE_EXPORT __declspec( dllexport )
-# else
-# define SALOMELOCALTRACE_EXPORT __declspec( dllimport )
-# endif
-#else
-# define SALOMELOCALTRACE_EXPORT
-#endif
-
-#endif
-
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# SALOMELocalTrace : log on local machine
-# File : Makefile.am
-# Author : Guillaume Boulant (CSSI)
-# Module : KERNEL
-# $Header$
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-# This directory defines the subdirectory src in the top source directory.
-SRCROOT=$(srcdir)/../..
-
-#
-# ===============================================================
-# Files to be installed
-# ===============================================================
-#
-# header files
-salomeinclude_HEADERS = SALOMELocalTraceTest.hxx
-
-# Executable scripts to be installed
-dist_salomescript_PYTHON = TestSALOMELocalTrace.py
-
-#
-# ===============================================================
-# Libraries targets
-# ===============================================================
-#
-
-lib_LTLIBRARIES = libSALOMELocalTraceTest.la
-libSALOMELocalTraceTest_la_SOURCES = SALOMELocalTraceTest.cxx
-libSALOMELocalTraceTest_la_CPPFLAGS = \
- @CPPUNIT_INCLUDES@ \
- -I$(SRCROOT)/SALOMELocalTrace \
- -I$(SRCROOT)/Basics
-
-libSALOMELocalTraceTest_la_LIBADD = \
- @CPPUNIT_LIBS@ \
- ../../SALOMELocalTrace/libSALOMELocalTrace.la
-
-#
-# ===============================================================
-# Executables targets
-# ===============================================================
-#
-bin_PROGRAMS = TestSALOMELocalTrace
-TestSALOMELocalTrace_SOURCES = TestSALOMELocalTrace.cxx
-TestSALOMELocalTrace_CPPFLAGS = \
- @CPPUNIT_INCLUDES@ \
- -I$(SRCROOT)/Basics/Test
-
-TestSALOMELocalTrace_LDADD = \
- @CPPUNIT_LIBS@ \
- libSALOMELocalTraceTest.la \
- ../../SALOMELocalTrace/libSALOMELocalTrace.la \
- ../../Basics/libSALOMEBasics.la
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "SALOMELocalTraceTest.hxx"
-
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <cstdlib>
-#include "LocalTraceBufferPool.hxx"
-#include "utilities.h"
-
-using namespace std;
-
-
-// ============================================================================
-/*!
- *
- */
-// ============================================================================
-
-void
-SALOMELocalTraceTest::setUp()
-{
-}
-
-// ============================================================================
-/*!
- *
- */
-// ============================================================================
-
-void
-SALOMELocalTraceTest::tearDown()
-{
-}
-
-#define TRACEFILE "/tmp/traceUnitTest.log"
-
-// ============================================================================
-/*!
- * Open and close a trace on a file, test singleton
- */
-// ============================================================================
-
-void
-SALOMELocalTraceTest::testSingletonBufferPool()
-{
- // --- trace on file
- const char *theFileName = TRACEFILE;
-
- string s = "file:";
- s += theFileName;
- CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
-
- ofstream traceFile;
- traceFile.open(theFileName, ios::out | ios::app);
- CPPUNIT_ASSERT(traceFile); // file created empty, then closed
- traceFile.close();
-
- LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();
- CPPUNIT_ASSERT(bp1);
- LocalTraceBufferPool* bp2 = LocalTraceBufferPool::instance();
- CPPUNIT_ASSERT(bp1 == bp2);
- bp1->deleteInstance(bp1);
-}
-
-
-
-#define NUM_THREADS 2
-#define NUM_MESSAGES 5
-void *PrintHello(void *threadid);
-
-// ============================================================================
-/*!
- * open a trace on console, multithread writing on file, close
- */
-// ============================================================================
-
-void
-SALOMELocalTraceTest::testLoadBufferPoolLocal()
-{
- string s = "local";
- CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
-
- // --- numThread thread creation for trace generation.
- int numThread = 2;
- pthread_t threads[numThread];
- int rc, t;
- for(t=0;t<numThread;t++)
- {
- MESSAGE("Creating thread " << t);
- rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t) ;
- CPPUNIT_ASSERT( !rc);
- }
-
- // --- wait for end of each thread producing trace.
-
- for(t=0;t<numThread;t++)
- {
- pthread_join(threads[t], NULL);
- MESSAGE("--------------------- end of PrintHello thread " << t);
- }
- MESSAGE(" ---- end of PrintHello threads ---- ");
-
- LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();
- CPPUNIT_ASSERT(bp1);
- bp1->deleteInstance(bp1);
-}
-
-// ============================================================================
-/*!
- * open a trace on a file, multithread writing on file, close
- */
-// ============================================================================
-
-void
-SALOMELocalTraceTest::testLoadBufferPoolFile()
-{
- const char *theFileName = TRACEFILE;
-
- string s = "file:";
- s += theFileName;
- //s = "local";
- CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
-
- ofstream traceFile;
- traceFile.open(theFileName, ios::out | ios::trunc);
- CPPUNIT_ASSERT(traceFile); // file created empty, then closed
- traceFile.close();
-
- // --- NUM_THREADS thread creation for trace generation.
-
- pthread_t threads[NUM_THREADS];
- int rc, t;
- for(t=0;t<NUM_THREADS;t++)
- {
- MESSAGE("Creating thread " << t);
- rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t) ;
- CPPUNIT_ASSERT( !rc);
- }
-
- // --- wait for end of each thread producing trace.
-
- for(t=0;t<NUM_THREADS;t++)
- {
- pthread_join(threads[t], NULL);
- MESSAGE("--------------------- end of PrintHello thread " << t);
- }
- MESSAGE(" ---- end of PrintHello threads ---- ");
-
- LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();
- CPPUNIT_ASSERT(bp1);
- bp1->deleteInstance(bp1);
-}
-
-// ============================================================================
-/*!
- * NUM_THREAD are created with function PrintHello,
- * which produces NUM_MESSAGES traces.
- */
-// ============================================================================
-
-void *PrintHello(void *threadid)
-{
-#if defined(_DEBUG_) || defined(_DEBUG)
- long id_thread = (long)threadid;
- for (int i=0; i<NUM_MESSAGES;i++)
- MESSAGE("Hello World! This is a trace test : " << id_thread
- << " - iter " << i);
-#endif
- pthread_exit(NULL);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef _SALOMELOCALTRACETEST_HXX_
-#define _SALOMELOCALTRACETEST_HXX_
-
-#include <cppunit/extensions/HelperMacros.h>
-
-class SALOMELocalTraceTest : public CppUnit::TestFixture
-{
- CPPUNIT_TEST_SUITE( SALOMELocalTraceTest );
- CPPUNIT_TEST( testSingletonBufferPool );
- CPPUNIT_TEST( testLoadBufferPoolLocal );
- CPPUNIT_TEST( testLoadBufferPoolFile );
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void setUp();
- void tearDown();
-
- void testSingletonBufferPool();
- void testLoadBufferPoolLocal();
- void testLoadBufferPoolFile();
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// --- include all Unit Test from basics until the present directory
-//
-#include "SALOMELocalTraceTest.hxx"
-
-// --- Registers the fixture into the 'registry'
-
-CPPUNIT_TEST_SUITE_REGISTRATION( SALOMELocalTraceTest );
-
-// --- generic Main program from Basic/Test
-
-#include "BasicMainTest.hxx"
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-import sys, os,signal,string,commands
-import runSalome
-import setenv
-
-# get SALOME environment :
-# here we need KERNEL_ROOT_DIR, PATH, LD_LIBRARY_PATH
-
-args, modules_list, modules_root_dir = setenv.get_config()
-setenv.set_env(args, modules_list, modules_root_dir)
-
-# execute Unit Test
-
-command = ['TestSALOMELocalTrace']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
-
-# no process to kill
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : utilities.h
-// Author : Antoine YESSAYAN, Paul RASCLE, EDF
-// Module : SALOME
-// $Header$
-//
-/* --- Definition macros file to print informations if _DEBUG_ is defined --- */
-
-#ifndef UTILITIES_H
-#define UTILITIES_H
-
-#include <iostream>
-#include <sstream>
-#include <cstdlib>
-
-
-#include "LocalTraceBufferPool.hxx"
-
-/*!
- * For each message to put in the trace, a specific ostingstream object is
- * created and destroyed automatically at the end of the message macro.
- * The insert function of LocalTraceBufferPool class gets a buffer in a
- * buffer pool (unique with the help of mutexes and semaphores) and copy the
- * message in the buffer.
- * This buffer is read later by a specific thread in charge of trace print.
- * Order of trace entries is globally respected. Nevertheless, if there are
- * several threads waiting for a free buffer to trace, the order of
- * thread waken up is not garanteed (no fifo or priority rules in Linux Kernel)
- */
-
-#define MESS_INIT(deb) std::ostringstream os; os<<deb
-#define MESS_BEGIN(deb) MESS_INIT(deb)<<__FILE__ <<" ["<<__LINE__<<"] : "
-#define MESS_END std::endl; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, os.str().c_str());
-#define MESS_ABORT std::endl; LocalTraceBufferPool::instance()->insert(ABORT_MESS, os.str().c_str());
-
-// Macroses for messages with separated structure in c++ file in _DUBUG mode
-#define MESSAGE_BEGIN(msg) {std::ostringstream ss; ss <<__FILE__ <<" ["<<__LINE__<<"] : "<< msg; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, ss.str().c_str());}
-#define MESSAGE_ADD(msg) {std::ostringstream ss; ss << msg; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, ss.str().c_str());}
-#define MESSAGE_END(msg) {std::ostringstream ss; ss << msg << std::endl; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, ss.str().c_str());}
-
-// --- Some macros are always defined (without _DEBUG_): for use with release version
-
-#define INFOS(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END}
-#define PYSCRIPT(msg) {MESS_INIT("---PYSCRIPT--- ") << msg << MESS_END}
-#define INTERRUPTION(msg) {MESS_BEGIN("- INTERRUPTION: ")<< msg << MESS_ABORT}
-
-#ifdef WIN32
-#define IMMEDIATE_ABORT(code) {std::cout <<std::flush; \
- std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << flush; \
- std::cerr << "ABORT return code= "<< code << std::endl; \
- /*std::*/exit(code);}
-#else
-#define IMMEDIATE_ABORT(code) {std::cout <<std::flush; \
- std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << flush; \
- std::cerr << "ABORT return code= "<< code << std::endl; \
- std::exit(code);}
-#endif
-
-/* --- To print date and time of compilation of current source --- */
-
-#if defined ( __GNUC__ )
-#define COMPILER "g++"
-#elif defined ( __sun )
-#define COMPILER "CC"
-#elif defined ( __KCC )
-#define COMPILER "KCC"
-#elif defined ( __PGI )
-#define COMPILER "pgCC"
-#elif defined ( __alpha )
-#define COMPILER "cxx"
-#else
-#define COMPILER "undefined"
-#endif
-
-#ifdef INFOS_COMPILATION
-#error INFOS_COMPILATION already defined
-#endif
-
-#if defined(_DEBUG_) || defined(_DEBUG)
-
-// --- the following MACROS are useful at debug time
-
-#define INFOS_COMPILATION { MESS_BEGIN("COMPILED with ") << COMPILER \
- << ", " << __DATE__ \
- << " at " << __TIME__ << MESS_END }
-
-#define MESSAGE(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END}
-#define SCRUTE(var) {MESS_BEGIN("- Trace ") << #var << "=" << var <<MESS_END}
-
-#define REPERE ("------- ")
-#define BEGIN_OF(msg) {MESS_BEGIN(REPERE) << "Begin of: " << msg << MESS_END}
-#define END_OF(msg) {MESS_BEGIN(REPERE) << "Normal end of: " << msg << MESS_END}
-
-#ifndef ASSERT
-#define ASSERT(condition) \
- if (!(condition)){INTERRUPTION("CONDITION "<<#condition<<" NOT VERIFIED")}
-#endif /* ASSERT */
-
-
-#else /* ifdef _DEBUG_*/
-
-#define INFOS_COMPILATION
-#define MESSAGE(msg) {}
-#define SCRUTE(var) {}
-#define REPERE
-#define BEGIN_OF(msg) {}
-#define END_OF(msg) {}
-
-#ifndef ASSERT
-#define ASSERT(condition) {}
-#endif /* ASSERT */
-
-#endif /* ifdef _DEBUG_*/
-
-#endif /* ifndef UTILITIES_H */
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# SALOMETraceCollector
-# File : Makefile.am
-# Author : Guillaume BOULANT, CSSI
-# Module : KERNEL
-# $Header$
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-# header files
-salomeinclude_HEADERS = \
- SALOMETraceCollector.hxx \
- TraceCollector_WaitForServerReadiness.hxx
-
-# Libraries targets
-lib_LTLIBRARIES = libwith_loggerTraceCollector.la
-
-libwith_loggerTraceCollector_la_SOURCES =\
- SALOMETraceCollector.cxx \
- TraceCollector_WaitForServerReadiness.cxx
-
-libwith_loggerTraceCollector_la_CPPFLAGS =\
- -I$(srcdir)/../Basics \
- -I$(srcdir)/../SALOMELocalTrace \
- -I$(top_builddir)/salome_adm/unix \
- -I$(top_builddir)/idl \
- @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
-
-libwith_loggerTraceCollector_la_LDFLAGS = -no-undefined -version-info=0:0:0
-libwith_loggerTraceCollector_la_LIBADD = \
- ../SALOMELocalTrace/libSALOMELocalTrace.la \
- $(top_builddir)/idl/libSalomeIDLKernel.la\
- @CORBA_LIBS@
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : LocalTraceCollector.cxx
-// Author : Paul RASCLE (EDF)
-// Module : KERNEL
-// $Header$
-//
-#include <SALOMEconfig.h>
-
-#include <iostream>
-#include <sstream>
-#include <fstream>
-#include <cstdlib>
-#include <omniORB4/CORBA.h>
-
-using namespace std;
-
-#include "SALOMETraceCollector.hxx"
-#include "TraceCollector_WaitForServerReadiness.hxx"
-#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(Logger)
-
-// Class attributes initialisation, for class method SALOMETraceCollector::run
-
-CORBA::ORB_ptr SALOMETraceCollector::_orb = 0;
-
-// ============================================================================
-/*!
- * This class is for use with CORBA, inside SALOME.
- * Type of trace (and corresponding class) is choosen in LocalTraceBufferPool.
- *
- * Guarantees a unique object instance of the class (singleton thread safe)
- * a separate thread for loop to print traces is launched.
- */
-// ============================================================================
-
-BaseTraceCollector* SALOMETraceCollector::instance()
-{
- if (_singleton == 0) // no need of lock when singleton already exists
- {
- int ret;
- ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
- if (_singleton == 0) // another thread may have got
- { // the lock after the first test
- BaseTraceCollector* myInstance = new SALOMETraceCollector();
- int argc=0;
- char *_argv=0;
- char ** argv = &_argv;
- _orb = CORBA::ORB_init (argc, argv);
-
- sem_init(&_sem,0,0); // to wait until run thread is initialized
- pthread_t traceThread;
- int bid = 0;
- pthread_create(&traceThread, NULL,
- SALOMETraceCollector::run, (void *)bid);
- sem_wait(&_sem);
- _singleton = myInstance; // _singleton known only when init done
- }
- ret = pthread_mutex_unlock(&_singletonMutex); // release lock
- }
- return _singleton;
-}
-
-// ============================================================================
-/*!
- * In a separate thread, loop to print traces.
- * Mutex garantees intialisation on instance method is done and only one run
- * allowed (double check ...)
- * Loop until there is no more buffer to print,
- * and no ask for end from destructor.
- * Get a buffer. If type = ABORT then exit application with message.
- */
-// ============================================================================
-
-void* SALOMETraceCollector::run(void *bid)
-{
- _threadId = new pthread_t;
- *_threadId = pthread_self();
- sem_post(&_sem); // unlock instance
-
- LocalTraceBufferPool* myTraceBuffer = LocalTraceBufferPool::instance();
- LocalTrace_TraceInfo myTrace;
-
- SALOME_Logger::Logger_var m_pInterfaceLogger;
- CORBA::Object_var obj;
-
- obj = TraceCollector_WaitForServerReadiness(_orb,"Logger");
- if (!CORBA::is_nil(obj))
- m_pInterfaceLogger = SALOME_Logger::Logger::_narrow(obj);
- if (CORBA::is_nil(m_pInterfaceLogger))
- {
- cerr << "Logger server not found ! Abort" << endl;
- cerr << flush ;
- exit(1);
- }
- else
- {
- CORBA::String_var LogMsg =
- CORBA::string_dup("\n---Init logger trace---\n");
- m_pInterfaceLogger->putMessage(LogMsg);
- DEVTRACE("Logger server found");
- }
-
- // --- Loop until there is no more buffer to print,
- // and no ask for end from destructor.
-
- while ((!_threadToClose) || myTraceBuffer->toCollect() )
- {
- if (_threadToClose)
- {
- DEVTRACE("SALOMETraceCollector _threadToClose");
- //break;
- }
-
- myTraceBuffer->retrieve(myTrace);
- if (!CORBA::is_nil(_orb))
- {
- if (myTrace.traceType == ABORT_MESS)
- {
- stringstream abortMessage("");
-#ifndef WIN32
- abortMessage << "INTERRUPTION from thread "
- << myTrace.threadId << " : " << myTrace.trace;
-#else
- abortMessage << "INTERRUPTION from thread "
- << (void*)&myTrace.threadId
- << " : " << myTrace.trace;
-#endif
- CORBA::String_var LogMsg =
- CORBA::string_dup(abortMessage.str().c_str());
- m_pInterfaceLogger->putMessage(LogMsg);
- exit(1);
- }
- else
- {
- stringstream aMessage("");
-#ifndef WIN32
- aMessage << "th. " << myTrace.threadId
-#else
- aMessage << "th. " << (void*)&myTrace.threadId
-#endif
- << " " << myTrace.trace;
- CORBA::String_var LogMsg =
- CORBA::string_dup(aMessage.str().c_str());
- m_pInterfaceLogger->putMessage(LogMsg);
- }
- }
- }
- pthread_exit(NULL);
- return NULL;
-}
-
-// ============================================================================
-/*!
- * Destructor: wait until printing thread ends (SALOMETraceCollector::run)
- */
-// ============================================================================
-
-SALOMETraceCollector:: ~SALOMETraceCollector()
-{
- int ret;
- ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
- if (_singleton)
- {
- DEVTRACE("SALOMETraceCollector:: ~SALOMETraceCollector()");
- LocalTraceBufferPool* myTraceBuffer = LocalTraceBufferPool::instance();
- _threadToClose = 1;
- myTraceBuffer->insert(NORMAL_MESS,"end of trace\n"); // to wake up thread
- if (_threadId)
- {
- int ret = pthread_join(*_threadId, NULL);
- if (ret) cerr << "error close SALOMETraceCollector : "<< ret << endl;
- else DEVTRACE("SALOMETraceCollector destruction OK");
- delete _threadId;
- _threadId = 0;
- _threadToClose = 0;
- }
- _singleton = 0;
- }
- ret = pthread_mutex_unlock(&_singletonMutex); // release lock
-}
-
-// ============================================================================
-/*!
- * Constructor: no need of LocalTraceBufferPool object initialization here,
- * thread safe singleton used in LocalTraceBufferPool::instance()
- */
-// ============================================================================
-
-SALOMETraceCollector::SALOMETraceCollector()
-{
- _threadId=0;
- _threadToClose = 0;
-}
-
-// ============================================================================
-/*!
- *
- */
-// ============================================================================
-
-extern "C"
-{
- SALOMETRACECOLLECTOR_EXPORT
- BaseTraceCollector *SingletonInstance(void)
- {
- BaseTraceCollector *instance = SALOMETraceCollector::instance();
- return instance;
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMETraceCollector.hxx
-// Author : Paul RASCLE (EDF)
-// Module : KERNEL
-// $Header$
-//
-#ifndef _SALOMETRACECOLLECTOR_HXX_
-#define _SALOMETRACECOLLECTOR_HXX_
-
-#include <string>
-#include <omniORB4/CORBA.h>
-#include "BaseTraceCollector.hxx"
-#include "LocalTraceBufferPool.hxx"
-
-//! See LocalTraceCollector instead of SALOMETraceCollector,
-//! for usage without CORBA
-
-#ifdef WIN32
-# if defined SALOMETRACECOLLECTOR_EXPORTS || defined with_loggerTraceCollector_EXPORTS
-# define SALOMETRACECOLLECTOR_EXPORT __declspec( dllexport )
-# else
-# define SALOMETRACECOLLECTOR_EXPORT
-# endif
-#else
-# define SALOMETRACECOLLECTOR_EXPORT
-#endif
-
-class SALOMETRACECOLLECTOR_EXPORT SALOMETraceCollector:
- public BaseTraceCollector
-{
- public:
- static BaseTraceCollector* instance();
- static void *run(void *bid);
- ~SALOMETraceCollector();
-
- protected:
- SALOMETraceCollector();
-
- private:
- static CORBA::ORB_ptr _orb;
-};
-
-#endif
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-####################################### library
-# SALOMELocalTrace : log on local machine
-# File : Makefile.am
-# Author : Guillaume Boulant (CSSI)
-# Module : KERNEL
-# $Header$
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-#
-# ===============================================================
-# Files to be installed
-# ===============================================================
-#
-
-# header files
-salomeinclude_HEADERS= SALOMETraceCollectorTest.hxx
-
-# Scripts to be installed
-dist_salomescript_PYTHON = TestSALOMETraceCollector.py
-
-
-#
-# ===============================================================
-# Local definitions
-# ===============================================================
-#
-
-# This directory defines the subdirectory src in the top source directory.
-RPATH=../..
-
-
-# This local variable defines the list of CPPFLAGS common to all target in this package.
-COMMON_CPPFLAGS=\
- @CPPUNIT_INCLUDES@ \
- -I$(srcdir)/$(RPATH)/Basics -I$(srcdir)/$(RPATH)/Basics/Test \
- -I$(srcdir)/$(RPATH)/SALOMELocalTrace -I$(srcdir)/$(RPATH)/SALOMELocalTrace/Test\
- -I$(srcdir)/$(RPATH)/SALOMETraceCollector \
- -I$(top_builddir)/salome_adm/unix
-
-# This local variable defines the list of dependant libraries common to all target in this package.
-COMMON_LIBS =\
- @CPPUNIT_LIBS@ \
- $(RPATH)/SALOMELocalTrace/Test/libSALOMELocalTraceTest.la $(RPATH)/SALOMELocalTrace/libSALOMELocalTrace.la \
- $(RPATH)/Basics/libSALOMEBasics.la
-
-
-#
-# ===============================================================
-# Libraries targets
-# ===============================================================
-#
-lib_LTLIBRARIES = libSALOMETraceCollectorTest.la
-libSALOMETraceCollectorTest_la_SOURCES = SALOMETraceCollectorTest.cxx
-libSALOMETraceCollectorTest_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSALOMETraceCollectorTest_la_LDFLAGS = -no-undefined -version-info=0:0:0
-libSALOMETraceCollectorTest_la_LIBADD = $(COMMON_LIBS)
-
-#
-# ===============================================================
-# Executables targets
-# ===============================================================
-#
-bin_PROGRAMS = TestSALOMETraceCollector
-TestSALOMETraceCollector_SOURCES = TestSALOMETraceCollector.cxx
-TestSALOMETraceCollector_CPPFLAGS = $(COMMON_CPPFLAGS)
-TestSALOMETraceCollector_LDADD = libSALOMETraceCollectorTest.la $(COMMON_LIBS)
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "SALOMETraceCollectorTest.hxx"
-
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <cstdlib>
-#include "LocalTraceBufferPool.hxx"
-#include "utilities.h"
-
-using namespace std;
-
-// ============================================================================
-/*!
- *
- */
-// ============================================================================
-
-void
-SALOMETraceCollectorTest::setUp()
-{
-}
-
-// ============================================================================
-/*!
- *
- */
-// ============================================================================
-
-void
-SALOMETraceCollectorTest::tearDown()
-{
-}
-
-#define NUM_THREADS 20
-#define NUM_MESSAGES 20
-void *PrintHello(void *threadid);
-
-// ============================================================================
-/*!
- * open a trace on a CORBA, multithread writing on file, close
- */
-// ============================================================================
-
-void
-SALOMETraceCollectorTest::testLoadBufferPoolCORBA()
-{
- string s = "with_logger";
- CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
-
- // --- NUM_THREADS thread creation for trace generation.
-
- pthread_t threads[NUM_THREADS];
- int rc, t;
- for(t=0;t<NUM_THREADS;t++)
- {
- MESSAGE("Creating thread " << t);
- rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t) ;
- CPPUNIT_ASSERT( !rc);
- }
-
- // --- wait for end of each thread producing trace.
-
- for(t=0;t<NUM_THREADS;t++)
- {
- pthread_join(threads[t], NULL);
- MESSAGE("--------------------- end of PrintHello thread " << t);
- }
- MESSAGE(" ---- end of PrintHello threads ---- ");
-
- LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();
- CPPUNIT_ASSERT(bp1);
- bp1->deleteInstance(bp1);
-}
-
-// ============================================================================
-/*!
- * NUM_THREAD are created with function PrintHello,
- * which produces NUM_MESSAGES traces.
- */
-// ============================================================================
-
-void *PrintHello(void *threadid)
-{
-#if defined(_DEBUG_) || defined(_DEBUG)
- long id_thread = (long)threadid;
- for (int i=0; i<NUM_MESSAGES;i++)
- MESSAGE("Hello World! This is a trace test : " << id_thread
- << " - iter " << i);
-#endif
- pthread_exit(NULL);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef _SALOMETRACECOLLECTORTTEST_HXX_
-#define _SALOMETRACECOLLECTORTTEST_HXX_
-
-#include <cppunit/extensions/HelperMacros.h>
-
-class SALOMETraceCollectorTest : public CppUnit::TestFixture
-{
- CPPUNIT_TEST_SUITE( SALOMETraceCollectorTest );
- CPPUNIT_TEST( testLoadBufferPoolCORBA );
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void setUp();
- void tearDown();
-
- void testLoadBufferPoolCORBA();
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// --- include all Unit Test from basics until the present directory
-//
-#include "SALOMELocalTraceTest.hxx"
-#include "SALOMETraceCollectorTest.hxx"
-
-// --- Registers the fixture into the 'registry'
-
-CPPUNIT_TEST_SUITE_REGISTRATION( SALOMELocalTraceTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( SALOMETraceCollectorTest );
-
-// --- generic Main program from Basic/Test
-
-#include "BasicMainTest.hxx"
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-import sys, os,signal,string,commands
-import runSalome
-import orbmodule
-import TestKiller
-
-# get SALOME environment :
-
-args, modules_list, modules_root_dir = runSalome.get_config()
-runSalome.set_env(args, modules_list, modules_root_dir)
-
-# launch CORBA naming server
-
-clt=orbmodule.client()
-
-# launch CORBA logger server
-
-myServer=runSalome.LoggerServer(args)
-myServer.run()
-clt.waitLogger("Logger")
-
-# execute Unit Test
-
-command = ['TestSALOMETraceCollector']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
-
-# kill Test process
-
-TestKiller.killProcess(runSalome.process_id)
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : TraceCollector_WaitForServerReadiness.cxx
-// Author : Paul RASCLE (EDF)
-// Module : KERNEL
-// $Header$
-//
-#include "TraceCollector_WaitForServerReadiness.hxx"
-#include <iostream>
-#include <ctime>
-
-#ifdef WIN32
-#include <omnithread/pthread_nt.h>
-#endif
-
-using namespace std;
-
-// ============================================================================
-/*!
- * Wait until a server is registered in naming service.
- * \param serverName name of the server to find.
- * When SALOME_NamingService is available,
- * use NamingService_WaitForServerReadiness instead.
- * This function is needed when macro MESSAGE used by SALOME_NamingService
- * is not available (inside LocalTrace methods, for instance !).
- * Direct access to CORBA Name Service. Look for serverName at Name service
- * Root without extensions.
- */
-// ============================================================================
-
-CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr orb,
- string serverName)
-{
- long TIMESleep = 500000000;
- int NumberOfTries = 40;
-
- timespec ts_req;
- ts_req.tv_nsec=TIMESleep;
- ts_req.tv_sec=0;
- timespec ts_rem;
- ts_rem.tv_nsec=0;
- ts_rem.tv_sec=0;
-
- CORBA::Object_var obj;
-
- try
- {
- // NB. You can't use SALOME_NamingService class because
- // it uses MESSAGE macro
- // Otherwise, you will get segmentation fault.
-
- CosNaming::NamingContext_var inc;
- CosNaming::Name name;
- name.length(1);
- name[0].id = CORBA::string_dup(serverName.c_str());
- CORBA::Object_var theObj=CORBA::Object::_nil();
-
- for (int itry=0; itry < NumberOfTries; itry++)
- {
- try
- {
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- if (!CORBA::is_nil(theObj))
- inc = CosNaming::NamingContext::_narrow(theObj);
- }
- catch( CORBA::SystemException& )
- {
- cout << "TraceCollector_WaitForServerReadiness: "
- << "CORBA::SystemException: "
- << "Unable to contact the Naming Service" << endl;
- }
- catch(...)
- {
- cout << "TraceCollector_WaitForServerReadiness: "
- << "Unknown exception dealing with Naming Service" << endl;
- }
-
- obj=CORBA::Object::_nil();
- if(!CORBA::is_nil(inc))
- {
- try
- {
- obj = inc->resolve(name);
- if (!CORBA::is_nil(obj))
- {
- //cout << "TraceCollector_WaitForServerReadiness: "
- // << serverName << " found in CORBA Name Service" << endl;
- break;
- }
- }
- catch (const CosNaming::NamingContext::NotFound&)
- {
- cout << "Caught exception: Naming Service can't found Logger";
- }
- }
-#ifndef WIN32
- nanosleep(&ts_req,&ts_rem);
-#else
- Sleep(TIMESleep / 1000000);
-#endif
- cout << "TraceCollector_WaitForServerReadiness: retry look for"
- << serverName << endl;
- }
- }
- catch (const CosNaming::NamingContext::NotFound&)
- {
- cout << "Caught exception: Naming Service can't found Logger";
- }
- catch (CORBA::COMM_FAILURE&)
- {
- cout << "Caught CORBA::SystemException CommFailure.";
- }
- catch (CORBA::SystemException&)
- {
- cout << "Caught CORBA::SystemException.";
- }
- catch (CORBA::Exception&)
- {
- cout << "Caught CORBA::Exception.";
- }
- catch (...)
- {
- cout << "Caught unknown exception.";
- }
- return obj._retn();
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : LocalTrace_WaitForServerReadiness.hxx
-// Author : Paul RASCLE (EDF)
-// Module : KERNEL
-// $Header$
-//
-#ifndef _TRACECOLLECTOR_WAITFORSERVERREADINESS_HXX_
-#define _TRACECOLLECTOR_WAITFORSERVERREADINESS_HXX_
-
-#include <SALOMEconfig.h>
-#include <omniORB4/CORBA.h>
-#include <string>
-
-CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr theOrb,
- std::string serverName);
-
-#endif
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-#
-# ===============================================================
-# Files to be installed
-# ===============================================================
-#
-# header files
-salomeinclude_HEADERS = SALOMEDS_Tool.hxx
-
-#
-# ===============================================================
-# Local definitions
-# ===============================================================
-#
-
-# This local variable defines the list of CPPFLAGS common to all target in this package.
-COMMON_CPPFLAGS=\
- -I$(srcdir)/../Basics \
- -I$(srcdir)/../Utils \
- -I$(srcdir)/../SALOMELocalTrace \
- -I$(top_builddir)/salome_adm/unix \
- -I$(top_builddir)/idl \
- @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ \
- @HDF5_INCLUDES@ \
- @BOOST_CPPFLAGS@
-
-# This local variable defines the list of dependant libraries common to all target in this package.
-COMMON_LIBS =\
- ../Utils/libOpUtil.la \
- $(top_builddir)/idl/libSalomeIDLKernel.la
-
-#
-# ===============================================================
-# Libraries targets
-# ===============================================================
-#
-lib_LTLIBRARIES = libTOOLSDS.la
-libTOOLSDS_la_SOURCES = \
- SALOMEDS_Tool.cxx
-
-libTOOLSDS_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libTOOLSDS_la_LDFLAGS = -no-undefined -version-info=0:0:0
-libTOOLSDS_la_LIBADD = $(COMMON_LIBS)
-
-#
-# ===============================================================
-# Executables targets
-# ===============================================================
-#
-# Nothing to build
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_Tool.cxx
-// Created : Mon Oct 21 16:24:34 2002
-// Author : Sergey RUIN
-// Project : SALOME
-// Module : SALOMEDS
-//
-#include "SALOMEDS_Tool.hxx"
-
-#include "utilities.h"
-#include "Basics_DirUtils.hxx"
-
-#ifndef WIN32
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <pwd.h>
-#include <unistd.h>
-#else
-#include <time.h>
-#include <lmcons.h>
-#endif
-
-#include <iostream>
-#include <fstream>
-#include <stdlib.h>
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-using namespace std;
-
-bool Exists(const string thePath)
-{
-#ifdef WIN32
- if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) {
- if ( GetLastError () == ERROR_FILE_NOT_FOUND ) {
- return false;
- }
- }
-#else
- int status = access ( thePath.c_str() , F_OK );
- if (status != 0) return false;
-#endif
- return true;
-}
-
-
-//============================================================================
-// function : GetTempDir
-// purpose : Return a temp directory to store created files like "/tmp/sub_dir/"
-//============================================================================
-std::string SALOMEDS_Tool::GetTmpDir()
-{
- return Kernel_Utils::GetTmpDirByEnv("SALOME_TMP_DIR");
- //Find a temporary directory to store a file
-
- /*string aTmpDir = "";
-
- char *Tmp_dir = getenv("SALOME_TMP_DIR");
- if(Tmp_dir != NULL) {
- aTmpDir = string(Tmp_dir);
-#ifdef WIN32
- if(aTmpDir[aTmpDir.size()-1] != '\\') aTmpDir+='\\';
-#else
- if(aTmpDir[aTmpDir.size()-1] != '/') aTmpDir+='/';
-#endif
- }
- else {
-#ifdef WIN32
- aTmpDir = string("C:\\");
-#else
- aTmpDir = string("/tmp/");
-#endif
- }
-
- srand((unsigned int)time(NULL));
- int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory
- char buffer[127];
- sprintf(buffer, "%d", aRND);
- string aSubDir(buffer);
- if(aSubDir.size() <= 1) aSubDir = string("123409876");
-
- aTmpDir += aSubDir; //Get RND sub directory
-
- string aDir = aTmpDir;
-
- if(Exists(aDir)) {
- for(aRND = 0; Exists(aDir); aRND++) {
- sprintf(buffer, "%d", aRND);
- aDir = aTmpDir+buffer; //Build a unique directory name
- }
- }
-
-#ifdef WIN32
- if(aDir[aDir.size()-1] != '\\') aDir+='\\';
-#else
- if(aDir[aTmpDir.size()-1] != '/') aDir+='/';
-#endif
-
-
-#ifdef WIN32
- CreateDirectory(aDir.c_str(), NULL);
-#else
- mkdir(aDir.c_str(), 0x1ff);
-#endif
-
- return aDir;*/
-}
-
-//============================================================================
-// function : RemoveTemporaryFiles
-// purpose : Removes files listed in theFileList
-//============================================================================
-void SALOMEDS_Tool::RemoveTemporaryFiles(const std::string& theDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
- const bool IsDirDeleted)
-{
- string aDirName = theDirectory;
-
- int i, aLength = theFiles.length();
- for(i=1; i<=aLength; i++) {
- string aFile(aDirName);
- aFile += theFiles[i-1];
- if(!Exists(aFile)) continue;
-
-#ifdef WIN32
- DeleteFile(aFile.c_str());
-#else
- unlink(aFile.c_str());
-#endif
- }
-
- if(IsDirDeleted) {
- if(Exists(aDirName)) {
-#ifdef WIN32
- RemoveDirectory(aDirName.c_str());
-#else
- rmdir(aDirName.c_str());
-#endif
- }
- }
-
-}
-
-//============================================================================
-// function : PutFilesToStream
-// purpose : converts the files from a list 'theFiles' to the stream
-//============================================================================
-namespace
-{
- SALOMEDS::TMPFile*
- PutFilesToStream(const std::string& theFromDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
- const SALOMEDS::ListOfFileNames& theFileNames,
- const int theNamesOnly)
- {
- int i, aLength = theFiles.length();
- if(aLength == 0)
- return (new SALOMEDS::TMPFile);
-
- //Get a temporary directory for saved a file
- string aTmpDir = theFromDirectory;
-
- long aBufferSize = 0;
- long aCurrentPos;
-
- int aNbFiles = 0;
- int* aFileNameSize= new int[aLength];
- long* aFileSize= new long[aLength];
-
- //Determine the required size of the buffer
-
- for(i=0; i<aLength; i++) {
-
- //Check if the file exists
-
- if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero
- string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
- if(!Exists(aFullPath)) continue;
-#ifdef WIN32
- ifstream aFile(aFullPath.c_str(), ios::binary);
-#else
- ifstream aFile(aFullPath.c_str());
-#endif
- aFile.seekg(0, ios::end);
- aFileSize[i] = aFile.tellg();
- aBufferSize += aFileSize[i]; //Add a space to store the file
- }
- aFileNameSize[i] = strlen(theFileNames[i])+1;
- aBufferSize += aFileNameSize[i]; //Add a space to store the file name
- aBufferSize += (theNamesOnly)?4:12; //Add 4 bytes: a length of the file name,
- // 8 bytes: length of the file itself
- aNbFiles++;
- }
-
- aBufferSize += 4; //4 bytes for a number of the files that will be written to the stream;
- unsigned char* aBuffer = new unsigned char[aBufferSize];
- if(aBuffer == NULL)
- return (new SALOMEDS::TMPFile);
-
- //Initialize 4 bytes of the buffer by 0
- memset(aBuffer, 0, 4);
- //Copy the number of files that will be written to the stream
- memcpy(aBuffer, &aNbFiles, ((sizeof(int) > 4) ? 4 : sizeof(int)));
-
-
- aCurrentPos = 4;
-
- for(i=0; i<aLength; i++) {
- ifstream *aFile;
- if (!theNamesOnly) { // mpv 15.01.2003: we don't open any file if theNamesOnly = true
- string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
- if(!Exists(aFullPath)) continue;
-#ifdef WIN32
- aFile = new ifstream(aFullPath.c_str(), ios::binary);
-#else
- aFile = new ifstream(aFullPath.c_str());
-#endif
- }
- //Initialize 4 bytes of the buffer by 0
- memset((aBuffer + aCurrentPos), 0, 4);
- //Copy the length of the file name to the buffer
- memcpy((aBuffer + aCurrentPos), (aFileNameSize + i), ((sizeof(int) > 4) ? 4 : sizeof(int)));
- aCurrentPos += 4;
-
- //Copy the file name to the buffer
- memcpy((aBuffer + aCurrentPos), theFileNames[i], aFileNameSize[i]);
- aCurrentPos += aFileNameSize[i];
-
- if (!theNamesOnly) { // mpv 15.01.2003: we don't copy file content to the buffer if !theNamesOnly
- //Initialize 8 bytes of the buffer by 0
- memset((aBuffer + aCurrentPos), 0, 8);
- //Copy the length of the file to the buffer
- memcpy((aBuffer + aCurrentPos), (aFileSize + i), ((sizeof(long) > 8) ? 8 : sizeof(long)));
- aCurrentPos += 8;
-
- aFile->seekg(0, ios::beg);
- aFile->read((char *)(aBuffer + aCurrentPos), aFileSize[i]);
- aFile->close();
- delete(aFile);
- aCurrentPos += aFileSize[i];
- }
- }
-
- delete[] aFileNameSize;
- delete[] aFileSize;
-
-
- CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer;
-
- return (new SALOMEDS::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1));
- }
-
-}
-
-
-SALOMEDS::TMPFile*
-SALOMEDS_Tool::PutFilesToStream(const std::string& theFromDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
- const int theNamesOnly)
-{
- SALOMEDS::ListOfFileNames aFileNames(theFiles);
- return ::PutFilesToStream(theFromDirectory,theFiles,aFileNames,theNamesOnly);
-}
-
-
-SALOMEDS::TMPFile*
-SALOMEDS_Tool::PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
- const SALOMEDS::ListOfFileNames& theFileNames)
-{
- return ::PutFilesToStream("",theFiles,theFileNames,0);
-}
-
-//============================================================================
-// function : PutStreamToFile
-// purpose : converts the stream "theStream" to the files
-//============================================================================
-SALOMEDS::ListOfFileNames_var
-SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
- const std::string& theToDirectory,
- const int theNamesOnly)
-{
- SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames;
-
- if(theStream.length() == 0)
- return aFiles;
-
- //Get a temporary directory for saving a file
- string aTmpDir = theToDirectory;
-
- unsigned char *aBuffer = (unsigned char*)theStream.NP_data();
-
- if(aBuffer == NULL)
- return aFiles;
-
- long aFileSize, aCurrentPos = 4;
- int i, aFileNameSize, aNbFiles = 0;
-
- //Copy the number of files in the stream
- memcpy(&aNbFiles, aBuffer, sizeof(int));
-
- aFiles->length(aNbFiles);
-
- for(i=0; i<aNbFiles; i++) {
-
- //Put a length of the file name to aFileNameSize
- memcpy(&aFileNameSize, (aBuffer + aCurrentPos), ((sizeof(int) > 4) ? 4 : sizeof(int)));
- aCurrentPos += 4;
-
- char *aFileName = new char[aFileNameSize];
- //Put a file name to aFileName
- memcpy(aFileName, (aBuffer + aCurrentPos), aFileNameSize);
- aCurrentPos += aFileNameSize;
-
- //Put a length of the file to aFileSize
- if (!theNamesOnly) {
- memcpy(&aFileSize, (aBuffer + aCurrentPos), ((sizeof(long) > 8) ? 8 : sizeof(long)));
- aCurrentPos += 8;
-
- string aFullPath = aTmpDir + aFileName;
-#ifdef WIN32
- ofstream aFile(aFullPath.c_str(), ios::binary);
-#else
- ofstream aFile(aFullPath.c_str());
-#endif
- aFile.write((char *)(aBuffer+aCurrentPos), aFileSize);
- aFile.close();
- aCurrentPos += aFileSize;
- }
- aFiles[i] = CORBA::string_dup(aFileName);
- delete[] aFileName;
- }
-
- return aFiles;
-}
-
-//============================================================================
-// function : GetNameFromPath
-// purpose : Returns the name by the path
-//============================================================================
-std::string SALOMEDS_Tool::GetNameFromPath(const std::string& thePath) {
- if (thePath.empty()) return "";
- string aPath = thePath;
- bool isFound = false;
- int pos = aPath.rfind('/');
- if(pos > 0) {
- aPath = aPath.substr(pos+1, aPath.size());
- isFound = true;
- }
- if(!isFound) {
- pos = aPath.rfind('\\');
- if(pos > 0) {
- aPath = aPath.substr(pos+1, aPath.size());
- isFound = true;
- }
- }
- if(!isFound) {
- pos = aPath.rfind('|');
- if(pos > 0) aPath = aPath.substr(pos+1, aPath.size());
- }
-
- pos = aPath.rfind('.');
- if(pos > 0) aPath = aPath.substr(0, pos); //Remove extension
-
- return aPath;
-}
-
-//============================================================================
-// function : GetDirFromPath
-// purpose : Returns the dir by the path
-//============================================================================
-std::string SALOMEDS_Tool::GetDirFromPath(const std::string& thePath) {
- if (thePath.empty()) return "";
-
- int pos = thePath.rfind('/');
- string path;
- if(pos > 0) {
- path = thePath.substr(0, pos+1);
- }
- if(path.empty()) {
- pos = thePath.rfind('\\');
- if(pos > 0) path = thePath.substr(0, pos+1);
- }
- if(path.empty()) {
- pos = thePath.rfind('|');
- if(pos > 0) path = thePath.substr(0, pos+1);
- }
- if(path.empty()) {
- path = thePath+"/";
- }
-
-#ifdef WIN32 //Check if the only disk letter is given as path
- if(path.size() == 2 && path[1] == ':') path +='\\';
-#endif
-
- for(int i = 0, len = path.size(); i<len; i++)
- if(path[i] == '|') path[i] = '/';
- return path;
-}
-
-//=======================================================================
-// name : GetFlag
-// Purpose : Retrieve specified flaf from "AttributeFlags" attribute
-//=======================================================================
-bool SALOMEDS_Tool::GetFlag( const int theFlag,
- SALOMEDS::Study_var theStudy,
- SALOMEDS::SObject_var theObj )
-{
- SALOMEDS::GenericAttribute_var anAttr;
- if ( !theObj->_is_nil() && theObj->FindAttribute( anAttr, "AttributeFlags" ) )
- {
- SALOMEDS::AttributeFlags_var aFlags = SALOMEDS::AttributeFlags::_narrow( anAttr );
- return aFlags->Get( theFlag );
- }
-
- return false;
-}
-
-//=======================================================================
-// name : SetFlag
-// Purpose : Set/Unset specified flaf from "AttributeFlags" attribute
-//=======================================================================
-bool SALOMEDS_Tool::SetFlag( const int theFlag,
- SALOMEDS::Study_var theStudy,
- const std::string& theEntry,
- const bool theValue )
-{
- SALOMEDS::SObject_var anObj = theStudy->FindObjectID(theEntry.c_str());
-
- if ( !anObj->_is_nil() )
- {
- SALOMEDS::GenericAttribute_var aGAttr;
- if ( anObj->FindAttribute( aGAttr, "AttributeFlags" ) )
- {
- SALOMEDS::AttributeFlags_var anAttr = SALOMEDS::AttributeFlags::_narrow( aGAttr );
- anAttr->Set( theFlag, theValue );
- }
- else if ( theValue )
- {
- SALOMEDS::StudyBuilder_var aBuilder = theStudy->NewBuilder();
- SALOMEDS::AttributeFlags_var anAttr = SALOMEDS::AttributeFlags::_narrow(
- aBuilder->FindOrCreateAttribute( anObj, "AttributeFlags" ) );
- anAttr->Set( theFlag, theValue );
- }
- return true;
- }
-
- return false;
-}
-
-//=======================================================================
-// name : getAllChildren
-// Purpose : Get all children of object.
-// If theObj is null all objects of study are returned
-//=======================================================================
-void SALOMEDS_Tool::GetAllChildren( SALOMEDS::Study_var theStudy,
- SALOMEDS::SObject_var theObj,
- std::list<SALOMEDS::SObject_var>& theList )
-{
- if ( theObj->_is_nil() )
- {
- SALOMEDS::SComponentIterator_var anIter = theStudy->NewComponentIterator();
- for ( ; anIter->More(); anIter->Next() )
- {
- SALOMEDS::SObject_var anObj = SALOMEDS::SObject::_narrow( anIter->Value() );
- if ( !anObj->_is_nil() )
- {
- theList.push_back( anObj );
- GetAllChildren( theStudy, anObj, theList );
- }
- }
- }
- else
- {
- SALOMEDS::ChildIterator_var anIter = theStudy->NewChildIterator( theObj );
- for ( ; anIter->More(); anIter->Next() )
- {
- SALOMEDS::SObject_var anObj = anIter->Value();
- SALOMEDS::SObject_var aRef;
- if ( !anObj->ReferencedObject( aRef ) )
- {
- theList.push_back( anObj );
- GetAllChildren( theStudy, anObj, theList );
- }
- }
- }
-}
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOMEDS_Tool.hxx
-// Created : Mon Oct 21 16:24:50 2002
-// Author : Sergey RUIN
-// Project : SALOME
-// Module : SALOMEDS
-//
-#ifndef __SALOMEDS_Tool_H__
-#define __SALOMEDS_Tool_H__
-
-#include <string>
-#include <list>
-
-
-// IDL headers
-#include "SALOMEconfig.h"
-#include CORBA_SERVER_HEADER(SALOMEDS)
-
-#ifdef WIN32
-# if defined TOOLSDS_EXPORTS
-# define TOOLSDS_EXPORT __declspec( dllexport )
-# else
-# define TOOLSDS_EXPORT __declspec( dllimport )
-# endif
-#else
-# define TOOLSDS_EXPORT
-#endif
-
-class TOOLSDS_EXPORT SALOMEDS_Tool
-{
-public:
-
- // Returns the unique temporary directory, that is defined in SALOME_TMP_DIR if this variable is set
- // otherwise return /tmp/something/ for Unix or c:\something\ for WIN32
- static std::string GetTmpDir();
-
-
- // Removes files which are in <theDirectory>, the files for deletion are listed in <theFiles>
- // if <IsDirDeleted> is true <theDirectory> is also deleted if it is empty
- static void RemoveTemporaryFiles(const std::string& theDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
- const bool IsDirDeleted);
-
- // Converts files listed in <theFiles> which are in <theFromDirectory> into a byte sequence TMPFile
- static SALOMEDS::TMPFile* PutFilesToStream(const std::string& theFromDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
- const int theNamesOnly = 0);
-
- // Converts files listed in <theFiles> which will be named as pointed in the <theFileNames> into a byte sequence TMPFile
- static SALOMEDS::TMPFile* PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
- const SALOMEDS::ListOfFileNames& theFileNames);
-
- // Converts a byte sequence <theStream> to files and places them in <theToDirectory>
- static SALOMEDS::ListOfFileNames_var PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
- const std::string& theToDirectory,
- const int theNamesOnly = 0);
-
- // Returns the name by the path
- // for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "doc1"
- static std::string GetNameFromPath(const std::string& thePath);
-
- // Returns the directory by the path
- // for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "/tmp/aaa"
- static std::string GetDirFromPath(const std::string& thePath);
-
- // Retrieves specified flaf from "AttributeFlags" attribute
- static bool GetFlag( const int theFlag,
- SALOMEDS::Study_var theStudy,
- SALOMEDS::SObject_var theObj );
-
- // Sets/Unsets specified flaf from "AttributeFlags" attribute
- static bool SetFlag( const int theFlag,
- SALOMEDS::Study_var theStudy,
- const std::string& theEntry,
- const bool theValue );
-
- // Get all children of object. If theObj is null all objects of study are returned
- static void GetAllChildren( SALOMEDS::Study_var theStudy,
- SALOMEDS::SObject_var theObj,
- std::list<SALOMEDS::SObject_var>& theList );
-
-};
-#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# SALOME TestContainer : test of container creation and its life cycle
-# File : Makefile.in
-# Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
-# Module : SALOME
-# $Header$
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-#
-# ===============================================================
-# Files to be installed
-# ===============================================================
-#
-# header files
-# Scripts to be installed
-dist_salomescript_PYTHON = \
- SALOME_TestComponentPy.py \
- TestComponentPy.py \
- TestLogger.py
-
-#
-# ===============================================================
-# Local definitions
-# ===============================================================
-#
-
-# This local variable defines the list of CPPFLAGS common to all target in this package.
-COMMON_CPPFLAGS=\
- -I$(srcdir)/../Basics \
- -I$(srcdir)/../SALOMELocalTrace \
- -I$(srcdir)/../NamingService \
- -I$(srcdir)/../Utils \
- -I$(srcdir)/../Registry \
- -I$(srcdir)/../Notification \
- -I$(srcdir)/../ResourcesManager \
- -I$(srcdir)/../Container \
- -I$(top_builddir)/salome_adm/unix \
- -I$(top_builddir)/idl \
- @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
-
-
-# This local variable defines the list of dependant libraries common to all target in this package.
-COMMON_LIBS =\
- ../Container/libSalomeContainer.la \
- ../Registry/libRegistry.la \
- ../Notification/libSalomeNotification.la \
- ../ResourcesManager/libSalomeResourcesManager.la \
- ../NamingService/libSalomeNS.la \
- ../Utils/libOpUtil.la \
- ../SALOMELocalTrace/libSALOMELocalTrace.la \
- ../Basics/libSALOMEBasics.la \
- $(top_builddir)/idl/libSalomeIDLKernel.la
-
-#
-# ===============================================================
-# Libraries targets
-# ===============================================================
-#
-lib_LTLIBRARIES = libSalomeTestComponentEngine.la
-libSalomeTestComponentEngine_la_SOURCES = \
- SALOME_TestComponent.hxx \
- SALOME_TestComponent_i.cxx \
- SALOME_TestComponent_i.hxx
-
-libSalomeTestComponentEngine_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSalomeTestComponentEngine_la_LIBADD = $(COMMON_LIBS)
-
-#LIB_CLIENT_IDL = SALOME_Component.idl SALOME_TestComponent.idl SALOME_Exception.idl
-
-#
-# ===============================================================
-# Executables targets
-# ===============================================================
-#
-bin_PROGRAMS = TestContainer TestLogger
-TestContainer_SOURCES = TestContainer.cxx
-TestContainer_CPPFLAGS = $(COMMON_CPPFLAGS)
-TestContainer_LDADD = libSalomeTestComponentEngine.la \
- ../Basics/libSALOMEBasics.la \
- $(CORBA_LIBS)
-
-TestLogger_SOURCES = TestLogger.cxx
-TestLogger_CPPFLAGS = $(COMMON_CPPFLAGS)
-TestLogger_LDADD = libSalomeTestComponentEngine.la \
- ../Basics/libSALOMEBasics.la \
- $(CORBA_LIBS)
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME TestContainer : test of container creation and its life cycle
-// File : SALOME_TestComponent.hxx
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-#ifndef SALOME_TESTCOMPONENT_HXX
-#define SALOME_TESTCOMPONENT_HXX
-
-#ifdef WIN32
-# if defined TESTCONTAINER_EXPORTS || defined SalomeTestComponentEngine_EXPORTS
-# define TESTCONTAINER_EXPORT __declspec( dllexport )
-# else
-# define TESTCONTAINER_EXPORT __declspec( dllimport )
-# endif
-#else
-# define TESTCONTAINER_EXPORT
-#endif
-
-#endif // SALOME_TESTCOMPONENT_HXX
+++ /dev/null
-#! /usr/bin/env python
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# SALOME TestContainer : test of container creation and its life cycle
-# File : SALOME_TestComponentPy.py
-# Author : Paul RASCLE, EDF
-# Module : SALOME
-# $Header$
-#
-import sys
-from omniORB import CORBA, PortableServer
-import CosNaming
-import Engines, Engines__POA
-from SALOME_ComponentPy import *
-
-class SALOME_TestComponentPy( Engines__POA.TestComponent, SALOME_ComponentPy_i):
-
- def Coucou(self, val):
- print "SALOME_TestComponentPy Coucou ", val
- result = "result from SALOME_TestComponentPy Coucou " + `val`
- return result
-
- def __init__(self, orb, poa, contID, containerName, instanceName, interfaceName):
- notif = 0
- SALOME_ComponentPy_i.__init__(self, orb, poa, contID, containerName,
- instanceName, interfaceName, notif)
- print "SALOME_TestComponentPy::__init__"
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME TestContainer : test of container creation and its life cycle
-// File : SALOME_TestComponent_i.cxx
-// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
-// Module : SALOME
-// $Header$
-//
-#ifndef WIN32
-# define private protected
-#endif
-#include "utilities.h"
-#include "SALOME_TestComponent_i.hxx"
-#include <stdio.h>
-#include <cstdlib>
-#include <map>
-using namespace std;
-
-Engines_TestComponent_i::Engines_TestComponent_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName) :
- Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
-{
- MESSAGE("activate object");
- _thisObj = this ;
- _id = _poa->activate_object(_thisObj);
- //does not work with 4.0.6 (too bad)
- //SCRUTE(_pd_refCount);
- //SCRUTE(_refcount_value());
-}
-
-Engines_TestComponent_i::Engines_TestComponent_i()
-{
-}
-
-Engines_TestComponent_i::~Engines_TestComponent_i()
-{
- MESSAGE("~Engines_TestComponent_i()");
-}
-
-char* Engines_TestComponent_i::Coucou(CORBA::Long L)
-{
- char s[100];
- sprintf(s, "TestComponent_i : L = %ld", (long) L);
- //does not work with 4.0.6 (too bad)
- //SCRUTE(_pd_refCount);
- //SCRUTE(_refcount_value());
-
- return CORBA::string_dup(s);
-}
-
-void Engines_TestComponent_i::Setenv()
-{
- // bool overwrite = true;
- map<std::string,CORBA::Any>::iterator it;
- MESSAGE("set environment associated with keys in map _fieldsDict");
- for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++)
- {
- std::string cle((*it).first);
- if ((*it).second.type()->kind() == CORBA::tk_string)
- {
- const char* value;
- (*it).second >>= value;
- //CCRT porting : setenv not defined in stdlib.h
- std::string s(cle);
- s+='=';
- s+=value;
- //char* cast because 1st arg of linux putenv function is not a const char* !!!
- putenv((char *)s.c_str());
- //End of CCRT porting
- //int ret = setenv(cle.c_str(), value, overwrite);
- MESSAGE("--- setenv: "<<cle<<" = "<< value);
- }
- }
- MESSAGE("read environment associated with keys in map _fieldsDict");
- for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++)
- {
- std::string cle((*it).first);
- char* valenv= getenv(cle.c_str());
- if (valenv)
- MESSAGE("--- getenv: "<<cle<<" = "<< valenv);
- }
-}
-
-extern "C"
-{
- PortableServer::ObjectId * SalomeTestComponentEngine_factory(
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName)
- {
- MESSAGE("PortableServer::ObjectId * TestComponent_factory()");
- SCRUTE(interfaceName);
- Engines_TestComponent_i * myTestComponent
- = new Engines_TestComponent_i(orb, poa, contId, instanceName, interfaceName);
- return myTestComponent->getId() ;
- }
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME TestContainer : test of container creation and its life cycle
-// File : SALOME_TestComponent_i.hxx
-// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
-// Module : SALOME
-// $Header$
-//
-#ifndef _SALOME_TESTCOMPONENT_I_HXX_
-#define _SALOME_TESTCOMPONENT_I_HXX_
-
-#include "SALOME_TestComponent.hxx"
-
-#include <iostream>
-
-#include "SALOME_Component_i.hxx"
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOME_TestComponent)
-
-class TESTCONTAINER_EXPORT Engines_TestComponent_i:
- public POA_Engines::TestComponent,
- public Engines_Component_i
-{
-public:
- Engines_TestComponent_i();
- Engines_TestComponent_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName);
-
- virtual ~Engines_TestComponent_i();
-
- char* Coucou(CORBA::Long L);
- void Setenv();
-
-private:
-
-};
-
-#endif
+++ /dev/null
-#! /usr/bin/env python
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# SALOME TestContainer : test of container creation and its life cycle
-# File : TestComponentPy.py
-# Author : Paul RASCLE, EDF
-# Module : SALOME
-# $Header$
-#
-import os
-import sys
-import string
-from omniORB import CORBA
-import CosNaming
-import Engines
-from Utils_Identity import getShortHostName
-
-
-#initialise the ORB
-orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
-
-#obtain a reference to the root naming context
-obj = orb.resolve_initial_references("NameService")
-rootContext = obj._narrow(CosNaming.NamingContext)
-
-if rootContext is None:
- print "Name Service Reference is invalid"
- sys.exit(1)
-
-#resolve the name /Containers.dir/FactoryServerPy.object
-machineName=getShortHostName()
-containerName = "FactoryServerPy"
-name = [CosNaming.NameComponent("Containers","dir"),
- CosNaming.NameComponent(machineName,"dir"),
- CosNaming.NameComponent(containerName,"object")]
-
-try:
- obj = rootContext.resolve(name)
-except CosNaming.NamingContext.NotFound, ex:
- print containerName , " not found in Naming Service"
- sys.exit(1)
-
-container = obj._narrow(Engines.Container)
-print container.getHostName()
-comp = container.load_impl("SALOME_TestComponentPy","SALOME_TestComponentPy")
-print comp._get_instanceName()
-comp.ping()
-comptest = comp._narrow(Engines.TestComponent)
-if comptest is None:
- print "probleme cast"
-print comptest.Coucou(1)
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME TestContainer : test of container creation and its life cycle
-// File : TestContainer.cxx
-// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
-// Module : SALOME
-// $Header$
-//
-#include "utilities.h"
-#include <iostream>
-#ifndef WIN32
-#include <unistd.h>
-#endif
-#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(SALOME_Component)
-#include CORBA_CLIENT_HEADER(SALOME_TestComponent)
-
-#include "SALOME_NamingService.hxx"
-#include "NamingService_WaitForServerReadiness.hxx"
-#include "Basics_Utils.hxx"
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
-#include "Utils_SALOME_Exception.hxx"
-#include "Utils_CommException.hxx"
-
-static std::ostream& operator<<(std::ostream& os, const CORBA::Exception& e)
-{
- CORBA::Any tmp;
- tmp<<= e;
- CORBA::TypeCode_var tc = tmp.type();
- const char *p = tc->name();
- os<<"Test blocking exception was catch of the kind : ";
- if ( *p != '\0' ) {
- os<<p;
- }
- else {
- os << tc->id();
- }
-
- return os;
-}
-
-Engines::TestComponent_ptr create_instance(Engines::Container_ptr iGenFact,
- std::string componenttName)
-{
-#if defined(_DEBUG_) || defined(_DEBUG)
- bool isLib =
- iGenFact->load_component_Library(componenttName.c_str());
- // iGenFact->load_component_Library("SalomeTestComponent");
- ASSERT(isLib);
-#else
- iGenFact->load_component_Library(componenttName.c_str());
-#endif
- CORBA::Object_var obj =
- // iGenFact->create_component_instance("SalomeTestComponent",
- iGenFact->create_component_instance(componenttName.c_str(),
- 0);
- Engines::TestComponent_var anInstance = Engines::TestComponent::_narrow(obj);
- MESSAGE("create anInstance");
- SCRUTE(anInstance->instanceName());
- return anInstance._retn();
-}
-
-int main (int argc, char * argv[])
-{
- // Initializing omniORB
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- CORBA::ORB_ptr orb = init( argc , argv ) ;
- // LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
-
- try
- {
- SALOME_NamingService _NS(orb) ;
- std::string containerName = "/Containers/" ;
- std::string hostName = Kernel_Utils::GetHostname();
- containerName += hostName + "/FactoryServer";
- NamingService_WaitForServerReadiness(&_NS,containerName);
-
- CORBA::Object_var obj = _NS.Resolve(containerName.c_str()) ;
- Engines::Container_var iGenFact = Engines::Container::_narrow(obj);
- iGenFact->ping() ;
-
- int nbInstances = 5;
-
- std::vector<Engines::TestComponent_var> instances(nbInstances);
-
- MESSAGE("------------------------------- create instances ");
- for (int iter = 0; iter < nbInstances ; iter++)
- {
- instances[iter] = create_instance(iGenFact,"SalomeTestComponent");
- }
-
- MESSAGE("------------------------------ set env instances ");
- for (int iter = 0; iter < nbInstances ; iter++)
- {
- Engines::TestComponent_var anInstance = instances[iter];
- SCRUTE(anInstance->instanceName());
- Engines::FieldsDict_var dico = new Engines::FieldsDict;
- dico->length(3);
- dico[0].key=CORBA::string_dup("key_0");
- dico[0].value <<="value_0";
- dico[1].key=CORBA::string_dup("key_1");
- dico[1].value <<=(CORBA::UShort)72;
- dico[2].key=CORBA::string_dup("key_2");
- dico[2].value <<=(CORBA::ULong)iter;
- anInstance->setProperties(dico);
- MESSAGE("Coucou " << anInstance->Coucou(iter));
- anInstance->Setenv();
- }
-
- MESSAGE("---------------------------------- get instances ");
- for (int iter = 0; iter < nbInstances ; iter++)
- {
- Engines::TestComponent_var anInstance = instances[iter];
- SCRUTE(anInstance->instanceName());
- Engines::FieldsDict_var dico2 = anInstance->getProperties();
- for (CORBA::ULong i=0; i<dico2->length(); i++)
- {
- MESSAGE("dico2["<<i<<"].key="<<dico2[i].key);
- MESSAGE("dico2["<<i<<"].value type ="<<dico2[i].value.type()->kind());
- if (dico2[i].value.type()->kind() == CORBA::tk_string)
- {
- const char* value;
- dico2[i].value >>= value;
- MESSAGE("dico2["<<i<<"].value="<<value);
- }
- }
- }
-
- MESSAGE("------------------------------- remove instances ");
- for (int iter = 0; iter < nbInstances ; iter++)
- {
- Engines::TestComponent_var anInstance = instances[iter];
- SCRUTE(anInstance->instanceName());
- iGenFact->remove_impl(anInstance) ;
- //iGenFact->finalize_removal() ; // unpredictable results ...
- }
- MESSAGE("------------------------------- PYTHON ");
- {
-// bool isLib =
-// iGenFact->load_component_Library("SALOME_TestComponentPy");
-// ASSERT(isLib);
-// CORBA::Object_var obj =
-// iGenFact->create_component_instance("SALOME_TestComponentPy",
-// 0);
-// Engines::TestComponent_var anInstance =
-// Engines::TestComponent::_narrow(obj);
-// MESSAGE("create anInstance");
-// SCRUTE(anInstance->instanceName());
- MESSAGE("------------------------------- create instances ");
- for (int iter = 0; iter < nbInstances ; iter++)
- {
- instances[iter] = create_instance(iGenFact,"SALOME_TestComponentPy");
- }
-
- MESSAGE("---------------------------------- get instances ");
- for (int iter = 0; iter < nbInstances ; iter++)
- {
- Engines::TestComponent_var anInstance = instances[iter];
- SCRUTE(anInstance->instanceName());
- MESSAGE("Coucou " << anInstance->Coucou(iter));
- }
- }
-
- // Clean-up.
- iGenFact->finalize_removal() ;
- orb->shutdown(0);
- }
- catch(CORBA::COMM_FAILURE& ex) {
- INFOS("Caught system exception COMM_FAILURE -- unable to contact the object.")
- }
- catch(CORBA::SystemException& e) {
- INFOS("Caught a CORBA::SystemException."<<e)
- }
- catch(CORBA::Exception& e) {
- INFOS("Caught CORBA::Exception."<<e)
- }
- catch(ServiceUnreachable& e) {
- INFOS("Caught Exception. "<<e)
- }
- catch(...) {
- INFOS("Caught unknown exception.")
- }
-
- // delete myThreadTrace;
- return 0;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME TestContainer : test of container creation and its life cycle
-// File : TestContainer.cxx
-// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
-// Module : SALOME
-// $Header$
-//
-#include "utilities.h"
-#include <iostream>
-#ifndef WIN32
-#include <unistd.h>
-#endif
-#include <SALOMEconfig.h>
-#include "SALOME_NamingService.hxx"
-#include "OpUtil.hxx"
-
-int main (int argc, char * argv[])
-{
- MESSAGE("It's OK");
- return 0;
-}
-
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-from SALOME_utilities import *
-
-MESSAGE("TestLogger.py : It's OK")
-
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# SALOME MPIContainer : implemenation of container based on MPI libraries
-# File : Makefile.am
-# Author : Guillaume Boulant (CSSI)
-# Module : SALOME
-# $Header$
-# ===============================================================
-# _CS_gbo Caution !! This package may not work. I didn't test it
-# because no mpi soft is installed on my computer. To be checked.
-# ===============================================================
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-#
-# ===============================================================
-# Header to be installed
-# ===============================================================
-#
-# header files
-salomeinclude_HEADERS = TestMPIComponentEngine.hxx
-
-#
-# ===============================================================
-# Local definitions
-# ===============================================================
-#
-
-# This local variable defines the list of CPPFLAGS common to all target in this package.
-# _CS_gbo See wether it can be shared by all packages in a common include!!
-COMMON_CPPFLAGS=\
- @MPI_INCLUDES@ \
- -I$(srcdir)/../Basics \
- -I$(srcdir)/../SALOMELocalTrace \
- -I$(srcdir)/../NamingService \
- -I$(srcdir)/../Utils \
- -I$(srcdir)/../Registry \
- -I$(srcdir)/../Notification \
- -I$(srcdir)/../ResourcesManager \
- -I$(srcdir)/../Container \
- -I$(srcdir)/../MPIContainer \
- -I$(top_builddir)/salome_adm/unix \
- -I$(top_builddir)/idl \
- @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
-
-# This local variable defines the list of dependant libraries common to all target in this package.
-COMMON_LIBS =\
- ../Registry/libRegistry.la \
- ../Notification/libSalomeNotification.la \
- ../ResourcesManager/libSalomeResourcesManager.la \
- ../NamingService/libSalomeNS.la \
- ../Utils/libOpUtil.la \
- ../SALOMELocalTrace/libSALOMELocalTrace.la \
- ../Basics/libSALOMEBasics.la \
- ../Container/libSalomeContainer.la \
- ../MPIContainer/libSalomeMPIContainer.la \
- $(top_builddir)/idl/libSalomeIDLKernel.la\
- @CORBA_LIBS@
-
-#
-# ===============================================================
-# Libraries targets
-# ===============================================================
-#
-lib_LTLIBRARIES = libSalomeTestMPIComponentEngine.la
-libSalomeTestMPIComponentEngine_la_SOURCES = TestMPIComponentEngine.cxx
-libSalomeTestMPIComponentEngine_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSalomeTestMPIComponentEngine_la_LDFLAGS = -no-undefined -version-info=0:0:0
-libSalomeTestMPIComponentEngine_la_LIBADD = $(COMMON_LIBS)
-
-
-
-#
-# ===============================================================
-# Executables targets
-# ===============================================================
-#
-bin_PROGRAMS = TestMPIContainer
-TestMPIContainer_SOURCES = TestMPIContainer.cxx
-TestMPIContainer_LDADD = libSalomeTestMPIComponentEngine.la $(COMMON_LIBS) @MPI_LIBS@
-TestMPIContainer_CPPFLAGS = $(COMMON_CPPFLAGS)
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//=============================================================================
-// File : TestMPIComponentEngine.cxx
-// Created : mer jui 4 12:28:26 CEST 2003
-// Author : Bernard SECHER, 2003
-// Project : SALOME
-// $Header$
-//=============================================================================
-//
-#include <mpi.h>
-#include "utilities.h"
-#include "TestMPIComponentEngine.hxx"
-using namespace std;
-
-TestMPIComponentEngine::TestMPIComponentEngine(int nbproc, int numproc,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName,
- bool regist) :
- Engines_Component_i(orb, poa, contId, instanceName, interfaceName,true,regist), MPIObject_i(nbproc,numproc)
-{
- MESSAGE("activate object")
- _thisObj = this ;
- _id = _poa->reference_to_id(_thisObj->_this());
-}
-
-TestMPIComponentEngine::TestMPIComponentEngine(): Engines_Component_i(), MPIObject_i()
-{
-}
-
-TestMPIComponentEngine::~TestMPIComponentEngine()
-{
-}
-
-void TestMPIComponentEngine::Coucou(CORBA::Long L)
-{
- if(_numproc==0)
- for(int ip=1;ip<_nbproc;ip++)
- Engines::TestMPIComponent::_narrow((*_tior)[ip])->SPCoucou(L);
- SPCoucou(L);
-}
-
-void TestMPIComponentEngine::SPCoucou(CORBA::Long L)
-{
- BEGIN_OF("[" << _numproc << "] TestMPIComponentEngine::Coucou()");
- MESSAGE("[" << _numproc << "] TestMPIComponentEngine : L = " << L);
- END_OF("[" << _numproc << "] TestMPIComponentEngine::Coucou()");
- MPI_Barrier(MPI_COMM_WORLD);
-}
-
-extern "C"
-{
- PortableServer::ObjectId * TestMPIComponentEngine_factory(
- int nbproc, int numproc,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName)
- {
- bool regist;
- TestMPIComponentEngine * myTestMPIComponent;
- MESSAGE("[" << numproc << "] PortableServer::ObjectId * TestMPIComponentEngine_factory()");
- SCRUTE(interfaceName);
- if(numproc==0)
- regist = true;
- else
- regist = false;
-
- myTestMPIComponent
- = new TestMPIComponentEngine(nbproc,numproc,orb, poa, contId, instanceName, interfaceName,regist);
- return myTestMPIComponent->getId() ;
- }
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//=============================================================================
-// File : TestMPIComponentEngine.hxx
-// Created : mer jui 4 12:28:30 CEST 2003
-// Author : Bernard SECHER, CEA
-// Project : SALOME
-// $Header$
-//=============================================================================
-//
-#ifndef _SALOME_TESTCOMPONENT_I_HXX_
-#define _SALOME_TESTCOMPONENT_I_HXX_
-
-#include <iostream>
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOME_TestMPIComponent)
-#include "SALOME_Component_i.hxx"
-#include "MPIObject_i.hxx"
-
-class TestMPIComponentEngine:
- public POA_Engines::TestMPIComponent,
- public Engines_Component_i, public MPIObject_i
-{
-public:
- TestMPIComponentEngine();
- TestMPIComponentEngine(int nbproc, int numproc,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName,
- bool regist);
-
- virtual ~TestMPIComponentEngine();
-
- void Coucou(CORBA::Long L);
- void SPCoucou(CORBA::Long L);
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// using namespace std;
-//=============================================================================
-// File : TestMPIContainer.cxx
-// Created : mer jui 4 13:11:27 CEST 2003
-// Author : Bernard SECHER, 2003
-// Project : SALOME
-// $Header$
-//=============================================================================
-//
-#include "utilities.h"
-#include <iostream>
-#include <unistd.h>
-#include <string>
-#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(SALOME_MPIContainer)
-#include CORBA_CLIENT_HEADER(SALOME_TestMPIComponent)
-
-#include "Basics_Utils.hxx"
-# include "Utils_ORB_INIT.hxx"
-# include "Utils_SINGLETON.hxx"
-#include "SALOME_NamingService.hxx"
-#include "OpUtil.hxx"
-using namespace std;
-
-int main (int argc, char * argv[])
-{
-
- // Initializing omniORB
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- CORBA::ORB_var &orb = init( argc , argv ) ;
- // SALOMETraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
-
- BEGIN_OF(argv[0])
- try{
-
- int status;
-
- if( argc != 3 || strcmp(argv[1],"-np") ){
- cout << "Usage: TestMPIContainer -np nbproc" << endl;
- exit(0);
- }
-
- // Obtain a reference to the root POA
- CORBA::Object_var obj = orb->resolve_initial_references("RootPOA") ;
- PortableServer::POA_var poa = PortableServer::POA::_narrow(obj) ;
-
- // Use Name Service to find container
- SALOME_NamingService NS(orb) ;
- string containerName = "/Containers/" ;
- string hostName = Kernel_Utils::GetHostname();
- containerName += hostName + "/MPIFactoryServer_" + argv[2];
-
- string dirn(getenv("KERNEL_ROOT_DIR"));
- dirn += "/lib/salome/libSalomeTestMPIComponentEngine.so";
-
- // Try to resolve MPI Container
- obj = NS.Resolve(containerName.c_str()) ;
- Engines::MPIContainer_var iGenFact = Engines::MPIContainer::_narrow(obj);
-
- if(CORBA::is_nil(iGenFact)){
-
- // Launch MPI Container
- string cmd("mpirun -np ");
- cmd += argv[2];
- cmd += " ";
- cmd += getenv("KERNEL_ROOT_DIR");
- cmd += "/bin/salome/SALOME_MPIContainer MPIFactoryServer_";
- cmd += argv[2];
- cmd += " &";
- MESSAGE(cmd);
- status = system(cmd.c_str());
- if (status == -1) {
- INFOS("TestMPIContainer launch MPI Container failed (system command status -1)") ;
- }
- else if (status == 217) {
- INFOS("TestMPIContainer launch MPI Container failed (system command status 217)") ;
- }
-
- // Try to resolve MPI Container
- int it = 0;
- do{
- sleep(1);
- obj = NS.Resolve(containerName.c_str()) ;
- iGenFact = Engines::MPIContainer::_narrow(obj);
- MESSAGE("Waiting for MPI Container " << containerName << " : it = " << it );
- }while( CORBA::is_nil(iGenFact) && (it++<15) );
-
- }
-
- if(CORBA::is_nil(iGenFact)){
- MESSAGE("launching container failed");
- exit(1);
- }
-
-
- Engines::TestMPIComponent_var m1;
-
-// for (int iter = 0; iter < 1 ; iter++){
-// MESSAGE("----------------------------------------------------" << iter);
- obj = iGenFact->load_impl("TestMPIComponent",dirn.c_str());
-
- INFOS("Get Handle on MPI Component");
- m1 = Engines::TestMPIComponent::_narrow(obj);
- if(CORBA::is_nil(m1)){
- INFOS("getting handle on MPI component failed");
- }
- else{
- m1->Coucou(1L);
-// // sleep(5);
- INFOS("Unload MPI Component");
- iGenFact->remove_impl(m1) ;
- }
-// }
-// // Clean-up.
-// // iGenFact->finalize_removal() ;
-// // sleep(5);
- iGenFact->Shutdown();
-// INFOS("shut down corba server for Test MPI Container");
-// orb->destroy();
- }
- catch(CORBA::COMM_FAILURE& ex) {
- INFOS("Caught system exception COMM_FAILURE -- unable to contact the object.");
- }
- catch(CORBA::SystemException&) {
- INFOS("Caught a CORBA::SystemException.");
- }
- catch(CORBA::Exception&) {
- INFOS("Caught CORBA::Exception.");
- }
- catch(...) {
- INFOS("Caught unknown exception.");
- }
-
- END_OF(argv[0]);
- // delete myThreadTrace;
- return 0 ;
-}
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# File : Makefile.am
-# Author : Guillaume Boulant (CSSI)
-# Module : KERNEL
-# $Header$
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-#
-# ===============================================================
-# Files to be installed
-# ===============================================================
-#
-
-# Executable scripts to be installed
-dist_salomescript_PYTHON = UnitTests.py
-
-#
-# ===============================================================
-# Executables targets
-# ===============================================================
-#
-
-bin_PROGRAMS = UnitTests
-UnitTests_SOURCES = UnitTests.cxx
-UnitTests_CPPFLAGS =\
- @CPPUNIT_INCLUDES@ \
- -I$(srcdir)/../Basics -I$(srcdir)/../Basics/Test \
- -I$(srcdir)/../SALOMELocalTrace -I$(srcdir)/../SALOMELocalTrace/Test \
- -I$(top_builddir)/salome_adm/unix
-
-if CORBA_GEN
- UnitTests_CPPFLAGS +=\
- -DWITH_CORBA \
- -I$(srcdir)/../SALOMETraceCollector -I$(srcdir)/../SALOMETraceCollector/Test \
- -I$(srcdir)/../NamingService -I$(srcdir)/../NamingService/Test \
- -I$(srcdir)/../Utils -I$(srcdir)/../Utils/Test \
- -I$(srcdir)/../LifeCycleCORBA -I$(srcdir)/../LifeCycleCORBA/Test \
- -I$(srcdir)/../SALOMDESImpl -I$(srcdir)/../SALOMEDSImpl/Test \
- -I$(srcdir)/../SALOMDES -I$(srcdir)/../SALOMEDS/Test \
- -I$(top_builddir)/idl \
- -I$(srcdir)/../Registry \
- -I$(srcdir)/../Notification \
- -I$(srcdir)/../ResourcesManager \
- @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
-endif
-
-UnitTests_LDADD =\
- @CPPUNIT_LIBS@ \
- ../Basics/libSALOMEBasics.la \
- ../SALOMELocalTrace/libSALOMELocalTrace.la ../SALOMELocalTrace/Test/libSALOMELocalTraceTest.la
-
-if CORBA_GEN
- UnitTests_LDADD +=\
- ../Registry/libRegistry.la \
- ../Notification/libSalomeNotification.la \
- ../ResourcesManager/libSalomeResourcesManager.la \
- ../NamingService/libSalomeNS.la ../NamingService/Test/libNamingServiceTest.la \
- ../Container/libSalomeContainer.la \
- ../SALOMETraceCollector/Test/libSALOMETraceCollectorTest.la \
- ../Utils/libOpUtil.la ../Utils/Test/libUtilsTest.la \
- ../LifeCycleCORBA/libSalomeLifeCycleCORBA.la ../LifeCycleCORBA/Test/libLifeCycleCORBATest.la \
- ../SALOMEDSImpl/libSalomeDSImpl.la ../SALOMEDSImpl/Test/libSALOMEDSImplTest.la \
- ../SALOMEDS/libSalomeDS.la ../SALOMEDS/Test/libSALOMEDSTest.la \
- $(top_builddir)/idl/libSalomeIDLKernel.la\
- @CORBA_LIBS@
-endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// --- include all Unit Test from basics until the present directory
-//
-#include "SALOMELocalTraceTest.hxx"
-
-#ifdef WITH_CORBA
-#include "SALOMETraceCollectorTest.hxx"
-#include "UtilsTest.hxx"
-#include "NamingServiceTest.hxx"
-#include "LifeCycleCORBATest.hxx"
-#include "SALOMEDSImplTest.hxx"
-#include "SALOMEDSTest.hxx"
-#endif
-
-// --- Registers the fixture into the 'registry'
-
-CPPUNIT_TEST_SUITE_REGISTRATION( SALOMELocalTraceTest );
-#ifdef WITH_CORBA
-CPPUNIT_TEST_SUITE_REGISTRATION( SALOMETraceCollectorTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( UtilsTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( NamingServiceTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( LifeCycleCORBATest );
-CPPUNIT_TEST_SUITE_REGISTRATION( SALOMEDSImplTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( SALOMEDSTest );
-#endif
-
-// --- generic Main program from Basic/Test
-
-#include "BasicMainTest.hxx"
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-import sys, os,signal,string,commands
-import runSalome
-import setenv
-import orbmodule
-import TestKiller
-
-# get SALOME environment :
-
-args, modules_list, modules_root_dir = setenv.get_config()
-setenv.set_env(args, modules_list, modules_root_dir)
-
-# set environment for trace in logger
-# (with file, servers may be killed before the write to the file...)
-
-#os.environ["SALOME_trace"] = "file:/tmp/traceUnitTest.log"
-#os.environ["SALOME_trace"] = "local"
-os.environ["SALOME_trace"] = "with_logger"
-
-# launch CORBA naming server
-
-clt=orbmodule.client()
-
-# launch CORBA logger server
-
-myServer=runSalome.LoggerServer(args)
-myServer.run()
-clt.waitLogger("Logger")
-
-# launch notify server
-
-myServer=runSalome.NotifyServer(args,modules_root_dir)
-myServer.run()
-
-# launch registry server
-
-myServer=runSalome.RegistryServer(args)
-myServer.run()
-clt.waitNS("/Registry")
-
-# launch module catalog server
-
-cataServer=runSalome.CatalogServer(args)
-cataServer.setpath(modules_list,modules_root_dir)
-cataServer.run()
-clt.waitNS("/Kernel/ModulCatalog")
-
-# launch container manager server
-
-myCmServer = runSalome.LauncherServer(args)
-myCmServer.setpath(modules_list,modules_root_dir)
-myCmServer.run()
-clt.waitNS("/SalomeLauncher")
-
-# execute Unit Test
-
-command = ['UnitTests']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
-
-# kill containers created by the Container Manager
-
-import Engines
-launcher = clt.waitNS("/SalomeLauncher",Engines.SalomeLauncher)
-launcher.Shutdown()
-
-# kill Test process
-
-TestKiller.killProcess(runSalome.process_id)
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# SALOME Utils : general SALOME's definitions and tools
-# File : Makefile.am
-# Author : Guillaume Boulant (CSSI)
-# Module : SALOME
-# $Header$
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-# header files
-salomeinclude_HEADERS =\
- OpUtil.hxx \
- Utils_Timer.hxx \
- Utils_CorbaException.hxx \
- Utils_CommException.hxx \
- Utils_SALOME_Exception.hxx \
- Utils_ORB_INIT.hxx \
- Utils_Identity.hxx \
- Utils_SINGLETON.hxx \
- Utils_DESTRUCTEUR_GENERIQUE.hxx \
- Utils_ExceptHandlers.hxx \
- Utils_Mutex.hxx \
- SALOME_Utils.hxx
-
-# Scripts to be exported
-dist_salomescript_PYTHON =\
- Utils_Identity.py \
- SALOME_utilities.py
-
-# Libraries targets
-lib_LTLIBRARIES = libOpUtil.la
-libOpUtil_la_SOURCES =\
- Utils_Timer.cxx \
- duplicate.cxx \
- Utils_CommException.cxx \
- Utils_SALOME_Exception.cxx \
- Utils_Identity.cxx Utils_ORB_INIT.cxx \
- Utils_DESTRUCTEUR_GENERIQUE.cxx \
- Utils_ExceptHandlers.cxx \
- Utils_Mutex.cxx
-
-libOpUtil_la_LDFLAGS = -no-undefined -version-info=0:0:0
-
-libOpUtil_la_CPPFLAGS = \
- -I$(srcdir)/../Basics \
- -I$(srcdir)/../SALOMELocalTrace \
- -I$(top_builddir)/salome_adm/unix \
- -I$(top_builddir)/idl \
- @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
-
-libOpUtil_la_LIBADD = \
- ../SALOMELocalTrace/libSALOMELocalTrace.la \
- $(top_builddir)/idl/libSalomeIDLKernel.la \
- @CORBA_LIBS@
-
-
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : OpUtil.cxx
-// Module : SALOME
-//
-#include "utilities.h"
-#include "OpUtil.hxx"
-#include <errno.h>
-#include <string.h>
-
-#ifndef WNT
-#include <unistd.h>
-#else
-#include <winsock2.h>
-#endif
-using namespace std;
-//int gethostname(char *name, size_t len);
-
-std::string GetHostname()
-{
- int ls = 100, r = 1;
- char *s;
-
- while (ls < 10000 && r) {
- ls *= 2;
- s = new char[ls];
- r = gethostname(s, ls-1);
- switch (r)
- {
- case 0:
- break;
- default:
-#ifdef EINVAL
- case EINVAL:
-#endif
-#ifdef ENAMETOOLONG
- case ENAMETOOLONG:
-#endif
- delete [] s;
- continue;
- }
- }
-
- if (r != 0) {
- s = new char[50];
- strcpy(s, "localhost");
- }
-
- // remove all after '.'
- char *aDot = (strchr(s,'.'));
- if (aDot) aDot[0] = '\0';
-
- string p = s;
- delete [] s;
- return p;
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : OpUtil.hxx
-// Module : SALOME
-//
-#ifndef _OPUTIL_HXX
-#define _OPUTIL_HXX
-
-#include "SALOME_Utils.hxx"
-
-UTILS_EXPORT const char *duplicate(const char * const);
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : SALOME_Utils.hxx
-// Author : Alexander A. BORODIN
-// Module : SALOME
-//
-#ifndef _SALOME_UTILS_HXX_
-#define _SALOME_UTILS_HXX_
-
-#ifdef WIN32
-# if defined UTILS_EXPORTS || defined OpUtil_EXPORTS
-# define UTILS_EXPORT __declspec( dllexport )
-# else
-# define UTILS_EXPORT __declspec( dllimport )
-# endif
-#else
-# define UTILS_EXPORT
-#endif
-
-#endif
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# SALOME Utils : general SALOME's definitions and tools
-# File : SALOME_utilities.py
-# Module : SALOME
-#
-import SALOME_Trace
-GLogger = SALOME_Trace.SALOME_Trace()
-
-from launchConfigureParser import verbose
-
-def MYTRACE ():
- if verbose():
- str = "- Trace "
- GLogger.putMessage(str + " : ")
-
-
-def REPERE():
- if verbose():
- GLogger.putMessage(" -------------- \n")
-
-
-def BEGIN_OF(msg):
- if verbose():
- REPERE(); MYTRACE();
- GLogger.putMessage("Begin of : "+ str(msg) + "\n")
- REPERE();
-
-
-def END_OF(msg):
- if verbose():
- REPERE(); MYTRACE();
- GLogger.putMessage("Normale end of : "+ str(msg) + "\n")
- REPERE();
-
-def MESSAGE(msg):
- if verbose():
- MYTRACE()
- GLogger.putMessage(str(msg) + "\n")
-
-def SCRUTE(var_name, var_value):
- MYTRACE();
- GLogger.putMessage(var_name + " = " + str(var_value) + "\n")
-
-
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-####################################### library
-# SALOMELocalTrace : log on local machine
-# File : Makefile.am
-# Author : Guillaume Boulant (CSSI)
-# Module : KERNEL
-# $Header$
-#
-include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-
-#
-# ===============================================================
-# Files to be installed
-# ===============================================================
-#
-# header files
-salomeinclude_HEADERS= UtilsTest.hxx
-
-# Scripts to be installed
-dist_salomescript_PYTHON = TestUtils.py
-
-
-#
-# ===============================================================
-# Local definitions
-# ===============================================================
-#
-# This directory defines the subdirectory src in the top source directory.
-RPATH=../..
-
-# This local variable defines the list of CPPFLAGS common to all target in this package.
-COMMON_CPPFLAGS=\
- @CPPUNIT_INCLUDES@ \
- -I$(srcdir)/$(RPATH)/Basics -I$(srcdir)/$(RPATH)/Basics/Test \
- -I$(srcdir)/$(RPATH)/SALOMELocalTrace -I$(srcdir)/$(RPATH)/SALOMELocalTrace/Test \
- -I$(srcdir)/$(RPATH)/SALOMETraceCollector -I$(srcdir)/$(RPATH)/SALOMETraceCollector/Test \
- -I$(srcdir)/$(RPATH)/Utils -I$(srcdir)/$(RPATH)/Utils/Test \
- -I$(top_builddir)/salome_adm/unix
-
-# This local variable defines the list of dependant libraries common to all target in this package.
-COMMON_LIBS =\
- @CPPUNIT_LIBS@ \
- $(RPATH)/Utils/libOpUtil.la \
- $(RPATH)/SALOMELocalTrace/Test/libSALOMELocalTraceTest.la $(RPATH)/SALOMELocalTrace/libSALOMELocalTrace.la \
- $(RPATH)/SALOMETraceCollector/Test/libSALOMETraceCollectorTest.la \
- $(RPATH)/Basics/libSALOMEBasics.la
-#
-# ===============================================================
-# Libraries targets
-# ===============================================================
-#
-lib_LTLIBRARIES = libUtilsTest.la
-libUtilsTest_la_SOURCES = UtilsTest.cxx
-libUtilsTest_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libUtilsTest_la_LDFLAGS = -no-undefined -version-info=0:0:0
-libUtilsTest_la_LIBADD = $(COMMON_LIBS)
-
-#
-# ===============================================================
-# Executables targets
-# ===============================================================
-#
-bin_PROGRAMS = TestUtils
-TestUtils_SOURCES = TestUtils.cxx
-TestUtils_CPPFLAGS = $(COMMON_CPPFLAGS)
-TestUtils_LDADD = libUtilsTest.la $(CORBA_LIBS)
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// --- include all Unit Test from basics until the present directory
-//
-#include "SALOMELocalTraceTest.hxx"
-#include "SALOMETraceCollectorTest.hxx"
-#include "UtilsTest.hxx"
-
-// --- Registers the fixture into the 'registry'
-
-CPPUNIT_TEST_SUITE_REGISTRATION( SALOMELocalTraceTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( SALOMETraceCollectorTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( UtilsTest );
-
-// --- generic Main program from Basic/Test
-
-#include "BasicMainTest.hxx"
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-import sys, os,signal,string,commands
-import runSalome
-import orbmodule
-import TestKiller
-
-# get SALOME environment :
-
-args, modules_list, modules_root_dir = runSalome.get_config()
-runSalome.set_env(args, modules_list, modules_root_dir)
-
-# launch CORBA naming server
-
-clt=orbmodule.client()
-
-# launch CORBA logger server
-
-myServer=runSalome.LoggerServer(args)
-myServer.run()
-clt.waitLogger("Logger")
-
-# execute Unit Test
-
-command = ['TestUtils']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
-
-# kill Test process
-
-TestKiller.killProcess(runSalome.process_id)
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "UtilsTest.hxx"
-
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <cstdlib>
-#include "Utils_SALOME_Exception.hxx"
-#include "utilities.h"
-
-using namespace std;
-
-#define TRACEFILE "/tmp/traceUnitTest.log"
-
-// ============================================================================
-/*!
- * Set Trace mecanism
- * - delete preexisting trace classes if any
- * - set trace on file
- */
-// ============================================================================
-
-void
-UtilsTest::setUp()
-{
- LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();
- CPPUNIT_ASSERT(bp1);
- bp1->deleteInstance(bp1);
-
- // --- trace on file
- const char *theFileName = TRACEFILE;
-
- string s = "file:";
- s += theFileName;
- CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
-
- ofstream traceFile;
- traceFile.open(theFileName, ios::out | ios::app);
- CPPUNIT_ASSERT(traceFile); // file created empty, then closed
- traceFile.close();
-
- bp1 = LocalTraceBufferPool::instance();
- CPPUNIT_ASSERT(bp1);
-}
-
-// ============================================================================
-/*!
- * - delete trace classes
- */
-// ============================================================================
-
-void
-UtilsTest::tearDown()
-{
- LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();
- CPPUNIT_ASSERT(bp1);
- bp1->deleteInstance(bp1);
-}
-
-int genExcept()
-{
- throw SALOME_Exception("a message");
-};
-
-// ============================================================================
-/*!
- * Check basic SALOME_exception mecanism
- */
-// ============================================================================
-
-void
-UtilsTest::testSALOME_ExceptionThrow()
-{
- CPPUNIT_ASSERT_THROW(genExcept(), SALOME_Exception);
-}
-
-// ============================================================================
-/*!
- * Check message on catch
- */
-// ============================================================================
-
-void
-UtilsTest::testSALOME_ExceptionMessage()
-{
-#define EXAMPLE_EXCEPTION_MESSAGE "something for the end user"
- try
- {
- throw SALOME_Exception(EXAMPLE_EXCEPTION_MESSAGE);
- }
- catch (const SALOME_Exception &ex)
- {
- string expectedMessage = EXAMPLE_EXCEPTION_MESSAGE;
- string actualMessage = ex.what();
- CPPUNIT_ASSERT(actualMessage.find(expectedMessage) != string::npos);
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef _UTILSTEST_HXX_
-#define _UTILSTEST_HXX_
-
-#include <cppunit/extensions/HelperMacros.h>
-
-class UtilsTest : public CppUnit::TestFixture
-{
- CPPUNIT_TEST_SUITE( UtilsTest );
- CPPUNIT_TEST( testSALOME_ExceptionThrow );
- CPPUNIT_TEST( testSALOME_ExceptionMessage );
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
- void setUp();
- void tearDown();
-
- void testSALOME_ExceptionThrow();
- void testSALOME_ExceptionMessage();
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_CommException.cxx
-// Author : Antoine YESSAYAN, EDF
-// Module : SALOME
-// $Header$
-//
-# include "Utils_CommException.hxx"
-using namespace std;
-
-CommException::CommException( void ): SALOME_Exception( "CommException" )
-{
-}
-
-
-CommException::CommException( const char *texte ): SALOME_Exception( texte )
-{
-}
-
-
-CommException::CommException( const CommException &ex ): SALOME_Exception( ex )
-{
-}
-
-
-CommException::~CommException() throw ()
-{
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_CommException.hxx
-// Author : Antoine YESSAYAN, EDF
-// Module : SALOME
-// $Header$
-//
-# if !defined ( __Utils_CommException_H__ )
-# define __Utils_CommException_H__ )
-
-#include "SALOME_Utils.hxx"
-
-#include "Utils_SALOME_Exception.hxx"
-
-class UTILS_EXPORT CommException : public SALOME_Exception
-{
-public :
- CommException( void );
- CommException( const char *texte );
- CommException( const CommException &ex );
- ~CommException() throw ();
-} ;
-
-# endif /* # if ( !defined __Utils_CommException_H__ ) */
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_CorbaException.hxx
-// Author : Paul RASCLE, EDF
-// Module : SALOME
-// $Header$
-//
-#ifndef _UTILS_CORBAEXCEPTION_HXX_
-#define _UTILS_CORBAEXCEPTION_HXX_
-
-#include "SALOME_Utils.hxx"
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOME_Exception)
-
-/*!
- * To raise a CORBA exception from a CORBA servant.
- */
-# define THROW_SALOME_CORBA_EXCEPTION(chain, typex) \
- {\
- SALOME::ExceptionStruct ExDescription; \
- ExDescription.text = CORBA::string_dup(chain); \
- ExDescription.type = typex; \
- ExDescription.sourceFile = CORBA::string_dup(__FILE__); \
- ExDescription.lineNumber = __LINE__; \
- throw SALOME::SALOME_Exception(ExDescription); \
- }
-
-#include <ostream>
-
-//Dump the CORBA exception type.
-inline std::ostream& operator<<(std::ostream& os, const CORBA::Exception& e)
-{
- CORBA::Any tmp;
- tmp<<= e;
- CORBA::TypeCode_var tc = tmp.type();
- const char *p = tc->name();
- os<<"CORBA Exception was catch of the kind : ";
- if ( *p != '\0' ) {
- os<<p;
- }
- else {
- os << tc->id();
- }
-
- return os;
-}
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_DESTRUCTEUR_GENERIQUE.cxx
-// Author : Antoine YESSAYAN, EDF
-// Module : SALOME
-// $Header$
-//
-# include <iostream>
-# include <list>
-extern "C"
-{
-# include <stdlib.h>
-}
-
-# include "Utils_DESTRUCTEUR_GENERIQUE.hxx"
-//# include "utilities.h"
-# include "LocalTraceBufferPool.hxx"
-void Nettoyage();
-
-#ifdef _DEBUG_
-// static int MYDEBUG = 0;
-#else
-// static int MYDEBUG = 0;
-#endif
-
-using namespace std;
-
-std::list<DESTRUCTEUR_GENERIQUE_*> *DESTRUCTEUR_GENERIQUE_::Destructeurs=0 ;
-
-/*! \class ATEXIT_
- *
- * Mecanisme pour faire executer une seule fois DESTRUCTEUR_GENERIQUE_::Nettoyage
- * a la fin du traitement : creation d'un singleton statique de l'objet
- * tres specialise ATEXIT_.
- *
- * La creation d'un objet de type ATEXIT_ entraine l'inscription de la fonction
- * Nettoyage() par atexit(). Il suffit donc de creer un singleton statique du type ATEXIT_
- * pour effectuer cet enregistrement une seule fois independament de l'utilisateur.
- */
-
-//CCRT
-static bool ATEXIT_Done = false ;
-//CCRT
-
-class ATEXIT_
-{
-public :
- /*!
- * Allocation dynamique de Destructeurs, une liste chainee de DESTRUCTEUR_GENERIQUE_* et enregistrement
- * de la fonction Nettoyage() par atexit().
- *
- * La liste chainee Destructeurs est detruite dans la fonction Nettoyage.
- */
- //CCRT ATEXIT_( void )
- ATEXIT_( bool Make_ATEXIT )
- {
- //CCRT
- if ( Make_ATEXIT && !ATEXIT_Done ) {
- //CCRT
- assert (DESTRUCTEUR_GENERIQUE_::Destructeurs==0);
- //cerr << "ATEXIT_::ATEXIT_ Construction ATEXIT" << endl;// message necessaire pour utiliser logger dans Nettoyage (cf.BUG KERNEL4561)
- DESTRUCTEUR_GENERIQUE_::Destructeurs =
- new std::list<DESTRUCTEUR_GENERIQUE_*> ; // Destructeur alloue dynamiquement (cf. ci-dessous) ,
- // il est utilise puis detruit par la fonction Nettoyage
- //To be sure the trace singleton will be the last one to be destroyed initialize it here before calling atexit
- LocalTraceBufferPool::instance();
- int cr = atexit( Nettoyage ); // execute Nettoyage lors de exit, aprs la destruction des donnees statiques !
- assert(cr==0) ;
- ATEXIT_Done = true ;
- }
- }
-
- ~ATEXIT_( )
- {
- //cerr << "ATEXIT_::~ATEXIT_ Destruction ATEXIT" << endl;
- }
-};
-
-
-
-
-static ATEXIT_ nettoyage = ATEXIT_( false ); /* singleton statique */
-
-
-/*!
- * traitement effectue :
- * -# execution de tous les objets de type DESTRUCTEUR_DE_ stockes dans la liste Destructeurs (ce qui detruit les
- * singletons correspondant) ;
- * -# puis destruction de tous les objets de type DESTRUCTEUR_DE_ stockes dans la liste Destructeurs;
- * -# destruction de la liste Destructeurs.
- */
-
-void Nettoyage( void )
-{
- //cerr << "Nettoyage()" << endl;
- //if(MYDEBUG) BEGIN_OF("Nettoyage( void )") ;
- assert(DESTRUCTEUR_GENERIQUE_::Destructeurs) ;
- //if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ;
- if( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() )
- {
- std::list<DESTRUCTEUR_GENERIQUE_*>::iterator it = DESTRUCTEUR_GENERIQUE_::Destructeurs->end() ;
-
- do
- {
- //if(MYDEBUG) MESSAGE( "DESTRUCTION d'un SINGLETON");
- it-- ;
- DESTRUCTEUR_GENERIQUE_* ptr = *it ;
- //DESTRUCTEUR_GENERIQUE_::Destructeurs->remove( *it ) ;
- (*ptr)() ;
- delete ptr ;
- }while( it!= DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ) ;
-
- DESTRUCTEUR_GENERIQUE_::Destructeurs->clear() ;
- //if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ;
- assert( DESTRUCTEUR_GENERIQUE_::Destructeurs->size()==0 ) ;
- assert( DESTRUCTEUR_GENERIQUE_::Destructeurs->empty() ) ;
- }
-
- delete DESTRUCTEUR_GENERIQUE_::Destructeurs;
- DESTRUCTEUR_GENERIQUE_::Destructeurs=0;
- //if(MYDEBUG) END_OF("Nettoyage( void )") ;
- return ;
-}
-
-
-/*!
- * Adds a destruction object to the list of actions to be performed at the end
- * of the process
- */
-const int DESTRUCTEUR_GENERIQUE_::Ajout( DESTRUCTEUR_GENERIQUE_ &objet )
-{
- // N.B. : l'ordre de creation des SINGLETON etant important
- // on n'utilise pas deux fois la meme position pour
- // les stocker dans la pile des objets.
-
- //CCRT
- if ( !ATEXIT_Done ) {
- nettoyage = ATEXIT_( true ) ;
- }
- //CCRT
- assert(Destructeurs) ;
- Destructeurs->push_back( &objet ) ;
- return Destructeurs->size() ;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_DESTRUCTEUR_GENERIQUE.hxx
-// Author : Antoine YESSAYAN, EDF
-// Module : SALOME
-// $Header$
-//
-# if !defined( __DESTRUCTEUR_GENERIQUE__H__ )
-# define __DESTRUCTEUR_GENERIQUE__H__
-
-#include <SALOMEconfig.h>
-
-#include "SALOME_Utils.hxx"
-
-#include <list>
-#include <cassert>
-#include <omniORB4/CORBA.h>
-#include <iostream>
-//# include "utilities.h"
-
-/*!\class DESTRUCTEUR_GENERIQUE_
- *
- * <B>Definition</B>
- *
- * The DESTRUCTEUR_GENERIQUE_ abstract class describes the comportement of any destruction object.
- * Tis type is used to create a list of miscellaneous destruction object.
- *
- * <B>Usage</B>
- *
- * The only way to use the DESTRUCTEUR_GENERIQUE_ class is inheritance :
- * class DESTRUCTEUR_SPECIFIQUE_ : public DESTRUCTEUR_GENERIQUE_
- *
- * <B>Design description</B>
- *
- * A generic destructor supply two functionalities :
- * -# a static method to add a destruction (objetct) to be performed DESTRUCTEUR_GENERIQUE_::Ajout(
- * DESTRUCTEUR_GENERIQUE_ &objet) ;
- * The Destruction object is stored in a list of pointer to DESTRUCTEUR_GENERIQUE_ objects.
- * -# an object method to execute the destruction : operator()().
- */
-
-class UTILS_EXPORT DESTRUCTEUR_GENERIQUE_
-{
-public :
- static std::list<DESTRUCTEUR_GENERIQUE_*> *Destructeurs;
-
- virtual ~DESTRUCTEUR_GENERIQUE_() {}//!< virtual destructor
- static const int Ajout( DESTRUCTEUR_GENERIQUE_ &objet );//!< adds a destruction object to the list of destructions
- virtual void operator()( void )=0 ;//!< performs the destruction
-};
-
-
-/*!\class DESTRUCTEUR_DE_
- *
- * <B>Purpose</B>
- *
- * The DESTRUCTEUR_DE_ class allows the user to program - at any moment - the destruction of an object
- * at the end of the process.
- *
- * <B>Usage</B>
- *
- * In this example the POINT_ ptrPoint will be destroyed at the end of the process (atexit).
- *
- * POINT_ *ptrPoint = new POINT_ ;<BR>
- * DESTRUCTEUR_DE_<POINT_> *ptrDestruction = new DESTRUCTEUR_DE_<POINT_>( *ptrPoint ) ;
- *
- * Note that neither ptrPoint, nor ptrDestruction should be destroyed by the user.
- *
- * <B>Design description</B>
- *
- * The destruction object must be created dynamicaly because it suscribes himself in the list of
- * destruction to be performed at the end of the process.
- *
- */
-template <class TYPE> class DESTRUCTEUR_DE_ : public DESTRUCTEUR_GENERIQUE_
-{
-public :
- /* Programs the destruction at the end of the process, of the object objet.
- This method records in _PtrObjet the address of an object to be destroyed
- at the end of the process
- */
- DESTRUCTEUR_DE_(TYPE &objet):
- _PtrObjet( &objet )
- {
- assert(DESTRUCTEUR_GENERIQUE_::Ajout( *this ) >= 0) ;
- }
-
- /* Performs the destruction of the object.
- This method really destroys the object pointed by _PtrObjet.
- It should be called at the end of the process (i.e. at exit).
- */
- virtual void operator()(void){
- typedef PortableServer::ServantBase TServant;
- if(_PtrObjet){
- if(dynamic_cast<TServant*>(_PtrObjet)){
- // std::cerr << "WARNING: automatic destruction for servant is no more used. It's too late in exit. Use explicit call" << std::endl;
- /*
- if(TServant* aServant = dynamic_cast<TServant*>(_PtrObjet)){
- PortableServer::POA_var aPOA = aServant->_default_POA();
- PortableServer::ObjectId_var anObjectId = aPOA->servant_to_id(aServant);
- aPOA->deactivate_object(anObjectId.in());
- aServant->_remove_ref();
- */
- }else{
- //cerr << "DESTRUCTEUR_GENERIQUE_::operator() deleting _PtrObjet" << endl;
- TYPE* aPtr = static_cast<TYPE*>(_PtrObjet);
- delete aPtr;
- }
- _PtrObjet = NULL ;
- }
- }
-
- virtual ~DESTRUCTEUR_DE_(){
- assert(!_PtrObjet) ;
- }
-
-private :
- TYPE *_PtrObjet ;
-};
-
-
-# endif /* # if !defined( __DESTRUCTEUR_GENERIQUE__H__ ) */
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File: Utils_ExceptHandler.cxx
-// Created: Mon Mar 15 10:23:41 2004
-// Author: Oksana TCHEBANOVA
-// <ota@localhost.localdomain>
-//
-#include "Utils_ExceptHandlers.hxx"
-#include "Utils_CorbaException.hxx"
-#include "Utils_SALOME_Exception.hxx"
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOME_Exception)
-
-using namespace std;
-
-void SalomeException ()
-{
- throw SALOME_Exception("Salome Exception");
-}
-
-void SALOME_SalomeException() {
- THROW_SALOME_CORBA_EXCEPTION("INTERNAL ERROR", SALOME::INTERNAL_ERROR);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// KERNEL Utils : common utils for KERNEL
-// File : Utils_ExceptHandlers.hxx
-// Author : Oksana Tchebanova
-// Module : KERNEL
-// $Header:
-//
-#ifndef Utils_ExceptHandlers_HeaderFile
-#define Utils_ExceptHandlers_HeaderFile
-
-#include "SALOME_Utils.hxx"
-
-#include <stdexcept>
-
-typedef void (*PVF)();
-
-class UTILS_EXPORT Unexpect { //save / retrieve unexpected exceptions treatment
- PVF old;
- public :
-#ifndef WIN32
- Unexpect( PVF f )
- { old = std::set_unexpected(f); }
- ~Unexpect() { std::set_unexpected(old); }
-#else
- Unexpect( PVF f )
- { old = ::set_unexpected(f); }
- ~Unexpect() { ::set_unexpected(old); }
-#endif
-};
-
-class UTILS_EXPORT Terminate {//save / retrieve terminate function
-
- PVF old;
- public :
-#ifndef WIN32
- Terminate( PVF f )
- { old = std::set_terminate(f); }
- ~Terminate() { std::set_terminate(old); }
-#else
- Terminate( PVF f )
- { old = ::set_terminate(f); }
- ~Terminate() { ::set_terminate(old); }
-#endif
-};
-
-#define UNEXPECT_CATCH(FuncName, ExceptionConstructor) \
-inline void FuncName () {\
- throw ExceptionConstructor (); \
-}
-//Example of the usage
-
-// void DTC_NotFound () {
-// throw (SALOME_DataTypeCatalog::NotFound());
-// }
-// or the same :
-//
-// UNEXPECT_CATCH( DTC_NotFound , SALOME_DataTypeCatalog::NotFound)
-// in the function body :
-// ....
-// Unexpect aCatch(DTC_NotFound) // redefinition of the unexpect exceptions handler
-// ....
-
-
-//Definitions :
-UTILS_EXPORT extern void SalomeException();
-UTILS_EXPORT extern void SALOME_SalomeException();
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_Identity.cxx
-// Author : Pascale NOYRET, EDF
-// Module : SALOME
-// $Header$
-//
-# include <iostream>
-# include "utilities.h"
-# include "Utils_Identity.hxx"
-
-extern "C"
-{
-# include <string.h>
-
-#ifndef WIN32 /* unix functionality */
-# include <pwd.h>
-#endif
-}
-
-#ifndef WIN32 /* unix functionality */
-
-# include <arpa/inet.h>
-# include <netinet/in.h>
-# include <sys/types.h>
-# include <netdb.h>
-
-const char* duplicate( const char *const str ) ;
-
-const struct utsname get_uname( void )
-{
- struct utsname hostid;
-#if defined(_DEBUG_) || defined(_DEBUG)
- const int retour=uname(&hostid);
- ASSERT(retour>=0);
-#else
- uname(&hostid);
-#endif
- return hostid ;
-}
-
-const char* get_adip( void )
-{
- struct utsname hostid;
-#if defined(_DEBUG_) || defined(_DEBUG)
- const int retour=uname(&hostid);
- ASSERT(retour>=0);
-#else
- uname(&hostid);
-#endif
-
- const hostent* pour_adip=gethostbyname(hostid.nodename);
- ASSERT(pour_adip!=NULL);
- const in_addr ip_addr=*(struct in_addr*)(pour_adip->h_addr) ;
- return duplicate(inet_ntoa(ip_addr));
-}
-const char* const get_pwname( void )
-{
- struct passwd *papa = getpwuid(getuid());
- return papa->pw_name ;
-}
-
-#else /* Windows functionality */
-
-#include <windows.h>
-#include <direct.h>
-#include <process.h>
-
-const char* duplicate( const char *const str ) ;
-
-const char* get_uname( void )
-{
- static std::string hostName(256, 0);
- static DWORD nSize = hostName.length();
- static int res = ::GetComputerNameEx(ComputerNameDnsFullyQualified, &hostName[0], &nSize);
- ASSERT( res );
- return hostName.c_str();
-}
-
-const char* get_adip( void )
-{
- //#include <Nspapi.h>
- //#include <Svcguid.h>
- //static GUID sType = SVCID_HOSTNAME;
- //static CSADDR_INFO* ips = new CSADDR_INFO[8]; // in case multiple IP addresses are returned
- //static DWORD nSize = 1024;
- //static std::string uname = get_uname();
- //static int res = ::GetAddressByName( NS_DEFAULT, &sType, &uname[0], 0, 0, 0, ips, &nSize, 0, 0 );
- //if ( res )
- // return ips[0].LocalAddr.lpSockaddr->sa_data;
-
- static hostent* he = ::gethostbyname( get_uname() );
- if ( he && he->h_addr_list && he->h_length >0 ) {
- static char str[16];
- unsigned i1 = (unsigned char)he->h_addr_list[0][0];
- unsigned i2 = (unsigned char)he->h_addr_list[0][1];
- unsigned i3 = (unsigned char)he->h_addr_list[0][2];
- unsigned i4 = (unsigned char)he->h_addr_list[0][3];
- sprintf ( str, "%03u.%03u.%03u.%03u", i1, i2, i3, i4 );
- return str;
- }
- return "<unknown>";
-}
-
-const char* const get_pwname( void )
-{
- static std::string retVal(256, 0);
- static DWORD dwSize = retVal.length() + 1;
- static int res = GetUserName( &retVal[0], &dwSize );
- ASSERT( res );
- return retVal.c_str();
-}
-
-PSID getuid() {
- PSID retVal = NULL;
- HANDLE hProcessToken = INVALID_HANDLE_VALUE;
- PTOKEN_OWNER pTKowner = NULL;
- LPVOID buffer = NULL;
- DWORD dwsize = 0;
-
- if ( !OpenProcessToken ( GetCurrentProcess (), TOKEN_QUERY, &hProcessToken )) return 0;
- if (!GetTokenInformation(hProcessToken, TokenOwner, buffer, dwsize, &dwsize)) return 0;
- pTKowner = (PTOKEN_OWNER)buffer;
- if ( pTKowner != NULL ) {
- retVal = pTKowner->Owner;
- }
- if ( hProcessToken != INVALID_HANDLE_VALUE ) CloseHandle ( hProcessToken );
-
- return retVal;
-}
-
-#define getcwd _getcwd
-#define getpid _getpid
-
-#endif /* WIN32 */
-
-
-Identity::Identity( const char *name ): _name(duplicate(name)),\
- _hostid(get_uname()),\
- _adip(get_adip()),\
- _uid(getuid()) ,\
- _pwname(get_pwname()) ,\
- _dir(getcwd(NULL,256)),\
- _pid(getpid()) ,\
- _start(time(NULL)),\
- _cstart(ctime(&_start))
-//CCRT
-{
- ASSERT(strlen(_dir)<256);
-}
-
-
-Identity::~Identity(void)
-{
- delete [] (char*)_name ;
- (char*&)_name = NULL ;
-
- //delete [] (char*)_dir ;
- //(char*&)_dir = NULL ;
- free((char*)_dir);
-#ifndef WIN32
- // free the memory only on Unix
- // becasue at Windows it is the same static variable
- // (function get_adip() returns the same char* as get_uname() )
- delete [] (char*)_adip ;
-#endif
- (char*&)_adip = NULL ;
-
-}
-
-/*------------*/
-/* Accessors */
-/*------------*/
-
-const char* const Identity::name (void) const
-{
- return _name ;
-}
-#ifndef WIN32
- const pid_t& Identity::pid(void) const
-#else
- const DWORD& Identity::pid(void) const
-#endif
-{
- return _pid ;
-}
-
-#ifndef WIN32
- const struct utsname &Identity::hostid(void) const
-#else
- const char* const Identity::hostid(void) const
-#endif
-{
- return _hostid ;
-}
-
-#ifndef WIN32
- const uid_t& Identity::uid(void) const
-#else
- const PSID& Identity::uid(void) const
-#endif
-{
- return _uid ;
-}
-const time_t &Identity::start(void) const
-{
- return _start ;
-}
-const char* const Identity::rep (void) const
-{
- return _dir ;
-}
-const char* const Identity::pwname (void) const
-{
- return _pwname ;
-}
-const char* const Identity::adip (void) const
-{
- return _adip ;
-}
-
-/*------------------*/
-/* Other methods */
-/*------------------*/
-
-const char* Identity::host_char( void ) const
-{
-#ifndef WIN32
- return _hostid.nodename;
-#else
- return _hostid;
-#endif
-}
-
-const char* Identity::start_char(void) const
-{
- return ctime(&_start) ;
-}
-
-std::ostream & operator<< ( std::ostream& os , const Identity& monid )
-{
- ASSERT(monid._name!=NULL) ;
- os << "Identity :" << std::endl ;
- os << '\t' << "Component name : " << monid._name << std::endl ;
- os << '\t' << "Numero de PID : " << monid._pid << std::endl;
- os << '\t' << "Uid utilisateur : " << monid._uid << std::endl;
- os << '\t' << "nom utilisateur : " << monid._pwname << std::endl;
-#ifndef WIN32
- os << '\t' << "Nom de machine : " << monid._hostid.nodename << std::endl;
-#else
- os << '\t' << "Nom de machine : " << monid._hostid << std::endl;
-#endif
- os << '\t' << "Adresse IP : " << monid._adip << std::endl;
- os << '\t' << "Heure de lancement : " << monid._cstart ; //ctime(&monid._start) ;
- os << '\t' << "Dans le repertoire : " << monid._dir << std::endl;
-
- return os ;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_Identity.hxx
-// Author : Pascale NOYRET, EDF
-// Module : SALOME
-// $Header$
-//
-# if !defined( __IDENTITE_H__ )
-# define __IDENTITE_H__
-
-#include "SALOME_Utils.hxx"
-
-extern "C"
-{
-# include <stdlib.h>
-# include <time.h>
-#ifndef WIN32
-# include <unistd.h>
-# include <sys/utsname.h>
-#else
-# include <windows.h>
-#endif
-}
-
-class UTILS_EXPORT Identity
-{
-
-protected :
- const char* const _name ;
- const char* const _adip; // Internet address
-
-#ifndef WIN32
- const struct utsname _hostid;
- const pid_t _pid ;
- const uid_t _uid ;
-#else
- const char* const _hostid;
- const DWORD _pid ;
- const PSID _uid ;
-#endif
- const char* const _pwname ;
- const char* const _dir ;
- const time_t _start;
- const char* const _cstart ;
-
-private :
- Identity( void );
- Identity( const Identity &monid );
-
-public :
- Identity(const char *name);
- ~Identity();
- friend std::ostream & operator<< ( std::ostream& os , const Identity& monid );
-
-#ifndef WIN32
- const pid_t& pid(void) const;
- const struct utsname& hostid(void) const;
- const uid_t& uid(void) const;
-#else
- const DWORD& pid(void) const;
- const char* const hostid(void) const;
- const PSID& uid(void) const;
-#endif
-
- const char* const name( void ) const;
- const char* const adip(void) const;
- const char* const pwname(void) const;
- const time_t& start(void) const;
- const char* const rep (void) const;
-
- const char* host_char(void ) const;
- const char* start_char(void) const;
-
-} ;
-# endif /* # if !defined( __IDENTITE_H__ ) */
+++ /dev/null
-#! /usr/bin/env python
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# SALOME Utils : general SALOME's definitions and tools
-# File : Utils_Identity.py
-# Author : Estelle Deville, CEA
-# Module : SALOME
-# $Header$
-#
-## @package Utils_Identity
-# \brief Module to get information about user and version
-#
-#
-
-import sys
-import os
-import socket
-
-if not sys.platform == "win32":
- import pwd
-
-import time
-import string
-
-def getShortHostName():
- """
- gives Hostname without domain extension.
-
- SALOME naming service needs short Hostnames (without domain extension).
- HOSTNAME is not allways defined in environment,
- socket.gethostname() gives short or complete Hostname, depending on
- defined aliases.
- """
- return string.split(socket.gethostname(),'.')[0]
-
-class Identity:
- def __init__(self,name):
- self._name = name
- self._pid = os.getpid()
- self._machine = socket.gethostname()
- self._adip = socket.gethostbyname(self._machine) # IP adress
- if sys.platform == "win32":
- self._uid = os.getpid()
- self._pwname = os.environ["USER"]
- else:
- self._uid = os.getuid()
- list = pwd.getpwuid(self._uid)
- self._pwname = list[0] # user name
-
- self._tc_start = time.time()
- self._cstart = time.ctime(self._tc_start)
- self._cdir = os.getcwd()
-
-def getapplipath():
- """
- Gives short application path (the complete path is $HOME/$APPLI)
- """
- return os.environ.get("APPLI",".salome_"+versnb)
-
-try:
- file = open(os.path.join(os.environ["KERNEL_ROOT_DIR"],"bin","salome","VERSION"), "r")
- s = file.readline()
- versnb = string.strip(string.split(s, ":")[1])
- dirname=".salome_"+versnb
-except:
- versnb = ""
- dirname=".salome"
-
-def version():
- """
- Gives salome version number
- """
- return versnb
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File: Utils_Mutex.cxx
-// Author: Sergey ANIKIN
-// Module : SALOME
-// $Header$
-//
-#include "Utils_Mutex.hxx"
-
-Utils_Mutex::Utils_Mutex()
-: myCount( 0 )
-{
- pthread_mutex_init( &myMutex, 0 );
- pthread_mutex_init( &myHelperMutex, 0 );
-}
-
-Utils_Mutex::~Utils_Mutex()
-{
- pthread_mutex_destroy( &myHelperMutex );
- pthread_mutex_destroy( &myMutex );
-}
-
-void Utils_Mutex::lock()
-{
- pthread_mutex_lock( &myHelperMutex );
-
-#ifndef WIN32
- if ( myCount > 0 && myThread == pthread_self() ) {
-#else
- if ( myCount > 0 && myThread.p == pthread_self().p ) {
-#endif
- myCount++;
- }
- else {
- pthread_mutex_unlock( &myHelperMutex );
- pthread_mutex_lock( &myMutex );
- pthread_mutex_lock( &myHelperMutex );
- myCount = 1;
- myThread = pthread_self();
- }
-
- pthread_mutex_unlock( &myHelperMutex );
-}
-
-void Utils_Mutex::unlock()
-{
- pthread_mutex_lock( &myHelperMutex );
-
-#ifndef WIN32
- if ( myThread == pthread_self() ) {
-#else
- if ( myThread.p == pthread_self().p ) {
-#endif
- if ( myCount && (--myCount) < 1 ) {
- myCount = 0;
- pthread_mutex_unlock( &myMutex );
- }
- }
-
- pthread_mutex_unlock( &myHelperMutex );
-}
-
-Utils_Locker::Utils_Locker( Utils_Mutex* mutex )
-: myMutex( mutex )
-{
- if ( myMutex ) myMutex->lock();
-}
-
-Utils_Locker::~Utils_Locker()
-{
- if ( myMutex ) myMutex->unlock();
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File: Utils_Mutex.hxx
-// Author: Sergey ANIKIN
-// Module : SALOME
-// $Header$
-//
-#ifndef Utils_Mutex_HeaderFile
-#define Utils_Mutex_HeaderFile
-
-#include "SALOME_Utils.hxx"
-
-#include <pthread.h>
-
-class UTILS_EXPORT Utils_Mutex
-{
-public:
- Utils_Mutex();
- ~Utils_Mutex();
-
- void lock();
- void unlock();
-
-private:
- pthread_mutex_t myMutex;
- pthread_mutex_t myHelperMutex;
- pthread_t myThread;
- int myCount;
-};
-
-class UTILS_EXPORT Utils_Locker
-{
-public:
- Utils_Locker( Utils_Mutex* );
- virtual ~Utils_Locker();
-
-private:
- Utils_Mutex* myMutex;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_ORB_INIT.cxx
-// Author : Antoine YESSAYAN, EDF
-// Module : SALOME
-// $Header$
-//
-# include "Utils_ORB_INIT.hxx"
-# include "utilities.h"
-
-# include "SALOMEconfig.h"
-
-ORB_INIT::ORB_INIT( void ): _orb( CORBA::ORB::_nil() )
-{
-}
-
-
-ORB_INIT::~ORB_INIT()
-{
- if ( ! CORBA::is_nil( _orb ) )
- {
- MESSAGE("WARNING: orb destroy is no more called at exit. Use explicit call.");
- //std::cerr << "appel _orb->destroy()" << std::endl;
- /*
- try {
- _orb->destroy() ;
- }
- catch(...) {
- MESSAGE("Caught CORBA::Exception.");
- }
- */
- //std::cerr << "retour _orb->destroy()" << std::endl;
- }
-}
-
-
-CORBA::ORB_var &ORB_INIT::operator() ( int argc , char **argv ) throw( CommException )
-{
- try {
- if ( CORBA::is_nil( _orb ) )
- {
- try
- {
-#if OMNIORB_VERSION >= 4
- _orb = CORBA::ORB_init( argc, argv, "omniORB4" ) ;
-#else
- _orb = CORBA::ORB_init( argc, argv, "omniORB3" ) ;
-#endif
- }
- catch( const CORBA::Exception &ex )
- {
- throw CommException( "Unable to create an ORB connexion" ) ;
- }
- }
- return _orb ;
- } catch ( CommException& e) {throw e;}
- catch (...) { throw CommException( "ORB_INIT::operator() : Unknown exception was caught" ) ;}
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_ORB_INIT.hxx
-// Author : Antoine YESSAYAN, EDF
-// Module : SALOME
-// $Header$
-//
-# if ! defined( __ORB_INIT_HXX__ )
-# define __ORB_INIT_HXX__
-
-#include <SALOMEconfig.h>
-
-#include "SALOME_Utils.hxx"
-
-#include "omniORB4/CORBA.h"
-
-#include "Utils_CommException.hxx"
-
-/*!
- * Ce composant prend en charge la connexion et la deconnexion a l'orb
- * Il est souhaitable de l'utiliser dans un SINGLETON.
- */
-
-class UTILS_EXPORT ORB_INIT
-{
-
-private :
- CORBA::ORB_var _orb ;
-
-public :
- ORB_INIT( void );
- virtual ~ORB_INIT();
- CORBA::ORB_var & operator() ( int argc , char **argv ) throw( CommException ) ;
-
- inline CORBA::ORB_var &orb( void );
-} ;
-
-inline CORBA::ORB_var &ORB_INIT::orb( void )
-{
- return _orb ;
-}
-
-# endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_SALOME_Exception.cxx
-// Author : Antoine YESSAYAN, EDF
-// Module : SALOME
-// $Header$
-//
-#include <iostream>
-#include "Utils_SALOME_Exception.hxx"
-#include "utilities.h"
-
-#ifndef WIN32
-extern "C"
-{
-#endif
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-#ifndef WIN32
-}
-#endif
-
-
-const char* duplicate( const char *const str ) ;
-
-SALOME_Exception::SALOME_Exception( void ): exception() , _text(0)
-{
- MESSAGE( "You must use the standard builder: SALOME_Exception::SALOME_Exception( const char *text )" ) ;
- INTERRUPTION(1) ;
-}
-
-
-
-const char *makeText( const char *text, const char *fileName, const unsigned int lineNumber )
-{
- char *newText = 0 ;
-
- ASSERT(text) ;
- const size_t l1 = 1+strlen(text) ;
- ASSERT(l1>1) ;
-
- const char* prefix = "Salome Exception" ;
- const size_t l0 = 2+strlen(prefix) ;
-
- if ( fileName )
- {
- const size_t l2 = 4+strlen(fileName) ;
- ASSERT(l2>4) ;
-
- ASSERT(lineNumber>=1) ;
- const size_t l3 = 4+int(log10(float(lineNumber))) ;
-
- newText = new char [ 1+l0+l1+l2+l3 ] ;
- sprintf( newText , "%s in %s [%u] : %s" , prefix, fileName, lineNumber, text ) ;
- }
- else
- {
- newText = new char [ 1+l0+l1 ] ;
- sprintf( newText , "%s : %s" , prefix, text ) ;
- }
- ASSERT(newText) ;
- return newText ;
-}
-
-
-SALOME_Exception::SALOME_Exception( const char *text, const char *fileName, const unsigned int lineNumber ) : exception(), _text( makeText( text , fileName , lineNumber ) )
-{
-}
-
-
-SALOME_Exception::~SALOME_Exception() throw ()
-{
- if ( _text )
- {
- delete [] ((char*)_text);
- char** pRef = (char**)&_text;
- *pRef = 0;
- }
- ASSERT(_text==NULL) ;
-}
-
-
-
-SALOME_Exception::SALOME_Exception( const SALOME_Exception &ex ): _text(duplicate(ex._text))
-{
- ;
-}
-
-
-std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex )
-{
- os << ex._text ;
- return os ;
-}
-
-
-
-const char* SALOME_Exception::what( void ) const throw ()
-{
- return _text ;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_SALOME_Exception.hxx
-// Author : Antoine YESSAYAN, EDF
-// Module : SALOME
-// $Header$
-//
-#if !defined( __Utils_SALOME_Exception_hxx__ )
-#define __Utils_SALOME_Exception_hxx__
-
-//#include "SALOME_Utils.hxx"
-
-# include <exception>
-# include <iostream>
-
-#ifdef LOCALIZED
-#undef LOCALIZED
-#endif
-#if defined(_DEBUG_) || defined(_DEBUG)
-# define LOCALIZED(message) #message , __FILE__ , __LINE__
-#else
-# define LOCALIZED(message) #message
-#endif
-
-//swig tool on Linux doesn't pass defines from header SALOME_Utils.hxx
-//therefore (temporary solution) defines are placed below
-
-#ifdef WIN32
-# if defined UTILS_EXPORTS || defined OpUtil_EXPORTS
-# define UTILS_EXPORT __declspec( dllexport )
-# else
-# define UTILS_EXPORT __declspec( dllimport )
-# define LOCALIZED(message) #message
-# endif
-#else
-# define UTILS_EXPORT
-#endif
-
-class SALOME_Exception;
-
-UTILS_EXPORT std::ostream& operator<<( std::ostream&, const SALOME_Exception& );
-
-UTILS_EXPORT const char *makeText( const char *text, const char *fileName, const unsigned int lineNumber );
-
-class UTILS_EXPORT SALOME_Exception : public std::exception
-{
-
-private :
- SALOME_Exception( void );
-
-protected :
- const char* _text ; // non constant pointer but read only char variable
-
-public :
- SALOME_Exception( const char *text, const char *fileName=0, const unsigned int lineNumber=0 );
- SALOME_Exception( const SALOME_Exception &ex );
- ~SALOME_Exception() throw ();
- friend std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex );
- virtual const char *what( void ) const throw () ;
-} ;
-
-
-#endif /* #if !defined( __Utils_SALOME_Exception_hxx__ ) */
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_SINGLETON.hxx
-// Author : Antoine YESSAYAN, EDF
-// Module : SALOME
-// $Header$
-//
-# if !defined( __SINGLETON__H__ )
-# define __SINGLETON__H__
-
-#include "SALOME_Utils.hxx"
-
-# include "Utils_DESTRUCTEUR_GENERIQUE.hxx"
-# include <list>
-
-/*!\class SINGLETON_
- *
- * <B>Definition</B>
- *
- * A singleton is a data which is created and deleted only once in the application.
- * The C++ compiler allow the user to create static data before the first executable statement.
- * They are deleted after the last statement.statement.
- *
- * The SINGLETON_ template class deals with dynamic singleton. It is useful for functor objects.
- * For example, an object which, when created, connects the application to a system and
- * disconnects the application at deletion.
- *
- *
- * <B>Usage</B>
- *
- * To create a single instance a POINT_ object :
- *
- * # include "Utils_SINGLETON.hxx"
- * ...
- * ptrPoint = SINGLETON_<POINT_>::Instance() ;
- *
- *
- * <B>Design description</B>
- *
- * -# the user creates an object of class TYPE By using a class method : SINGLETON_<TYPE>::Instance() which
- * returns a pointer to the single object ;
- * -# this class method uses the default constructor to create an object ;
- * -# at the same time, this class method reate a destructor object which is added to the generic list
- * of destructors objects to be executed at the end of the application (atexit) ;
- * -# at the end of the application process all the deletions are performed by the Nettoyage() C function
- * which execute the destructions objects then deletes the destructions objects themselves ;
- * -# the Nettoyage() C function is recorded using atexit() C function through the creation of a static
- * single object ATEXIT_().
- */
-
-
-template <class TYPE> class SINGLETON_
-{
-
-public :
-
- static TYPE *Instance( void ); //!< Singleton dynamic creation using the default builder
- static bool IsAlreadyExisting( void ); //!< returns True if the singleton is already existing
- static int Destruction( void ); //!< destroys the Singleton before the end of the application process
-
-private :
-
- TYPE _Instance ;
- static SINGLETON_ *PtrSingleton ;
-
- SINGLETON_( void );
- ~SINGLETON_();
-
-} ; /* class SINGLETON_<TYPE> */
-
-
-
-
-template <class TYPE> SINGLETON_<TYPE> *SINGLETON_<TYPE>::PtrSingleton=NULL ;
-
-
-
-/*!
- * The class method Instance :
- * -# creates an object of class TYPE ;
- * -# creates a destruction object DESTRUCTEUR_DE_<TYPE> which is appended to the list of destruction objects to be
- * executed ;
- * -# returns a pointer to the created object.
- *
- * Note that the two created objects are deleted at the end of the process in the function Nettoyage().
- */
-template <class TYPE> TYPE *SINGLETON_<TYPE>::Instance( void )
-{
- if ( ! PtrSingleton )
- {
- //MESSAGE("SINGLETON_<TYPE>::Instance( void )") ;
- PtrSingleton = new SINGLETON_<TYPE> ;
- new DESTRUCTEUR_DE_<TYPE>( PtrSingleton->_Instance ) ;
- }
- return &PtrSingleton->_Instance ;
-}
-
-
-template <class TYPE> bool SINGLETON_<TYPE>::IsAlreadyExisting( void )
-{
- return PtrSingleton ? true : false ;
-}
-
-
-
-
-template <class TYPE> SINGLETON_<TYPE>::SINGLETON_( void )
-{
- //MESSAGE("CREATION d'un SINGLETON_") ;
-}
-
-
-
-
-/*!
- The method SINGLETON_<TYPE>::Destruction can be called by the user. If it is not
- the function nettoyage() calls it atexit.
-
- N.B. : the singleton objects are destroyed in the reverse order of there creation.
-*/
-template <class TYPE> int SINGLETON_<TYPE>::Destruction( void )
-{
- int k = - 1 ;
- //BEGIN_OF("SINGLETON_<TYPE>::Destruction( void )") ;
- if ( PtrSingleton )
- {
- //MESSAGE("Destruction du SINGLETON_") ;
-
-
- std::list<DESTRUCTEUR_GENERIQUE_ *>::iterator k ;
- for( k=DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ; k!=DESTRUCTEUR_GENERIQUE_::Destructeurs->end();k++)
- {
- if ( *k == PtrSingleton->_Instance )
- {
- DESTRUCTEUR_GENERIQUE_::Destructeurs->erase( k ) ;
- break ;
- }
- }
- delete PtrSingleton ;
- PtrSingleton = NULL ;
- }
- //END_OF("SINGLETON_<TYPE>::Destruction( void )") ;
- return k ;
-}
-
-
-template <class TYPE> SINGLETON_<TYPE>::~SINGLETON_()
-{
- //MESSAGE("passage dans SINGLETON_<TYPE>::~SINGLETON_( void )") ;
-}
-
-# endif /* # if !defined( __SINGLETON__H__ ) */
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_Timer.cxx
-// Module : SALOME
-//
-# include "Utils_Timer.hxx"
-
-# include <iostream>
-
-#include "utilities.h"
-
-#ifndef WIN32
-static struct timezone *tz=(struct timezone*) malloc(sizeof(struct timezone));
-#else
-//timezone *tz=_timezone;
-#endif
-
-#ifndef CLK_TCK
-# define CLK_TCK CLOCKS_PER_SEC
-#endif
-
-Utils_Timer::Utils_Timer() {
-#ifndef WIN32
- RefToInitialTMS = new tms;
- RefToCurrentTMS = new tms;
-
- RefToInitialTimeB = new timeval;
- RefToCurrentTimeB = new timeval;
-#else
- RefToInitialTMS = new FILETIME;
- RefToCurrentTMS = new FILETIME;
-
- RefToInitialTimeB = new time_t;
- RefToCurrentTimeB = new time_t;
-#endif
-
- Cumul_user = Cumul_sys = 0.;
- Stopped = 1;
-}
-
-Utils_Timer::~Utils_Timer() {
- delete RefToInitialTMS ;
- delete RefToCurrentTMS ;
-
- delete RefToInitialTimeB ;
- delete RefToCurrentTimeB ;
-}
-
-void Utils_Timer::Start() {
- if (Stopped) {
- Stopped = 0;
-#ifndef WIN32
- times(RefToInitialTMS);
- gettimeofday(RefToInitialTimeB,tz);
-#else
- SYSTEMTIME st;
- GetSystemTime(&st);
- SystemTimeToFileTime(&st, RefToInitialTMS);
- time(RefToCurrentTimeB);
-#endif
- }
-}
-
-void Utils_Timer::Stop() {
- if (!Stopped) {
-#ifndef WIN32
- times(RefToCurrentTMS);
- int diffr_user = RefToCurrentTMS->tms_utime - RefToInitialTMS->tms_utime;
- int diffr_sys = RefToCurrentTMS->tms_stime - RefToInitialTMS->tms_stime;
- gettimeofday(RefToCurrentTimeB,tz);
-
- Cumul_user += (double) diffr_user / CLK_TCK ;
- Cumul_sys += (double) diffr_sys / CLK_TCK ;
-#else
- SYSTEMTIME st;
- GetSystemTime(&st);
- SystemTimeToFileTime(&st, RefToCurrentTMS);
- Cumul_user += (int)(((ULARGE_INTEGER*)(RefToCurrentTMS))->QuadPart - ((ULARGE_INTEGER*)(RefToInitialTMS))->QuadPart) / 10000000;
- Cumul_sys = Cumul_user;
- time(RefToCurrentTimeB);
-#endif
- Stopped = 1;
- }
-}
-
-void Utils_Timer::Show() {
- bool StopSav = Stopped;
- if (!StopSav) Stop();
- MESSAGE("CPU user time: " << Cumul_user << " seconds ");
- MESSAGE("CPU system time: " << Cumul_sys << " seconds ");
- if (!StopSav) Start();
-}
-
-void Utils_Timer::Reset() {
- Stopped = 1;
- Cumul_user = Cumul_sys = 0. ;
-}
-
-void Utils_Timer::ShowAbsolute(){
-#if defined(_DEBUG_) || defined(_DEBUG)
-#ifndef WIN32
- unsigned long Absolute_user = (unsigned long) ((timeval*)RefToCurrentTimeB)->tv_sec ;
-#else
- unsigned long Absolute_user = *RefToCurrentTimeB;
-#endif
- MESSAGE("Absolute time: " << Absolute_user << " seconds ");
-#endif
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : Utils_Timer.hxx
-// Module : SALOME
-//
-#include "SALOME_Utils.hxx"
-
-#include <stdlib.h>
-#include <time.h>
-
-#ifndef WIN32
-# include <sys/times.h>
-# include <sys/time.h>
-# include <unistd.h>
-#else
-# include <windows.h>
-# include <time.h>
-# include <sys/timeb.h>
-#define _POSIX_
-#endif
-
-class UTILS_EXPORT Utils_Timer {
- public:
- Utils_Timer();
- virtual ~Utils_Timer();
- void Start();
- void Stop();
- void Reset();
- void Show();
- void ShowAbsolute();
- protected:
- double Cumul_user;
- double Cumul_sys;
- bool Stopped;
-#ifndef WIN32
- tms *RefToCurrentTMS, *RefToInitialTMS;
- timeval *RefToCurrentTimeB, *RefToInitialTimeB;
-#else
- FILETIME *RefToCurrentTMS, *RefToInitialTMS;
- time_t *RefToCurrentTimeB, *RefToInitialTimeB;
-#endif
-};
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME Utils : general SALOME's definitions and tools
-// File : duplicate.cxx
-// Author : Antoine YESSAYAN, EDF
-// Module : SALOME
-// $Header$
-//
-/*!
- * This function can be changed by strdup() if strdup() is ANSI.
- * It is strongly (and only) used in the Registry environment
- * (RegistryService, RegistryConnexion, Identity, ...)
- */
-extern "C"
-{
-#include <stdlib.h>
-#include <string.h>
-}
-#include "utilities.h"
-#include "OpUtil.hxx"
-
-using namespace std;
-
-const char* duplicate( const char *const str )
-{
- ASSERT(str!=NULL) ;
- const size_t length = strlen( str ) ;
- ASSERT(length>0) ;
- char *new_str = new char[ 1+length ] ;
- ASSERT(new_str) ;
- strcpy( new_str , str ) ;
- return new_str ;
-}
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-from distutils.core import setup, Extension
-
-module1 = Extension('win32pm',
- libraries = ['kernel32'],
- sources = ['win32pm.c'])
-
-setup (name = 'win32pm',
- version = '1.0',
- description = 'Win32 process managment package',
- ext_modules = [module1])
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include <Python.h>
-#include <windows.h>
-
-static PyObject * win32pm_spawnhandle( PyObject *self, PyObject *args )
-{
- char *argv;
- char *flags;
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
- DWORD dwProcessFlags = CREATE_NEW_CONSOLE;
- /* Default value as in Python sources:
- CREATE_NEW_CONSOLE has been known to
- cause random failures on win9x. Specifically a
- dialog:
- "Your program accessed mem currently in use at xxx"
- and a hopeful warning about the stability of your
- system.
- Cost is Ctrl+C wont kill children, but anyone
- who cares can have a go!
- */
-
- if (!PyArg_ParseTuple(args, "s|s", &argv, &flags))
- return NULL;
- if ( flags && !strcmp( flags, "-nc" ) ) // no console
- dwProcessFlags = 0;
-
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof(si);
- ZeroMemory( &pi, sizeof(pi) );
-
- if ( !CreateProcess( NULL, argv,
- NULL, // Process handle not inheritable.
- NULL, // Thread handle not inheritable.
- TRUE,
- dwProcessFlags, // Creation flags.
- NULL, // Use parent's environment block.
- NULL, // Use parent's starting directory.
- &si, // Pointer to STARTUPINFO structure.
- &pi ) ) // Pointer to PROCESS_INFORMATION structure.
- return NULL;
- return Py_BuildValue("i", pi.hProcess);
-}
-
-static PyObject * win32pm_spawnpid( PyObject *self, PyObject *args )
-{
- char* argv;
- char *flags;
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
- DWORD dwProcessFlags = CREATE_NEW_CONSOLE;
- /* Default value as in Python sources:
- CREATE_NEW_CONSOLE has been known to
- cause random failures on win9x. Specifically a
- dialog:
- "Your program accessed mem currently in use at xxx"
- and a hopeful warning about the stability of your
- system.
- Cost is Ctrl+C wont kill children, but anyone
- who cares can have a go!
- */
-
- if (!PyArg_ParseTuple(args, "s|s", &argv, &flags))
- return NULL;
- if ( flags && !strcmp( flags, "-nc" ) ) // no console
- dwProcessFlags = 0;
-
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof(si);
- ZeroMemory( &pi, sizeof(pi) );
-
- if ( !CreateProcess( NULL, argv,
- NULL, // Process handle not inheritable.
- NULL, // Thread handle not inheritable.
- TRUE,
- dwProcessFlags, // Creation flags.
- NULL, // Use parent's environment block.
- NULL, // Use parent's starting directory.
- &si, // Pointer to STARTUPINFO structure.
- &pi ) ) // Pointer to PROCESS_INFORMATION structure.
- return NULL;
- return Py_BuildValue("i", pi.dwProcessId);
-}
-
-static PyObject * win32pm_handle( PyObject *self, PyObject *args )
-{
- int argv1 = 0;
- int argv2 = 0;
- HANDLE ph = 0;
- int pid = 0;
- if (!PyArg_ParseTuple(args, "i|i", &argv1, &argv2))
- return NULL;
- ph = OpenProcess( 1, (BOOL)argv2, argv1 );
- return Py_BuildValue("i", (int)ph );
-}
-
-static PyObject * win32pm_killpid( PyObject *self, PyObject *args )
-{
- int pid = 0;
- int exitCode = 0;
- HANDLE ph = 0;
- BOOL stat = 0;
- if (!PyArg_ParseTuple(args, "i|i", &pid, &exitCode))
- return NULL;
- ph = OpenProcess( 1, 0, pid );
- stat = TerminateProcess( ph, exitCode );
- return Py_BuildValue("i", (int)stat );
-}
-
-static PyObject * win32pm_killhandle( PyObject *self, PyObject *args )
-{
- int phId = 0;
- int exitCode = 0;
- BOOL stat = 0;
- if (!PyArg_ParseTuple(args, "i|i", &phId, &exitCode))
- return NULL;
-
- stat = TerminateProcess( (void*)phId, exitCode );
- return Py_BuildValue("i", (int)stat );
-}
-
-static PyMethodDef win32pmMethods[] = {
- {"spawnhandle", win32pm_spawnhandle, METH_VARARGS,
- "Creates new process. Returns windows handle of new process."},
- {"spawnpid", win32pm_spawnpid, METH_VARARGS,
- "Creates new process. Returns PID of new process."},
- {"handle", win32pm_handle, METH_VARARGS,
- "Returns windows handle of indicated process PID."},
- {"killpid", win32pm_killpid, METH_VARARGS,
- "Terminate process by PID."},
- {"killhandle", win32pm_killhandle, METH_VARARGS,
- "Terminate process by windows process handle."},
- {NULL, NULL, 0, NULL} /* Sentinel */
-};
-
-PyMODINIT_FUNC
-initwin32pm(void)
-{
- Py_InitModule("win32pm", win32pmMethods);
-}